From 2ea1807f34479f683f4fc3691dfccf4146b94706 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: 星期日, 31 三月 2024 15:34:54 +0800 Subject: [PATCH] add 添加表单配置 --- src/api/workflow/nodeConfig/index.ts | 63 +++ src/views/workflow/formManage/index.vue | 249 ++++++++++++++ src/views/workflow/task/myDocument.vue | 22 src/api/workflow/formManage/index.ts | 76 ++++ src/api/workflow/workflowCommon/index.ts | 49 ++ src/api/workflow/task/types.ts | 6 src/api/workflow/formManage/types.ts | 75 ++++ src/api/workflow/workflowCommon/types.ts | 10 src/views/workflow/task/taskCopyList.vue | 24 src/api/workflow/definitionConfig/types.ts | 95 +++++ src/api/workflow/definitionConfig/index.ts | 38 ++ /dev/null | 81 ---- src/api/workflow/nodeConfig/types.ts | 43 ++ src/views/workflow/task/allTaskWaiting.vue | 26 src/views/workflow/task/taskFinish.vue | 26 src/views/workflow/task/taskWaiting.vue | 36 - src/views/workflow/processInstance/index.vue | 22 src/components/BpmnDesign/panel/TaskPanel.vue | 25 + src/views/workflow/processDefinition/index.vue | 39 + 19 files changed, 814 insertions(+), 191 deletions(-) diff --git a/src/api/workflow/definitionConfig/index.ts b/src/api/workflow/definitionConfig/index.ts new file mode 100644 index 0000000..44c3e85 --- /dev/null +++ b/src/api/workflow/definitionConfig/index.ts @@ -0,0 +1,38 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types'; + + +/** + * 鏌ヨ琛ㄥ崟閰嶇疆璇︾粏 + * @param id + */ +export const getByDefId = (definitionId: string | number): AxiosPromise<DefinitionConfigVO> => { + return request({ + url: '/workflow/definitionConfig/getByDefId/' + definitionId, + method: 'get' + }); +}; + +/** + * 鏂板琛ㄥ崟閰嶇疆 + * @param data + */ +export const saveOrUpdate = (data: DefinitionConfigForm) => { + return request({ + url: '/workflow/definitionConfig/saveOrUpdate', + method: 'post', + data: data + }); +}; + +/** + * 鍒犻櫎琛ㄥ崟閰嶇疆 + * @param id + */ +export const deldefinitionConfig = (id: string | number | Array<string | number>) => { + return request({ + url: '/workflow/definitionConfig/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/definitionConfig/types.ts b/src/api/workflow/definitionConfig/types.ts new file mode 100644 index 0000000..836e7f4 --- /dev/null +++ b/src/api/workflow/definitionConfig/types.ts @@ -0,0 +1,95 @@ +import { FormManageVO } from '@/api/workflow/formManage/types'; + +export interface DefinitionConfigVO { + /** + * 涓婚敭 + */ + id: string | number; + + /** + * 琛ㄥ崟ID + */ + formId?: string | number; + + /** + * 娴佺▼瀹氫箟ID + */ + definitionId: string | number; + + /** + * 娴佺▼KEY + */ + processKey: string; + + /** + * 澶囨敞 + */ + remark: string; + + /** + * 琛ㄥ崟绠$悊 + */ + wfFormManageVo: FormManageVO; + +} + +export interface DefinitionConfigForm extends BaseEntity { + /** + * 涓婚敭 + */ + id?: string | number; + + /** + * 琛ㄥ崟ID + */ + formId?: string | number; + + /** + * 娴佺▼瀹氫箟ID + */ + definitionId?: string | number; + + /** + * 娴佺▼KEY + */ + processKey?: string; + + /** + * 澶囨敞 + */ + remark?: string; + + /** + * 琛ㄥ崟绠$悊 + */ + wfFormManageVo: FormManageVO; + + +} + +export interface DefinitionConfigQuery extends PageQuery { + + /** + * 琛ㄥ崟ID + */ + formId?: string | number; + + /** + * 娴佺▼瀹氫箟ID + */ + definitionId?: string | number; + + /** + * 娴佺▼KEY + */ + processKey?: string; + + /** + * 琛ㄥ崟绠$悊 + */ + wfFormManageVo: FormManageVO; + +} + + + diff --git a/src/api/workflow/formDefinition/index.ts b/src/api/workflow/formDefinition/index.ts deleted file mode 100644 index 7eed53d..0000000 --- a/src/api/workflow/formDefinition/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -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<FormDefinitionVO> => { - 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<string | number>) => { - return request({ - url: '/workflow/formDefinition/' + id, - method: 'delete' - }); -}; diff --git a/src/api/workflow/formDefinition/types.ts b/src/api/workflow/formDefinition/types.ts deleted file mode 100644 index 5a8f37b..0000000 --- a/src/api/workflow/formDefinition/types.ts +++ /dev/null @@ -1,81 +0,0 @@ -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/formManage/index.ts b/src/api/workflow/formManage/index.ts new file mode 100644 index 0000000..c2930cf --- /dev/null +++ b/src/api/workflow/formManage/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FormManageVO, FormManageForm, FormManageQuery } from '@/api/workflow/formManage/types'; + +/** + * 鏌ヨ琛ㄥ崟绠$悊鍒楄〃 + * @param query + * @returns {*} + */ + +export const listFormManage = (query?: FormManageQuery): AxiosPromise<FormManageVO[]> => { + return request({ + url: '/workflow/formManage/list', + method: 'get', + params: query + }); +}; + +/** + * 鏌ヨ琛ㄥ崟绠$悊鍒楄〃 + * @param query + * @returns {*} + */ + +export const selectListFormManage = (): AxiosPromise<FormManageVO[]> => { + return request({ + url: '/workflow/formManage/list/selectList', + method: 'get', + }); +}; + +/** + * 鏌ヨ琛ㄥ崟绠$悊璇︾粏 + * @param id + */ +export const getFormManage = (id: string | number): AxiosPromise<FormManageVO> => { + return request({ + url: '/workflow/formManage/' + id, + method: 'get' + }); +}; + +/** + * 鏂板琛ㄥ崟绠$悊 + * @param data + */ +export const addFormManage = (data: FormManageForm) => { + return request({ + url: '/workflow/formManage', + method: 'post', + data: data + }); +}; + +/** + * 淇敼琛ㄥ崟绠$悊 + * @param data + */ +export const updateFormManage = (data: FormManageForm) => { + return request({ + url: '/workflow/formManage', + method: 'put', + data: data + }); +}; + +/** + * 鍒犻櫎琛ㄥ崟绠$悊 + * @param id + */ +export const delFormManage = (id: string | number | Array<string | number>) => { + return request({ + url: '/workflow/formManage/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/formManage/types.ts b/src/api/workflow/formManage/types.ts new file mode 100644 index 0000000..38db96f --- /dev/null +++ b/src/api/workflow/formManage/types.ts @@ -0,0 +1,75 @@ +export interface FormManageVO { + /** + * 涓婚敭 + */ + id: string | number; + + /** + * 琛ㄥ崟鍚嶇О + */ + formName: string; + + /** + * 琛ㄥ崟绫诲瀷 + */ + formType: string; + /** + * 琛ㄥ崟绫诲瀷鍚嶇О + */ + formTypeName: string; + + /** + * 璺敱鍦板潃/琛ㄥ崟ID + */ + router: string; + + /** + * 澶囨敞 + */ + remork: string; + +} + +export interface FormManageForm extends BaseEntity { + /** + * 涓婚敭 + */ + id?: string | number; + + /** + * 琛ㄥ崟鍚嶇О + */ + formName?: string; + + /** + * 琛ㄥ崟绫诲瀷 + */ + formType?: string; + + /** + * 璺敱鍦板潃/琛ㄥ崟ID + */ + router?: string; + + /** + * 澶囨敞 + */ + remork?: string; + +} + +export interface FormManageQuery extends PageQuery { + + /** + * 琛ㄥ崟鍚嶇О + */ + formName?: string; + + /** + * 琛ㄥ崟绫诲瀷 + */ + formType?: string; +} + + + diff --git a/src/api/workflow/nodeConfig/index.ts b/src/api/workflow/nodeConfig/index.ts new file mode 100644 index 0000000..3270c17 --- /dev/null +++ b/src/api/workflow/nodeConfig/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types'; + +/** + * 鏌ヨ鑺傜偣閰嶇疆鍒楄〃 + * @param query + * @returns {*} + */ + +export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise<NodeConfigVO[]> => { + return request({ + url: '/workflow/nodeConfig/list', + method: 'get', + params: query + }); +}; + +/** + * 鏌ヨ鑺傜偣閰嶇疆璇︾粏 + * @param id + */ +export const getNodeConfig = (id: string | number): AxiosPromise<NodeConfigVO> => { + return request({ + url: '/workflow/nodeConfig/' + id, + method: 'get' + }); +}; + +/** + * 鏂板鑺傜偣閰嶇疆 + * @param data + */ +export const addNodeConfig = (data: NodeConfigForm) => { + return request({ + url: '/workflow/nodeConfig', + method: 'post', + data: data + }); +}; + +/** + * 淇敼鑺傜偣閰嶇疆 + * @param data + */ +export const updateNodeConfig = (data: NodeConfigForm) => { + return request({ + url: '/workflow/nodeConfig', + method: 'put', + data: data + }); +}; + +/** + * 鍒犻櫎鑺傜偣閰嶇疆 + * @param id + */ +export const delNodeConfig = (id: string | number | Array<string | number>) => { + return request({ + url: '/workflow/nodeConfig/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/nodeConfig/types.ts b/src/api/workflow/nodeConfig/types.ts new file mode 100644 index 0000000..4e3a60b --- /dev/null +++ b/src/api/workflow/nodeConfig/types.ts @@ -0,0 +1,43 @@ +import { FormManageVO } from '@/api/workflow/formManage/types'; + +export interface NodeConfigVO { + /** + * 涓婚敭 + */ + id: string | number; + + /** + * 琛ㄥ崟id + */ + formId: string | number; + + /** + * 琛ㄥ崟绫诲瀷 + */ + formType: string; + + /** + * 鑺傜偣鍚嶇О + */ + nodeName: string; + + /** + * 鑺傜偣id + */ + nodeId: string | number; + + /** + * 娴佺▼瀹氫箟id + */ + definitionId: string | number; + + /** + * 琛ㄥ崟绠$悊 + */ + wfFormManageVo: FormManageVO; + +} + + + + diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 412b0aa..2e39d06 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -1,3 +1,5 @@ +import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; +import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; export interface TaskQuery extends PageQuery { name?: string; processDefinitionKey?: string; @@ -37,8 +39,8 @@ participantVo: ParticipantVo; multiInstance: boolean; businessKey: string; - formKey: string; - wfFormDefinitionVo: any; + wfNodeConfigVo: NodeConfigVO; + wfDefinitionConfigVo: DefinitionConfigVO; } export interface VariableVo { diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts new file mode 100644 index 0000000..b2846b2 --- /dev/null +++ b/src/api/workflow/workflowCommon/index.ts @@ -0,0 +1,49 @@ +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; + +export default { + routerJump(routerJumpVo: RouterJumpVo,proxy){ + if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { + proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ + path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, + query: { + id: routerJumpVo.businessKey, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); + } else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) { + proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ + path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`, + query: { + id: routerJumpVo.businessKey, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); + }else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'static') { + proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ + path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`, + query: { + id: routerJumpVo.businessKey, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); + }else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'dynamic') { + proxy.$tab.closePage(proxy.$route); + proxy.$router.push({ + path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`, + query: { + id: routerJumpVo.businessKey, + type: routerJumpVo.type, + taskId: routerJumpVo.taskId + } + }); + } else { + proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); + } + } +} \ No newline at end of file diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts new file mode 100644 index 0000000..698c849 --- /dev/null +++ b/src/api/workflow/workflowCommon/types.ts @@ -0,0 +1,10 @@ +import { NodeConfigVO } from '@/api/workflow/nodeConfig/types'; +import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types'; + +export interface RouterJumpVo { + wfDefinitionConfigVo: DefinitionConfigVO; + wfNodeConfigVo: NodeConfigVO; + businessKey: string; + taskId: string; + type: string; +} \ No newline at end of file diff --git a/src/components/BpmnDesign/panel/TaskPanel.vue b/src/components/BpmnDesign/panel/TaskPanel.vue index 5a23702..fbd4669 100644 --- a/src/components/BpmnDesign/panel/TaskPanel.vue +++ b/src/components/BpmnDesign/panel/TaskPanel.vue @@ -21,8 +21,10 @@ <el-form-item v-if="showConfig.skipExpression" prop="skipExpression" label="璺宠繃琛ㄨ揪寮�"> <el-input v-model="formData.skipExpression" @change="skipExpressionChange"> </el-input> </el-form-item> - <el-form-item prop="formKey" label="琛ㄥ崟鍦板潃"> - <el-input v-model="formData.formKey" @change="formKeyChange" placeholder="褰撳墠鑺傜偣琛ㄥ崟璺敱濡傦細/demo/leaveEdit/index"> </el-input> + <el-form-item prop="formKey" label="琛ㄥ崟鍦板潃" v-loading="formManageListLoading"> + <el-select @change="formKeyChange" v-model="formData.formKey" clearable filterable placeholder="璇烽�夋嫨琛ㄥ崟" style="width: 260px" > + <el-option v-for="item in formManageList" :key="item.id" :label="item.formTypeName+':'+item.formName" :value="item.formType+':'+item.id" /> + </el-select> </el-form-item> </div> </el-collapse-item> @@ -239,9 +241,10 @@ import { AllocationTypeEnum, MultiInstanceTypeEnum, SpecifyDescEnum } from '@/enums/bpmn/IndexEnums'; import { UserVO } from '@/api/system/user/types'; import { RoleVO } from '@/api/system/role/types'; - -const { proxy } = getCurrentInstance() as ComponentInternalInstance; - +import { selectListFormManage } from '@/api/workflow/formManage'; +import { FormManageVO } from '@/api/workflow/formManage/types'; +const formManageList = ref<FormManageVO[]>([]); +const formManageListLoading = ref(false); interface PropType { element: ModdleElement; } @@ -459,6 +462,18 @@ { id: 'fa253b34-4335-458c-b1bc-b039e2a2b7a6', label: '鎸囧畾涓�涓汉', value: 'specifySingle' }, { id: '7365ff54-2e05-4312-9bfb-0b8edd779c5b', label: '鎸囧畾澶氫釜浜�', value: 'specifyMultiple' } ]; + +const listFormManage = async () => { + formManageListLoading.value = true + const res = await selectListFormManage(); + formManageList.value = res.data; + formManageListLoading.value = false +} +onMounted(() => { + nextTick(() => { + listFormManage(); + }); +}); </script> <style lang="scss" scoped></style> diff --git a/src/views/workflow/formManage/index.vue b/src/views/workflow/formManage/index.vue new file mode 100644 index 0000000..752f77d --- /dev/null +++ b/src/views/workflow/formManage/index.vue @@ -0,0 +1,249 @@ +<template> + <div class="p-2"> + <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> + <div class="search" v-show="showSearch"> + <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> + <el-form-item label="琛ㄥ崟鍚嶇О" prop="formName"> + <el-input v-model="queryParams.formName" placeholder="璇疯緭鍏ヨ〃鍗曞悕绉�" clearable style="width: 240px" @keyup.enter="handleQuery" /> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button> + <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + </div> + </transition> + + <el-card shadow="never"> + <template #header> + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['workflow:formManage:add']">鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['workflow:formManage:edit']">淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['workflow:formManage:remove']">鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['workflow:formManage:export']">瀵煎嚭</el-button> + </el-col> + <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + </template> + + <el-table v-loading="loading" :data="formManageList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="琛ㄥ崟鍚嶇О" align="center" prop="formName" /> + <el-table-column label="琛ㄥ崟绫诲瀷" align="center"> + <template #default="scope"> + <dict-tag :options="wf_form_type" :value="scope.row.formType"></dict-tag> + </template> + </el-table-column> + <el-table-column label="鍦板潃" align="center" prop="router" /> + <el-table-column label="澶囨敞" align="center" prop="remork" /> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template #default="scope"> + <el-tooltip content="淇敼" placement="top"> + <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['workflow:formManage:edit']"></el-button> + </el-tooltip> + <el-tooltip content="鍒犻櫎" placement="top"> + <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['workflow:formManage:remove']"></el-button> + </el-tooltip> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + v-model:page="queryParams.pageNum" + v-model:limit="queryParams.pageSize" + @pagination="getList" + /> + </el-card> + <!-- 娣诲姞鎴栦慨鏀硅〃鍗曠鐞嗗璇濇 --> + <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> + <el-form ref="formManageFormRef" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="琛ㄥ崟鍚嶇О" prop="formName"> + <el-input v-model="form.formName" placeholder="璇疯緭鍏ヨ〃鍗曞悕绉�" /> + </el-form-item> + <el-form-item label="琛ㄥ崟绫诲瀷" prop="formType"> + <el-radio-group v-model="form.formType" @change="form.router = ''"> + <el-radio border v-for="dict in wf_form_type" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="璺敱鍦板潃" prop="router" v-if="form.formType === 'static'"> + <el-input v-model="form.router" placeholder="璇疯緭鍏ヨ矾鐢卞湴鍧�" /> + </el-form-item> + <el-form-item label="琛ㄥ崟" prop="router" v-else> + <el-input v-model="form.router" disabled placeholder="璇烽�夋嫨琛ㄥ崟" > + <template #append> + <el-button icon="Search" /> + </template> + </el-input> + </el-form-item> + <el-form-item label="澶囨敞" prop="remork"> + <el-input v-model="form.remork" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> + </el-form-item> + </el-form> + <template #footer> + <div class="dialog-footer"> + <el-button :loading="buttonLoading" type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </template> + </el-dialog> + </div> +</template> + +<script setup name="FormManage" lang="ts"> +import { listFormManage, getFormManage, delFormManage, addFormManage, updateFormManage } from '@/api/workflow/formManage'; +import { FormManageVO, FormManageQuery, FormManageForm } from '@/api/workflow/formManage/types'; +const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { wf_form_type } = toRefs<any>(proxy?.useDict('wf_form_type')); + +const formManageList = ref<FormManageVO[]>([]); +const buttonLoading = ref(false); +const loading = ref(true); +const showSearch = ref(true); +const ids = ref<Array<string | number>>([]); +const single = ref(true); +const multiple = ref(true); +const total = ref(0); + +const queryFormRef = ref<ElFormInstance>(); +const formManageFormRef = ref<ElFormInstance>(); + +const dialog = reactive<DialogOption>({ + visible: false, + title: '' +}); + +const initFormData: FormManageForm = { + id: undefined, + formName: undefined, + formType: 'static', + remork: undefined, +} +const data = reactive<PageData<FormManageForm, FormManageQuery>>({ + form: {...initFormData}, + queryParams: { + pageNum: 1, + pageSize: 10, + formName: undefined, + formType: undefined + }, + rules: { + id: [ + { required: true, message: "涓婚敭涓嶈兘涓虹┖", trigger: "blur" } + ], + formName: [ + { required: true, message: "琛ㄥ崟鍚嶇О涓嶈兘涓虹┖", trigger: "blur" } + ], + formType: [ + { required: true, message: "琛ㄥ崟绫诲瀷涓嶈兘涓虹┖", trigger: "change" } + ], + router: [ + { required: true, message: "涓嶈兘涓虹┖", trigger: "blur" } + ], + } +}); + +const { queryParams, form, rules } = toRefs(data); + +/** 鏌ヨ琛ㄥ崟绠$悊鍒楄〃 */ +const getList = async () => { + loading.value = true; + const res = await listFormManage(queryParams.value); + formManageList.value = res.rows; + total.value = res.total; + loading.value = false; +} + +/** 鍙栨秷鎸夐挳 */ +const cancel = () => { + reset(); + dialog.visible = false; +} + +/** 琛ㄥ崟閲嶇疆 */ +const reset = () => { + form.value = {...initFormData}; + formManageFormRef.value?.resetFields(); +} + +/** 鎼滅储鎸夐挳鎿嶄綔 */ +const handleQuery = () => { + queryParams.value.pageNum = 1; + getList(); +} + +/** 閲嶇疆鎸夐挳鎿嶄綔 */ +const resetQuery = () => { + queryFormRef.value?.resetFields(); + handleQuery(); +} + +/** 澶氶�夋閫変腑鏁版嵁 */ +const handleSelectionChange = (selection: FormManageVO[]) => { + ids.value = selection.map(item => item.id); + single.value = selection.length != 1; + multiple.value = !selection.length; +} + +/** 鏂板鎸夐挳鎿嶄綔 */ +const handleAdd = () => { + reset(); + dialog.visible = true; + dialog.title = "娣诲姞琛ㄥ崟绠$悊"; +} + +/** 淇敼鎸夐挳鎿嶄綔 */ +const handleUpdate = async (row?: FormManageVO) => { + reset(); + const _id = row?.id || ids.value[0] + const res = await getFormManage(_id); + Object.assign(form.value, res.data); + dialog.visible = true; + dialog.title = "淇敼琛ㄥ崟绠$悊"; +} + +/** 鎻愪氦鎸夐挳 */ +const submitForm = () => { + formManageFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + buttonLoading.value = true; + if (form.value.id) { + await updateFormManage(form.value).finally(() => buttonLoading.value = false); + } else { + await addFormManage(form.value).finally(() => buttonLoading.value = false); + } + proxy?.$modal.msgSuccess("鎿嶄綔鎴愬姛"); + dialog.visible = false; + await getList(); + } + }); +} + +/** 鍒犻櫎鎸夐挳鎿嶄綔 */ +const handleDelete = async (row?: FormManageVO) => { + const _ids = row?.id || ids.value; + await proxy?.$modal.confirm('鏄惁纭鍒犻櫎琛ㄥ崟绠$悊缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�').finally(() => loading.value = false); + await delFormManage(_ids); + proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + await getList(); +} + +/** 瀵煎嚭鎸夐挳鎿嶄綔 */ +const handleExport = () => { + proxy?.download('workflow/formManage/export', { + ...queryParams.value + }, `formManage_${new Date().getTime()}.xlsx`) +} + +onMounted(() => { + getList(); +}); +</script> diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index 6dfee4f..2712929 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -221,15 +221,17 @@ </el-dialog> <!-- 琛ㄥ崟閰嶇疆 --> <el-dialog v-model="formDialog.visible" :title="formDialog.title" width="650px" append-to-body :close-on-click-modal="false"> - <el-form :model="formDefinitionForm" label-width="auto"> + <el-form :model="definitionConfigForm" label-width="auto"> <el-form-item label="娴佺▼KEY"> - <el-input v-model="formDefinitionForm.processKey" disabled/> + <el-input v-model="definitionConfigForm.processKey" disabled/> </el-form-item> - <el-form-item label="璺敱鍦板潃"> - <el-input v-model="formDefinitionForm.path" placeholder="璇峰亣绀轰緥璺敱璇峰~鍐欙細/demo/leaveEdit/index"/> + <el-form-item label="琛ㄥ崟" prop="formId"> + <el-select v-model="definitionConfigForm.formId" clearable filterable placeholder="璇烽�夋嫨琛ㄥ崟" style="width: 260px" > + <el-option v-for="item in formManageList" :key="item.id" :label="item.formTypeName+':'+item.formName" :value="item.id" /> + </el-select> </el-form-item> <el-form-item label="澶囨敞"> - <el-input v-model="formDefinitionForm.remark" type="textarea" resize="none"/> + <el-input v-model="definitionConfigForm.remark" type="textarea" resize="none"/> </el-form-item> </el-form> @@ -258,12 +260,15 @@ } from '@/api/workflow/processDefinition'; import ProcessPreview from './components/processPreview.vue'; import { listCategory } from '@/api/workflow/category'; -import { getByDefId,saveOrUpdate } from '@/api/workflow/formDefinition'; +import { getByDefId,saveOrUpdate } from '@/api/workflow/definitionConfig'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessDefinitionQuery, ProcessDefinitionVO } from '@/api/workflow/processDefinition/types'; -import { FormDefinitionForm } from '@/api/workflow/formDefinition/types'; +import { definitionConfigForm } from '@/api/workflow/definitionConfig/types'; import { UploadRequestOptions } from 'element-plus'; +import { FormManageVO } from '@/api/workflow/formManage/types'; +import { selectListFormManage } from '@/api/workflow/formManage'; +const formManageList = ref<FormManageVO[]>([]); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const previewRef = ref<InstanceType<typeof ProcessPreview>>(); @@ -290,7 +295,7 @@ const categoryName = ref(''); /** 閮ㄧ讲鏂囦欢鍒嗙被閫夋嫨 */ const selectCategory = ref(); -const formDefinitionForm = ref<FormDefinitionForm>({}); +const definitionConfigForm = ref<definitionConfigForm>({}); const uploadDialog = reactive<DialogOption>({ visible: false, @@ -473,21 +478,22 @@ }; //鎵撳紑琛ㄥ崟閰嶇疆 const handleFormOpen = async (row: ProcessDefinitionVO) => { + listFormManage() formDialog.visible = true - formDefinitionForm.value.processKey = row.key - formDefinitionForm.value.definitionId = row.id + definitionConfigForm.value.processKey = row.key + definitionConfigForm.value.definitionId = row.id const resp = await getByDefId(row.id) if(resp.data){ - formDefinitionForm.value = resp.data + definitionConfigForm.value = resp.data }else{ - formDefinitionForm.value.path = undefined - formDefinitionForm.value.remark = undefined + definitionConfigForm.value.formId = undefined + definitionConfigForm.value.remark = undefined } } //淇濆瓨琛ㄥ崟 const handlerSaveForm = async () => { await proxy?.$modal.confirm('鏄惁纭淇濆瓨锛�'); - saveOrUpdate(formDefinitionForm.value).then(resp=>{ + saveOrUpdate(definitionConfigForm.value).then(resp=>{ if(resp.code === 200){ proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛'); formDialog.visible = false @@ -495,4 +501,9 @@ } }) } +//琛ㄥ崟鍒楄〃 +const listFormManage = async () => { + const res = await selectListFormManage(); + formManageList.value = res.data; +} </script> diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 88746c7..0da78bc 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -161,6 +161,8 @@ import { listCategory } from '@/api/workflow/category'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; //瀹℃壒璁板綍缁勪欢 const { proxy } = getCurrentInstance() as ComponentInternalInstance; const queryFormRef = ref<ElFormInstance>(); @@ -347,18 +349,14 @@ }; /** 鏌ョ湅鎸夐挳鎿嶄綔 */ const handleView = (row) => { - if(row.wfFormDefinitionVo){ - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: 'view' - } - }) - }else{ - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: 'view' + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; onMounted(() => { diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index eee6263..45ec729 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -54,13 +54,13 @@ </template> <template v-else> <el-tag type="success"> - {{ scope.row.assigneeName }} + {{ scope.row.assigneeName || '鏃�'}} </el-tag> </template> </template> <template v-else-if="tab === 'finish'" #default="scope"> <el-tag type="success"> - {{ scope.row.assigneeName }} + {{ scope.row.assigneeName || '鏃�'}} </el-tag> </template> </el-table-column> @@ -129,6 +129,8 @@ import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue'; import UserSelect from '@/components/UserSelect'; import { TaskQuery, TaskVO, VariableVo } from '@/api/workflow/task/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; //瀹℃壒璁板綍缁勪欢 //鍔犵缁勪欢 const multiInstanceUserRef = ref<InstanceType<typeof MultiInstanceUser>>(); @@ -260,18 +262,14 @@ }; /** 鏌ョ湅鎸夐挳鎿嶄綔 */ const handleView = (row) => { - if(row.wfFormDefinitionVo){ - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: 'view' - } - }) - }else{ - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: 'view' + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; onMounted(() => { getWaitingList(); diff --git a/src/views/workflow/task/myDocument.vue b/src/views/workflow/task/myDocument.vue index 9328934..8ccb3a5 100644 --- a/src/views/workflow/task/myDocument.vue +++ b/src/views/workflow/task/myDocument.vue @@ -117,6 +117,8 @@ import { listCategory } from '@/api/workflow/category'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const queryFormRef = ref<ElFormInstance>(); const categoryTreeRef = ref<ElTreeInstance>(); @@ -250,17 +252,13 @@ //鍔炵悊 const handleOpen = async (row,type) => { - if(row.wfFormDefinitionVo){ - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: type - } - }) - }else{ - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: type + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; </script> diff --git a/src/views/workflow/task/taskCopyList.vue b/src/views/workflow/task/taskCopyList.vue index 54e8f1e..7393999 100644 --- a/src/views/workflow/task/taskCopyList.vue +++ b/src/views/workflow/task/taskCopyList.vue @@ -43,7 +43,7 @@ </template> <template v-else> <el-tag type="success"> - {{ scope.row.assigneeName }} + {{ scope.row.assigneeName || '鏃�'}} </el-tag> </template> </template> @@ -73,6 +73,8 @@ <script lang="ts" setup> import { getPageByTaskCopy} from '@/api/workflow/task'; import { TaskQuery } from '@/api/workflow/task/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; //瀹℃壒璁板綍缁勪欢 const queryFormRef = ref<ElFormInstance>(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -127,18 +129,14 @@ /** 鏌ョ湅鎸夐挳鎿嶄綔 */ const handleView = (row) => { - if(row.wfFormDefinitionVo){ - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: 'view' - } - }) - }else{ - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: 'view' + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; diff --git a/src/views/workflow/task/taskFinish.vue b/src/views/workflow/task/taskFinish.vue index a1315b2..e6e3d6c 100644 --- a/src/views/workflow/task/taskFinish.vue +++ b/src/views/workflow/task/taskFinish.vue @@ -37,7 +37,7 @@ <el-table-column fixed align="center" prop="assigneeName" label="鍔炵悊浜�"> <template #default="scope"> <el-tag type="success"> - {{ scope.row.assigneeName }} + {{ scope.row.assigneeName || '鏃�'}} </el-tag> </template> </el-table-column> @@ -62,6 +62,8 @@ <script lang="ts" setup> import { getPageByTaskFinish } from '@/api/workflow/task'; import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; //瀹℃壒璁板綍缁勪欢 const queryFormRef = ref<ElFormInstance>(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -113,19 +115,15 @@ }); }; /** 鏌ョ湅鎸夐挳鎿嶄綔 */ -const handleView = (row) => { - if(row.wfFormDefinitionVo){ - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: 'view' - } - }) - }else{ - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } +const handleView = (row: TaskVO) => { + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: 'view' + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; onMounted(() => { diff --git a/src/views/workflow/task/taskWaiting.vue b/src/views/workflow/task/taskWaiting.vue index 29a52a2..af609cb 100644 --- a/src/views/workflow/task/taskWaiting.vue +++ b/src/views/workflow/task/taskWaiting.vue @@ -43,7 +43,7 @@ </template> <template v-else> <el-tag type="success"> - {{ scope.row.assigneeName }} + {{ scope.row.assigneeName || '鏃�' }} </el-tag> </template> </template> @@ -79,6 +79,9 @@ <script lang="ts" setup> import { getPageByTaskWait, claim, returnTask } from '@/api/workflow/task'; import { TaskQuery, TaskVO } from '@/api/workflow/task/types'; +import workflowCommon from '@/api/workflow/workflowCommon'; +import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; + //鎻愪氦缁勪欢 const queryFormRef = ref<ElFormInstance>(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -135,29 +138,14 @@ }; //鍔炵悊 const handleOpen = async (row: TaskVO) => { - if (row.formKey != null) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.formKey}`, - query: { - id: row.businessKey, - type: 'approval', - taskId: row.id - } - }); - } else if (row.wfFormDefinitionVo) { - proxy.$tab.closePage(proxy.$route); - proxy.$router.push({ - path: `${row.wfFormDefinitionVo.path}`, - query: { - id: row.businessKey, - type: 'approval', - taskId: row.id - } - }); - } else { - proxy?.$modal.msgError('璇峰埌娴佺▼瀹氫箟鑿滃崟閰嶇疆璺敱锛�'); - } + const routerJumpVo = reactive<RouterJumpVo>({ + wfDefinitionConfigVo: row.wfDefinitionConfigVo, + wfNodeConfigVo: row.wfNodeConfigVo, + businessKey: row.businessKey, + taskId: row.id, + type: 'approval' + }); + workflowCommon.routerJump(routerJumpVo,proxy) }; /** 璁ら浠诲姟 */ -- Gitblit v1.9.3