同意操作请求过程新增遮罩层

This commit is contained in:
zhaojuncheng
2025-03-11 09:39:30 +08:00
parent f7d3f9823e
commit 48be0e883f

View File

@ -1,4 +1,5 @@
<template> <template>
<a-spin :spinning="spinning" tip="请稍后...">
<div class="page-bg-wrap"> <div class="page-bg-wrap">
<div class="geg-flow-page"> <div class="geg-flow-page">
<div class="top-toolbar"> <div class="top-toolbar">
@ -62,6 +63,7 @@
</a-modal> </a-modal>
</div> </div>
</div> </div>
</a-spin>
</template> </template>
<script setup> <script setup>
@ -85,6 +87,7 @@
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const spinning = ref(false);
const userStore = useUserStore(); const userStore = useUserStore();
const { t } = useI18n(); const { t } = useI18n();
const { notification } = useMessage(); const { notification } = useMessage();
@ -156,6 +159,7 @@
okType: 'danger', okType: 'danger',
cancelText: t('取消'), cancelText: t('取消'),
onOk() { onOk() {
openSpinning();
withdraw(processId.value, drawNode.value).then((res) => { withdraw(processId.value, drawNode.value).then((res) => {
if (res) { if (res) {
notification.open({ notification.open({
@ -170,6 +174,8 @@
description: t('撤回失败') description: t('撤回失败')
}); });
} }
}).finally(()=>{
closeSpinning();
}); });
}, },
onCancel() {} onCancel() {}
@ -190,10 +196,12 @@
} }
async function onApproveClick(isAutoAgreeBreak = false) { async function onApproveClick(isAutoAgreeBreak = false) {
openSpinning();
if (!isAutoAgreeBreak) { if (!isAutoAgreeBreak) {
await submit(); await submit();
} }
if (!validateSuccess.value) { if (!validateSuccess.value) {
closeSpinning();
return; return;
} }
const params = await getApproveParams(); const params = await getApproveParams();
@ -204,6 +212,7 @@
if (isAutoAgreeBreak) { if (isAutoAgreeBreak) {
opinionDlg.value.stopLoading() opinionDlg.value.stopLoading()
} }
closeSpinning();
opinionDlg.value.toggleDialog({ opinionDlg.value.toggleDialog({
action: 'agree', action: 'agree',
nextNodes, nextNodes,
@ -461,4 +470,11 @@
} }
} }
function openSpinning() {
spinning.value = true;
}
function closeSpinning() {
spinning.value = false;
}
</script> </script>