|
@@ -10,6 +10,16 @@
|
|
|
<el-form-item label="队伍编号" prop="teamCode">
|
|
<el-form-item label="队伍编号" prop="teamCode">
|
|
|
<el-input v-model="queryParams.teamCode" placeholder="请输入队伍编号" clearable @keyup.enter="handleQuery" />
|
|
<el-input v-model="queryParams.teamCode" placeholder="请输入队伍编号" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="参与项目" prop="projectId">
|
|
|
|
|
+ <el-select v-model="queryParams.projectId" placeholder="请选择项目" clearable filterable style="width: 200px" >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in projectOptions"
|
|
|
|
|
+ :key="item.projectId"
|
|
|
|
|
+ :label="item.projectName"
|
|
|
|
|
+ :value="item.projectId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
@@ -105,14 +115,10 @@
|
|
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
+
|
|
|
<!-- 添加或修改参赛队伍对话框 -->
|
|
<!-- 添加或修改参赛队伍对话框 -->
|
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
|
|
<el-form ref="gameTeamFormRef" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="gameTeamFormRef" :model="form" :rules="rules" label-width="80px">
|
|
|
- <!-- <el-form-item label="赛事" prop="eventId">
|
|
|
|
|
- <el-select v-model="form.eventId" placeholder="请选择赛事" clearable filterable style="width: 100%">
|
|
|
|
|
- <el-option v-for="option in eventOptions" :key="option.value" :label="option.label" :value="option.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item> -->
|
|
|
|
|
<el-form-item label="队伍名称" prop="teamName">
|
|
<el-form-item label="队伍名称" prop="teamName">
|
|
|
<el-input v-model="form.teamName" placeholder="请输入队伍名称" />
|
|
<el-input v-model="form.teamName" placeholder="请输入队伍名称" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -151,10 +157,6 @@
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
<template #tip>
|
|
<template #tip>
|
|
|
<div class="text-center el-upload__tip">
|
|
<div class="text-center el-upload__tip">
|
|
|
- <!-- <div class="el-upload__tip">-->
|
|
|
|
|
- <!-- <el-checkbox v-model="upload.updateSupport" />-->
|
|
|
|
|
- <!-- 是否更新已经存在的用户数据-->
|
|
|
|
|
- <!-- </div>-->
|
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板 </el-link>
|
|
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板 </el-link>
|
|
|
</div>
|
|
</div>
|
|
@@ -173,29 +175,26 @@
|
|
|
<script setup name="GameTeam" lang="ts">
|
|
<script setup name="GameTeam" lang="ts">
|
|
|
import { listGameTeam, getGameTeam, delGameTeam, addGameTeam, updateGameTeam, moveGroup } from '@/api/system/gameTeam';
|
|
import { listGameTeam, getGameTeam, delGameTeam, addGameTeam, updateGameTeam, moveGroup } from '@/api/system/gameTeam';
|
|
|
import { listRankGroup } from '@/api/system/rankGroup';
|
|
import { listRankGroup } from '@/api/system/rankGroup';
|
|
|
|
|
+import { listGameEventProject } from '@/api/system/gameEventProject';
|
|
|
import { GameTeamVO, GameTeamQuery, GameTeamForm } from '@/api/system/gameTeam/types';
|
|
import { GameTeamVO, GameTeamQuery, GameTeamForm } from '@/api/system/gameTeam/types';
|
|
|
-import { RankGroupVO } from '@/api/system/rankGroup/types';
|
|
|
|
|
|
|
+import { GameEventProjectVO } from '@/api/system/gameEventProject/types';
|
|
|
import { globalHeaders } from '@/utils/request';
|
|
import { globalHeaders } from '@/utils/request';
|
|
|
-import { GameEventVO } from '@/api/system/gameEvent/types';
|
|
|
|
|
-import { orderBy } from 'element-plus/es/components/table/src/util';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
|
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
|
|
|
-const defaultEvent = ref<GameEventVO | null>(null); // 默认赛事信息
|
|
|
|
|
|
|
|
|
|
const gameTeamList = ref<GameTeamVO[]>([]);
|
|
const gameTeamList = ref<GameTeamVO[]>([]);
|
|
|
const buttonLoading = ref(false);
|
|
const buttonLoading = ref(false);
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
-const showSearch = ref(true);
|
|
|
|
|
const ids = ref<Array<string | number>>([]);
|
|
const ids = ref<Array<string | number>>([]);
|
|
|
const single = ref(true);
|
|
const single = ref(true);
|
|
|
const multiple = ref(true);
|
|
const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
-const eventOptions = ref<Array<{ label: string; value: string | number }>>([]);
|
|
|
|
|
|
|
|
|
|
-// 新增:排名分组相关
|
|
|
|
|
|
|
+// 排名分组相关
|
|
|
const rankGroupOptions = ref<Array<{ label: string; value: string | number }>>([]);
|
|
const rankGroupOptions = ref<Array<{ label: string; value: string | number }>>([]);
|
|
|
const selectedRankGroupId = ref<number | null>(null);
|
|
const selectedRankGroupId = ref<number | null>(null);
|
|
|
|
|
+const projectOptions = ref<GameEventProjectVO[]>([]);
|
|
|
|
|
|
|
|
// 列显隐数据
|
|
// 列显隐数据
|
|
|
const columns = ref<FieldOption[]>([
|
|
const columns = ref<FieldOption[]>([
|
|
@@ -203,7 +202,7 @@ const columns = ref<FieldOption[]>([
|
|
|
{ key: 1, label: '队伍编号', visible: true },
|
|
{ key: 1, label: '队伍编号', visible: true },
|
|
|
{ key: 2, label: '赛事名称', visible: false },
|
|
{ key: 2, label: '赛事名称', visible: false },
|
|
|
{ key: 3, label: '队伍名称', visible: true },
|
|
{ key: 3, label: '队伍名称', visible: true },
|
|
|
- { key: 4, label: '排名分组名', visible: true }, // 新增
|
|
|
|
|
|
|
+ { key: 4, label: '排名分组名', visible: true },
|
|
|
{ key: 5, label: '团队描述', visible: true },
|
|
{ key: 5, label: '团队描述', visible: true },
|
|
|
{ key: 6, label: '领队', visible: true },
|
|
{ key: 6, label: '领队', visible: true },
|
|
|
{ key: 7, label: '人数', visible: true },
|
|
{ key: 7, label: '人数', visible: true },
|
|
@@ -224,22 +223,17 @@ const dialog = reactive<DialogOption>({
|
|
|
|
|
|
|
|
/*** 用户导入参数 */
|
|
/*** 用户导入参数 */
|
|
|
const upload = reactive<ImportOption>({
|
|
const upload = reactive<ImportOption>({
|
|
|
- // 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
open: false,
|
|
|
- // 弹出层标题(用户导入)
|
|
|
|
|
title: '',
|
|
title: '',
|
|
|
- // 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
isUploading: false,
|
|
|
- // 是否更新已经存在的用户数据
|
|
|
|
|
updateSupport: 0,
|
|
updateSupport: 0,
|
|
|
- // 设置上传的请求头部
|
|
|
|
|
headers: globalHeaders(),
|
|
headers: globalHeaders(),
|
|
|
- // 上传的地址
|
|
|
|
|
url: import.meta.env.VITE_APP_BASE_API + '/system/gameTeam/import'
|
|
url: import.meta.env.VITE_APP_BASE_API + '/system/gameTeam/import'
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
const initFormData: GameTeamForm = {
|
|
const initFormData: GameTeamForm = {
|
|
|
eventId: undefined,
|
|
eventId: undefined,
|
|
|
- rgId:undefined,
|
|
|
|
|
|
|
+ rgId: undefined,
|
|
|
teamName: undefined,
|
|
teamName: undefined,
|
|
|
teamCode: undefined,
|
|
teamCode: undefined,
|
|
|
leader: undefined,
|
|
leader: undefined,
|
|
@@ -252,54 +246,26 @@ const initFormData: GameTeamForm = {
|
|
|
remark: undefined,
|
|
remark: undefined,
|
|
|
athleteList: []
|
|
athleteList: []
|
|
|
};
|
|
};
|
|
|
-const data = reactive<PageData<GameTeamForm, GameTeamQuery>>({
|
|
|
|
|
|
|
+
|
|
|
|
|
+const data = reactive<PageData<GameTeamForm, GameTeamQuery> & { showSearch: boolean }>({
|
|
|
form: { ...initFormData },
|
|
form: { ...initFormData },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
eventId: undefined,
|
|
eventId: undefined,
|
|
|
|
|
+ projectId: undefined,
|
|
|
orderByColumn: undefined,
|
|
orderByColumn: undefined,
|
|
|
isAsc: undefined
|
|
isAsc: undefined
|
|
|
- // teamName: undefined,
|
|
|
|
|
- // teamCode: undefined,
|
|
|
|
|
- // leader: undefined,
|
|
|
|
|
- // athleteValue: undefined,
|
|
|
|
|
- // projectValue: undefined,
|
|
|
|
|
- // athleteNum: undefined,
|
|
|
|
|
- // numberRange: undefined,
|
|
|
|
|
- // teamDescribe: undefined,
|
|
|
|
|
- // status: undefined,
|
|
|
|
|
- // params: {
|
|
|
|
|
- // }
|
|
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
teamName: [{ required: true, message: '队伍名称不能为空', trigger: 'blur' }],
|
|
teamName: [{ required: true, message: '队伍名称不能为空', trigger: 'blur' }],
|
|
|
teamCode: [{ required: true, message: '队伍编号不能为空', trigger: 'blur' }],
|
|
teamCode: [{ required: true, message: '队伍编号不能为空', trigger: 'blur' }],
|
|
|
teamDescribe: [{ required: true, message: '团队描述不能为空', trigger: 'blur' }]
|
|
teamDescribe: [{ required: true, message: '团队描述不能为空', trigger: 'blur' }]
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ showSearch: true
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
-
|
|
|
|
|
-// // 添加额外的ref用于处理默认事件ID
|
|
|
|
|
-// const defaultEventId = computed(() => defaultEvent.value?.eventId);
|
|
|
|
|
-// // 监听默认事件变化
|
|
|
|
|
-// watchEffect(() => {
|
|
|
|
|
-// if (defaultEventId.value) {
|
|
|
|
|
-// form.value.eventId = defaultEventId.value;
|
|
|
|
|
-// queryParams.value.eventId = defaultEventId.value;
|
|
|
|
|
-// }
|
|
|
|
|
-// });
|
|
|
|
|
-
|
|
|
|
|
-/** 获取默认赛事 */
|
|
|
|
|
-// const getDefaultEventInfo = async () => {
|
|
|
|
|
-// try {
|
|
|
|
|
-// const res = await getDefaultEvent();
|
|
|
|
|
-// defaultEvent.value = res.data;
|
|
|
|
|
-// } catch (error) {
|
|
|
|
|
-// proxy?.$modal.msgError('获取默认赛事信息失败');
|
|
|
|
|
-// }
|
|
|
|
|
-// };
|
|
|
|
|
|
|
+const { queryParams, form, rules, showSearch } = toRefs(data);
|
|
|
|
|
|
|
|
const rankGroupMap = computed(() => {
|
|
const rankGroupMap = computed(() => {
|
|
|
const map = new Map();
|
|
const map = new Map();
|
|
@@ -308,14 +274,9 @@ const rankGroupMap = computed(() => {
|
|
|
});
|
|
});
|
|
|
return map;
|
|
return map;
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
/** 查询参赛队伍列表 */
|
|
/** 查询参赛队伍列表 */
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
- // if (!queryParams.value.eventId) {
|
|
|
|
|
- // proxy?.$modal.msgWarning('未获取到默认赛事信息');
|
|
|
|
|
- // loading.value = false;
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
const res = await listGameTeam(queryParams.value);
|
|
const res = await listGameTeam(queryParams.value);
|
|
|
gameTeamList.value = res.rows;
|
|
gameTeamList.value = res.rows;
|
|
@@ -323,19 +284,6 @@ const getList = async () => {
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 获取赛事选项列表 */
|
|
|
|
|
-// const getEventOptions = async () => {
|
|
|
|
|
-// try {
|
|
|
|
|
-// const res = await getEventIdNameMap();
|
|
|
|
|
-// eventOptions.value = Object.entries(res.data).map(([key, value]) => ({
|
|
|
|
|
-// label: key as string,
|
|
|
|
|
-// value: value as string | number
|
|
|
|
|
-// }));
|
|
|
|
|
-// } catch (error) {
|
|
|
|
|
-// console.error('获取赛事列表失败:', error);
|
|
|
|
|
-// }
|
|
|
|
|
-// };
|
|
|
|
|
-
|
|
|
|
|
/** 取消按钮 */
|
|
/** 取消按钮 */
|
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
|
reset();
|
|
reset();
|
|
@@ -357,8 +305,6 @@ const handleQuery = () => {
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
queryFormRef.value?.resetFields();
|
|
queryFormRef.value?.resetFields();
|
|
|
- // 保留默认赛事ID
|
|
|
|
|
- // queryParams.value.eventId = defaultEvent.value?.eventId;
|
|
|
|
|
handleQuery();
|
|
handleQuery();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -368,18 +314,17 @@ const handleSelectionChange = (selection: GameTeamVO[]) => {
|
|
|
single.value = selection.length != 1;
|
|
single.value = selection.length != 1;
|
|
|
multiple.value = !selection.length;
|
|
multiple.value = !selection.length;
|
|
|
|
|
|
|
|
- // 如果没有选中队伍,清空选择的分组
|
|
|
|
|
if (selection.length === 0) {
|
|
if (selection.length === 0) {
|
|
|
selectedRankGroupId.value = null;
|
|
selectedRankGroupId.value = null;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 新增:获取排名分组选项列表 */
|
|
|
|
|
|
|
+/** 获取排名分组选项列表 */
|
|
|
const getRankGroupOptions = async () => {
|
|
const getRankGroupOptions = async () => {
|
|
|
try {
|
|
try {
|
|
|
const res = await listRankGroup({
|
|
const res = await listRankGroup({
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- pageSize: 1000, // 获取所有排名分组
|
|
|
|
|
|
|
+ pageSize: 1000,
|
|
|
eventId: queryParams.value.eventId,
|
|
eventId: queryParams.value.eventId,
|
|
|
orderByColumn: undefined,
|
|
orderByColumn: undefined,
|
|
|
isAsc: undefined,
|
|
isAsc: undefined,
|
|
@@ -393,7 +338,24 @@ const getRankGroupOptions = async () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/** 新增:移动分组操作 */
|
|
|
|
|
|
|
+/** 获取项目选项列表 */
|
|
|
|
|
+const getProjectOptions = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await listGameEventProject({
|
|
|
|
|
+ eventId: queryParams.value.eventId,
|
|
|
|
|
+ classification: '1',
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 1000,
|
|
|
|
|
+ orderByColumn: undefined,
|
|
|
|
|
+ isAsc: undefined,
|
|
|
|
|
+ });
|
|
|
|
|
+ projectOptions.value = res.rows;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取项目列表失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** 移动分组操作 */
|
|
|
const handleMoveGroup = async () => {
|
|
const handleMoveGroup = async () => {
|
|
|
if (!selectedRankGroupId.value) {
|
|
if (!selectedRankGroupId.value) {
|
|
|
proxy?.$modal.msgWarning('请选择目标排名分组');
|
|
proxy?.$modal.msgWarning('请选择目标排名分组');
|
|
@@ -407,13 +369,11 @@ const handleMoveGroup = async () => {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await proxy?.$modal.confirm(`确认将选中的 ${ids.value.length} 个队伍移动到选定的排名分组吗?`);
|
|
await proxy?.$modal.confirm(`确认将选中的 ${ids.value.length} 个队伍移动到选定的排名分组吗?`);
|
|
|
-
|
|
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
await moveGroup({
|
|
await moveGroup({
|
|
|
teamIds: ids.value,
|
|
teamIds: ids.value,
|
|
|
rgId: selectedRankGroupId.value
|
|
rgId: selectedRankGroupId.value
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
proxy?.$modal.msgSuccess('移动分组成功');
|
|
proxy?.$modal.msgSuccess('移动分组成功');
|
|
|
selectedRankGroupId.value = null;
|
|
selectedRankGroupId.value = null;
|
|
|
await getList();
|
|
await getList();
|
|
@@ -461,8 +421,9 @@ const submitForm = () => {
|
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (row?: GameTeamVO) => {
|
|
const handleDelete = async (row?: GameTeamVO) => {
|
|
|
const _teamIds = row?.teamId || ids.value;
|
|
const _teamIds = row?.teamId || ids.value;
|
|
|
- await proxy?.$modal.confirm('是否确认删除参赛队伍编号为"' + _teamIds + '"的数据项?').finally(() => (loading.value = false));
|
|
|
|
|
- await delGameTeam(_teamIds);
|
|
|
|
|
|
|
+ await proxy?.$modal.confirm('是否确认删除参赛队伍ID为"' + _teamIds + '"的数据项?');
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ await delGameTeam(_teamIds).finally(() => loading.value = false);
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
await getList();
|
|
await getList();
|
|
|
};
|
|
};
|
|
@@ -484,13 +445,13 @@ const handleImport = () => {
|
|
|
upload.open = true;
|
|
upload.open = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/**文件上传中处理 */
|
|
|
|
|
|
|
+/** 文件上传中处理 */
|
|
|
const handleFileUploadProgress = () => {
|
|
const handleFileUploadProgress = () => {
|
|
|
upload.isUploading = true;
|
|
upload.isUploading = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/** 文件上传成功处理 */
|
|
/** 文件上传成功处理 */
|
|
|
-const handleFileSuccess = (response: any, file: UploadFile) => {
|
|
|
|
|
|
|
+const handleFileSuccess = (response: any, file: any) => {
|
|
|
upload.open = false;
|
|
upload.open = false;
|
|
|
upload.isUploading = false;
|
|
upload.isUploading = false;
|
|
|
uploadRef.value?.handleRemove(file);
|
|
uploadRef.value?.handleRemove(file);
|
|
@@ -507,11 +468,12 @@ function submitFileForm() {
|
|
|
|
|
|
|
|
/** 下载模板操作 */
|
|
/** 下载模板操作 */
|
|
|
const importTemplate = () => {
|
|
const importTemplate = () => {
|
|
|
- proxy?.download('system/gameTeam/importTemplate', {}, `game_event_template_${new Date().getTime()}.xlsx`);
|
|
|
|
|
|
|
+ proxy?.download('system/gameTeam/importTemplate', {}, `参赛队伍_${new Date().getTime()}.xlsx`);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getList();
|
|
getList();
|
|
|
- getRankGroupOptions(); // 新增
|
|
|
|
|
|
|
+ getRankGroupOptions();
|
|
|
|
|
+ getProjectOptions();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|