Преглед изворни кода

feat(system): 优化投诉处理和比赛管理功能

- 在投诉处理中增加自动设置状态为"处理中"的逻辑
- 在比赛管理页面添加自动比赛管理按钮- 优化比赛信息展示和编辑功能
- 调整游戏类型和报名时间字段类型
fugui001 пре 4 месеци
родитељ
комит
894023f5e6

+ 2 - 2
src/api/system/business/tournaments/types.ts

@@ -102,7 +102,7 @@ export interface TournamentsForm extends BaseEntity {
   /**
    * 游戏类型
    */
-  gameType?: number;
+  gameType?: string;
 
   /**
    * 起始记分牌数量
@@ -139,7 +139,7 @@ export interface TournamentsForm extends BaseEntity {
   /**
    * 报名时间
    */
-  signTime?: number;
+  signTime?: string;
 
   /**
    * 道具ID

+ 9 - 0
src/views/system/business/complaints/index.vue

@@ -354,7 +354,16 @@ const handleUpdate = async (row?: ComplaintsVO) => {
   reset();
   const _id = row?.id || ids.value[0];
   const res = await getComplaints(_id);
+  const data = res.data;
   Object.assign(form.value, res.data);
+  // 判断状态:如果是 1,则自动设置为 2(处理中)
+  if (data.status === 1) {
+    form.value.status = 2;
+  } else {
+    // 否则保持接口返回的状态(或其他默认逻辑)
+    form.value.status = data.status;
+    // 或者你希望用户手动选择:form.value.status = null;
+  }
   dialog.visible = true;
   dialog.title = '处理申诉';
 };

+ 15 - 17
src/views/system/business/tournaments/index.vue

@@ -31,11 +31,11 @@
           <el-col :span="1.5">
             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['business:tournaments:add']">创立比赛</el-button>
           </el-col>
-          <el-col :span="1.5">
+          <!--          <el-col :span="1.5">
             <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['business:tournaments:edit']"
               >编辑</el-button
             >
-          </el-col>
+          </el-col>-->
           <!--          <el-col :span="1.5">
             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['business:tournaments:remove']"
               >删除</el-button
@@ -47,11 +47,15 @@
 
           <!-- 新增的 “盲注管理” 按钮 -->
           <el-col :span="1.5">
-            <el-button type="info" plain icon="Operation" v-hasPermi="['business:tournaments:manager']">
+            <el-button type="warning" plain icon="Operation" v-hasPermi="['business:tournaments:manager']">
               <router-link to="/business/structures">盲注表管理</router-link>
             </el-button>
           </el-col>
-
+          <el-col :span="1.5">
+            <el-button type="success" plain icon="Operation" v-hasPermi="['business:tournaments:manager']">
+              <router-link to="/business/config">自动比赛管理</router-link>
+            </el-button>
+          </el-col>
           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
       </template>
@@ -112,7 +116,7 @@
                 <el-button link type="primary" icon="View" @click="openAuditDialog(scope.row.id, 'view')">查看</el-button>
               </el-tooltip>
 
-              <el-tooltip content="编辑" placement="top" v-hasPermi="['business:tournaments:edit']">
+              <el-tooltip content="编辑" v-if="scope.row.status === 0" placement="top" v-hasPermi="['business:tournaments:edit']">
                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row, 'edit')">编辑</el-button>
               </el-tooltip>
 
@@ -788,17 +792,12 @@ const resetFormPrize = () => {
 /** 修改按钮操作 */
 const handleUpdate = async (row?: TournamentsVO, mode: 'edit' | 'view' = 'edit') => {
   reset(); // 重置表单
-
   const _id = row?.id || ids.value[0];
   const res = await getTournaments(_id);
-  // 确保 gameType 是 number 类型
-  const gameType = Number(res.data.gameType);
-  const signTime = Number(res.data.signTime);
   // 设置表单数据
   Object.assign(form.value, res.data);
-  form.value.gameType = gameType; // 确保赋值正确
-  form.value.signTime = signTime;
-
+  form.value.signTime = String(res.data.signTime);
+  form.value.gameType = String(res.data.gameType); // 转为字符串
   competitionIcon.value = res.data.competitionIcon;
   // 处理奖励表单数据
   const prizeItems = res.data.itemsPrizeList || [];
@@ -887,6 +886,8 @@ const handleExport = () => {
 };
 
 onMounted(() => {
+  console.log('tournaments_type:', tournaments_type.value);
+  console.log('tournaments_time:', tournaments_time.value);
   getList();
   loadItemOptions();
   loadItemStructuresOptions();
@@ -1210,14 +1211,11 @@ const handleCopy = async (row?: TournamentsVO) => {
   reset(); // 重置表单
   const _id = row?.id || ids.value[0];
   const res = await getTournaments(_id);
-  // 确保 gameType 是 number 类型
-  const gameType = Number(res.data.gameType);
-  const signTime = Number(res.data.signTime);
   // 设置表单数据
   res.data.id = null;
   Object.assign(form.value, res.data);
-  form.value.gameType = gameType; // 确保赋值正确
-  form.value.signTime = signTime;
+  form.value.signTime = String(res.data.signTime);
+  form.value.gameType = String(res.data.gameType); // 转为字符串
   form.value.status = 0;
   competitionIcon.value = res.data.competitionIcon;
   // 处理奖励表单数据