dacli(镜像 webapi jxcj 2026-07-01): report 走 webapi + reportHttp shim + 32000 启动
按 CLAUDE.md §2.6 镜像架构 + BS-新12 v2:
1. **webapi/report.ts 新增 5 个函数** (镜像 web 端 report.ts:22 createReport):
- getReportList(params)
- getReportInfo(id)
- createReport(params) (镜像 web report.ts:22)
- updateReport(params + id) (镜像 web report.ts:23)
- delReport(id)
- 全部走 loadReport Proxy 模式, 跟 webapi/portal.ts 一致
2. **_defhttp_shim.ts 新增 reportHttp shim** (jxcj 2026-07-01):
- 镜像 web 端 reportHttp (独立 baseURL → 报表服务 32000)
- 跟 defHttp 同样方法 (get/post/put/delete)
- dacli 没多 client 机制, 走主 30000 client (nginx 代理 /api/Report/ → 32000)
- 跟 web 端 report.ts schema 完全一致 (cells/snapshot/formData), 不与 web 端 schema 漂移
3. **commands/report/create.ts 镜像 web 端** (跟 portal/create.ts 同模式):
- 用 webapi/report.createReport (而非直接 c.postJson)
- body 镜像 web/.../views/onlineDev/report/Form.vue: handleSubmit
- 'const query = { ...values, id: state.dataForm.id }; createReport(query)'
- 7 个 option: --fullName --enCode --category --description --sortCode --cells --snapshot
4. **报表服务 32000 启动** (per CLAUDE.md §常用命令):
- java -Dloader.path=boot/report/lib/ -jar boot/report/jnpf-datareport-univer-admin-*.jar
- Tomcat on port 32000 (Started in 14.85s)
- 跨服务 sa-token 受限 (jnpf 已知问题, 见 boot/report/sa-token-override/README.md '已知限制')
- 端到端跑: 命令已就位 + 32000 启动, 待跨服务 token 共享或主服务 token 走 nginx 代理可解
5. **portal (已镜像)** + **大屏/报表 (走 form create type=1+webType=4 数据视图)** + **DI (走 dacli di create)**:
- 4 能力 (大屏/门户/报表/DI) 全部镜像 web 端
镜像依据 (web 端 1:1):
- web/.../api/onlineDev/report.ts:22 createReport + reportHttp 走 /api/Report
- web/.../views/onlineDev/report/Form.vue: handleSubmit 'const query = {...values, id}; createReport(query)'
- 后端 jnpf-java-datareport-univer/.../ReportController.java: POST /api/Report
- 后端 jnpf/.../ReportCrForm.java: systemId/fullName/enCode/category/sortCode/description/cells/snapshot/enabledMark
Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
3b013fdb3e
commit
f8aad5200d
3 files changed
+97
-41
No files matched your search
@@ -119,4 +119,34 @@ export const defHttp = {
|
||||
const r = await c.del<T>(stripApiPrefix(config.url))
|
||||
return unwrap<T>(r)
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* shim of web reportHttp (jxcj 2026-07-01 镜像 web 端 report.ts)
|
||||
*
|
||||
* 区别: web 端 reportHttp 走独立 reportApiURL (jnpf 报表服务端口 32000, jnpf-datareport-univer 微服务).
|
||||
* dacli 没多 client 机制, 但 nginx 已经把 /api/Report/ 代理到 32000, 走主 30000 client 等价.
|
||||
* 镜像目的: 跟 web 端 report.ts 同 schema (formData cells snapshot 等), 不与 web 端 schema 漂移.
|
||||
*/
|
||||
export const reportHttp = {
|
||||
async get<T = unknown>(config: { url: string; data?: Record<string, unknown> }): Promise<T> {
|
||||
const c = getClient()
|
||||
const r = await c.get<T>(stripApiPrefix(config.url), cleanQuery(config.data))
|
||||
return unwrap<T>(r)
|
||||
},
|
||||
async post<T = unknown>(config: { url: string; data?: unknown }): Promise<T> {
|
||||
const c = getClient()
|
||||
const r = await c.postJson<T>(stripApiPrefix(config.url), config.data ?? {})
|
||||
return unwrap<T>(r)
|
||||
},
|
||||
async put<T = unknown>(config: { url: string; data?: unknown }): Promise<T> {
|
||||
const c = getClient()
|
||||
const r = await c.putJson<T>(stripApiPrefix(config.url), config.data ?? {})
|
||||
return unwrap<T>(r)
|
||||
},
|
||||
async delete<T = unknown>(config: { url: string; data?: unknown }): Promise<T> {
|
||||
const c = getClient()
|
||||
const r = await c.del<T>(stripApiPrefix(config.url))
|
||||
return unwrap<T>(r)
|
||||
},
|
||||
}
|
||||
@@ -46,3 +46,28 @@ export const loadReport: any = new Proxy({} as any, {
|
||||
return cached[prop]
|
||||
},
|
||||
})
|
||||
|
||||
/** 获取报表列表 (镜像 web report.ts: getReportList) */
|
||||
export async function getReportList(params?: Record<string, unknown>): Promise<unknown> {
|
||||
return loadReport.getReportList(params)
|
||||
}
|
||||
|
||||
/** 获取报表信息 (镜像 web report.ts: getReportInfo) */
|
||||
export async function getReportInfo(id: string): Promise<unknown> {
|
||||
return loadReport.getReportInfo(id)
|
||||
}
|
||||
|
||||
/** 创建报表 (镜像 web report.ts:22 createReport) */
|
||||
export async function createReport(params: Record<string, unknown>): Promise<unknown> {
|
||||
return loadReport.createReport(params)
|
||||
}
|
||||
|
||||
/** 更新报表 (镜像 web report.ts:23 updateReport) */
|
||||
export async function updateReport(params: Record<string, unknown> & { id: string }): Promise<unknown> {
|
||||
return loadReport.updateReport(params)
|
||||
}
|
||||
|
||||
/** 删除报表 (镜像 web report.ts: delReport) */
|
||||
export async function delReport(id: string): Promise<unknown> {
|
||||
return loadReport.delReport(id)
|
||||
}
|
||||
Reference in new issue
Block a user