فهرست منبع

feat(system): 业务配置列表增加开启功能

- 新增开启配置功能和相关接口
- 优化业务配置列表,增加根据状态动态显示停止/开始按钮
-修复赛事模板列表删除按钮点击问题
fugui001 4 ماه پیش
والد
کامیت
a78387904b

+ 11 - 0
src/api/system/business/config/index.ts

@@ -118,3 +118,14 @@ export const stopScheduleConfig = (id: string | number): AxiosPromise<ConfigVO>
     method: 'post'
   });
 };
+
+/**
+ * 开启配置
+ * @param id
+ */
+export const startScheduleConfig = (id: string | number): AxiosPromise<ConfigVO> => {
+  return request({
+    url: '/business/config/startScheduleConfig/' + id,
+    method: 'post'
+  });
+};

+ 27 - 7
src/views/system/business/config/index.vue

@@ -117,12 +117,23 @@
             </el-tooltip>
 
             <!-- 停止按钮 -->
-            <el-tooltip content="停止" placement="top">
-              <el-button link type="warning" size="small" @click="handleStop(scope.row)" v-hasPermi="['system:config:remove']">
-                <el-icon><VideoPause /></el-icon>
-                停止
-              </el-button>
-            </el-tooltip>
+            <!-- 动态:停止 或 开始 按钮 -->
+            <template v-if="scope.row.enabled">
+              <!-- 已启用,显示:停止按钮 -->
+              <el-tooltip content="停止" placement="top">
+                <el-button link type="warning" size="small" @click="handleStop(scope.row)" v-hasPermi="['system:config:remove']">
+                  <el-icon><VideoPause /></el-icon> 停止
+                </el-button>
+              </el-tooltip>
+            </template>
+            <template v-else>
+              <!-- 已禁用,显示:开始按钮 -->
+              <el-tooltip content="开始" placement="top">
+                <el-button link type="success" size="small" @click="handleStart(scope.row)" v-hasPermi="['system:config:add']">
+                  <el-icon><VideoPlay /></el-icon> 开始
+                </el-button>
+              </el-tooltip>
+            </template>
 
             <!-- 删除按钮 -->
             <el-tooltip content="删除" placement="top">
@@ -216,7 +227,8 @@ import {
   selectTemplateTourList,
   updateScheduleConfig,
   deleteScheduleConfig,
-  stopScheduleConfig
+  stopScheduleConfig,
+  startScheduleConfig
 } from '@/api/system/business/config';
 import { selectAllCreationSchemesAllList } from '@/api/system/business/scheme';
 import { ConfigVO, ConfigQuery, ConfigForm } from '@/api/system/business/config/types';
@@ -393,6 +405,14 @@ const handleStop = async (row?: ConfigVO) => {
   await getList();
 };
 
+const handleStart = async (row?: ConfigVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否开启排期配置,编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await startScheduleConfig(row.configId);
+  proxy?.$modal.msgSuccess('操作成功');
+  await getList();
+};
+
 /** 导出按钮操作 */
 const handleExport = () => {
   proxy?.download(

+ 0 - 1
src/views/system/business/tournamentsTemplate/index.vue

@@ -727,7 +727,6 @@ const submitForm = () => {
 /** 删除按钮操作 */
 const handleDelete = async (row?: TournamentsVO) => {
   const _ids = row?.id || ids.value;
-  debugger;
   await proxy?.$modal.confirm('是否确认删除【赛事信息】编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
   await delTournaments(_ids);
   proxy?.$modal.msgSuccess('删除成功');