diff --git a/src/webapi/log.ts b/src/webapi/log.ts new file mode 100644 index 0000000..5b01ed0 --- /dev/null +++ b/src/webapi/log.ts @@ -0,0 +1,32 @@ +/** + * webapi/log.ts — 直接 import web 端 log.ts (v0.11+ Phase 2) + * + * 镜像 web/apps/jnpf-web-apps-main/src/api/system/log.ts 5 函数: + * getLogList / delLog / batchDelLog / getInfo / batchDelLoginLog + * + * 注: web getLogList 接受 category (1 登录 / 3 操作 / 4 异常 / 5 请求) + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const LOG_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/system/log.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(LOG_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadLog: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('log 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +}) diff --git a/src/webapi/message.ts b/src/webapi/message.ts new file mode 100644 index 0000000..dab7a30 --- /dev/null +++ b/src/webapi/message.ts @@ -0,0 +1,41 @@ +/** + * webapi/message.ts — 镜像 web 端 msgCenter/notice + msgTemplate (v0.11+ Phase 2) + * + * 镜像 2 个 web 文件 (12 函数): + * - web/api/msgCenter/notice.ts (5): getNoticeList, create, update, delNotice, sendNotice + * - web/api/msgCenter/msgTemplate.ts (7): getMsgTemplateList, create, update, getInfo, delMsgTemplate, copy, testMsgTemplate + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const NOTICE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/msgCenter/notice.ts' +const MSG_TEMPLATE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/msgCenter/msgTemplate.ts' + +let cached: { notice: any; template: any } | null = null + +export async function initWebapi(client: JnpfClient): Promise { + if (cached) return + const { initDefHttpShim } = await import('./_defhttp_shim.ts') + initDefHttpShim(client) + const notice = await loadWebModule(NOTICE_SRC) + const template = await loadWebModule(MSG_TEMPLATE_SRC) + cached = { notice, template } +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadNotice: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('message/notice 模块未初始化, 请先 await initWebapi(client)') + return cached.notice[prop] + }, +}) + +export const loadMsgTemplate: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('message/template 模块未初始化, 请先 await initWebapi(client)') + return cached.template[prop] + }, +}) diff --git a/src/webapi/monitor.ts b/src/webapi/monitor.ts new file mode 100644 index 0000000..9d1c638 --- /dev/null +++ b/src/webapi/monitor.ts @@ -0,0 +1,30 @@ +/** + * webapi/monitor.ts — 直接 import web 端 monitor.ts (v0.11+ Phase 2) + * + * 镜像 web/apps/jnpf-web-apps-main/src/api/system/monitor.ts 函数 + * (含 getSysMonitor 等) + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const MONITOR_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/system/monitor.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(MONITOR_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadMonitor: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('monitor 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +}) diff --git a/src/webapi/report.ts b/src/webapi/report.ts new file mode 100644 index 0000000..f3937aa --- /dev/null +++ b/src/webapi/report.ts @@ -0,0 +1,35 @@ +/** + * webapi/report.ts — 镜像 web 端 jnpf-web-datareport (v0.11+ Phase 2) + * + * 注意: 报表是独立子项目 jnpf-web-datareport + * 端点 (走主平台 backend): + * - /api/extend/ReportManage (CRUD 报表) + * - /api/extend/ReportCategory (分类) + * - /api/extend/DataReport (数据/预览) + * + * 用户 2026-06-25 修正: 报表 web 端在 jnpf-web-datareport, 不在主 webapp + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const REPORT_SRC = '/home/ubuntu/ccWorkDir/jnpf/前端/jnpf-web-datareport/src/api/index.js' + +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(REPORT_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadReport: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('report 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +}) diff --git a/src/webapi/role.ts b/src/webapi/role.ts new file mode 100644 index 0000000..b340aca --- /dev/null +++ b/src/webapi/role.ts @@ -0,0 +1,30 @@ +/** + * webapi/role.ts — 直接 import web 端 role.ts (v0.11+ Phase 2) + * + * 镜像 web/apps/jnpf-web-apps-main/src/api/permission/role.ts 7 函数: + * getRoleList / getRoleSelector / create / update / getInfo / delRole / getRoleByCondition + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const ROLE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/permission/role.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(ROLE_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadRole: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('role 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +}) diff --git a/src/webapi/schedule.ts b/src/webapi/schedule.ts new file mode 100644 index 0000000..ba5b5ce --- /dev/null +++ b/src/webapi/schedule.ts @@ -0,0 +1,32 @@ +/** + * webapi/schedule.ts — 直接 import web 端 task.ts (v0.11+ Phase 2) + * + * 镜像 web/apps/jnpf-web-apps-main/src/api/system/task.ts 7 函数: + * getTaskList / create / update / getInfo / delTask / getTaskLogList / getTaskMethodsList + * + * 端点: /api/scheduletask (Quartz cron 任务, 不是日历日程) + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const SCHEDULE_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/system/task.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(SCHEDULE_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadSchedule: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('schedule 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +}) diff --git a/src/webapi/visualdata.ts b/src/webapi/visualdata.ts new file mode 100644 index 0000000..93c0638 --- /dev/null +++ b/src/webapi/visualdata.ts @@ -0,0 +1,33 @@ +/** + * webapi/visualdata.ts — 镜像 web 端 jnpf-web-datascreen-vue3/src/api (v0.11+ Phase 2) + * + * 注意: 大屏是独立子项目 jnpf-web-datascreen-vue3, 端点: + * - /visual/list /visual/detail /visual/save /visual/update /visual/remove /visual/copy + * - /category/* /components/* /glob/* /record/* + * + * 用户 2026-06-25 修正: 大屏 web 端在 jnpf-web-datascreen-vue3, 不在主 webapp + */ +import { JnpfClient } from '../core/client.ts' +import { loadWebModule } from './_loader.ts' + +const VISUAL_DATA_SRC = '/home/ubuntu/ccWorkDir/jnpf/前端/jnpf-web-datascreen-vue3/src/api/visual.js' + +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(VISUAL_DATA_SRC) +} + +export function isWebapiLoaded(): boolean { + return cached !== null +} + +export const loadVisualData: any = new Proxy({} as any, { + get(_target, prop) { + if (!cached) throw new Error('visualdata 模块未初始化, 请先 await initWebapi(client)') + return cached[prop] + }, +})