fix: 优化待办任务摘要字段的渲染方式
							parent
							
								
									e1434c7b2d
								
							
						
					
					
						commit
						7762059537
					
				|  | @ -2,6 +2,8 @@ import type { VbenFormSchema } from '#/adapter/form'; | ||||||
| import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; | import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||||
| import type { BpmTaskApi } from '#/api/bpm/task'; | import type { BpmTaskApi } from '#/api/bpm/task'; | ||||||
| 
 | 
 | ||||||
|  | import { h } from 'vue'; | ||||||
|  | 
 | ||||||
| import { useAccess } from '@vben/access'; | import { useAccess } from '@vben/access'; | ||||||
| 
 | 
 | ||||||
| import { getCategorySimpleList } from '#/api/bpm/category'; | import { getCategorySimpleList } from '#/api/bpm/category'; | ||||||
|  | @ -82,7 +84,28 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>( | ||||||
|       title: '摘要', |       title: '摘要', | ||||||
|       minWidth: 200, |       minWidth: 200, | ||||||
|       slots: { |       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}`, | ||||||
|  |               ), | ||||||
|  |             ); | ||||||
|  |           }); | ||||||
|  |         }, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|  |  | ||||||
|  | @ -90,28 +90,6 @@ function onRefresh() { | ||||||
|       /> |       /> | ||||||
|       <DocAlert title="审批加签、减签" url="https://doc.iocoder.cn/bpm/sign/" /> |       <DocAlert title="审批加签、减签" url="https://doc.iocoder.cn/bpm/sign/" /> | ||||||
|     </template> |     </template> | ||||||
|     <Grid table-title="待办任务"> |     <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> |  | ||||||
|   </Page> |   </Page> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 子夜
						子夜