解决找不到审批视图组件的问题

This commit is contained in:
xiaocp2009 2025-11-04 10:45:43 +08:00
parent 6d759b55a3
commit a6fd75bfd3
2 changed files with 8 additions and 3 deletions

View File

@ -88,7 +88,8 @@ export async function loadDynamicComponent(
formPath: string,
{ delay = 2000, timeout = 3000 } = {}
) {
const suffix = `${humpToLine(formPath)}.vue`;
//const suffix = `${humpToLine(formPath)}index.vue`;
const suffix = `${humpToLine(formPath)}`;
const componentPath = suffix.replace('/workflow', '/workflow/form');
const matched = Object.entries(modules).find(([path]) => path.endsWith(componentPath));

View File

@ -45,8 +45,12 @@ const title = computed(() => {
const formPaths = ref<SelectOption[]>([]);
const modules = import.meta.glob('@/components/workflow/form/**/*.vue');
Object.keys(modules).forEach(key => {
const label = key.replace('/src/components/workflow/form/', '');
const value = key.replace('/src/components/workflow/form', '/workflow');
//const label = key.replace('/src/components/workflow/form/', '');
//const value = key.replace('/src/components/workflow/form', '/workflow');
const label = key.replace('/src/components/workflow/form/', '').replace('/index.vue', '');
//const value = key.replace('/src/components/workflow/form', '/workflow').replace('index.vue', '');
formPaths.value.push({ label, value });
});