| | |
| | | } from "../approve-template/selectOptionSource.js"; |
| | | import { enrichInstanceRowFromFormConfig } from "./approvalInstanceFormConfigTable.js"; |
| | | import { |
| | | filterInstanceRowsByModuleSearch, |
| | | hasActiveModuleSearch, |
| | | } from "./approvalInstanceListSearch.js"; |
| | | import { |
| | | getApprovalModuleConfig, |
| | | getModuleListBusinessType, |
| | | resolveModuleBusinessType, |
| | |
| | | const moduleConfig = computed(() => getApprovalModuleConfig(moduleKey)); |
| | | const businessTypeOptions = ref([]); |
| | | |
| | | /** 与审批列表一致:优先用 TypeEnums 的 value,匹配不到再回退 approvalType */ |
| | | /** 列表查询 businessType:优先 registry 写死枚举,再回退 TypeEnums */ |
| | | const defaultListBusinessType = computed(() => { |
| | | const fixed = getModuleListBusinessType(moduleKey); |
| | | if (fixed != null && fixed !== "") return fixed; |
| | | const resolved = resolveModuleBusinessType(moduleKey, businessTypeOptions.value); |
| | | if (resolved != null && resolved !== "") return resolved; |
| | | return getModuleListBusinessType(moduleKey); |
| | | return ""; |
| | | }); |
| | | |
| | | async function loadBusinessTypeOptions() { |
| | |
| | | const caches = await fetchSelectOptionCaches( |
| | | collectOptionSourcesFromFields(allFields) |
| | | ); |
| | | tableData.value = mapped.map((row) => mapListRow(row, caches)); |
| | | page.total = total; |
| | | let rows = mapped.map((row) => mapListRow(row, caches)); |
| | | if (hasActiveModuleSearch(moduleKey, searchForm)) { |
| | | rows = filterInstanceRowsByModuleSearch(moduleKey, rows, searchForm); |
| | | } |
| | | tableData.value = rows; |
| | | page.total = hasActiveModuleSearch(moduleKey, searchForm) |
| | | ? rows.length |
| | | : total; |
| | | } catch { |
| | | tableData.value = []; |
| | | page.total = 0; |