康来智慧冷链系统 - 前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

62 lines
1.6 KiB

import { BasicColumn, FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
export const columns: BasicColumn[] = [
{
title: '流程名称',
dataIndex: 'name',
width: 200,
},
{
title: '流程KEY',
dataIndex: 'modelKey',
width: 200,
},
{
title: '分类',
dataIndex: ['processDefinition', 'category'],
width: 150,
customRender: ({ record }) => {
return record.processDefinition?.category ?
h(Tag, { color: 'success' }, () => String(record.processDefinition?.category).split(',')[1]) :
h(Tag, { color: 'warning' }, () => '暂无分类');
}
},
{
title: '流程版本',
dataIndex: ['processDefinition', 'version'],
width: 150,
customRender: ({ record }) => {
const version = record.processDefinition?.version;
return h(Tag, { color: version ? 'success' : 'warning' }, () => version || '版本未发布');
}
},
{
title: '流程状态',
dataIndex: ['processDefinition', 'suspend'],
width: 150,
customRender: ({ record }) => {
const suspend = record.processDefinition?.suspend;
return h(Tag, { color: suspend ? 'error' : (typeof suspend === 'undefined' ? 'warning' :'success')},
() => suspend ? '已挂起' : (typeof suspend === 'undefined' ? '草稿' : '已发布'));
}
},
{
title: '更新时间',
dataIndex: 'lastUpdated',
width: 200,
}
];
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '流程名称',
component: 'Input',
componentProps: {
placeholder: '请输入流程名称'
},
colProps: { span: 8 }
}
];