diff --git a/src/utils/helper/generatorHelper.ts b/src/utils/helper/generatorHelper.ts index 85ef0f8..a67902e 100644 --- a/src/utils/helper/generatorHelper.ts +++ b/src/utils/helper/generatorHelper.ts @@ -825,12 +825,14 @@ ${hasTemplatePrint ? ' reactive ' : ''} const btnEvent = ${btnEvent} const { currentRoute } = useRouter(); + const router = useRouter(); ${ hasTemplatePrint ? `const printMenuId = computed(() => currentRoute.value.meta.menuId as string);` : '' } const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string); + const schemaIdComputedRef = computed(() => currentRoute.value.meta.schemaId as string); ${ hasStartWorkButton @@ -1000,16 +1002,17 @@ ${hasTemplatePrint ? ' reactive ' : ''} hasAddButton ? ` function handleAdd() { - ${ - formType === 'modal' - ? ` - openModal(true, { - isUpdate: false, - });` - : ` - openDrawer(true, { - isUpdate: false, - });` + if (schemaIdComputedRef.value) { + router.push({ + path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow' + }); + } else { + router.push({ + path: '/form/${lowerClassName}/0/createForm', + query: { + formPath: '${model.outputConfig.outputValue}/${lowerClassName}' + } + }); } }` : '' @@ -1021,9 +1024,11 @@ ${hasTemplatePrint ? ' reactive ' : ''} ${ formType === 'modal' ? ` - openModal(true, { - id: record.${camelCaseString(mainTable.pkField)}, - isUpdate: true, + router.push({ + path: '/form/${lowerClassName}/' + record.id + '/updateForm', + query: { + formPath: '${model.outputConfig.outputValue}/${lowerClassName}' + } });` : ` openDrawer(true, { @@ -1303,10 +1308,12 @@ ${hasTemplatePrint ? ' reactive ' : ''} ${ formType === 'modal' ? ` - openModal(true, { - isView: true, - id: record.${camelCaseString(mainTable.pkField)}, - });` + router.push({ + path: '/form/${lowerClassName}/' + record.id + '/viewForm', + query: { + formPath: '${model.outputConfig.outputValue}/${lowerClassName}' + } + });` : ` openDrawer(true, { isView: true, @@ -1547,10 +1554,13 @@ ${hasTemplatePrint ? ' reactive ' : ''} } } function handleApproveProcess(record: Recordable) { - visibleApproveProcessRef.value = true; - schemaIdRef.value = record.workflowData.schemaId; - processIdRef.value = record.workflowData.processId; - taskIdRef.value = record.workflowData.taskIds[0]; + const { processId, taskIds, schemaId } = record.workflowData; + router.push({ + path: '/flow/' + schemaId + '/' + processId + '/approveFlow', + query: { + taskId: taskIds[0] + } + }); } function handleCloseLaunch() { visibleLaunchProcessRef.value = false; diff --git a/src/views/secondDev/approveFlowPage.vue b/src/views/secondDev/approveFlowPage.vue index 035000d..33922b6 100644 --- a/src/views/secondDev/approveFlowPage.vue +++ b/src/views/secondDev/approveFlowPage.vue @@ -36,16 +36,9 @@ - + @@ -54,231 +47,231 @@ diff --git a/src/views/secondDev/createFlow.vue b/src/views/secondDev/createFlow.vue index f393f54..4683995 100644 --- a/src/views/secondDev/createFlow.vue +++ b/src/views/secondDev/createFlow.vue @@ -36,7 +36,9 @@
- +
@@ -45,252 +47,293 @@ 关闭 + diff --git a/src/views/workflow/task/FlowLaunch.vue b/src/views/workflow/task/FlowLaunch.vue index ccf7d6b..0457612 100644 --- a/src/views/workflow/task/FlowLaunch.vue +++ b/src/views/workflow/task/FlowLaunch.vue @@ -1,169 +1,170 @@ diff --git a/src/views/workflow/task/components/processTasks/DraftsV2.vue b/src/views/workflow/task/components/processTasks/DraftsV2.vue index 4c89dc5..5ee58ba 100644 --- a/src/views/workflow/task/components/processTasks/DraftsV2.vue +++ b/src/views/workflow/task/components/processTasks/DraftsV2.vue @@ -4,122 +4,124 @@ - + diff --git a/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue b/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue index c3ed2f4..fa51d09 100644 --- a/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue +++ b/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue @@ -114,6 +114,15 @@ }); const router = useRouter(); const { currentRoute } = router; + + + onMounted(() => { + bus.on(FLOW_PROCESSED, onFlowProcessed); + }); + + onUnmounted(() => { + bus.off(FLOW_PROCESSED, onFlowProcessed); + }); watch( () => unref(currentRoute), (val) => { @@ -134,14 +143,6 @@ function onFlowProcessed() { reload(); } - - onMounted(() => { - bus.on(FLOW_PROCESSED, onFlowProcessed); - }); - - onUnmounted(() => { - bus.off(FLOW_PROCESSED, onFlowProcessed); - });