From 20af2adad1811c4491453c4bfb6eb949c6c0a043 Mon Sep 17 00:00:00 2001 From: GAOANG <1140589958@qq.com> Date: Mon, 22 Apr 2024 09:14:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20form=E8=A1=A8=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=9B=91=E5=90=AC=E5=88=B7=E6=96=B0=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/helper/generatorHelper.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/utils/helper/generatorHelper.ts b/src/utils/helper/generatorHelper.ts index 343fcf7..81b3abd 100644 --- a/src/utils/helper/generatorHelper.ts +++ b/src/utils/helper/generatorHelper.ts @@ -793,7 +793,7 @@ ${hasTemplatePrint ? ' reactive ' : ''} import useEventBus from '/@/hooks/event/useEventBus'; - const { bus, CREATE_FLOW, FLOW_PROCESSED } = useEventBus(); + const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { notification } = useMessage(); const { t } = useI18n(); @@ -1450,12 +1450,20 @@ ${hasTemplatePrint ? ' reactive ' : ''} onMounted(() => { ${ model.listConfig.isLeftMenu ? `fetch();` : ''} - bus.on(FLOW_PROCESSED, handleRefresh); - bus.on(CREATE_FLOW, handleRefresh); + if (schemaIdComputedRef.value) { + bus.on(FLOW_PROCESSED, handleRefresh); + bus.on(CREATE_FLOW, handleRefresh); + } else { + bus.on(FORM_LIST_MODIFIED, handleRefresh); + } }); onUnmounted(() => { - bus.off(FLOW_PROCESSED, handleRefresh); - bus.off(CREATE_FLOW, handleRefresh); + if (schemaIdComputedRef.value) { + bus.off(FLOW_PROCESSED, handleRefresh); + bus.off(CREATE_FLOW, handleRefresh); + } else { + bus.off(FORM_LIST_MODIFIED, handleRefresh); + } }); function getActions(record: Recordable):ActionItem[] { ${