update
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import {Message, Modal, Tag} from "@arco-design/web-vue";
|
||||
import {h} from 'vue';
|
||||
import Api from "../../api/index.js";
|
||||
|
||||
const ModalContent = {
|
||||
props: {
|
||||
@@ -40,13 +39,13 @@ const ModalContent = {
|
||||
}
|
||||
}
|
||||
|
||||
const openTerminateTask = ({type = 'none', status_text = '待上传素材', taskId}) => {
|
||||
const openTerminateTask = ({type = 'none', status_text = '待上传素材', taskId, Api = Api.admin.stopTask, callback}) => {
|
||||
const status = type;
|
||||
|
||||
Modal.warning({
|
||||
title: '确认终止子任务',
|
||||
draggable: true,
|
||||
hideCancel: false,
|
||||
hideCancel: status === 'warning',
|
||||
content: () =>
|
||||
h(
|
||||
ModalContent,
|
||||
@@ -60,8 +59,11 @@ const openTerminateTask = ({type = 'none', status_text = '待上传素材', task
|
||||
},
|
||||
okText: status === 'success' ? '确认终止' : '确认',
|
||||
onOk: async () => {
|
||||
const {code, msg} = await Api.admin.stopTask(taskId);
|
||||
if (code === 1) Message.success(msg);
|
||||
if (status !== 'warning') {
|
||||
const {code, msg} = await Api(taskId);
|
||||
if (code === 1) Message.success(msg);
|
||||
}
|
||||
callback && callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user