diff --git a/index.html b/index.html index 687c9d3..1593304 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,10 @@ /> <%= title %> + + + + diff --git a/src/views/common/workflow/extension/form/form.data.ts b/src/views/common/workflow/extension/form/form.data.ts new file mode 100644 index 0000000..8a431b0 --- /dev/null +++ b/src/views/common/workflow/extension/form/form.data.ts @@ -0,0 +1,108 @@ +import { BasicColumn, FormSchema } from '/@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; +import { listFormCategory } from '/@/api/platform/common/workflow/extension/controller/formCategory'; + +/** 表格列配置 */ +export const columns: BasicColumn[] = [ + { + title: '表单名称', + dataIndex: 'name', + }, + { + title: '分类', + dataIndex: ['formCategory', 'name'], + }, + { + title: '版本号', + dataIndex: ['formDefinitionJson', 'version'], + width: 200, + customRender: ({ record }) => { + return h(Tag, {color: 'success'}, () => record.formDefinitionJson?.version); + } + }, + { + title: '状态', + dataIndex: ['formDefinitionJson', 'status'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.status == '1' ? + h(Tag, { color: 'success' }, () => '已发布'): + h(Tag, { color: 'red' }, () => '未发布'); + } + }, + { + title: '是否主版本', + dataIndex: ['formDefinitionJson', 'isPrimary'], + width: 200, + customRender: ({ record }) => { + return record.formDefinitionJson?.isPrimary == '1' ? + h(Tag, { color: 'success' }, () => '主版本'): + h(Tag, { color: 'red' }, () => '非主版本'); + } + }, +]; + +/** 搜索表单配置 */ +export const searchFormSchema: FormSchema[] = [ + { + field: 'categoryId', + label: '表单分类', + component: 'ApiTreeSelect', + componentProps: { + placeholder: '请选择分类', + fieldNames: { + label: 'name', + key: 'id', + value: 'id' + }, + getPopupContainer: () => document.body, + api: listFormCategory, + listToTree: true, + }, + colProps: { span: 8 } + }, + { + field: 'name', + label: '表单名称', + component: 'Input', + componentProps: { + placeholder: '请输入表单名称', + }, + colProps: { span: 8 } + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false + }, + { + field: 'categoryId', + label: '表单分类', + component: 'ApiTreeSelect', + componentProps: { + placeholder: '请选择分类', + fieldNames: { + label: 'name', + key: 'id', + value: 'id' + }, + getPopupContainer: () => document.body, + api: listFormCategory, + listToTree: true, + }, + required: true, + }, + { + field: 'name', + label: '表单名称', + component: 'Input', + componentProps: { + placeholder: '请输入表单名称', + }, + }, +]; diff --git a/src/views/common/workflow/extension/form/index.vue b/src/views/common/workflow/extension/form/index.vue new file mode 100644 index 0000000..e08ad2c --- /dev/null +++ b/src/views/common/workflow/extension/form/index.vue @@ -0,0 +1,216 @@ + + +