refactor: empty占位

This commit is contained in:
dap
2025-08-14 10:02:43 +08:00
parent d8d8ecf308
commit d4df6ba0ac
2 changed files with 206 additions and 192 deletions

View File

@@ -393,6 +393,7 @@ async function handleCopy(text: string) {
</script> </script>
<template> <template>
<div class="w-full">
<Card <Card
v-if="task" v-if="task"
:body-style="{ overflowY: 'auto', height: '100%' }" :body-style="{ overflowY: 'auto', height: '100%' }"
@@ -585,5 +586,8 @@ async function handleCopy(text: string) {
</div> </div>
</div> </div>
</Card> </Card>
<Fallback v-else title="点击左侧选择" /> <slot v-else name="empty">
<Fallback title="点击左侧选择" />
</slot>
</div>
</template> </template>

View File

@@ -6,6 +6,8 @@ import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui'; import { useVbenModal } from '@vben/common-ui';
import { Spin } from 'ant-design-vue';
import { getTaskByBusinessId } from '#/api/workflow/instance'; import { getTaskByBusinessId } from '#/api/workflow/instance';
import { ApprovalPanel } from '.'; import { ApprovalPanel } from '.';
@@ -36,6 +38,14 @@ const [BasicModal, modalApi] = useVbenModal({
<template> <template>
<BasicModal> <BasicModal>
<ApprovalPanel :task="taskInfo" type="readonly" /> <!-- :task="taskInfo" -->
<ApprovalPanel type="readonly">
<template #empty>
<Spin
class="flex h-[200px] w-full items-center justify-center"
size="large"
/>
</template>
</ApprovalPanel>
</BasicModal> </BasicModal>
</template> </template>