From 666f211700dee31423db6692882e3e40df83a127 Mon Sep 17 00:00:00 2001 From: GAOANG <1140589958@qq.com> Date: Sun, 28 Apr 2024 10:26:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E4=B8=B0=E6=B1=9F=20=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E8=A1=A8=E5=8D=95=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/useWorkFlowForm.ts | 34 -------------------- src/utils/helper/generatorHelper.ts | 40 ++++++++++-------------- src/views/secondDev/formCreatePage.vue | 43 ++++++-------------------- 3 files changed, 26 insertions(+), 91 deletions(-) diff --git a/src/hooks/web/useWorkFlowForm.ts b/src/hooks/web/useWorkFlowForm.ts index 6437739..0b9ff27 100644 --- a/src/hooks/web/useWorkFlowForm.ts +++ b/src/hooks/web/useWorkFlowForm.ts @@ -497,37 +497,3 @@ export function changeSchemaDisabled(schemas) { }); return schemas; } -// 辅助设置表单可以编辑 -export function changeSchemaEnable(schemas) { - const layoutComponents = ['tab', 'grid', 'card']; - schemas?.map((info) => { - if (layoutComponents.includes(info.type!)) { - info.children?.map((childInfo) => { - childInfo.list.map((com) => { - if (layoutComponents.includes(com.type)) { - changeSchemaDisabled(childInfo.list); - } else { - com.dynamicDisabled = false; - } - }); - }); - } else if (info.type == 'table-layout') { - info.children?.map((childInfo) => { - childInfo.list.map((com) => { - com.children.map((el) => { - if (layoutComponents.includes(el.type) || el.type == 'table-layout') { - changeSchemaDisabled(com.children); - } else { - el.dynamicDisabled = false; - } - }); - }); - }); - } else if (info.type == 'one-for-one') { - changeSchemaDisabled(info.componentProps.childSchemas); - } else { - info.dynamicDisabled = false; - } - }); - return schemas; -} \ No newline at end of file diff --git a/src/utils/helper/generatorHelper.ts b/src/utils/helper/generatorHelper.ts index e31555f..81b3abd 100644 --- a/src/utils/helper/generatorHelper.ts +++ b/src/utils/helper/generatorHelper.ts @@ -841,7 +841,6 @@ ${hasTemplatePrint ? ' reactive ' : ''} formIdComputedRef.value = currentRoute.value.meta.formId const schemaIdComputedRef = ref(); schemaIdComputedRef.value = currentRoute.value.meta.schemaId - const menuId = currentRoute.value.meta.menuId; ${ hasStartWorkButton @@ -1019,8 +1018,7 @@ ${hasTemplatePrint ? ' reactive ' : ''} router.push({ path: '/form/${lowerClassName}/' + record.id + '/viewForm', query: { - formPath: '${model.outputConfig.outputValue}/${lowerClassName}', - menuId: menuId + formPath: '${model.outputConfig.outputValue}/${lowerClassName}' } }); } @@ -1349,8 +1347,7 @@ ${hasTemplatePrint ? ' reactive ' : ''} router.push({ path: '/form/${lowerClassName}/' + record.id + '/viewForm', query: { - formPath: '${model.outputConfig.outputValue}/${lowerClassName}', - menuId: menuId + formPath: '${model.outputConfig.outputValue}/${lowerClassName}' } });` : ` @@ -1481,7 +1478,6 @@ ${hasTemplatePrint ? ' reactive ' : ''} icon: button?.icon, tooltip: button?.name, onClick: handleView.bind(null, record), - code: button.code }); } if (['edit', 'copyData', 'delete'].includes(button.code)) { @@ -1511,6 +1507,18 @@ ${hasTemplatePrint ? ' reactive ' : ''} act.onClick = handleStartwork.bind(null, record); } actionsList.unshift(act); + ${ + hasFlowRecordButton + ? `if (hasFlowRecord) { + actionsList.splice(1, 0, { + tooltip: '查看流转记录', + icon: 'liuzhuanxinxi|svg', + onClick: handleFlowRecord.bind(null, record), + }); + }` + : '' + } + } else { actionsList.unshift({ icon: 'faqishenpi|svg', @@ -1525,14 +1533,7 @@ ${hasTemplatePrint ? ' reactive ' : ''} actionsList = actionsList.concat(editAndDelBtn); } } - return filterAction(actionsList, record); - } - function filterAction(list, record) { - const result = list.filter((item)=> { - let conditions = item.code !== 'view' - return conditions - }) - return result + return actionsList; } ` : ` @@ -1543,7 +1544,6 @@ ${hasTemplatePrint ? ' reactive ' : ''} tooltip: button?.name, color: button.code === 'delete' ? 'error' : undefined, onClick: btnEvent[button.code].bind(null, record), - code: button?.code }; } else { if (button.code === 'view') { @@ -1551,21 +1551,13 @@ ${hasTemplatePrint ? ' reactive ' : ''} icon: button?.icon, tooltip: button?.name, onClick: btnEvent[button.code].bind(null, record), - code: button?.code }; } else { return {}; } } }); - return filterAction(actionsList, record); - } - function filterAction(list, record) { - const result = list.filter((item)=> { - let conditions = item.code === 'view' || item.code === 'delete' - return conditions - }) - return result + return actionsList; }` } ${ diff --git a/src/views/secondDev/formCreatePage.vue b/src/views/secondDev/formCreatePage.vue index a10ab4d..02dcf20 100644 --- a/src/views/secondDev/formCreatePage.vue +++ b/src/views/secondDev/formCreatePage.vue @@ -8,17 +8,11 @@ 关闭 - - - - - 编辑 - - + - 保存 + 确认 @@ -29,14 +23,13 @@