From ac71192e9ada38ff25df462749bb9f9cffc51a8a Mon Sep 17 00:00:00 2001 From: ssw Date: Wed, 1 Jul 2026 03:22:07 +0800 Subject: [PATCH] =?UTF-8?q?dacli(web-patches):=20jxcj=20=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?/=E9=97=A8=E6=88=B7/=E6=8A=A5=E8=A1=A8=203=20=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 dacli/docs/web-patches/jxcj-dashboard-portal-report.md: - 3 个 no-spa-page HTML 页面 (dashboard/portal/report) - 走 4 个真实 DI (JxcjCompetitionStatus / Summary / TeamStatusChart / FinalRankingReport) - BS-新12 反馈: dacli bigscreen/portal create silent fail (id=undefined) Co-Authored-By: Claude --- .../jxcj-dashboard-portal-report.md | 173 ++++++++++++++ docs/web-patches/jxcj-official-site.md | 218 ++++++++++++++++++ 2 files changed, 391 insertions(+) create mode 100644 docs/web-patches/jxcj-dashboard-portal-report.md create mode 100644 docs/web-patches/jxcj-official-site.md diff --git a/docs/web-patches/jxcj-dashboard-portal-report.md b/docs/web-patches/jxcj-dashboard-portal-report.md new file mode 100644 index 0000000..57f0b50 --- /dev/null +++ b/docs/web-patches/jxcj-dashboard-portal-report.md @@ -0,0 +1,173 @@ +# web-patch: jxcj 大屏/门户/报表 3 个 no-spa-page 页面 + +**patch 日期**: 2026-07-01 +**appCode**: jxcj +**patch 类型**: 扩展 `web/apps/jnpf-web-apps-main/public/ssw/jxcj/` (no-spa-page 静态扩展, 不在 web 主包构建里, 不被 jnpf 升级覆盖) + +--- + +## 改动清单 + +| # | 文件 | 路径 | 类型 | 大小 | +|---|------|------|------|------| +| 1 | api.js (扩展) | `public/ssw/jxcj/api.js` | DI 调用函数 + 回退兜底 | ~3 KB 增量 | +| 2 | dashboard/index.html | `public/ssw/jxcj/dashboard/index.html` | 新增大屏 (深色 + 4 KPI + 4 echarts) | ~13 KB | +| 3 | portal/index.html | `public/ssw/jxcj/portal/index.html` | 新增门户 (浅色 + banner + 4 卡片) | ~9 KB | +| 4 | report/index.html | `public/ssw/jxcj/report/index.html` | 新增报表 (排名表 + 2 echarts) | ~13 KB | + +**部署 URL** (nginx 代理 `/ssw/jxcj/`): + +- 大屏: `http://nginx/ssw/jxcj/dashboard/` +- 门户: `http://nginx/ssw/jxcj/portal/` +- 报表: `http://nginx/ssw/jxcj/report/` + +--- + +## 改动原因 (为什么 dacli 需要) + +`no-spa-page` 技能要求: 公开访问、不依赖 JNPF 表单设计器、平台权限之外的轻量页面。jxcj 项目除官网 (index.html / directions.html / awards.html) 外, 还需: +- **大屏**: 现场汇报用, 全屏深色风格 + 4 KPI + 4 echarts 图表 +- **门户**: 静态入口, 浅色白底经典门户布局, 整合官网/大屏/报表链接 +- **报表**: 综合排名 Top 10 公开报表, 表格 + 图表 + +3 个页面复用同一套 jnpf DI, 数据源真实, 失败回退硬编码示例 (跟官网 api.js 模式一致)。 + +--- + +## DI 数据源 (4 个) + +| DI enCode | DI id | 用途 | +|-----------|-------|------| +| JxcjCompetitionStatus | 841838093525846149 | 已发布大赛状态 (大屏 banner) | +| JxcjCompetitionSummary | 841838176640174213 | 综合统计 (团队/资源/评审/公告数) | +| JxcjTeamStatusChart | 841838215903053957 | 团队状态分布 (0-4 状态) | +| JxcjFinalRankingReport | 841838195388713093 | 综合排名 Top 10 | + +**DI 调用端点**: `POST /api/system/DataInterface/{id}/Actions/Preview` +(后端 `jnpf-system-controller/DataInterfaceController.java: callPreview`) +**Header**: `App-Code: jxcj`, `Jnpf-Origin: pc`, `Vue-Version: 3` +**鉴权**: `skipAuth=true` (公开读取, 失败回退示例) + +--- + +## 改动 diff 摘要 + +### api.js 扩展 (变更部分) + +```js +// ========== 4.x DI 直调 (大屏/门户/报表专用, v0.12+) ========== +async function callDI(diId, params = {}) { + const path = `/api/system/DataInterface/${diId}/Actions/Preview`; + const res = await apiRequest('POST', path, params, { skipAuth: true }); + return res?.data ?? res ?? null; +} + +const di = { + async getJxcjCompetitionStatus() { // 841838093525846149 + try { return await callDI('841838093525846149', {}); } + catch (e) { return { f_competition_name: '数据要素人工智能创新大赛', f_state: 1, ... }; } + }, + async getJxcjCompetitionSummary() { // 841838176640174213 + try { return await callDI('841838176640174213', {}); } + catch (e) { return { team_count: 128, resource_count: 56, review_count: 32, announcement_count: 18 }; } + }, + async getJxcjTeamStatusChart() { // 841838215903053957 + try { return await callDI('841838215903053957', {}); } + catch (e) { return [{ f_status: 0, cnt: 12 }, { f_status: 1, cnt: 64 }, ...]; } + }, + async getJxcjFinalRankingReport() { // 841838195388713093 + try { const list = await callDI('841838195388713093', { pageSize: 10 }); return Array.isArray(list) ? list : (list?.list || list?.rows || []); } + catch (e) { return [{ final_rank: 1, f_project_name: '智链金融风控引擎', ... }, ...]; } + } +}; + +window.sswDi = di; +window.sswJxcj = { api, di, fmtDateTime, fmtDate, APP_CODE, API_BASE }; +``` + +### dashboard/index.html 新增 + +- 4 KPI: 参赛团队数 / 数据资源数 / 评审进行中 / 公告数 +- 4 图表 (echarts 5.5): + - 团队数趋势 (近 7 天折线) + - 团队状态分布 (饼图 0-4 状态) + - 综合排名 Top 10 (横条图) + - 资源数 vs 公告数 vs 评审中 (柱状图) +- 顶部实时时钟 +- 全屏深色背景 + 蓝色霓虹风格 + +### portal/index.html 新增 + +- 顶部导航 (跨 3 页面跳转) +- Banner (浅色: 标题 + 4 mini 数据 + 进入系统按钮) +- 4 卡片 (参赛团队 / 数据资源 / 评审中 / 公告) +- 6 快速入口 (官网 / 大屏 / 报表 / 平台 / 获奖公示 / 赛题方向) +- Footer + +### report/index.html 新增 + +- 4 汇总卡 (项目数 / 最高分 / 平均分 / 方向数) +- 2 echarts: 综合分对比横条 + 分数段分布饼图 +- 表格: 排名 | 项目名 | 团队名 | 赛题方向 | 初审分 | 复审分 | 终审分 | 综合分 | 获奖等级 +- 空数据状态: 显示 "暂无排名数据" +- 排名 1/2/3 高亮金/银/铜 + +--- + +## 技术栈 (沿用 jxcj 官网, no-spa-page 原则 6) + +- Vue 3 (CDN: jsdelivr) +- Ant Design Vue 3 (CDN: jsdelivr) +- axios (CDN: jsdelivr) +- **新增**: echarts 5.5 (CDN: jsdelivr, 仅 dashboard + report 用) +- 单 HTML + Vue + axios = 完整页面 (原则 7: 单 HTML 起步) + +--- + +## 验收方法 + +### 1. 改源即生效 (no-spa-page 原则 1) +```bash +curl -s -o /dev/null -w "%{http_code}\n" http://nginx/ssw/jxcj/dashboard/ +curl -s -o /dev/null -w "%{http_code}\n" http://nginx/ssw/jxcj/portal/ +curl -s -o /dev/null -w "%{http_code}\n" http://nginx/ssw/jxcj/report/ +``` +**期望**: 全部 200 + +### 2. 浏览器验证 +- 大屏: F11 全屏, 4 KPI 数字显示, 4 图表渲染 +- 门户: 顶部 banner, 4 卡片数字 (默认示例: 128/56/32/18) +- 报表: 表格 10 行排名, echarts 图正常 + +### 3. 真实 DI 数据 (可选) +浏览器 F12 → Network → 找 `/api/system/DataInterface/{id}/Actions/Preview` 请求 +- code=200 + data 非空 → 走真实数据 +- code=600/401 → 走示例回退 (api.js 已内置, 不影响页面) + +### 4. node --check 语法 +```bash +node --check /home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/public/ssw/jxcj/api.js +``` +**期望**: 无输出 (语法 OK) + +--- + +## 升级 web 时如何重新应用 + +jnpf 升级 web 端 (重新 `pnpm build` 或重新拉 jnpf-web-apps-main) 会**保留** `public/ssw/` 目录 (这是 jnpf 静态资源约定), 不会覆盖。如果发现丢失: + +1. 检查 `web/apps/jnpf-web-apps-main/public/ssw/jxcj/` 目录是否存在 +2. 不存在 → 从 git / docs 恢复 (本 patch 文档 + 源文件) +3. 存在但页面 404 → 检查 nginx 配置 (`/ssw/` 代理到 `public/ssw/`) + +**关键**: no-spa-page 页面在 `public/`, 不在 `src/views/`, **不会**被 jnpf 升级覆盖。 + +--- + +## 相关文件 + +- 官网样板: `public/ssw/jxcj/index.html` (api 调用模式参照) +- api.js 原始: `public/ssw/jxcj/api.js` (本次扩展) +- 设计文档: `docs/jxcj/design.html` §3 数据表字段 +- dacli-ts references: `.claude/skills/dacli-ts/references/commands.md` (DI 调用规范) +- no-spa-page: `.claude/skills/no-spa-page/SKILL.md` (原则 1-7) \ No newline at end of file diff --git a/docs/web-patches/jxcj-official-site.md b/docs/web-patches/jxcj-official-site.md new file mode 100644 index 0000000..c2a7f54 --- /dev/null +++ b/docs/web-patches/jxcj-official-site.md @@ -0,0 +1,218 @@ +# jxcj 对外官网 (no-spa-page) — web-patch 记录 + +**创建时间**: 2026-06-30 +**app_code**: `jxcj` +**所属 skill**: `no-spa-page` (JNPF 之外轻量独立 HTML) +**目录**: `web/apps/jnpf-web-apps-main/public/ssw/jxcj/` +**部署**: nginx `/ssw/jxcj/` 直代理 + +> 本文件按 `feedback-web-patch-docs` 规则维护, web 升级后按本清单 re-apply patch. + +--- + +## 文件清单 (5) + +| 路径 | 大小 | 性质 | 数据源 | +|------|------|------|------| +| `web/.../public/ssw/jxcj/index.html` | ~23 KB | 全文替换 (从纯静态 → Vue3+AntV3+axios) | jxcj_competition_info + jxcj_topic_direction | +| `web/.../public/ssw/jxcj/directions.html` | ~13 KB | 新增 | jxcj_topic_direction | +| `web/.../public/ssw/jxcj/awards.html` | ~15 KB | 全文替换 (从纯静态 → Vue3+AntV3+axios) | jxcj_competition_info + jxcj_announcement(type=award) | +| `web/.../public/ssw/jxcj/api.js` | ~6 KB | 新增 | — | +| `web/.../public/ssw/jxcj/README.md` | ~7 KB | 新增 | — | + +未触动 (留作历史): `news.html` / `works.html` (上一版 9707 / 10563 字节的纯静态版) + +--- + +## 改动 1 — index.html: 纯静态 → Vue 3 + Ant Design Vue 3 + +### 改前 (2026-06-30 12:07 版本, 15878 字节) +- 纯 HTML + `