From 1d01543b21104ec5f2a31efd6f9f92b0ceb952ff Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Wed, 14 Jun 2023 22:39:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=BC=96=E5=86=99=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E8=A1=A8=E5=8D=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 + .../extension/controller/formCategory.ts | 25 ++ .../extension/controller/formDefinition.ts | 25 ++ .../controller/formDefinitionJson.ts | 28 +++ .../workflow/extension/entity/formCategory.ts | 10 + .../extension/entity/formDefinition.ts | 17 ++ .../extension/entity/formDefinitionJson.ts | 16 ++ .../Form/src/components/ApiTreeSelect.vue | 4 + src/utils/helper/treeHelper.ts | 2 +- .../workflow/extension/form/FormModal.vue | 79 +++++++ .../workflow/extension/form/form.data.ts | 108 +++++++++ .../common/workflow/extension/form/index.vue | 216 ++++++++++++++++++ 12 files changed, 533 insertions(+), 1 deletion(-) create mode 100644 src/api/platform/common/workflow/extension/controller/formCategory.ts create mode 100644 src/api/platform/common/workflow/extension/controller/formDefinition.ts create mode 100644 src/api/platform/common/workflow/extension/controller/formDefinitionJson.ts create mode 100644 src/api/platform/common/workflow/extension/entity/formCategory.ts create mode 100644 src/api/platform/common/workflow/extension/entity/formDefinition.ts create mode 100644 src/api/platform/common/workflow/extension/entity/formDefinitionJson.ts create mode 100644 src/views/common/workflow/extension/form/FormModal.vue create mode 100644 src/views/common/workflow/extension/form/form.data.ts create mode 100644 src/views/common/workflow/extension/form/index.vue 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 @@ + + +