chore(openspec): track ty-form rename + search collapse in fe-admin-user-page
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
1272b48fc1
commit
5a941f8ee6
@ -5,7 +5,7 @@
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
- 抽取公共组件:`ty-schema-form`(JSON Schema 表单)、`ty-search-form`、`ty-table`、`ty-form-dialog`、`ty-crud`(整页组合)。
|
||||
- 抽取公共组件:`ty-form`(JSON Schema 表单)、`ty-search-form`、`ty-table`、`ty-form-dialog`、`ty-crud`(整页组合)。
|
||||
- 用 JSON Schema 描述表单(搜索 + 弹窗表单),声明式渲染字段与校验。
|
||||
- 用户管理页用 `ty-crud` + JSON Schema + 内联数据(setTimeout)跑通。
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
|
||||
### D1. JSON Schema 驱动表单(自实现轻量子集)
|
||||
表单字段用 JSON Schema 描述:`type`(string/integer/number/boolean)、`title`(标签)、`enum`+`enumNames`(下拉)、`format`(password/email/textarea)、`default`、`readOnly`、`showOn`(仅 create/edit 显示,如 password)、`required`(必填)、`minLength`/`format:email`(校验)。
|
||||
- `ty-schema-form` 按 schema 渲染字段(enum→select、boolean→switch、number→input-number、format→password/textarea、其余→input),校验规则由 schema 生成,`defineExpose` 暴露 `validate`/`resetFields`。
|
||||
- `ty-form` 按 schema 渲染字段(enum→select、boolean→switch、number→input-number、format→password/textarea、其余→input),校验规则由 schema 生成,`defineExpose` 暴露 `validate`/`resetFields`。
|
||||
- 不引第三方 JSON Schema 表单库(`vue-json-schema-form` 等)——脚手架追求少依赖,且只需常用子集。
|
||||
|
||||
### D2. 组件分层(基础组件 + 整页组合)
|
||||
- 基础组件:`ty-schema-form`、`ty-search-form`(搜索 + 查询/重置)、`ty-table`(列配置 + 分页 + 操作列插槽)、`ty-form-dialog`(弹窗 + schema 表单 + 校验提交)。
|
||||
- 基础组件:`ty-form`、`ty-search-form`(搜索 + 查询/重置)、`ty-table`(列配置 + 分页 + 操作列插槽)、`ty-form-dialog`(弹窗 + schema 表单 + 校验提交)。
|
||||
- 整页组件:`ty-crud`(组合搜索/工具栏/表格/弹窗/删除),props 传 `columns/searchSchema/formSchema/list/create/update/remove` 等,`#row-actions` 插槽放额外操作(如重置密码)。
|
||||
- 类型放 `src/types/crud.ts`(JsonSchema/JsonSchemaProperty/TableColumn/PageResult/PageQuery)。
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
- 新增「用户管理」页面(`src/pages/system/user/index.vue`,对应菜单 `/system/user`)。
|
||||
- 页面功能:搜索(用户名/昵称/手机/状态)、表格(用户名/昵称/邮箱/手机/状态/组织/创建时间)、分页、新增/编辑弹窗、删除确认、重置密码。
|
||||
- **抽取公共 CRUD 组件**(本次核心目标):`ty-schema-form`(JSON Schema 驱动表单)、`ty-search-form`、`ty-table`、`ty-form-dialog`、`ty-crud`(整页组合),供后续 8 个域页面复用。
|
||||
- **抽取公共 CRUD 组件**(本次核心目标):`ty-form`(JSON Schema 驱动表单)、`ty-search-form`、`ty-table`、`ty-form-dialog`、`ty-crud`(整页组合),供后续 8 个域页面复用。
|
||||
- **JSON Schema 描述表单**:搜索与弹窗表单字段用 JSON Schema 声明式配置(类型/标题/枚举/校验/showOn)。
|
||||
- 数据:页面内联 + `setTimeout` 模拟异步(不建 mock 模块),字段对齐后端 `user` 模型,后续接后端只替换数据函数。
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
## Impact
|
||||
|
||||
- 前端 `sources/sysmgr-admin`:
|
||||
- 新增公共组件 `src/components/ty-schema-form.vue`、`ty-search-form.vue`、`ty-table.vue`、`ty-form-dialog.vue`、`ty-crud.vue`
|
||||
- 新增公共组件 `src/components/ty-form.vue`、`ty-search-form.vue`、`ty-table.vue`、`ty-form-dialog.vue`、`ty-crud.vue`
|
||||
- 新增类型 `src/types/crud.ts`(JsonSchema/TableColumn/PageResult 等)
|
||||
- 新增 `src/pages/system/user/index.vue`(用户管理页,ty-crud + JSON Schema + 内联数据)
|
||||
- 后端无变更;不接真实接口。
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
## 2. 基础组件(src/components/ty-*.vue,自动导入)
|
||||
|
||||
- [x] 2.1 `ty-schema-form`:按 JSON Schema 渲染字段(select/switch/input-number/password/textarea/input)+ 校验 + expose validate/resetFields + readOnly/showOn
|
||||
- [x] 2.1 `ty-form`:按 JSON Schema 渲染字段(select/switch/input-number/password/textarea/input)+ 校验 + expose validate/resetFields + readOnly/showOn
|
||||
- [x] 2.2 `ty-search-form`:行内搜索 + 查询/重置
|
||||
- [x] 2.3 `ty-table`:列配置(text/tag/datetime/formatter)+ 分页 + `#actions` 操作列插槽
|
||||
- [x] 2.4 `ty-form-dialog`:弹窗 + schema 表单 + 校验提交(v-model:visible + mode)
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 45b22acd6cf4b498e5a432b56ce448141d4d0808
|
||||
Subproject commit 104b7678d3ff684c066cb6884c0fc6a1b464dc07
|
||||
Loading…
x
Reference in New Issue
Block a user