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..60b0da2f 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..0d4a79eb 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("操作成功");