feat: form表单列表监听刷新 修改

This commit is contained in:
GAOANG
2024-04-22 09:14:39 +08:00
parent 881112f604
commit 20af2adad1

View File

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