From c384335ebe309c59c86cad8fd6b145809376b5e1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 25 Jun 2024 09:13:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0utask=20=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/pm.js | 8 ++++++++ src/views/pm/mtask.vue | 12 ++++++------ src/views/pm/utask_dept10.vue | 19 ++++++++----------- src/views/pm/utask_dept6.vue | 14 +++++++------- src/views/pm/utask_dept7.vue | 14 +++++++------- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/api/model/pm.js b/src/api/model/pm.js index 9880bf3c..894aa937 100644 --- a/src/api/model/pm.js +++ b/src/api/model/pm.js @@ -179,5 +179,13 @@ export default { ); } }, + toggle:{ + name: "停止/恢复任务", + req: async function(id){ + return await http.post( + `${config.API_URL}/pm/utask/${id}/toggle/` + ); + } + }, } } \ No newline at end of file diff --git a/src/views/pm/mtask.vue b/src/views/pm/mtask.vue index 5b09b87b..1cff6fa4 100644 --- a/src/views/pm/mtask.vue +++ b/src/views/pm/mtask.vue @@ -61,7 +61,7 @@ 编辑 - 终止 + 终止 删除 @@ -189,8 +189,8 @@ 编辑 - 终止 + 停止/恢复 @@ -427,12 +427,12 @@ export default { .catch(() => { }); }, //终止 - table_end(row) { - this.$confirm(`确定终止该任务吗?`, "提示", { + table_toggle(row) { + this.$confirm(`确定停止/恢复该任务吗?`, "提示", { type: "warning", }) .then(() => { - this.$API.pm.utask.stop + this.$API.pm.utask.toggle .req(row.id) .then((res) => { this.$message.success("操作成功"); diff --git a/src/views/pm/utask_dept10.vue b/src/views/pm/utask_dept10.vue index d934e9e0..edfbff95 100644 --- a/src/views/pm/utask_dept10.vue +++ b/src/views/pm/utask_dept10.vue @@ -178,17 +178,14 @@ @@ -437,8 +434,8 @@ export default { return err; }); }, - table_stop(row) { - this.$API.pm.utask.stop + table_toggle(row) { + this.$API.pm.utask.toggle .req(row.id) .then((res) => { this.$message.success("操作成功"); diff --git a/src/views/pm/utask_dept6.vue b/src/views/pm/utask_dept6.vue index 16e28a20..b927f7d6 100644 --- a/src/views/pm/utask_dept6.vue +++ b/src/views/pm/utask_dept6.vue @@ -185,14 +185,14 @@ @@ -464,8 +464,8 @@ export default { return err; }); }, - table_stop(row) { - this.$API.pm.utask.stop + table_toggle(row) { + this.$API.pm.utask.toggle .req(row.id) .then((res) => { this.$message.success("操作成功"); diff --git a/src/views/pm/utask_dept7.vue b/src/views/pm/utask_dept7.vue index 1432029f..fa617c4e 100644 --- a/src/views/pm/utask_dept7.vue +++ b/src/views/pm/utask_dept7.vue @@ -178,14 +178,14 @@ @@ -425,8 +425,8 @@ export default { return err; }); }, - table_stop(row) { - this.$API.pm.utask.stop + table_toggle(row) { + this.$API.pm.utask.toggle .req(row.id) .then((res) => { this.$message.success("操作成功");