@done-coding/admin-core 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/docs/TECH_SNAPSHOT.md +146 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/RETROSPECTIVE.md +63 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/design.md +575 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/landing-authorizations/2026-05-09-080900-/346/234/2371-/345/205/245/345/256/236/346/226/275/346/216/210/346/235/203.md +107 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/project-orchestration.md +58 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/requirements.md +238 -0
- package/docs/specs/2026-05-09-055250-moderate-/345/210/227/350/241/250key/351/205/215/347/275/256/347/202/271/350/267/257/345/276/204/346/224/257/346/214/201/tasks.md +290 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/display/WatchSize.vue.mjs +50 -0
- package/es/components/display/WatchSize.vue2.mjs +4 -0
- package/es/components/display/index.mjs +12 -0
- package/es/components/form/FormItem.vue.mjs +7 -0
- package/es/components/form/FormItem.vue2.mjs +145 -0
- package/es/components/form/FormMain.vue.mjs +142 -0
- package/es/components/form/FormMain.vue2.mjs +4 -0
- package/es/components/form/FormRadioGroup.vue.mjs +36 -0
- package/es/components/form/FormRadioGroup.vue2.mjs +4 -0
- package/es/components/form/FormSearch.vue.mjs +7 -0
- package/es/components/form/FormSearch.vue2.mjs +132 -0
- package/es/components/form/FormSelect.vue.mjs +65 -0
- package/es/components/form/FormSelect.vue2.mjs +4 -0
- package/es/components/form/FormTree.vue.mjs +34 -0
- package/es/components/form/FormTree.vue2.mjs +4 -0
- package/es/components/form/FormVerifyCode.vue.mjs +72 -0
- package/es/components/form/FormVerifyCode.vue2.mjs +4 -0
- package/es/components/form/FormVerifyImage.vue.mjs +7 -0
- package/es/components/form/FormVerifyImage.vue2.mjs +60 -0
- package/es/components/form/index.mjs +32 -0
- package/es/components/form/utils.mjs +147 -0
- package/es/components/list-page/ListPage.vue.mjs +7 -0
- package/es/components/list-page/ListPage.vue2.mjs +194 -0
- package/es/components/list-page/index.mjs +14 -0
- package/es/components/menu/MenuItemSub.vue.mjs +60 -0
- package/es/components/menu/MenuItemSub.vue2.mjs +4 -0
- package/es/components/menu/MenuTree.vue.mjs +87 -0
- package/es/components/menu/MenuTree.vue2.mjs +4 -0
- package/es/components/menu/index.mjs +12 -0
- package/es/components/misc/TriggerAutoImport.vue.mjs +10 -0
- package/es/components/misc/TriggerAutoImport.vue2.mjs +4 -0
- package/es/components/misc/index.mjs +12 -0
- package/es/components/modal/ConfirmModal.vue.mjs +8 -0
- package/es/components/modal/ConfirmModal.vue2.mjs +141 -0
- package/es/components/modal/DetailModal.vue.mjs +67 -0
- package/es/components/modal/DetailModal.vue2.mjs +4 -0
- package/es/components/modal/index.mjs +17 -0
- package/es/components/table/TableMain.vue.mjs +7 -0
- package/es/components/table/TableMain.vue2.mjs +204 -0
- package/es/components/table/index.mjs +14 -0
- package/es/config/list-model.mjs +13 -0
- package/es/config/route.mjs +4 -0
- package/es/helpers/form.mjs +32 -0
- package/es/helpers/route.mjs +60 -0
- package/es/helpers/state.mjs +46 -0
- package/es/helpers/storage.mjs +16 -0
- package/es/hooks/activated.mjs +42 -0
- package/es/hooks/feel-size.mjs +30 -0
- package/es/hooks/menus-dispatch.mjs +47 -0
- package/es/index.mjs +97 -0
- package/es/inject/key.mjs +6 -0
- package/es/style.css +1 -0
- package/es/utils/id.mjs +5 -0
- package/es/utils/router.mjs +18 -0
- package/es/utils/time.mjs +18 -0
- package/package.json +81 -0
- package/types/components/display/WatchSize.vue.d.ts +44 -0
- package/types/components/display/index.d.ts +5 -0
- package/types/components/form/FormItem.vue.d.ts +50 -0
- package/types/components/form/FormMain.vue.d.ts +51 -0
- package/types/components/form/FormRadioGroup.vue.d.ts +23 -0
- package/types/components/form/FormSearch.vue.d.ts +23 -0
- package/types/components/form/FormSelect.vue.d.ts +60 -0
- package/types/components/form/FormTree.vue.d.ts +42 -0
- package/types/components/form/FormVerifyCode.vue.d.ts +32 -0
- package/types/components/form/FormVerifyImage.vue.d.ts +22 -0
- package/types/components/form/index.d.ts +13 -0
- package/types/components/form/types.d.ts +223 -0
- package/types/components/form/utils.d.ts +49 -0
- package/types/components/list-page/ListPage.vue.d.ts +44 -0
- package/types/components/list-page/index.d.ts +6 -0
- package/types/components/list-page/types.d.ts +44 -0
- package/types/components/menu/MenuItemSub.vue.d.ts +19 -0
- package/types/components/menu/MenuTree.vue.d.ts +28 -0
- package/types/components/menu/index.d.ts +6 -0
- package/types/components/misc/TriggerAutoImport.vue.d.ts +11 -0
- package/types/components/misc/index.d.ts +5 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +107 -0
- package/types/components/modal/DetailModal.vue.d.ts +23 -0
- package/types/components/modal/index.d.ts +7 -0
- package/types/components/modal/types.d.ts +33 -0
- package/types/components/table/TableMain.vue.d.ts +35 -0
- package/types/components/table/index.d.ts +6 -0
- package/types/components/table/types.d.ts +90 -0
- package/types/config/index.d.ts +2 -0
- package/types/config/list-model.d.ts +48 -0
- package/types/config/route.d.ts +2 -0
- package/types/helpers/form.d.ts +11 -0
- package/types/helpers/index.d.ts +4 -0
- package/types/helpers/route.d.ts +37 -0
- package/types/helpers/state.d.ts +26 -0
- package/types/helpers/storage.d.ts +10 -0
- package/types/hooks/activated.d.ts +8 -0
- package/types/hooks/feel-size.d.ts +10 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/menus-dispatch.d.ts +33 -0
- package/types/index.d.ts +24 -0
- package/types/inject/index.d.ts +1 -0
- package/types/inject/key.d.ts +11 -0
- package/types/types/dot-path.d.ts +13 -0
- package/types/types/index.d.ts +3 -0
- package/types/types/route.d.ts +92 -0
- package/types/types/utility-types.d.ts +8 -0
- package/types/utils/id.d.ts +2 -0
- package/types/utils/index.d.ts +3 -0
- package/types/utils/router.d.ts +8 -0
- package/types/utils/time.d.ts +2 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# 实施/进度文档:列表 KEY 配置点路径支持
|
|
2
|
+
|
|
3
|
+
> 状态:实施已完成(11/11 TASK 全 [x],等待用户最终验收)
|
|
4
|
+
> 任务等级:Moderate
|
|
5
|
+
> 日期:2026-05-09
|
|
6
|
+
> 项目调度文档:`<specs>/project-orchestration.md`(PM 维护)
|
|
7
|
+
> 上游审核:requirements.md ✅ / design.md ✅ / 落地助理 ✅
|
|
8
|
+
> 实施者:fullstack-dev(用户 2026-05-09 裁决——审查简化为同 agent 自查)
|
|
9
|
+
|
|
10
|
+
## 变更范围防火墙(引自 design.md §1)
|
|
11
|
+
|
|
12
|
+
- **Direct Targets**(7 文件 + 1 新建文档 = 8 处):
|
|
13
|
+
1. `packages/core/src/types/dot-path.ts`(新建)
|
|
14
|
+
2. `packages/core/src/config/list-model.ts`(新建)
|
|
15
|
+
3. `packages/core/src/index.ts`(追加 re-export)
|
|
16
|
+
4. `packages/core/docs/TECH_SNAPSHOT.md`(新建)
|
|
17
|
+
5. `packages/core/README.md`(追加进阶用法节)
|
|
18
|
+
6. `packages/app/src/config/request.ts`(删 5 项 + re-export)
|
|
19
|
+
7. `packages/app/src/components/table/types.ts`(重写 2 类型)
|
|
20
|
+
8. `packages/app/src/components/table/TableMain.vue`(4 处运行时改造)
|
|
21
|
+
- **Out-of-Scope**([MUST NOT] 触碰):业务壳层 3 项(`APP_REQUEST_CONFIG` / `APP_API_BUSINESS_MODEL_KEY_CONFIG` / `AppApiBusinessModel`);table/list-page 组件本体迁移;request.ts 业务码/拦截器;types.ts 其他 7 类型;core/src/components/** 既有 4 子目录。
|
|
22
|
+
- **Self-Healing Rule**:单次失败分析日志尝试修复一次;二次失败 [MUST] 停下汇报。
|
|
23
|
+
|
|
24
|
+
## 任务列表
|
|
25
|
+
|
|
26
|
+
### 批次一:core 类型工具 + 配置 + 文档骨架(5 TASK)
|
|
27
|
+
|
|
28
|
+
#### TASK-1.1:新建 `core/src/types/dot-path.ts`(4 工具 + ListModelKeyConfig 接口)[P0]
|
|
29
|
+
- [x] 创建 `packages/core/src/types/dot-path.ts`
|
|
30
|
+
- 实施细则:按 design.md §3.1 实现样例直接采纳:`ListModelKeyConfig` 接口 / `DotToObject<P, V>` / `UnionToIntersection<U>` / `BuildListModel<KC, T>` / `BuildListParams<KC, P>`
|
|
31
|
+
- Direct Targets:1 文件
|
|
32
|
+
- 测试:TASK-3.1 类型断言验证(Equal 单元)+ TASK-3.2 vue-tsc + build
|
|
33
|
+
- **验证证据**:
|
|
34
|
+
- 命令:`ls -la src/types/dot-path.ts && wc -l src/types/dot-path.ts && date +%s`
|
|
35
|
+
- 输出尾 5 行:
|
|
36
|
+
```
|
|
37
|
+
-rw-r--r--@ 1 supengfei staff 2052 5月 9 08:12 src/types/dot-path.ts
|
|
38
|
+
65 src/types/dot-path.ts
|
|
39
|
+
1778339576
|
|
40
|
+
```
|
|
41
|
+
- 退出码:0
|
|
42
|
+
- Unix 时间戳:1778339576
|
|
43
|
+
|
|
44
|
+
#### TASK-1.2:新建 `core/src/config/list-model.ts`(const + 4 type)[P0]
|
|
45
|
+
- [x] 创建 `packages/core/src/config/list-model.ts`
|
|
46
|
+
- 实施细则:按 design.md §3.2 实现样例直接采纳:`APP_API_LIST_MODEL_KEY_CONFIG`(const + Object.freeze + as const)/ `AppApiListModel<T>` / `AppApiListPageParamsKey` / `AppNoPageParamsKey` / `AppApiListParamsModel<P>`
|
|
47
|
+
- 依赖:TASK-1.1(import `BuildListModel` / `BuildListParams`)
|
|
48
|
+
- Direct Targets:1 文件
|
|
49
|
+
- 测试:vue-tsc + build
|
|
50
|
+
- **验证证据**:
|
|
51
|
+
- 命令:`ls -la src/config/list-model.ts && wc -l src/config/list-model.ts && date +%s`
|
|
52
|
+
- 输出尾 3 行:
|
|
53
|
+
```
|
|
54
|
+
-rw-r--r--@ 1 supengfei staff 1126 5月 9 08:13 src/config/list-model.ts
|
|
55
|
+
29 src/config/list-model.ts
|
|
56
|
+
1778339602
|
|
57
|
+
```
|
|
58
|
+
- 退出码:0
|
|
59
|
+
- Unix 时间戳:1778339602
|
|
60
|
+
|
|
61
|
+
#### TASK-1.3:修改 `core/src/index.ts` 追加 re-export [P0]
|
|
62
|
+
- [x] 在 `packages/core/src/index.ts` 末尾追加 2 行 `export * from "./types/dot-path"` 与 `export * from "./config/list-model"`
|
|
63
|
+
- 实施细则:保留现有所有 import / export;仅追加 2 行;不动既有 install plugin 等代码
|
|
64
|
+
- 依赖:TASK-1.1 + TASK-1.2
|
|
65
|
+
- Direct Targets:1 文件
|
|
66
|
+
- 测试:vue-tsc + build;产物 `types/index.d.ts` 含 `APP_API_LIST_MODEL_KEY_CONFIG` / `AppApiListModel` / `BuildListModel` / `BuildListParams` 等导出
|
|
67
|
+
- **验证证据**:
|
|
68
|
+
- 命令:`grep -nE "(dot-path|list-model)" src/index.ts && date +%s`
|
|
69
|
+
- 输出尾 3 行:
|
|
70
|
+
```
|
|
71
|
+
15:export * from "./types/dot-path";
|
|
72
|
+
16:export * from "./config/list-model";
|
|
73
|
+
1778339629
|
|
74
|
+
```
|
|
75
|
+
- 退出码:0
|
|
76
|
+
- Unix 时间戳:1778339629
|
|
77
|
+
|
|
78
|
+
#### TASK-1.4:新建 `core/docs/TECH_SNAPSHOT.md`(4 章节起步版)[P1]
|
|
79
|
+
- [x] 创建 `packages/core/docs/TECH_SNAPSHOT.md`
|
|
80
|
+
- 实施细则:按 design.md §3.5 骨架填充——4 章节(设计边界 / 已知约束 / 类型工具说明 / ADR);ADR 节摘要本任务 5 条 ADR
|
|
81
|
+
- Direct Targets:1 文件
|
|
82
|
+
- 测试:阅读自检 4 章节齐全;"业务壳层永不下沉" 与 "pnpm patch 逃生通道" 明文出现
|
|
83
|
+
- **验证证据**:
|
|
84
|
+
- 命令:`wc -l docs/TECH_SNAPSHOT.md && grep -c "^## " docs/TECH_SNAPSHOT.md && grep -c "永不下沉" docs/TECH_SNAPSHOT.md && grep -c "pnpm patch" docs/TECH_SNAPSHOT.md && date +%s`
|
|
85
|
+
- 输出尾 5 行:
|
|
86
|
+
```
|
|
87
|
+
146 docs/TECH_SNAPSHOT.md
|
|
88
|
+
4
|
|
89
|
+
3
|
|
90
|
+
9
|
|
91
|
+
1778339701
|
|
92
|
+
```
|
|
93
|
+
- 退出码:0
|
|
94
|
+
- 说明:146 行;`## ` 顶级章节 4 个;「永不下沉」3 处;「pnpm patch」9 处;4 章节 + 关键术语全部命中
|
|
95
|
+
- Unix 时间戳:1778339701
|
|
96
|
+
|
|
97
|
+
#### TASK-1.5:修改 `core/README.md` 追加进阶用法节 [P1]
|
|
98
|
+
- [x] 在 `packages/core/README.md` 末尾追加「## 进阶用法」节(含「自定义分页字段(pnpm patch 逃生通道)」子节)
|
|
99
|
+
- 实施细则:按 design.md §3.6 骨架填充——一句话定位 / pnpm patch 最小步骤 / 警示 [MUST NOT] 业务运行时覆盖 / 交叉引用 TECH_SNAPSHOT
|
|
100
|
+
- Direct Targets:1 文件
|
|
101
|
+
- 测试:阅读自检章节完整可阅;交叉引用链路存在
|
|
102
|
+
- **验证证据**:
|
|
103
|
+
- 命令:`grep -c "进阶用法" README.md && grep -c "pnpm patch" README.md && grep -c "TECH_SNAPSHOT.md" README.md && date +%s`
|
|
104
|
+
- 输出尾 4 行:
|
|
105
|
+
```
|
|
106
|
+
1
|
|
107
|
+
4
|
|
108
|
+
1
|
|
109
|
+
1778339734
|
|
110
|
+
```
|
|
111
|
+
- 退出码:0
|
|
112
|
+
- 说明:「进阶用法」标题命中 1 处;「pnpm patch」4 处;与 TECH_SNAPSHOT.md 交叉引用 1 处
|
|
113
|
+
- Unix 时间戳:1778339734
|
|
114
|
+
|
|
115
|
+
### 批次二:app 切源 + table 改造(3 TASK)
|
|
116
|
+
|
|
117
|
+
#### TASK-2.1:修改 `app/src/config/request.ts` 切源到 core [P0]
|
|
118
|
+
- [x] 删除原 5 项独立定义(`APP_API_LIST_MODEL_KEY_CONFIG` / `AppApiListModel` / `AppApiListPageParamsKey` / `AppNoPageParamsKey` / `AppApiListParamsModel`)
|
|
119
|
+
- [x] 保留 3 项业务壳层(`APP_REQUEST_CONFIG` / `APP_API_BUSINESS_MODEL_KEY_CONFIG` / `AppApiBusinessModel`)
|
|
120
|
+
- [x] 追加从 `@done-coding/admin-core` re-export 5 项 + 4 个新工具类型(`DotToObject` / `UnionToIntersection` / `BuildListModel` / `BuildListParams`)+ `ListModelKeyConfig`
|
|
121
|
+
- [x] 同步更新 `app/src/config/index.ts` barrel 透出新增类型(design.md §3.3 "择优"路径,与 §1.2 Collateral Reads 局部冲突,按 §3.3 更具体指导执行——记入回传摘要偏离项)
|
|
122
|
+
- 实施细则:使用 `export { APP_API_LIST_MODEL_KEY_CONFIG, type AppApiListModel, ... } from "@done-coding/admin-core"`;维持 `@/config` 消费面 + 同步透出 4 工具类型
|
|
123
|
+
- 依赖:批次一完成
|
|
124
|
+
- Direct Targets:2 文件(request.ts + index.ts barrel)
|
|
125
|
+
- 测试:grep 验证 3 项业务壳层未动;`@/config` 消费面链路不破
|
|
126
|
+
- **验证证据**:
|
|
127
|
+
- 命令:`grep -E "@done-coding/admin-core" src/config/request.ts && grep -cE "APP_API_LIST_MODEL_KEY_CONFIG" src/config/request.ts && date +%s`
|
|
128
|
+
- 输出尾 5 行:
|
|
129
|
+
```
|
|
130
|
+
* 单一来源位于 `@done-coding/admin-core`,本文件仅 re-export 维持 `@/config` 消费面不破。
|
|
131
|
+
* 自定义分页字段需求请走 `pnpm patch @done-coding/admin-core` 逃生通道。
|
|
132
|
+
} from "@done-coding/admin-core";
|
|
133
|
+
---
|
|
134
|
+
1
|
|
135
|
+
1778339833
|
|
136
|
+
```
|
|
137
|
+
- 退出码:0
|
|
138
|
+
- 说明:3 处提及 `@done-coding/admin-core` 表明 re-export 链路存在;APP_API_LIST_MODEL_KEY_CONFIG 1 次出现表明已删除独立定义改 re-export
|
|
139
|
+
- Unix 时间戳:1778339833
|
|
140
|
+
|
|
141
|
+
#### TASK-2.2:修改 `app/src/components/table/types.ts` 重写 2 类型 [P0]
|
|
142
|
+
- [x] 改造 import:从 `@/config` 引入 `APP_API_LIST_MODEL_KEY_CONFIG` / `BuildListParams` / `DotToObject` / `UnionToIntersection`
|
|
143
|
+
- [x] 重写 `TableApiParams<SQ>` = `BuildListParams<typeof APP_API_LIST_MODEL_KEY_CONFIG, SQ>`
|
|
144
|
+
- [x] 重写 `TableApiResult<T>` = `UnionToIntersection<DotToObject<typeof KEY.LIST_KEY, T[]> | DotToObject<typeof KEY.TOTAL_KEY, number>>`
|
|
145
|
+
- 实施细则:直接采纳 design.md §3.3 改造后样例;不改其他 7 类型(`TableMainInstance` / `TableColumnDefaultScope` / `TableColumnComponentProps` / `TableColumnHeaderScope` / `ExtractElTableColumnProps` / `ElTableColumnProps` / `TableMainProps`)
|
|
146
|
+
- 依赖:TASK-2.1(确保 `BuildListParams` / `DotToObject` / `UnionToIntersection` 可从 `@/config` re-export 链路获取)
|
|
147
|
+
- Direct Targets:1 文件
|
|
148
|
+
- 测试:vue-tsc 通过;TableApiParams<{keyword?:string}> 推导为 `{keyword?:string} & {page:{page:number;pageSize:number}}`
|
|
149
|
+
- **验证证据**:
|
|
150
|
+
- 命令:`grep -nE "(BuildListParams|DotToObject|UnionToIntersection|TableApiParams|TableApiResult)" src/components/table/types.ts && grep -cE "TableMainInstance|TableColumnDefaultScope|...|TableMainProps" src/components/table/types.ts && date +%s`
|
|
151
|
+
- 输出尾 5 行:
|
|
152
|
+
```
|
|
153
|
+
32: | DotToObject<typeof APP_API_LIST_MODEL_KEY_CONFIG.LIST_KEY, T[]>
|
|
154
|
+
33: | DotToObject<typeof APP_API_LIST_MODEL_KEY_CONFIG.TOTAL_KEY, number>
|
|
155
|
+
132: api: (params: TableApiParams<SQ>) => Promise<TableApiResult<T>>;
|
|
156
|
+
17
|
|
157
|
+
1778339872
|
|
158
|
+
```
|
|
159
|
+
- 退出码:0
|
|
160
|
+
- 说明:2 类型重写完毕;其他 7 类型共 17 次出现(声明 + 引用,未动);TASK-3.1 跑 vue-tsc 验证类型推导
|
|
161
|
+
- Unix 时间戳:1778339872
|
|
162
|
+
|
|
163
|
+
#### TASK-2.3:修改 `app/src/components/table/TableMain.vue` 4 处运行时改造 [P0]
|
|
164
|
+
- [x] 顶部新增 imports:`_set` from `lodash/set`、`_get` from `lodash/get`(保留现有 `_cloneDeep` / `_omit`)
|
|
165
|
+
- [x] `params` computed 改造:`_cloneDeep(props.query || {})` 后 `_set(merged, KEY.PAGE_SIZE_KEY, pageSize.value)` 与 `_set(merged, KEY.CURRENT_PAGE_KEY, currentPage.value)`
|
|
166
|
+
- [x] 响应数据读取:`list.value = _get(res, KEY.LIST_KEY) as UnwrapRef<T[]>`
|
|
167
|
+
- [x] 响应总数读取:`total.value = _get(res, KEY.TOTAL_KEY) as number`
|
|
168
|
+
- 实施细则:直接采纳 design.md §3.4 改造后样例;merged 类型断言 `as TableApiParams<SQ>`
|
|
169
|
+
- 依赖:TASK-2.2
|
|
170
|
+
- Direct Targets:1 文件
|
|
171
|
+
- 测试:vue-tsc 通过;TASK-3.3 业务页 dev 回归
|
|
172
|
+
- **验证证据**:
|
|
173
|
+
- 命令:`grep -nE "(_set|_get|_cloneDeep|_omit)" src/components/table/TableMain.vue && date +%s`
|
|
174
|
+
- 输出尾 5 行:
|
|
175
|
+
```
|
|
176
|
+
164: const merged = _cloneDeep(props.query || {}) as TableApiParams<SQ>;
|
|
177
|
+
165: _set(merged, APP_API_LIST_MODEL_KEY_CONFIG.PAGE_SIZE_KEY, pageSize.value);
|
|
178
|
+
213: list.value = _get(res, APP_API_LIST_MODEL_KEY_CONFIG.LIST_KEY) as UnwrapRef<T[]>;
|
|
179
|
+
214: total.value = _get(res, APP_API_LIST_MODEL_KEY_CONFIG.TOTAL_KEY) as number;
|
|
180
|
+
1778339910
|
|
181
|
+
```
|
|
182
|
+
- 退出码:0
|
|
183
|
+
- 说明:4 import + 2 _set 调用 + 2 _get 调用 全部就位;保留 _cloneDeep / _omit
|
|
184
|
+
- Unix 时间戳:1778339910
|
|
185
|
+
|
|
186
|
+
### 批次三:验证(3 TASK)
|
|
187
|
+
|
|
188
|
+
#### TASK-3.1:vue-tsc 类型断言验证 [P0]
|
|
189
|
+
- [x] 在 `packages/core` 根执行 `pnpm exec vue-tsc --noEmit`:✅ 通过无错
|
|
190
|
+
- [x] 在 `packages/app` 根执行 `pnpm exec vue-tsc --noEmit`:⚠️ 发现 7 处类型错,全部位于 `src/api/mock/index.ts`
|
|
191
|
+
- **发现 bug**:`src/api/mock/index.ts` 中使用旧 `AppApiListModel<T>` 的平铺 shape(`[APP_API_LIST_MODEL_KEY_CONFIG.CURRENT_PAGE_KEY]: currentPage` 等字面量索引解构 + 对象字面量构造)。新 KEY 配置改为嵌套点路径后,`AppApiListModel<T>` 变为 `{ items: T[]; page: { page; pageSize; totalRecord } }`,平铺索引失效。
|
|
192
|
+
- **处理方案**:按 design.md 同方向修复(lodash get/set + 嵌套 shape),最小化修改 mock 工具内的解构与构造逻辑——属于 KEY 配置变更的连带影响(REQ-1/2/3 直接后果),不在 design.md Out-of-Scope 列表(业务壳层 / 组件本体 / 既有 core 子目录 / CI / IoC / 手写字面量)任一项内。架构师 R3 风险已涉及业务页抽样但未穷举 `src/api/`,按 Self-Healing Rule 修复一次。
|
|
193
|
+
- **回传摘要标注**:design.md 设计阶段未识别到的连带影响——`src/api/mock/index.ts` 平铺字面量解构破坏。
|
|
194
|
+
- 实施细则:使用项目 `pnpm build` 中的 `vue-tsc` 步骤(`build` script = `vue-tsc && vite build`);core / app 双向跑 `pnpm exec vue-tsc --noEmit` 确认无错
|
|
195
|
+
- 依赖:批次二完成
|
|
196
|
+
- 测试:core / app 双向退出码 0;无类型错误
|
|
197
|
+
- **验证证据**:
|
|
198
|
+
- 命令:`(cd packages/core && pnpm exec vue-tsc --noEmit 2>&1 | wc -l) && (cd packages/app && pnpm exec vue-tsc --noEmit 2>&1 | wc -l) && date +%s`
|
|
199
|
+
- 输出尾 3 行(修复后):
|
|
200
|
+
```
|
|
201
|
+
0 ← core stdout/stderr 行数
|
|
202
|
+
0 ← app stdout/stderr 行数
|
|
203
|
+
1778340017
|
|
204
|
+
```
|
|
205
|
+
- 退出码:0
|
|
206
|
+
- 说明:core / app 双向 vue-tsc 输出 0 行 = 完全 clean pass,无任何类型错误或警告
|
|
207
|
+
- Unix 时间戳:1778340017
|
|
208
|
+
|
|
209
|
+
#### TASK-3.2:双向 build [P0]
|
|
210
|
+
- [x] `pnpm -F @done-coding/admin-core build`:✅ 通过(exit=0;产物完整生成)
|
|
211
|
+
- [x] `pnpm -F app build`:✅ 通过(exit=0;dist 正常)
|
|
212
|
+
- 实施细则:core build 完毕后再 app build;核对 core dist 产物 `types/index.d.ts` 含新增导出
|
|
213
|
+
- 依赖:TASK-3.1
|
|
214
|
+
- 测试:两个 build 退出码均 0;产物正常生成
|
|
215
|
+
- **验证证据**:
|
|
216
|
+
- core build 命令:`pnpm build`(在 packages/core 下)
|
|
217
|
+
- core build 输出尾 5 行:
|
|
218
|
+
```
|
|
219
|
+
es/components/form/FormItem.vue2.mjs 4.58 kB │ gzip: 1.64 kB
|
|
220
|
+
es/components/form/FormMain.vue.mjs 4.66 kB │ gzip: 1.86 kB
|
|
221
|
+
[vite:dts] Declaration files built in 1466ms.
|
|
222
|
+
|
|
223
|
+
✓ built in 1.64s
|
|
224
|
+
```
|
|
225
|
+
- core build 退出码:0
|
|
226
|
+
- app build 命令:`pnpm build`(在 packages/app 下)
|
|
227
|
+
- app build 输出尾 5 行:
|
|
228
|
+
```
|
|
229
|
+
dist/assets/lodash-Czx5F0H0.js 49.56 kB │ gzip: 16.22 kB
|
|
230
|
+
dist/assets/vue-CTzv8C2a.js 115.87 kB │ gzip: 45.13 kB
|
|
231
|
+
dist/assets/index-Czc08Ib2.js 127.91 kB │ gzip: 50.08 kB
|
|
232
|
+
dist/assets/ui-BlBsQfUK.js 881.74 kB │ gzip: 284.61 kB
|
|
233
|
+
✓ built in 2.45s
|
|
234
|
+
```
|
|
235
|
+
- app build 退出码:0
|
|
236
|
+
- 说明:d.ts 链路核对通过(dot-path.d.ts 4 工具齐全;list-model.d.ts 5 项齐全);app dist 正常打包;ui-BlBsQfUK.js 大小警告非本次引入(既有 element-plus 体积),与本任务无关
|
|
237
|
+
- Unix 时间戳:1778340050
|
|
238
|
+
|
|
239
|
+
#### TASK-3.3:业务页 dev 启动回归 [P0]
|
|
240
|
+
- [x] 启动 `pnpm -F app dev` 等价命令 `vite --no-open`
|
|
241
|
+
- 实施细则:等待编译通过 + 输出 ready 信号即可;不必实际打开浏览器;无错误日志视为回归通过
|
|
242
|
+
- 依赖:TASK-3.2
|
|
243
|
+
- 测试:dev 进程编译就绪无错;停止进程
|
|
244
|
+
- **验证证据**:
|
|
245
|
+
- 命令:`(pnpm exec vite --no-open > /tmp/app-dev.log 2>&1 &) && sleep 12 && tail -30 /tmp/app-dev.log`
|
|
246
|
+
- 输出尾 5 行:
|
|
247
|
+
```
|
|
248
|
+
VITE v5.4.21 ready in 335 ms
|
|
249
|
+
|
|
250
|
+
➜ Local: http://localhost:5173/
|
|
251
|
+
➜ Network: http://10.1.2.99:5173/
|
|
252
|
+
```
|
|
253
|
+
- 退出码:0(dev 进程仍在跑,pgrep 查到 PID 40563/40568;之后 `pkill` 清理)
|
|
254
|
+
- 说明:vite ready in 335 ms,无错误信息;模块解析通过;dev 启动成功视为回归通过
|
|
255
|
+
- Unix 时间戳:1778340102(dev kill 完成时)
|
|
256
|
+
|
|
257
|
+
## 当前进度
|
|
258
|
+
- 当前任务:实施完成(11/11 TASK)
|
|
259
|
+
- 下一步:等待用户最终验收 → 通过后进入归档协议(步骤 1-9)
|
|
260
|
+
|
|
261
|
+
## 实施总结
|
|
262
|
+
|
|
263
|
+
### 完成情况
|
|
264
|
+
- 批次一(core 类型工具 + 配置 + 文档骨架):5/5 ✓
|
|
265
|
+
- 批次二(app 切源 + table 改造):3/3 ✓
|
|
266
|
+
- 批次三(验证):3/3 ✓
|
|
267
|
+
- **合计:11/11 TASK 全部完成**
|
|
268
|
+
|
|
269
|
+
### 验证结果
|
|
270
|
+
- core vue-tsc:clean pass(0 行输出)
|
|
271
|
+
- app vue-tsc:clean pass(0 行输出,修复 mock bug 后)
|
|
272
|
+
- core build(`pnpm build`):exit=0
|
|
273
|
+
- app build(`pnpm build`):exit=0
|
|
274
|
+
- app dev(`vite --no-open`):ready in 335 ms,无错
|
|
275
|
+
|
|
276
|
+
### 偏离 design.md 记录
|
|
277
|
+
1. **新增连带变更**:`app/src/config/index.ts` barrel——design.md §1.2 列为 Collateral Reads,但 §3.3 「@/config re-export 链路」段显式给出"或通过 index.ts barrel 一次到位"的择优方案;按 §3.3 执行(追加 5 项类型透出:`DotToObject` / `UnionToIntersection` / `BuildListModel` / `BuildListParams` / `ListModelKeyConfig`)。
|
|
278
|
+
2. **新增连带修复**:`app/src/api/mock/index.ts`——`AppApiListModel<T>` shape 由平铺改为嵌套,旧 mock 工具的字面量索引解构和构造失效;按 design.md 同方向修复(lodash get/set + 嵌套 shape)。design.md 设计阶段未识别此连带影响(R3 风险已涉及业务页 vue-tsc 抽样但未穷举 `src/api/`),按 Self-Healing Rule 修复一次。
|
|
279
|
+
|
|
280
|
+
### 自查 8 项通过情况
|
|
281
|
+
| # | 自查项 | 状态 |
|
|
282
|
+
|---|---|---|
|
|
283
|
+
| 1 | design.md Direct Targets 7 文件全部按预案修改/新建 | ✓ 7 文件全部就位 |
|
|
284
|
+
| 2 | Out-of-Scope 区域无任何触碰 | ✓ 业务壳层 3 项保留;table 目录无组件本体迁移;core/src/components/** 既有 4 子目录未动;NG-7 字面量贯彻 |
|
|
285
|
+
| 3 | vue-tsc 通过 | ✓ core / app 双向 clean pass |
|
|
286
|
+
| 4 | pnpm build 双向通过 | ✓ core exit=0 / app exit=0 |
|
|
287
|
+
| 5 | app dev 启动通过 | ✓ vite ready in 335 ms |
|
|
288
|
+
| 6 | DUCK + typeof 推导贯彻每一行新增/修改类型 | ✓ list-model.ts + types.ts 全部从 typeof KEY_CONFIG 推导 |
|
|
289
|
+
| 7 | U+FFFD 乱码自检 | ✓ 11 文件全部扫描,无 FFFD |
|
|
290
|
+
| 8 | tasks.md 全部 [x] + 验证证据齐全 | ✓ 21 个 [x] / 0 个 [ ] / 11 TASK 各含验证证据块 |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as d, ref as m, nextTick as l, onUpdated as u, onBeforeUnmount as g, openBlock as f, createElementBlock as p, renderSlot as v } from "vue";
|
|
2
|
+
import w from "lodash/debounce";
|
|
3
|
+
import { useActivatedExec as C, useActivatedEvent as b } from "../../hooks/activated.mjs";
|
|
4
|
+
const E = /* @__PURE__ */ d({
|
|
5
|
+
__name: "WatchSize",
|
|
6
|
+
props: {
|
|
7
|
+
mode: { default: "height" }
|
|
8
|
+
},
|
|
9
|
+
emits: ["heightChange", "widthChange"],
|
|
10
|
+
setup(r, { emit: c }) {
|
|
11
|
+
const s = r, i = c, t = m(), e = w(() => {
|
|
12
|
+
l(() => {
|
|
13
|
+
var n, o, a, h;
|
|
14
|
+
switch (s.mode) {
|
|
15
|
+
case "height":
|
|
16
|
+
i("heightChange", ((n = t.value) == null ? void 0 : n.clientHeight) || 0);
|
|
17
|
+
break;
|
|
18
|
+
case "width":
|
|
19
|
+
i("widthChange", ((o = t.value) == null ? void 0 : o.clientWidth) || 0);
|
|
20
|
+
break;
|
|
21
|
+
case "both":
|
|
22
|
+
i("heightChange", ((a = t.value) == null ? void 0 : a.clientHeight) || 0), i("widthChange", ((h = t.value) == null ? void 0 : h.clientWidth) || 0);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}, 16);
|
|
27
|
+
return C(() => {
|
|
28
|
+
e();
|
|
29
|
+
}), b(
|
|
30
|
+
() => {
|
|
31
|
+
window.addEventListener("resize", e);
|
|
32
|
+
},
|
|
33
|
+
() => {
|
|
34
|
+
window.removeEventListener("resize", e);
|
|
35
|
+
}
|
|
36
|
+
), u(() => {
|
|
37
|
+
e();
|
|
38
|
+
}), g(() => {
|
|
39
|
+
e(), e.flush();
|
|
40
|
+
}), (n, o) => (f(), p("div", {
|
|
41
|
+
ref_key: "box",
|
|
42
|
+
ref: t
|
|
43
|
+
}, [
|
|
44
|
+
v(n.$slots, "default")
|
|
45
|
+
], 512));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
E as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { ElFormItem as q, ElText as G } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/form-item/style/css";
|
|
4
|
+
import "element-plus/es/components/text/style/css";
|
|
5
|
+
import { defineComponent as J, shallowRef as Q, computed as n, watch as p, withDirectives as U, openBlock as a, createBlock as c, mergeProps as v, unref as r, withCtx as y, renderSlot as W, normalizeProps as F, createTextVNode as k, toDisplayString as h, resolveDynamicComponent as b, createSlots as X, createElementBlock as L, Fragment as Y, createCommentVNode as Z, vShow as _ } from "vue";
|
|
6
|
+
import { getPlaceholder as ee, getChangeSubmit as te, getBlurSubmit as ne, getEnterSubmit as oe, getVModelSugar as re, generateFormData as ie } from "./utils.mjs";
|
|
7
|
+
import ae from "lodash/omit";
|
|
8
|
+
const ce = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "form-item-tip"
|
|
11
|
+
}, pe = /* @__PURE__ */ J({
|
|
12
|
+
name: "FormItem",
|
|
13
|
+
__name: "FormItem",
|
|
14
|
+
props: {
|
|
15
|
+
config: {},
|
|
16
|
+
data: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["viewHideChange", "submit"],
|
|
19
|
+
setup(i, { emit: B }) {
|
|
20
|
+
const t = i, l = B, P = Q(), H = n(() => {
|
|
21
|
+
const {
|
|
22
|
+
config: { beLink: e }
|
|
23
|
+
} = t;
|
|
24
|
+
return e ? Array.isArray(e) ? e : [e] : [];
|
|
25
|
+
}), w = n(() => H.value.filter((e) => e.key !== t.config.key)), V = n(() => w.value.length > 0), x = n(() => t.data[t.config.key]), g = n(() => ({
|
|
26
|
+
data: t.data,
|
|
27
|
+
config: t.config
|
|
28
|
+
})), D = n(() => {
|
|
29
|
+
const { config: e } = t;
|
|
30
|
+
return typeof e.wrapProps == "function" ? e.wrapProps(g.value) : e.wrapProps || {};
|
|
31
|
+
}), C = n(() => {
|
|
32
|
+
const { config: e } = t;
|
|
33
|
+
return typeof e.props == "function" ? e.props(g.value) : e.props || {};
|
|
34
|
+
}), T = () => {
|
|
35
|
+
l("submit", "enter");
|
|
36
|
+
}, A = () => {
|
|
37
|
+
l("submit", "blur");
|
|
38
|
+
}, M = () => {
|
|
39
|
+
l("submit", "change");
|
|
40
|
+
}, E = (e, o) => {
|
|
41
|
+
w.value.forEach((u) => {
|
|
42
|
+
const { key: f, getValue: S } = u, j = S(e, t.data[f], o);
|
|
43
|
+
t.data[f] = S(e, j);
|
|
44
|
+
});
|
|
45
|
+
}, N = n(() => ee(t.config) || {}), $ = n(() => ({
|
|
46
|
+
...oe(t.config, T) || {},
|
|
47
|
+
...ne(t.config, A) || {},
|
|
48
|
+
...te(t.config, M) || {}
|
|
49
|
+
})), z = n(() => ae(C.value, ["children"])), K = n(() => re({
|
|
50
|
+
modelValueKey: "modelValue",
|
|
51
|
+
data: t.data,
|
|
52
|
+
config: t.config
|
|
53
|
+
})), O = n(() => V.value ? {
|
|
54
|
+
onTriggerChangeLink: E
|
|
55
|
+
} : {}), d = n(() => ({
|
|
56
|
+
...N.value,
|
|
57
|
+
...$.value,
|
|
58
|
+
...z.value,
|
|
59
|
+
...K.value,
|
|
60
|
+
...O.value
|
|
61
|
+
})), s = n(() => {
|
|
62
|
+
const { children: e } = C.value;
|
|
63
|
+
return e;
|
|
64
|
+
}), I = n(() => {
|
|
65
|
+
const { config: e } = t, { hide: o } = e;
|
|
66
|
+
return typeof o == "boolean" ? o : (o == null ? void 0 : o({
|
|
67
|
+
...g.value,
|
|
68
|
+
getInitValue: () => ie([e])[e.key]
|
|
69
|
+
})) ?? !1;
|
|
70
|
+
}), R = n(() => `form-item-${t.config.key}`);
|
|
71
|
+
p(
|
|
72
|
+
I,
|
|
73
|
+
(e) => {
|
|
74
|
+
var o;
|
|
75
|
+
l("viewHideChange", {
|
|
76
|
+
config: t.config,
|
|
77
|
+
status: e
|
|
78
|
+
}), e && ((o = P.value) == null || o.clearValidate());
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
immediate: !0
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
let m;
|
|
85
|
+
return p(
|
|
86
|
+
V,
|
|
87
|
+
(e) => {
|
|
88
|
+
e ? m = p(
|
|
89
|
+
x,
|
|
90
|
+
(o) => {
|
|
91
|
+
E(o);
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
immediate: !0
|
|
95
|
+
}
|
|
96
|
+
) : m == null || m();
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
immediate: !0
|
|
100
|
+
}
|
|
101
|
+
), (e, o) => {
|
|
102
|
+
const u = G, f = q;
|
|
103
|
+
return U((a(), c(f, v({
|
|
104
|
+
ref_key: "formItem",
|
|
105
|
+
ref: P,
|
|
106
|
+
prop: i.config.key,
|
|
107
|
+
label: i.config.label,
|
|
108
|
+
class: r(R)
|
|
109
|
+
}, r(D)), {
|
|
110
|
+
default: y(() => [
|
|
111
|
+
i.config.render === void 0 ? W(e.$slots, "default", F(v({ key: 0 }, r(d))), () => [
|
|
112
|
+
k(h(r(d).modelValue), 1)
|
|
113
|
+
], !0) : (a(), c(b(i.config.render), F(v({ key: 1 }, r(d))), X({ _: 2 }, [
|
|
114
|
+
r(s) !== void 0 ? {
|
|
115
|
+
name: "default",
|
|
116
|
+
fn: y(() => [
|
|
117
|
+
typeof r(s) == "function" ? (a(), c(b(r(s)), { key: 0 })) : (a(), L(Y, { key: 1 }, [
|
|
118
|
+
k(h(r(s)), 1)
|
|
119
|
+
], 64))
|
|
120
|
+
]),
|
|
121
|
+
key: "0"
|
|
122
|
+
} : void 0
|
|
123
|
+
]), 1040)),
|
|
124
|
+
i.config.tip ? (a(), L("div", ce, [
|
|
125
|
+
typeof i.config.tip == "function" ? (a(), c(b(i.config.tip), { key: 0 })) : (a(), c(u, {
|
|
126
|
+
key: 1,
|
|
127
|
+
type: "info"
|
|
128
|
+
}, {
|
|
129
|
+
default: y(() => [
|
|
130
|
+
k(h(i.config.tip), 1)
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}))
|
|
134
|
+
])) : Z("", !0)
|
|
135
|
+
]),
|
|
136
|
+
_: 3
|
|
137
|
+
}, 16, ["prop", "label", "class"])), [
|
|
138
|
+
[_, !r(I)]
|
|
139
|
+
]);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
export {
|
|
144
|
+
pe as default
|
|
145
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ElForm as B, ElRow as H, ElCol as K } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/css";
|
|
3
|
+
import "element-plus/es/components/form/style/css";
|
|
4
|
+
import "element-plus/es/components/row/style/css";
|
|
5
|
+
import "element-plus/es/components/col/style/css";
|
|
6
|
+
import { defineComponent as N, shallowRef as P, ref as E, computed as i, provide as D, watch as p, openBlock as h, createBlock as L, unref as y, withCtx as f, createVNode as V, createElementBlock as G, Fragment as T, renderList as q, withDirectives as z, mergeProps as O, renderSlot as S, vShow as J } from "vue";
|
|
7
|
+
import Q from "./FormItem.vue.mjs";
|
|
8
|
+
import { FORM_ITEM_CHANGE_LOADING as U } from "./utils.mjs";
|
|
9
|
+
const ue = /* @__PURE__ */ N({
|
|
10
|
+
name: "FormMain",
|
|
11
|
+
inheritAttrs: !0,
|
|
12
|
+
__name: "FormMain",
|
|
13
|
+
props: {
|
|
14
|
+
list: {},
|
|
15
|
+
data: {},
|
|
16
|
+
layout: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["loadingChange", "visibleChange", "submit"],
|
|
19
|
+
setup(m, { expose: j, emit: x }) {
|
|
20
|
+
const u = m, v = x, a = P(), d = E([]), c = E({}), b = i(() => !!d.value.length), F = i(() => Object.keys(c.value).filter(
|
|
21
|
+
(e) => c.value[e]
|
|
22
|
+
)), R = i(() => u.list.filter((e) => !F.value.includes(e.key))), $ = i(() => R.value.length > 0), I = (e) => e;
|
|
23
|
+
j({
|
|
24
|
+
validate: () => a.value ? new Promise((e, t) => {
|
|
25
|
+
var o;
|
|
26
|
+
(o = a.value) == null || o.validate((l, s) => {
|
|
27
|
+
if (l)
|
|
28
|
+
e();
|
|
29
|
+
else {
|
|
30
|
+
const r = { ...s || {} };
|
|
31
|
+
Object.keys(r).forEach((n) => {
|
|
32
|
+
var C;
|
|
33
|
+
F.value.includes(n) && (console.log(`当前${n}被隐藏,移除校验`, r[n]), delete r[n], (C = a.value) == null || C.clearValidate(n));
|
|
34
|
+
}), Object.keys(r).length === 0 ? e() : t(s);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}) : Promise.reject(new Error("实例化未完成")),
|
|
38
|
+
resetFields: () => a.value ? a.value.resetFields() : console.error("实例化未完成"),
|
|
39
|
+
clearValidate: (e) => a.value ? a.value.clearValidate(e) : console.error("实例化未完成")
|
|
40
|
+
});
|
|
41
|
+
const g = i(() => u.list), _ = i(() => g.value.reduce((e, t) => (t.rules && (typeof t.rules == "function" ? e[t.key] = t.rules({
|
|
42
|
+
data: u.data,
|
|
43
|
+
config: t
|
|
44
|
+
}) : e[t.key] = t.rules), e), {})), k = i(() => d.value.reduce(
|
|
45
|
+
(e, t) => (e[t.key] = [
|
|
46
|
+
{
|
|
47
|
+
validator: () => [new Error(`${t.label}${t.message}`)]
|
|
48
|
+
}
|
|
49
|
+
], e),
|
|
50
|
+
{}
|
|
51
|
+
)), M = i(() => {
|
|
52
|
+
const e = Object.keys(_.value), t = Object.keys(k.value);
|
|
53
|
+
return [...new Set(e.concat(t))].reduce((l, s) => (l[s] = [
|
|
54
|
+
..._.value[s] || [],
|
|
55
|
+
...k.value[s] || []
|
|
56
|
+
], l), {});
|
|
57
|
+
});
|
|
58
|
+
D(U, ({ key: e, message: t }) => {
|
|
59
|
+
if (!e)
|
|
60
|
+
return console.error("更新状态未传入key, 此处忽略");
|
|
61
|
+
const o = d.value.findIndex((l) => l.key === e);
|
|
62
|
+
o === -1 ? t && d.value.push({
|
|
63
|
+
key: e,
|
|
64
|
+
message: t,
|
|
65
|
+
label: u.list.find((l) => l.key === e).label
|
|
66
|
+
}) : t ? d.value.splice(o, 1, {
|
|
67
|
+
key: e,
|
|
68
|
+
message: t,
|
|
69
|
+
label: u.list.find((l) => l.key === e).label
|
|
70
|
+
}) : d.value.splice(o, 1);
|
|
71
|
+
});
|
|
72
|
+
const A = ({
|
|
73
|
+
status: e,
|
|
74
|
+
config: { key: t }
|
|
75
|
+
}) => {
|
|
76
|
+
(c.value[t] || !1) !== e && (c.value[t] = e);
|
|
77
|
+
}, w = (e) => ({
|
|
78
|
+
...u.layout || {},
|
|
79
|
+
...e || {}
|
|
80
|
+
});
|
|
81
|
+
return p(
|
|
82
|
+
g,
|
|
83
|
+
() => {
|
|
84
|
+
c.value = {};
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
immediate: !0
|
|
88
|
+
}
|
|
89
|
+
), p(b, () => {
|
|
90
|
+
v("loadingChange", b.value);
|
|
91
|
+
}), p(
|
|
92
|
+
$,
|
|
93
|
+
(e) => {
|
|
94
|
+
v("visibleChange", e);
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
immediate: !0
|
|
98
|
+
}
|
|
99
|
+
), (e, t) => {
|
|
100
|
+
const o = K, l = H, s = B;
|
|
101
|
+
return h(), L(s, {
|
|
102
|
+
ref_key: "elForm",
|
|
103
|
+
ref: a,
|
|
104
|
+
model: m.data,
|
|
105
|
+
rules: y(M)
|
|
106
|
+
}, {
|
|
107
|
+
default: f(() => [
|
|
108
|
+
V(l, null, {
|
|
109
|
+
default: f(() => [
|
|
110
|
+
(h(!0), G(T, null, q(y(g), (r) => z((h(), L(o, O({
|
|
111
|
+
key: r.key
|
|
112
|
+
}, { ref_for: !0 }, w(r.layout)), {
|
|
113
|
+
default: f(() => [
|
|
114
|
+
V(Q, {
|
|
115
|
+
data: m.data,
|
|
116
|
+
config: I(r),
|
|
117
|
+
onViewHideChange: A,
|
|
118
|
+
onSubmit: t[0] || (t[0] = (n) => v("submit", n))
|
|
119
|
+
}, {
|
|
120
|
+
default: f((n) => [
|
|
121
|
+
S(e.$slots, r.key, O({ ref_for: !0 }, n))
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
}, 1032, ["data", "config"])
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, 1040)), [
|
|
128
|
+
[J, !(y(c)[r.key] ?? !1)]
|
|
129
|
+
])), 128)),
|
|
130
|
+
S(e.$slots, "default", { mergeLayout: w })
|
|
131
|
+
]),
|
|
132
|
+
_: 3
|
|
133
|
+
})
|
|
134
|
+
]),
|
|
135
|
+
_: 3
|
|
136
|
+
}, 8, ["model", "rules"]);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export {
|
|
141
|
+
ue as default
|
|
142
|
+
};
|