feat: 列表刷新修改
This commit is contained in:
@ -659,7 +659,7 @@ export function buildListCode(model: GeneratorConfig): string {
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed,${model.listConfig.isLeftMenu ? 'onMounted,' : ''}${
|
||||
import { ref, computed, onMounted, onUnmounted, ${
|
||||
hasBatchDeleteButton || hasDeleteButton || (hasSetUserIdButton && !isSetDataAuth)
|
||||
? 'createVNode,'
|
||||
: ''
|
||||
@ -790,6 +790,11 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
? `import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';`
|
||||
: ''
|
||||
}
|
||||
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
defineEmits(['register']);
|
||||
@ -831,8 +836,11 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
? `const printMenuId = computed(() => currentRoute.value.meta.menuId as string);`
|
||||
: ''
|
||||
}
|
||||
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
|
||||
const schemaIdComputedRef = computed(() => currentRoute.value.meta.schemaId as string);
|
||||
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||
|
||||
${
|
||||
hasStartWorkButton
|
||||
@ -1436,12 +1444,19 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
}`
|
||||
: ``
|
||||
}
|
||||
onMounted(() => {
|
||||
fetch();
|
||||
});
|
||||
`
|
||||
: ``
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
${ model.listConfig.isLeftMenu ? `fetch();` : ''}
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||
bus.off(CREATE_FLOW, handleRefresh);
|
||||
});
|
||||
function getActions(record: Recordable):ActionItem[] {
|
||||
${
|
||||
hasStartWorkButton
|
||||
|
||||
Reference in New Issue
Block a user