|
@@ -109,15 +109,14 @@
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div style="display: flex; flex-direction: column; gap: 5px">
|
|
<div style="display: flex; flex-direction: column; gap: 5px">
|
|
|
<el-tooltip content="查看" placement="top">
|
|
<el-tooltip content="查看" placement="top">
|
|
|
- <el-button link type="primary" icon="View" @click="handleUpdate(scope.row, 'view')">查看</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="View" @click="openAuditDialog(scope.row.id, 'view')">查看</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip content="编辑" placement="top">
|
|
<el-tooltip content="编辑" placement="top">
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row, 'edit')">编辑</el-button>
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row, 'edit')">编辑</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip content="领奖审核" placement="top">
|
|
<el-tooltip content="领奖审核" placement="top">
|
|
|
- <el-button link type="primary" icon="Edit" @click="openAuditDialog(scope.row.id)">领奖审核</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Edit" @click="openAuditDialog(scope.row.id, 'audit')">领奖审核</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
-
|
|
|
|
|
<!-- <el-tooltip content="分配盲注" placement="top">
|
|
<!-- <el-tooltip content="分配盲注" placement="top">
|
|
|
<el-button link type="success" icon="Document" @click="openAssignDialog(scope.row)"> 分配 </el-button>
|
|
<el-button link type="success" icon="Document" @click="openAssignDialog(scope.row)"> 分配 </el-button>
|
|
|
</el-tooltip>-->
|
|
</el-tooltip>-->
|
|
@@ -361,7 +360,7 @@
|
|
|
@close="cancelAudit"
|
|
@close="cancelAudit"
|
|
|
>
|
|
>
|
|
|
<!-- 查看对局记录按钮 -->
|
|
<!-- 查看对局记录按钮 -->
|
|
|
- <div class="dialog-header-actions">
|
|
|
|
|
|
|
+ <div class="dialog-header-actions" v-if="auditDialog.mode === 'view'">
|
|
|
<el-button type="primary">查看对局记录</el-button>
|
|
<el-button type="primary">查看对局记录</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -369,14 +368,18 @@
|
|
|
<div class="tournament-info" v-if="tournamentInfo.id">
|
|
<div class="tournament-info" v-if="tournamentInfo.id">
|
|
|
<p>比赛时间:{{ tournamentInfo.startTime }} ~ {{ tournamentInfo.endTime }}</p>
|
|
<p>比赛时间:{{ tournamentInfo.startTime }} ~ {{ tournamentInfo.endTime }}</p>
|
|
|
<p>参加人数:{{ tournamentInfo.id }}人</p>
|
|
<p>参加人数:{{ tournamentInfo.id }}人</p>
|
|
|
- <p v-if="tournamentInfo.id">比赛类型:{{ tournamentInfo.id }}</p>
|
|
|
|
|
- <p v-if="tournamentInfo.id">报名条件:{{ tournamentInfo.itemsName }} x {{ tournamentInfo.itemsNum }}</p>
|
|
|
|
|
- <p v-if="tournamentInfo.id">盲注表:{{ tournamentInfo.blindStructuresName }}</p>
|
|
|
|
|
- <p v-if="tournamentInfo.id">报名截止等级:{{ tournamentInfo.lateRegistrationLevel }}</p>
|
|
|
|
|
|
|
+ <p v-if="auditDialog.mode === 'view'">比赛类型:{{ tournamentInfo.id }}</p>
|
|
|
|
|
+ <p v-if="auditDialog.mode === 'view'">报名条件:{{ tournamentInfo.itemsName }} x {{ tournamentInfo.itemsNum }}</p>
|
|
|
|
|
+ <p v-if="auditDialog.mode === 'view'">
|
|
|
|
|
+ 盲注表:{{ tournamentInfo.blindStructuresName }}
|
|
|
|
|
+ <el-button type="primary" @click="handleViewLevelsSee(tournamentInfo)">预览</el-button>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p v-if="auditDialog.mode === 'view'">报名截止等级:{{ tournamentInfo.lateRegistrationLevel }}</p>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 表格内容 -->
|
|
<!-- 表格内容 -->
|
|
|
<el-table :data="auditData" border style="width: 100%">
|
|
<el-table :data="auditData" border style="width: 100%">
|
|
|
|
|
+ <el-table-column prop="id" label="id" align="center" v-if="false"></el-table-column>
|
|
|
<el-table-column prop="rank" label="排名" align="center"></el-table-column>
|
|
<el-table-column prop="rank" label="排名" align="center"></el-table-column>
|
|
|
<el-table-column prop="playerName" label="用户名" align="center"></el-table-column>
|
|
<el-table-column prop="playerName" label="用户名" align="center"></el-table-column>
|
|
|
<el-table-column prop="phone" label="手机" align="center"></el-table-column>
|
|
<el-table-column prop="phone" label="手机" align="center"></el-table-column>
|
|
@@ -394,15 +397,24 @@
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">查看牌局</el-button>
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">查看牌局</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip content="审核" placement="top">
|
|
<el-tooltip content="审核" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">审核</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Audit">审核</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip content="移除" placement="top">
|
|
<el-tooltip content="移除" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">移除</el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleClaimsDelete(scope.row)">移除</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
-
|
|
|
|
|
|
|
+ <!-- 分页组件 -->
|
|
|
|
|
+ <div class="pagination-container" style="margin-top: 20px; text-align: center">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-model:current-page="auditQueryParams.pageNum"
|
|
|
|
|
+ v-model:page-size="auditQueryParams.pageSize"
|
|
|
|
|
+ :total="auditTotal"
|
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
|
+ @current-change="getAuditData"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
<!-- 对话框底部按钮 -->
|
|
<!-- 对话框底部按钮 -->
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
@@ -410,6 +422,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="移除获奖名额" v-model="removeDialog.visible" width="30%">
|
|
|
|
|
+ <span>是否移除用户:{{ removeDialog.playerName }}{{ removeDialog.phone }} 在本次比赛中的获奖名额?</span>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button @click="cancelRemove">取消</el-button>
|
|
|
|
|
+ <el-button type="danger" @click="confirmRemove">确认移除</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -427,7 +449,7 @@ import {
|
|
|
import { selectItemsSelList } from '@/api/system/business/items';
|
|
import { selectItemsSelList } from '@/api/system/business/items';
|
|
|
import { selectBlindLevelsById } from '@/api/system/business/levels';
|
|
import { selectBlindLevelsById } from '@/api/system/business/levels';
|
|
|
import { selectBlingStructuresInfo } from '@/api/system/business/structures';
|
|
import { selectBlingStructuresInfo } from '@/api/system/business/structures';
|
|
|
-import { listClaims } from '@/api/system/business/claims';
|
|
|
|
|
|
|
+import { listClaims, deleteClaim } from '@/api/system/business/claims';
|
|
|
import { TournamentsVO, TournamentsQuery, TournamentsForm, TournamentsBindStructuresVO } from '@/api/system/business/tournaments/types';
|
|
import { TournamentsVO, TournamentsQuery, TournamentsForm, TournamentsBindStructuresVO } from '@/api/system/business/tournaments/types';
|
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
import LevelsIndex from '@/views/system/business/levels/index.vue';
|
|
import LevelsIndex from '@/views/system/business/levels/index.vue';
|
|
@@ -1022,7 +1044,8 @@ const handleSortChange = ({ prop, order }) => {
|
|
|
|
|
|
|
|
const auditDialog = ref({
|
|
const auditDialog = ref({
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- title: ''
|
|
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ mode: 'view' as 'view' | 'audit'
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const tournamentInfo = ref<Partial<TournamentsVO>>({
|
|
const tournamentInfo = ref<Partial<TournamentsVO>>({
|
|
@@ -1038,33 +1061,107 @@ const tournamentInfo = ref<Partial<TournamentsVO>>({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const auditData = ref<ClaimsVO[]>([]);
|
|
const auditData = ref<ClaimsVO[]>([]);
|
|
|
-
|
|
|
|
|
|
|
+// 创建新的查询参数对象,不影响原始 queryParams
|
|
|
|
|
+const auditQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ tournamentId: null as number | null
|
|
|
|
|
+};
|
|
|
|
|
+const auditTotal = ref(0);
|
|
|
// 模拟打开对话框并获取数据
|
|
// 模拟打开对话框并获取数据
|
|
|
-const openAuditDialog = async (tournamentId) => {
|
|
|
|
|
|
|
+const openAuditDialog = async (row: TournamentsVO | number, mode: 'view' | 'audit' = 'view') => {
|
|
|
auditDialog.value.visible = true;
|
|
auditDialog.value.visible = true;
|
|
|
|
|
+ auditDialog.value.mode = mode; // 设置模式
|
|
|
|
|
+
|
|
|
|
|
+ let tournamentId: number;
|
|
|
|
|
+
|
|
|
|
|
+ if (typeof row === 'number') {
|
|
|
|
|
+ tournamentId = row;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ auditQueryParams.tournamentId = tournamentId;
|
|
|
|
|
+ await getAuditData(1);
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
const res = await getTournaments(tournamentId);
|
|
const res = await getTournaments(tournamentId);
|
|
|
- debugger;
|
|
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
tournamentInfo.value = res.data;
|
|
tournamentInfo.value = res.data;
|
|
|
}
|
|
}
|
|
|
- // 创建新的查询参数对象,不影响原始 queryParams
|
|
|
|
|
- const auditQueryParams = {
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- tournamentId: tournamentId
|
|
|
|
|
- };
|
|
|
|
|
- const res2 = await listClaims(auditQueryParams);
|
|
|
|
|
- auditData.value = res2.rows;
|
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取数据失败', error);
|
|
console.error('获取数据失败', error);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+const getAuditData = async (pageNum: number) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ auditQueryParams.pageNum = pageNum;
|
|
|
|
|
+ const res = await listClaims(auditQueryParams);
|
|
|
|
|
+ auditData.value = res.rows;
|
|
|
|
|
+ auditTotal.value = res.total;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取审核数据失败', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
// 关闭对话框
|
|
// 关闭对话框
|
|
|
const cancelAudit = () => {
|
|
const cancelAudit = () => {
|
|
|
auditDialog.value.visible = false;
|
|
auditDialog.value.visible = false;
|
|
|
/*tournamentInfo.value = {};
|
|
/*tournamentInfo.value = {};
|
|
|
auditData.value = [];*/
|
|
auditData.value = [];*/
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+const removeDialog = ref({
|
|
|
|
|
+ visible: false,
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ tournamentId: null,
|
|
|
|
|
+ playerName: '',
|
|
|
|
|
+ phone: ''
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+const handleClaimsDelete = (row: ClaimsVO) => {
|
|
|
|
|
+ removeDialog.value.visible = true;
|
|
|
|
|
+ removeDialog.value.id = row.id; // 假设 row 中有 id 字段
|
|
|
|
|
+ removeDialog.value.tournamentId = row.tournamentId; // 假设 row 中有 tournamentId 字段
|
|
|
|
|
+ removeDialog.value.playerName = row.playerName; // 假设 row 中有 playerName 字段
|
|
|
|
|
+ removeDialog.value.phone = row.phone;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const cancelRemove = () => {
|
|
|
|
|
+ removeDialog.value.visible = false;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const confirmRemove = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await deleteClaim({
|
|
|
|
|
+ id: removeDialog.value.id,
|
|
|
|
|
+ tournamentId: removeDialog.value.tournamentId
|
|
|
|
|
+ });
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ ElMessage.success('移除成功');
|
|
|
|
|
+ // 重新加载审核数据
|
|
|
|
|
+ const auditQueryParams = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ tournamentId: tournamentInfo.value.id
|
|
|
|
|
+ };
|
|
|
|
|
+ const res2 = await listClaims(auditQueryParams);
|
|
|
|
|
+ auditData.value = res2.rows;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error('移除失败,请重试');
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ removeDialog.value.visible = false;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleViewLevelsSee = (tournamentsVO: TournamentsVO | undefined | null) => {
|
|
|
|
|
+ if (!tournamentsVO || !tournamentsVO.blindStructureId) {
|
|
|
|
|
+ proxy?.$modal.msgWarning('该赛事未绑定盲注表');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ dialogParams.value.blindStructureId = tournamentsVO.blindStructureId;
|
|
|
|
|
+ dialogParams.value.name = tournamentsVO.blindStructuresName ?? '';
|
|
|
|
|
+ levelsDialogVisible.value = true;
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|