ztxkui 4.2.18-9 → 4.2.18-91

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 (259) hide show
  1. package/dist/App.js +315 -291
  2. package/dist/Demo.js +58 -42
  3. package/dist/DemoCom/BasicDemo.js +57 -56
  4. package/dist/DemoCom/CodeQueryDemo.js +3 -2
  5. package/dist/DemoCom/CollapseDemo.js +28 -27
  6. package/dist/DemoCom/DragSort.js +11 -10
  7. package/dist/DemoCom/FormDemo.js +36 -30
  8. package/dist/DemoCom/PrintContainerDemo.js +151 -150
  9. package/dist/DemoCom/PrintDemo.js +15 -14
  10. package/dist/DemoCom/SinaturesDemo.js +9 -8
  11. package/dist/DemoCom/SyhDemo.js +21 -20
  12. package/dist/DemoCom/TableAnalyse.js +34 -33
  13. package/dist/DemoCom/TableDemo.js +74 -70
  14. package/dist/DemoCom/TableDemo1.js +34 -33
  15. package/dist/DemoCom/TableDetail.d.ts +9 -0
  16. package/dist/DemoCom/TableDetail.js +259 -0
  17. package/dist/DemoCom/TestCom.js +22 -19
  18. package/dist/DemoCom/data.d.ts +110 -0
  19. package/dist/DemoCom/data.js +2308 -0
  20. package/dist/TableDemo/BasicTable.js +103 -29
  21. package/dist/TableDemo/EditableTable.js +177 -91
  22. package/dist/TableDemo/ModalTable.js +25 -24
  23. package/dist/TableDemo/ProEditableTable.d.ts +21 -0
  24. package/dist/TableDemo/ProEditableTable.js +483 -0
  25. package/dist/TableDemo/data.d.ts +15 -0
  26. package/dist/TableDemo/data.js +44 -11
  27. package/dist/TableDemo/index.js +5 -4
  28. package/dist/TreeDemo.js +8 -7
  29. package/dist/TreeSelectDemo.js +10 -7
  30. package/dist/UI/Form/index.d.ts +3 -0
  31. package/dist/UI/Form/index.js +346 -0
  32. package/dist/UI/index.d.ts +2 -0
  33. package/dist/UI/index.js +10 -0
  34. package/dist/UploadDemo.js +12 -17
  35. package/dist/components/Button/button.js +3 -2
  36. package/dist/components/Collapse/collapse.js +2 -1
  37. package/dist/components/EnhanceSelect/index.d.ts +5 -1
  38. package/dist/components/EnhanceSelect/index.js +179 -32
  39. package/dist/components/EnhanceTree/index.js +4 -3
  40. package/dist/components/EnhanceTreeSelect/index.js +11 -5
  41. package/dist/components/Export/export.js +5 -4
  42. package/dist/components/Input/input.d.ts +3 -0
  43. package/dist/components/Input/input.js +53 -3
  44. package/dist/components/InputNumber/input-number.js +3 -2
  45. package/dist/components/NumberCase/index.js +9 -7
  46. package/dist/components/Print/print.js +4 -3
  47. package/dist/components/PrintContainer/AttachPreviewModal.js +3 -2
  48. package/dist/components/PrintContainer/PrintModal.js +4 -3
  49. package/dist/components/PrintContainer/handle.d.ts +2 -4
  50. package/dist/components/PrintContainer/handle.js +3 -2
  51. package/dist/components/PrintContainer/lodop.js +2 -1
  52. package/dist/components/PrintContainer/print-container.js +74 -73
  53. package/dist/components/PrintContainer/service.js +5 -4
  54. package/dist/components/ProForm/hooks.d.ts +23 -0
  55. package/dist/components/ProForm/hooks.js +209 -0
  56. package/dist/components/ProForm/index.d.ts +6 -0
  57. package/dist/components/ProForm/index.js +101 -0
  58. package/dist/components/ProForm/interface.d.ts +169 -0
  59. package/dist/components/ProForm/interface.js +1 -0
  60. package/dist/components/ProForm/item.d.ts +13 -0
  61. package/dist/components/ProForm/item.js +221 -0
  62. package/dist/components/ProForm/items.d.ts +5 -0
  63. package/dist/components/ProForm/items.js +36 -0
  64. package/dist/components/ProForm/search-drawer.d.ts +12 -0
  65. package/dist/components/ProForm/search-drawer.js +202 -0
  66. package/dist/components/ProForm/setting.d.ts +5 -0
  67. package/dist/components/ProForm/setting.js +13 -0
  68. package/dist/components/ProFormList/index.d.ts +12 -0
  69. package/dist/components/ProFormList/index.js +34 -0
  70. package/dist/components/ProTable/hooks.d.ts +28 -0
  71. package/dist/components/ProTable/hooks.js +279 -0
  72. package/dist/components/ProTable/index.d.ts +8 -0
  73. package/dist/components/ProTable/index.js +77 -0
  74. package/dist/components/ProTable/interface.d.ts +51 -0
  75. package/dist/components/ProTable/interface.js +1 -0
  76. package/dist/components/RangePicker/range-picker.js +5 -2
  77. package/dist/components/SortableCancel/sortable-cancel.d.ts +1 -0
  78. package/dist/components/SortableCancel/sortable-cancel.js +2 -2
  79. package/dist/components/Table/components/FillDown.d.ts +8 -0
  80. package/dist/components/Table/components/FillDown.js +11 -0
  81. package/dist/components/Table/components/FilterDropdown.d.ts +15 -0
  82. package/dist/components/Table/components/FilterDropdown.js +93 -0
  83. package/dist/components/Table/constants.d.ts +2 -0
  84. package/dist/components/Table/constants.js +2 -0
  85. package/dist/components/Table/hooks/useColumns.d.ts +25 -8
  86. package/dist/components/Table/hooks/useColumns.js +704 -180
  87. package/dist/components/Table/hooks/useDropRef.js +4 -2
  88. package/dist/components/Table/hooks/useInnerPagination.js +1 -0
  89. package/dist/components/Table/hooks/useSelectSubtotal.d.ts +4 -0
  90. package/dist/components/Table/hooks/useSelectSubtotal.js +182 -0
  91. package/dist/components/Table/hooks/useVituralScrollBar.d.ts +10 -0
  92. package/dist/components/Table/hooks/useVituralScrollBar.js +234 -0
  93. package/dist/components/Table/index.d.ts +11 -0
  94. package/dist/components/Table/table-adddel-column.d.ts +8 -5
  95. package/dist/components/Table/table-adddel-column.js +16 -5
  96. package/dist/components/Table/table-dynamic.js +165 -18
  97. package/dist/components/Table/table-enhance-cell.d.ts +7 -3
  98. package/dist/components/Table/table-enhance-cell.js +214 -109
  99. package/dist/components/Table/table-enhance-row.d.ts +4 -4
  100. package/dist/components/Table/table-enhance-row.js +10 -11
  101. package/dist/components/Table/table-headTooltip.d.ts +6 -0
  102. package/dist/components/Table/table-headTooltip.js +13 -0
  103. package/dist/components/Table/table-resizable-title.d.ts +4 -5
  104. package/dist/components/Table/table-resizable-title.js +33 -6
  105. package/dist/components/Table/table-sort.d.ts +11 -0
  106. package/dist/components/Table/table-sort.js +66 -0
  107. package/dist/components/Table/table.d.ts +30 -4
  108. package/dist/components/Table/table.js +526 -180
  109. package/dist/components/Table/utils/dom.d.ts +26 -0
  110. package/dist/components/Table/utils/dom.js +123 -0
  111. package/dist/components/Table/utils/filterHandle.d.ts +1 -0
  112. package/dist/components/Table/utils/filterHandle.js +66 -0
  113. package/dist/components/Table/utils/getSummaryData.d.ts +2 -1
  114. package/dist/components/Table/utils/getSummaryData.js +282 -25
  115. package/dist/components/Table/utils/shallowEqual.d.ts +2 -0
  116. package/dist/components/Table/utils/shallowEqual.js +35 -0
  117. package/dist/components/Table/utils/validate.d.ts +1 -1
  118. package/dist/components/Table/utils/validate.js +30 -11
  119. package/dist/components/TreeSelect/index.d.ts +15 -0
  120. package/dist/components/TreeSelect/index.js +29 -0
  121. package/dist/components/Upload/upload-table.js +31 -26
  122. package/dist/components/Upload/upload.js +23 -18
  123. package/dist/components/Upload/utils.js +11 -10
  124. package/dist/components/UploadSingle/upload-single.js +5 -4
  125. package/dist/components/Watermark/index.d.ts +2 -0
  126. package/dist/components/Watermark/index.js +2 -0
  127. package/dist/components/Watermark/interface.d.ts +20 -0
  128. package/dist/components/Watermark/interface.js +1 -0
  129. package/dist/components/Watermark/utils.d.ts +1 -0
  130. package/dist/components/Watermark/utils.js +70 -0
  131. package/dist/components/Watermark/water.d.ts +50 -0
  132. package/dist/components/Watermark/water.js +66 -0
  133. package/dist/components/Watermark/watermark-div.d.ts +4 -0
  134. package/dist/components/Watermark/watermark-div.js +41 -0
  135. package/dist/components/Watermark/watermark-shadow.d.ts +6 -0
  136. package/dist/components/Watermark/watermark-shadow.js +116 -0
  137. package/dist/components/Watermark/watermark.d.ts +3 -0
  138. package/dist/components/Watermark/watermark.js +102 -0
  139. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.d.ts +9 -0
  140. package/dist/components/WorkflowPrintContainer/component/Gragh/Gragh.js +63 -0
  141. package/dist/components/WorkflowPrintContainer/component/Header.d.ts +12 -0
  142. package/dist/components/WorkflowPrintContainer/component/Header.js +109 -0
  143. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.d.ts +18 -0
  144. package/dist/components/WorkflowPrintContainer/component/ProcessDetail.js +243 -0
  145. package/dist/components/WorkflowPrintContainer/component/Upload/index.d.ts +20 -0
  146. package/dist/components/WorkflowPrintContainer/component/Upload/index.js +59 -0
  147. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.d.ts +10 -0
  148. package/dist/components/WorkflowPrintContainer/component/association/component/TableList.js +75 -0
  149. package/dist/components/WorkflowPrintContainer/component/association/index.d.ts +9 -0
  150. package/dist/components/WorkflowPrintContainer/component/association/index.js +92 -0
  151. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.d.ts +9 -0
  152. package/dist/components/WorkflowPrintContainer/component/attention/component/TableList.js +38 -0
  153. package/dist/components/WorkflowPrintContainer/component/attention/index.d.ts +10 -0
  154. package/dist/components/WorkflowPrintContainer/component/attention/index.js +95 -0
  155. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.d.ts +8 -0
  156. package/dist/components/WorkflowPrintContainer/component/audit/component/TableList.js +53 -0
  157. package/dist/components/WorkflowPrintContainer/component/audit/index.d.ts +7 -0
  158. package/dist/components/WorkflowPrintContainer/component/audit/index.js +88 -0
  159. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.d.ts +9 -0
  160. package/dist/components/WorkflowPrintContainer/component/previewTable/component/TableList.js +53 -0
  161. package/dist/components/WorkflowPrintContainer/component/previewTable/index.d.ts +11 -0
  162. package/dist/components/WorkflowPrintContainer/component/previewTable/index.js +60 -0
  163. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.d.ts +9 -0
  164. package/dist/components/WorkflowPrintContainer/component/send/component/TableList.js +50 -0
  165. package/dist/components/WorkflowPrintContainer/component/send/index.d.ts +9 -0
  166. package/dist/components/WorkflowPrintContainer/component/send/index.js +92 -0
  167. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.d.ts +12 -0
  168. package/dist/components/WorkflowPrintContainer/component/trail/component/TableList.js +282 -0
  169. package/dist/components/WorkflowPrintContainer/component/trail/index.d.ts +11 -0
  170. package/dist/components/WorkflowPrintContainer/component/trail/index.js +56 -0
  171. package/dist/components/WorkflowPrintContainer/images.d.ts +2 -0
  172. package/dist/components/WorkflowPrintContainer/images.js +2 -0
  173. package/dist/components/WorkflowPrintContainer/index.d.ts +2 -0
  174. package/dist/components/WorkflowPrintContainer/index.js +2 -0
  175. package/dist/components/WorkflowPrintContainer/service.d.ts +14 -0
  176. package/dist/components/WorkflowPrintContainer/service.js +101 -0
  177. package/dist/components/WorkflowPrintContainer/usePagination.d.ts +14 -0
  178. package/dist/components/WorkflowPrintContainer/usePagination.js +22 -0
  179. package/dist/components/WorkflowPrintContainer/workflow-print-container.d.ts +100 -0
  180. package/dist/components/WorkflowPrintContainer/workflow-print-container.js +236 -0
  181. package/dist/components/business/Analyse/index.js +12 -11
  182. package/dist/components/business/CodeQuery/component/SearchForm.js +3 -2
  183. package/dist/components/business/CodeQuery/component/TableList.js +5 -4
  184. package/dist/components/business/CodeQuery/hooks.js +2 -1
  185. package/dist/components/business/CodeQuery/index.js +2 -1
  186. package/dist/components/business/Common/UserForgetPassword/index.js +36 -28
  187. package/dist/components/business/Common/UserInfo/component/MakingForm.js +11 -10
  188. package/dist/components/business/Common/UserInfo/index.js +7 -4
  189. package/dist/components/business/Common/UserPassword/index.d.ts +1 -0
  190. package/dist/components/business/Common/UserPassword/index.js +39 -18
  191. package/dist/components/business/Common/validatePassword.d.ts +1 -1
  192. package/dist/components/business/Common/validatePassword.js +17 -7
  193. package/dist/components/business/DetailCard/index.js +7 -6
  194. package/dist/components/business/DetailHeader/index.js +7 -6
  195. package/dist/components/business/DetailList/index.js +5 -4
  196. package/dist/components/business/DgColumns/index.js +12 -11
  197. package/dist/components/business/ExportButton/index.js +6 -5
  198. package/dist/components/business/Footer/index.js +4 -1
  199. package/dist/components/business/GridList/item.d.ts +1 -1
  200. package/dist/components/business/List/item.d.ts +1 -1
  201. package/dist/components/business/NewList/item.d.ts +1 -1
  202. package/dist/components/business/NewList/item.js +1 -1
  203. package/dist/components/business/OperationBtnGroup/index.js +17 -16
  204. package/dist/components/business/SearchContainer/hooks/useToggle.d.ts +1 -1
  205. package/dist/components/business/SearchContainer/hooks/useToggle.js +5 -4
  206. package/dist/components/business/SearchContainer/record-common-item.d.ts +14 -0
  207. package/dist/components/business/SearchContainer/record-common-item.js +82 -0
  208. package/dist/components/business/SearchContainer/record-common-list.d.ts +3 -0
  209. package/dist/components/business/SearchContainer/record-common-list.js +64 -0
  210. package/dist/components/business/SearchContainer/search-container.d.ts +13 -0
  211. package/dist/components/business/SearchContainer/search-container.js +32 -3
  212. package/dist/components/business/SearchContainer/search-drawer.d.ts +1 -0
  213. package/dist/components/business/SearchContainer/search-drawer.js +139 -13
  214. package/dist/components/business/SearchContainer/search-item.js +33 -2
  215. package/dist/components/business/SearchContainer/search-left.d.ts +1 -0
  216. package/dist/components/business/SearchContainer/search-left.js +11 -3
  217. package/dist/components/business/SearchContainer/search-right.js +23 -4
  218. package/dist/components/business/SearchContainer/useRecordCommonInit.d.ts +15 -0
  219. package/dist/components/business/SearchContainer/useRecordCommonInit.js +242 -0
  220. package/dist/components/business/SearchContainer/useRecordCommonSearch.d.ts +7 -0
  221. package/dist/components/business/SearchContainer/useRecordCommonSearch.js +140 -0
  222. package/dist/components/business/SearchContainer/useRecordCommonSearchContext.d.ts +31 -0
  223. package/dist/components/business/SearchContainer/useRecordCommonSearchContext.js +8 -0
  224. package/dist/components/business/Signatures/components/AttachOperation.js +7 -6
  225. package/dist/components/business/Signatures/components/CompareResult.js +7 -6
  226. package/dist/components/business/Signatures/components/DetailTable.js +37 -34
  227. package/dist/components/business/Signatures/components/QunjSeal.js +5 -4
  228. package/dist/components/business/Signatures/components/SealCheckbox.js +3 -2
  229. package/dist/components/business/Signatures/components/TemplateAttach.js +2 -1
  230. package/dist/components/business/Signatures/index.js +64 -53
  231. package/dist/components/business/SortList/sort-drawer.js +5 -4
  232. package/dist/components/business/Template/index.js +11 -10
  233. package/dist/components/utils/MyStorage.d.ts +36 -0
  234. package/dist/components/utils/MyStorage.js +120 -0
  235. package/dist/components/utils/ZtxkContext.d.ts +34 -0
  236. package/dist/components/utils/ZtxkContext.js +13 -0
  237. package/dist/components/utils/fetch.d.ts +10 -0
  238. package/dist/components/utils/fetch.js +119 -0
  239. package/dist/components/utils/index.d.ts +1 -0
  240. package/dist/components/utils/index.js +20 -0
  241. package/dist/components/utils/processNumber.d.ts +12 -0
  242. package/dist/components/utils/processNumber.js +106 -0
  243. package/dist/components/utils/upload.js +6 -3
  244. package/dist/components/utils/useBaseContext.d.ts +5 -0
  245. package/dist/components/utils/useBaseContext.js +10 -0
  246. package/dist/components/utils/useLastest.d.ts +2 -0
  247. package/dist/components/utils/useLastest.js +6 -0
  248. package/dist/components/utils/useMemoizedFn.d.ts +4 -0
  249. package/dist/components/utils/useMemoizedFn.js +19 -0
  250. package/dist/constants.d.ts +1 -1
  251. package/dist/constants.js +1 -1
  252. package/dist/index.css +1011 -7
  253. package/dist/index.css.map +1 -1
  254. package/dist/index.d.ts +10 -1
  255. package/dist/index.js +200 -84
  256. package/dist/locales/en-US.json +818 -0
  257. package/dist/locales/zh-CN.json +818 -0
  258. package/dist/request.js +6 -5
  259. package/package.json +7 -2
@@ -1,82 +1,143 @@
1
+ import i18next from 'ztxkutils/dist/i18next';
1
2
  /**
2
3
  * @author 陈亚雄
3
4
  * @description 基础表格,充当列表
4
5
  */
5
- import React from 'react';
6
+ import React, { useState } from 'react';
6
7
  // redux
7
8
  // ztxkui公共组件
8
9
  import { Table } from '../index';
9
- // 路由配置
10
- // store
11
- // 自定义组件
12
- // 其他文件
13
- import { dataSource } from './data';
10
+ var dataObj = {
11
+ 1: [
12
+ { id: 1, test1: '1', test2: '2', test3: '3', test4: '4' },
13
+ { id: 2, test1: '11', test2: '22', test3: '33', test4: '44' },
14
+ { id: 3, test1: '111', test2: '222', test3: '333', test4: '444' },
15
+ ],
16
+ 2: [
17
+ { id: 3, test1: '2-1', test2: '2-2', test3: '2-3', test4: '2-4' },
18
+ { id: 2, test1: '2-11', test2: '2-22', test3: '2-33', test4: '2-44' },
19
+ { id: 4, test1: '2-111', test2: '2-222', test3: '2-333', test4: '2-444' },
20
+ ],
21
+ 3: [
22
+ { id: 3, test1: '3-1', test2: '3-2', test3: '3-3', test4: '3-4' },
23
+ { id: 2, test1: '3-11', test2: '3-22', test3: '3-33', test4: '3-44' },
24
+ { id: 4, test1: '3-111', test2: '3-222', test3: '3-333', test4: '3-444' },
25
+ ],
26
+ 4: [
27
+ { id: 1, test1: '4-1', test2: '4-2', test3: '4-3', test4: '4-4' },
28
+ { id: 2, test1: '4-11', test2: '4-22', test3: '4-33', test4: '4-44' },
29
+ { id: 3, test1: '4-111', test2: '4-222', test3: '4-333', test4: '4-444' },
30
+ ],
31
+ 5: [
32
+ { id: 1, test1: '5-1', test2: '5-2', test3: '5-3', test4: '5-4' },
33
+ { id: 2, test1: '5-11', test2: '5-22', test3: '5-33', test4: '5-44' },
34
+ { id: '3', test1: '5-111', test2: '5-222', test3: '5-333', test4: '5-444' },
35
+ {
36
+ id: '3',
37
+ test1: '5-1111',
38
+ test2: '5-2222',
39
+ test3: '5-3333',
40
+ test4: '5-4444',
41
+ },
42
+ {
43
+ id: '3',
44
+ test1: '5-11111',
45
+ test2: '5-22222',
46
+ test3: '5-33333',
47
+ test4: '5-44444',
48
+ },
49
+ ],
50
+ 6: [
51
+ { id: 11, test1: '6-1', test2: '6-2', test3: '6-3', test4: '6-4' },
52
+ { id: 22, test1: '6-11', test2: '6-22', test3: '6-33', test4: '6-44' },
53
+ {
54
+ id: '33',
55
+ test1: '6-111',
56
+ test2: '6-222',
57
+ test3: '6-333',
58
+ test4: '6-444',
59
+ },
60
+ {
61
+ id: '36',
62
+ test1: '6-1111',
63
+ test2: '6-2222',
64
+ test3: '6-3333',
65
+ test4: '6-4444',
66
+ },
67
+ {
68
+ id: '34',
69
+ test1: '6-11111',
70
+ test2: '6-22222',
71
+ test3: '6-33333',
72
+ test4: '6-44444',
73
+ },
74
+ ],
75
+ 7: [],
76
+ 8: [],
77
+ 9: [],
78
+ };
79
+ var i = 0;
14
80
  var BasicTable = function (_a) {
15
81
  var dynamicKey = _a.dynamicKey;
82
+ var _b = useState([]), data = _b[0], setData = _b[1];
16
83
  var columns = [
17
84
  {
18
- title: '序号',
19
- width: 62,
20
- fixed: 'left',
21
- key: 'index',
22
- render: function (_text, _record, index) { return "" + (index + 1); },
23
- },
24
- {
25
- title: '测试1',
85
+ title: i18next.t('测试1'),
26
86
  width: 100,
27
87
  dataIndex: 'test1',
28
88
  key: 'test1',
89
+ fixed: true,
29
90
  },
30
91
  {
31
- title: '测试2',
92
+ title: i18next.t('测试2'),
32
93
  width: 100,
33
94
  dataIndex: 'test2',
34
95
  key: 'test2',
35
96
  },
36
97
  {
37
- title: '测试3',
98
+ title: i18next.t('测试3'),
38
99
  width: 100,
39
100
  dataIndex: 'test3',
40
101
  key: 'test3',
41
102
  },
42
103
  {
43
- title: '测试4',
104
+ title: i18next.t('测试4'),
44
105
  width: 100,
45
106
  dataIndex: 'test4',
46
107
  key: 'test4',
47
108
  },
48
109
  {
49
- title: '测试5',
110
+ title: i18next.t('测试5'),
50
111
  width: 100,
51
112
  dataIndex: 'test5',
52
113
  key: 'test5',
53
114
  },
54
115
  {
55
- title: '测试6',
116
+ title: i18next.t('测试6'),
56
117
  width: 100,
57
118
  dataIndex: 'test6',
58
119
  key: 'test6',
59
120
  },
60
121
  {
61
- title: '测试7',
122
+ title: i18next.t('测试7'),
62
123
  width: 100,
63
124
  dataIndex: 'test7',
64
125
  key: 'test7',
65
126
  },
66
127
  {
67
- title: '测试8',
128
+ title: i18next.t('测试8'),
68
129
  width: 100,
69
130
  dataIndex: 'test8',
70
131
  key: 'test8',
71
132
  },
72
133
  {
73
- title: '测试9',
134
+ title: i18next.t('测试9'),
74
135
  width: 100,
75
136
  dataIndex: 'test9',
76
137
  key: 'test9',
77
138
  },
78
139
  {
79
- title: '测试10',
140
+ title: i18next.t('测试10'),
80
141
  width: 100,
81
142
  dataIndex: 'test10',
82
143
  key: 'test10',
@@ -84,13 +145,26 @@ var BasicTable = function (_a) {
84
145
  ];
85
146
  return (React.createElement("div", null,
86
147
  React.createElement("div", null,
87
- "\u57FA\u7840\u5C55\u793A\u8868\u683C\uFF1B",
148
+ i18next.t('基础展示表格;'),
88
149
  React.createElement("br", null),
89
- React.createElement("b", null, "\u52A8\u6001\u5217\u914D\u7F6E\uFF1B"),
90
- "\u5982\u679C\u9700\u8981\u7F13\u5B58\u4F4F\u52A8\u6001\u5217\u914D\u7F6E\uFF0C\u9700\u8981\u4F20\u5165showColumnDynamicKey\uFF1B \u8868\u683C\u5185\u90E8\u8FDB\u884C\u4E86\u4F18\u5316\uFF0C\u6570\u636E\u5C06\u5B58\u50A8\u5728\u672C\u5730\u7F13\u5B58\u4E2D\uFF0C\u53EF\u4EE5\u4E0D\u7528\u901A\u8FC7\u5916\u754C\u4F20\u5165\u914D\u7F6E",
150
+ React.createElement("b", null, i18next.t('动态列配置;')),
151
+ i18next.t('如果需要缓存住动态列配置,需要传入showColumnDynamicKey; 表格内部进行了优化,数据将存储在本地缓存中,可以不用通过外界传入配置'),
91
152
  React.createElement("br", null),
92
- React.createElement("b", null, "\u5217\u4F38\u7F29\uFF1B"),
93
- "isResizableColumn\u5C5E\u6027\u9ED8\u8BA4\u4E3Atrue\uFF0C\u5982\u679C\u4E0D\u9700\u8981\u5217\u4F38\u7F29\u53EF\u4EE5\u4F20\u5165false"),
94
- React.createElement(Table, { dataSource: dataSource, columns: columns, rowKey: "id", showColumnDynamic: true, showColumnDynamicKey: dynamicKey || 'symbol-id-1' })));
153
+ React.createElement("b", null, i18next.t('列伸缩;')),
154
+ i18next.t('isResizableColumn属性默认为true,如果不需要列伸缩可以传入false')),
155
+ React.createElement("button", { onClick: function () {
156
+ i++;
157
+ setData(dataObj[i]);
158
+ console.log(dataObj[i]);
159
+ } },
160
+ i18next.t('切换数据'),
161
+ i),
162
+ React.createElement("button", { onClick: function () {
163
+ i--;
164
+ setData(dataObj[i]);
165
+ } },
166
+ i18next.t('--切换数据'),
167
+ i),
168
+ React.createElement(Table, { dataSource: data, columns: columns, rowKey: "id", scroll: { x: 400, y: 300 }, isOpenVirtualScrollBar: true })));
95
169
  };
96
170
  export default BasicTable;
@@ -50,6 +50,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
50
50
  to[j] = from[i];
51
51
  return to;
52
52
  };
53
+ import i18next from 'ztxkutils/dist/i18next';
53
54
  /**
54
55
  * @author 陈亚雄
55
56
  * @description 可编辑表格
@@ -146,22 +147,75 @@ export function divide(num1, num2) {
146
147
  return 0;
147
148
  }
148
149
  }
150
+ var dataObj = {
151
+ 1: [
152
+ { id: 1, test1: '1', test2: '2', test3: '3', test4: '4' },
153
+ { id: 2, test1: '11', test2: '22', test3: '33', test4: '44' },
154
+ { id: 3, test1: '111', test2: '222', test3: '333', test4: '444' },
155
+ ],
156
+ 2: [
157
+ { id: 3, test1: '2-1', test2: '2-2', test3: '2-3', test4: '2-4' },
158
+ { id: 2, test1: '2-11', test2: '2-22', test3: '2-33', test4: '2-44' },
159
+ { id: 4, test1: '2-111', test2: '2-222', test3: '2-333', test4: '2-444' },
160
+ ],
161
+ 3: [
162
+ { id: 3, test1: '3-1', test2: '3-2', test3: '3-3', test4: '3-4' },
163
+ { id: 2, test1: '3-11', test2: '3-22', test3: '3-33', test4: '3-44' },
164
+ { id: 4, test1: '3-111', test2: '3-222', test3: '3-333', test4: '3-444' },
165
+ ],
166
+ 4: [
167
+ { id: 1, test1: '4-1', test2: '4-2', test3: '4-3', test4: '4-4' },
168
+ { id: 2, test1: '4-11', test2: '4-22', test3: '4-33', test4: '4-44' },
169
+ { id: 3, test1: '4-111', test2: '4-222', test3: '4-333', test4: '4-444' },
170
+ ],
171
+ 5: [
172
+ { id: 1, test1: '5-1', test2: '5-2', test3: '5-3', test4: '5-4' },
173
+ { id: 2, test1: '5-11', test2: '5-22', test3: '5-33', test4: '5-44' },
174
+ { id: '3', test1: '5-111', test2: '5-222', test3: '5-333', test4: '5-444' },
175
+ {
176
+ id: '3',
177
+ test1: '5-1111',
178
+ test2: '5-2222',
179
+ test3: '5-3333',
180
+ test4: '5-4444',
181
+ },
182
+ {
183
+ id: '3',
184
+ test1: '5-11111',
185
+ test2: '5-22222',
186
+ test3: '5-33333',
187
+ test4: '5-44444',
188
+ },
189
+ ],
190
+ 6: [],
191
+ 7: [],
192
+ 8: [],
193
+ 9: [],
194
+ };
195
+ var i = 0;
149
196
  var EditableTable = function () {
150
- var _a = useState(dataSource), records = _a[0], setRecords = _a[1];
197
+ var _a = useState(), records = _a[0], setRecords = _a[1];
198
+ var _b = useState([]), data = _b[0], setData = _b[1];
199
+ useEffect(function () {
200
+ setTimeout(function () {
201
+ setRecords(dataSource);
202
+ }, 1000);
203
+ }, []);
151
204
  var recordsRef = useRef([]);
152
205
  // 初始化渲染,针对配置了editable、editableConfig的列配置
153
- var _b = useState(false), firstRender = _b[0], setFirstRender = _b[1];
206
+ var _c = useState(false), firstRender = _c[0], setFirstRender = _c[1];
154
207
  // 新增删除行改变
155
- var _c = useState(false), lengthChange = _c[0], setLengthChange = _c[1];
208
+ var _d = useState(false), lengthChange = _d[0], setLengthChange = _d[1];
156
209
  // 表格行拖拽改变
157
- var _d = useState(false), moveChange = _d[0], setMoveChange = _d[1];
210
+ var _e = useState(false), moveChange = _e[0], setMoveChange = _e[1];
158
211
  // 表格
159
212
  var tableHandleRef = useRef({});
213
+ var _f = useState([]), expandedRowKeys = _f[0], setExpandedRowKeys = _f[1];
160
214
  // 表格配置
161
- var _e = useState({
215
+ var _g = useState({
162
216
  test1: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
163
217
  test2: { isChangeable: 1, isDisplay: 1, isRequired: 1 },
164
- }), tableConfig = _e[0], setTableConfig = _e[1];
218
+ }), tableConfig = _g[0], setTableConfig = _g[1];
165
219
  useEffect(function () {
166
220
  setTimeout(function () {
167
221
  setTableConfig({
@@ -174,18 +228,22 @@ var EditableTable = function () {
174
228
  }, []);
175
229
  var columns = [
176
230
  {
177
- title: '序号',
231
+ title: i18next.t('序号'),
178
232
  width: 62,
179
233
  fixed: 'left',
180
234
  key: 'index',
181
235
  render: function (_text, _record, index) { return "" + (index + 1); },
182
236
  },
183
237
  {
184
- title: '测试1',
185
- width: 100,
238
+ title: i18next.t('测试1'),
239
+ width: 400,
186
240
  dataIndex: 'test1',
187
241
  key: 'test1',
188
242
  editable: true,
243
+ editableConfig: {
244
+ type: 'textArea',
245
+ maxLength: 100,
246
+ },
189
247
  showCopy: true,
190
248
  validate: {},
191
249
  shouldCellUpdate: function (record, preRecord) {
@@ -205,14 +263,14 @@ var EditableTable = function () {
205
263
  },
206
264
  },
207
265
  {
208
- title: '测试111',
209
- width: 100,
266
+ title: i18next.t('测试111'),
267
+ width: 400,
210
268
  dataIndex: 'test111',
211
269
  key: 'test111',
212
270
  editable: true,
213
271
  editableConfig: {
214
272
  type: 'inputNumber',
215
- placeholder: '输入',
273
+ placeholder: i18next.t('输入'),
216
274
  min: 0,
217
275
  precision: 2,
218
276
  formatterType: 'currency',
@@ -235,14 +293,14 @@ var EditableTable = function () {
235
293
  },
236
294
  },
237
295
  {
238
- title: '测试2',
296
+ title: i18next.t('测试2'),
239
297
  width: 150,
240
298
  dataIndex: 'test2',
241
299
  key: 'test2',
242
300
  editable: true,
243
301
  editableConfig: {
244
302
  type: 'inputNumber',
245
- placeholder: '输入',
303
+ placeholder: i18next.t('输入'),
246
304
  min: 0,
247
305
  precision: 2,
248
306
  formatterType: 'currency',
@@ -256,7 +314,7 @@ var EditableTable = function () {
256
314
  return Promise.reject({
257
315
  errorFields: [
258
316
  {
259
- errors: "\u6D4B\u8BD5-\u660E\u7EC6\u8868 \u7B2C" + index + "\u884C \u6D4B\u8BD52 \u4E0D\u80FD\u5C0F\u4E8E102\uFF01",
317
+ errors: i18next.t('测试-明细表 第{{index}}行 测试2 不能小于102!', { index: index }),
260
318
  },
261
319
  ],
262
320
  });
@@ -281,7 +339,7 @@ var EditableTable = function () {
281
339
  },
282
340
  },
283
341
  {
284
- title: "\u91D1\u989D(\u542B\u7A0E)",
342
+ title: i18next.t('金额(含税)', {}),
285
343
  width: 130,
286
344
  dataIndex: 'test2222',
287
345
  key: 'test2222',
@@ -308,7 +366,7 @@ var EditableTable = function () {
308
366
  },
309
367
  },
310
368
  {
311
- title: '测试3',
369
+ title: i18next.t('测试3'),
312
370
  width: 100,
313
371
  dataIndex: 'test3',
314
372
  key: 'test3',
@@ -337,62 +395,62 @@ var EditableTable = function () {
337
395
  } }));
338
396
  },
339
397
  },
340
- // {
341
- // title: '测试4',
342
- // width: 100,
343
- // dataIndex: 'test4',
344
- // key: 'test4',
345
- // },
346
- // {
347
- // title: '测试5',
348
- // // width: 100,
349
- // // dataIndex: 'test5',
350
- // // key: 'test5',
351
- // children: [
352
- // {
353
- // title: '测试5-001',
354
- // width: 100,
355
- // dataIndex: 'test5-001',
356
- // key: 'test5-001',
357
- // },
358
- // {
359
- // title: '测试5-002',
360
- // width: 100,
361
- // dataIndex: 'test5-002',
362
- // key: 'test5-002',
363
- // },
364
- // ],
365
- // },
366
- // {
367
- // title: '测试6',
368
- // width: 100,
369
- // dataIndex: 'test6',
370
- // key: 'test6',
371
- // },
372
- // {
373
- // title: '测试7',
374
- // width: 100,
375
- // dataIndex: 'test7',
376
- // key: 'test7',
377
- // },
378
- // {
379
- // title: '测试8',
380
- // width: 100,
381
- // dataIndex: 'test8',
382
- // key: 'test8',
383
- // },
384
- // {
385
- // title: '测试9',
386
- // width: 100,
387
- // dataIndex: 'test9',
388
- // key: 'test9',
389
- // },
390
- // {
391
- // title: '测试10',
392
- // width: 100,
393
- // dataIndex: 'test10',
394
- // key: 'test10',
395
- // },
398
+ {
399
+ title: i18next.t('测试4'),
400
+ width: 100,
401
+ dataIndex: 'test4',
402
+ key: 'test4',
403
+ },
404
+ {
405
+ title: i18next.t('测试5'),
406
+ // width: 100,
407
+ // dataIndex: 'test5',
408
+ // key: 'test5',
409
+ children: [
410
+ {
411
+ title: i18next.t('测试5-001'),
412
+ width: 100,
413
+ dataIndex: 'test5-001',
414
+ key: 'test5-001',
415
+ },
416
+ {
417
+ title: i18next.t('测试5-002'),
418
+ width: 100,
419
+ dataIndex: 'test5-002',
420
+ key: 'test5-002',
421
+ },
422
+ ],
423
+ },
424
+ {
425
+ title: i18next.t('测试6'),
426
+ width: 100,
427
+ dataIndex: 'test6',
428
+ key: 'test6',
429
+ },
430
+ {
431
+ title: i18next.t('测试7'),
432
+ width: 100,
433
+ dataIndex: 'test7',
434
+ key: 'test7',
435
+ },
436
+ {
437
+ title: i18next.t('测试8'),
438
+ width: 100,
439
+ dataIndex: 'test8',
440
+ key: 'test8',
441
+ },
442
+ {
443
+ title: i18next.t('测试9'),
444
+ width: 100,
445
+ dataIndex: 'test9',
446
+ key: 'test9',
447
+ },
448
+ {
449
+ title: i18next.t('测试10'),
450
+ width: 100,
451
+ dataIndex: 'test10',
452
+ key: 'test10',
453
+ },
396
454
  ];
397
455
  // 初始化渲染,针对配置了editable、editableConfig的列配置
398
456
  useEffect(function () {
@@ -483,18 +541,18 @@ var EditableTable = function () {
483
541
  }, []);
484
542
  return (React.createElement("div", null,
485
543
  React.createElement("div", null,
486
- "\u53EF\u7F16\u8F91\u8868\u683C\uFF1B\u5982\u679C\u662F\u8F93\u5165\u6846\uFF0C\u53EF\u4F7F\u7528\u8868\u683C\u9ED8\u8BA4\u63D0\u4F9B\u7684\u7F16\u8F91\u6846\uFF1B \u914D\u7F6Eeditable\u4E3Atrue\u5373\u53EF\uFF0C\u8FD8\u53EF\u914D\u7F6EeditableConfig\u914D\u7F6E\u6267\u884C\u7C7B\u578B\u7B49\uFF1B\u5177\u4F53editableConfig\u53EF\u67E5\u770B\u8BE6\u7EC6\u7B7E\u540D",
544
+ i18next.t('可编辑表格;如果是输入框,可使用表格默认提供的编辑框; 配置editable为true即可,还可配置editableConfig配置执行类型等;具体editableConfig可查看详细签名'),
487
545
  React.createElement("br", null),
488
- React.createElement("b", null, "\u5BF9\u4E8E\u914D\u7F6E\u4E86\u7F16\u8F91\u7684\u8868\u683C\uFF0C\u4E00\u5B9A\u8981\u4F7F\u7528SCU\u6765\u4F18\u5316\u8868\u683C\u6E32\u67D3\uFF0C\u6B64\u4E3E\u53EF\u4EE5\u4F18\u5316\u8868\u683C\u6E32\u67D3"),
546
+ React.createElement("b", null, i18next.t('对于配置了编辑的表格,一定要使用SCU来优化表格渲染,此举可以优化表格渲染')),
489
547
  React.createElement("br", null),
490
- React.createElement("b", null, "\u5982\u679C\u914D\u7F6E\u4E86editable\uFF0C\u5E76\u4E14\u914D\u7F6E\u4E86SCU\u6765\u4F18\u5316\u6E32\u67D3\uFF0C\u90A3\u4E48\u521D\u59CB\u5316\u7684\u65F6\u5019\u9700\u8981\u7528\u4E00\u4E2A\u53D8\u91CF\u6807\u8BC6\u9996\u6B21\u9700\u8981\u6E32\u67D3"),
548
+ React.createElement("b", null, i18next.t('如果配置了editable,并且配置了SCU来优化渲染,那么初始化的时候需要用一个变量标识首次需要渲染')),
491
549
  React.createElement("br", null),
492
- React.createElement("b", null, "\u65B0\u589E\u5220\u9664\u884C\uFF0C\u8868\u683C\u62D6\u62FD\u6392\u5E8F\uFF1B"),
493
- "\u5BF9\u4E8E\u914D\u7F6E\u4E86SCU\u7684\u5217\uFF0C\u9700\u8981\u5728\u65B0\u589E\u5220\u9664\u7684\u65F6\u5019\u91CD\u65B0\u6E32\u67D3\uFF0C\u901A\u8FC7\u8BBE\u7F6Estate\u6807\u8BC6",
550
+ React.createElement("b", null, i18next.t('新增删除行,表格拖拽排序;')),
551
+ i18next.t('对于配置了SCU的列,需要在新增删除的时候重新渲染,通过设置state标识'),
494
552
  React.createElement("br", null),
495
- React.createElement("b", null, "\u8868\u683C\u81EA\u5B9A\u4E49\u9A8C\u8BC1\uFF0C\u4F20\u5165tableHandleRef\u4E00\u4E2ARef\u5BF9\u8C61\uFF0C\u53EF\u83B7\u53D6\u8868\u683C\u63D0\u4F9B\u76F8\u5173\u65B9\u6CD5"),
496
- React.createElement("p", null, "1.\u7F16\u5199\u9A8C\u8BC1\u89C4\u5219\uFF0C\u5728\u5217\u91CC\u9762\u7F16\u5199\uFF0C\u901A\u8FC7\u4F20\u5165validate\u5C5E\u6027\u914D\u7F6E,\u5177\u4F53\u53EF\u67E5\u770B\u7B7E\u540D \u5982\u679C\u53EA\u662F\u7B80\u5355\u7684\u975E\u7A7A\u9A8C\u8BC1\uFF0C\u90A3\u4E48\u53EF\u4F20\u5165\u4E00\u4E2A\u7A7A\u5BF9\u8C61\u5373\u53EF \u5982\u679C\u662F\u590D\u6742\u9A8C\u8BC1\u53EF\u901A\u8FC7validate\u4F20\u5165\u66F4\u591A\u914D\u7F6E"),
497
- React.createElement("p", null, "2.\u5982\u679C\u4F20\u5165\u4E86\u81EA\u5B9A\u4E49render\u51FD\u6570\uFF0C\u7EC4\u4EF6\u65E0\u6CD5\u638C\u63E1\u5728\u4F55\u65F6\u6E05\u7A7A\u9519\u8BEF\u4FE1\u606F\uFF0C\u6240\u4EE5\u9700\u8981\u8C03\u7528\u65B9\u4E3B\u52A8\u6E05\u7A7A\u9519\u8BEF\u4FE1\u606F")),
553
+ React.createElement("b", null, i18next.t('表格自定义验证,传入tableHandleRef一个Ref对象,可获取表格提供相关方法')),
554
+ React.createElement("p", null, i18next.t('1.编写验证规则,在列里面编写,通过传入validate属性配置,具体可查看签名 如果只是简单的非空验证,那么可传入一个空对象即可 如果是复杂验证可通过validate传入更多配置')),
555
+ React.createElement("p", null, i18next.t('2.如果传入了自定义render函数,组件无法掌握在何时清空错误信息,所以需要调用方主动清空错误信息'))),
498
556
  React.createElement(Button, { onClick: function () {
499
557
  console.log(records);
500
558
  (function () {
@@ -522,10 +580,25 @@ var EditableTable = function () {
522
580
  });
523
581
  });
524
582
  })();
525
- } }, "\u9A8C\u8BC1"),
583
+ } }, i18next.t('验证')),
526
584
  React.createElement(Button, { onClick: function () {
527
585
  console.log(records);
528
- } }, "\u83B7\u53D6\u6570\u636E"),
586
+ var ids = records.map(function (item) { return item.id; });
587
+ setExpandedRowKeys(ids);
588
+ } }, i18next.t('获取数据')),
589
+ React.createElement("button", { onClick: function () {
590
+ i++;
591
+ console.log(dataObj[i]);
592
+ setData(dataObj[i]);
593
+ } },
594
+ i18next.t('切换数据'),
595
+ i),
596
+ React.createElement("button", { onClick: function () {
597
+ i--;
598
+ setData(dataObj[i]);
599
+ } },
600
+ i18next.t('--切换数据'),
601
+ i),
529
602
  React.createElement(Table, { dataSource: records, columns: columns, rowKey: "id",
530
603
  // 表格项可输入
531
604
  onEditableSave: onEditableSaveHandle,
@@ -534,16 +607,29 @@ var EditableTable = function () {
534
607
  // 表格行拖拽
535
608
  onMoveRow: onMoveRowHandle,
536
609
  // tableValidate
537
- tableHandleRef: tableHandleRef, tableName: "\u6211\u662F\u4E00\u4E2A\u8868\u683C",
610
+ tableHandleRef: tableHandleRef, tableName: i18next.t('我是一个表格'),
538
611
  // 显隐配置
539
- configInfo: tableConfig, showColumnDynamic: true, showColumnDynamicKey: "test-o-0011", onTableChange: onTableChange, showInnerPagination: true, expandable: {
540
- expandedRowRender: function (record) { return React.createElement("p", { style: { margin: 0 } }, "111"); },
541
- rowExpandable: function (record) { return true; },
542
- },
543
- // scroll={{ x: 1000, y: 200 }}
544
- showDelAllBtn: true, delAllChange: onDelAllChange, rowSelection: {
612
+ // configInfo={tableConfig}
613
+ showColumnDynamic: true, showColumnDynamicKey: "test-o-0011", onTableChange: onTableChange, showInnerPagination: true, expandable: {
614
+ // expandedRowRender: (record) => <p style={{ margin: 0 }}>111</p>,
615
+ // rowExpandable: (record) => true,
616
+ expandedRowKeys: expandedRowKeys,
617
+ onExpand: function (expanded, record) {
618
+ if (expanded) {
619
+ setExpandedRowKeys(function (pre) { return __spreadArray(__spreadArray([], pre), [record === null || record === void 0 ? void 0 : record.id]); });
620
+ }
621
+ else {
622
+ setExpandedRowKeys(function (pre) {
623
+ var index = pre.findIndex(function (id) { return id === (record === null || record === void 0 ? void 0 : record.id); });
624
+ var newRecord = pre.slice();
625
+ newRecord.splice(index, 1);
626
+ return newRecord;
627
+ });
628
+ }
629
+ },
630
+ }, isOpenVirtualScrollBar: true, scroll: { x: 1200, y: 400 }, showDelAllBtn: true, delAllChange: onDelAllChange, rowSelection: {
545
631
  type: 'checkbox',
546
- }, summaryConfig: [
632
+ }, summaryFixed: true, summaryConfig: [
547
633
  {
548
634
  type: 'subtotal',
549
635
  fields: [