king-design-analyzer 2.1.9 → 2.2.1

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.
Files changed (327) hide show
  1. package/components/actions.json +109 -0
  2. package/components/advancedset.json +128 -0
  3. package/components/affix.json +8 -0
  4. package/components/aksk.json +172 -0
  5. package/components/anchor.json +220 -0
  6. package/components/anchorlink.json +111 -0
  7. package/components/az.json +15 -2
  8. package/components/badge.json +8 -0
  9. package/components/billtypes.json +14 -2
  10. package/components/breadcrumb.json +9 -1
  11. package/components/button.json +192 -0
  12. package/components/buttonlink.json +74 -0
  13. package/components/card.json +14 -4
  14. package/components/cardcol.json +142 -0
  15. package/components/cardcols.json +121 -0
  16. package/components/cardcontent.json +20 -3
  17. package/components/cardtabs.json +172 -0
  18. package/components/carousel.json +7 -0
  19. package/components/cascader.json +576 -368
  20. package/components/checkbox.json +51 -4
  21. package/components/cidrinput.json +140 -0
  22. package/components/code.json +8 -1
  23. package/components/collapse.json +335 -341
  24. package/components/colorpicker.json +217 -0
  25. package/components/configprovider.json +96 -0
  26. package/components/copy.json +7 -0
  27. package/components/copyhover.json +111 -0
  28. package/components/copyrow.json +125 -0
  29. package/components/datepicker.json +656 -524
  30. package/components/description.json +98 -0
  31. package/components/descriptions.json +10 -3
  32. package/components/diagram.json +295 -0
  33. package/components/dialog.json +526 -455
  34. package/components/divider.json +9 -1
  35. package/components/drawer.json +603 -558
  36. package/components/dropdown.json +464 -384
  37. package/components/duration.json +125 -0
  38. package/components/editable.json +66 -0
  39. package/components/ellipsis.json +34 -1
  40. package/components/filtertablefieldsdialog.json +128 -0
  41. package/components/flex.json +152 -0
  42. package/components/form.json +143 -3
  43. package/components/formiteminput.json +214 -0
  44. package/components/formitemspinner.json +213 -0
  45. package/components/formitemswitch.json +185 -0
  46. package/components/formitemtableconfigs.json +210 -0
  47. package/components/grid.json +7 -0
  48. package/components/header.json +165 -0
  49. package/components/icon.json +13 -1
  50. package/components/icontooltip.json +19 -1
  51. package/components/input.json +196 -8
  52. package/components/instancelist.json +194 -0
  53. package/components/instancenum.json +196 -0
  54. package/components/ipinput.json +117 -0
  55. package/components/kspstatus.json +205 -0
  56. package/components/kvcode.json +120 -0
  57. package/components/layoutcontent.json +24 -3
  58. package/components/layoutlistcontent.json +157 -0
  59. package/components/layoutpermissioncontent.json +156 -0
  60. package/components/layoutstandardlist.json +276 -0
  61. package/components/layouttabs.json +168 -0
  62. package/components/lazymount.json +87 -0
  63. package/components/lazyteleport.json +119 -0
  64. package/components/menu.json +11 -3
  65. package/components/notification.json +351 -0
  66. package/components/pagination.json +12 -0
  67. package/components/paginationplus.json +30 -3
  68. package/components/password.json +121 -0
  69. package/components/popover.json +457 -437
  70. package/components/projects.json +129 -0
  71. package/components/protable.json +99 -8
  72. package/components/queuevisualrange.json +110 -0
  73. package/components/radio.json +82 -2
  74. package/components/rate.json +200 -0
  75. package/components/region.json +14 -2
  76. package/components/scrollselect.json +140 -0
  77. package/components/search.json +221 -0
  78. package/components/searchinput.json +132 -0
  79. package/components/searchitems.json +215 -0
  80. package/components/searchselect.json +195 -0
  81. package/components/select.json +749 -666
  82. package/components/sidebar.json +198 -0
  83. package/components/skeleton.json +234 -0
  84. package/components/slider.json +12 -2
  85. package/components/spin.json +10 -2
  86. package/components/spinner.json +419 -429
  87. package/components/split.json +263 -0
  88. package/components/sshkeys.json +138 -0
  89. package/components/status.json +60 -3
  90. package/components/steps.json +7 -0
  91. package/components/switch.json +12 -3
  92. package/components/table.json +24 -2
  93. package/components/tablecolumnid.json +14 -2
  94. package/components/tabs.json +14 -2
  95. package/components/tag.json +8 -5
  96. package/components/timeline.json +215 -0
  97. package/components/timepicker.json +147 -3
  98. package/components/timerange.json +262 -0
  99. package/components/tip.json +27 -0
  100. package/components/tooltip.json +492 -395
  101. package/components/tour.json +418 -372
  102. package/components/transfer.json +79 -8
  103. package/components/tree.json +28 -5
  104. package/components/treeselect.json +612 -475
  105. package/components/upload.json +474 -473
  106. package/components/vdialog.json +309 -0
  107. package/components/vdrawer.json +335 -0
  108. package/components/virtuallist.json +7 -0
  109. package/dist/ast/index.d.mts +65 -2
  110. package/dist/ast/index.d.ts +65 -2
  111. package/dist/ast/index.js +4 -3
  112. package/dist/ast/index.mjs +2 -1
  113. package/dist/chunk-4OTQAQ6J.mjs +341 -0
  114. package/dist/{chunk-F26GUCGG.js → chunk-4WXOYU2N.js} +32 -9
  115. package/dist/chunk-6HOIRUQB.mjs +409 -0
  116. package/dist/chunk-DHLWNT53.js +364 -0
  117. package/dist/{chunk-H2ET6MMM.mjs → chunk-IPJJMPOO.mjs} +155 -66
  118. package/dist/{chunk-WYSRJVX4.js → chunk-JJ6AB4ZH.js} +2 -2
  119. package/dist/{chunk-2W6OCG2S.js → chunk-JNRGUR3O.js} +155 -67
  120. package/dist/chunk-KF5YBEM5.js +143 -0
  121. package/dist/{chunk-OJOHB64C.mjs → chunk-LRTDTFFQ.mjs} +28 -5
  122. package/dist/{chunk-DSWKLUIX.mjs → chunk-NZL6T22V.mjs} +1 -1
  123. package/dist/chunk-QC6VTSA3.mjs +117 -0
  124. package/dist/chunk-V5N65MRP.js +411 -0
  125. package/dist/full/index.d.mts +2 -0
  126. package/dist/full/index.d.ts +2 -0
  127. package/dist/full/index.js +7 -6
  128. package/dist/full/index.mjs +5 -4
  129. package/dist/index.d.mts +1 -0
  130. package/dist/index.d.ts +1 -0
  131. package/dist/index.js +14 -13
  132. package/dist/index.mjs +6 -5
  133. package/dist/metadata/index.d.mts +38 -3
  134. package/dist/metadata/index.d.ts +38 -3
  135. package/dist/metadata/index.js +26 -16
  136. package/dist/metadata/index.mjs +26 -15
  137. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  138. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  139. package/dist/runtime/index.d.mts +2 -0
  140. package/dist/runtime/index.d.ts +2 -0
  141. package/dist/runtime/index.js +4 -4
  142. package/dist/runtime/index.mjs +2 -2
  143. package/dist/shared/index.d.mts +10 -0
  144. package/dist/shared/index.d.ts +10 -0
  145. package/dist/shared/index.js +23 -0
  146. package/dist/shared/index.mjs +2 -0
  147. package/dist/static/index.js +5 -5
  148. package/dist/static/index.mjs +2 -2
  149. package/docs_for_llm/actions.doc.md +87 -0
  150. package/docs_for_llm/advancedset.doc.md +98 -0
  151. package/docs_for_llm/affix.doc.md +20 -7
  152. package/docs_for_llm/aksk.doc.md +111 -0
  153. package/docs_for_llm/anchor.doc.md +155 -0
  154. package/docs_for_llm/anchorlink.doc.md +75 -0
  155. package/docs_for_llm/az.doc.md +17 -11
  156. package/docs_for_llm/badge.doc.md +11 -5
  157. package/docs_for_llm/billtypes.doc.md +17 -11
  158. package/docs_for_llm/breadcrumb.doc.md +80 -4
  159. package/docs_for_llm/button.doc.md +91 -18
  160. package/docs_for_llm/buttonlink.doc.md +64 -0
  161. package/docs_for_llm/card.doc.md +58 -8
  162. package/docs_for_llm/cardcol.doc.md +78 -0
  163. package/docs_for_llm/cardcols.doc.md +84 -0
  164. package/docs_for_llm/cardcontent.doc.md +31 -10
  165. package/docs_for_llm/cardtabs.doc.md +106 -0
  166. package/docs_for_llm/carousel.doc.md +79 -7
  167. package/docs_for_llm/cascader.doc.md +106 -23
  168. package/docs_for_llm/checkbox.doc.md +25 -13
  169. package/docs_for_llm/cidrinput.doc.md +83 -0
  170. package/docs_for_llm/code.doc.md +22 -11
  171. package/docs_for_llm/collapse.doc.md +147 -14
  172. package/docs_for_llm/colorpicker.doc.md +104 -0
  173. package/docs_for_llm/configprovider.doc.md +77 -0
  174. package/docs_for_llm/copy.doc.md +15 -13
  175. package/docs_for_llm/copyhover.doc.md +59 -0
  176. package/docs_for_llm/copyrow.doc.md +80 -0
  177. package/docs_for_llm/datepicker.doc.md +66 -35
  178. package/docs_for_llm/description.doc.md +75 -0
  179. package/docs_for_llm/descriptions.doc.md +122 -10
  180. package/docs_for_llm/diagram.doc.md +343 -0
  181. package/docs_for_llm/dialog.doc.md +97 -77
  182. package/docs_for_llm/divider.doc.md +14 -7
  183. package/docs_for_llm/drawer.doc.md +114 -69
  184. package/docs_for_llm/dropdown.doc.md +290 -22
  185. package/docs_for_llm/duration.doc.md +76 -0
  186. package/docs_for_llm/editable.doc.md +36 -14
  187. package/docs_for_llm/ellipsis.doc.md +10 -5
  188. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  189. package/docs_for_llm/flex.doc.md +83 -0
  190. package/docs_for_llm/form.doc.md +196 -18
  191. package/docs_for_llm/formiteminput.doc.md +128 -0
  192. package/docs_for_llm/formitemspinner.doc.md +105 -0
  193. package/docs_for_llm/formitemswitch.doc.md +113 -0
  194. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  195. package/docs_for_llm/grid.doc.md +78 -5
  196. package/docs_for_llm/header.doc.md +114 -0
  197. package/docs_for_llm/icon.doc.md +12 -8
  198. package/docs_for_llm/icontooltip.doc.md +121 -0
  199. package/docs_for_llm/input.doc.md +199 -41
  200. package/docs_for_llm/instancelist.doc.md +113 -0
  201. package/docs_for_llm/instancenum.doc.md +95 -0
  202. package/docs_for_llm/ipinput.doc.md +77 -0
  203. package/docs_for_llm/kspstatus.doc.md +82 -0
  204. package/docs_for_llm/kvcode.doc.md +76 -0
  205. package/docs_for_llm/layoutcontent.doc.md +54 -17
  206. package/docs_for_llm/layoutlistcontent.doc.md +168 -0
  207. package/docs_for_llm/layoutpermissioncontent.doc.md +93 -0
  208. package/docs_for_llm/layoutstandardlist.doc.md +129 -0
  209. package/docs_for_llm/layouttabs.doc.md +101 -0
  210. package/docs_for_llm/lazymount.doc.md +82 -0
  211. package/docs_for_llm/lazyteleport.doc.md +85 -0
  212. package/docs_for_llm/menu.doc.md +139 -14
  213. package/docs_for_llm/message.doc.md +93 -10
  214. package/docs_for_llm/notification.doc.md +214 -0
  215. package/docs_for_llm/pagination.doc.md +30 -17
  216. package/docs_for_llm/paginationplus.doc.md +31 -10
  217. package/docs_for_llm/password.doc.md +86 -0
  218. package/docs_for_llm/popover.doc.md +24 -55
  219. package/docs_for_llm/progress.doc.md +13 -10
  220. package/docs_for_llm/projects.doc.md +91 -0
  221. package/docs_for_llm/protable.doc.md +98 -15
  222. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  223. package/docs_for_llm/radio.doc.md +23 -8
  224. package/docs_for_llm/rate.doc.md +127 -0
  225. package/docs_for_llm/region.doc.md +25 -13
  226. package/docs_for_llm/scrollselect.doc.md +90 -0
  227. package/docs_for_llm/search.doc.md +120 -0
  228. package/docs_for_llm/searchinput.doc.md +111 -0
  229. package/docs_for_llm/searchitems.doc.md +116 -0
  230. package/docs_for_llm/searchselect.doc.md +126 -0
  231. package/docs_for_llm/select.doc.md +208 -49
  232. package/docs_for_llm/sidebar.doc.md +133 -0
  233. package/docs_for_llm/skeleton.doc.md +152 -0
  234. package/docs_for_llm/slider.doc.md +42 -22
  235. package/docs_for_llm/spin.doc.md +18 -6
  236. package/docs_for_llm/spinner.doc.md +28 -18
  237. package/docs_for_llm/split.doc.md +170 -0
  238. package/docs_for_llm/sshkeys.doc.md +88 -0
  239. package/docs_for_llm/status.doc.md +14 -9
  240. package/docs_for_llm/steps.doc.md +81 -7
  241. package/docs_for_llm/switch.doc.md +32 -16
  242. package/docs_for_llm/table.doc.md +317 -55
  243. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  244. package/docs_for_llm/tabs.doc.md +117 -12
  245. package/docs_for_llm/tag.doc.md +167 -15
  246. package/docs_for_llm/timeline.doc.md +187 -0
  247. package/docs_for_llm/timepicker.doc.md +74 -36
  248. package/docs_for_llm/timerange.doc.md +157 -0
  249. package/docs_for_llm/tip.doc.md +50 -11
  250. package/docs_for_llm/tooltip.doc.md +99 -27
  251. package/docs_for_llm/tour.doc.md +125 -28
  252. package/docs_for_llm/transfer.doc.md +99 -33
  253. package/docs_for_llm/tree.doc.md +129 -24
  254. package/docs_for_llm/treeselect.doc.md +101 -44
  255. package/docs_for_llm/upload.doc.md +63 -32
  256. package/docs_for_llm/useCRUD.doc.md +49 -0
  257. package/docs_for_llm/useCountdown.doc.md +43 -0
  258. package/docs_for_llm/useDetail.doc.md +48 -0
  259. package/docs_for_llm/useDialog.doc.md +46 -0
  260. package/docs_for_llm/useEntity.doc.md +45 -0
  261. package/docs_for_llm/useEventListener.doc.md +44 -0
  262. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  263. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  264. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  265. package/docs_for_llm/useGroup.doc.md +48 -0
  266. package/docs_for_llm/useIdEntities.doc.md +48 -0
  267. package/docs_for_llm/useIdEntity.doc.md +103 -0
  268. package/docs_for_llm/useInterval.doc.md +43 -0
  269. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  270. package/docs_for_llm/useMessage.doc.md +46 -0
  271. package/docs_for_llm/useModifyCache.doc.md +37 -0
  272. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  273. package/docs_for_llm/usePagination.doc.md +60 -0
  274. package/docs_for_llm/usePersist.doc.md +54 -0
  275. package/docs_for_llm/usePoll.doc.md +41 -0
  276. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  277. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  278. package/docs_for_llm/useSearch.doc.md +68 -0
  279. package/docs_for_llm/useShell.doc.md +43 -0
  280. package/docs_for_llm/useSkip.doc.md +41 -0
  281. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  282. package/docs_for_llm/useStore.doc.md +34 -0
  283. package/docs_for_llm/useTable.doc.md +57 -0
  284. package/docs_for_llm/useTableGroup.doc.md +47 -0
  285. package/docs_for_llm/useTableSort.doc.md +40 -0
  286. package/docs_for_llm/useToState.doc.md +112 -0
  287. package/docs_for_llm/useUser.doc.md +38 -0
  288. package/docs_for_llm/useValidForm.doc.md +41 -0
  289. package/docs_for_llm/vdialog.doc.md +154 -0
  290. package/docs_for_llm/vdrawer.doc.md +148 -0
  291. package/docs_for_llm/virtuallist.doc.md +157 -3
  292. package/hooks/useCRUD.json +61 -0
  293. package/hooks/useCountdown.json +49 -0
  294. package/hooks/useDetail.json +67 -0
  295. package/hooks/useDialog.json +49 -0
  296. package/hooks/useEntity.json +61 -0
  297. package/hooks/useEventListener.json +61 -0
  298. package/hooks/useFalseUntilTruthy.json +43 -0
  299. package/hooks/useGetCopyAuthText.json +36 -0
  300. package/hooks/useGetUserPermission.json +55 -0
  301. package/hooks/useGroup.json +49 -0
  302. package/hooks/useIdEntities.json +61 -0
  303. package/hooks/useInterval.json +55 -0
  304. package/hooks/useLayoutStandardList.json +36 -0
  305. package/hooks/useMessage.json +73 -0
  306. package/hooks/useModifyCache.json +36 -0
  307. package/hooks/useOpenDialog.json +43 -0
  308. package/hooks/usePagination.json +49 -0
  309. package/hooks/usePersist.json +61 -0
  310. package/hooks/usePoll.json +43 -0
  311. package/hooks/useRoutePlus.json +36 -0
  312. package/hooks/useRouterPlus.json +36 -0
  313. package/hooks/useSearch.json +56 -0
  314. package/hooks/useShell.json +49 -0
  315. package/hooks/useSkip.json +43 -0
  316. package/hooks/useStorageIdEntity.json +67 -0
  317. package/hooks/useStore.json +36 -0
  318. package/hooks/useTable.json +49 -0
  319. package/hooks/useTableGroup.json +43 -0
  320. package/hooks/useTableSort.json +43 -0
  321. package/hooks/useUser.json +36 -0
  322. package/hooks/useValidForm.json +43 -0
  323. package/package.json +14 -8
  324. package/dist/chunk-D3Y6FGWA.js +0 -153
  325. package/dist/chunk-HPAUCD5I.js +0 -156
  326. package/dist/chunk-L4DS3EXI.mjs +0 -133
  327. package/dist/chunk-NZ6TLWMD.mjs +0 -151
@@ -0,0 +1,129 @@
1
+ # 标准列表布局 (LayoutStandardList)
2
+
3
+ 标准化列表页业务容器,内置搜索、批量操作、轮询和列管理等能力,适合快速搭建成熟的资源管理列表页。
4
+
5
+ **关键词**: standard list, resource list layout, 列表布局, 标准列表, 批量操作列表, 带搜索列表, 列管理, 轮询列表
6
+
7
+ **使用场景**: 标准资源列表页、带搜索和批量操作的列表页、带轮询和列设置的控制台列表、快速搭建资源管理页
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { LayoutStandardList } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | canCreate | `Record<string, any>` | `undefined` | 否 | 控制“创建”按钮可用性的配置对象 | - | - |
18
+ | canDelete | `Record<string, any>` | `undefined` | 否 | 控制批量删除按钮可用性的配置对象 | - | - |
19
+ | handleClickCreateBtn | `() => void` | `undefined` | 否 | 点击创建按钮时的处理函数 | - | - |
20
+ | handleClickBatchDeleteBtn | `() => void` | `undefined` | 否 | 点击批量删除按钮时的处理函数 | - | - |
21
+ | placeholder | `string` | `undefined` | 否 | 搜索框占位文案 | - | - |
22
+ | hasSearch | `boolean` | `true` | 否 | 是否显示搜索区域 | - | - |
23
+ | hasSearchItems | `boolean` | `undefined` | 否 | 是否显示检索项区域 | - | - |
24
+ | searches | `SearchType[] | Record<string, SearchType>` | `undefined` | 否 | 搜索配置集合 | - | - |
25
+ | searchGroups | `SearchGroupItem[]` | `undefined` | 否 | 搜索类型分组配置 | - | - |
26
+ | labelMaps | `Record<string, string>` | `undefined` | 否 | 筛选标签文案映射 | - | - |
27
+ | rowKey | `string` | `undefined` | 否 | 表格行唯一键字段名 | - | - |
28
+ | notCheckTip | `string` | `undefined` | 否 | 未选中任何行时的提示文案 | - | - |
29
+ | tableFields | `any` | `undefined` | 否 | 可配置的表格字段定义 | - | - |
30
+ | checkType | `any` | `"checkbox"` | 否 | 表格勾选模式 | - | - |
31
+ | sortType | `string` | `undefined` | 否 | 排序模式 | - | - |
32
+ | pollInterval | `number` | `0` | 否 | 轮询刷新间隔,单位毫秒 | - | - |
33
+ | useList | `Function` | `undefined` | 是 | 拉取列表数据的 hook 或函数,必填 | - | - |
34
+ | useListDepParams | `any[]` | `undefined` | 否 | 触发 useList 刷新的依赖参数列表 | - | - |
35
+ | useListOptionParams | `Record<string, any>` | `undefined` | 否 | 传给 useList 的可选参数对象 | - | - |
36
+
37
+ ## 插槽 (Slots)
38
+ | 插槽名 | 说明 | 模板写法 | 示例 |
39
+ | --- | --- | --- | --- |
40
+ | default | 自定义列表主体内容 | `<LayoutStandardList>...</LayoutStandardList>` | `<LayoutStandardList>
41
+ <template <LayoutStandardList>...</LayoutStandardList>>
42
+ 自定义default内容
43
+ </template>
44
+ </LayoutStandardList>` |
45
+
46
+ ### 插槽参数说明
47
+ **default**
48
+
49
+ - 参数结构: 无参数
50
+
51
+ ## 使用示例
52
+ ### 资源管理列表页
53
+ **场景**: 快速拼出带搜索、列配置和新建入口的资源列表页。
54
+
55
+ 通过内置搜索和创建按钮快速搭建标准资源列表。
56
+
57
+ **使用的 API**: 属性: canCreate, hasSearch, searches, tableFields, placeholder
58
+
59
+ ```vue
60
+ <script setup lang="ts">
61
+ import { LayoutStandardList, ProTable } from '@ksyun-internal/versatile';
62
+
63
+ const searches = [
64
+ { key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },
65
+ { key: 'status', label: '状态', type: 'select', list: [{ key: 'running', label: '运行中' }] },
66
+ ];
67
+ const tableFields = [
68
+ { key: 'name', label: '实例名称', checked: true },
69
+ { key: 'status', label: '状态', checked: true },
70
+ ];
71
+ </script>
72
+
73
+ <template>
74
+ <LayoutStandardList
75
+ :can-create="true"
76
+ :has-search="true"
77
+ :searches="searches"
78
+ :table-fields="tableFields"
79
+ placeholder="搜索实例名称"
80
+ >
81
+ <ProTable :columns="[]" :data-source="[]" row-key="id" />
82
+ </LayoutStandardList>
83
+ </template>
84
+ ```
85
+
86
+ ### 带批量操作和轮询的标准列表
87
+ **场景**: 在资源列表页中同时开启筛选条件回显、批量操作和定时刷新。
88
+
89
+ 使用批量删除、检索项回显和轮询能力构建更完整的资源管理页。
90
+
91
+ **使用的 API**: 属性: hasSearch, hasSearchItems, searches, tableFields, pollInterval, canDelete, handleClickBatchDeleteBtn, useList, rowKey
92
+
93
+ ```vue
94
+ <script setup lang="ts">
95
+ import { LayoutStandardList, ProTable } from '@ksyun-internal/versatile';
96
+
97
+ const searches = [
98
+ { key: 'name', label: '实例名称', type: 'input', placeholder: '请输入实例名称' },
99
+ { key: 'status', label: '状态', type: 'select', list: [{ key: 'running', label: '运行中' }, { key: 'stopped', label: '已停止' }] },
100
+ ];
101
+ const tableFields = [
102
+ { key: 'name', label: '实例名称', checked: true },
103
+ { key: 'status', label: '状态', checked: true },
104
+ { key: 'privateIp', label: '内网 IP', checked: false },
105
+ ];
106
+ const useList = () => ({ loading: false, dataSource: [], total: 0 });
107
+ const handleClickBatchDeleteBtn = () => console.log('batch delete');
108
+ </script>
109
+
110
+ <template>
111
+ <LayoutStandardList
112
+ :has-search="true"
113
+ :has-search-items="true"
114
+ :searches="searches"
115
+ :table-fields="tableFields"
116
+ :poll-interval="10000"
117
+ :can-delete="{ value: true }"
118
+ :handle-click-batch-delete-btn="handleClickBatchDeleteBtn"
119
+ :use-list="useList"
120
+ row-key="id"
121
+ >
122
+ <ProTable :columns="[]" :data-source="[]" row-key="id" />
123
+ </LayoutStandardList>
124
+ </template>
125
+ ```
126
+
127
+ ## 相关组件
128
+ LayoutListContent, ProTable, Search, SearchItems
129
+
@@ -0,0 +1,101 @@
1
+ # 布局标签页 (LayoutTabs)
2
+
3
+ 页面级业务标签组件,适合在详情页或配置页切换“概览、监控、日志、告警”等大块内容。
4
+
5
+ **关键词**: layout tabs, tabs, tab, 页面标签, 页签
6
+
7
+ **使用场景**: 详情页多标签切换、控制台页面分区导航、路由参数驱动的页签切换
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { LayoutTabs } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | modelValue | `any` | `undefined` | 否 | 当前激活的标签值 | - | - |
18
+ | tabs | `TabItem[]` | `[]` | 否 | 标签数据列表,元素通常包含 value、label、disabled 等字段 | - | - |
19
+ | theme | `string` | `undefined` | 否 | 标签页视觉主题 | - | - |
20
+ | routerName | `string` | `undefined` | 否 | 结合路由模式时使用的路由名称 | - | - |
21
+ | tabParamKey | `string` | `"tab"` | 否 | URL 中用于记录当前 tab 的参数名 | - | - |
22
+ | halfRadius | `boolean` | `false` | 否 | 是否启用半圆角样式 | - | - |
23
+
24
+ ## 事件 (Events)
25
+ | 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
26
+ | --- | --- | --- | --- | --- |
27
+ | update:modelValue | `@update:modelValue` | 激活标签值变化时触发,适合直接绑定当前 tab 状态。 | `value?: string | number` | - |
28
+ | update:tab | `@update:tab` | 当前完整标签对象变化时触发,便于读取路由名或扩展字段。 | `value?: LayoutTabItem` | - |
29
+
30
+ ### 事件参数说明
31
+ **update:modelValue**
32
+
33
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
34
+ | --- | --- | --- | --- | --- |
35
+ | value | `string | number` | 否 | - | 当前激活标签的 value。 |
36
+
37
+ **update:tab**
38
+
39
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
40
+ | --- | --- | --- | --- | --- |
41
+ | value | `LayoutTabItem` | 否 | - | 当前选中的完整标签项对象。 |
42
+
43
+ ## 使用示例
44
+ ### 详情页标签切换
45
+ **场景**: 在详情页顶部切换不同子页面内容。
46
+
47
+ 在页面主区域切换不同业务模块。
48
+
49
+ **使用的 API**: 属性: modelValue, tabs | 事件: update:modelValue
50
+
51
+ ```vue
52
+ <script setup lang="ts">
53
+ import { ref } from 'vue';
54
+ import { LayoutTabs } from '@ksyun-internal/versatile';
55
+
56
+ const active = ref('overview');
57
+ const tabs = [
58
+ { label: '概览', value: 'overview' },
59
+ { label: '监控', value: 'monitor' },
60
+ { label: '日志', value: 'logs' },
61
+ ];
62
+ </script>
63
+
64
+ <template>
65
+ <LayoutTabs v-model="active" :tabs="tabs" />
66
+ </template>
67
+ ```
68
+
69
+ ### 结合路由参数记录页签
70
+ **场景**: 让用户刷新页面后仍能保留当前页签状态。
71
+
72
+ 通过 tabParamKey 让当前页签状态体现在 URL 上。
73
+
74
+ **使用的 API**: 属性: modelValue, tabs, tabParamKey, halfRadius | 事件: update:modelValue, update:tab
75
+
76
+ ```vue
77
+ <script setup lang="ts">
78
+ import { ref } from 'vue';
79
+ import { LayoutTabs } from '@ksyun-internal/versatile';
80
+
81
+ const active = ref('alarm');
82
+ const tabs = [
83
+ { label: '概览', value: 'overview' },
84
+ { label: '告警', value: 'alarm' },
85
+ { label: '审计日志', value: 'audit' },
86
+ ];
87
+ </script>
88
+
89
+ <template>
90
+ <LayoutTabs
91
+ v-model="active"
92
+ :tabs="tabs"
93
+ tab-param-key="view"
94
+ :half-radius="true"
95
+ />
96
+ </template>
97
+ ```
98
+
99
+ ## 相关组件
100
+ LayoutContent, Header
101
+
@@ -0,0 +1,82 @@
1
+ # 延迟挂载 (LazyMount)
2
+
3
+ 仅在内容真正可见时再挂载子树的轻量组件,适合优化重量级图表、编辑器或弹层内部内容的首次渲染开销。
4
+
5
+ **关键词**: lazy mount, deferred mount, 延迟挂载, 按需挂载, 性能优化
6
+
7
+ **使用场景**: 大型内容按需挂载、弹层内容懒加载、编辑器或图表按需渲染
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { LazyMount } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | show | `boolean` | `undefined` | 是 | 是否挂载内容 | - | - |
18
+
19
+ ## 插槽 (Slots)
20
+ | 插槽名 | 说明 | 模板写法 | 示例 |
21
+ | --- | --- | --- | --- |
22
+ | default | 延迟挂载的内容 | `<LazyMount>...</LazyMount>` | `<LazyMount>
23
+ <template <LazyMount>...</LazyMount>>
24
+ 自定义default内容
25
+ </template>
26
+ </LazyMount>` |
27
+
28
+ ### 插槽参数说明
29
+ **default**
30
+
31
+ - 参数结构: 无参数
32
+
33
+ ## 使用示例
34
+ ### 延迟挂载重量级图表
35
+ **场景**: 减少图表、代码编辑器等重组件的初始渲染成本。
36
+
37
+ 在用户展开监控面板后再渲染图表区域。
38
+
39
+ **使用的 API**: 属性: show
40
+
41
+ ```vue
42
+ <script setup lang="ts">
43
+ import { ref } from 'vue';
44
+ import { LazyMount } from '@ksyun-internal/versatile';
45
+
46
+ const showChart = ref(false);
47
+ </script>
48
+
49
+ <template>
50
+ <button @click="showChart = !showChart">切换监控面板</button>
51
+ <LazyMount :show="showChart">
52
+ <div>这里放图表组件</div>
53
+ </LazyMount>
54
+ </template>
55
+ ```
56
+
57
+ ### 编辑器面板按需挂载
58
+ **场景**: 避免策略编辑器、脚本编辑器在初始渲染时带来额外开销。
59
+
60
+ 只在用户切换到高级编辑模式后再加载编辑器区域。
61
+
62
+ **使用的 API**: 属性: show
63
+
64
+ ```vue
65
+ <script setup lang="ts">
66
+ import { ref } from 'vue';
67
+ import { LazyMount } from '@ksyun-internal/versatile';
68
+
69
+ const advanced = ref(false);
70
+ </script>
71
+
72
+ <template>
73
+ <button @click="advanced = !advanced">高级编辑</button>
74
+ <LazyMount :show="advanced">
75
+ <textarea rows="8" style="width: 100%;">这里放策略编辑器</textarea>
76
+ </LazyMount>
77
+ </template>
78
+ ```
79
+
80
+ ## 相关组件
81
+ LazyTeleport
82
+
@@ -0,0 +1,85 @@
1
+ # 延迟传送 (LazyTeleport)
2
+
3
+ 结合 Teleport 与惰性挂载能力的组件,只有在需要显示时才把内容传送到目标容器,适合悬浮工具栏、页面外挂操作区。
4
+
5
+ **关键词**: lazy teleport, teleport, 延迟传送, portal, 按需 teleport
6
+
7
+ **使用场景**: 弹层内容延迟挂载、按需 Teleport 内容、禁用 Teleport 的回退渲染
8
+
9
+ ## 导入语句
10
+ ```typescript
11
+ import { LazyTeleport } from '@ksyun-internal/versatile';
12
+ ```
13
+
14
+ ## 属性 (Props)
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | to | `string | Element` | `undefined` | 否 | Teleport 目标容器 | - | - |
18
+ | disabled | `boolean` | `undefined` | 否 | 是否禁用 Teleport | - | - |
19
+ | defer | `boolean` | `undefined` | 否 | 是否延迟传送 | - | - |
20
+ | show | `boolean` | `undefined` | 是 | 是否展示内容 | - | - |
21
+
22
+ ## 插槽 (Slots)
23
+ | 插槽名 | 说明 | 模板写法 | 示例 |
24
+ | --- | --- | --- | --- |
25
+ | default | 待传送内容 | `<LazyTeleport>...</LazyTeleport>` | `<LazyTeleport>
26
+ <template <LazyTeleport>...</LazyTeleport>>
27
+ 自定义default内容
28
+ </template>
29
+ </LazyTeleport>` |
30
+
31
+ ### 插槽参数说明
32
+ **default**
33
+
34
+ - 参数结构: 无参数
35
+
36
+ ## 使用示例
37
+ ### 延迟传送页面操作区
38
+ **场景**: 把低频出现的页面操作区延迟挂载到指定容器。
39
+
40
+ 仅在页面进入编辑态后把操作按钮挂到目标容器。
41
+
42
+ **使用的 API**: 属性: to, show
43
+
44
+ ```vue
45
+ <script setup lang="ts">
46
+ import { ref } from 'vue';
47
+ import { LazyTeleport } from '@ksyun-internal/versatile';
48
+
49
+ const showActions = ref(true);
50
+ </script>
51
+
52
+ <template>
53
+ <div id="page-actions"></div>
54
+ <LazyTeleport to="#page-actions" :show="showActions">
55
+ <div>保存 / 取消</div>
56
+ </LazyTeleport>
57
+ </template>
58
+ ```
59
+
60
+ ### 禁用 Teleport 回退到原地渲染
61
+ **场景**: 在宿主环境不适合 Teleport 时回退到就地渲染。
62
+
63
+ 在某些嵌入场景下通过 disabled 让内容仍在原位置渲染。
64
+
65
+ **使用的 API**: 属性: to, show, disabled
66
+
67
+ ```vue
68
+ <script setup lang="ts">
69
+ import { ref } from 'vue';
70
+ import { LazyTeleport } from '@ksyun-internal/versatile';
71
+
72
+ const showActions = ref(true);
73
+ const disableTeleport = ref(true);
74
+ </script>
75
+
76
+ <template>
77
+ <LazyTeleport to="#toolbar" :show="showActions" :disabled="disableTeleport">
78
+ <div>保存当前草稿</div>
79
+ </LazyTeleport>
80
+ </template>
81
+ ```
82
+
83
+ ## 相关组件
84
+ LazyMount, VDialog, VDrawer
85
+
@@ -12,27 +12,35 @@ import { Menu, MenuItem } from '@king-design/vue';
12
12
  ```
13
13
 
14
14
  ## 属性 (Props)
15
- | 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
16
- | --- | --- | --- | --- | --- | --- |
17
- | selectedKey | `string | number` | `undefined` | 否 | 当前选中项的 key,可用 v-model:selectedKey 双向绑定 | `<Menu v-model:selectedKey="selectedKey"></Menu>` |
18
- | expandedKeys | `(string | number)[]` | `[]` | 否 | 展开的子菜单 key 数组,可用 v-model:expandedKeys 双向绑定 | `<Menu v-model:expandedKeys="expandedKeys"></Menu>` |
19
- | theme | `"light" | "dark"` | `"dark"` | 否 | 菜单主题 | `<Menu theme="light"></Menu>` |
20
- | type | `"vertical" | "horizontal"` | `"vertical"` | 否 | 菜单排列方式 | `<Menu type="horizontal"></Menu>` |
21
- | collapse | `boolean` | `false` | 否 | 菜单是否折叠(只显示图标) | `<Menu :collapse="isCollapsed"></Menu>` |
22
- | size | `"large" | "default" | "small"` | `"default"` | 否 | 菜单尺寸 | `<Menu size="small"></Menu>` |
23
- | accordion | `boolean` | `false` | 否 | 是否每次只能展开一项(手风琴模式) | `<Menu accordion></Menu>` |
24
- | dot | `boolean` | `false` | 否 | 是否给菜单项前面添加圆点 | `<Menu dot></Menu>` |
25
- | showCollapseArrow | `boolean` | `false` | 否 | 是否展示折叠按钮 | `<Menu showCollapseArrow></Menu>` |
15
+ | 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
16
+ | --- | --- | --- | --- | --- | --- | --- |
17
+ | selectedKey | `string | number` | `undefined` | 否 | 当前选中项的 key,可用 v-model:selectedKey 双向绑定 | - | `<Menu v-model:selectedKey="selectedKey"></Menu>` |
18
+ | expandedKeys | `(string | number)[]` | `[]` | 否 | 展开的子菜单 key 数组,可用 v-model:expandedKeys 双向绑定 | - | `<Menu v-model:expandedKeys="expandedKeys"></Menu>` |
19
+ | theme | `"light" | "dark"` | `"dark"` | 否 | 菜单主题 | - | `<Menu theme="light"></Menu>` |
20
+ | type | `"vertical" | "horizontal"` | `"vertical"` | 否 | 菜单排列方式 | - | `<Menu type="horizontal"></Menu>` |
21
+ | collapse | `boolean` | `false` | 否 | 菜单是否折叠(只显示图标) | - | `<Menu :collapse="isCollapsed"></Menu>` |
22
+ | size | `"large" | "default" | "small"` | `"default"` | 否 | 菜单尺寸 | - | `<Menu size="small"></Menu>` |
23
+ | accordion | `boolean` | `false` | 否 | 是否每次只能展开一项(手风琴模式) | - | `<Menu accordion></Menu>` |
24
+ | dot | `boolean` | `false` | 否 | 是否给菜单项前面添加圆点 | - | `<Menu dot></Menu>` |
25
+ | showCollapseArrow | `boolean` | `false` | 否 | 是否展示折叠按钮 | - | `<Menu showCollapseArrow></Menu>` |
26
26
 
27
27
  ## 插槽 (Slots)
28
28
  | 插槽名 | 说明 | 模板写法 | 示例 |
29
29
  | --- | --- | --- | --- |
30
- | header | 扩展菜单头部 | `undefined` | - |
30
+ | header | 扩展菜单头部 | `#header` | `<Menu>
31
+ <template #header>头部内容</template>
32
+ </Menu>` |
33
+
34
+ ### 插槽参数说明
35
+ **header**
36
+
37
+ - 参数结构: 无参数
31
38
 
32
39
  ## 子组件 (Sub-Components)
33
40
  ### MenuItem
34
41
  菜单项组件,可嵌套使用形成子菜单
35
42
 
43
+ #### 属性 (Props)
36
44
  | 属性名 | 类型 | 说明 | 示例 |
37
45
  | --- | --- | --- | --- |
38
46
  | key | `string | number` | 全局唯一的标识,用于标识和控制选中状态 | `<MenuItem key="home">首页</MenuItem>` |
@@ -40,10 +48,125 @@ import { Menu, MenuItem } from '@king-design/vue';
40
48
  | disabled | `boolean` | 是否禁用当前项 | `<MenuItem key="disabled" disabled>禁用项</MenuItem>` |
41
49
  | dot | `boolean` | 是否给当前菜单项前面添加圆点 | `<MenuItem key="item" dot>带圆点</MenuItem>` |
42
50
 
43
- **事件**:
44
- - `@select`: 选中没有子菜单的菜单项时触发
51
+ #### 事件 (Events)
52
+ | 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
53
+ | --- | --- | --- | --- | --- |
54
+ | select | `@select` | 选中没有子菜单的菜单项时触发 | `menuItem: MenuItem, e: MouseEvent` | `<MenuItem @select="handleMenuSelect"></MenuItem>` |
55
+
56
+ ##### MenuItem 事件参数说明
57
+ **select**
58
+
59
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
60
+ | --- | --- | --- | --- | --- |
61
+ | menuItem | `MenuItem` | 是 | - | 被选中的菜单项实例 |
62
+ | e | `MouseEvent` | 是 | - | 原生鼠标事件 |
63
+
64
+ 事件处理示例:
65
+ ```typescript
66
+ const activeSection = ref('');
67
+
68
+ const handleMenuSelect = (menuItem, e: MouseEvent) => {
69
+ activeSection.value = String(menuItem.key);
70
+ };
71
+ ```
72
+
73
+ #### 组合示例
74
+ ##### 带图标的嵌套菜单
75
+ **场景**: 创建带图标的多级嵌套菜单,包含禁用项和路由跳转
76
+
77
+ 图标和多级嵌套子菜单
78
+
79
+ **命中的子组件 API**: 属性: key, to, disabled | 事件: select
80
+
81
+ ```vue
82
+ <script setup lang="ts">
83
+ import { ref } from 'vue';
84
+ import { Menu, MenuItem, Icon } from '@king-design/vue';
85
+
86
+ const selectedKey = ref('');
87
+ const expandedKeys = ref<string[]>(['3']);
88
+
89
+ const onSelect = (menuItem: any) => {
90
+ console.log('选中:', menuItem.key);
91
+ };
92
+ </script>
93
+ <template>
94
+ <Menu
95
+ v-model:selectedKey="selectedKey"
96
+ v-model:expandedKeys="expandedKeys"
97
+ theme="light"
98
+ >
99
+ <MenuItem key="1" @select="onSelect">菜单 1</MenuItem>
100
+ <MenuItem key="2" disabled>菜单 2(禁用)</MenuItem>
101
+ <MenuItem key="3">
102
+ <Icon class="k-icon-heart" /> 菜单 3
103
+ <Menu>
104
+ <MenuItem key="3-1" @select="onSelect">子菜单 1</MenuItem>
105
+ <MenuItem key="3-2" @select="onSelect">子菜单 2</MenuItem>
106
+ <MenuItem key="3-3" disabled>子菜单 3(禁用)</MenuItem>
107
+ <MenuItem key="3-4">子菜单 4</MenuItem>
108
+ </Menu>
109
+ </MenuItem>
110
+ <MenuItem key="4" to="/">菜单 4(路由)</MenuItem>
111
+ </Menu>
112
+ </template>
113
+ ```
114
+
115
+ ##### 路由集成
116
+ **场景**: 配合 Vue Router 进行页面导航
117
+
118
+ 配合 Vue Router 使用
119
+
120
+ **命中的子组件 API**: 属性: key, to
121
+
122
+ ```vue
123
+ <script setup lang="ts">
124
+ import { ref } from 'vue';
125
+ import { Menu, MenuItem } from '@king-design/vue';
126
+
127
+ const selectedKey = ref('home');
128
+ </script>
129
+ <template>
130
+ <Menu v-model:selectedKey="selectedKey">
131
+ <MenuItem key="home" to="/">首页</MenuItem>
132
+ <MenuItem key="products" to="/products">产品</MenuItem>
133
+ <MenuItem key="docs" :to="{name: 'docs'}">文档</MenuItem>
134
+ </Menu>
135
+ </template>
136
+ ```
137
+
138
+ ##### 带圆点和头部
139
+ **场景**: 使用 dot 属性给菜单项添加圆点,使用 header 插槽自定义头部
140
+
141
+ 使用 dot 属性和 header 插槽
142
+
143
+ **命中的子组件 API**: 属性: key, dot
144
+
145
+ ```vue
146
+ <script setup lang="ts">
147
+ import { ref } from 'vue';
148
+ import { Menu, MenuItem } from '@king-design/vue';
149
+
150
+ const selectedKey = ref('1');
151
+ const expandedKeys = ref<string[]>([]);
152
+ </script>
153
+ <template>
154
+ <Menu
155
+ v-model:selectedKey="selectedKey"
156
+ v-model:expandedKeys="expandedKeys"
157
+ :dot="true"
158
+ theme="light"
159
+ >
160
+ <template #header>管理面板</template>
161
+ <MenuItem key="1">菜单项 1</MenuItem>
162
+ <MenuItem key="2">菜单项 2</MenuItem>
163
+ <MenuItem key="3" :dot="false">无圆点菜单项</MenuItem>
164
+ </Menu>
165
+ </template>
166
+ ```
45
167
 
46
168
  ## 常见错误与正确用法 (Anti-Hallucination)
169
+ ### MenuItem 未设置 key
47
170
  > **错误用法**: `<Menu v-model:selectedKey="selectedKey">
48
171
  <MenuItem>首页</MenuItem>
49
172
  </Menu>`
@@ -52,10 +175,12 @@ import { Menu, MenuItem } from '@king-design/vue';
52
175
  </Menu>`
53
176
  > **说明**: 每个 MenuItem 必须设置唯一的 key 用于标识和控制选中状态
54
177
 
178
+ ### 使用错误的 v-model 语法
55
179
  > **错误用法**: `<Menu v-model="selectedKey">`
56
180
  > **正确写法**: `<Menu v-model:selectedKey="selectedKey">`
57
181
  > **说明**: Menu 使用 v-model:selectedKey 而非 v-model 来绑定选中项
58
182
 
183
+ ### type 值拼写错误
59
184
  > **错误用法**: `<Menu type="horizonal">`
60
185
  > **正确写法**: `<Menu type="horizontal">`
61
186
  > **说明**: type 只支持 vertical 和 horizontal,注意拼写