From f50ed6b2c54615fa3e540bc6788a08239084d8e2 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: Thu, 21 Mar 2024 21:02:41 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/formDefinition/index.ts | 38 +++ src/api/workflow/formDefinition/types.ts | 81 ++++++ src/api/workflow/leave/types.ts | 2 + src/api/workflow/task/types.ts | 2 + src/components/Process/approvalRecord.vue | 6 +- src/router/index.ts | 14 ++ src/views/workflow/leave/index.vue | 191 ++------------ src/views/workflow/leave/leaveEdit.vue | 237 ++++++++++++++++++ src/views/workflow/model/index.vue | 10 +- .../workflow/processDefinition/index.vue | 87 ++++++- src/views/workflow/processInstance/index.vue | 11 +- src/views/workflow/task/allTaskWaiting.vue | 4 +- src/views/workflow/task/myDocument.vue | 4 +- src/views/workflow/task/taskCopyList.vue | 4 +- src/views/workflow/task/taskFinish.vue | 4 +- src/views/workflow/task/taskWaiting.vue | 57 ++--- 16 files changed, 508 insertions(+), 244 deletions(-) create mode 100644 src/api/workflow/formDefinition/index.ts create mode 100644 src/api/workflow/formDefinition/types.ts create mode 100644 src/views/workflow/leave/leaveEdit.vue diff --git a/src/api/workflow/formDefinition/index.ts b/src/api/workflow/formDefinition/index.ts new file mode 100644 index 0000000..7eed53d --- /dev/null +++ b/src/api/workflow/formDefinition/index.ts @@ -0,0 +1,38 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FormDefinitionVO, FormDefinitionForm, FormDefinitionQuery } from '@/api/workflow/formDefinition/types'; + + +/** + * 查询表单配置详细 + * @param id + */ +export const getByDefId = (definitionId: string | number): AxiosPromise => { + return request({ + url: '/workflow/formDefinition/getByDefId/' + definitionId, + method: 'get' + }); +}; + +/** + * 新增表单配置 + * @param data + */ +export const saveOrUpdate = (data: FormDefinitionForm) => { + return request({ + url: '/workflow/formDefinition/saveOrUpdate', + method: 'post', + data: data + }); +}; + +/** + * 删除表单配置 + * @param id + */ +export const delFormDefinition = (id: string | number | Array) => { + return request({ + url: '/workflow/formDefinition/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/formDefinition/types.ts b/src/api/workflow/formDefinition/types.ts new file mode 100644 index 0000000..5a8f37b --- /dev/null +++ b/src/api/workflow/formDefinition/types.ts @@ -0,0 +1,81 @@ +export interface FormDefinitionVO { + /** + * 主键 + */ + id: string | number; + + /** + * 路由地址 + */ + path: string; + + /** + * 流程定义ID + */ + definitionId: string | number; + + /** + * 流程KEY + */ + processKey: string; + + /** + * 备注 + */ + remark: string; + +} + +export interface FormDefinitionForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 路由地址 + */ + path?: string; + + /** + * 流程定义ID + */ + definitionId?: string | number; + + /** + * 流程KEY + */ + processKey?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface FormDefinitionQuery extends PageQuery { + + /** + * 路由地址 + */ + path?: string; + + /** + * 流程定义ID + */ + definitionId?: string | number; + + /** + * 流程KEY + */ + processKey?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/workflow/leave/types.ts b/src/api/workflow/leave/types.ts index 9405257..05fc52e 100644 --- a/src/api/workflow/leave/types.ts +++ b/src/api/workflow/leave/types.ts @@ -5,6 +5,7 @@ export interface LeaveVO { endDate: string; leaveDays: number; remark: string; + processInstanceVo: any; } export interface LeaveForm extends BaseEntity { @@ -14,6 +15,7 @@ export interface LeaveForm extends BaseEntity { endDate?: string; leaveDays?: number; remark?: string; + processInstanceVo: any; } export interface LeaveQuery extends PageQuery { diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index f1aede9..1a7629b 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -36,6 +36,8 @@ export interface TaskVO extends BaseEntity { processDefinitionKey: string; participantVo: ParticipantVo; multiInstance: boolean; + businessKey: string; + wfFormDefinitionVo: any; } export interface VariableVo { diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index 2ef5d73..c24b8a4 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -10,7 +10,11 @@ - + + + - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/workflow/model/index.vue b/src/views/workflow/model/index.vue index 26550c3..c738e78 100644 --- a/src/views/workflow/model/index.vue +++ b/src/views/workflow/model/index.vue @@ -57,18 +57,18 @@ - + - + - - - + + + - + - - - - + + + + @@ -71,14 +71,14 @@ {{ scope.row.diagramResourceName }} - + - + @@ -158,8 +166,8 @@ - - + + @@ -208,6 +216,29 @@ + + + + + + + + + + + + + + + + @@ -224,8 +255,10 @@ import { } from '@/api/workflow/processDefinition'; import ProcessPreview from './components/processPreview.vue'; import { listCategory } from '@/api/workflow/category'; +import { getByDefId,saveOrUpdate } from '@/api/workflow/formDefinition'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessDefinitionQuery, ProcessDefinitionVO } from '@/api/workflow/processDefinition/types'; +import { FormDefinitionForm } from '@/api/workflow/formDefinition/types'; import { UploadRequestOptions } from 'element-plus'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -254,6 +287,7 @@ const categoryOptions = ref([]); const categoryName = ref(''); /** 部署文件分类选择 */ const selectCategory = ref(); +const formDefinitionForm = ref({}); const uploadDialog = reactive({ visible: false, @@ -265,6 +299,11 @@ const processDefinitionDialog = reactive({ title: '历史版本' }); +const formDialog = reactive({ + visible: false, + title: '表单配置' +}); + // 查询参数 const queryParams = ref({ pageNum: 1, @@ -429,4 +468,28 @@ const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => }); return; }; +//打开表单配置 +const handleFormOpen = async (row: ProcessDefinitionVO) => { + formDialog.visible = true + formDefinitionForm.value.processKey = row.key + formDefinitionForm.value.definitionId = row.id + const resp = await getByDefId(row.id) + if(resp.data){ + formDefinitionForm.value = resp.data + }else{ + formDefinitionForm.value.path = undefined + formDefinitionForm.value.remark = undefined + } +} +//保存表单 +const handlerSaveForm = async () => { + await proxy?.$modal.confirm('是否确认保存?'); + saveOrUpdate(formDefinitionForm.value).then(resp=>{ + if(resp.code === 200){ + proxy?.$modal.msgSuccess('操作成功'); + formDialog.visible = false + getList(); + } + }) +} diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index eafc609..19e57f7 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -56,12 +56,11 @@ - + - - - - + + + @@ -127,7 +126,7 @@ - + diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index dfaf7c9..8d5836f 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -39,9 +39,9 @@ - + - + diff --git a/src/views/workflow/task/myDocument.vue b/src/views/workflow/task/myDocument.vue index 4597a2a..1e71f1f 100644 --- a/src/views/workflow/task/myDocument.vue +++ b/src/views/workflow/task/myDocument.vue @@ -42,9 +42,9 @@ - + - + diff --git a/src/views/workflow/task/taskCopyList.vue b/src/views/workflow/task/taskCopyList.vue index 112c95b..5d22b0b 100644 --- a/src/views/workflow/task/taskCopyList.vue +++ b/src/views/workflow/task/taskCopyList.vue @@ -28,9 +28,9 @@ - + - + diff --git a/src/views/workflow/task/taskFinish.vue b/src/views/workflow/task/taskFinish.vue index fd9ce6e..8bc870f 100644 --- a/src/views/workflow/task/taskFinish.vue +++ b/src/views/workflow/task/taskFinish.vue @@ -28,9 +28,9 @@ - + - + diff --git a/src/views/workflow/task/taskWaiting.vue b/src/views/workflow/task/taskWaiting.vue index a6443bd..8ef3c03 100644 --- a/src/views/workflow/task/taskWaiting.vue +++ b/src/views/workflow/task/taskWaiting.vue @@ -28,9 +28,9 @@ - + - + @@ -54,22 +54,14 @@ - + @@ -81,22 +73,13 @@ @pagination="handleQuery" /> - - - -