feat: form表单列表监听刷新 修改
This commit is contained in:
@ -793,7 +793,7 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
|
|
||||||
import useEventBus from '/@/hooks/event/useEventBus';
|
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 { notification } = useMessage();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -1450,12 +1450,20 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
${ model.listConfig.isLeftMenu ? `fetch();` : ''}
|
${ model.listConfig.isLeftMenu ? `fetch();` : ''}
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||||
bus.on(CREATE_FLOW, handleRefresh);
|
bus.on(CREATE_FLOW, handleRefresh);
|
||||||
|
} else {
|
||||||
|
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||||
bus.off(CREATE_FLOW, handleRefresh);
|
bus.off(CREATE_FLOW, handleRefresh);
|
||||||
|
} else {
|
||||||
|
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
function getActions(record: Recordable):ActionItem[] {
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
${
|
${
|
||||||
|
|||||||
Reference in New Issue
Block a user