jtxa-ui 1.1.3 → 1.1.4
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 +64 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- [TableBigData 大数据表](#8-tablebigdata-大数据增量表-table-big-data)
|
|
27
27
|
- [TreeTable 虚拟树表](#9-treetable-虚拟树表-tree-table)
|
|
28
28
|
- [共享表格属性 publicProps](#共享表格属性-publicprops)
|
|
29
|
+
- [渲染器清单(cellRender / editRender)](#渲染器清单cellrender--editrender)
|
|
29
30
|
- [工具函数](#工具函数)
|
|
30
31
|
- [已知问题与注意事项](#已知问题与注意事项)
|
|
31
32
|
- [相关文档](#相关文档)
|
|
@@ -152,6 +153,22 @@ app.use(TreeTable)
|
|
|
152
153
|
|
|
153
154
|
**Events**:`switchChange` · `focus` · `blur` · `casChange` · `cusBtn`
|
|
154
155
|
|
|
156
|
+
**`rules` 字符串语法**:`rules` 为对象,`key` 是 `modelKey`,`value` 是规则字符串数组,由内置 `Validate`(`packages/form/validate.js`)转换为 Element Plus 规则:
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
const rules = {
|
|
160
|
+
name: ['required', 'phone'], // 必填 + 手机号
|
|
161
|
+
age: ['num'], // 必须是数字
|
|
162
|
+
email: ['email'], // 邮箱格式
|
|
163
|
+
code: ['idCard'], // 身份证
|
|
164
|
+
remark: ['range-2-10'], // 长度 2~10(用 “-” 传参)
|
|
165
|
+
ename: ['letters'], // 仅英文字母
|
|
166
|
+
tags: ['requireSelect'], // 至少选一个(数组)
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
内置校验类型:`required` · `requiredFocus` · `range-min-max` · `len-n` · `num` · `email` · `idCard` · `phone` · `letters` · `requireAll` · `requireSelect`。
|
|
171
|
+
|
|
155
172
|
**Slots**:
|
|
156
173
|
|
|
157
174
|
- `upload`:当字段 `type: 'upload'` 时,使用 `item.slotName`(默认 `upload`)具名插槽渲染上传区;
|
|
@@ -349,6 +366,24 @@ const conditions = searchTypeRef.value.getData()
|
|
|
349
366
|
| `isLastLoad` | Boolean | `true` | 是否末次加载 |
|
|
350
367
|
| `slotConfig` | Array | `[]` | 自定义插槽组件配置(传入业务子组件) |
|
|
351
368
|
|
|
369
|
+
**`mode` 与面板组件映射**:`mode`(或 `pageMode`)决定渲染哪种版式,内部按值派发到 `mtt-panel-*` 子组件:
|
|
370
|
+
|
|
371
|
+
| mode | 面板组件 | 版式形态 |
|
|
372
|
+
| --- | --- | --- |
|
|
373
|
+
| `0` | `jt-page-manager-tree-table` | 默认树表 |
|
|
374
|
+
| `1` | `mtt-panel` | 左右看板 |
|
|
375
|
+
| `2` | `mtt-panel-1` | 上下看板 |
|
|
376
|
+
| `3` | `mtt-panel-2` | 展开形式看板 |
|
|
377
|
+
| `5` | `mtt-panel-5` | 左侧 Tab + 右侧 tree-list |
|
|
378
|
+
| `7` | `mtt-panel-7` | 左侧树 + 右侧普通清单 |
|
|
379
|
+
| `8` | `mtt-panel-8` | 左侧 Tab + 右侧分组表格 |
|
|
380
|
+
| `10` | `mtt-panel-10` | 左侧 Tab + 右侧 TreeTable |
|
|
381
|
+
| `11` | `mtt-panel-11` | 左侧 Tab + 右侧 TreeTable(变体) |
|
|
382
|
+
| `12` | `mtt-panel-12` | 左侧 Tab + 右侧 TreeTable(变体) |
|
|
383
|
+
| `13` | `mtt-panel-13` | 左侧 Tab + 右侧 TreeTable(变体) |
|
|
384
|
+
|
|
385
|
+
> `mode` 还可由 `config.radioData` 中某项 `style` 字段在运行时切换(见 `radioChange`)。
|
|
386
|
+
|
|
352
387
|
**Events**:`getBaseParams`
|
|
353
388
|
|
|
354
389
|
**Slots**:透传父级所有插槽;向面板透传 `#cusComp`。
|
|
@@ -621,6 +656,35 @@ VxeTable 基础封装:工具栏、表尾统计、虚拟滚动、单选 / 多
|
|
|
621
656
|
|
|
622
657
|
---
|
|
623
658
|
|
|
659
|
+
## 渲染器清单(cellRender / editRender)
|
|
660
|
+
|
|
661
|
+
表格列通过 `header[].cellRender` / `header[].editRender` 指定渲染器名称,对应 `packages/tables/hooks/cell-render/cell-render.js` 与 `edit-render/edit-render.js` 中 `VxeUI.renderer.add(...)` 的注册名。
|
|
662
|
+
|
|
663
|
+
**单元格渲染器(cellRender)**
|
|
664
|
+
|
|
665
|
+
| 名称 | 说明 |
|
|
666
|
+
| --- | --- |
|
|
667
|
+
| `TabsBtn` | 单元格内按钮组 |
|
|
668
|
+
| `TabsCheckbox` | 单元格内复选框组 |
|
|
669
|
+
| `TabsSwitch` | 单元格内开关 |
|
|
670
|
+
| `Select` | 单元格内下拉(表单型,由 `CellForm` 承载) |
|
|
671
|
+
| `Input` | 单元格内输入框(表单型) |
|
|
672
|
+
| `Number` | 单元格内数字输入(表单型) |
|
|
673
|
+
| `Rate` | 单元格内评分(表单型) |
|
|
674
|
+
|
|
675
|
+
> `Select` / `Input` / `Number` / `Rate` 共用 `CellForm`,通过列配置 `props`(枚举 `enum`、功能码 `funcode`、占位 `placeholder`、最大值 `max` 等)区分形态。
|
|
676
|
+
|
|
677
|
+
**编辑渲染器(editRender,双击进入编辑态时生效)**
|
|
678
|
+
|
|
679
|
+
| 名称 | 说明 |
|
|
680
|
+
| --- | --- |
|
|
681
|
+
| `cascader` | 级联选择器 |
|
|
682
|
+
| `cascader-select` | 级联 + 选择组合 |
|
|
683
|
+
| `cus-select` | 自定义下拉 |
|
|
684
|
+
| `cus-input` | 自定义输入 |
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
624
688
|
## 工具函数
|
|
625
689
|
|
|
626
690
|
随默认导出(`import jtui from 'jtxa-ui'`)一并暴露的工具方法:
|