diff --git a/package.json b/package.json index fc60498b8db070ea8b360a931fb16ab9f4c677be..b1ce04f0d2839ffe4759cc324e08194dfa8fd89f 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 0000000000000000000000000000000000000000..e1c61de09fb76f967483873adb861d03100acfdf --- /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 0000000000000000000000000000000000000000..46f6269d93fdb6e6b6c979647e731facbea97387 --- /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 0000000000000000000000000000000000000000..cbb7746fdaf0959c68805647e98a5ef4376608d5 --- /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 0000000000000000000000000000000000000000..dfa5b7be39ae9f13be6348dee7fff8d9e7d4575a --- /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 63a5c35a9344444509c01edff29d620806240731..029c1314257a4e9665085848700196e352ecc5f0 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 2ab09dd655310e53f03290407c824657c7f670b6..a0e95ef6eb9e0b7b19d0cf79b91a3eb963d2a8a1 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 0000000000000000000000000000000000000000..ef6793e18ce2a61647531f2f27176576f9b2346d --- /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 0000000000000000000000000000000000000000..aa497e5c4450f8760309fad38ba42326dc9054f4 --- /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 0000000000000000000000000000000000000000..af010a353bc5640cb11eed5c10e777a031012f9b --- /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 0000000000000000000000000000000000000000..857e16dc2dff374870b86c43dcd325d2e81d5a75 --- /dev/null +++ b/src/views/workflow/formInstance/index.vue @@ -0,0 +1,251 @@ + + +