fix: 优化待办任务摘要字段的渲染方式

pull/113/head
子夜 2025-05-24 16:43:44 +08:00
parent e1434c7b2d
commit 7762059537
2 changed files with 25 additions and 24 deletions

View File

@ -2,6 +2,8 @@ import type { VbenFormSchema } from '#/adapter/form';
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
import type { BpmTaskApi } from '#/api/bpm/task';
import { h } from 'vue';
import { useAccess } from '@vben/access';
import { getCategorySimpleList } from '#/api/bpm/category';
@ -82,7 +84,28 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
title: '摘要',
minWidth: 200,
slots: {
default: 'slot-summary',
default: ({ row }) => {
const summary = row?.processInstance?.summary;
if (!summary || summary.length === 0) {
return '-';
}
return summary.map((item: any) => {
return h(
'div',
{
key: item.key,
},
h(
'span',
{
class: 'text-gray-500',
},
`${item.key} : ${item.value}`,
),
);
});
},
},
},
{

View File

@ -90,28 +90,6 @@ function onRefresh() {
/>
<DocAlert title="审批加签、减签" url="https://doc.iocoder.cn/bpm/sign/" />
</template>
<Grid table-title="">
<!-- 摘要 -->
<!-- TODO siye这个要不要也放到 data.ts 处理掉 -->
<template #slot-summary="{ row }">
<div
class="flex flex-col py-2"
v-if="
row.processInstance.summary &&
row.processInstance.summary.length > 0
"
>
<div
v-for="(item, index) in row.processInstance.summary"
:key="index"
>
<span class="text-gray-500">
{{ item.key }} : {{ item.value }}
</span>
</div>
</div>
<div v-else>-</div>
</template>
</Grid>
<Grid table-title="" />
</Page>
</template>