openxiangda-skill-kit 2.1.5 → 2.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda-skill-kit",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "description": "OpenXiangda 2.0 中文 AI 技能的校验、分发与安装。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "openxiangda-devkit-core": "2.13.0"
20
+ "openxiangda-devkit-core": "2.14.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -175,3 +175,23 @@ import 'openxiangda/mobile/styles.css';
175
175
  PC 抽屉提供“全屏 / 新开页面 / 关闭”。全屏保留当前表单;新开页面先暂存,再通过草稿 ID 恢复,内容不放入 URL。移动录入使用平台移动字段的分组行式布局、简单标题和底部操作,不放“返回列表”或桌面输入控件;草稿箱和恢复确认使用底部弹层。
176
176
 
177
177
  自定义表单可从 `openxiangda/react` 使用 `createResourceFormDraftClient(resourceCode, mode, recordId?, viewCode?)`,提供 `list/save/remove/submit`。命名视图只能恢复和提交属于当前视图的草稿;所有视图仍共用每人每个模型 20 份的上限。`save` 使用草稿 ID、expectedRevision 和可编辑字段值;`submit` 消费现有 DataTransactionOperation,不另建 CRUD 后端。此能力需要平台的 authenticated-form-drafts SQL 迁移及对应服务端版本,平台未升级时界面会明确显示暂存失败并保留输入。
178
+
179
+ ## 列表排序声明 {#sortable-fields}
180
+
181
+ 模块化列表视图用 `sortableFields` 声明用户可点击列头排序的列;`defaultSort.field`
182
+ 隐式可排序,两者重复出现不报错。与 `filterFields` / `searchableFields` 同构:
183
+
184
+ ```ts
185
+ crud: [{
186
+ model: 'venues',
187
+ list: {
188
+ fields: ['name', 'capacity'],
189
+ filterFields: ['capacity'],
190
+ searchableFields: ['name'],
191
+ sortableFields: ['capacity'],
192
+ defaultSort: { field: 'name', order: 'asc' },
193
+ },
194
+ }]
195
+ ```
196
+
197
+ 引用未声明字段按编译错误处理;低层 `data.resources[].fields[].sortable` 语义不变。
@@ -22,6 +22,7 @@
22
22
  | `audit.read` 可写 `true`(绑定本资源读能力)或能力数组 | `audit: { read: true }` |
23
23
  | `resource-ref.*` 必须带 `source` 来源协议 | `{ type: 'resource-ref.single', source: { kind: 'resource', resourceCode: 'repair-requests', labelField: 'title', searchFields: ['title'], pageSize: 20, loadMode: 'search' } }` |
24
24
  | `labelField` 必须指向目标资源的 `text.short` / `text.long` 字段 | 不要用流水号/选项字段当 label |
25
+ | 列表可排序列用视图级 `sortableFields` 表达(`defaultSort.field` 隐式可排序) | `list: { sortableFields: ['capacity'], defaultSort: { field: 'name', order: 'asc' } }` |
25
26
  | 每个字段都必须带中文/业务 `label`(含子表外键与排序字段) | `{ code: 'requestId', type: 'uuid', label: '所属申请', required: true }` |
26
27
  | 子表 `subtable` 的外键是子资源的 **uuid** 字段,排序字段是**可写 number.integer** | 子资源:`{ code: 'requestId', type: 'uuid', required: true }` + `{ code: 'sortOrder', type: 'number.integer', required: true }`;父表:`subtable: { resourceCode: 'repair-items', foreignKey: 'requestId', orderField: 'sortOrder', maxRows: 20 }` |
27
28
  | 图片/附件的 `file` 限定数量与大小 | `file: { maxCount: 3, maxSizeMb: 10, accept: ['image/png', 'image/jpeg'] }` |