feat: 增加utask 恢复功能
This commit is contained in:
parent
74ba7e6f97
commit
c384335ebe
|
@ -179,5 +179,13 @@ export default {
|
|||
);
|
||||
}
|
||||
},
|
||||
toggle:{
|
||||
name: "停止/恢复任务",
|
||||
req: async function(id){
|
||||
return await http.post(
|
||||
`${config.API_URL}/pm/utask/${id}/toggle/`
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
|
@ -61,7 +61,7 @@
|
|||
编辑
|
||||
</el-link>
|
||||
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
|
||||
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
|
||||
<el-link type="primary" @click="table_toggle(scope.row)" v-if="scope.row.state==30">终止</el-link>
|
||||
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==20"></el-divider>
|
||||
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==20">
|
||||
删除
|
||||
|
@ -189,8 +189,8 @@
|
|||
编辑
|
||||
</el-link>
|
||||
<el-divider direction="vertical" v-if="scope.row.state == 30 || scope.row.state == 20"></el-divider>
|
||||
<el-link type="danger" @click="table_end(scope.row)"
|
||||
v-if="scope.row.state == 30 || scope.row.state == 20">终止</el-link>
|
||||
<el-link type="danger" @click="table_toggle(scope.row)"
|
||||
v-if="scope.row.state == 30 || scope.row.state == 34">停止/恢复</el-link>
|
||||
<el-divider direction="vertical" v-if="scope.row.state == 10 || scope.row.state == 14"></el-divider>
|
||||
<el-link type="danger" @click="table_del(scope.row)"
|
||||
v-if="scope.row.state == 10 || scope.row.state == 14">
|
||||
|
@ -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("操作成功");
|
||||
|
|
|
@ -178,17 +178,14 @@
|
|||
</template>
|
||||
</el-popconfirm>
|
||||
<el-popconfirm
|
||||
title="确定终止该任务吗?"
|
||||
@confirm.stop="table_stop(scope.row)"
|
||||
v-if="scope.row.state == 30"
|
||||
v-auth="'utask.stop'"
|
||||
title="确定停止/恢复该任务吗?"
|
||||
@confirm.stop="table_toggle(scope.row)"
|
||||
v-if="scope.row.state == 30 || scope.row.state == 34"
|
||||
v-auth="'utask.toggle'"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
v-if="scope.row.state == 30"
|
||||
>终止</el-button
|
||||
<el-button link type="danger"
|
||||
>停/复</el-button
|
||||
>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
|
@ -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("操作成功");
|
||||
|
|
|
@ -185,14 +185,14 @@
|
|||
</template>
|
||||
</el-popconfirm>
|
||||
<el-popconfirm
|
||||
title="确定终止该任务吗?"
|
||||
@confirm.stop="table_stop(scope.row)"
|
||||
v-if="scope.row.state == 30"
|
||||
v-auth="'utask.stop'"
|
||||
title="确定停止/恢复该任务吗?"
|
||||
@confirm.stop="table_toggle(scope.row)"
|
||||
v-if="scope.row.state == 30||scope.row.state == 34"
|
||||
v-auth="'utask.toggle'"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="danger"
|
||||
>终止</el-button
|
||||
>停止/恢复</el-button
|
||||
>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
|
@ -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("操作成功");
|
||||
|
|
|
@ -178,14 +178,14 @@
|
|||
</template>
|
||||
</el-popconfirm>
|
||||
<el-popconfirm
|
||||
title="确定终止该任务吗?"
|
||||
@confirm.stop="table_stop(scope.row)"
|
||||
v-if="scope.row.state == 30"
|
||||
v-auth="'utask.stop'"
|
||||
title="确定停止/恢复该任务吗?"
|
||||
@confirm.stop="table_toggle(scope.row)"
|
||||
v-if="scope.row.state == 30 || scope.row.state == 34"
|
||||
v-auth="'utask.toggle'"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button link type="danger"
|
||||
>终止</el-button
|
||||
>停/复</el-button
|
||||
>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
|
@ -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("操作成功");
|
||||
|
|
Loading…
Reference in New Issue