|
@@ -83,12 +83,8 @@
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="是否默认赛事" prop="isDefault">
|
|
<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-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-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -260,12 +256,7 @@
|
|
<el-table-column label="配置类型" prop="configType" width="150">
|
|
<el-table-column label="配置类型" prop="configType" width="150">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-select v-model="scope.row.configType" placeholder="请选择配置类型" style="width: 100%">
|
|
<el-select v-model="scope.row.configType" placeholder="请选择配置类型" style="width: 100%">
|
|
- <el-option
|
|
|
|
- v-for="type in configTypes"
|
|
|
|
- :key="type.typeCode"
|
|
|
|
- :label="type.typeName"
|
|
|
|
- :value="type.typeCode"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-option v-for="type in configTypes" :key="type.typeCode" :label="type.typeName" :value="type.typeCode" />
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -374,7 +365,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="GameEventEdit" lang="ts">
|
|
<script setup name="GameEventEdit" lang="ts">
|
|
-import { getGameEvent, addGameEvent, updateGameEvent,changeEventDefault } from '@/api/system/gameEvent';
|
|
|
|
|
|
+import { getGameEvent, addGameEvent, updateGameEvent, changeEventDefault } from '@/api/system/gameEvent';
|
|
import { GameEventVO, GameEventForm } from '@/api/system/gameEvent/types';
|
|
import { GameEventVO, GameEventForm } from '@/api/system/gameEvent/types';
|
|
import { listGameEventConfig, addGameEventConfig, updateGameEventConfig, delGameEventConfig } from '@/api/system/gameEventConfig';
|
|
import { listGameEventConfig, addGameEventConfig, updateGameEventConfig, delGameEventConfig } from '@/api/system/gameEventConfig';
|
|
import { GameEventConfigVO, GameEventConfigForm } from '@/api/system/gameEventConfig/types';
|
|
import { GameEventConfigVO, GameEventConfigForm } from '@/api/system/gameEventConfig/types';
|
|
@@ -640,10 +631,10 @@ const loadImageConfigData = async (eventId: string | number) => {
|
|
orderByColumn: '',
|
|
orderByColumn: '',
|
|
isAsc: ''
|
|
isAsc: ''
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
// 获取所有图片配置模板
|
|
// 获取所有图片配置模板
|
|
const allImageConfigs = Array.isArray(templateRes.rows) ? templateRes.rows : [];
|
|
const allImageConfigs = Array.isArray(templateRes.rows) ? templateRes.rows : [];
|
|
-
|
|
|
|
|
|
+
|
|
// 查询当前赛事的图片配置数据(如果是默认赛事,eventId为空字符串)
|
|
// 查询当前赛事的图片配置数据(如果是默认赛事,eventId为空字符串)
|
|
const eventRes = await listGameEventConfig({
|
|
const eventRes = await listGameEventConfig({
|
|
eventId: eventId === '' ? '' : eventId,
|
|
eventId: eventId === '' ? '' : eventId,
|
|
@@ -655,7 +646,7 @@ const loadImageConfigData = async (eventId: string | number) => {
|
|
});
|
|
});
|
|
|
|
|
|
const eventImageConfigs = Array.isArray(eventRes.rows) ? eventRes.rows : [];
|
|
const eventImageConfigs = Array.isArray(eventRes.rows) ? eventRes.rows : [];
|
|
-
|
|
|
|
|
|
+
|
|
// 合并配置:以模板为基础,用当前赛事的数据覆盖
|
|
// 合并配置:以模板为基础,用当前赛事的数据覆盖
|
|
imageConfigItems.value = allImageConfigs.map((template) => {
|
|
imageConfigItems.value = allImageConfigs.map((template) => {
|
|
const existingConfig = eventImageConfigs.find((item) => item.configKey === template.configKey);
|
|
const existingConfig = eventImageConfigs.find((item) => item.configKey === template.configKey);
|
|
@@ -668,7 +659,6 @@ const loadImageConfigData = async (eventId: string | number) => {
|
|
configId: existingConfig?.configId
|
|
configId: existingConfig?.configId
|
|
};
|
|
};
|
|
});
|
|
});
|
|
-
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('加载图片配置数据失败:', error);
|
|
console.error('加载图片配置数据失败:', error);
|
|
proxy?.$modal.msgError('加载图片配置数据失败: ' + (error as Error).message);
|
|
proxy?.$modal.msgError('加载图片配置数据失败: ' + (error as Error).message);
|
|
@@ -718,7 +708,7 @@ const refreshImageConfigs = async () => {
|
|
const saveImageConfigData = async (eventId?: string | number) => {
|
|
const saveImageConfigData = async (eventId?: string | number) => {
|
|
try {
|
|
try {
|
|
// 如果是默认赛事操作,使用空字符串作为eventId
|
|
// 如果是默认赛事操作,使用空字符串作为eventId
|
|
- const targetEventId = eventId === '' ? '' : (eventId || (route.params.id as string));
|
|
|
|
|
|
+ const targetEventId = eventId === '' ? '' : eventId || (route.params.id as string);
|
|
const updates: GameEventConfigForm[] = [];
|
|
const updates: GameEventConfigForm[] = [];
|
|
const adds: GameEventConfigForm[] = [];
|
|
const adds: GameEventConfigForm[] = [];
|
|
|
|
|
|
@@ -864,7 +854,7 @@ const addConfigItem = () => {
|
|
configKey: '',
|
|
configKey: '',
|
|
configValue: '',
|
|
configValue: '',
|
|
configDesc: '',
|
|
configDesc: '',
|
|
- configType: '', // 添加配置类型字段
|
|
|
|
|
|
+ configType: '' // 添加配置类型字段
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
@@ -975,11 +965,11 @@ const saveEvent = async () => {
|
|
|
|
|
|
let savedEventId: string;
|
|
let savedEventId: string;
|
|
// 如果设置为默认赛事,则取消其他赛事的默认状态
|
|
// 如果设置为默认赛事,则取消其他赛事的默认状态
|
|
- if(basicForm.value.isDefault === '0'){
|
|
|
|
- handleStatusChange({
|
|
|
|
- eventId: basicForm.value.eventId,
|
|
|
|
|
|
+ if (basicForm.value.isDefault === '0') {
|
|
|
|
+ handleStatusChange({
|
|
|
|
+ eventId: basicForm.value.eventId,
|
|
isDefault: basicForm.value.isDefault,
|
|
isDefault: basicForm.value.isDefault,
|
|
- eventName: basicForm.value.eventName
|
|
|
|
|
|
+ eventName: basicForm.value.eventName
|
|
} as GameEventVO);
|
|
} as GameEventVO);
|
|
}
|
|
}
|
|
|
|
|