feat: 列表刷新修改
This commit is contained in:
@ -5,6 +5,7 @@ export default function () {
|
||||
return {
|
||||
bus,
|
||||
FLOW_PROCESSED: 'flow_processed',
|
||||
FORM_LIST_MODIFIED: 'form_list_modified'
|
||||
FORM_LIST_MODIFIED: 'form_list_modified',
|
||||
CREATE_FLOW: 'create_flow'
|
||||
};
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -68,6 +68,9 @@ import { separator } from '/@bpmn/config/info';
|
||||
import { message } from 'ant-design-vue';
|
||||
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
|
||||
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
|
||||
const { bus, CREATE_FLOW } = useEventBus();
|
||||
|
||||
const router = useRouter();
|
||||
const tabStore = useMultipleTabStore();
|
||||
@ -198,6 +201,7 @@ function createFlowSuccess(taskList) {
|
||||
data.submitLoading = false;
|
||||
loading.value = false
|
||||
setTimeout(() => {
|
||||
bus.emit(CREATE_FLOW, {});
|
||||
close();
|
||||
}, 500);
|
||||
}
|
||||
@ -224,6 +228,7 @@ function flowSuccess() {
|
||||
});
|
||||
message.success('操作成功');
|
||||
setTimeout(() => {
|
||||
bus.emit(CREATE_FLOW, {});
|
||||
close();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user