feat: bpm todo

pull/4/MERGE
xingyu 2023-04-12 23:04:47 +08:00
parent 6f6de0b393
commit 0bcf07887e
2 changed files with 85 additions and 1 deletions

View File

@ -0,0 +1,59 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
export const columns: BasicColumn[] = [
{
title: '任务编号',
dataIndex: 'id',
width: 100
},
{
title: '任务名称',
dataIndex: 'name',
width: 180
},
{
title: '所属流程',
dataIndex: 'processInstance.name',
width: 180
},
{
title: '流程发起人',
dataIndex: 'processInstance.startUserNickname',
width: 180
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
},
{
title: '状态',
dataIndex: 'suspensionState',
width: 180,
customRender: ({ text }) => {
if (text === 1) {
return useRender.renderTag('激活', 'success')
} else if (text === 2) {
return useRender.renderTag('挂起', 'warning')
}
}
}
]
export const searchFormSchema: FormSchema[] = [
{
label: '流程名',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
{
label: '创建时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 }
}
]

View File

@ -1,3 +1,28 @@
<template>
<div>开发中</div>
<div>
<BasicTable @register="registerTable" />
</div>
</template>
<script lang="ts" setup name="Todo">
import { useI18n } from '@/hooks/web/useI18n'
import { BasicTable, useTable } from '@/components/Table'
import { getTodoTaskPage } from '@/api/bpm/task'
import { columns, searchFormSchema } from './todo.data'
const { t } = useI18n()
const [registerTable] = useTable({
title: '审批列表',
api: getTodoTaskPage,
columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true,
showTableSetting: true,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
</script>