From ae5c7e83726b153c1275d09d6ccd14602a356580 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Sat, 21 Jun 2025 17:20:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(components):=20=E9=9D=A2=E6=9D=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=B5=81=E7=A8=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/workflow/approval-info-panel.vue | 38 ++++++++----------- .../custom/workflow/flow-preview.vue | 30 +++++++++++++++ .../custom/workflow/leave-edit/index.vue | 2 +- src/typings/components.d.ts | 3 +- 4 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 src/components/custom/workflow/flow-preview.vue diff --git a/src/components/custom/workflow/approval-info-panel.vue b/src/components/custom/workflow/approval-info-panel.vue index 48b7d36a..4e7109c7 100644 --- a/src/components/custom/workflow/approval-info-panel.vue +++ b/src/components/custom/workflow/approval-info-panel.vue @@ -20,7 +20,7 @@ const props = defineProps(); useDict('wf_task_status'); -const activeTab = ref('info'); +const activeTab = ref('image'); const { loading, startLoading, endLoading } = useLoading(); @@ -155,8 +155,9 @@ const hisTask = ref([]); /** 初始化数据 */ async function initData() { + activeTab.value = 'image'; + instanceId.value = undefined; hisTask.value = []; - if (loading.value) return; startLoading(); try { await getData(); @@ -166,16 +167,20 @@ async function initData() { } async function getData() { + startLoading(); const { error, data } = await fetchGetFlowHisTaskList(props.businessId); if (error) { window.$message?.error(error.message); return; } instanceId.value = data?.instanceId || ''; - hisTask.value = data?.list || []; - // 并行加载所有附件数据 - const promises = hisTask.value.map(async item => { + const rawList = data?.list || []; + if (rawList.length === 0) { + hisTask.value = []; + return; + } + const promises = rawList.map(async item => { if (item.ext) { const { error: err, data: ossList } = await fetchGetOssListByIds(item.ext.split(',')); if (!err) { @@ -183,8 +188,9 @@ async function getData() { } } }); - await Promise.all(promises); + hisTask.value = rawList; + endLoading(); } defineExpose({ @@ -196,23 +202,11 @@ defineExpose({
- - + + - - "威尔!着火了!快来帮忙!"我听到女朋友大喊。现在一个难题在我面前——是恢复一个重要的 Amazon 服务,还是救公寓的火。 -
-
- 我的脑海中忽然出现了 Amazon - 著名的领导力准则"客户至上",有很多的客户还依赖我们的服务,我不能让他们失望!所以着火也不管了,女朋友喊我也无所谓,我开始 - debug 这个线上问题。 + +
diff --git a/src/components/custom/workflow/flow-preview.vue b/src/components/custom/workflow/flow-preview.vue new file mode 100644 index 00000000..759d3a1d --- /dev/null +++ b/src/components/custom/workflow/flow-preview.vue @@ -0,0 +1,30 @@ + + +