@bit-sun/business-component 2.2.16 → 2.2.18

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 (177) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +54 -7
  9. package/dist/index.js +54 -7
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +77 -77
  18. package/src/assets/32.svg +27 -27
  19. package/src/assets/addIcon.svg +17 -17
  20. package/src/assets/allfunc.svg +27 -27
  21. package/src/assets/arrowRight.svg +24 -24
  22. package/src/assets/btn-delete.svg +29 -29
  23. package/src/assets/btn-edit.svg +19 -19
  24. package/src/assets/btn-more.svg +17 -17
  25. package/src/assets/btn-submit.svg +19 -19
  26. package/src/assets/caidan.svg +11 -11
  27. package/src/assets/close.svg +26 -26
  28. package/src/assets/drag.svg +17 -17
  29. package/src/assets/exportFail.svg +37 -37
  30. package/src/assets/exportProcessing.svg +28 -28
  31. package/src/assets/exportSuccess.svg +34 -34
  32. package/src/assets/fixed-left-active.svg +11 -11
  33. package/src/assets/fixed-left.svg +15 -15
  34. package/src/assets/fixed-right-active.svg +11 -11
  35. package/src/assets/fixed-right.svg +15 -15
  36. package/src/assets/guanbi.svg +15 -15
  37. package/src/assets/icon-quanping.svg +15 -15
  38. package/src/assets/icon-shezhi.svg +17 -17
  39. package/src/assets/label_icon_bottom.svg +25 -25
  40. package/src/assets/list-no-img.svg +21 -21
  41. package/src/assets/morentouxiang-32.svg +23 -23
  42. package/src/assets/scanning.svg +24 -24
  43. package/src/assets/upExport.svg +22 -22
  44. package/src/components/Business/AddSelectBusiness/index.md +129 -129
  45. package/src/components/Business/AddSelectBusiness/index.tsx +835 -835
  46. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  47. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  48. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  49. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  50. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  58. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  59. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  60. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  61. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  62. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  63. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  64. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  65. package/src/components/Business/BsLayouts/index.less +79 -79
  66. package/src/components/Business/BsLayouts/index.tsx +1479 -1479
  67. package/src/components/Business/BsLayouts/service.ts +10 -10
  68. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  69. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +538 -538
  70. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  71. package/src/components/Business/BsSulaQueryTable/index.tsx +527 -527
  72. package/src/components/Business/BsSulaQueryTable/setting.tsx +802 -802
  73. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  74. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -688
  75. package/src/components/Business/CommodityEntry/index.md +70 -70
  76. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  77. package/src/components/Business/CommonAlert/index.tsx +23 -23
  78. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  79. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  80. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  81. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  82. package/src/components/Business/DetailPageWrapper/index.tsx +313 -313
  83. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  84. package/src/components/Business/HomePageWrapper/index.less +33 -33
  85. package/src/components/Business/HomePageWrapper/index.md +45 -45
  86. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  87. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  88. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +201 -201
  89. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  90. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  91. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  92. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  93. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  94. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  95. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  96. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  97. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  98. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  99. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  100. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  101. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  102. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  103. package/src/components/Business/JsonQueryTable/index.less +16 -16
  104. package/src/components/Business/JsonQueryTable/index.md +328 -328
  105. package/src/components/Business/JsonQueryTable/index.tsx +320 -320
  106. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  107. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  108. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  109. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  110. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  111. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  112. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  113. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  114. package/src/components/Business/JsonQueryTable/static.ts +356 -356
  115. package/src/components/Business/SearchSelect/BusinessUtils.ts +1723 -1723
  116. package/src/components/Business/SearchSelect/common.ts +53 -53
  117. package/src/components/Business/SearchSelect/index.md +1310 -1310
  118. package/src/components/Business/SearchSelect/index.tsx +51 -51
  119. package/src/components/Business/SearchSelect/utils.ts +100 -100
  120. package/src/components/Business/StateFlow/index.less +130 -130
  121. package/src/components/Business/StateFlow/index.md +60 -60
  122. package/src/components/Business/StateFlow/index.tsx +29 -29
  123. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  124. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  125. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  126. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
  127. package/src/components/Business/columnSettingTable/index.less +247 -247
  128. package/src/components/Business/columnSettingTable/index.md +357 -357
  129. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  130. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  131. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  132. package/src/components/Business/moreTreeTable/index.less +99 -99
  133. package/src/components/Business/moreTreeTable/index.md +448 -508
  134. package/src/components/Business/moreTreeTable/index.tsx +361 -315
  135. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  136. package/src/components/Functional/AddSelect/index.less +367 -367
  137. package/src/components/Functional/AddSelect/index.md +155 -155
  138. package/src/components/Functional/AddSelect/index.tsx +1203 -1203
  139. package/src/components/Functional/BillEntry/index.less +371 -371
  140. package/src/components/Functional/BillEntry/index.md +39 -39
  141. package/src/components/Functional/BillEntry/index.tsx +766 -766
  142. package/src/components/Functional/DataImport/index.less +63 -63
  143. package/src/components/Functional/DataImport/index.md +44 -44
  144. package/src/components/Functional/DataImport/index.tsx +695 -695
  145. package/src/components/Functional/DataValidation/index.less +63 -63
  146. package/src/components/Functional/DataValidation/index.md +39 -39
  147. package/src/components/Functional/DataValidation/index.tsx +687 -687
  148. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  149. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  150. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  151. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  152. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  153. package/src/components/Functional/SearchSelect/index.less +115 -115
  154. package/src/components/Functional/SearchSelect/index.md +141 -141
  155. package/src/components/Functional/SearchSelect/index.tsx +813 -813
  156. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  157. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  158. package/src/components/Functional/TreeSearchSelect/index.tsx +160 -160
  159. package/src/index.ts +34 -34
  160. package/src/plugin/TableColumnSetting/index.less +247 -247
  161. package/src/plugin/TableColumnSetting/index.md +50 -50
  162. package/src/plugin/TableColumnSetting/index.tsx +724 -724
  163. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  164. package/src/styles/bsDefault.less +1912 -1912
  165. package/src/utils/CheckOneUser/index.md +39 -39
  166. package/src/utils/CheckOneUser/index.ts +51 -51
  167. package/src/utils/LocalstorageUtils.ts +90 -90
  168. package/src/utils/TableUtils.tsx +18 -18
  169. package/src/utils/checkUtils.ts +39 -39
  170. package/src/utils/enumConfig.ts +11 -11
  171. package/src/utils/getFormMode.js +12 -12
  172. package/src/utils/index.ts +3 -3
  173. package/src/utils/requestUtils.ts +34 -34
  174. package/src/utils/serialize.js +7 -7
  175. package/src/utils/utils.ts +183 -183
  176. package/tsconfig.json +29 -29
  177. package/typings.d.ts +4 -4
@@ -1,508 +1,448 @@
1
- ---
2
- nav:
3
- title: '组件'
4
- order: 1
5
- group:
6
- title: 业务组件
7
- order: 1
8
- title: 多表头表格
9
- order: 1
10
- ---
11
-
12
- # MoreTreeTable
13
-
14
-
15
- ## 纵向表头表格
16
-
17
- ```tsx
18
- import { MoreTreeTable } from '../../../index.ts';
19
- import React, { useState, useRef } from 'react';
20
-
21
- export default () => {
22
- const colTableRef = useRef(null);
23
- const data = {
24
- colHead: [
25
- {
26
- key: 'fixed1',
27
- title: '固定列1',
28
- fixed: true,
29
- },
30
- {
31
- key: 'fixed2',
32
- title: '固定列2',
33
- fixed: true,
34
- },
35
- {
36
- key: '1111',
37
- title: '测试1',
38
- children: [
39
- {
40
- key: '1111-1',
41
- title: '测试1-1',
42
- children: [
43
- {
44
- key: '1111-1-2',
45
- title: '测试1-1-2',
46
- },
47
- {
48
- key: '1111-1-3',
49
- title: '测试1-1-4',
50
- },
51
- ],
52
- },
53
- {
54
- key: '1111-2',
55
- title: '测试1-2',
56
- children: [
57
- {
58
- key: '1111-2-2',
59
- title: '测试1-2-2',
60
- },
61
- {
62
- key: '1111-2-3',
63
- title: '测试1-2-4',
64
- },
65
- ],
66
- },
67
- {
68
- key: '1111-3',
69
- title: '测试1-3',
70
- children: [
71
- {
72
- key: '1111-3-2',
73
- title: '测试1-3-2',
74
- },
75
- {
76
- key: '1111-3-3',
77
- title: '测试1-3-4',
78
- },
79
- ],
80
- },
81
- {
82
- key: '1111-4',
83
- title: '测试1-4',
84
- },
85
- ],
86
- },
87
- {
88
- key: '2222',
89
- title: '测试1',
90
- children: [
91
- {
92
- key: '2222-1',
93
- title: '测试1-1',
94
- children: [
95
- {
96
- key: '2222-1-2',
97
- title: '测试1-1-2',
98
- },
99
- {
100
- key: '2222-1-3',
101
- title: '测试1-1-4',
102
- },
103
- ],
104
- },
105
- {
106
- key: '2222-2',
107
- title: '测试1-2',
108
- children: [
109
- {
110
- key: '2222-2-2',
111
- title: '测试1-2-2',
112
- },
113
- {
114
- key: '2222-2-3',
115
- title: '测试1-2-4',
116
- children: [
117
- {
118
- key: '2222-2-3-1',
119
- title: '测试1-2-2',
120
- },
121
- {
122
- key: '2222-2-3-2',
123
- title: '测试1-2-2',
124
- },
125
- ],
126
- },
127
- ],
128
- },
129
- {
130
- key: '2222-3',
131
- title: '测试1-3',
132
- children: [
133
- {
134
- key: '2222-3-2',
135
- title: '测试1-3-2',
136
- },
137
- {
138
- key: '2222-3-3',
139
- title: '测试1-3-4',
140
- },
141
- ],
142
- },
143
- {
144
- key: '2222-4',
145
- title: '测试1-4',
146
- },
147
- ],
148
- },
149
- ],
150
- //纵向表头数据
151
- tableValue2: [
152
- {
153
- '1111-1-2': '1',
154
- '1111-1-3': '2',
155
- '1111-2-2': '3',
156
- '1111-2-3': '4',
157
- '1111-3-2': '5',
158
- '2222-3-3': '6',
159
- '2222-4': '7',
160
- 'fixed1': '标题1',
161
- 'fixed2': '标题1-1',
162
- },
163
- {
164
- '1111-1-2': '1',
165
- '1111-1-3': '2',
166
- '1111-2-2': '3',
167
- '1111-2-3': '4',
168
- '1111-3-2': '5',
169
- '2222-3-3': '6',
170
- '2222-4': '7',
171
- 'fixed1': '标题1',
172
- 'fixed2': '标题1-2',
173
- },
174
- {
175
- '1111-1-2': '1',
176
- '1111-1-3': '2',
177
- '1111-2-2': '3',
178
- '1111-2-3': '4',
179
- '1111-3-2': '5',
180
- '2222-3-3': '6',
181
- '2222-4': '7',
182
- 'fixed1': '标题1',
183
- 'fixed2': '标题1-3',
184
- },
185
- {
186
- '1111-1-2': '1',
187
- '1111-1-3': '2',
188
- '1111-2-2': '3',
189
- '1111-2-3': '4',
190
- '1111-3-2': '5',
191
- '2222-3-3': '6',
192
- '2222-4': '7',
193
- 'fixed1': '标题1',
194
- 'fixed2': '标题1-4',
195
- },
196
- {
197
- '1111-1-2': '1',
198
- '1111-1-3': '2',
199
- '1111-2-2': '3',
200
- '1111-2-3': '4',
201
- '1111-3-2': '5',
202
- '2222-3-3': '6',
203
- '2222-4': '7',
204
- 'fixed1': '标题1',
205
- 'fixed2': '标题1-5',
206
- },
207
- {
208
- 'fixed1': '标题2',
209
- 'fixed2': '标题2-1',
210
- },
211
- {
212
- 'fixed1': '标题2',
213
- 'fixed2': '标题2-2',
214
- },
215
- {
216
- 'fixed1': '标题2',
217
- 'fixed2': '标题2-3',
218
- },
219
- {
220
- 'fixed1': '标题2',
221
- 'fixed2': '标题2-4',
222
- },
223
- {
224
- 'fixed1': '标题2',
225
- 'fixed2': '标题2-5',
226
- },
227
- {
228
- 'fixed1': '标题2',
229
- 'fixed2': '标题2-6',
230
- },
231
- {
232
- 'fixed1': '标题2',
233
- 'fixed2': '标题2-7',
234
- },
235
- {
236
- 'fixed1': '标题2',
237
- 'fixed2': '标题2-8',
238
- },
239
- ],
240
- };
241
- return (
242
- <MoreTreeTable
243
- height={500}
244
- colData={data.colHead}
245
- colTableData={data.tableValue2}
246
- colHeaderWidth={400}
247
- ref={colTableRef}
248
- />
249
- );
250
- };
251
- ```
252
-
253
- ## 多表头表格
254
-
255
- ```tsx
256
- import { MoreTreeTable } from '../../../index.ts';
257
- import React, { useState, useRef } from 'react';
258
-
259
- export default () => {
260
- const colTableRef = useRef(null);
261
- const data = {
262
- rowHead: [
263
- {
264
- key: '1111',
265
- title: '测试1',
266
- children: [
267
- {
268
- key: '1111-1',
269
- title: '测试1-1',
270
- children: [
271
- {
272
- key: '1111-1-2',
273
- title: '测试1-1-2',
274
- },
275
- {
276
- key: '1111-1-3',
277
- title: '测试1-1-4',
278
- },
279
- ],
280
- },
281
- {
282
- key: '1111-2',
283
- title: '测试1-2',
284
- children: [
285
- {
286
- id: '1111-2-2',
287
- title: '测试1-2-2',
288
- },
289
- {
290
- id: '1111-2-3',
291
- title: '测试1-2-4',
292
- },
293
- ],
294
- },
295
- {
296
- key: '1111-3',
297
- title: '测试1-3',
298
- children: [
299
- {
300
- key: '1111-3-2',
301
- title: '测试1-3-2',
302
- },
303
- {
304
- key: '1111-3-3',
305
- title: '测试1-3-4',
306
- },
307
- ],
308
- },
309
- {
310
- key: '1111-4',
311
- title: '测试1-4',
312
- },
313
- ],
314
- },
315
- {
316
- key: '2222',
317
- title: '测试1',
318
- children: [
319
- {
320
- key: '2222-1',
321
- title: '测试1-1',
322
- children: [
323
- {
324
- key: '2222-1-2',
325
- title: '测试1-1-2',
326
- },
327
- {
328
- key: '2222-1-3',
329
- title: '测试1-1-4',
330
- },
331
- ],
332
- },
333
- {
334
- key: '2222-2',
335
- title: '测试1-2',
336
- children: [
337
- {
338
- key: '2222-2-2',
339
- title: '测试1-2-2',
340
- },
341
- {
342
- key: '2222-2-3',
343
- title: '测试1-2-4',
344
- },
345
- ],
346
- },
347
- {
348
- key: '2222-3',
349
- title: '测试1-3',
350
- children: [
351
- {
352
- key: '2222-3-2',
353
- title: '测试1-3-2',
354
- },
355
- {
356
- key: '2222-3-3',
357
- title: '测试1-3-4',
358
- },
359
- ],
360
- },
361
- {
362
- key: '2222-4',
363
- title: '测试1-4',
364
- },
365
- ],
366
- },
367
- ],
368
- colHead: [
369
- {
370
- key: '1111',
371
- title: '测试1',
372
- children: [
373
- {
374
- key: '1111-1',
375
- title: '测试1-1',
376
- children: [
377
- {
378
- key: '1111-1-2',
379
- title: '测试1-1-2',
380
- },
381
- {
382
- key: '1111-1-3',
383
- title: '测试1-1-4',
384
- },
385
- ],
386
- },
387
- {
388
- key: '1111-2',
389
- title: '测试1-2',
390
- children: [
391
- {
392
- key: '1111-2-2',
393
- title: '测试1-2-2',
394
- },
395
- {
396
- key: '1111-2-3',
397
- title: '测试1-2-4',
398
- },
399
- ],
400
- },
401
- {
402
- key: '1111-3',
403
- title: '测试1-3',
404
- children: [
405
- {
406
- key: '1111-3-2',
407
- title: '测试1-3-2',
408
- },
409
- {
410
- key: '1111-3-3',
411
- title: '测试1-3-4',
412
- },
413
- ],
414
- },
415
- {
416
- key: '1111-4',
417
- title: '测试1-4',
418
- },
419
- ],
420
- },
421
- {
422
- key: '2222',
423
- title: '测试1',
424
- children: [
425
- {
426
- key: '2222-1',
427
- title: '测试1-1',
428
- children: [
429
- {
430
- key: '2222-1-2',
431
- title: '测试1-1-2',
432
- },
433
- {
434
- key: '2222-1-3',
435
- title: '测试1-1-4',
436
- },
437
- ],
438
- },
439
- {
440
- key: '2222-2',
441
- title: '测试1-2',
442
- children: [
443
- {
444
- key: '2222-2-2',
445
- title: '测试1-2-2',
446
- },
447
- {
448
- key: '2222-2-3',
449
- title: '测试1-2-4',
450
- children: [
451
- {
452
- key: '2222-2-3-1',
453
- title: '测试1-2-2',
454
- },
455
- {
456
- key: '2222-2-3-2',
457
- title: '测试1-2-2',
458
- },
459
- ],
460
- },
461
- ],
462
- },
463
- {
464
- key: '2222-3',
465
- title: '测试1-3',
466
- children: [
467
- {
468
- key: '2222-3-2',
469
- title: '测试1-3-2',
470
- },
471
- {
472
- key: '2222-3-3',
473
- title: '测试1-3-4',
474
- },
475
- ],
476
- },
477
- {
478
- key: '2222-4',
479
- title: '测试1-4',
480
- },
481
- ],
482
- },
483
- ],
484
- //多项表头的数据
485
- tableValue1: {
486
- '1111-1-2__1111-1-2': '测试数据1',
487
- '1111-1-3__1111-1-3': '测试数据2',
488
- '1111-2-2__1111-2-2': '测试数据3',
489
- '1111-2-3__1111-2-3': '测试数据4',
490
- '1111-3-2__1111-3-2': '测试数据5',
491
- '2222-3-3__2222-3-3': '测试数据6',
492
- '2222-4__2222-4': '测试数据7',
493
- },
494
- };
495
- return (
496
- <MoreTreeTable
497
- // width={1000}
498
- height={500}
499
- colData={data.colHead}
500
- rowData={data.rowHead}
501
- multiTableData={data.tableValue1}
502
- colTableData={data.tableValue2}
503
- colHeaderWidth={400}
504
- ref={colTableRef}
505
- />
506
- );
507
- };
508
- ```
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 多表头表格
9
+ order: 1
10
+ ---
11
+
12
+ # MoreTreeTable
13
+
14
+
15
+ ## 纵向表头表格
16
+
17
+ ```tsx
18
+ import { MoreTreeTable } from '../../../index.ts';
19
+ import React, { useState, useRef } from 'react';
20
+
21
+ export default () => {
22
+ const colTableRef = useRef(null);
23
+
24
+ let colTableData = [];
25
+ for (let i = 1; i < 10001; i++) {
26
+ colTableData.push({
27
+ '1111-1-2': '1',
28
+ '1111-1-3': '2',
29
+ '1111-2-2': '3',
30
+ '1111-2-3': '4',
31
+ '1111-3-2': '5',
32
+ '2222-3-3': '6',
33
+ '2222-4': '7',
34
+ 'fixed1': '标题1',
35
+ 'fixed2': `标题1-${i}`,
36
+ })
37
+ }
38
+ for (let j = 1; j < 10001; j++) {
39
+ colTableData.push({
40
+ '1111-1-2': '1',
41
+ '1111-1-3': '2',
42
+ '1111-2-2': '3',
43
+ '1111-2-3': '4',
44
+ '1111-3-2': '5',
45
+ '2222-3-3': '6',
46
+ '2222-4': '7',
47
+ 'fixed1': '标题2',
48
+ 'fixed2': `标题2-${j}`,
49
+ })
50
+ }
51
+ const data = {
52
+ colHead: [
53
+ {
54
+ key: 'fixed1',
55
+ title: '固定列1',
56
+ fixed: true,
57
+ },
58
+ {
59
+ key: 'fixed2',
60
+ title: '固定列2',
61
+ fixed: true,
62
+ },
63
+ {
64
+ key: '1111',
65
+ title: '测试1',
66
+ children: [
67
+ {
68
+ key: '1111-1',
69
+ title: '测试1-1',
70
+ children: [
71
+ {
72
+ key: '1111-1-2',
73
+ title: '测试1-1-2',
74
+ },
75
+ {
76
+ key: '1111-1-3',
77
+ title: '测试1-1-4',
78
+ },
79
+ ],
80
+ },
81
+ {
82
+ key: '1111-2',
83
+ title: '测试1-2',
84
+ children: [
85
+ {
86
+ key: '1111-2-2',
87
+ title: '测试1-2-2',
88
+ },
89
+ {
90
+ key: '1111-2-3',
91
+ title: '测试1-2-4',
92
+ },
93
+ ],
94
+ },
95
+ {
96
+ key: '1111-3',
97
+ title: '测试1-3',
98
+ children: [
99
+ {
100
+ key: '1111-3-2',
101
+ title: '测试1-3-2',
102
+ },
103
+ {
104
+ key: '1111-3-3',
105
+ title: '测试1-3-4',
106
+ },
107
+ ],
108
+ },
109
+ {
110
+ key: '1111-4',
111
+ title: '测试1-4',
112
+ },
113
+ ],
114
+ },
115
+ {
116
+ key: '2222',
117
+ title: '测试1',
118
+ children: [
119
+ {
120
+ key: '2222-1',
121
+ title: '测试1-1',
122
+ children: [
123
+ {
124
+ key: '2222-1-2',
125
+ title: '测试1-1-2',
126
+ },
127
+ {
128
+ key: '2222-1-3',
129
+ title: '测试1-1-4',
130
+ },
131
+ ],
132
+ },
133
+ {
134
+ key: '2222-2',
135
+ title: '测试1-2',
136
+ children: [
137
+ {
138
+ key: '2222-2-2',
139
+ title: '测试1-2-2',
140
+ },
141
+ {
142
+ key: '2222-2-3',
143
+ title: '测试1-2-4',
144
+ children: [
145
+ {
146
+ key: '2222-2-3-1',
147
+ title: '测试1-2-2',
148
+ },
149
+ {
150
+ key: '2222-2-3-2',
151
+ title: '测试1-2-2',
152
+ },
153
+ ],
154
+ },
155
+ ],
156
+ },
157
+ {
158
+ key: '2222-3',
159
+ title: '测试1-3',
160
+ children: [
161
+ {
162
+ key: '2222-3-2',
163
+ title: '测试1-3-2',
164
+ },
165
+ {
166
+ key: '2222-3-3',
167
+ title: '测试1-3-4',
168
+ },
169
+ ],
170
+ },
171
+ {
172
+ key: '2222-4',
173
+ title: '测试1-4',
174
+ },
175
+ ],
176
+ },
177
+ ],
178
+ //纵向表头数据
179
+ tableValue2: colTableData,
180
+ };
181
+ return (
182
+ <MoreTreeTable
183
+ height={500}
184
+ colData={data.colHead}
185
+ colTableData={data.tableValue2}
186
+ colHeaderWidth={400}
187
+ ref={colTableRef}
188
+ />
189
+ );
190
+ };
191
+ ```
192
+
193
+ ## 多表头表格
194
+
195
+ ```tsx
196
+ import { MoreTreeTable } from '../../../index.ts';
197
+ import React, { useState, useRef } from 'react';
198
+
199
+ export default () => {
200
+ const colTableRef = useRef(null);
201
+ const data = {
202
+ rowHead: [
203
+ {
204
+ key: '1111',
205
+ title: '测试1',
206
+ children: [
207
+ {
208
+ key: '1111-1',
209
+ title: '测试1-1',
210
+ children: [
211
+ {
212
+ key: '1111-1-2',
213
+ title: '测试1-1-2',
214
+ },
215
+ {
216
+ key: '1111-1-3',
217
+ title: '测试1-1-4',
218
+ },
219
+ ],
220
+ },
221
+ {
222
+ key: '1111-2',
223
+ title: '测试1-2',
224
+ children: [
225
+ {
226
+ id: '1111-2-2',
227
+ title: '测试1-2-2',
228
+ },
229
+ {
230
+ id: '1111-2-3',
231
+ title: '测试1-2-4',
232
+ },
233
+ ],
234
+ },
235
+ {
236
+ key: '1111-3',
237
+ title: '测试1-3',
238
+ children: [
239
+ {
240
+ key: '1111-3-2',
241
+ title: '测试1-3-2',
242
+ },
243
+ {
244
+ key: '1111-3-3',
245
+ title: '测试1-3-4',
246
+ },
247
+ ],
248
+ },
249
+ {
250
+ key: '1111-4',
251
+ title: '测试1-4',
252
+ },
253
+ ],
254
+ },
255
+ {
256
+ key: '2222',
257
+ title: '测试1',
258
+ children: [
259
+ {
260
+ key: '2222-1',
261
+ title: '测试1-1',
262
+ children: [
263
+ {
264
+ key: '2222-1-2',
265
+ title: '测试1-1-2',
266
+ },
267
+ {
268
+ key: '2222-1-3',
269
+ title: '测试1-1-4',
270
+ },
271
+ ],
272
+ },
273
+ {
274
+ key: '2222-2',
275
+ title: '测试1-2',
276
+ children: [
277
+ {
278
+ key: '2222-2-2',
279
+ title: '测试1-2-2',
280
+ },
281
+ {
282
+ key: '2222-2-3',
283
+ title: '测试1-2-4',
284
+ },
285
+ ],
286
+ },
287
+ {
288
+ key: '2222-3',
289
+ title: '测试1-3',
290
+ children: [
291
+ {
292
+ key: '2222-3-2',
293
+ title: '测试1-3-2',
294
+ },
295
+ {
296
+ key: '2222-3-3',
297
+ title: '测试1-3-4',
298
+ },
299
+ ],
300
+ },
301
+ {
302
+ key: '2222-4',
303
+ title: '测试1-4',
304
+ },
305
+ ],
306
+ },
307
+ ],
308
+ colHead: [
309
+ {
310
+ key: '1111',
311
+ title: '测试1',
312
+ children: [
313
+ {
314
+ key: '1111-1',
315
+ title: '测试1-1',
316
+ children: [
317
+ {
318
+ key: '1111-1-2',
319
+ title: '测试1-1-2',
320
+ },
321
+ {
322
+ key: '1111-1-3',
323
+ title: '测试1-1-4',
324
+ },
325
+ ],
326
+ },
327
+ {
328
+ key: '1111-2',
329
+ title: '测试1-2',
330
+ children: [
331
+ {
332
+ key: '1111-2-2',
333
+ title: '测试1-2-2',
334
+ },
335
+ {
336
+ key: '1111-2-3',
337
+ title: '测试1-2-4',
338
+ },
339
+ ],
340
+ },
341
+ {
342
+ key: '1111-3',
343
+ title: '测试1-3',
344
+ children: [
345
+ {
346
+ key: '1111-3-2',
347
+ title: '测试1-3-2',
348
+ },
349
+ {
350
+ key: '1111-3-3',
351
+ title: '测试1-3-4',
352
+ },
353
+ ],
354
+ },
355
+ {
356
+ key: '1111-4',
357
+ title: '测试1-4',
358
+ },
359
+ ],
360
+ },
361
+ {
362
+ key: '2222',
363
+ title: '测试1',
364
+ children: [
365
+ {
366
+ key: '2222-1',
367
+ title: '测试1-1',
368
+ children: [
369
+ {
370
+ key: '2222-1-2',
371
+ title: '测试1-1-2',
372
+ },
373
+ {
374
+ key: '2222-1-3',
375
+ title: '测试1-1-4',
376
+ },
377
+ ],
378
+ },
379
+ {
380
+ key: '2222-2',
381
+ title: '测试1-2',
382
+ children: [
383
+ {
384
+ key: '2222-2-2',
385
+ title: '测试1-2-2',
386
+ },
387
+ {
388
+ key: '2222-2-3',
389
+ title: '测试1-2-4',
390
+ children: [
391
+ {
392
+ key: '2222-2-3-1',
393
+ title: '测试1-2-2',
394
+ },
395
+ {
396
+ key: '2222-2-3-2',
397
+ title: '测试1-2-2',
398
+ },
399
+ ],
400
+ },
401
+ ],
402
+ },
403
+ {
404
+ key: '2222-3',
405
+ title: '测试1-3',
406
+ children: [
407
+ {
408
+ key: '2222-3-2',
409
+ title: '测试1-3-2',
410
+ },
411
+ {
412
+ key: '2222-3-3',
413
+ title: '测试1-3-4',
414
+ },
415
+ ],
416
+ },
417
+ {
418
+ key: '2222-4',
419
+ title: '测试1-4',
420
+ },
421
+ ],
422
+ },
423
+ ],
424
+ //多项表头的数据
425
+ tableValue1: {
426
+ '1111-1-2__1111-1-2': '测试数据1',
427
+ '1111-1-3__1111-1-3': '测试数据2',
428
+ '1111-2-2__1111-2-2': '测试数据3',
429
+ '1111-2-3__1111-2-3': '测试数据4',
430
+ '1111-3-2__1111-3-2': '测试数据5',
431
+ '2222-3-3__2222-3-3': '测试数据6',
432
+ '2222-4__2222-4': '测试数据7',
433
+ },
434
+ };
435
+ return (
436
+ <MoreTreeTable
437
+ // width={1000}
438
+ height={500}
439
+ colData={data.colHead}
440
+ rowData={data.rowHead}
441
+ multiTableData={data.tableValue1}
442
+ colTableData={data.tableValue2}
443
+ colHeaderWidth={400}
444
+ ref={colTableRef}
445
+ />
446
+ );
447
+ };
448
+ ```