vue-super-crud 1.7.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 (291) hide show
  1. package/.browserslistrc +3 -0
  2. package/.versionrc.json +36 -0
  3. package/CHANGELOG.md +232 -0
  4. package/LICENSE +201 -0
  5. package/README.md +46 -0
  6. package/babel.config.js +12 -0
  7. package/build/alias.js +10 -0
  8. package/build/build.js +52 -0
  9. package/build/config.js +70 -0
  10. package/deploy.bat +14 -0
  11. package/docs/.vuepress/components/button/base.vue +88 -0
  12. package/docs/.vuepress/components/common/code-format.vue +331 -0
  13. package/docs/.vuepress/components/commonConfig/presetCodeTemplate/base.vue +68 -0
  14. package/docs/.vuepress/components/commonConfig/presetCodeTemplate/customParams.vue +73 -0
  15. package/docs/.vuepress/components/commonConfig/renderType/component.vue +160 -0
  16. package/docs/.vuepress/components/commonConfig/renderType/formatter.vue +49 -0
  17. package/docs/.vuepress/components/commonConfig/renderType/render.vue +91 -0
  18. package/docs/.vuepress/components/commonConfig/renderType/slot.vue +63 -0
  19. package/docs/.vuepress/components/crud/baseUse/baseUse.vue +98 -0
  20. package/docs/.vuepress/components/crud/baseUse/columnAction.vue +72 -0
  21. package/docs/.vuepress/components/crud/baseUse/columnWidth.vue +107 -0
  22. package/docs/.vuepress/components/crud/baseUse/handleRow.vue +65 -0
  23. package/docs/.vuepress/components/crud/baseUse/height.vue +82 -0
  24. package/docs/.vuepress/components/crud/baseUse/index.vue +54 -0
  25. package/docs/.vuepress/components/crud/baseUse/loading.vue +70 -0
  26. package/docs/.vuepress/components/crud/baseUse/pagination.vue +108 -0
  27. package/docs/.vuepress/components/crud/baseUse/selection.vue +114 -0
  28. package/docs/.vuepress/components/crud/baseUse/summaryMethod.vue +118 -0
  29. package/docs/.vuepress/components/crud/baseUse/title.vue +54 -0
  30. package/docs/.vuepress/components/crud/baseUse/toolbar.vue +69 -0
  31. package/docs/.vuepress/components/crud/buttons/common.vue +115 -0
  32. package/docs/.vuepress/components/crud/buttons/fast.vue +82 -0
  33. package/docs/.vuepress/components/crud/contextMenu/base.vue +72 -0
  34. package/docs/.vuepress/components/crud/copy.vue +52 -0
  35. package/docs/.vuepress/components/crud/crudEvents/api.vue +157 -0
  36. package/docs/.vuepress/components/crud/crudEvents/deleteTip.vue +93 -0
  37. package/docs/.vuepress/components/crud/crudEvents/events.vue +188 -0
  38. package/docs/.vuepress/components/crud/dataSort/base.vue +142 -0
  39. package/docs/.vuepress/components/crud/genDynamicColumns/base.vue +53 -0
  40. package/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue +111 -0
  41. package/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue +68 -0
  42. package/docs/.vuepress/components/crud/handleBar/handleRow.vue +65 -0
  43. package/docs/.vuepress/components/crud/handleBar/toolbar.vue +69 -0
  44. package/docs/.vuepress/components/crud/renderType/1.vue +57 -0
  45. package/docs/.vuepress/components/crud/renderType/2.vue +63 -0
  46. package/docs/.vuepress/components/crud/renderType/3.vue +105 -0
  47. package/docs/.vuepress/components/crud/renderType/5.vue +91 -0
  48. package/docs/.vuepress/components/crud/search/1.vue +90 -0
  49. package/docs/.vuepress/components/crud/search/2.vue +78 -0
  50. package/docs/.vuepress/components/crud/search/3.vue +107 -0
  51. package/docs/.vuepress/components/crud/search/base.vue +123 -0
  52. package/docs/.vuepress/components/crud/search/localSearch.vue +124 -0
  53. package/docs/.vuepress/components/crud/search/special.vue +148 -0
  54. package/docs/.vuepress/components/crud/selection/events.vue +47 -0
  55. package/docs/.vuepress/components/crud/selection/pagination.vue +94 -0
  56. package/docs/.vuepress/components/crud/selection/singleSelection.vue +64 -0
  57. package/docs/.vuepress/components/crud/span/base.vue +69 -0
  58. package/docs/.vuepress/components/crud/span/special.vue +75 -0
  59. package/docs/.vuepress/components/crud/summary/base.vue +99 -0
  60. package/docs/.vuepress/components/crud/tableEdit/addDeleteBtn.vue +174 -0
  61. package/docs/.vuepress/components/crud/tableEdit/cellEdit.vue +194 -0
  62. package/docs/.vuepress/components/crud/tableEdit/controlEdit.vue +219 -0
  63. package/docs/.vuepress/components/crud/tableEdit/dialog.vue +172 -0
  64. package/docs/.vuepress/components/crud/tableEdit/free.vue +88 -0
  65. package/docs/.vuepress/components/crud/tableEdit/freeColumn.vue +82 -0
  66. package/docs/.vuepress/components/crud/tableEdit/methods.vue +154 -0
  67. package/docs/.vuepress/components/crud/tableEdit/rowAction.vue +107 -0
  68. package/docs/.vuepress/components/crud/tableEdit/rowBatch.vue +116 -0
  69. package/docs/.vuepress/components/crud/tableEdit/rowClick.vue +98 -0
  70. package/docs/.vuepress/components/crud/validate/base.vue +122 -0
  71. package/docs/.vuepress/components/crud/validate/custom.vue +82 -0
  72. package/docs/.vuepress/components/crud/validate/regulars.vue +88 -0
  73. package/docs/.vuepress/components/crud/validate/relation.vue +91 -0
  74. package/docs/.vuepress/components/crud/validate/tree.vue +82 -0
  75. package/docs/.vuepress/components/dialog/baseUse/base.vue +92 -0
  76. package/docs/.vuepress/components/dialog/baseUse/beforeConfirm.vue +78 -0
  77. package/docs/.vuepress/components/dialog/baseUse/control.vue +79 -0
  78. package/docs/.vuepress/components/dialog/baseUse/drawer.vue +59 -0
  79. package/docs/.vuepress/components/dialog/baseUse/footer.vue +87 -0
  80. package/docs/.vuepress/components/dialog/baseUse/insertSlot.vue +79 -0
  81. package/docs/.vuepress/components/dict/DictLinkage.vue +91 -0
  82. package/docs/.vuepress/components/dict/baseUse.vue +72 -0
  83. package/docs/.vuepress/components/dict/component.vue +82 -0
  84. package/docs/.vuepress/components/dict/localDict.vue +68 -0
  85. package/docs/.vuepress/components/form/baseUse/base.vue +48 -0
  86. package/docs/.vuepress/components/form/baseUse/dataFormat.vue +92 -0
  87. package/docs/.vuepress/components/form/baseUse/deep.vue +57 -0
  88. package/docs/.vuepress/components/form/baseUse/gridLayout.vue +47 -0
  89. package/docs/.vuepress/components/form/baseUse/group.vue +66 -0
  90. package/docs/.vuepress/components/form/baseUse/hidden.vue +40 -0
  91. package/docs/.vuepress/components/form/baseUse/inlineLayout.vue +48 -0
  92. package/docs/.vuepress/components/form/baseUse/label.vue +51 -0
  93. package/docs/.vuepress/components/form/baseUse/tooltip.vue +40 -0
  94. package/docs/.vuepress/components/form/baseUse/validate.vue +52 -0
  95. package/docs/.vuepress/components/form/detail/base.vue +78 -0
  96. package/docs/.vuepress/components/form/detail/border.vue +90 -0
  97. package/docs/.vuepress/components/form/detail/singleDetail.vue +72 -0
  98. package/docs/.vuepress/components/formatData/baseUse.vue +131 -0
  99. package/docs/.vuepress/components/mock/index.js +347 -0
  100. package/docs/.vuepress/components/mockData/custom.vue +69 -0
  101. package/docs/.vuepress/components/mockData/example.vue +290 -0
  102. package/docs/.vuepress/components/positionSlot/base.vue +24 -0
  103. package/docs/.vuepress/components/positionSlot/form.vue +71 -0
  104. package/docs/.vuepress/components/positionSlot/table.vue +85 -0
  105. package/docs/.vuepress/components/tabs/base.vue +57 -0
  106. package/docs/.vuepress/components/temp.js +195 -0
  107. package/docs/.vuepress/config.js +146 -0
  108. package/docs/.vuepress/enhanceApp.js +142 -0
  109. package/docs/.vuepress/public/favicon.ico +0 -0
  110. package/docs/.vuepress/public/super.png +0 -0
  111. package/docs/.vuepress/styles/index.styl +25 -0
  112. package/docs/.vuepress/styles/palette.styl +6 -0
  113. package/docs/README.md +14 -0
  114. package/docs/guide/button/base.md +31 -0
  115. package/docs/guide/commonConfig/jsx.md +166 -0
  116. package/docs/guide/commonConfig/presetCodeTemplate.md +68 -0
  117. package/docs/guide/commonConfig/renderType.md +181 -0
  118. package/docs/guide/crud/baseUse.md +120 -0
  119. package/docs/guide/crud/buttons.md +18 -0
  120. package/docs/guide/crud/config.md +217 -0
  121. package/docs/guide/crud/contextMenu.md +18 -0
  122. package/docs/guide/crud/dataSort.md +66 -0
  123. package/docs/guide/crud/genDynamicColumns.md +145 -0
  124. package/docs/guide/crud/handleBar.md +26 -0
  125. package/docs/guide/crud/renderType.md +4 -0
  126. package/docs/guide/crud/search.md +150 -0
  127. package/docs/guide/crud/selection.md +73 -0
  128. package/docs/guide/crud/span.md +98 -0
  129. package/docs/guide/crud/summary.md +167 -0
  130. package/docs/guide/crud/tableEdit.md +377 -0
  131. package/docs/guide/crud/validate.md +158 -0
  132. package/docs/guide/dialog/baseUse.md +81 -0
  133. package/docs/guide/dict/baseUse.md +174 -0
  134. package/docs/guide/dict/component.md +88 -0
  135. package/docs/guide/dict/config.md +44 -0
  136. package/docs/guide/form/baseUse.md +142 -0
  137. package/docs/guide/form/detail.md +38 -0
  138. package/docs/guide/formatData/baseUse.md +98 -0
  139. package/docs/guide/formatData/config.md +142 -0
  140. package/docs/guide/mockData/base.md +26 -0
  141. package/docs/guide/positionSlot/base.md +41 -0
  142. package/docs/guide/question/base.md +44 -0
  143. package/docs/guide/start/base.md +30 -0
  144. package/docs/guide/tabs/base.md +63 -0
  145. package/examples/App.vue +52 -0
  146. package/examples/Layout/components/AppMain.vue +40 -0
  147. package/examples/Layout/components/Item.vue +29 -0
  148. package/examples/Layout/components/Link.vue +44 -0
  149. package/examples/Layout/components/SidebarItem.vue +93 -0
  150. package/examples/Layout/index.vue +69 -0
  151. package/examples/assets/logo.png +0 -0
  152. package/examples/favicon.ico +0 -0
  153. package/examples/index.html +18 -0
  154. package/examples/main.js +54 -0
  155. package/examples/router/index.js +140 -0
  156. package/examples/store/index.js +0 -0
  157. package/examples/styles/index.scss +63 -0
  158. package/examples/styles/sidebar.scss +226 -0
  159. package/examples/styles/transition.scss +48 -0
  160. package/examples/styles/variables.scss +25 -0
  161. package/examples/views/crud/base.vue +68 -0
  162. package/examples/views/crud/handleRow.vue +84 -0
  163. package/examples/views/crud/search.vue +116 -0
  164. package/examples/views/dashboard/index.vue +244 -0
  165. package/examples/views/dashboard/index1.vue +234 -0
  166. package/examples/views/dashboard/test.vue +9 -0
  167. package/examples/views/formTest/index.vue +168 -0
  168. package/examples/views/nested/menu1/index.vue +7 -0
  169. package/examples/views/nested/menu1/menu1-1/index.vue +7 -0
  170. package/examples/views/nested/menu1/menu1-2/index.vue +7 -0
  171. package/examples/views/nested/menu1/menu1-2/menu1-2-1/index.vue +5 -0
  172. package/examples/views/nested/menu1/menu1-2/menu1-2-2/index.vue +5 -0
  173. package/examples/views/nested/menu1/menu1-3/index.vue +5 -0
  174. package/examples/views/nested/menu2/index.vue +5 -0
  175. package/gulpfile.js +84 -0
  176. package/lib/index.css +1 -0
  177. package/lib/super-crud.min.js +15 -0
  178. package/package.json +66 -0
  179. package/packages/button/index.vue +189 -0
  180. package/packages/core/components/comp.vue +223 -0
  181. package/packages/core/components/position.vue +135 -0
  182. package/packages/core/components/render.vue +460 -0
  183. package/packages/core/configManager.js +302 -0
  184. package/packages/core/create.js +8 -0
  185. package/packages/core/defaultRender.js +64 -0
  186. package/packages/core/dict/global.js +10 -0
  187. package/packages/core/dict/index.js +432 -0
  188. package/packages/core/dict/mixin.js +94 -0
  189. package/packages/core/event.js +60 -0
  190. package/packages/core/index.js +6 -0
  191. package/packages/core/init.js +122 -0
  192. package/packages/core/mock/genConfig.js +228 -0
  193. package/packages/core/mock/genData.js +422 -0
  194. package/packages/core/mock/index.js +4 -0
  195. package/packages/core/rules.js +111 -0
  196. package/packages/crud/column.vue +205 -0
  197. package/packages/crud/columnAction.vue +207 -0
  198. package/packages/crud/columnCell.vue +146 -0
  199. package/packages/crud/defaultColumn.vue +130 -0
  200. package/packages/crud/drawerColumn.vue +225 -0
  201. package/packages/crud/form.vue +69 -0
  202. package/packages/crud/index.vue +564 -0
  203. package/packages/crud/menuBar.vue +298 -0
  204. package/packages/crud/mixins/cacheHandler.js +36 -0
  205. package/packages/crud/mixins/calcColumnWidth.js +79 -0
  206. package/packages/crud/mixins/calcHeight.js +105 -0
  207. package/packages/crud/mixins/columnHandler.js +128 -0
  208. package/packages/crud/mixins/contextMenu.js +98 -0
  209. package/packages/crud/mixins/dataProcessor.js +202 -0
  210. package/packages/crud/mixins/dialog.js +109 -0
  211. package/packages/crud/mixins/excelHandler.js +150 -0
  212. package/packages/crud/mixins/exposeMethods.js +107 -0
  213. package/packages/crud/mixins/generateDynamicColumns.js +250 -0
  214. package/packages/crud/mixins/props.js +38 -0
  215. package/packages/crud/mixins/searchHandler.js +151 -0
  216. package/packages/crud/mixins/select.js +359 -0
  217. package/packages/crud/mixins/spanMethod.js +288 -0
  218. package/packages/crud/mixins/summary.js +177 -0
  219. package/packages/crud/mixins/tableEdit.js +547 -0
  220. package/packages/crud/mixins/validate.js +219 -0
  221. package/packages/crud/pagination.vue +110 -0
  222. package/packages/crud/search.vue +119 -0
  223. package/packages/crud/searchHeader.vue +231 -0
  224. package/packages/crud/selectBanner.vue +138 -0
  225. package/packages/crud/utils/EditState.js +319 -0
  226. package/packages/crud/utils/excelExport.js +112 -0
  227. package/packages/crud/utils/excelImport.js +112 -0
  228. package/packages/crud/utils/index.js +98 -0
  229. package/packages/dialog/dialog.js +233 -0
  230. package/packages/dialog/dialog.vue +15 -0
  231. package/packages/dialog/index.js +22 -0
  232. package/packages/dict/cascadeFormat.vue +179 -0
  233. package/packages/dict/dateFormat.vue +40 -0
  234. package/packages/dict/form/cascade.vue +61 -0
  235. package/packages/dict/form/checkbox.vue +90 -0
  236. package/packages/dict/form/extendMethod.js +22 -0
  237. package/packages/dict/form/input-base.js +31 -0
  238. package/packages/dict/form/input.js +20 -0
  239. package/packages/dict/form/radio.vue +69 -0
  240. package/packages/dict/form/select.vue +118 -0
  241. package/packages/dict/form/switch.vue +75 -0
  242. package/packages/dict/valueFormat.vue +188 -0
  243. package/packages/directive/dialog/drag.js +86 -0
  244. package/packages/directive/dialog/dragSize.js +42 -0
  245. package/packages/directive/index.js +9 -0
  246. package/packages/directive/insertSlot.js +10 -0
  247. package/packages/form/contextMenu.js +192 -0
  248. package/packages/form/draftDrawer.vue +391 -0
  249. package/packages/form/formAction.vue +97 -0
  250. package/packages/form/formItem.vue +259 -0
  251. package/packages/form/index.vue +451 -0
  252. package/packages/form/props.js +15 -0
  253. package/packages/grid/cell.vue +65 -0
  254. package/packages/grid/index.vue +130 -0
  255. package/packages/group/index.vue +96 -0
  256. package/packages/tabs/index.vue +290 -0
  257. package/packages/tooltip/index.js +9 -0
  258. package/packages/tooltip/tooltip.vue +32 -0
  259. package/packages/tooltip/tooltipComponent.js +38 -0
  260. package/packages/verifyInput/index.vue +131 -0
  261. package/src/config/common.js +88 -0
  262. package/src/config/crud.js +567 -0
  263. package/src/config/dialog.js +87 -0
  264. package/src/config/form.js +215 -0
  265. package/src/config/index.js +9 -0
  266. package/src/constants/index.js +72 -0
  267. package/src/index.js +67 -0
  268. package/src/template/btn/crud.js +6 -0
  269. package/src/template/btn/dialog.js +1 -0
  270. package/src/template/btn/form.js +3 -0
  271. package/src/template/btn/index.js +9 -0
  272. package/src/template/dicts.js +1 -0
  273. package/src/template/formatData.js +507 -0
  274. package/src/template/index.js +19 -0
  275. package/src/template/render.js +124 -0
  276. package/src/template/rules.js +53 -0
  277. package/src/utils/bem.js +49 -0
  278. package/src/utils/cache.js +77 -0
  279. package/src/utils/getType.js +34 -0
  280. package/src/utils/index.js +212 -0
  281. package/src/utils/mergeTemp.js +124 -0
  282. package/styles/button.scss +3 -0
  283. package/styles/crud.scss +425 -0
  284. package/styles/dialog.scss +95 -0
  285. package/styles/form.scss +532 -0
  286. package/styles/group.scss +78 -0
  287. package/styles/index.scss +94 -0
  288. package/styles/tabs.scss +139 -0
  289. package/styles/verifyInput.scss +56 -0
  290. package/vue-jsx-sync.js +90 -0
  291. package/vue.config.js +54 -0
@@ -0,0 +1,120 @@
1
+ # 基本使用
2
+
3
+ ## 基本使用
4
+
5
+ `@getList` 获取表格数据 </br>
6
+ `init` 初始化是否立即调用 getList(默认为 true) </br>
7
+
8
+ <ClientOnly>
9
+ <common-code-format>
10
+ <crud-baseUse-baseUse slot="source"></crud-baseUse-baseUse>
11
+
12
+ <<< @/docs/.vuepress/components/crud/baseUse/baseUse.vue
13
+ </common-code-format>
14
+ </ClientOnly>
15
+
16
+ ## 分页配置
17
+
18
+ 搜索表单对象中 `pageNum` 当前页码,`pageSize` 每页条数 </br>
19
+ `pagination` 分页配置(传递对象,具体参考 el-pagination)
20
+
21
+ <ClientOnly>
22
+ <common-code-format>
23
+ <crud-baseUse-pagination slot="source"></crud-baseUse-pagination>
24
+
25
+ <<< @/docs/.vuepress/components/crud/baseUse/pagination.vue
26
+ </common-code-format>
27
+ </ClientOnly>
28
+
29
+ ## 标题
30
+
31
+ `title` 表格标题 </br>
32
+
33
+ <ClientOnly>
34
+ <common-code-format>
35
+ <crud-baseUse-title slot="source"></crud-baseUse-title>
36
+
37
+ <<< @/docs/.vuepress/components/crud/baseUse/title.vue
38
+ </common-code-format>
39
+ </ClientOnly>
40
+
41
+ ## 操作栏
42
+
43
+ `handleRow` 操作栏 </br>
44
+
45
+ <ClientOnly>
46
+ <common-code-format>
47
+ <crud-baseUse-handleRow slot="source"></crud-baseUse-handleRow>
48
+
49
+ <<< @/docs/.vuepress/components/crud/baseUse/handleRow.vue
50
+ </common-code-format>
51
+ </ClientOnly>
52
+
53
+ ## 工具栏
54
+
55
+ `toolbar` 工具栏 </br>
56
+
57
+ <ClientOnly>
58
+ <common-code-format>
59
+ <crud-baseUse-toolbar slot="source"></crud-baseUse-toolbar>
60
+
61
+ <<< @/docs/.vuepress/components/crud/baseUse/toolbar.vue
62
+ </common-code-format>
63
+ </ClientOnly>
64
+
65
+ ## 表格操作列
66
+
67
+ `action` 操作列配置,值为`false`则隐藏 </br>
68
+ `action.width`、`action.minWidth` 设置为`auto`,会自适应列宽度 </br>
69
+
70
+ <ClientOnly>
71
+ <common-code-format>
72
+ <crud-baseUse-columnAction slot="source"></crud-baseUse-columnAction>
73
+
74
+ <<< @/docs/.vuepress/components/crud/baseUse/columnAction.vue
75
+ </common-code-format>
76
+ </ClientOnly>
77
+
78
+
79
+ ## 表格高度与嵌套表头
80
+
81
+ `height`、`maxHeight` 设置为`auto`,会自适应窗口高度,配合calcHeight 自定义调节范围 </br>
82
+ `calcHeight` 减去的底部高度 </br>
83
+ `children` 多级嵌套表头
84
+
85
+ <ClientOnly>
86
+ <common-code-format>
87
+ <crud-baseUse-height slot="source"></crud-baseUse-height>
88
+
89
+ <<< @/docs/.vuepress/components/crud/baseUse/height.vue
90
+ </common-code-format>
91
+ </ClientOnly>
92
+
93
+ ## 索引列、展开列
94
+
95
+ `index` 索引列,值为对象时自定义属性 </br>
96
+ `expand` 展开列
97
+
98
+ <ClientOnly>
99
+ <common-code-format>
100
+ <crud-baseUse-index slot="source"></crud-baseUse-index>
101
+
102
+ <<< @/docs/.vuepress/components/crud/baseUse/index.vue
103
+ </common-code-format>
104
+ </ClientOnly>
105
+
106
+ ## 组件加载
107
+
108
+ `loading` 外部控制加载状态,支持`.sync`双向绑定</br>
109
+ `disableLoading` 禁用组件内部控制加载状态 </br>
110
+ `loadingText` 自定义加载文本 </br>
111
+ `loadingSpinner` 自定义加载图标 </br>
112
+ `loadingBackground` 自定义加载背景颜色
113
+
114
+ <ClientOnly>
115
+ <common-code-format>
116
+ <crud-baseUse-loading slot="source"></crud-baseUse-loading>
117
+
118
+ <<< @/docs/.vuepress/components/crud/baseUse/loading.vue
119
+ </common-code-format>
120
+ </ClientOnly>
@@ -0,0 +1,18 @@
1
+ # 按钮配置
2
+
3
+ # 通用配置
4
+
5
+ 按钮配置对象接收`el-button`属性, 详情参考[element-ui](https://element.eleme.cn/#/zh-CN/component/button)</br>
6
+ `button.handles` 添加自定义按钮 </br>
7
+ `button.hidden` 自定义按钮隐藏, 可接收函数, 在操作列`action`按钮中使用可获取行数据 </br>
8
+ `button.children` 为折叠按钮,可配置多个子按钮 </br>
9
+
10
+ `controlButton` 控制所有按钮,返回所需的按钮组 </br>
11
+
12
+ <ClientOnly>
13
+ <common-code-format>
14
+ <crud-buttons-common slot="source"></crud-buttons-common>
15
+
16
+ <<< @/docs/.vuepress/components/crud/buttons/common.vue
17
+ </common-code-format>
18
+ </ClientOnly>
@@ -0,0 +1,217 @@
1
+
2
+ # 配置文档
3
+
4
+ ## 基础配置项
5
+
6
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
7
+ | :------------ | :--------------------------------------------------------------- | :--------------- | :----------------- | :------------------------- |
8
+ | data.sync | 表格数据绑定值 | Array | — | — |
9
+ | search.sync | 搜索表单绑定值 | Object | — | {pageNum: 1, pageSize: 10} |
10
+ | loading.sync | 加载绑定值 | Boolean | — | — |
11
+ | options | 表格全部配置 | Object | — | — |
12
+ | title | 表格标题 | String | - | - |
13
+ | size | 表格尺寸 | String | small/medium/large | small |
14
+ | disabled | 是否禁用 | Boolean | true/false | false |
15
+ | init | 是否开启初始化,配合 `getList` 使用 | Boolean | true/false | false |
16
+ | height | 表格高度, 配置`auto` 自动计算高度 | String | auto/- | - |
17
+ | calcHeight | 自动计算高度的偏差值 | Number | - | 0 |
18
+ | gap | 表格外间距 | Number/String | - | 20 |
19
+ | uniqueId | 是否本地生成唯一标识 | Boolean | true/false | false |
20
+ | valueKey | 唯一值的Key | String | - | "id" |
21
+ | handleRow | [操作行配置](/guide/crud/config.html#handlerow-操作行配置) | Object | - | {} |
22
+ | action | [操作列配置](/guide/crud/config.html#action-操作列配置) | Object | - | {} |
23
+ | toolbar | [工具栏配置](/guide/crud/config.html#toolbar-工具栏配置) | Object | - | {} |
24
+ | pagination | [分页配置](/guide/crud/config.html#pagination-分页配置) | Object | - | {} |
25
+ | empty | [空状态配置](/guide/crud/config.html#empty-空状态配置) | Object | - | {} |
26
+ | contextMenu | [右键菜单配置](/guide/crud/config.html#contextmenu-右键菜单配置) | Object | - | {} |
27
+ | renderColumns | [表格列配置](/guide/crud/config.html#rendercolumns-列渲染配置) | Array / Function | []/()=>[] | - |
28
+ | props | [字段名配置](/guide/crud/config.html#props-数据属性配置) | Object | - | {} |
29
+
30
+
31
+ ## 按钮控制配置
32
+
33
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
34
+ | :------------- | :----------------------- | :------ | :--------- | :----- |
35
+ | footerAddBtn | 表格底部,追加行新增按钮 | Boolean | true/false | false |
36
+ | rowAddType | 行新增类型 | String | first/last | first |
37
+ | rowAddBtn | 是否显示行新增按钮 | Boolean | true/false | false |
38
+ | deleteBtn | 是否显示删除按钮 | Boolean | true/false | false |
39
+ | batchDeleteBtn | 是否显示批量删除按钮 | Boolean | true/false | false |
40
+ | addBtn | 是否显示弹窗新增按钮 | Boolean | true/false | false |
41
+ | editBtn | 是否显示弹窗编辑按钮 | Boolean | true/false | false |
42
+ | viewBtn | 是否显示弹窗查看按钮 | Boolean | true/false | false |
43
+
44
+
45
+ ## 编辑模式配置
46
+
47
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
48
+ | :-------------------- | :------------------- | :------------- | :--------- | :----- |
49
+ | freeEdit | 是否开启自由编辑 | Boolean | true/false | false |
50
+ | rowEdit | 是否开启行编辑 | Boolean/Object | - | false |
51
+ | cellEdit | 是否开启单元格编辑 | Boolean/Object | - | false |
52
+ | batchEdit | 是否开启批量编辑 | Boolean/Object | - | false |
53
+ | batchRowEdit | 是否开启批量行编辑 | Boolean/Object | - | false |
54
+ | isRowEdit | 控制行编辑状态的函数 | Function | - | - |
55
+ | editOpacity | 是否开启编辑透明主题 | Boolean | true/false | true |
56
+ | refreshAfterOperation | 操作后是否刷新表格 | Boolean | true/false | true |
57
+
58
+ ## 表单配置
59
+
60
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
61
+ | :---------- | :----------- | :----- | :----- | :----------------- |
62
+ | addForm | 新增表单配置 | Object | - | {} |
63
+ | editForm | 编辑表单配置 | Object | - | {} |
64
+ | viewForm | 查看表单配置 | Object | - | {viewType: "form"} |
65
+ | formOptions | 通用表单配置 | Object | - | {} |
66
+ | dialog | 弹窗配置 | Object | - | {} |
67
+
68
+ ## 搜索配置
69
+
70
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
71
+ | :----------- | :--------------- | :------------- | :--------- | :--------------------------- |
72
+ | searchForm | 搜索表单配置 | Boolean/Object | - | {initShow: false} |
73
+ | searchHeader | 搜索表头配置 | Boolean/Object | - | {width: 290, resetBtn: true} |
74
+ | showPopper | 搜索弹窗是否打开 | Boolean | true/false | false |
75
+
76
+ ## 特殊列配置
77
+
78
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
79
+ | :-------- | :--------- | :------------- | :----- | :------------------------------------------ |
80
+ | selection | 选择列配置 | Boolean/Object | - | {width: 50, align: "center"} |
81
+ | index | 序号列配置 | Boolean/Object | - | {label: "序号", width: 50, align: "center"} |
82
+ | expand | 展开列配置 | Boolean/Object | - | {width: 50, align: "center"} |
83
+
84
+ ## handleRow 操作行配置
85
+
86
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
87
+ | :---------- | :--------------- | :------------- | :--------- | :----- |
88
+ | show | 是否显示 | Boolean | true/false | - |
89
+ | add | 弹窗新增按钮 | Boolean/Object | - | {} |
90
+ | rowAdd | 行新增按钮 | Boolean/Object | - | {} |
91
+ | batchDelete | 批量删除按钮配置 | Boolean/Object | - | {} |
92
+ | handles | 自定义按钮列表 | Array | - | [] |
93
+
94
+ ## action 操作列配置
95
+
96
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
97
+ | :----------- | :------------- | :------ | :---------------- | :------- |
98
+ | show | 是否显示 | Boolean | true/false | - |
99
+ | prop | 列属性名 | String | - | "action" |
100
+ | width | 列宽度 | String | auto/- | "auto" |
101
+ | label | 列标题 | String | - | "操作" |
102
+ | align | 对齐方式 | String | left/center/right | "center" |
103
+ | calcWidth | 宽度计算偏差 | Number | - | 20 |
104
+ | defaultWidth | 默认宽度 | Number | - | 50 |
105
+ | handles | 自定义按钮列表 | Array | - | [] |
106
+ | delete | 删除按钮配置 | Object | - | {} |
107
+ | view | 查看按钮配置 | Object | - | {} |
108
+ | edit | 编辑按钮配置 | Object | - | {} |
109
+ | rowEdit | 行编辑按钮配置 | Object | - | {} |
110
+ | handles | 自定义按钮列表 | Array | - | [] |
111
+
112
+ ## toolbar 工具栏配置
113
+
114
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
115
+ | :-------- | :--------------- | :------ | :--------- | :----- |
116
+ | show | 是否显示 | Boolean | true/false | - |
117
+ | handles | 自定义按钮列表 | Array | - | [] |
118
+ | batchEdit | 批量编辑按钮配置 | Object | - | {} |
119
+ | zoom | 缩放按钮配置 | Object | - | {} |
120
+ | search | 搜索按钮配置 | Object | - | {} |
121
+ | refresh | 刷新按钮配置 | Object | - | {} |
122
+ | reset | 重置按钮配置 | Object | - | {} |
123
+ | column | 列设置按钮配置 | Object | - | {} |
124
+ | handles | 自定义按钮列表 | Array | - | [] |
125
+
126
+ ## pagination 分页配置
127
+
128
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
129
+ | :--------- | :--------------------------- | :------ | :---------------- | :---------------------------------------- |
130
+ | align | 对齐方式 | String | left/center/right | "right" |
131
+ | pageSizes | 每页显示个数选择器的选项设置 | Array | - | [10, 20, 30, 50, 100, 200] |
132
+ | layout | 组件布局 | String | - | "total, sizes, prev, pager, next, jumper" |
133
+ | background | 是否为分页按钮添加背景色 | Boolean | true/false | true |
134
+ | pagerCount | 页码按钮的数量 | Number | - | 5 |
135
+
136
+ ## empty 空状态配置
137
+
138
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
139
+ | :----- | :------- | :----- | :----- | :--------- |
140
+ | image | 图片地址 | String | - | "" |
141
+ | size | 图片大小 | Number | - | 100 |
142
+ | text | 显示文本 | String | - | "暂无数据" |
143
+
144
+ ## contextMenu 右键菜单配置
145
+
146
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
147
+ | :-------- | :--------------- | :------ | :--------- | :----- |
148
+ | copy | 是否启用复制功能 | Boolean | true/false | true |
149
+ | quickEdit | 是否启用快速编辑 | Boolean | true/false | true |
150
+ | actionBtn | 是否显示操作按钮 | Boolean | true/false | true |
151
+ | handles | 自定义菜单项 | Array | - | [] |
152
+
153
+ ## renderColumns 列渲染配置
154
+
155
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
156
+ | :----------- | :------------- | :--------------- | :---------------- | :----- |
157
+ | hiddenList | 是否只隐藏列表 | Boolean | true/false | - |
158
+ | children | 嵌套列子列 | Array | - | - |
159
+ | sameRowSpan | 是否合并单元格 | Boolean/String | true/false/[prop] | - |
160
+ | spanMethod | 合并单元格方法 | Function | - | - |
161
+ | isEdit | 是否允许编辑 | Boolean/Function | - | - |
162
+ | summary | 汇总方式 | String/Function | sum/avg/max/min | - |
163
+ | add | 新增时的配置 | Object | - | {} |
164
+ | edit | 编辑时的配置 | Object | - | {} |
165
+ | view | 查看时的配置 | Object | - | {} |
166
+ | form | 通用表单配置 | Object | - | {} |
167
+ | search | 搜索配置 | Object | - | {} |
168
+ | searchHeader | 搜索表头配置 | Object | - | {} |
169
+
170
+ ## props 字段名配置
171
+
172
+ | 属性名 | 说明 | 类型 | 可选值 | 默认值 |
173
+ | :------- | :------------- | :----- | :----- | :--------- |
174
+ | pageNum | 页码字段名 | String | - | "pageNum" |
175
+ | pageSize | 每页数量字段名 | String | - | "pageSize" |
176
+
177
+ ## 插槽
178
+
179
+ | 名称 | 说明 |
180
+ | :------------------ | :------------------- |
181
+ | [prop] | 列渲染 |
182
+ | [prop]-header | 列渲染表头 |
183
+ | [prop]-form | 列渲染表单状态 |
184
+ | [prop]-view | 列渲染查看状态 |
185
+ | [prop]-edit | 列渲染编辑状态 |
186
+ | [prop]-add | 列渲染新增状态 |
187
+ | [prop]-search | 列渲染搜索状态 |
188
+ | [prop]-searchHeader | 列渲染搜索表头状态 |
189
+ | empty | 空状态 |
190
+ | title | 标题(覆盖原有内容) |
191
+ | title-left | 标题左侧 |
192
+ | title-right | 标题右侧 |
193
+ | title-top | 标题顶部 |
194
+ | title-bottom | 标题底部 |
195
+ | handleRow | 操作行(覆盖原有内容) |
196
+ | handleRow-left | 操作行左侧 |
197
+ | handleRow-right | 操作行右侧 |
198
+ | handleRow-top | 操作行顶部 |
199
+ | handleRow-bottom | 操作行底部 |
200
+ | toolbar | 工具栏(覆盖原有内容) |
201
+ | toolbar-left | 工具栏左侧 |
202
+ | toolbar-right | 工具栏右侧 |
203
+ | toolbar-top | 工具栏顶部 |
204
+ | toolbar-bottom | 工具栏底部 |
205
+ | pagination | 分页(覆盖原有内容) |
206
+ | pagination-left | 分页左侧 |
207
+ | pagination-right | 分页右侧 |
208
+ | pagination-top | 分页顶部 |
209
+ | pagination-bottom | 分页底部 |
210
+
211
+
212
+ <style>
213
+ table {
214
+ width: 100% !important;
215
+ display: table;
216
+ }
217
+ </style>
@@ -0,0 +1,18 @@
1
+ # 右键菜单
2
+
3
+ :::tip
4
+
5
+ 需要安装 vue-contextmenujs
6
+
7
+ :::
8
+
9
+ `contextMenu.actionBtn` 继承操作列 `action` 上的所有按钮</br>
10
+ `contextMenu.handles` 自定义右键菜单
11
+
12
+ <ClientOnly>
13
+ <common-code-format>
14
+ <crud-contextMenu-base slot="source"></crud-contextMenu-base>
15
+
16
+ <<< @/docs/.vuepress/components/crud/contextMenu/base.vue
17
+ </common-code-format>
18
+ </ClientOnly>
@@ -0,0 +1,66 @@
1
+ # 多层级数据排序
2
+
3
+ 表格支持按照多个字段进行层级排序,即在上一层级排序的基础上,对相同值的数据进行下一层级的排序。常用于具有明确层级关系的数据展示,如省市区地址、组织架构等。
4
+
5
+ ## 基础用法
6
+
7
+ 通过配置 `sortProps` 数组来指定排序字段及其优先级。数组中的字段顺序决定了排序的优先级。
8
+
9
+ <ClientOnly>
10
+ <common-code-format>
11
+ <crud-dataSort-base slot="source"></crud-dataSort-base>
12
+
13
+ <<< @/docs/.vuepress/components/crud/dataSort/base.vue
14
+ </common-code-format>
15
+ </ClientOnly>
16
+
17
+ ## 高级排序配置
18
+
19
+ 对象数组:为每个字段指定详细的排序规则
20
+
21
+ ```js
22
+ options: {
23
+ sortProps: [
24
+ "province",
25
+ { prop: "city", order: "desc", nullsPosition: "first" },
26
+ "amount",
27
+ ],
28
+ },
29
+ ```
30
+
31
+ ## 自定义排序规则
32
+
33
+ 通过配置 `sortMethod` 来自定义排序逻辑。
34
+
35
+ ```js
36
+ options: {
37
+ sortProps: [
38
+ "province",
39
+ "city",
40
+ { prop: "amount", sortMethod: (a, b) => b.amount - a.amount },
41
+ ],
42
+ },
43
+ ```
44
+
45
+ ## API
46
+
47
+ ### Options 配置
48
+
49
+ | 参数 | 说明 | 类型 | 默认值 |
50
+ | --------- | -------------------------- | -------- | ------ |
51
+ | sortProps | 排序字段数组(按优先级排序) | string[] | [] |
52
+
53
+ ### 排序参数
54
+
55
+ | 参数 | 说明 | 类型 | 默认值 |
56
+ | ------------- | -------------- | ---------------- | ------ |
57
+ | prop | 排序字段名称 | string | - |
58
+ | order | 排序方向 | 'asc' / 'desc' | 'asc' |
59
+ | nullsPosition | 空值位置 | 'first' / 'last' | 'last' |
60
+ | sortMethod | 自定义排序方法 | Function(a, b) | - |
61
+
62
+ ### Methods 方法
63
+
64
+ | 方法名 | 说明 | 参数 | 返回值 |
65
+ | ---------- | ----------------------------------------------- | ------------- | ------ |
66
+ | sortedData | 排序方法,默认使用 sortProps 配置并排序所有数据 | (data, props) | - |
@@ -0,0 +1,145 @@
1
+ # 动态列
2
+
3
+ 通过 `dynamicConfig` 配置可以快速生成多层级的动态列,常用于通过树级数据生成多层级列。
4
+
5
+ ## 单层级动态列
6
+
7
+ `path` 设置树级数据路径,`prop` 设置树级数据唯一标识。
8
+
9
+ <ClientOnly></ClientOnly>
10
+ <common-code-format>
11
+ <crud-genDynamicColumns-base slot="source"></crud-genDynamicColumns-base>
12
+
13
+ <<< @/docs/.vuepress/components/crud/genDynamicColumns/base.vue
14
+ </common-code-format>
15
+ </ClientOnly>
16
+
17
+ ## 多层级动态列
18
+
19
+ 通过 `columnConfig` 可以设置列渲染配置,可以获取树级路径 `path` 和树级数据 `source` 。
20
+
21
+ <ClientOnly>
22
+ <common-code-format>
23
+ <crud-genDynamicColumns-treeDynamic slot="source"></crud-genDynamicColumns-treeDynamic>
24
+
25
+ <<< @/docs/.vuepress/components/crud/genDynamicColumns/treeDynamic.vue
26
+ </common-code-format>
27
+ </ClientOnly>
28
+
29
+ ## 多层级动态列和固定子列
30
+
31
+ 通过 `source[row.$index]` 可以获取到当前行的层级数据。 </br>
32
+ 支持响应式修改数据。
33
+
34
+ <ClientOnly>
35
+ <common-code-format>
36
+ <crud-genDynamicColumns-dynamicAndFixed slot="source"></crud-genDynamicColumns-dynamicAndFixed>
37
+
38
+ <<< @/docs/.vuepress/components/crud/genDynamicColumns/dynamicAndFixed.vue
39
+ </common-code-format>
40
+ </ClientOnly>
41
+
42
+ ## 数据格式与转换
43
+
44
+ ```js
45
+ // 数据结构为:
46
+ const data = [
47
+ {
48
+ materialCode: `M001`,
49
+ materialName: `产品1`,
50
+ materialSpec: `规格 1`,
51
+ quantityGradeName: "A",
52
+ firstChildren: [
53
+ // 第一层级
54
+ {
55
+ id: "S001", // 第一层级唯一标识
56
+ name: "供应商1", // 第一层级名称
57
+ secondChildren: [
58
+ // 第二层级
59
+ {
60
+ sort: 1, // 第二层级唯一标识
61
+ productUnitPrice: 100,
62
+ priceFollow: "Y",
63
+ priceDifference: -10,
64
+ pricePercentageChange: 0.1,
65
+ },
66
+ {
67
+ sort: 2,
68
+ productUnitPrice: 90,
69
+ priceFollow: "N",
70
+ priceDifference: 5,
71
+ pricePercentageChange: 0.05,
72
+ },
73
+ ],
74
+ },
75
+ ],
76
+ },
77
+ ];
78
+
79
+ // 转换后的数据结构为:
80
+
81
+ const data = [
82
+ {
83
+ materialCode: `M001`,
84
+ materialName: `产品1`,
85
+ materialSpec: `规格 1`,
86
+ quantityGradeName: "A",
87
+ S001: { // 第一层级唯一标识
88
+ id: "S001",
89
+ name: "供应商1",
90
+ 1: { // 第二层级唯一标识
91
+ sort: 1,
92
+ productUnitPrice: 100,
93
+ priceFollow: "Y",
94
+ priceDifference: -10,
95
+ pricePercentageChange: 0.1,
96
+ },
97
+ 2: {
98
+ sort: 2,
99
+ productUnitPrice: 90,
100
+ priceFollow: "N",
101
+ priceDifference: 5,
102
+ pricePercentageChange: 0.05,
103
+ },
104
+ },
105
+ firstChildren: [ // 原来的数据依旧保留
106
+ {
107
+ id: "S001",
108
+ name: "供应商1",
109
+ secondChildren: [
110
+ {
111
+ sort: 1,
112
+ productUnitPrice: 100,
113
+ priceFollow: "Y",
114
+ priceDifference: -10,
115
+ pricePercentageChange: 0.1,
116
+ },
117
+ {
118
+ sort: 2,
119
+ productUnitPrice: 90,
120
+ priceFollow: "N",
121
+ priceDifference: 5,
122
+ pricePercentageChange: 0.05,
123
+ },
124
+ ],
125
+ },
126
+ ],
127
+ },
128
+ ];
129
+ ```
130
+
131
+ ## options 配置项
132
+
133
+ | 参数 | 说明 | 类型 | 默认值 |
134
+ | --------------------- | ------------------------------------------------------- | ------ | ------ |
135
+ | dynamicInsertPosition | 动态列插入位置,可接收普通列的 prop 值,或者 index 索引 | String | - |
136
+ | dynamicConfig | 动态列配置数组 | Array | - |
137
+
138
+ ## dynamicConfig 配置项
139
+
140
+ | 参数 | 说明 | 类型 | 默认值 |
141
+ | ------------ | -------------------- | --------------------- | ------ |
142
+ | path | 当前层级数据路径 | String | - |
143
+ | prop | 当前层级唯一标识 | String | - |
144
+ | label | 当前层级标题字段 | String/Function(item) | - |
145
+ | columnConfig | 设置真正的渲染列配置 | Function(path, item) | - |
@@ -0,0 +1,26 @@
1
+ # 操作栏
2
+
3
+ ## 左操作栏
4
+ `handleRow` 操作行不默认展示按钮 </br>
5
+ `#handleRow` `#handleRow-left` 插槽
6
+
7
+ <ClientOnly>
8
+ <common-code-format>
9
+ <crud-handleBar-handleRow slot="source"></crud-handleBar-handleRow>
10
+
11
+ <<< @/docs/.vuepress/components/crud/handleBar/handleRow.vue
12
+ </common-code-format>
13
+ </ClientOnly>
14
+
15
+ ## 右工具栏
16
+ `toolbar` 工具栏默认展示全部 </br>
17
+ `#toolbar` `#toolbar-left` 插槽
18
+
19
+ <ClientOnly>
20
+ <common-code-format>
21
+ <crud-handleBar-toolbar slot="source"></crud-handleBar-toolbar>
22
+
23
+ <<< @/docs/.vuepress/components/crud/handleBar/toolbar.vue
24
+ </common-code-format>
25
+ </ClientOnly>
26
+
@@ -0,0 +1,4 @@
1
+
2
+ # 自定义表格内容
3
+
4
+ 详情参考[通用配置-自定义组件内容](/guide/commonConfig/renderType.html#基本使用)