fix: 创建流程取消后 不显示loading

This commit is contained in:
GAOANG
2024-04-28 10:50:10 +08:00
parent 10429dfa9e
commit da8d4b1581
2 changed files with 9 additions and 1 deletions

View File

@ -46,6 +46,7 @@
let _taskId = ''; let _taskId = '';
let _nextNodes = []; let _nextNodes = [];
let _callback = null; let _callback = null;
let _onCancel = null;
const formState = reactive({ const formState = reactive({
nextNodeName: '', nextNodeName: '',
@ -62,7 +63,7 @@
.join('、'); .join('、');
} }
function toggleDialog({ isClose, action, callback, processId, taskId, nextNodes } = {}) { function toggleDialog({ isClose, action, callback, onCancel, processId, taskId, nextNodes } = {}) {
if (isClose) { if (isClose) {
isOpen.value = false; isOpen.value = false;
loading.value = false; loading.value = false;
@ -71,6 +72,7 @@
isOpen.value = true; isOpen.value = true;
_action.value = action; _action.value = action;
_callback = callback; _callback = callback;
_onCancel = onCancel;
_processId = processId; _processId = processId;
_taskId = taskId; _taskId = taskId;
_nextNodes = nextNodes; _nextNodes = nextNodes;
@ -134,6 +136,9 @@
} }
function onClickCancel() { function onClickCancel() {
if (_onCancel && typeof _onCancel === 'function') {
_onCancel();
}
isOpen.value = false; isOpen.value = false;
} }

View File

@ -219,6 +219,9 @@ async function approvalCreate() {
approvalData.approvedContent = args.opinion; approvalData.approvedContent = args.opinion;
approvalData.nextTaskUser = args.nextTaskUser; approvalData.nextTaskUser = args.nextTaskUser;
onFinish({}); onFinish({});
},
onCancel:() => {
loading.value = false
} }
}); });
} }