From 6f42e2bdc9a5ff5c6717d1c1032557fa2fd5b478 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Mon, 12 May 2025 14:17:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=AE=9A=E4=B9=89|=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=AE=9E=E4=BE=8B=E5=8A=9F=E8=83=BD,=20?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/workflow/formDefinition/index.ts | 91 ++++++ src/api/workflow/formDefinition/types.ts | 101 ++++++ src/api/workflow/formInstance/index.ts | 63 ++++ src/api/workflow/formInstance/types.ts | 90 ++++++ src/main.ts | 6 + src/router/index.ts | 31 +- src/views/workflow/formDefinition/design.vue | 86 +++++ src/views/workflow/formDefinition/index.vue | 315 +++++++++++++++++++ src/views/workflow/formInstance/edit.vue | 226 +++++++++++++ src/views/workflow/formInstance/index.vue | 251 +++++++++++++++ 11 files changed, 1260 insertions(+), 1 deletion(-) create mode 100644 src/api/workflow/formDefinition/index.ts create mode 100644 src/api/workflow/formDefinition/types.ts create mode 100644 src/api/workflow/formInstance/index.ts create mode 100644 src/api/workflow/formInstance/types.ts create mode 100644 src/views/workflow/formDefinition/design.vue create mode 100644 src/views/workflow/formDefinition/index.vue create mode 100644 src/views/workflow/formInstance/edit.vue create mode 100644 src/views/workflow/formInstance/index.vue diff --git a/package.json b/package.json index fc60498b..b1ce04f0 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "crypto-js": "4.2.0", "echarts": "5.6.0", "element-plus": "2.9.8", + "epic-designer": "^1.0.1", "file-saver": "2.0.5", "highlight.js": "11.9.0", "image-conversion": "2.1.1", diff --git a/src/api/workflow/formDefinition/index.ts b/src/api/workflow/formDefinition/index.ts new file mode 100644 index 00000000..e1c61de0 --- /dev/null +++ b/src/api/workflow/formDefinition/index.ts @@ -0,0 +1,91 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FormDefinitionVO, FormDefinitionForm, FormDefinitionQuery } from '@/api/workflow/formDefinition/types'; + +/** + * 查询表单定义列表 + * @param query + * @returns {*} + */ + +export const listFormDefinition = (query?: FormDefinitionQuery): AxiosPromise => { + return request({ + url: '/workflow/formDefinition/list', + method: 'get', + params: query + }); +}; + +/** + * 查询表单定义详细 + * @param id + */ +export const getFormDefinition = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/formDefinition/' + id, + method: 'get' + }); +}; + +/** + * 新增表单定义 + * @param data + */ +export const addFormDefinition = (data: FormDefinitionForm) => { + return request({ + url: '/workflow/formDefinition', + method: 'post', + data: data + }); +}; + +/** + * 修改表单定义 + * @param data + */ +export const updateFormDefinition = (data: FormDefinitionForm) => { + return request({ + url: '/workflow/formDefinition', + method: 'put', + data: data + }); +}; + +/** + * 修改表单定义结构 + * @param data + */ +export const updateFormSchema = (data: FormDefinitionForm) => { + return request({ + url: '/workflow/formDefinition/editFormSchema', + method: 'put', + data: data + }); +}; + +/** + * 删除表单定义 + * @param id + */ +export const delFormDefinition = (id: string | number | Array) => { + return request({ + url: '/workflow/formDefinition/' + id, + method: 'delete' + }); +}; + +/** + * 新增表单定义 + * @param data + */ +export const updateFormDefinitionStatus = (id: string | number, status: string) => { + const data = { + id, + status + }; + return request({ + url: '/workflow/formDefinition/changeStatus', + method: 'post', + data: data + }); +}; diff --git a/src/api/workflow/formDefinition/types.ts b/src/api/workflow/formDefinition/types.ts new file mode 100644 index 00000000..46f6269d --- /dev/null +++ b/src/api/workflow/formDefinition/types.ts @@ -0,0 +1,101 @@ +export interface FormDefinitionVO { + /** + * 主键 + */ + id: string | number; + + /** + * 表单标识 + */ + formKey: string; + + /** + * 表单名称 + */ + formName: string; + + /** + * 版本号 + */ + version: number; + + /** + * 表单结构 + */ + formSchema: string; + + /** + * 状态 + */ + status: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface FormDefinitionForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 表单标识 + */ + formKey?: string; + + /** + * 表单名称 + */ + formName?: string; + + /** + * 版本号 + */ + version?: number; + + /** + * 表单结构 + */ + formSchema?: string; + + /** + * 状态 + */ + status?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface FormDefinitionQuery extends PageQuery { + + /** + * 表单标识 + */ + formKey?: string; + + /** + * 表单名称 + */ + formName?: string; + + /** + * 状态 + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/workflow/formInstance/index.ts b/src/api/workflow/formInstance/index.ts new file mode 100644 index 00000000..cbb7746f --- /dev/null +++ b/src/api/workflow/formInstance/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FormInstanceVO, FormInstanceForm, FormInstanceQuery } from '@/api/workflow/formInstance/types'; + +/** + * 查询表单实例列表 + * @param query + * @returns {*} + */ + +export const listFormInstance = (query?: FormInstanceQuery): AxiosPromise => { + return request({ + url: '/workflow/formInstance/list', + method: 'get', + params: query + }); +}; + +/** + * 查询表单实例详细 + * @param id + */ +export const getFormInstance = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/formInstance/' + id, + method: 'get' + }); +}; + +/** + * 新增表单实例 + * @param data + */ +export const addFormInstance = (data: FormInstanceForm) => { + return request({ + url: '/workflow/formInstance', + method: 'post', + data: data + }); +}; + +/** + * 修改表单实例 + * @param data + */ +export const updateFormInstance = (data: FormInstanceForm) => { + return request({ + url: '/workflow/formInstance', + method: 'put', + data: data + }); +}; + +/** + * 删除表单实例 + * @param id + */ +export const delFormInstance = (id: string | number | Array) => { + return request({ + url: '/workflow/formInstance/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/formInstance/types.ts b/src/api/workflow/formInstance/types.ts new file mode 100644 index 00000000..dfa5b7be --- /dev/null +++ b/src/api/workflow/formInstance/types.ts @@ -0,0 +1,90 @@ +export interface FormInstanceVO { + /** + * 主键 + */ + id: string | number; + + /** + * 表单定义ID + */ + definitionId: string | number; + + /** + * 表单标识 + */ + formKey: string; + + /** + * 表单结构 + */ + formSchema: string; + + /** + * 表单数据 + */ + formData: string; + + /** + * 状态 + */ + status: string; + + /** + * 备注 + */ + remark: string; +} + +export interface FormInstanceForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 表单定义ID + */ + definitionId?: string | number; + + /** + * 表单标识 + */ + formKey?: string; + + /** + * 表单结构 + */ + formSchema?: string; + + /** + * 表单数据 + */ + formData?: string; + + /** + * 状态 + */ + status?: string; + + /** + * 备注 + */ + remark?: string; +} + +export interface FormInstanceQuery extends PageQuery { + /** + * 表单定义ID + */ + definitionId?: string | number; + + /** + * 状态 + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/main.ts b/src/main.ts index 63a5c35a..029c1314 100644 --- a/src/main.ts +++ b/src/main.ts @@ -38,6 +38,12 @@ VXETable.setConfig({ zIndex: 999999 }); +// epic designer +import 'epic-designer/dist/style.css'; +import { setupElementPlus } from 'epic-designer/dist/ui/elementPlus'; +// 注册Element UI +setupElementPlus(); + // 修改 el-dialog 默认点击遮照为不关闭 import { ElDialog } from 'element-plus'; ElDialog.props.closeOnClickModal.default = false; diff --git a/src/router/index.ts b/src/router/index.ts index 2ab09dd6..730a7292 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -190,7 +190,36 @@ export const dynamicRoutes: RouteRecordRaw[] = [ meta: { title: '流程设计', activeMenu: '/workflow/processDefinition', noCache: true } } ] - } + }, + // 电子表单设计路由 + { + path: '/workflow/formDesign', + component: Layout, + hidden: true, + permissions: ['workflow:formDefinition:edit'], + children: [ + { + path: 'index', + component: () => import('@/views/workflow/formDefinition/design.vue'), + name: 'formDesign', + meta: { title: '表单设计', activeMenu: '/workflow/formDefinition', noCache: true } + } + ] + }, + { + path: '/workflow/dynFormEdit', + component: Layout, + hidden: true, + permissions: ['workflow:formInstance:edit'], + children: [ + { + path: 'index/:definitionId(\\d+)', + component: () => import('@/views/workflow/formInstance/edit.vue'), + name: 'dynFormEdit', + meta: { title: '表单设计', activeMenu: '/workflow/formInstance', noCache: true } + } + ] + }, ]; /** diff --git a/src/views/workflow/formDefinition/design.vue b/src/views/workflow/formDefinition/design.vue new file mode 100644 index 00000000..ef6793e1 --- /dev/null +++ b/src/views/workflow/formDefinition/design.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/src/views/workflow/formDefinition/index.vue b/src/views/workflow/formDefinition/index.vue new file mode 100644 index 00000000..aa497e5c --- /dev/null +++ b/src/views/workflow/formDefinition/index.vue @@ -0,0 +1,315 @@ + + + diff --git a/src/views/workflow/formInstance/edit.vue b/src/views/workflow/formInstance/edit.vue new file mode 100644 index 00000000..af010a35 --- /dev/null +++ b/src/views/workflow/formInstance/edit.vue @@ -0,0 +1,226 @@ + + + diff --git a/src/views/workflow/formInstance/index.vue b/src/views/workflow/formInstance/index.vue new file mode 100644 index 00000000..857e16dc --- /dev/null +++ b/src/views/workflow/formInstance/index.vue @@ -0,0 +1,251 @@ + + + -- Gitee From ed6f642fc31d6e0abe4a90057d1101fb89c3a881 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Mon, 12 May 2025 15:45:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add=20=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 730a7292..a0e95ef6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -216,7 +216,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [ path: 'index/:definitionId(\\d+)', component: () => import('@/views/workflow/formInstance/edit.vue'), name: 'dynFormEdit', - meta: { title: '表单设计', activeMenu: '/workflow/formInstance', noCache: true } + meta: { title: '表单实例', activeMenu: '/workflow/formInstance', noCache: true } } ] }, -- Gitee