|
|
@@ -389,13 +389,18 @@
|
|
|
<el-option v-for="item in selectOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item label="晋级条件类型" prop="qualifierType">
|
|
|
- <el-select aria-required="true" v-model="form.qualifierType" placeholder="请选择" :disabled="dialog.mode === 'view'">
|
|
|
+ <el-select
|
|
|
+ aria-required="true"
|
|
|
+ v-model="form.qualifierType"
|
|
|
+ placeholder="请选择"
|
|
|
+ :disabled="dialog.mode === 'view'"
|
|
|
+ @change="handleQualifierTypeChange"
|
|
|
+ >
|
|
|
<el-option v-for="dict in qualifier_type" :key="dict.value" :label="dict.label" :value="dict.value"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="晋级条件值" prop="qualifierValue" v-if="form.qualifierType !== '0'">
|
|
|
+ <el-form-item label="晋级条件值" prop="qualifierValue" v-if="form.qualifierType === '2'">
|
|
|
<el-input v-model="form.qualifierValue" placeholder="请输入晋级条件值" :disabled="dialog.mode === 'view'" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="报名时长" prop="signTime">
|
|
|
@@ -460,6 +465,12 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item label="晋级级别" prop="qualifierValue" v-if="form.qualifierType === '1'">
|
|
|
+ <el-select v-model="form.qualifierValue" placeholder="选项" style="width: 200px" :disabled="dialog.mode === 'view'">
|
|
|
+ <el-option v-for="item in itemOptionsStructuresLevel2" :key="item.id" :label="item.label" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="起始记分牌数量" prop="startingChips">
|
|
|
<el-input v-model="form.startingChips" placeholder="请输入起始记分牌数量" :disabled="dialog.mode === 'view'" />
|
|
|
</el-form-item>
|
|
|
@@ -787,6 +798,13 @@ const loadItemStructuresOptions = async () => {
|
|
|
});
|
|
|
}
|
|
|
itemOptionsStructures.value = list;
|
|
|
+
|
|
|
+ // Automatically select the first option if form is in add mode and no value is set
|
|
|
+ if (!form.value.blindStructureId && list.length > 0) {
|
|
|
+ form.value.blindStructureId = list[0].id;
|
|
|
+ // Trigger the change event to load corresponding levels
|
|
|
+ handleBlindStructureChange(list[0].id);
|
|
|
+ }
|
|
|
} else {
|
|
|
alert('加载失败:' + res.msg);
|
|
|
}
|
|
|
@@ -796,7 +814,7 @@ const loadItemStructuresOptions = async () => {
|
|
|
};
|
|
|
// 下拉选项数据
|
|
|
const itemOptionsStructuresLevel = ref<{ id: number; label: string }[]>([]);
|
|
|
-
|
|
|
+const itemOptionsStructuresLevel2 = ref<{ id: number; label: string }[]>([]);
|
|
|
// 加载报名条件选项
|
|
|
const handleBlindStructureChange = async (value: number) => {
|
|
|
//data.form.lateRegistrationLevel = null;
|
|
|
@@ -814,10 +832,12 @@ const handleBlindStructureChange = async (value: number) => {
|
|
|
});
|
|
|
}
|
|
|
itemOptionsStructuresLevel.value = list;
|
|
|
+ itemOptionsStructuresLevel2.value = list;
|
|
|
// 判断当前选择的 lateRegistrationLevel 是否在新列表中
|
|
|
const currentLevel = data.form.lateRegistrationLevel;
|
|
|
if (currentLevel && !list.some((item) => item.id === currentLevel)) {
|
|
|
data.form.lateRegistrationLevel = null;
|
|
|
+ data.form.lateRegistrationLevel = null;
|
|
|
}
|
|
|
} else {
|
|
|
alert('加载失败:' + res.msg);
|
|
|
@@ -1121,6 +1141,10 @@ const handleAdd = () => {
|
|
|
dialog.visible = true;
|
|
|
dialog.title = '创建比赛';
|
|
|
dialog.mode = 'add'; // 设置模式
|
|
|
+ // Load structures and automatically select first option
|
|
|
+ nextTick(() => {
|
|
|
+ loadItemStructuresOptions();
|
|
|
+ });
|
|
|
};
|
|
|
// 重置函数
|
|
|
const resetFormPrize = () => {
|
|
|
@@ -1158,10 +1182,12 @@ const handleUpdate = async (row?: TournamentsVO, mode: 'edit' | 'view' = 'edit')
|
|
|
}
|
|
|
];
|
|
|
}
|
|
|
-
|
|
|
dialog.visible = true;
|
|
|
dialog.title = mode === 'view' ? '查看比赛' : '编辑比赛';
|
|
|
dialog.mode = mode; // 设置模式
|
|
|
+ nextTick(() => {
|
|
|
+ loadItemStructuresOptions();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
@@ -1686,6 +1712,8 @@ const handleCopy = async (row?: TournamentsVO) => {
|
|
|
res.data.id = null;
|
|
|
Object.assign(form.value, res.data);
|
|
|
form.value.signTime = String(res.data.signTime);
|
|
|
+ form.value.gameVariant = String(res.data.gameVariant);
|
|
|
+ form.value.qualifierType = String(res.data.qualifierType);
|
|
|
form.value.gameType = String(res.data.gameType); // 转为字符串
|
|
|
form.value.status = 0;
|
|
|
form.value.id = null;
|
|
|
@@ -1824,7 +1852,11 @@ const getGameVariantText = (value: string | number | null | undefined): string =
|
|
|
default:
|
|
|
return '未知';
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
+const handleQualifierTypeChange = (value: string) => {
|
|
|
+ // Clear the qualifierValue when qualifierType changes
|
|
|
+ form.value.qualifierValue = null;
|
|
|
+};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.more-rewards {
|