diff --git a/src/api/workflow/model/index.ts b/src/api/workflow/model/index.ts index f58cdd3..56f7fed 100644 --- a/src/api/workflow/model/index.ts +++ b/src/api/workflow/model/index.ts @@ -89,3 +89,16 @@ export const modelDeploy = (id: string): AxiosPromise => { method: 'post' }); }; + +/** + * 复制模型 + * @param data + * @returns {*} + */ +export const copyModel = (data: ModelForm): AxiosPromise => { + return request({ + url: '/workflow/model/copyModel', + method: 'post', + data: data + }); +}; \ No newline at end of file diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts index 0425a1a..5b24aa0 100644 --- a/src/api/workflow/task/types.ts +++ b/src/api/workflow/task/types.ts @@ -40,7 +40,6 @@ export interface TaskVO extends BaseEntity { multiInstance?: boolean; businessKey?: string; wfNodeConfigVo?: NodeConfigVO; - wfDefinitionConfigVo?: DefinitionConfigVO; } export interface VariableVo { diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts index b2846b2..a90216a 100644 --- a/src/api/workflow/workflowCommon/index.ts +++ b/src/api/workflow/workflowCommon/index.ts @@ -22,28 +22,8 @@ export default { 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('请到流程定义菜单配置路由!'); + }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 index 698c849..9bd2454 100644 --- a/src/api/workflow/workflowCommon/types.ts +++ b/src/api/workflow/workflowCommon/types.ts @@ -1,8 +1,6 @@ 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; diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index b0e4c11..ca8ac9e 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -209,10 +209,15 @@ const handleCompleteTask = async () => { await proxy?.$modal.confirm('是否确认提交?'); loading.value = true; buttonLoading.value = true; - await completeTask(form.value).finally(() => (loading.value = false)); - dialog.visible = false; - emits('submitCallback'); - proxy?.$modal.msgSuccess('操作成功'); + try { + await completeTask(form.value); + dialog.visible = false; + emits('submitCallback'); + proxy?.$modal.msgSuccess('操作成功'); + }finally { + loading.value = false + buttonLoading.value = false + } }; /** 驳回弹窗打开 */ diff --git a/src/views/workflow/model/index.vue b/src/views/workflow/model/index.vue index b3a7a68..e5cff45 100644 --- a/src/views/workflow/model/index.vue +++ b/src/views/workflow/model/index.vue @@ -59,7 +59,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -105,10 +110,10 @@ - + - + ([]); const categoryOptions = ref([]); const categoryName = ref(''); -const modelId = ref(''); +const billType = ref(''); const dialog = reactive({ visible: false, @@ -268,14 +274,18 @@ const clickDeploy = async (id: string, key: string) => { await getList(); proxy?.$modal.msgSuccess('部署成功'); }; +//新增打开 const handleAdd = () => { + billType.value = 'add'; ids.value = []; getTreeselect(); form.value = { ...initFormData }; dialog.visible = true; dialog.title = '新增模型'; }; +//修改打开 const handleUpdate = () => { + billType.value = 'update'; dialog.title = '修改模型'; nextTick(async () => { await getTreeselect(); @@ -286,20 +296,35 @@ const handleUpdate = () => { }); }; +//复制打开 +const handleCopy = (row?: ModelVO) => { + billType.value = 'copy'; + dialog.title = '复制模型'; + nextTick(async () => { + await getTreeselect(); + form.value = { ...initFormData }; + form.value.id = row.id + dialog.visible = true; + }); +}; + /** 提交按钮 */ const submitForm = () => { formRef.value.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; - if (ids.value && ids.value.length > 0) { + if('copy' === billType.value){ + await copyModel(form.value); + proxy?.$modal.msgSuccess('操作成功'); + }else if(ids.value && ids.value.length > 0 && 'update' === billType.value){ form.value.id = ids.value[0]; await update(form.value); - proxy?.$modal.msgSuccess('新增成功'); - } else { + proxy?.$modal.msgSuccess('操作成功'); + }else { initXml(form.value.key, form.value.name); form.value.xml = xml.value; await addModel(form.value); - proxy?.$modal.msgSuccess('新增成功'); + proxy?.$modal.msgSuccess('操作成功'); } dialog.visible = false; await getList(); diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue index d41bc95..a3c26df 100644 --- a/src/views/workflow/processDefinition/index.vue +++ b/src/views/workflow/processDefinition/index.vue @@ -108,7 +108,6 @@ @@ -211,39 +210,11 @@ 转换模型 - - 表单配置 - - - - - - - - - - - - - - - - - - - @@ -260,15 +231,10 @@ import { } from '@/api/workflow/processDefinition'; import ProcessPreview from './components/processPreview.vue'; import { listCategory } from '@/api/workflow/category'; -import { getByDefId,saveOrUpdate } from '@/api/workflow/definitionConfig'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessDefinitionQuery, ProcessDefinitionVO } from '@/api/workflow/processDefinition/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([]); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const previewRef = ref>(); @@ -295,7 +261,6 @@ const categoryOptions = ref([]); const categoryName = ref(''); /** 部署文件分类选择 */ const selectCategory = ref(); -const definitionConfigForm = ref({}); const uploadDialog = reactive({ visible: false, @@ -307,11 +272,6 @@ const processDefinitionDialog = reactive({ title: '历史版本' }); -const formDialog = reactive({ - visible: false, - title: '表单配置' -}); - // 查询参数 const queryParams = ref({ pageNum: 1, @@ -476,34 +436,4 @@ const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest => }); return; }; -//打开表单配置 -const handleFormOpen = async (row: ProcessDefinitionVO) => { - listFormManage() - formDialog.visible = true - definitionConfigForm.value.processKey = row.key - definitionConfigForm.value.definitionId = row.id - const resp = await getByDefId(row.id) - if(resp.data){ - definitionConfigForm.value = resp.data - }else{ - definitionConfigForm.value.formId = undefined - definitionConfigForm.value.remark = undefined - } -} -//保存表单 -const handlerSaveForm = async () => { - await proxy?.$modal.confirm('是否确认保存?'); - saveOrUpdate(definitionConfigForm.value).then(resp=>{ - if(resp.code === 200){ - proxy?.$modal.msgSuccess('操作成功'); - formDialog.visible = false - getList(); - } - }) -} -//表单列表 -const listFormManage = async () => { - const res = await selectListFormManage(); - formManageList.value = res.data; -}