Files
dacli/src/webapi/dict.ts
T
sswandClaude 727b13c407 feat(v0.11+): Phase A-E AI 工作流闭环 - 源分析 + 镜像 + 新命令 + skill + 验证
按 docs/dacli/v0.11-final.md 4 阶段执行:
1. 源码分析 docs/source-analysis.md (分析 web/views/** 页面逻辑)
2. 镜像高频 webapi (dict + workflow)
3. 新增 AI 痛点驱动命令 (form selector + workflow selector)
4. 集成到 form-development / workflow-development skill
5. 用官方示例验证 (workSystem 86 form/17 flow, developSystem 4 form)

新增模块:
- src/webapi/dict.ts (15 函数镜像 web/.../systemData/dictionary.ts)
- src/webapi/workflow.ts (14 函数镜像 web/.../workFlow/template.ts)
- src/commands/form/selector.ts (formSelector 命令 + 树形平铺)
- src/commands/workflow/selector.ts (getFlowSelector 命令)

测试:
- tests/test-webapi-dict-workflow.ts (15 dict + 14 workflow 函数实测 PASS)

Skill 集成:
- .claude/skills/form-development/SKILL.md (新增 form selector 段)
- .claude/skills/workflow-development/SKILL.md (新增 workflow selector 段)

验证 (workSystem):
- form selector --json: 86 form 平铺
- workflow selector --json: 17 工作流

验证 (developSystem):
- form selector --json: 4 form
- workflow selector --json: 17 工作流 (跨应用可见)

源分析报告 docs/source-analysis.md 列出 18 个未覆盖模块 + 缺口分级 (P0/P1/P2).

Co-Authored-By: Claude <[email protected]>
2026-06-25 13:59:32 +08:00

39 lines
1.4 KiB
TypeScript

/**
* webapi/dict.ts — 直接 import web 端 dictionary.ts (v0.11+)
*
* web/apps/jnpf-web-apps-main/src/api/systemData/dictionary.ts 15 函数:
* - 字典类型 (Dictionary Type): getDictionaryType / getDictionaryTypeSelector /
* createDictionaryType / updateDictionaryType / getDictionaryTypeInfo / delDictionaryType
* - 字典数据 (Dictionary Data): getDictionaryDataList / getDictionaryAll /
* getDictionaryDataTypeSelector / getDictionaryDataSelector / createDictionaryData /
* updateDictionaryData / getDictionaryDataInfo / delDictionaryData
* - 导出: exportData
*
* 注意: 字典全平台唯一 (enCode + fullName), BS-47
*/
import { JnpfClient } from '../core/client.ts'
import { loadWebModule } from './_loader.ts'
const DICT_SRC = '/home/ubuntu/ccWorkDir/web/apps/jnpf-web-apps-main/src/api/systemData/dictionary.ts'
let cached: any = null
export async function initWebapi(client: JnpfClient): Promise<void> {
if (cached) return
const { initDefHttpShim } = await import('./_defhttp_shim.ts')
initDefHttpShim(client)
cached = await loadWebModule(DICT_SRC)
}
export function isWebapiLoaded(): boolean {
return cached !== null
}
export const loadDict: any = new Proxy({} as any, {
get(_target, prop) {
if (!cached) {
throw new Error(`dict 模块未初始化, 请先 await initWebapi(client)`)
}
return cached[prop]
},
})