diff --git a/apps/web-antd/src/views/workflow/components/approval-panel.vue b/apps/web-antd/src/views/workflow/components/approval-panel.vue index 985cca35..16c22855 100644 --- a/apps/web-antd/src/views/workflow/components/approval-panel.vue +++ b/apps/web-antd/src/views/workflow/components/approval-panel.vue @@ -22,11 +22,22 @@ defineOptions({ const props = defineProps<{ task?: TaskInfo }>(); const currentFlowInfo = ref(); +/** + * card的loading状态 + */ +const loading = ref(false); async function handleLoadInfo(task: TaskInfo | undefined) { - if (!task) return null; - const resp = await flowInfo(task.businessId); - currentFlowInfo.value = resp; + try { + if (!task) return null; + loading.value = true; + const resp = await flowInfo(task.businessId); + currentFlowInfo.value = resp; + } catch (error) { + console.error(error); + } finally { + loading.value = false; + } } watch(() => props.task, handleLoadInfo); @@ -38,6 +49,7 @@ onUnmounted(() => (currentFlowInfo.value = undefined));