|
@@ -122,10 +122,13 @@
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-tooltip content="修改" placement="top">
|
|
<el-tooltip content="修改" placement="top">
|
|
|
- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['physical:tournaments:edit']"></el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['physical:tournaments:edit']">修改</el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
<el-tooltip content="删除" placement="top">
|
|
<el-tooltip content="删除" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['physical:tournaments:remove']"></el-button>
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['physical:tournaments:remove']">删除</el-button>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <el-tooltip content="复制" placement="top" v-hasPermi="['business:tournaments:query']">
|
|
|
|
|
+ <el-button link type="primary" icon="Files" @click="handleCopy(scope.row)"> 复制 </el-button>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -997,4 +1000,47 @@ const handlePreviewClick2 = () => {
|
|
|
dialogVisible2.value = true;
|
|
dialogVisible2.value = true;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+/** 修改按钮操作 */
|
|
|
|
|
+const handleCopy = async (row?: TournamentsVO) => {
|
|
|
|
|
+ reset(); // 重置表单
|
|
|
|
|
+ const _id = row?.id || ids.value[0];
|
|
|
|
|
+ const res = await getTournaments(_id);
|
|
|
|
|
+ // 设置表单数据
|
|
|
|
|
+ res.data.id = null;
|
|
|
|
|
+ Object.assign(form.value, res.data);
|
|
|
|
|
+ form.value.signTime = String(res.data.signTime);
|
|
|
|
|
+ form.value.gameType = String(res.data.gameType); // 转为字符串
|
|
|
|
|
+ form.value.status = 0;
|
|
|
|
|
+ form.value.id = null;
|
|
|
|
|
+ form.value.levelDuration = null;
|
|
|
|
|
+
|
|
|
|
|
+ form.value.delayCardTime = res.data.delayCardTime;
|
|
|
|
|
+ form.value.delayCardNum = res.data.delayCardNum;
|
|
|
|
|
+
|
|
|
|
|
+ competitionIcon.value = res.data.competitionIcon;
|
|
|
|
|
+ // 处理奖励表单数据
|
|
|
|
|
+ const prizeItems = res.data.itemsPrizeList || [];
|
|
|
|
|
+ if (prizeItems.length > 0) {
|
|
|
|
|
+ formPrize.rewards = prizeItems.map((item, index) => ({
|
|
|
|
|
+ ranking: item.ranking || index + 1,
|
|
|
|
|
+ itemId: Number(item.itemId),
|
|
|
|
|
+ quantity: Number(item.quantity)
|
|
|
|
|
+ }));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ formPrize.rewards = [
|
|
|
|
|
+ {
|
|
|
|
|
+ ranking: 1,
|
|
|
|
|
+ itemId: null,
|
|
|
|
|
+ quantity: null
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ // ✅ 主动触发盲注等级加载
|
|
|
|
|
+ if (form.value.blindStructureId) {
|
|
|
|
|
+ await handleBlindStructureChange(form.value.blindStructureId);
|
|
|
|
|
+ }
|
|
|
|
|
+ dialog.mode = 'add'; // 设置为新增模式
|
|
|
|
|
+ dialog.visible = true;
|
|
|
|
|
+ dialog.title = '创建比赛';
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|