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[] { ${