refactor(v0.11+): di 4 个 NEW-CMD 改走 webapi 镜像 (loadDataInterface)

- 新建 webapi/di.ts (镜像 web/api/systemData/dataInterface.ts 11 函数)
- di/info: c.get → loadDataInterface.getDataInterfaceInfo
- di/test: c.postJson → loadDataInterface.getDataInterfaceRes
- di/update: c.get+c.putJson → loadDataInterface.getDataInterfaceInfo+updateDataInterface
- di/delete: c.del → loadDataInterface.delDataInterface

webapi 镜像累计 14 个模块 (visualDev, dataModel, dataSource, dict, menu, workflow, role, log, monitor, message, schedule, visualdata, report, di)

Co-Authored-By: Claude <[email protected]>
This commit is contained in:
sswandClaude committed 2026-06-25 15:31:34 +08:00
1 parent 4669e35480
commit d1284c45cb
5 files changed
+81 -54

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
/**
* webapi/di.ts — 直接 import web 端 dataInterface.ts (v0.11+ Phase 2)
*
* 镜像 web/apps/jnpf-web-apps-main/src/api/systemData/dataInterface.ts 11 函数:
* getDataInterfaceList / getDataInterfaceSelector / createDataInterface /
* updateDataInterface / getDataInterfaceInfo / delDataInterface /
* getDataInterfaceRes (Preview) / getDataInterfaceParam / exportData /
* getDataInterfaceLog / getDataInterfaceDataSelect
*/
import { JnpfClient } from '../core/client.ts'
import { loadWebModule } from './_loader.ts'
const DI_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/systemData/dataInterface.ts'
let cached: any = null
export async function initWebapi(client: JnpfClient): Promise<void> {
if (cached) return
const { initDefHttpShim } = await import('./_defhttp_shim.ts')
initDefHttpShim(client)
cached = await loadWebModule(DI_SRC)
}
export function isWebapiLoaded(): boolean {
return cached !== null
}
export const loadDataInterface: any = new Proxy({} as any, {
get(_target, prop) {
if (!cached) throw new Error('di 模块未初始化, 请先 await initWebapi(client)')
return cached[prop]
},
})