From f32faa69e5b5d3597f9f2081cf6dc808195338b4 Mon Sep 17 00:00:00 2001 From: ssw Date: Mon, 29 Jun 2026 17:48:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(dacli/webapi):=20=E6=8A=A5=E8=A1=A8=20API?= =?UTF-8?q?=20=E9=95=9C=E5=83=8F=E8=B7=AF=E5=BE=84=E4=BB=8E=20jnpf-web-dat?= =?UTF-8?q?areport=20=E6=94=B9=E4=B8=BA=E4=B8=BB=20webapp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jnpf-web-datareport 是 jQuery 老项目, 没有 src/api/ 目录 (只有 src/index.js) 原路径 /jnpf/前端/jnpf-web-datareport/src/api/index.js 永远 ENOENT, 任何 dacli report 命令触发 initWebapi 都炸 新路径 /web/apps/jnpf-web-apps-main/src/api/onlineDev/report.ts 是 Vue 3 主 webapp 的报表 API 客户端, 导出 getReportList/getReportInfo/delReport/copy/ getData/saveVersion 等 6 个函数, 走 /api/Report 端点 (被 nginx 代理到报表服务 32000) 验证: loadWebModule 成功, 6 个函数都拿到, dacli report list --json 不再 ENOENT Co-Authored-By: Claude --- src/webapi/report.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/webapi/report.ts b/src/webapi/report.ts index f3937aa..9038d3b 100644 --- a/src/webapi/report.ts +++ b/src/webapi/report.ts @@ -1,18 +1,23 @@ /** - * webapi/report.ts — 镜像 web 端 jnpf-web-datareport (v0.11+ Phase 2) + * webapi/report.ts — 镜像 web 端报表 API (主 webapp 的 onlineDev/report.ts) * - * 注意: 报表是独立子项目 jnpf-web-datareport - * 端点 (走主平台 backend): - * - /api/extend/ReportManage (CRUD 报表) - * - /api/extend/ReportCategory (分类) - * - /api/extend/DataReport (数据/预览) - * - * 用户 2026-06-25 修正: 报表 web 端在 jnpf-web-datareport, 不在主 webapp + * 注意: + * - jnpf-web-datareport (jQuery 老项目) 没有 src/api/ 目录, 无法镜像 + * - 改用主 webapp Vue 3 版的 report.ts + * - 端点走 /api/Report (大写 R, 被 nginx 代理到报表服务 32000): + * - GET /api/Report 列表 + * - GET /api/Report/{id} 详情 + * - POST /api/Report 新建 + * - PUT /api/Report/{id} 修改 + * - DELETE /api/Report/{id} 删除 + * - POST /api/Report/{id}/Actions/Copy + * - POST /api/Report/Data 预览/取数 + * - POST /api/Report/Save 保存设计 */ 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' +const REPORT_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/onlineDev/report.ts' let cached: any = null