refactor(workflow): 优化审批组件代码结构
重构审批卡片组件,使用 items 属性替代 DescriptionsItem 子组件 修复 Textarea 组件名称大小写问题 调整样式类顺序保持一致性
This commit is contained in:
parent
58071810d9
commit
b427a77fc1
@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="tsx">
|
||||
import type { DescriptionsProps } from 'antdv-next';
|
||||
|
||||
import type { TaskInfo } from '#/api/workflow/task/model';
|
||||
|
||||
import { computed } from 'vue';
|
||||
@ -6,7 +8,7 @@ import { computed } from 'vue';
|
||||
import { VbenAvatar } from '@vben/common-ui';
|
||||
import { DictEnum } from '@vben/constants';
|
||||
|
||||
import { Descriptions, DescriptionsItem, Tooltip } from 'antdv-next';
|
||||
import { Descriptions, Tooltip } from 'antdv-next';
|
||||
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
@ -33,6 +35,20 @@ function handleClick() {
|
||||
const diffUpdateTimeString = computed(() => {
|
||||
return getDiffTimeString(props.info.updateTime);
|
||||
});
|
||||
|
||||
const items = computed<DescriptionsProps['items']>(() => {
|
||||
const { info } = props;
|
||||
return [
|
||||
{
|
||||
content: <div class="font-bold">{info.nodeName}</div>,
|
||||
label: '当前任务',
|
||||
},
|
||||
{
|
||||
content: info.createTime,
|
||||
label: '提交时间',
|
||||
},
|
||||
];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -45,6 +61,7 @@ const diffUpdateTimeString = computed(() => {
|
||||
>
|
||||
<Descriptions
|
||||
:column="1"
|
||||
:items="items"
|
||||
:title="info.businessTitle ?? info.flowName"
|
||||
size="middle"
|
||||
>
|
||||
@ -53,21 +70,12 @@ const diffUpdateTimeString = computed(() => {
|
||||
:is="renderDict(info.flowStatus, DictEnum.WF_BUSINESS_STATUS)"
|
||||
/>
|
||||
</template>
|
||||
<DescriptionsItem label="当前任务">
|
||||
<div class="font-bold">{{ info.nodeName }}</div>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="提交时间">
|
||||
{{ info.createTime }}
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="更新时间">
|
||||
{{ info.updateTime }}
|
||||
</DescriptionsItem> -->
|
||||
</Descriptions>
|
||||
<div class="flex w-full items-center justify-between text-[14px]">
|
||||
<div class="flex items-center gap-1 overflow-hidden whitespace-nowrap">
|
||||
<VbenAvatar
|
||||
:alt="info?.createByName"
|
||||
class="bg-primary size-[24px] rounded-full text-[10px] text-white"
|
||||
class="size-[24px] rounded-full bg-primary text-[10px] text-white"
|
||||
src=""
|
||||
/>
|
||||
<span class="overflow-hidden text-ellipsis opacity-50">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!-- 审批终止 Modal弹窗的content属性专用 用于填写审批意见 -->
|
||||
<script setup lang="ts">
|
||||
import { Textarea } from 'antdv-next';
|
||||
import { TextArea } from 'antdv-next';
|
||||
|
||||
defineOptions({
|
||||
name: 'ApprovalContent',
|
||||
@ -15,7 +15,7 @@ defineEmits<{ 'update:value': [string] }>();
|
||||
<template>
|
||||
<div class="flex flex-col gap-2">
|
||||
<div>{{ description }}</div>
|
||||
<Textarea
|
||||
<TextArea
|
||||
:allow-clear="true"
|
||||
:auto-size="true"
|
||||
:value="value"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user