diff --git a/skills/dacli-ts/SKILL.md b/skills/dacli-ts/SKILL.md index 6f435d4..9d93ffc 100644 --- a/skills/dacli-ts/SKILL.md +++ b/skills/dacli-ts/SKILL.md @@ -60,7 +60,7 @@ dacli form create --ai "..." - `workflow.ts` — 14 函数 (work 端点 + 全套 CRUD) ★ - `dict.ts` — 15 函数 (字典) ★ - `_buildformdata.ts` — 镜像 web 端 buildFormData (form/flow 字段构造) -- `dataModel.ts` / `dataSource.ts` / `menu.ts` / `permission.ts` / `di.ts` / `printDev.ts` / `report.ts` / `portal.ts` / `bigscreen.ts` (待建) +- `dataModel.ts` / `dataSource.ts` / `menu.ts` / `permission.ts` / `di.ts` / `printDev.ts` / `report.ts` / `portal.ts` / `visualdata.ts` (大屏独立子项目) / `datascreen.ts` (大屏备 shim 方案) **为什么这样**:之前复刻 buildFormData 漏 22+ 隐式契约, 反复修 schema 完整性. 直接 import web 端 = 0 维护, web 端升一次自动跟上. @@ -137,7 +137,8 @@ dacli (Node CLI) ├─ src/webapi/monitor.ts 7 函数 (loadMonitor: server/online/flow) ★ NEW ├─ src/webapi/schedule.ts 8 函数 (loadSchedule: list/info/update/delete)★ NEW ├─ src/webapi/message.ts 9 函数 (loadNotice/loadMsgTemplate) ★ NEW - ├─ src/webapi/visualdata.ts 8 函数 (loadDataInterface: di list/info/test) ★ NEW + ├─ src/webapi/visualdata.ts 镜像 jnpf-web-datascreen-vue3/src/api/visual.js (9 函数: getList/copyObj/getCategory/getObj/uploadImg/addObj/updateComponent/updateObj/delObj) ★ NEW + ├─ src/webapi/datascreen.ts 镜像同上 (备 shim 方案, 处理 visual.js 相对路径 import) ★ v0.13+ ├─ src/webapi/report.ts 7 函数 ★ NEW ├─ src/webapi/onlineUser.ts 3 函数 ★ NEW ├─ src/webapi/flowMonitor.ts 3 函数 ★ NEW @@ -171,7 +172,7 @@ const data = await loadVisualDev.getVisualDevList({ keyword: 'foo' }) // 调 we - `msg/*` (notice/template CRUD 6) → `loadNotice/loadMsgTemplate.*` - `schedule/*` (update/delete) → `loadSchedule.*` - `monitor/*` (server/online/flow) → `loadMonitor.*` -- `bigscreen/*` (update/delete) → `loadReport.*` +- `bigscreen/*` (update/delete) → `loadVisualData.*` (v0.11+); `bigscreen/create` → `loadDatascreen.addObj` (v0.13+, 备 shim); `bigscreen/list/info` 待切 → `loadVisualData.*` (v0.14 推进) - `workflow/*` (info/update/delete + selector) → `loadWorkflow.*` - `user/*` (list/create/delete) → `loadUser.*` @@ -347,10 +348,12 @@ dacli dict typeCreate --fullName="TestDup2" --enCode="tdd10duptestv1" --parentId | `dacli monitor online` | 在线用户 | `cbe6a1e` | | `dacli monitor flow` | 流程监控 | `cbe6a1e` | -### bigscreen (2 个 NEW-CMD) - 独立子项目 +### bigscreen (2 个 NEW-CMD) - 大屏独立子项目 `jnpf-web-datascreen-vue3` | 命令 | 用途 | commit | |------|------|--------| -| `dacli bigscreen update ` / `dacli bigscreen delete ` | 改 / 删大屏 | `af9e5a6` `4669e35` | +| `dacli bigscreen update ` / `dacli bigscreen delete ` | 改 / 删大屏 (走 `webapi/visualdata.ts`, 镜像 `jnpf-web-datascreen-vue3/src/api/visual.js`) | `af9e5a6` `4669e35` | + +> **⚠️ v0.14+ 关键修正 (2026-07-01)**: 大屏 web 端是**独立子项目** `jnpf/前端/jnpf-web-datascreen-vue3/`, 完整 API client 在 `src/api/visual.js` (9 函数). `web/apps/jnpf-web-apps-main/src/api/onlineDev/dataV.ts` 只镜像了 `getDataVSelector()` (1/9, 下拉框), 不能作为完整 webapi 源. `dacli/src/webapi/bigscreen.ts` (基于 `dataV.ts`) 因此**已被 `@deprecated`**, 不可用 — `list/info/release` 命令需切到 `webapi/visualdata.ts` (走 `/api/visual/*` nginx 代理 32000 jnpf-datareport-univer 微服务). **不要**"镜像 `dataV.ts` + 手写其他端点直调 `/api/blade-visual/visual/*`" — 那是自己拼接数据接后端, 违反 webapi 镜像原则. ### dict (4 个 NEW-CMD) - 字典管理闭环 | 命令 | 用途 | commit | diff --git a/skills/ssw-e2e-test/SKILL.md b/skills/ssw-e2e-test/SKILL.md index 81fb457..748b199 100644 --- a/skills/ssw-e2e-test/SKILL.md +++ b/skills/ssw-e2e-test/SKILL.md @@ -90,41 +90,51 @@ with sync_playwright() as p: ### TC-B 真实端到端 5 步 (jxcj1 实战, 阶段 13) +> **v0.14+ 加速原则 (2026-07-01, 用户强要求)**: TC-B 不是"全浏览器操作". 应当**复用 webapi 镜像能力** — 构造/查找/触发/注入走 webapi (快, 50ms), 验证走浏览器 (真实, 必要). 加速 3-5x. 详见 `dacli/docs/cmd-review/v0.13-webapi-form-workflow-refactor.md` §8.3.1. + ```bash -# 1. 浏览器登录 jnpf-app (拿 session token) +# 1. webapi 拿 token + addInitScript 注入 (替代浏览器登录, 加速 30x) +TOKEN=$(dacli app context --json | jq -r .token) +playwright -s={app_code} addInitScript "window.localStorage.setItem('jnpf_access-token', JSON.stringify({accessToken:'$TOKEN'}))" +# 旧版: 浏览器打开 + fill + click 登录 (1-2s). 新版: addInitScript 50ms. + +# 1.5 (旧, 仅当 webapi 不可用时) 浏览器登录 jnpf-app (拿 session token) playwright -s={app_code} open http://nginx/jnpf_app_{app_code}/login playwright -s={app_code} fill "input#account" "admin" playwright -s={app_code} fill "input[type='password']" "123456" playwright -s={app_code} click "button:has(span:text-is('登 录'))" -# 2. 拿 currentUserInfo 推路由 -TOKEN=$(dacli app context --json | jq -r .token 2>/dev/null || cat ~/.dacli-token/token.json | jq -r .token) -playwright -s={app_code} eval "async () => { - const r = await fetch('/api/oauth/CurrentUser?systemCode={app_code}&isBackend=0', {headers:{'Authorization':'$TOKEN'}}); - const d = await r.json(); - const models = d.data?.menuList?.flatMap(m => m.children || []).filter(m => m.urlAddress?.startsWith('model/')); - return JSON.stringify(models.slice(0,3).map(m => m.urlAddress)); -}" +# 2. webapi 拿 enCode (替代 currentUserInfo 推路由, 加速 50x) +EN_CODE=$(dacli form list --keyword={enCode} --json | jq -r '.data.records[0].enCode') +# 旧版: fetch /api/oauth/CurrentUser 推路由 (2-3s). 新版: webapi list 50ms. -# 3. 真实点击 menu (vue router 跳转) +# 3. 真实点击 menu (vue router 跳转) — 保留, TC-B 核心价值 playwright -s={app_code} click "aside >> text=审批中心" playwright -s={app_code} click "aside >> text=我的待办" -# 4. 检测真实 DOM 渲染 +# 4. 检测真实 DOM 渲染 — 保留 playwright -s={app_code} eval "() => JSON.stringify({ title: document.title, rows: document.querySelectorAll('tr').length, addBtns: [...document.querySelectorAll('button')].filter(b => /新增|添加/.test(b.textContent)).length })" -# 5. 真实点击 + 填表单 + 提交 (行数 +1) +# 5. 真实点击 + 浏览器验 (webapi 已构造, 浏览器只验证行数变化) +# 旧版: 浏览器填表 + 提交 (5-10s). 新版: webapi create + 浏览器验行数 +1 (5s 总) playwright -s={app_code} click "button:has-text('新增')" -playwright -s={app_code} fill ".ant-modal input[type='text']:first-of-type" "TCC-${TS}" -playwright -s={app_code} click ".ant-modal-footer button.ant-btn-primary" -# 验证: 行数 +1 +sleep 1 +# 验 modal 打开 (vue 渲染) — 不填表 +playwright -s={app_code} eval "() => !!document.querySelector('.ant-modal')" +playwright -s={app_code} click ".ant-modal-close" +sleep 1 +# webapi 构造 1 条 → 浏览器 goto list 验行数 +1 +REC_ID=$(dacli test run --formId=$FORM_ID --keep-data --json | jq -r '.steps[] | select(.step=="create") | .data.id') +playwright -s={app_code} open "http://nginx/jnpf_app_{app_code}/model/{enCode}" +sleep 2 +# 验证: 行数 +1 (webapi 构造的数据能在浏览器看到) ``` -### ⚠️ TC-B 反模式 (jxcj 2026-06-29 踩坑) +### ⚠️ TC-B 反模式 (jxcj 2026-06-29 踩坑 + v0.14+ 跨模块审计) | ❌ 反模式 | ✅ 正路 | |---|---| @@ -132,6 +142,9 @@ playwright -s={app_code} click ".ant-modal-footer button.ant-btn-primary" | 只看 API status code 200 | 真实 UI 状态 (行数 +1, 弹窗关闭, DOM 更新) | | 不截图, 只 log | 截图 md5 去重 (4 张图, md5 不全相同) | | 用 `playwright -s=X eval "() => location.href"` 验证路由 | 真实点击 menu → 检测 vue 渲染 | +| **全浏览器构造** (5 步填表 + 提交, 5-10s/条) | **webapi 准备 + 浏览器验证** (`dacli test run --keep-data` 50ms, 浏览器只验行数) | +| **currentUserInfo 推路由** (2-3s) | **`dacli form list` 拿 enCode** (50ms) | +| **浏览器登录** (1-2s) | **`addInitScript` 注入 token** (50ms) | ### TC-B 截图去重要求 (4 铁律之一)