|
|
@@ -152,6 +152,12 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="玩法类型" align="center" prop="gameVariant">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ getGameVariantText(scope.row.gameVariant) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<!-- <el-table-column label="是否删除" align="center">
|
|
|
<template #default="scope">
|
|
|
<span
|
|
|
@@ -172,7 +178,7 @@
|
|
|
<el-tooltip content="复制" placement="top" v-hasPermi="['business:tournaments:copy']">
|
|
|
<el-button link type="primary" icon="Files" @click="handleCopy(scope.row)"> 复制 </el-button>
|
|
|
</el-tooltip>
|
|
|
-<!-- <el-tooltip content="恢复" placement="top">
|
|
|
+ <!-- <el-tooltip content="恢复" placement="top">
|
|
|
<el-button link type="primary" icon="Files" @click="handleRecoverTournament(scope.row)" v-hasPermi="['business:tournaments:query']"
|
|
|
>恢复</el-button
|
|
|
>
|
|
|
@@ -364,7 +370,34 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="玩法类型" prop="gameVariant">
|
|
|
+ <el-select aria-required="true" v-model="form.gameVariant" placeholder="请选择" :disabled="dialog.mode === 'view'">
|
|
|
+ <el-option v-for="dict in game_variant_type" :key="dict.value" :label="dict.label" :value="dict.value"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="目标锦标赛" prop="targetTournamentId">
|
|
|
+ <el-select
|
|
|
+ v-model="form.targetTournamentId"
|
|
|
+ placeholder="请选择比赛"
|
|
|
+ :disabled="dialog.mode === 'view'"
|
|
|
+ @visible-change="handleSelectVisibleChange"
|
|
|
+ remote
|
|
|
+ :remote-method="remoteMethod"
|
|
|
+ :loading="selectLoading"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <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-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-input v-model="form.qualifierValue" placeholder="请输入晋级条件值" :disabled="dialog.mode === 'view'" />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="报名时长" prop="signTime">
|
|
|
<el-select v-model="form.signTime" placeholder="请选择" :disabled="dialog.mode === 'view'">
|
|
|
<el-option v-for="dict in tournaments_time" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
|
|
@@ -651,8 +684,8 @@ import { ref } from 'vue';
|
|
|
import LevelsIndex from '@/views/system/business/levels/index.vue';
|
|
|
import { ClaimsVO } from '@/api/system/business/claims/types';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { tournaments_type, tournaments_time, tournaments_status } = toRefs<any>(
|
|
|
- proxy?.useDict('tournaments_type', 'tournaments_time', 'tournaments_status')
|
|
|
+const { tournaments_type, tournaments_time, tournaments_status, game_variant_type, qualifier_type } = toRefs<any>(
|
|
|
+ proxy?.useDict('tournaments_type', 'tournaments_time', 'tournaments_status', 'game_variant_type', 'qualifier_type')
|
|
|
);
|
|
|
|
|
|
const tournamentsList = ref<TournamentsVO[]>([]);
|
|
|
@@ -845,6 +878,7 @@ const competitionBg = ref('');
|
|
|
const fileList2 = ref([]);
|
|
|
|
|
|
import { parseTime } from '@/utils/dateUtils';
|
|
|
+import { ElSelect } from 'element-plus';
|
|
|
// 单选控制变量(用于绑定 el-radio)
|
|
|
const selectedRadio = ref<number | null>(null);
|
|
|
|
|
|
@@ -867,6 +901,8 @@ const initFormData: TournamentsForm = {
|
|
|
name: undefined,
|
|
|
startTime: undefined,
|
|
|
gameType: undefined,
|
|
|
+ gameVariant: null,
|
|
|
+ qualifierType: '0',
|
|
|
startingChips: undefined,
|
|
|
levelDuration: undefined,
|
|
|
lateRegistrationLevel: undefined,
|
|
|
@@ -907,6 +943,8 @@ const data = reactive<PageData<TournamentsForm, TournamentsQuery>>({
|
|
|
name: [{ required: true, message: '赛事名称不能为空', trigger: 'blur' }],
|
|
|
startTime: [{ required: true, message: '比赛开始时间不能为空', trigger: 'blur' }],
|
|
|
gameType: [{ required: true, message: '游戏类型不能为空', trigger: 'change' }],
|
|
|
+ gameVariant: [{ required: true, message: '玩法类型不能为空', trigger: 'change' }],
|
|
|
+ qualifierType: [{ required: true, message: '晋级条件类型不能为空', trigger: 'change' }],
|
|
|
lateRegistrationLevel: [{ required: true, message: '截止报名级别不能为空', trigger: 'change' }],
|
|
|
signTime: [{ required: true, message: '报名时间不能为空', trigger: 'change' }],
|
|
|
itemsId: [{ required: true, message: '报名条件不能为空', trigger: 'change' }],
|
|
|
@@ -1098,6 +1136,8 @@ const handleUpdate = async (row?: TournamentsVO, mode: 'edit' | 'view' = 'edit')
|
|
|
// 设置表单数据
|
|
|
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); // 转为字符串
|
|
|
competitionIcon.value = res.data.competitionIcon;
|
|
|
competitionBg.value = res.data.competitionBg;
|
|
|
@@ -1262,6 +1302,9 @@ onMounted(() => {
|
|
|
getList();
|
|
|
loadItemOptions();
|
|
|
loadItemStructuresOptions();
|
|
|
+
|
|
|
+ // 直接调用 loadSelectData 来加载初始数据
|
|
|
+ loadSelectData('');
|
|
|
});
|
|
|
|
|
|
async function getAssignList() {
|
|
|
@@ -1717,6 +1760,71 @@ const isProdEnvironment = computed(() => {
|
|
|
// 根据实际项目中的环境变量判断是否为正式环境
|
|
|
return import.meta.env.MODE === 'production' || import.meta.env.VITE_APP_ENV === 'prod';
|
|
|
});
|
|
|
+// 在 setup 中添加
|
|
|
+const selectOptions = ref<TournamentsVO[]>([]);
|
|
|
+const selectLoading = ref(false);
|
|
|
+const selectPageNum = ref(1);
|
|
|
+const selectPageSize = ref(30); // 每页数量
|
|
|
+const selectTotal = ref(0);
|
|
|
+// 远程搜索方法
|
|
|
+const remoteMethod = async (query: string) => {
|
|
|
+ if (query !== '') {
|
|
|
+ selectPageNum.value = 1;
|
|
|
+ await loadSelectData(query);
|
|
|
+ } else {
|
|
|
+ selectOptions.value = [];
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 加载数据(支持分页)
|
|
|
+const loadSelectData = async (query: string) => {
|
|
|
+ selectLoading.value = true;
|
|
|
+ const params = {
|
|
|
+ pageNum: selectPageNum.value,
|
|
|
+ pageSize: selectPageSize.value,
|
|
|
+ status: 0, // 只查 status=0
|
|
|
+ name: query, // 搜索关键词
|
|
|
+ sortBy: 'name',
|
|
|
+ isAsc: true
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ const res = await listTournaments(params);
|
|
|
+ const rows = res.rows || [];
|
|
|
+ if (selectPageNum.value === 1) {
|
|
|
+ selectOptions.value = rows;
|
|
|
+ } else {
|
|
|
+ selectOptions.value.push(...rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ selectTotal.value = res.total;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('加载比赛列表失败:', error);
|
|
|
+ } finally {
|
|
|
+ selectLoading.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 监听下拉框展开时触发加载
|
|
|
+const handleSelectVisibleChange = async (visible: boolean) => {
|
|
|
+ if (visible && selectOptions.value.length === 0) {
|
|
|
+ await remoteMethod('');
|
|
|
+ }
|
|
|
+};
|
|
|
+// 添加游戏玩法类型文本转换函数
|
|
|
+const getGameVariantText = (value: string | number | null | undefined): string => {
|
|
|
+ const numValue = Number(value);
|
|
|
+ switch (numValue) {
|
|
|
+ case 0:
|
|
|
+ return '德州扑克';
|
|
|
+ case 1:
|
|
|
+ return '奥马哈';
|
|
|
+ case 2:
|
|
|
+ return '短牌';
|
|
|
+ default:
|
|
|
+ return '未知';
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.more-rewards {
|