king-design-analyzer 2.1.7 → 2.2.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/components/actions.json +101 -0
- package/components/advancedset.json +127 -0
- package/components/affix.json +7 -0
- package/components/aksk.json +172 -0
- package/components/az.json +15 -2
- package/components/badge.json +7 -0
- package/components/billtypes.json +14 -2
- package/components/breadcrumb.json +7 -0
- package/components/button.json +191 -0
- package/components/buttonlink.json +73 -0
- package/components/card.json +8 -1
- package/components/cardcol.json +142 -0
- package/components/cardcols.json +121 -0
- package/components/cardcontent.json +15 -3
- package/components/cardtabs.json +172 -0
- package/components/carousel.json +7 -0
- package/components/cascader.json +520 -368
- package/components/checkbox.json +51 -4
- package/components/cidrinput.json +140 -0
- package/components/code.json +8 -1
- package/components/collapse.json +7 -0
- package/components/colorpicker.json +217 -0
- package/components/copy.json +7 -0
- package/components/copyhover.json +111 -0
- package/components/copyrow.json +124 -0
- package/components/datepicker.json +656 -524
- package/components/description.json +98 -0
- package/components/dialog.json +522 -455
- package/components/divider.json +8 -1
- package/components/drawer.json +571 -558
- package/components/dropdown.json +464 -384
- package/components/duration.json +125 -0
- package/components/editable.json +66 -0
- package/components/ellipsis.json +34 -1
- package/components/filtertablefieldsdialog.json +128 -0
- package/components/flex.json +151 -0
- package/components/form.json +131 -0
- package/components/formiteminput.json +214 -0
- package/components/formitemspinner.json +213 -0
- package/components/formitemswitch.json +185 -0
- package/components/formitemtableconfigs.json +210 -0
- package/components/grid.json +7 -0
- package/components/header.json +161 -0
- package/components/icon.json +13 -1
- package/components/icontooltip.json +19 -1
- package/components/input.json +188 -4
- package/components/instancelist.json +194 -0
- package/components/instancenum.json +196 -0
- package/components/ipinput.json +117 -0
- package/components/kspstatus.json +205 -0
- package/components/kvcode.json +120 -0
- package/components/layoutcontent.json +15 -3
- package/components/layoutlistcontent.json +148 -0
- package/components/layoutpermissioncontent.json +155 -0
- package/components/layoutstandardlist.json +275 -0
- package/components/layouttabs.json +168 -0
- package/components/lazymount.json +86 -0
- package/components/lazyteleport.json +118 -0
- package/components/menu.json +7 -0
- package/components/pagination.json +12 -0
- package/components/paginationplus.json +30 -3
- package/components/password.json +121 -0
- package/components/popover.json +457 -437
- package/components/projects.json +129 -0
- package/components/protable.json +97 -8
- package/components/queuevisualrange.json +110 -0
- package/components/radio.json +82 -2
- package/components/rate.json +199 -0
- package/components/region.json +14 -2
- package/components/search.json +221 -0
- package/components/searchinput.json +132 -0
- package/components/searchitems.json +215 -0
- package/components/searchselect.json +195 -0
- package/components/select.json +686 -666
- package/components/sidebar.json +198 -0
- package/components/skeleton.json +233 -0
- package/components/spin.json +8 -1
- package/components/split.json +260 -0
- package/components/sshkeys.json +138 -0
- package/components/status.json +60 -3
- package/components/steps.json +7 -0
- package/components/switch.json +8 -1
- package/components/table.json +18 -1
- package/components/tablecolumnid.json +14 -2
- package/components/tabs.json +12 -0
- package/components/timeline.json +213 -0
- package/components/timepicker.json +147 -3
- package/components/timerange.json +262 -0
- package/components/tip.json +7 -0
- package/components/tooltip.json +484 -395
- package/components/tour.json +418 -372
- package/components/transfer.json +27 -3
- package/components/tree.json +6 -4
- package/components/treeselect.json +556 -475
- package/components/upload.json +474 -473
- package/components/vdialog.json +308 -0
- package/components/vdrawer.json +331 -0
- package/components/virtuallist.json +7 -0
- package/dist/ast/index.d.mts +35 -1
- package/dist/ast/index.d.ts +35 -1
- package/dist/ast/index.js +5 -3
- package/dist/ast/index.mjs +3 -1
- package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
- package/dist/chunk-BI5TIQID.mjs +330 -0
- package/dist/{chunk-6QS5IGS6.js → chunk-CJGGFVQJ.js} +8 -8
- package/dist/chunk-CR3GC4H3.js +353 -0
- package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
- package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/chunk-KF5YBEM5.js +143 -0
- package/dist/chunk-KMIDURUR.mjs +33324 -0
- package/dist/chunk-QC6VTSA3.mjs +117 -0
- package/dist/chunk-SZYVGYKK.js +33350 -0
- package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
- package/dist/chunk-UJCSKKID.mjs +27 -0
- package/dist/{chunk-FVSQ6BU6.mjs → chunk-XGPHQHLR.mjs} +4 -4
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.mjs +1 -1
- package/dist/full/index.js +8 -6
- package/dist/full/index.mjs +6 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -13
- package/dist/index.mjs +7 -5
- package/dist/metadata/index.d.mts +22 -2
- package/dist/metadata/index.d.ts +22 -2
- package/dist/metadata/index.js +27 -17
- package/dist/metadata/index.mjs +27 -16
- package/dist/resolve-BsLBxlBi.d.mts +24 -0
- package/dist/resolve-BsLBxlBi.d.ts +24 -0
- package/dist/runtime/index.js +5 -4
- package/dist/runtime/index.mjs +3 -2
- package/dist/shared/index.d.mts +10 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.js +23 -0
- package/dist/shared/index.mjs +2 -0
- package/dist/static/index.js +6 -5
- package/dist/static/index.mjs +3 -2
- package/docs_for_llm/actions.doc.md +77 -0
- package/docs_for_llm/advancedset.doc.md +89 -0
- package/docs_for_llm/affix.doc.md +15 -7
- package/docs_for_llm/aksk.doc.md +111 -0
- package/docs_for_llm/az.doc.md +17 -11
- package/docs_for_llm/badge.doc.md +6 -5
- package/docs_for_llm/billtypes.doc.md +17 -11
- package/docs_for_llm/breadcrumb.doc.md +6 -3
- package/docs_for_llm/button.doc.md +34 -18
- package/docs_for_llm/buttonlink.doc.md +55 -0
- package/docs_for_llm/card.doc.md +8 -5
- package/docs_for_llm/cardcol.doc.md +78 -0
- package/docs_for_llm/cardcols.doc.md +84 -0
- package/docs_for_llm/cardcontent.doc.md +10 -10
- package/docs_for_llm/cardtabs.doc.md +106 -0
- package/docs_for_llm/carousel.doc.md +8 -7
- package/docs_for_llm/cascader.doc.md +46 -25
- package/docs_for_llm/checkbox.doc.md +25 -13
- package/docs_for_llm/cidrinput.doc.md +83 -0
- package/docs_for_llm/code.doc.md +22 -11
- package/docs_for_llm/collapse.doc.md +9 -6
- package/docs_for_llm/colorpicker.doc.md +104 -0
- package/docs_for_llm/copy.doc.md +15 -13
- package/docs_for_llm/copyhover.doc.md +59 -0
- package/docs_for_llm/copyrow.doc.md +71 -0
- package/docs_for_llm/datepicker.doc.md +51 -39
- package/docs_for_llm/description.doc.md +75 -0
- package/docs_for_llm/descriptions.doc.md +9 -6
- package/docs_for_llm/dialog.doc.md +48 -77
- package/docs_for_llm/divider.doc.md +9 -7
- package/docs_for_llm/drawer.doc.md +43 -84
- package/docs_for_llm/dropdown.doc.md +52 -21
- package/docs_for_llm/duration.doc.md +76 -0
- package/docs_for_llm/editable.doc.md +36 -14
- package/docs_for_llm/ellipsis.doc.md +10 -5
- package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
- package/docs_for_llm/flex.doc.md +74 -0
- package/docs_for_llm/form.doc.md +33 -14
- package/docs_for_llm/formiteminput.doc.md +128 -0
- package/docs_for_llm/formitemspinner.doc.md +105 -0
- package/docs_for_llm/formitemswitch.doc.md +113 -0
- package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
- package/docs_for_llm/grid.doc.md +7 -5
- package/docs_for_llm/header.doc.md +85 -0
- package/docs_for_llm/icon.doc.md +12 -8
- package/docs_for_llm/icontooltip.doc.md +121 -0
- package/docs_for_llm/input.doc.md +90 -39
- package/docs_for_llm/instancelist.doc.md +113 -0
- package/docs_for_llm/instancenum.doc.md +95 -0
- package/docs_for_llm/ipinput.doc.md +77 -0
- package/docs_for_llm/kspstatus.doc.md +82 -0
- package/docs_for_llm/kvcode.doc.md +76 -0
- package/docs_for_llm/layoutcontent.doc.md +17 -17
- package/docs_for_llm/layoutlistcontent.doc.md +95 -0
- package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
- package/docs_for_llm/layoutstandardlist.doc.md +120 -0
- package/docs_for_llm/layouttabs.doc.md +101 -0
- package/docs_for_llm/lazymount.doc.md +73 -0
- package/docs_for_llm/lazyteleport.doc.md +76 -0
- package/docs_for_llm/menu.doc.md +14 -11
- package/docs_for_llm/message.doc.md +48 -10
- package/docs_for_llm/pagination.doc.md +30 -17
- package/docs_for_llm/paginationplus.doc.md +31 -10
- package/docs_for_llm/password.doc.md +86 -0
- package/docs_for_llm/popover.doc.md +24 -55
- package/docs_for_llm/progress.doc.md +13 -10
- package/docs_for_llm/projects.doc.md +91 -0
- package/docs_for_llm/protable.doc.md +89 -15
- package/docs_for_llm/queuevisualrange.doc.md +78 -0
- package/docs_for_llm/radio.doc.md +23 -8
- package/docs_for_llm/rate.doc.md +122 -0
- package/docs_for_llm/region.doc.md +25 -13
- package/docs_for_llm/search.doc.md +120 -0
- package/docs_for_llm/searchinput.doc.md +111 -0
- package/docs_for_llm/searchitems.doc.md +116 -0
- package/docs_for_llm/searchselect.doc.md +126 -0
- package/docs_for_llm/select.doc.md +40 -55
- package/docs_for_llm/sidebar.doc.md +133 -0
- package/docs_for_llm/skeleton.doc.md +117 -0
- package/docs_for_llm/slider.doc.md +31 -21
- package/docs_for_llm/spin.doc.md +8 -5
- package/docs_for_llm/spinner.doc.md +28 -18
- package/docs_for_llm/split.doc.md +157 -0
- package/docs_for_llm/sshkeys.doc.md +88 -0
- package/docs_for_llm/status.doc.md +14 -9
- package/docs_for_llm/steps.doc.md +10 -7
- package/docs_for_llm/switch.doc.md +17 -14
- package/docs_for_llm/table.doc.md +118 -51
- package/docs_for_llm/tablecolumnid.doc.md +36 -16
- package/docs_for_llm/tabs.doc.md +19 -10
- package/docs_for_llm/tag.doc.md +19 -10
- package/docs_for_llm/timeline.doc.md +109 -0
- package/docs_for_llm/timepicker.doc.md +57 -38
- package/docs_for_llm/timerange.doc.md +157 -0
- package/docs_for_llm/tip.doc.md +20 -11
- package/docs_for_llm/tooltip.doc.md +55 -29
- package/docs_for_llm/tour.doc.md +48 -29
- package/docs_for_llm/transfer.doc.md +40 -29
- package/docs_for_llm/tree.doc.md +65 -23
- package/docs_for_llm/treeselect.doc.md +37 -48
- package/docs_for_llm/upload.doc.md +56 -32
- package/docs_for_llm/useCRUD.doc.md +49 -0
- package/docs_for_llm/useCountdown.doc.md +43 -0
- package/docs_for_llm/useDetail.doc.md +48 -0
- package/docs_for_llm/useDialog.doc.md +46 -0
- package/docs_for_llm/useEntity.doc.md +45 -0
- package/docs_for_llm/useEventListener.doc.md +44 -0
- package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
- package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
- package/docs_for_llm/useGetUserPermission.doc.md +43 -0
- package/docs_for_llm/useGroup.doc.md +48 -0
- package/docs_for_llm/useIdEntities.doc.md +48 -0
- package/docs_for_llm/useIdEntity.doc.md +103 -0
- package/docs_for_llm/useInterval.doc.md +43 -0
- package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
- package/docs_for_llm/useMessage.doc.md +46 -0
- package/docs_for_llm/useModifyCache.doc.md +37 -0
- package/docs_for_llm/useOpenDialog.doc.md +41 -0
- package/docs_for_llm/usePagination.doc.md +60 -0
- package/docs_for_llm/usePersist.doc.md +54 -0
- package/docs_for_llm/usePoll.doc.md +41 -0
- package/docs_for_llm/useRoutePlus.doc.md +34 -0
- package/docs_for_llm/useRouterPlus.doc.md +34 -0
- package/docs_for_llm/useSearch.doc.md +68 -0
- package/docs_for_llm/useShell.doc.md +43 -0
- package/docs_for_llm/useSkip.doc.md +41 -0
- package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
- package/docs_for_llm/useStore.doc.md +34 -0
- package/docs_for_llm/useTable.doc.md +57 -0
- package/docs_for_llm/useTableGroup.doc.md +47 -0
- package/docs_for_llm/useTableSort.doc.md +40 -0
- package/docs_for_llm/useToState.doc.md +112 -0
- package/docs_for_llm/useUser.doc.md +38 -0
- package/docs_for_llm/useValidForm.doc.md +41 -0
- package/docs_for_llm/vdialog.doc.md +129 -0
- package/docs_for_llm/vdrawer.doc.md +119 -0
- package/docs_for_llm/virtuallist.doc.md +6 -3
- package/hooks/useCRUD.json +61 -0
- package/hooks/useCountdown.json +49 -0
- package/hooks/useDetail.json +67 -0
- package/hooks/useDialog.json +49 -0
- package/hooks/useEntity.json +61 -0
- package/hooks/useEventListener.json +61 -0
- package/hooks/useFalseUntilTruthy.json +43 -0
- package/hooks/useGetCopyAuthText.json +36 -0
- package/hooks/useGetUserPermission.json +55 -0
- package/hooks/useGroup.json +49 -0
- package/hooks/useIdEntities.json +61 -0
- package/hooks/useInterval.json +55 -0
- package/hooks/useLayoutStandardList.json +36 -0
- package/hooks/useMessage.json +73 -0
- package/hooks/useModifyCache.json +36 -0
- package/hooks/useOpenDialog.json +43 -0
- package/hooks/usePagination.json +49 -0
- package/hooks/usePersist.json +61 -0
- package/hooks/usePoll.json +43 -0
- package/hooks/useRoutePlus.json +36 -0
- package/hooks/useRouterPlus.json +36 -0
- package/hooks/useSearch.json +56 -0
- package/hooks/useShell.json +49 -0
- package/hooks/useSkip.json +43 -0
- package/hooks/useStorageIdEntity.json +67 -0
- package/hooks/useStore.json +36 -0
- package/hooks/useTable.json +49 -0
- package/hooks/useTableGroup.json +43 -0
- package/hooks/useTableSort.json +43 -0
- package/hooks/useUser.json +36 -0
- package/hooks/useValidForm.json +43 -0
- package/package.json +12 -6
- package/dist/chunk-HDV7ETXE.mjs +0 -1055
- package/dist/chunk-HPAUCD5I.js +0 -156
- package/dist/chunk-L4DS3EXI.mjs +0 -133
- package/dist/chunk-YWY3D4J7.js +0 -1082
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
集成了搜索、筛选、排序、分页、工具栏等功能的高级表格组件。
|
|
4
4
|
|
|
5
|
-
**关键词**: table, search, filter, list, 表格, pro
|
|
5
|
+
**关键词**: table, search, filter, list, 表格, pro, 高级表格, 资源列表
|
|
6
6
|
|
|
7
|
-
**使用场景**:
|
|
7
|
+
**使用场景**: 资源列表页、复杂数据展示、带搜索导出和列设置的高级列表、资源管理后台表格页
|
|
8
8
|
|
|
9
9
|
## 导入语句
|
|
10
10
|
```typescript
|
|
@@ -12,10 +12,46 @@ import { ProTable } from '@ksyun-internal/versatile';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| data | `Array` | `undefined` | 是 | 表格数据 | - |
|
|
18
|
-
|
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| data | `Array` | `undefined` | 是 | 表格数据 | - | - |
|
|
18
|
+
| fixHeader | `boolean | number | string` | `false` | 否 | 表头固定,给定需要固定高度的具体数值,当超出该值时,展示滚动条 | `inherited:Table` | `<Table :data="data" :fixHeader="300"></Table>` |
|
|
19
|
+
| stickHeader | `boolean | number | string` | `false` | 否 | 表头吸顶,给定需要吸顶的高度,当表头在页面滚动滚动时,距离视窗顶部的距离等于该高度时,将表头固定在此高度处 | `inherited:Table` | - |
|
|
20
|
+
| stickScrollbar | `boolean | number | string` | `false` | 否 | 当出现横向滚动条时,设置是否当表格底部没有滚动到视窗中时,将横向滚动条固定在页面底部;取值为number类型时,用来指定距离视窗底部的距离 | `inherited:Table` | - |
|
|
21
|
+
| checkType | `"checkbox" | "radio" | "none"` | `"checkbox"` | 否 | 当行可选择时,定义选择的类型: 单选 "radio" , 复选 "checkbox", 不可选 "none" | `inherited:Table` | - |
|
|
22
|
+
| checkedKeys | `TableRowKey[]` | `[]` | 否 | 通过key数组来指定哪些行被选中,可用v-model:checkedKeys双向绑定 | `inherited:Table` | - |
|
|
23
|
+
| rowKey | `(value: T, index: number) => TableRowKey` | `(value, index) => index` | 否 | 设置每行的key | `inherited:Table` | `<Table :data="tableData" :rowKey="(value, index) => index"></Table>` |
|
|
24
|
+
| rowCheckable | `boolean` | `true` | 否 | 当行可选时,是否点击该行任意区域都可选中 | `inherited:Table` | - |
|
|
25
|
+
| disableRow | `(value: T, index: number, key: TableRowKey) => boolean` | `undefined` | 否 | 定义行禁用可选的逻辑,返回true,则该行被禁用选择 | `inherited:Table` | - |
|
|
26
|
+
| type | `"default" | "border" | "grid"` | `"default"` | 否 | 表格类型,默认左右无边框,"border"类型会添加边框, "grid"类型会展示栅格边框 | `inherited:Table` | - |
|
|
27
|
+
| stripe | `boolean` | `false` | 否 | 相邻行是否展示不同的背景色 | `inherited:Table` | - |
|
|
28
|
+
| rowClassName | `(value: T, index: number, key: TableRowKey) => string | undefined` | `undefined` | 否 | 通过一个函数定义行的className,该函数会传入该行数据,索引和key当做参数,返回的字符串将被设为该行的className | `inherited:Table` | - |
|
|
29
|
+
| group | `TableGroupValue` | `undefined` | 否 | 分组配置 | `inherited:Table` | - |
|
|
30
|
+
| sort | `TableSortValue` | `undefined` | 否 | 排序配置,可用v-model:sort双向绑定 | `inherited:Table` | - |
|
|
31
|
+
| loading | `boolean` | `undefined` | 否 | 加载状态 | - | - |
|
|
32
|
+
| merge | `TableMerge` | `undefined` | 否 | 指定表格单元格合并逻辑 | `inherited:Table` | - |
|
|
33
|
+
| expandedKeys | `TableRowKey[]` | `undefined` | 否 | 通过key来指定哪些行展开,可用v-model:expandedKeys绑定 | `inherited:Table` | - |
|
|
34
|
+
| rowExpandable | `boolean` | `true` | 否 | 是否点击该行任意区域即展开 | `inherited:Table` | - |
|
|
35
|
+
| selectedKeys | `TableRowKey[]` | `undefined` | 否 | 当rowSelectable取值为非false时,指定哪些行高亮 | `inherited:Table` | - |
|
|
36
|
+
| rowSelectable | `boolean | "single" | "multiple"` | `false` | 否 | 是否点击行时高亮该行,取值为multiple时,可以同时高亮多行 | `inherited:Table` | - |
|
|
37
|
+
| childrenKey | `string` | `"children"` | 否 | 树形表格指定子元素键名 | `inherited:Table` | - |
|
|
38
|
+
| indent | `number` | `32` | 否 | 树形表格指定子元素缩进宽度 | `inherited:Table` | - |
|
|
39
|
+
| spreadKeys | `TableRowKey[]` | `undefined` | 否 | 树形表格指定展开的行,可用v-model:spreadKeys绑定 | `inherited:Table` | - |
|
|
40
|
+
| tooltipPosition | `"left" | "bottom" | "right" | "top" | Position` | `"top"` | 否 | 行提示的位置 | `inherited:Table` | - |
|
|
41
|
+
| tooltipContainer | `Container` | `undefined` | 否 | 指定行提示弹层追加的位置,支持函数或 CSS 选择器 | `inherited:Table` | - |
|
|
42
|
+
| keepStatus | `boolean` | `false` | 否 | 是否在行销毁的时候,保持该行在checkedKeys | selectedKeys | spreadKeys | expandedKeys中的key值 | `inherited:Table` | - |
|
|
43
|
+
| showIndeterminate | `boolean` | `true` | 否 | 表头的Checkbox是否支持展示半选中状态 | `inherited:Table` | - |
|
|
44
|
+
| resizable | `boolean` | `false` | 否 | 是否可以表头拖动调整列宽 | `inherited:Table` | - |
|
|
45
|
+
| minColWidth | `number` | `40` | 否 | 指定所有列拖动时的最小宽度 | `inherited:Table` | - |
|
|
46
|
+
| widthStoreKey | `string` | `undefined` | 否 | 如果要保存表格拖动后的列宽信息,可以通过该属性设置保存到localStorage中的key | `inherited:Table` | - |
|
|
47
|
+
| draggable | `boolean` | `false` | 否 | 表格行是否可拖动排序 | `inherited:Table` | - |
|
|
48
|
+
| animation | `boolean | [boolean, boolean]` | `true` | 否 | 是否开启动效,可以通过数组单独设置行和列的动效 | `inherited:Table` | - |
|
|
49
|
+
| hideHeader | `boolean` | `false` | 否 | 是否隐藏表头 | `inherited:Table` | - |
|
|
50
|
+
| pagination | `boolean | PaginationProps` | `false` | 否 | 是否支持分页,可传入对象配置分页参数 | `inherited:Table` | - |
|
|
51
|
+
| fixFooter | `boolean` | `false` | 否 | table给定需要固定高度时,自定义footer固定 | `inherited:Table` | - |
|
|
52
|
+
| load | `(node: any) => Promise<any[]> | void` | `undefined` | 否 | 指定异步加载节点数据的函数,该函数通过Promise返回数组来添加子节点数据 | `inherited:Table` | - |
|
|
53
|
+
| spreadArrowIndex | `number` | `0` | 否 | 指定树形表格展开Icon的所在列,默认在第一列 | `inherited:Table` | - |
|
|
54
|
+
| virtual | `boolean` | `false` | 否 | 是否开启虚拟滚动,适用于大数据量场景 | `inherited:Table` | - |
|
|
19
55
|
| tableHeaderProps | `TableHeaderProps` | `{ show: true }` | 否 | 头部工具栏配置对象。包含以下子属性:
|
|
20
56
|
- show: Boolean (默认 true) - 是否显示
|
|
21
57
|
- toolbar: TableToolbar - 表格功能区配置
|
|
@@ -29,7 +65,7 @@ import { ProTable } from '@ksyun-internal/versatile';
|
|
|
29
65
|
- searches: string (默认 '') - 继承 Search 组件的 searches 属性
|
|
30
66
|
- searchGroups: TableFilter - 继承 Search 组件的 searchGroups 属性
|
|
31
67
|
- filter: TableFilter - 表格检索区配置
|
|
32
|
-
- show: Boolean (默认 true) - 是否显示 | `:tableHeaderProps="{
|
|
68
|
+
- show: Boolean (默认 true) - 是否显示 | - | `:tableHeaderProps="{
|
|
33
69
|
show: true,
|
|
34
70
|
toolbar: {
|
|
35
71
|
show: true,
|
|
@@ -44,19 +80,54 @@ import { ProTable } from '@ksyun-internal/versatile';
|
|
|
44
80
|
},
|
|
45
81
|
filter: { show: true }
|
|
46
82
|
}"` |
|
|
47
|
-
| searchKey | `string` | `undefined` | 否 | 搜索关键词绑定 | `v-model:searchKey="key"` |
|
|
48
|
-
| searchValue | `string` | `undefined` | 否 | 搜索值绑定 | `v-model:searchValue="val"` |
|
|
49
|
-
| searchItems | `object` | `{}` | 否 | 同 SearchItems 组件的 modelValue,可用 v-model 双向绑定 | `v-model:searchItems="searchParams"` |
|
|
83
|
+
| searchKey | `string` | `undefined` | 否 | 搜索关键词绑定 | - | `v-model:searchKey="key"` |
|
|
84
|
+
| searchValue | `string` | `undefined` | 否 | 搜索值绑定 | - | `v-model:searchValue="val"` |
|
|
85
|
+
| searchItems | `object` | `{}` | 否 | 同 SearchItems 组件的 modelValue,可用 v-model 双向绑定 | - | `v-model:searchItems="searchParams"` |
|
|
50
86
|
|
|
51
87
|
## 事件 (Events)
|
|
52
88
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
53
89
|
| --- | --- | --- | --- | --- |
|
|
54
90
|
| refresh | `@refresh` | 点击刷新按钮时触发 | `-` | `<ProTable @refresh="loadData" />` |
|
|
55
|
-
| change:searchValue | `@change:searchValue` | 搜索框内容变更时触发 |
|
|
56
|
-
| change:searchKey | `@change:searchKey` | 搜索 Key 变更时触发 |
|
|
57
|
-
| change:columns | `@change:columns` | 列设置变更时触发 |
|
|
58
|
-
| change:filters | `@change:filters` | 筛选条件变更时触发 |
|
|
59
|
-
| change:export | `@change:export` | 导出配置变更时触发,payload 包含 selectedKeys 和 exportRange |
|
|
91
|
+
| change:searchValue | `@change:searchValue` | 搜索框内容变更时触发 | `value: string, label?: string, current?: SearchType, obj?: Record<string, any> | null` | - |
|
|
92
|
+
| change:searchKey | `@change:searchKey` | 搜索 Key 变更时触发 | `value: string, current?: SearchType` | - |
|
|
93
|
+
| change:columns | `@change:columns` | 列设置变更时触发 | `data: string[]` | - |
|
|
94
|
+
| change:filters | `@change:filters` | 筛选条件变更时触发 | `data: TableGroupValue` | - |
|
|
95
|
+
| change:export | `@change:export` | 导出配置变更时触发,payload 包含 selectedKeys 和 exportRange | `data: ExportConfig` | - |
|
|
96
|
+
|
|
97
|
+
### 事件参数说明
|
|
98
|
+
**change:searchValue**
|
|
99
|
+
|
|
100
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
101
|
+
| --- | --- | --- | --- | --- |
|
|
102
|
+
| value | `string` | 是 | - | 当前搜索框中的检索值。 |
|
|
103
|
+
| label | `string` | 否 | - | 当前搜索值对应的展示文案,选择型搜索时可直接用于回显。 |
|
|
104
|
+
| current | `SearchType` | 否 | - | 当前正在使用的搜索项配置。 |
|
|
105
|
+
| obj | `Record<string, any> | null` | 否 | - | 选择型搜索命中的原始选项对象;纯输入搜索通常为 `null`。 |
|
|
106
|
+
|
|
107
|
+
**change:searchKey**
|
|
108
|
+
|
|
109
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
110
|
+
| --- | --- | --- | --- | --- |
|
|
111
|
+
| value | `string` | 是 | - | 当前选中的搜索字段 key。 |
|
|
112
|
+
| current | `SearchType` | 否 | - | 当前激活的搜索项配置对象。 |
|
|
113
|
+
|
|
114
|
+
**change:columns**
|
|
115
|
+
|
|
116
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
117
|
+
| --- | --- | --- | --- | --- |
|
|
118
|
+
| data | `string[]` | 是 | - | 当前保留展示的列 key 列表,可直接用于持久化用户列设置。 |
|
|
119
|
+
|
|
120
|
+
**change:filters**
|
|
121
|
+
|
|
122
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
123
|
+
| --- | --- | --- | --- | --- |
|
|
124
|
+
| data | `TableGroupValue` | 是 | - | 当前表格分组或筛选条件对象,通常用于组装请求参数。 |
|
|
125
|
+
|
|
126
|
+
**change:export**
|
|
127
|
+
|
|
128
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
129
|
+
| --- | --- | --- | --- | --- |
|
|
130
|
+
| data | `ExportConfig` | 是 | - | 当前导出配置,包含待导出列 key 和导出范围标识。 |
|
|
60
131
|
|
|
61
132
|
## 插槽 (Slots)
|
|
62
133
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
@@ -64,3 +135,6 @@ import { ProTable } from '@ksyun-internal/versatile';
|
|
|
64
135
|
| actions | 表格的左上角操作区 | `<template #actions>...</template>` | `<ProTable><template #actions><Button type="primary">新建</Button></template></ProTable>` |
|
|
65
136
|
| toolbar | 表格的右上角功能区 | `<template #toolbar>...</template>` | `<ProTable><template #toolbar><Button>自定义操作</Button></template></ProTable>` |
|
|
66
137
|
|
|
138
|
+
## 相关组件
|
|
139
|
+
Table, Search, SearchItems, PaginationPlus
|
|
140
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 队列可见范围 (QueueVisualRange)
|
|
2
|
+
|
|
3
|
+
用于配置队列、任务或资源可见范围的业务组件,适合在私有、项目共享、全员可见等可见性策略之间切换。
|
|
4
|
+
|
|
5
|
+
**关键词**: queue visual range, visibility scope, 队列可见范围, 可见性, 共享范围
|
|
6
|
+
|
|
7
|
+
**使用场景**: 队列权限范围配置、资源共享范围设置、共享范围说明和切换
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { QueueVisualRange } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `string` | `""` | 否 | 当前可见范围值 | - | - |
|
|
18
|
+
| tip | `string` | `undefined` | 否 | 说明提示文案 | - | - |
|
|
19
|
+
|
|
20
|
+
## 事件 (Events)
|
|
21
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
| update:modelValue | `@update:modelValue` | 可见范围变化时触发,可据此同步权限或共享策略配置。 | `value?: string` | - |
|
|
24
|
+
|
|
25
|
+
### 事件参数说明
|
|
26
|
+
**update:modelValue**
|
|
27
|
+
|
|
28
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
29
|
+
| --- | --- | --- | --- | --- |
|
|
30
|
+
| value | `string` | 否 | - | 当前选中的可见范围标识。 |
|
|
31
|
+
|
|
32
|
+
## 使用示例
|
|
33
|
+
### 设置队列可见范围
|
|
34
|
+
**场景**: 在任务或资源配置页选择共享和可见性范围。
|
|
35
|
+
|
|
36
|
+
在新建队列时选择私有或共享范围。
|
|
37
|
+
|
|
38
|
+
**使用的 API**: 属性: modelValue, tip | 事件: update:modelValue
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { ref } from 'vue';
|
|
43
|
+
import { QueueVisualRange } from '@ksyun-internal/versatile';
|
|
44
|
+
|
|
45
|
+
const visualRange = ref('project');
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<QueueVisualRange v-model="visualRange" tip="共享范围越大,越需要关注访问控制" />
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 共享范围选择联动说明
|
|
54
|
+
**场景**: 在队列和任务创建时明确不同共享范围的含义。
|
|
55
|
+
|
|
56
|
+
在切换可见范围时同步展示额外说明文案。
|
|
57
|
+
|
|
58
|
+
**使用的 API**: 属性: modelValue, tip | 事件: update:modelValue
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { ref } from 'vue';
|
|
63
|
+
import { QueueVisualRange } from '@ksyun-internal/versatile';
|
|
64
|
+
|
|
65
|
+
const visualRange = ref('private');
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<QueueVisualRange
|
|
70
|
+
v-model="visualRange"
|
|
71
|
+
tip="选择项目共享后,同项目成员均可查看该队列"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 相关组件
|
|
77
|
+
Visibility
|
|
78
|
+
|
|
@@ -12,21 +12,33 @@ import { Radio } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| value | `any` | `false` | 否 | 单选框取值,用于 v-model 进行双向绑定 | `<Radio v-model="selected" trueValue="a">选项 A</Radio>` |
|
|
18
|
-
| trueValue | `any` | `true` | 否 | 单选框选中后的值,用于区分不同选项 | `<Radio v-model="selected" trueValue="apple">苹果</Radio>` |
|
|
19
|
-
| disabled | `boolean` | `false` | 否 | 是否禁用 | `<Radio disabled>禁用选项</Radio>` |
|
|
20
|
-
| name | `string` | `undefined` | 否 | 单选框的名称。指定相同的 name 可以使多个单选框组成一个单选框组,行为与浏览器原生单选框一致。 | `<Radio name="gender" trueValue="male">男</Radio>
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| value | `any` | `false` | 否 | 单选框取值,用于 v-model 进行双向绑定 | - | `<Radio v-model="selected" trueValue="a">选项 A</Radio>` |
|
|
18
|
+
| trueValue | `any` | `true` | 否 | 单选框选中后的值,用于区分不同选项 | - | `<Radio v-model="selected" trueValue="apple">苹果</Radio>` |
|
|
19
|
+
| disabled | `boolean` | `false` | 否 | 是否禁用 | - | `<Radio disabled>禁用选项</Radio>` |
|
|
20
|
+
| name | `string` | `undefined` | 否 | 单选框的名称。指定相同的 name 可以使多个单选框组成一个单选框组,行为与浏览器原生单选框一致。 | `native` | `<Radio name="gender" trueValue="male">男</Radio>
|
|
21
21
|
<Radio name="gender" trueValue="female">女</Radio>` |
|
|
22
|
+
| autocomplete | `string` | `undefined` | 否 | 原生 autocomplete 属性,指定浏览器自动补全行为 | `native` | `<Radio autocomplete="off">选项</Radio>` |
|
|
23
|
+
| autofocus | `boolean` | `undefined` | 否 | 原生 autofocus 属性,页面加载后自动聚焦单选框 | `native` | `<Radio autofocus trueValue="a">选项 A</Radio>` |
|
|
24
|
+
| form | `string` | `undefined` | 否 | 原生 form 属性,指定单选框关联的表单 id | `native` | `<Radio form="myForm" trueValue="a">选项 A</Radio>` |
|
|
25
|
+
| maxlength | `number | string` | `undefined` | 否 | 原生 maxlength 属性,组件透传到内部 input 元素 | `native` | `<Radio :maxlength="1" trueValue="a">选项 A</Radio>` |
|
|
26
|
+
| required | `boolean` | `undefined` | 否 | 原生 required 属性,标记为必选输入项 | `native` | `<Radio required trueValue="a">选项 A</Radio>` |
|
|
22
27
|
|
|
23
28
|
## 事件 (Events)
|
|
24
29
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
30
|
| --- | --- | --- | --- | --- |
|
|
26
31
|
| change | `@change` | 当点击组件导致值变化时触发 | `value: any, e: MouseEvent` | `<Radio @change="handleChange" trueValue="a">选项</Radio>` |
|
|
27
32
|
|
|
28
|
-
###
|
|
29
|
-
**change
|
|
33
|
+
### 事件参数说明
|
|
34
|
+
**change**
|
|
35
|
+
|
|
36
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
37
|
+
| --- | --- | --- | --- | --- |
|
|
38
|
+
| value | `any` | 是 | - | 当前选中的值 |
|
|
39
|
+
| e | `MouseEvent` | 是 | - | 原生鼠标事件对象 |
|
|
40
|
+
|
|
41
|
+
事件处理示例:
|
|
30
42
|
```typescript
|
|
31
43
|
const handleChange = (value: any, e: MouseEvent) => {
|
|
32
44
|
console.log('选中值:', value);
|
|
@@ -34,18 +46,21 @@ const handleChange = (value: any, e: MouseEvent) => {
|
|
|
34
46
|
```
|
|
35
47
|
|
|
36
48
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
49
|
+
### 多个 Radio 未设置 trueValue
|
|
37
50
|
> **错误用法**: `<Radio v-model="selected">选项 A</Radio>
|
|
38
51
|
<Radio v-model="selected">选项 B</Radio>`
|
|
39
52
|
> **正确写法**: `<Radio v-model="selected" trueValue="a">选项 A</Radio>
|
|
40
53
|
<Radio v-model="selected" trueValue="b">选项 B</Radio>`
|
|
41
54
|
> **说明**: 多个 Radio 组成单选组时,必须为每个 Radio 设置不同的 trueValue 来区分选项
|
|
42
55
|
|
|
56
|
+
### 未设置 name 且同组 Radio 绑定了不同的 v-model
|
|
43
57
|
> **错误用法**: `<Radio v-model="value1" trueValue="a">A</Radio>
|
|
44
58
|
<Radio v-model="value2" trueValue="b">B</Radio>`
|
|
45
59
|
> **正确写法**: `<Radio v-model="selected" trueValue="a">A</Radio>
|
|
46
60
|
<Radio v-model="selected" trueValue="b">B</Radio>`
|
|
47
61
|
> **说明**: 如果不使用 name 属性进行原生分组,同一组单选框必须绑定同一个 v-model 变量,否则无法实现互斥选择
|
|
48
62
|
|
|
63
|
+
### 多个 Radio 设置了相同的 trueValue
|
|
49
64
|
> **错误用法**: `<Radio v-model="selected" trueValue="a">A</Radio>
|
|
50
65
|
<Radio v-model="selected" trueValue="a">B</Radio>`
|
|
51
66
|
> **正确写法**: `<Radio v-model="selected" trueValue="a">A</Radio>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# 评分 (Rate)
|
|
2
|
+
|
|
3
|
+
评分组件,用于展示和选择星级评分。支持半星、禁用态、自定义总数以及再次点击清空评分。
|
|
4
|
+
|
|
5
|
+
**关键词**: rate, 评分, 星级, 打分, 半星, clearable
|
|
6
|
+
|
|
7
|
+
**使用场景**: 商品评价、服务满意度评分、内容点赞等级、后台数据展示只读评分
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { Rate } from '@king-design/vue';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| value | `number` | `0` | 否 | 当前评分值,可用 v-model 双向绑定。 | - | `<Rate v-model="score" />` |
|
|
18
|
+
| count | `number` | `5` | 否 | 总星数。 | - | `<Rate v-model="score" :count="10" />` |
|
|
19
|
+
| disabled | `boolean` | `false` | 否 | 是否禁用。禁用后只展示当前值,不响应 hover 和点击。 | - | `<Rate :value="4" disabled />` |
|
|
20
|
+
| half | `boolean` | `false` | 否 | 是否允许半星评分。 | - | `<Rate v-model="score" half />` |
|
|
21
|
+
| clearable | `boolean` | `false` | 否 | 是否允许点击当前值后清空评分。 | - | `<Rate v-model="score" clearable />` |
|
|
22
|
+
|
|
23
|
+
## 事件 (Events)
|
|
24
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| mouseleave | `@mouseleave` | 鼠标离开评分区域时触发,通常用于结束悬停预览。 | `e: MouseEvent` | `<Rate @mouseleave="handleMouseLeave" />` |
|
|
27
|
+
|
|
28
|
+
### 事件参数说明
|
|
29
|
+
**mouseleave**
|
|
30
|
+
|
|
31
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| e | `MouseEvent` | 是 | - | 原生鼠标事件 |
|
|
34
|
+
|
|
35
|
+
事件处理示例:
|
|
36
|
+
```typescript
|
|
37
|
+
const handleMouseLeave = (e: MouseEvent) => {
|
|
38
|
+
console.log('离开评分区域');
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 插槽 (Slots)
|
|
43
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
|
+
| icon | 自定义每一项评分图标,默认使用星形图标。 | `<template #icon>...</template>` | `<Rate v-model="score"><template #icon><Icon class="k-icon-favorite" /></template></Rate>` |
|
|
46
|
+
|
|
47
|
+
## 常见错误与正确用法 (Anti-Hallucination)
|
|
48
|
+
### 传入小数评分但未开启 half
|
|
49
|
+
> **错误用法**: `<Rate :value="3.5" />`
|
|
50
|
+
> **正确写法**: `<Rate :value="3.5" half />`
|
|
51
|
+
> **说明**: 如果需要展示或选择半星评分,应显式开启 half,否则组件按整星交互处理。
|
|
52
|
+
|
|
53
|
+
### 期望再次点击清空评分但未开启 clearable
|
|
54
|
+
> **错误用法**: `<Rate v-model="score" />`
|
|
55
|
+
> **正确写法**: `<Rate v-model="score" clearable />`
|
|
56
|
+
> **说明**: 默认再次点击当前星级不会清空值,如需允许取消评分,应开启 clearable。
|
|
57
|
+
|
|
58
|
+
## 使用示例
|
|
59
|
+
### 基础用法
|
|
60
|
+
**场景**: 收集用户星级评分
|
|
61
|
+
|
|
62
|
+
用户评分输入。
|
|
63
|
+
|
|
64
|
+
**使用的 API**: 属性: value
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
<script setup lang="ts">
|
|
68
|
+
import { ref } from 'vue';
|
|
69
|
+
import { Rate } from '@king-design/vue';
|
|
70
|
+
|
|
71
|
+
const score = ref(3);
|
|
72
|
+
</script>
|
|
73
|
+
<template>
|
|
74
|
+
<Rate v-model="score" />
|
|
75
|
+
</template>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 半星和可清空
|
|
79
|
+
**场景**: 允许半星和取消评分
|
|
80
|
+
|
|
81
|
+
适合更细粒度的打分场景。
|
|
82
|
+
|
|
83
|
+
**使用的 API**: 属性: value, half, clearable
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import { ref } from 'vue';
|
|
88
|
+
import { Rate } from '@king-design/vue';
|
|
89
|
+
|
|
90
|
+
const score = ref(3.5);
|
|
91
|
+
</script>
|
|
92
|
+
<template>
|
|
93
|
+
<Rate v-model="score" half clearable />
|
|
94
|
+
</template>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 自定义图标
|
|
98
|
+
**场景**: 在点赞或喜爱度场景中使用心形评分
|
|
99
|
+
|
|
100
|
+
使用心形图标替代默认星形。
|
|
101
|
+
|
|
102
|
+
**使用的 API**: 属性: value | 插槽: icon
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
import { ref } from 'vue';
|
|
107
|
+
import { Icon, Rate } from '@king-design/vue';
|
|
108
|
+
|
|
109
|
+
const score = ref(4);
|
|
110
|
+
</script>
|
|
111
|
+
<template>
|
|
112
|
+
<Rate v-model="score">
|
|
113
|
+
<template #icon>
|
|
114
|
+
<Icon class="k-icon-heart" />
|
|
115
|
+
</template>
|
|
116
|
+
</Rate>
|
|
117
|
+
</template>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 相关组件
|
|
121
|
+
Icon, Tag, Tooltip
|
|
122
|
+
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
地域(Region)选择组件,支持多区域和多地域的展示与切换。
|
|
4
4
|
|
|
5
|
-
**关键词**: region, area, location, 地域,
|
|
5
|
+
**关键词**: region, area, location, 地域, 区域, 大区, region select, 地域选择
|
|
6
6
|
|
|
7
|
-
**使用场景**:
|
|
7
|
+
**使用场景**: 购买页选择地域、列表页筛选地域、资源创建时切换可售卖地域、和 AZ 联动选择地域与可用区
|
|
8
8
|
|
|
9
9
|
## 导入语句
|
|
10
10
|
```typescript
|
|
@@ -12,14 +12,14 @@ import { Region } from '@ksyun-internal/versatile';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| modelValue | `string` | `undefined` | 否 | 选中的地域编码(RegionCode) | `<Region v-model="regionCode" />` |
|
|
18
|
-
| areaCode | `string` | `undefined` | 否 | 当前选中的大区编码 | `<Region v-model:areaCode="areaCode" />` |
|
|
19
|
-
| packages | `Region[]` | `undefined` | 否 | 地域配置列表 | `<Region :packages="packages" />` |
|
|
20
|
-
| supportEmptyAz | `boolean` | `false` | 否 | 是否支持空可用区 | `<Region supportEmptyAz />` |
|
|
21
|
-
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多 | `<Region showLearnMore />` |
|
|
22
|
-
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接ID | `<Region :learnMoreUrl="123" />` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `string` | `undefined` | 否 | 选中的地域编码(RegionCode) | - | `<Region v-model="regionCode" />` |
|
|
18
|
+
| areaCode | `string` | `undefined` | 否 | 当前选中的大区编码 | - | `<Region v-model:areaCode="areaCode" />` |
|
|
19
|
+
| packages | `Region[]` | `undefined` | 否 | 地域配置列表 | - | `<Region :packages="packages" />` |
|
|
20
|
+
| supportEmptyAz | `boolean` | `false` | 否 | 是否支持空可用区 | - | `<Region supportEmptyAz />` |
|
|
21
|
+
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多 | - | `<Region showLearnMore />` |
|
|
22
|
+
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接ID | - | `<Region :learnMoreUrl="123" />` |
|
|
23
23
|
|
|
24
24
|
## 事件 (Events)
|
|
25
25
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
@@ -27,13 +27,25 @@ import { Region } from '@ksyun-internal/versatile';
|
|
|
27
27
|
| change | `update:modelValue` | 地域改变时触发 | `value: string` | `<Region @update:modelValue="v => console.log(v)" /></Region>` |
|
|
28
28
|
| areaChange | `update:areaCode` | 大区改变时触发 | `value: string` | `<Region @update:areaCode="v => console.log(v)" /></Region>` |
|
|
29
29
|
|
|
30
|
-
###
|
|
31
|
-
**change
|
|
30
|
+
### 事件参数说明
|
|
31
|
+
**change**
|
|
32
|
+
|
|
33
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
34
|
+
| --- | --- | --- | --- | --- |
|
|
35
|
+
| value | `string` | 是 | - | 新的RegionCode |
|
|
36
|
+
|
|
37
|
+
事件处理示例:
|
|
32
38
|
```typescript
|
|
33
39
|
(val) => { console.log(val); }
|
|
34
40
|
```
|
|
35
41
|
|
|
36
|
-
**areaChange
|
|
42
|
+
**areaChange**
|
|
43
|
+
|
|
44
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
45
|
+
| --- | --- | --- | --- | --- |
|
|
46
|
+
| value | `string` | 是 | - | 新的AreaCode |
|
|
47
|
+
|
|
48
|
+
事件处理示例:
|
|
37
49
|
```typescript
|
|
38
50
|
(val) => { console.log(val); }
|
|
39
51
|
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# 组合搜索框 (Search)
|
|
2
|
+
|
|
3
|
+
由搜索类型选择器和输入区域组合而成的业务搜索组件,适合列表页按名称、ID、状态等不同维度快速检索。
|
|
4
|
+
|
|
5
|
+
**关键词**: search, filter, search bar, search by field, 组合搜索, 搜索框, 多条件搜索, 字段筛选
|
|
6
|
+
|
|
7
|
+
**使用场景**: 列表页关键字搜索、按类型切换搜索条件、和 SearchItems 联动的高级检索、控制台资源列表顶部搜索区
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { Search } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| searchKey | `string` | `""` | 否 | 当前选中的搜索类型 key | - | - |
|
|
18
|
+
| searchValue | `string` | `""` | 否 | 当前输入或选择的搜索值 | - | - |
|
|
19
|
+
| searches | `SearchType[] | Record<string, SearchType>` | `undefined` | 是 | 搜索配置集合,支持数组或 key-value 对象 | - | - |
|
|
20
|
+
| searchGroups | `SearchGroupItem[]` | `undefined` | 否 | 搜索类型分组配置 | - | - |
|
|
21
|
+
| clearable | `boolean` | `false` | 否 | 是否允许清空搜索值 | - | - |
|
|
22
|
+
| leftWidth | `string | number` | `120` | 否 | 左侧搜索类型选择区域宽度 | - | - |
|
|
23
|
+
| rightWidth | `string | number` | `240` | 否 | 右侧搜索输入区域宽度 | - | - |
|
|
24
|
+
|
|
25
|
+
## 事件 (Events)
|
|
26
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
27
|
+
| --- | --- | --- | --- | --- |
|
|
28
|
+
| clear | `@clear` | 用户点击清空按钮后触发,通常用于重置搜索值并刷新列表。 | `-` | - |
|
|
29
|
+
| change:searchKey | `@change:searchKey` | 搜索维度切换时触发,可据此切换占位提示或请求参数。 | `value: string, current?: SearchType` | - |
|
|
30
|
+
| change:searchValue | `@change:searchValue` | 搜索值变化时触发,适合实时记录当前检索条件。 | `value: string, label?: string, current?: SearchType, obj?: Record<string, any> | null` | - |
|
|
31
|
+
|
|
32
|
+
### 事件参数说明
|
|
33
|
+
**change:searchKey**
|
|
34
|
+
|
|
35
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
36
|
+
| --- | --- | --- | --- | --- |
|
|
37
|
+
| value | `string` | 是 | - | 当前选中的搜索字段 key,例如 `name`、`project`、`privateIp`。 |
|
|
38
|
+
| current | `SearchType` | 否 | - | 当前激活的搜索项配置对象,包含 label、type、placeholder 等信息。 |
|
|
39
|
+
|
|
40
|
+
**change:searchValue**
|
|
41
|
+
|
|
42
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
43
|
+
| --- | --- | --- | --- | --- |
|
|
44
|
+
| value | `string` | 是 | - | 当前输入框或选择器中的搜索值。 |
|
|
45
|
+
| label | `string` | 否 | - | 当前搜索值对应的展示文案,选择型搜索时常用于回显标签。 |
|
|
46
|
+
| current | `SearchType` | 否 | - | 当前正在使用的搜索项配置对象。 |
|
|
47
|
+
| obj | `Record<string, any> | null` | 否 | - | 选择型搜索命中的原始选项对象;输入型搜索通常为 `null`。 |
|
|
48
|
+
|
|
49
|
+
## 使用示例
|
|
50
|
+
### 实例列表组合搜索
|
|
51
|
+
**场景**: 在列表页顶部提供按不同字段切换的统一搜索入口。
|
|
52
|
+
|
|
53
|
+
在一个搜索框内切换按名称、实例 ID 或 IP 搜索。
|
|
54
|
+
|
|
55
|
+
**使用的 API**: 属性: searchKey, searchValue, searches, clearable | 事件: change:searchKey, change:searchValue, clear
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { ref } from 'vue';
|
|
60
|
+
import { Search } from '@ksyun-internal/versatile';
|
|
61
|
+
|
|
62
|
+
const searchKey = ref('name');
|
|
63
|
+
const searchValue = ref('web-prod');
|
|
64
|
+
const searches = [
|
|
65
|
+
{ key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },
|
|
66
|
+
{ key: 'id', label: '实例 ID', type: 'input', placeholder: '请输入实例 ID' },
|
|
67
|
+
{ key: 'ip', label: '内网 IP', type: 'input', placeholder: '请输入内网 IP' },
|
|
68
|
+
];
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<Search
|
|
73
|
+
v-model:search-key="searchKey"
|
|
74
|
+
v-model:search-value="searchValue"
|
|
75
|
+
:searches="searches"
|
|
76
|
+
:clearable="true"
|
|
77
|
+
/>
|
|
78
|
+
</template>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 按分组组织搜索条件
|
|
82
|
+
**场景**: 在复杂列表页中把搜索条件按业务域分组,降低用户选择成本。
|
|
83
|
+
|
|
84
|
+
通过 searchGroups 将资源类和网络类搜索条件分组展示。
|
|
85
|
+
|
|
86
|
+
**使用的 API**: 属性: searchKey, searchValue, searches, searchGroups, leftWidth, rightWidth | 事件: change:searchKey, change:searchValue
|
|
87
|
+
|
|
88
|
+
```vue
|
|
89
|
+
<script setup lang="ts">
|
|
90
|
+
import { ref } from 'vue';
|
|
91
|
+
import { Search } from '@ksyun-internal/versatile';
|
|
92
|
+
|
|
93
|
+
const searchKey = ref('project');
|
|
94
|
+
const searchValue = ref('core');
|
|
95
|
+
const searches = {
|
|
96
|
+
name: { key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },
|
|
97
|
+
project: { key: 'project', label: '项目名称', type: 'input', placeholder: '请输入项目名称' },
|
|
98
|
+
privateIp: { key: 'privateIp', label: '内网 IP', type: 'input', placeholder: '请输入内网 IP' },
|
|
99
|
+
};
|
|
100
|
+
const searchGroups = [
|
|
101
|
+
{ label: '资源信息', keys: ['name', 'project'] },
|
|
102
|
+
{ label: '网络信息', keys: ['privateIp'] },
|
|
103
|
+
];
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<Search
|
|
108
|
+
v-model:search-key="searchKey"
|
|
109
|
+
v-model:search-value="searchValue"
|
|
110
|
+
:searches="searches"
|
|
111
|
+
:search-groups="searchGroups"
|
|
112
|
+
:left-width="140"
|
|
113
|
+
:right-width="280"
|
|
114
|
+
/>
|
|
115
|
+
</template>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 相关组件
|
|
119
|
+
SearchInput, SearchSelect, SearchItems, ProTable
|
|
120
|
+
|