فهرست منبع

fix(tournaments): 添加删除操作的状态限制条件

- 在删除按钮上添加状态检查,仅当比赛状态为-1或0时允许删除
- 防止已发布或进行中的比赛被误删
- 保持原有的权限控制逻辑不变
fugui 3 روز پیش
والد
کامیت
080d3b876e
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      src/views/system/physical/tournaments/index.vue

+ 6 - 1
src/views/system/physical/tournaments/index.vue

@@ -150,7 +150,12 @@
               <template #dropdown>
                 <el-dropdown-menu style="min-width: 100px; padding: 4px 0">
                   <el-dropdown-item @click="handleUpdate(scope.row)" v-hasPermi="['physical:tournaments:edit']">修改</el-dropdown-item>
-                  <el-dropdown-item @click="handleDelete(scope.row)" v-hasPermi="['physical:tournaments:remove']">删除</el-dropdown-item>
+                   <el-dropdown-item
+                    @click="handleDelete(scope.row)"
+                    v-hasPermi="['physical:tournaments:remove']"
+                    :disabled="!(scope.row.status === -1 || scope.row.status === 0)">
+                    删除
+                  </el-dropdown-item>
                   <el-dropdown-item @click="handleCopy(scope.row)" v-hasPermi="['business:tournaments:query']">复制</el-dropdown-item>
                   <el-dropdown-item @click="handleToggleShow(scope.row)" v-hasPermi="['physical:tournaments:edit']">
                     {{ scope.row.isShow === 1 ? '隐藏' : '展示' }}