/** * webapi/dict.ts — 直接 import web 端 dictionary.ts (v0.11+) * * web/apps/jnpf-web-apps-main/src/api/systemData/dictionary.ts 15 函数: * - 字典类型 (Dictionary Type): getDictionaryType / getDictionaryTypeSelector / * createDictionaryType / updateDictionaryType / getDictionaryTypeInfo / delDictionaryType * - 字典数据 (Dictionary Data): getDictionaryDataList / getDictionaryAll / * getDictionaryDataTypeSelector / getDictionaryDataSelector / createDictionaryData / * updateDictionaryData / getDictionaryDataInfo / delDictionaryData * - 导出: exportData * * 注意: 字典全平台唯一 (enCode + fullName), BS-47 */ import { JnpfClient } from '../core/client.ts' import { loadWebModule } from './_loader.ts' const DICT_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/systemData/dictionary.ts' let cached: any = null export async function initWebapi(client: JnpfClient): Promise { if (cached) return const { initDefHttpShim } = await import('./_defhttp_shim.ts') initDefHttpShim(client) cached = await loadWebModule(DICT_SRC) } export function isWebapiLoaded(): boolean { return cached !== null } export const loadDict: any = new Proxy({} as any, { get(_target, prop) { if (!cached) { throw new Error(`dict 模块未初始化, 请先 await initWebapi(client)`) } return cached[prop] }, })