|
@@ -29,24 +29,14 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="赛事类型" prop="eventType">
|
|
|
<el-select v-model="basicForm.eventType" placeholder="请选择赛事类型" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="dict in game_event_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-option v-for="dict in game_event_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="用途" prop="purpose">
|
|
|
<el-select v-model="basicForm.purpose" placeholder="请选择用途" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="dict in game_event_purpose"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-option v-for="dict in game_event_purpose" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -94,22 +84,14 @@
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="是否默认赛事" prop="isDefault">
|
|
|
<el-radio-group v-model="basicForm.isDefault">
|
|
|
- <el-radio
|
|
|
- v-for="dict in sys_yes_no"
|
|
|
- :key="dict.value"
|
|
|
- :value="dict.value"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <el-radio v-for="dict in sys_yes_no" :key="dict.value" :value="dict.value">{{ dict.label }} </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-radio-group v-model="basicForm.status">
|
|
|
- <el-radio
|
|
|
- v-for="dict in game_event_status"
|
|
|
- :key="dict.value"
|
|
|
- :value="dict.value"
|
|
|
- >{{ dict.label }}</el-radio>
|
|
|
+ <el-radio v-for="dict in game_event_status" :key="dict.value" :value="dict.value">{{ dict.label }} </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -139,7 +121,6 @@
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="basicForm.remark" type="textarea" placeholder="请输入备注" :rows="3" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
|
|
@@ -150,14 +131,14 @@
|
|
|
<h3>赛事菜单</h3>
|
|
|
<el-button type="primary" @click="addMenuItem" icon="Plus">添加菜单项</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<el-table :data="menuItems" border style="width: 100%">
|
|
|
- <el-table-column label="菜单名称" prop="menuName" width="200">
|
|
|
+ <el-table-column label="菜单名称" prop="menuName">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.menuName" placeholder="请输入菜单名称" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="活动类型" prop="activityStatus" width="200">
|
|
|
+ <el-table-column label="活动类型" prop="activityStatus">
|
|
|
<template #default="scope">
|
|
|
<el-radio-group v-model="scope.row.activityStatus">
|
|
|
<el-radio :value="0">赛前</el-radio>
|
|
@@ -166,17 +147,17 @@
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="图标" prop="icon" width="200">
|
|
|
+ <el-table-column label="图标" prop="icon">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.icon" placeholder="请输入图标" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="颜色" prop="color" width="200">
|
|
|
+ <el-table-column label="颜色" prop="color">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.color" placeholder="请输入颜色" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="是否站外" prop="isFrame" width="200">
|
|
|
+ <el-table-column label="是否站外" prop="isFrame">
|
|
|
<template #default="scope">
|
|
|
<el-radio-group v-model="scope.row.isFrame">
|
|
|
<el-radio :value="1">站内</el-radio>
|
|
@@ -184,19 +165,19 @@
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="链接" prop="siteLink" width="200">
|
|
|
+ <el-table-column label="链接" prop="siteLink">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.siteLink" placeholder="请输入链接" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="排序" prop="orderNum" width="180">
|
|
|
+ <el-table-column label="排序" prop="orderNum">
|
|
|
<template #default="scope">
|
|
|
<el-input-number v-model="scope.row.orderNum" :min="1" :max="999" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" size="small" @click="removeMenuItem(scope.$index)" icon="Delete">删除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="removeMenuItem(scope.$index)" icon="Delete">删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -212,36 +193,26 @@
|
|
|
</div>
|
|
|
|
|
|
<el-table :data="projectItems" border style="width: 100%">
|
|
|
- <el-table-column label="項目类型" prop="projectType" width="180">
|
|
|
+ <el-table-column label="項目类型" prop="projectType">
|
|
|
<template #default="scope">
|
|
|
<el-select v-model="scope.row.projectType" placeholder="请选择項目类型" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="dict in game_project_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ <el-option v-for="dict in game_project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="项目名称" prop="projectName" width="200">
|
|
|
+ <el-table-column label="项目名称" prop="projectName">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.projectName" placeholder="请输入项目名称" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="项目组别" prop="groupType" width="200">
|
|
|
+ <el-table-column label="项目组别" prop="groupType">
|
|
|
<template #default="scope">
|
|
|
<el-select v-model="scope.row.groupType" placeholder="请选择项目组别" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="group in groupItems"
|
|
|
- :key="group.groupId"
|
|
|
- :label="group.groupName"
|
|
|
- :value="group.groupName"
|
|
|
- />
|
|
|
+ <el-option v-for="group in groupItems" :key="group.groupId" :label="group.groupName" :value="group.groupName" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="排序" prop="orderType" width="100">
|
|
|
+ <el-table-column label="排序" prop="orderType">
|
|
|
<template #default="scope">
|
|
|
<el-radio-group v-model="scope.row.orderType">
|
|
|
<el-radio value="0">降序</el-radio>
|
|
@@ -249,24 +220,24 @@
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="比赛地点" prop="location" width="100">
|
|
|
+ <el-table-column label="比赛地点" prop="location">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.location" placeholder="请输入比赛地点" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="录取名次" prop="roundType" width="100">
|
|
|
+ <el-table-column label="录取名次" prop="roundType">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.roundType" placeholder="请输入录取名次" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="分数" prop="scoreValue" width="100">
|
|
|
+ <el-table-column label="分数" prop="scoreValue">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.scoreValue" placeholder="请输入分数" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" size="small" @click="removeProjectItem(scope.$index)" icon="Delete">移除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="removeProjectItem(scope.$index)" icon="Delete">移除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -280,31 +251,31 @@
|
|
|
<h3>赛事配置信息</h3>
|
|
|
<el-button type="primary" @click="addConfigItem" icon="Plus">添加配置</el-button>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<el-table :data="configItems" border style="width: 100%">
|
|
|
- <el-table-column label="配置键" prop="configKey" width="200">
|
|
|
+ <el-table-column label="配置键" prop="configKey">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.configKey" placeholder="请输入配置键" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="配置值" prop="configValue" width="300">
|
|
|
+ <el-table-column label="配置值" prop="configValue">
|
|
|
<template #default="scope">
|
|
|
<image-or-url-input v-model="scope.row.configValue" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="配置描述" prop="configDesc" width="200">
|
|
|
+ <el-table-column label="配置描述" prop="configDesc">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.configDesc" placeholder="请输入配置描述" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column label="是否启用" prop="isEnabled" width="120">
|
|
|
+ <!-- <el-table-column label="是否启用" prop="isEnabled">
|
|
|
<template #default="scope">
|
|
|
<el-switch v-model="scope.row.isEnabled" />
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" size="small" @click="removeConfigItem(scope.$index)" icon="Delete">删除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="removeConfigItem(scope.$index)" icon="Delete">删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -320,24 +291,24 @@
|
|
|
</div>
|
|
|
|
|
|
<el-table :data="teamItems" border style="width: 100%">
|
|
|
- <el-table-column label="单位名称" prop="teamName" width="200">
|
|
|
+ <el-table-column label="单位名称" prop="teamName">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.teamName" placeholder="请输入单位名称" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="编号" prop="teamCode" width="100">
|
|
|
+ <el-table-column label="编号" prop="teamCode">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.teamCode" placeholder="请输入编号" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="团队描述" prop="teamDescribe" width="200">
|
|
|
+ <el-table-column label="团队描述" prop="teamDescribe">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.teamDescribe" placeholder="请描述一下你的团队吧~" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" size="small" @click="removeTeamItem(scope.$index)" icon="Delete">删除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="removeTeamItem(scope.$index)" icon="Delete">删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -353,12 +324,12 @@
|
|
|
</div>
|
|
|
|
|
|
<el-table :data="groupItems" border style="width: 100%">
|
|
|
- <el-table-column label="分组名称" prop="groupName" width="200">
|
|
|
+ <el-table-column label="分组名称" prop="groupName">
|
|
|
<template #default="scope">
|
|
|
<el-input v-model="scope.row.groupName" placeholder="请输入分组名称" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="成员性别" prop="memberGender" width="200">
|
|
|
+ <el-table-column label="成员性别" prop="memberGender">
|
|
|
<template #default="scope">
|
|
|
<el-radio-group v-model="scope.row.memberGender">
|
|
|
<el-radio value="0">不分男女</el-radio>
|
|
@@ -367,9 +338,9 @@
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
+ <el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button type="danger" size="small" @click="removeGroupItem(scope.$index)" icon="Delete">删除</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="removeGroupItem(scope.$index)" icon="Delete">删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -394,18 +365,18 @@ import { GameEventConfigVO, GameEventConfigForm } from '@/api/system/gameEventCo
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { listGameEventMenu, addGameEventMenu, updateGameEventMenu, delGameEventMenu } from '@/api/system/gameEventMenu';
|
|
|
import { GameEventMenuVO, GameEventMenuForm } from '@/api/system/gameEventMenu/types';
|
|
|
-import { listGameTeam, addGameTeam, updateGameTeam,delGameTeam } from '@/api/system/gameTeam';
|
|
|
+import { listGameTeam, addGameTeam, updateGameTeam, delGameTeam } from '@/api/system/gameTeam';
|
|
|
import { GameTeamVO, GameTeamForm } from '@/api/system/gameTeam/types';
|
|
|
import { listGameEventGroup, addGameEventGroup, updateGameEventGroup, delGameEventGroup } from '@/api/system/gameEventGroup';
|
|
|
-import { GameEventGroupForm,GameEventGroupVO } from '@/api/system/gameEventGroup/types';
|
|
|
-import { addGameEventProject, listGameEventProject, updateGameEventProject,delGameEventProject } from '@/api/system/gameEventProject';
|
|
|
+import { GameEventGroupForm, GameEventGroupVO } from '@/api/system/gameEventGroup/types';
|
|
|
+import { addGameEventProject, listGameEventProject, updateGameEventProject, delGameEventProject } from '@/api/system/gameEventProject';
|
|
|
import { GameEventProjectForm, GameEventProjectVO } from '@/api/system/gameEventProject/types';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { game_event_type, game_event_purpose, game_event_status, sys_yes_no,game_project_type } = toRefs<any>(
|
|
|
- proxy?.useDict('game_event_type', 'game_event_purpose', 'game_event_status', 'sys_yes_no','game_project_type')
|
|
|
+const { game_event_type, game_event_purpose, game_event_status, sys_yes_no, game_project_type } = toRefs<any>(
|
|
|
+ proxy?.useDict('game_event_type', 'game_event_purpose', 'game_event_status', 'sys_yes_no', 'game_project_type')
|
|
|
);
|
|
|
|
|
|
// 页面状态
|
|
@@ -434,27 +405,15 @@ const basicForm = ref<GameEventForm>({
|
|
|
remark: ''
|
|
|
});
|
|
|
|
|
|
-
|
|
|
// 表单验证规则
|
|
|
const basicRules = {
|
|
|
- eventCode: [
|
|
|
- { required: true, message: '请输入赛事编号', trigger: 'blur' }
|
|
|
- ],
|
|
|
- eventName: [
|
|
|
- { required: true, message: '请输入赛事名称', trigger: 'blur' }
|
|
|
- ],
|
|
|
- eventType: [
|
|
|
- { required: true, message: '请选择赛事类型', trigger: 'change' }
|
|
|
- ],
|
|
|
- startTime: [
|
|
|
- { required: true, message: '请选择开始时间', trigger: 'change' }
|
|
|
- ],
|
|
|
- endTime: [
|
|
|
- { required: true, message: '请选择结束时间', trigger: 'change' }
|
|
|
- ]
|
|
|
+ eventCode: [{ required: true, message: '请输入赛事编号', trigger: 'blur' }],
|
|
|
+ eventName: [{ required: true, message: '请输入赛事名称', trigger: 'blur' }],
|
|
|
+ eventType: [{ required: true, message: '请选择赛事类型', trigger: 'change' }],
|
|
|
+ startTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
|
|
|
+ endTime: [{ required: true, message: '请选择结束时间', trigger: 'change' }]
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 初始化页面
|
|
|
onMounted(async () => {
|
|
|
const eventId = route.params.id as string;
|
|
@@ -473,10 +432,10 @@ const loadEventData = async (eventId: string) => {
|
|
|
try {
|
|
|
const res = await getGameEvent(eventId);
|
|
|
const data = res.data;
|
|
|
-
|
|
|
+
|
|
|
// 填充基本信息
|
|
|
Object.assign(basicForm.value, data);
|
|
|
-
|
|
|
+
|
|
|
// 加载图片配置数据
|
|
|
try {
|
|
|
await loadImageConfigData(eventId);
|
|
@@ -484,7 +443,7 @@ const loadEventData = async (eventId: string) => {
|
|
|
console.warn('加载图片配置数据失败,继续加载其他数据:', error);
|
|
|
// 不中断其他数据的加载
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
await loadMenuData(eventId); // 加载菜单数据
|
|
|
await loadGroupData(eventId); // 加载分组数据
|
|
|
await loadProjectData(eventId); // 加载项目数据
|
|
@@ -492,13 +451,11 @@ const loadEventData = async (eventId: string) => {
|
|
|
await loadConfigData(eventId); // 加载配置数据
|
|
|
// TODO: 加载菜单、项目、配置数据
|
|
|
// 这里需要调用相应的API来加载数据
|
|
|
-
|
|
|
} catch (error) {
|
|
|
proxy?.$modal.msgError('加载赛事数据失败');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 赛事分组数据
|
|
|
const groupItems = ref<GameEventGroupForm[]>([]);
|
|
|
// 加载项目分组数据
|
|
@@ -520,7 +477,7 @@ const addGroupItem = () => {
|
|
|
groupId: '',
|
|
|
eventId: '',
|
|
|
groupName: '',
|
|
|
- memberGender: '',
|
|
|
+ memberGender: ''
|
|
|
});
|
|
|
};
|
|
|
// 删除赛事分组项
|
|
@@ -583,7 +540,7 @@ const addMenuItem = () => {
|
|
|
isFrame: 1,
|
|
|
siteLink: '',
|
|
|
orderNum: menuItems.value.length + 1,
|
|
|
- eventId: isEdit.value ? route.params.id as string : '' // 关联赛事ID
|
|
|
+ eventId: isEdit.value ? (route.params.id as string) : '' // 关联赛事ID
|
|
|
});
|
|
|
};
|
|
|
// 删除菜单项
|
|
@@ -607,7 +564,7 @@ const saveMenuData = async (eventId: string) => {
|
|
|
// if (!menuData.eventId) {
|
|
|
// menuData.eventId = eventId;
|
|
|
// }
|
|
|
-
|
|
|
+
|
|
|
// console.log('Menu data:', item);
|
|
|
if (item.menuId) {
|
|
|
// 更新现有菜单
|
|
@@ -634,13 +591,13 @@ const loadImageConfigData = async (eventId: string) => {
|
|
|
pageNum: 1,
|
|
|
pageSize: 100
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
// console.log('Template response:', templateRes);
|
|
|
-
|
|
|
+
|
|
|
// 获取所有图片配置模板
|
|
|
const allImageConfigs = Array.isArray(templateRes.rows) ? templateRes.rows : [];
|
|
|
// console.log('All image configs:', allImageConfigs);
|
|
|
-
|
|
|
+
|
|
|
// 查询当前赛事的图片配置数据
|
|
|
const eventRes = await listGameEventConfig({
|
|
|
eventId: eventId,
|
|
@@ -648,14 +605,14 @@ const loadImageConfigData = async (eventId: string) => {
|
|
|
pageNum: 1,
|
|
|
pageSize: 100
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
const eventImageConfigs = Array.isArray(eventRes.rows) ? eventRes.rows : [];
|
|
|
// console.log('Event image configs:', eventImageConfigs);
|
|
|
//console.log('Event image configs:', eventRes);
|
|
|
-
|
|
|
+
|
|
|
// 合并配置:以模板为基础,用当前赛事的数据覆盖
|
|
|
- imageConfigItems.value = allImageConfigs.map(template => {
|
|
|
- const existingConfig = eventImageConfigs.find(item => item.configKey === template.configKey);
|
|
|
+ imageConfigItems.value = allImageConfigs.map((template) => {
|
|
|
+ const existingConfig = eventImageConfigs.find((item) => item.configKey === template.configKey);
|
|
|
return {
|
|
|
...template,
|
|
|
eventId: eventId,
|
|
@@ -665,7 +622,7 @@ const loadImageConfigData = async (eventId: string) => {
|
|
|
configId: existingConfig?.configId
|
|
|
};
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
// console.log('Final image config items:', imageConfigItems.value);
|
|
|
} catch (error) {
|
|
|
console.error('加载图片配置数据失败:', error);
|
|
@@ -697,7 +654,7 @@ const loadImageConfigTemplates = async () => {
|
|
|
const imageData = Array.isArray(res.rows) ? res.rows : []; // 修改此处,确保正确访问数组数据
|
|
|
// console.log('Image data (new mode):', imageData);
|
|
|
|
|
|
- imageConfigItems.value = imageData.map(item => ({
|
|
|
+ imageConfigItems.value = imageData.map((item) => ({
|
|
|
...item,
|
|
|
configValue: item.configValue || '', // 确保 configValue 初始化正确
|
|
|
isEnabled: item.isEnabled || '0', // 确保 isEnabled 初始化正确
|
|
@@ -714,7 +671,7 @@ const loadImageConfigTemplates = async () => {
|
|
|
// 保存图片配置数据
|
|
|
const saveImageConfigData = async (eventId?: string) => {
|
|
|
try {
|
|
|
- const targetEventId = eventId || route.params.id as string;
|
|
|
+ const targetEventId = eventId || (route.params.id as string);
|
|
|
const updates: GameEventConfigForm[] = [];
|
|
|
const adds: GameEventConfigForm[] = [];
|
|
|
|
|
@@ -727,7 +684,7 @@ const saveImageConfigData = async (eventId?: string) => {
|
|
|
configType: 'IMAGE'
|
|
|
};
|
|
|
|
|
|
- if (item.configId && item.configValue) {
|
|
|
+ if (item.configId && item.configValue) {
|
|
|
updates.push(configData);
|
|
|
} else if (!item.configId && item.configValue) {
|
|
|
adds.push(configData);
|
|
@@ -780,7 +737,7 @@ const addProjectItem = () => {
|
|
|
remark: '',
|
|
|
location: '',
|
|
|
scoreValue: '',
|
|
|
- groupType: '',
|
|
|
+ groupType: ''
|
|
|
});
|
|
|
};
|
|
|
// 删除项目项
|
|
@@ -815,7 +772,6 @@ const saveProjectData = async (eventId: string) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 配置信息数据
|
|
|
const configItems = ref<GameEventConfigForm[]>([]);
|
|
|
// 加载赛事配置数据
|
|
@@ -836,7 +792,7 @@ const addConfigItem = () => {
|
|
|
configItems.value.push({
|
|
|
configKey: '',
|
|
|
configValue: '',
|
|
|
- configDesc: '',
|
|
|
+ configDesc: ''
|
|
|
});
|
|
|
};
|
|
|
// 删除配置项
|
|
@@ -871,7 +827,6 @@ const saveconfigData = async (eventId: string) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 参赛队伍数据
|
|
|
const teamItems = ref<GameTeamForm[]>([]);
|
|
|
// 加载队伍数据
|
|
@@ -894,7 +849,7 @@ const addTeamItem = () => {
|
|
|
teamCode: '',
|
|
|
eventId: '',
|
|
|
teamDescribe: '',
|
|
|
- remark: '',
|
|
|
+ remark: ''
|
|
|
});
|
|
|
};
|
|
|
// 删除参赛队伍项
|
|
@@ -939,7 +894,7 @@ const saveEvent = async () => {
|
|
|
|
|
|
// 合并表单数据
|
|
|
const formData: GameEventForm = {
|
|
|
- ...basicForm.value,
|
|
|
+ ...basicForm.value
|
|
|
};
|
|
|
|
|
|
let savedEventId: string;
|
|
@@ -951,7 +906,7 @@ const saveEvent = async () => {
|
|
|
} else {
|
|
|
const addRes = await addGameEvent(formData);
|
|
|
// 假设返回的数据中包含新创建的赛事ID
|
|
|
- savedEventId = addRes.data?.eventId || route.params.id as string;
|
|
|
+ savedEventId = addRes.data?.eventId || (route.params.id as string);
|
|
|
}
|
|
|
|
|
|
// 保存图片配置数据
|
|
@@ -966,13 +921,12 @@ const saveEvent = async () => {
|
|
|
await saveGroupData(savedEventId);
|
|
|
// 保存赛事项目数据
|
|
|
await saveProjectData(savedEventId);
|
|
|
-
|
|
|
+
|
|
|
proxy?.$modal.msgSuccess('保存成功');
|
|
|
-
|
|
|
+
|
|
|
// 保存成功后,设置一个标识,表示需要刷新列表数据
|
|
|
sessionStorage.setItem('needRefreshGameEventList', 'true');
|
|
|
goBack();
|
|
|
-
|
|
|
} catch (error) {
|
|
|
console.error('保存失败:', error);
|
|
|
proxy?.$modal.msgError('保存失败');
|
|
@@ -993,13 +947,13 @@ const goBack = () => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
gap: 16px;
|
|
|
-
|
|
|
+
|
|
|
.page-title {
|
|
|
font-size: 18px;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.menu-config,
|
|
|
.project-config,
|
|
|
.config-info,
|
|
@@ -1012,7 +966,7 @@ const goBack = () => {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
margin-bottom: 16px;
|
|
|
-
|
|
|
+
|
|
|
h3 {
|
|
|
margin: 0;
|
|
|
font-size: 16px;
|
|
@@ -1020,7 +974,7 @@ const goBack = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.image-config {
|
|
|
.config-info {
|
|
|
margin-top: 8px;
|
|
@@ -1029,7 +983,7 @@ const goBack = () => {
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.team-config {
|
|
|
.team-header {
|
|
|
display: flex;
|
|
@@ -1077,4 +1031,4 @@ const goBack = () => {
|
|
|
:deep(.el-form-item) {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|