ruoyi-plus-vben5/apps/web-antd/src/views/workflow/processDefinition/data.tsx

98 lines
1.9 KiB
TypeScript
Raw Normal View History

2024-12-11 21:33:59 +08:00
import type { VxeGridProps } from '#/adapter/vxe-table';
2024-12-12 09:08:07 +08:00
import { type FormSchemaGetter } from '#/adapter/form';
import { OptionsTag } from '#/components/table';
2024-12-11 21:33:59 +08:00
2024-12-20 16:37:56 +08:00
import { publishStatusOptions } from './constant';
2024-12-11 21:33:59 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'flowName',
label: '流程名称',
},
{
component: 'Input',
fieldName: 'flowCode',
label: '流程code',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
field: 'flowName',
title: '流程名称',
minWidth: 150,
},
{
field: 'flowCode',
title: '流程code',
minWidth: 150,
},
{
field: 'version',
title: '版本号',
minWidth: 80,
formatter: ({ cellValue }) => `V${cellValue}.0`,
},
{
field: 'activityStatus',
2024-12-20 16:37:56 +08:00
title: '激活状态',
2024-12-11 21:33:59 +08:00
minWidth: 100,
2024-12-12 09:08:07 +08:00
slots: {
2024-12-20 16:37:56 +08:00
default: 'activityStatus',
2024-12-12 09:08:07 +08:00
},
2024-12-11 21:33:59 +08:00
},
{
field: 'isPublish',
title: '发布状态',
minWidth: 100,
2024-12-12 09:08:07 +08:00
slots: {
default: ({ row }) => {
const cellValue = row.isPublish;
return (
<OptionsTag options={publishStatusOptions as any} value={cellValue} />
);
},
},
2024-12-11 21:33:59 +08:00
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
resizable: false,
width: 200,
2024-12-11 21:33:59 +08:00
},
];
2024-12-16 08:48:53 +08:00
export const modalSchema: FormSchemaGetter = () => [
{
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
fieldName: 'id',
},
{
component: 'TreeSelect',
fieldName: 'category',
label: '流程分类',
rules: 'selectRequired',
},
{
component: 'Input',
fieldName: 'flowCode',
2024-12-17 08:15:27 +08:00
label: '流程code',
2024-12-16 08:48:53 +08:00
rules: 'required',
},
{
component: 'Input',
fieldName: 'flowName',
label: '流程名称',
rules: 'required',
},
];