From 8da96a8a8cd7adf77148c890ff479659694c1849 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Wed, 26 Feb 2025 18:14:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/taskinfo/index.ts | 5 +++++ src/views/task/index.vue | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/api/system/taskinfo/index.ts b/src/api/system/taskinfo/index.ts index 0189937..b71e6c3 100644 --- a/src/api/system/taskinfo/index.ts +++ b/src/api/system/taskinfo/index.ts @@ -48,4 +48,9 @@ export const TaskInfoApi = { exportTaskInfo: async (params) => { return await request.download({ url: `/system/task-info/export-excel`, params }) }, + + // 导出任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。 Excel + taskExec: async (data) => { + return await request.put({ url: `/system/task-info/taskExec`, data }) + }, } diff --git a/src/views/task/index.vue b/src/views/task/index.vue index 09b109a..ee2161d 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -178,6 +178,16 @@ > 详情 </el-button> + <el-button + link + type="primary" + @click="taskExec(scope.row)" + v-if="scope.row.status == 1" + v-hasPermi="['system:task-info:update']" + + > + 立即执行 + </el-button> <el-button link type="danger" @@ -271,6 +281,22 @@ const getList = async () => { } } +// 立即执行 +const taskExec = async (data) => { + + loading.value = true + + try { + await TaskInfoApi.taskExec(data) + message.success(t('common.createSuccess')) + getList() + } finally { + loading.value = false + + } + + +} //选择任务中企业范围 const selectEnterprise = async (id: number) => {}