@bit-sun/business-component 2.3.22-beta7 → 2.3.22-beta8

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 (270) 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/docs/index.md +21 -21
  9. package/lib/assets/drag.svg +17 -17
  10. package/lib/assets/exportFail.svg +37 -37
  11. package/lib/assets/exportProcessing.svg +28 -28
  12. package/lib/assets/exportSuccess.svg +34 -34
  13. package/lib/assets/label_icon_bottom.svg +25 -25
  14. package/lib/assets/upExport.svg +22 -22
  15. package/package.json +78 -78
  16. package/src/assets/32.svg +27 -27
  17. package/src/assets/addIcon.svg +17 -17
  18. package/src/assets/allfunc.svg +27 -27
  19. package/src/assets/arrowRight.svg +24 -24
  20. package/src/assets/btn-delete.svg +29 -29
  21. package/src/assets/btn-edit.svg +19 -19
  22. package/src/assets/btn-more.svg +17 -17
  23. package/src/assets/btn-submit.svg +19 -19
  24. package/src/assets/caidan.svg +11 -11
  25. package/src/assets/close.svg +26 -26
  26. package/src/assets/drag.svg +17 -17
  27. package/src/assets/exportFail.svg +37 -37
  28. package/src/assets/exportProcessing.svg +28 -28
  29. package/src/assets/exportSuccess.svg +34 -34
  30. package/src/assets/fixed-left-active.svg +11 -11
  31. package/src/assets/fixed-left.svg +15 -15
  32. package/src/assets/fixed-right-active.svg +11 -11
  33. package/src/assets/fixed-right.svg +15 -15
  34. package/src/assets/guanbi.svg +15 -15
  35. package/src/assets/icon-quanping.svg +15 -15
  36. package/src/assets/icon-shezhi.svg +17 -17
  37. package/src/assets/label_icon_bottom.svg +25 -25
  38. package/src/assets/list-no-img.svg +21 -21
  39. package/src/assets/morentouxiang-32.svg +23 -23
  40. package/src/assets/scanning.svg +24 -24
  41. package/src/assets/upExport.svg +22 -22
  42. package/src/common/ENUM.ts +41 -41
  43. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  44. package/src/components/Business/AddSelectBusiness/index.tsx +1060 -1060
  45. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  46. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  47. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  48. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  49. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  50. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  57. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  58. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  59. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  60. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  61. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  62. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  63. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  64. package/src/components/Business/BsLayouts/index.less +79 -79
  65. package/src/components/Business/BsLayouts/index.tsx +1484 -1484
  66. package/src/components/Business/BsLayouts/service.ts +10 -10
  67. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  68. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +565 -564
  69. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  70. package/src/components/Business/BsSulaQueryTable/index.tsx +531 -531
  71. package/src/components/Business/BsSulaQueryTable/setting.tsx +853 -852
  72. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  73. package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -690
  74. package/src/components/Business/CommodityEntry/index.md +70 -70
  75. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  76. package/src/components/Business/CommonAlert/index.tsx +23 -23
  77. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  78. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  79. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  80. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  81. package/src/components/Business/DetailPageWrapper/index.tsx +313 -313
  82. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  83. package/src/components/Business/HomePageWrapper/index.less +33 -33
  84. package/src/components/Business/HomePageWrapper/index.md +45 -45
  85. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  86. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  87. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  88. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  89. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  90. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  91. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  92. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  93. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  94. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  95. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  96. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  97. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  98. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  99. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  100. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  101. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  102. package/src/components/Business/JsonQueryTable/index.less +16 -16
  103. package/src/components/Business/JsonQueryTable/index.md +328 -328
  104. package/src/components/Business/JsonQueryTable/index.tsx +535 -535
  105. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  106. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  107. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  108. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  109. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  110. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  111. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  112. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  113. package/src/components/Business/JsonQueryTable/static.ts +390 -390
  114. package/src/components/Business/SearchSelect/BusinessUtils.ts +1762 -1762
  115. package/src/components/Business/SearchSelect/common.ts +75 -75
  116. package/src/components/Business/SearchSelect/index.md +1329 -1329
  117. package/src/components/Business/SearchSelect/index.tsx +55 -55
  118. package/src/components/Business/SearchSelect/utils.ts +100 -100
  119. package/src/components/Business/StateFlow/index.less +130 -130
  120. package/src/components/Business/StateFlow/index.md +60 -60
  121. package/src/components/Business/StateFlow/index.tsx +29 -29
  122. package/src/components/Business/TreeSearchSelect/index.md +156 -156
  123. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  124. package/src/components/Business/TreeSearchSelect/utils.ts +75 -75
  125. package/src/components/Business/columnSettingTable/columnSetting.tsx +765 -764
  126. package/src/components/Business/columnSettingTable/index.less +247 -247
  127. package/src/components/Business/columnSettingTable/index.md +357 -357
  128. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  129. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  130. package/src/components/Business/columnSettingTable/utils.tsx +71 -71
  131. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  132. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  133. package/src/components/Business/moreTreeTable/index.less +99 -99
  134. package/src/components/Business/moreTreeTable/index.md +448 -448
  135. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  136. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  137. package/src/components/Functional/AddSelect/helps.ts +79 -79
  138. package/src/components/Functional/AddSelect/index.less +367 -367
  139. package/src/components/Functional/AddSelect/index.md +155 -155
  140. package/src/components/Functional/AddSelect/index.tsx +1170 -1170
  141. package/src/components/Functional/BillEntry/index.less +371 -371
  142. package/src/components/Functional/BillEntry/index.md +39 -39
  143. package/src/components/Functional/BillEntry/index.tsx +772 -772
  144. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  145. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  146. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  147. package/src/components/Functional/DataImport/index.less +63 -63
  148. package/src/components/Functional/DataImport/index.md +44 -44
  149. package/src/components/Functional/DataImport/index.tsx +695 -695
  150. package/src/components/Functional/DataValidation/index.less +63 -63
  151. package/src/components/Functional/DataValidation/index.md +39 -39
  152. package/src/components/Functional/DataValidation/index.tsx +687 -687
  153. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  154. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  155. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  156. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  157. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  158. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  159. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  160. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  161. package/src/components/Functional/SearchSelect/index.less +115 -115
  162. package/src/components/Functional/SearchSelect/index.md +141 -141
  163. package/src/components/Functional/SearchSelect/index.tsx +879 -879
  164. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  165. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  166. package/src/components/Functional/TreeSearchSelect/index.tsx +199 -199
  167. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  168. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  169. package/src/components/Solution/RuleComponent/index.js +2032 -2032
  170. package/src/components/Solution/RuleComponent/index.less +230 -230
  171. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  172. package/src/components/Solution/RuleComponent/ruleFiled.js +2107 -2107
  173. package/src/components/Solution/RuleComponent/services.ts +13 -13
  174. package/src/components/Solution/RuleComponent/util.js +139 -139
  175. package/src/index.ts +38 -38
  176. package/src/plugin/TableColumnSetting/index.less +247 -247
  177. package/src/plugin/TableColumnSetting/index.md +50 -50
  178. package/src/plugin/TableColumnSetting/index.tsx +725 -724
  179. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  180. package/src/styles/bsDefault.less +1890 -1890
  181. package/src/utils/CheckOneUser/index.md +39 -39
  182. package/src/utils/CheckOneUser/index.ts +51 -51
  183. package/src/utils/LocalstorageUtils.ts +114 -95
  184. package/src/utils/TableUtils.tsx +18 -18
  185. package/src/utils/checkUtils.ts +39 -39
  186. package/src/utils/enumConfig.ts +11 -11
  187. package/src/utils/getFormMode.js +12 -12
  188. package/src/utils/index.ts +4 -4
  189. package/src/utils/requestUtils.ts +42 -34
  190. package/src/utils/serialize.js +7 -7
  191. package/src/utils/utils.ts +212 -212
  192. package/tsconfig.json +29 -29
  193. package/typings.d.ts +4 -4
  194. package/dist/common/ENUM.d.ts +0 -40
  195. package/dist/components/Business/AddSelectBusiness/index.d.ts +0 -3
  196. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +0 -4
  197. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +0 -4
  198. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +0 -4
  199. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +0 -17
  200. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +0 -30
  201. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +0 -3
  202. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +0 -2
  203. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +0 -4
  204. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +0 -4
  205. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +0 -2
  206. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +0 -8
  207. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +0 -8
  208. package/dist/components/Business/BsLayouts/index.d.ts +0 -18
  209. package/dist/components/Business/BsLayouts/service.d.ts +0 -1
  210. package/dist/components/Business/BsLayouts/utils.d.ts +0 -10
  211. package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +0 -60
  212. package/dist/components/Business/BsSulaQueryTable/index.d.ts +0 -2
  213. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +0 -60
  214. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +0 -98
  215. package/dist/components/Business/CommodityEntry/index.d.ts +0 -2
  216. package/dist/components/Business/CommonAlert/index.d.ts +0 -3
  217. package/dist/components/Business/CommonGuideWrapper/index.d.ts +0 -6
  218. package/dist/components/Business/DetailPageWrapper/index.d.ts +0 -9
  219. package/dist/components/Business/DetailPageWrapper/utils.d.ts +0 -8
  220. package/dist/components/Business/HomePageWrapper/index.d.ts +0 -3
  221. package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +0 -2
  222. package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +0 -2
  223. package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +0 -6
  224. package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +0 -2
  225. package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +0 -2
  226. package/dist/components/Business/JsonQueryTable/function.d.ts +0 -37
  227. package/dist/components/Business/JsonQueryTable/index.d.ts +0 -4
  228. package/dist/components/Business/JsonQueryTable/static.d.ts +0 -41
  229. package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +0 -5
  230. package/dist/components/Business/SearchSelect/common.d.ts +0 -25
  231. package/dist/components/Business/SearchSelect/index.d.ts +0 -3
  232. package/dist/components/Business/SearchSelect/utils.d.ts +0 -5
  233. package/dist/components/Business/StateFlow/index.d.ts +0 -3
  234. package/dist/components/Business/TreeSearchSelect/index.d.ts +0 -3
  235. package/dist/components/Business/TreeSearchSelect/utils.d.ts +0 -4
  236. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +0 -54
  237. package/dist/components/Business/columnSettingTable/index.d.ts +0 -16
  238. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +0 -17
  239. package/dist/components/Business/columnSettingTable/utils.d.ts +0 -8
  240. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +0 -3
  241. package/dist/components/Business/moreTreeTable/hooks/useSticky.d.ts +0 -8
  242. package/dist/components/Business/moreTreeTable/index.d.ts +0 -4
  243. package/dist/components/Business/moreTreeTable/utils.d.ts +0 -9
  244. package/dist/components/Functional/AddSelect/helps.d.ts +0 -14
  245. package/dist/components/Functional/AddSelect/index.d.ts +0 -3
  246. package/dist/components/Functional/BillEntry/index.d.ts +0 -4
  247. package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +0 -18
  248. package/dist/components/Functional/BsAntdSula/index.d.ts +0 -1
  249. package/dist/components/Functional/DataImport/index.d.ts +0 -144
  250. package/dist/components/Functional/DataValidation/index.d.ts +0 -144
  251. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +0 -12
  252. package/dist/components/Functional/QueryMutipleInput/index.d.ts +0 -5
  253. package/dist/components/Functional/SearchSelect/index.d.ts +0 -4
  254. package/dist/components/Functional/SearchSelect/utils.d.ts +0 -1
  255. package/dist/components/Functional/TreeSearchSelect/index.d.ts +0 -2
  256. package/dist/components/Solution/RuleComponent/Formula.d.ts +0 -8
  257. package/dist/components/Solution/RuleComponent/services.d.ts +0 -1
  258. package/dist/index.d.ts +0 -28
  259. package/dist/index.esm.js +0 -30768
  260. package/dist/index.js +0 -30815
  261. package/dist/plugin/TableColumnSetting/index.d.ts +0 -64
  262. package/dist/plugin/TableColumnSetting/utils.d.ts +0 -1
  263. package/dist/utils/CheckOneUser/index.d.ts +0 -2
  264. package/dist/utils/LocalstorageUtils.d.ts +0 -17
  265. package/dist/utils/TableUtils.d.ts +0 -11
  266. package/dist/utils/checkUtils.d.ts +0 -3
  267. package/dist/utils/enumConfig.d.ts +0 -12
  268. package/dist/utils/index.d.ts +0 -4
  269. package/dist/utils/requestUtils.d.ts +0 -1
  270. package/dist/utils/utils.d.ts +0 -23
@@ -1,852 +1,853 @@
1
- // @ts-nocheck
2
- import React from 'react';
3
- import {
4
- Table,
5
- message,
6
- Checkbox,
7
- Modal,
8
- Input,
9
- Button,
10
- Tooltip,
11
- Typography,
12
- } from 'antd';
13
- import {
14
- SortableContainer,
15
- SortableElement,
16
- SortableHandle,
17
- } from 'react-sortable-hoc';
18
- import axios from 'axios';
19
- import { SearchOutlined } from '@ant-design/icons';
20
- import { arrayMoveImmutable } from 'array-move';
21
- import shezhi from '../../../assets/icon-shezhi.svg';
22
- import close from '../../../assets/close.svg';
23
- import drag from '../../../assets/drag.svg';
24
- import fixedLeft from '../../../assets/fixed-left.svg';
25
- import fixedLeftActive from '../../../assets/fixed-left-active.svg';
26
- import fixedRight from '../../../assets/fixed-right.svg';
27
- import fixedRightActive from '../../../assets/fixed-right-active.svg';
28
- import './index.less';
29
- import ENUM from '@/utils/enumConfig';
30
-
31
- const DragHandle = SortableHandle(() => <img width={25} src={drag} />);
32
-
33
- const SortableItem = SortableElement((props) => <tr {...props} />);
34
- const SortableBody = SortableContainer((props) => <tbody {...props} />);
35
-
36
- class SortableTable extends React.Component {
37
- state = {
38
- dataSource: [],
39
- columns: [],
40
- sortDataSource: [],
41
- setVisible: false,
42
- searchDataSource: false,
43
- onSearchSort: false,
44
- isDefaultValue: false,
45
- defaultValue: [],
46
- bsTableCode: '', //设置table 列的标识
47
- };
48
-
49
- patchUserColumnConfig = (config) => {
50
- let that = this;
51
- let configvalue = config
52
- ? config.map((item) => ({
53
- key: item.key,
54
- dataIndex: item.dataIndex,
55
- width: item.width,
56
- hidden: item.hidden,
57
- fixed: item.fixed,
58
- }))
59
- : '';
60
- return new Promise((resolve: any, reject: any) => {
61
- axios({
62
- url: '/user/appConfig/saveUserOrder',
63
- method: 'POST',
64
- data: {
65
- code: that.state.bsTableCode,
66
- detail: configvalue ? JSON.stringify(configvalue) : '',
67
- },
68
- }).then((res:any) => {
69
- if (res?.data?.status === '0') {
70
- this.patchConfigToLocalstorage(configvalue);
71
- resolve({ status: '0' });
72
- } else {
73
- message.error('保存表头列自定义失败,请稍后尝试');
74
- reject('');
75
- }
76
- })
77
- })
78
- };
79
-
80
- getConfigFromlocalstorage = () => {
81
- let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
82
- let configArray = JSON.parse(config);
83
- let configSetting = configArray.filter(
84
- (item) => item.code === this.state.bsTableCode,
85
- );
86
-
87
- if (configSetting.length && configSetting[0].detail) {
88
- return JSON.parse(configSetting[0].detail);
89
- }
90
- return [];
91
- };
92
-
93
- patchConfigToLocalstorage = (configvalue) => {
94
- const { setShowColumns, datasource = [] } = this.props;
95
- const { sortDataSource, bsTableCode } = this.state;
96
- let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]'
97
- let configArray = JSON.parse(config)
98
- let currentSetting = configArray.filter(item => item.code === bsTableCode)
99
- if (currentSetting.length) {
100
- currentSetting[0].detail = JSON.stringify(configvalue)
101
- } else {
102
- configArray.push({
103
- "code": bsTableCode,
104
- "detail": JSON.stringify(configvalue)
105
- })
106
- }
107
-
108
- localStorage.setItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION, JSON.stringify(configArray));
109
- this.setState({
110
- visible: false,
111
- });
112
- if(configvalue){
113
- setShowColumns([...sortDataSource]);
114
- }else{
115
- this.setState({
116
- isDefaultValue: true,
117
- dataSource: [...datasource.map((item)=>({
118
- ...item,
119
- hidden: false
120
- }))],
121
- sortDataSource: [...datasource.map((item)=>({
122
- ...item,
123
- hidden: false
124
- }))]
125
- });
126
- setShowColumns([...datasource]);
127
- }
128
- };
129
-
130
- setInitValue = (isClick = false) => {
131
- const { datasource, showColumn }: any =
132
- this.props;
133
- let config = this.getConfigFromlocalstorage();
134
-
135
- this.setState({
136
- isDefaultValue: true,
137
- dataSource: datasource.map((item) => {
138
- let innerItem = config.filter(
139
- (inneritem) => {
140
- let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
141
- let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
142
- return innerKey && innerKey === itemKey;
143
- }
144
- );
145
- return {
146
- ...item,
147
- key: item.key || item.dataIndex,
148
- width: innerItem[0]?.width || item.width,
149
- hidden: config.length ? !innerItem.length : item.hidden,
150
- };
151
- }),
152
- defaultValue: datasource.map((item) => {
153
- let innerItem = config.filter(
154
- (inneritem) => {
155
- let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
156
- let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
157
- return innerKey && innerKey === itemKey;
158
- }
159
- );
160
- return {
161
- ...item,
162
- key: item.key || item.dataIndex,
163
- width: innerItem[0]?.width || item.width,
164
- hidden: config.length ? !innerItem.length : item.hidden,
165
- };
166
- }),
167
- sortDataSource: [...showColumn]
168
- });
169
- };
170
-
171
- componentDidMount() {
172
- const { datasource, showColumn, bsTableCode }: any =
173
- this.props;
174
- let config = this.getConfigFromlocalstorage();
175
-
176
- this.setState({
177
- dataSource: datasource.map((item) => {
178
- let innerItem = config.filter(
179
- (inneritem) => {
180
- let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
181
- let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
182
- return innerKey && innerKey === itemKey;
183
- }
184
- );
185
- return {
186
- ...item,
187
- key: item.key || item.dataIndex,
188
- width: innerItem[0]?.width || item.width,
189
- hidden: config.length ? !innerItem.length : item.hidden,
190
- };
191
- }),
192
- defaultValue: datasource.map((item) => {
193
- let innerItem = config.filter(
194
- (inneritem) => {
195
- let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
196
- let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
197
- return innerKey && innerKey === itemKey;
198
- }
199
- );
200
- return {
201
- ...item,
202
- key: item.key || item.dataIndex,
203
- width: innerItem[0]?.width || item.width,
204
- hidden: config.length ? !innerItem.length : item.hidden,
205
- };
206
- }),
207
- sortDataSource: datasource
208
- .filter((item) => !item.hidden)
209
- .map((item) => ({
210
- ...item,
211
- key: item.key || item.dataIndex,
212
- width:
213
- showColumn.filter(
214
- (inneritem) => {
215
- let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
216
- let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
217
- return innerKey && innerKey === itemKey;
218
- }
219
- )[0]?.width || item.width,
220
- })),
221
- bsTableCode
222
- });
223
- }
224
-
225
- columns = [
226
- {
227
- title: '列名称',
228
- dataIndex: 'title',
229
- className: 'drag-visible',
230
- width: 100,
231
- },
232
- {
233
- title: '列首',
234
- dataIndex: 'fixedLeft',
235
- render: (text, record) => {
236
- return (
237
- <span
238
- onClick={() => {
239
- const { sortDataSource } = this.state;
240
- if (record?.fixed !== 'left') {
241
- let newSortData = sortDataSource.map((item) => {
242
- if (item.title === record.title) {
243
- return {
244
- ...item,
245
- fixed: 'left',
246
- };
247
- }
248
- return item;
249
- });
250
- this.setState({
251
- sortDataSource: [
252
- ...newSortData.filter((item) => item.fixed === 'left'),
253
- ...newSortData.filter((item) => !item.fixed),
254
- ...newSortData.filter((item) => item.fixed === 'right'),
255
- ],
256
- isDefaultValue: false,
257
- dataSource: [
258
- ...this.state.dataSource.map((item) => {
259
- if (item.title === record.title) {
260
- return {
261
- ...item,
262
- fixed: 'left',
263
- };
264
- }
265
- return item;
266
- }),
267
- ],
268
- });
269
- } else {
270
- let newSortData = sortDataSource.map((item) => {
271
- if (item.title === record.title) {
272
- return {
273
- ...item,
274
- fixed: null,
275
- };
276
- }
277
- return item;
278
- });
279
- this.setState({
280
- sortDataSource: [
281
- ...newSortData.filter((item) => item.fixed === 'left'),
282
- ...newSortData.filter((item) => !item.fixed),
283
- ...newSortData.filter((item) => item.fixed === 'right'),
284
- ],
285
- isDefaultValue: false,
286
- dataSource: [
287
- ...this.state.dataSource.map((item) => {
288
- if (item.title === record.title) {
289
- return {
290
- ...item,
291
- fixed: null,
292
- };
293
- }
294
- return item;
295
- }),
296
- ],
297
- });
298
- }
299
- }}
300
- style={{ display: 'inline-block', width: '24px', textAlign: 'center' }}
301
- >
302
- <Tooltip
303
- placement="top"
304
- title={record?.fixed === 'left' ? '取消固定' : '固定列首'}
305
- >
306
- <img
307
- width={18}
308
- src={record?.fixed === 'left' ? fixedLeftActive : fixedLeft}
309
- />
310
- </Tooltip>
311
- </span>
312
- );
313
- },
314
- },
315
- {
316
- title: '列尾',
317
- dataIndex: 'fixedRight',
318
- render: (text, record) => {
319
- return (
320
- <span
321
- onClick={() => {
322
- const { sortDataSource } = this.state;
323
- if (record?.fixed !== 'right') {
324
- let newSortData = sortDataSource.map((item) => {
325
- if (item.title === record.title) {
326
- return {
327
- ...item,
328
- fixed: 'right',
329
- };
330
- }
331
- return item;
332
- });
333
- this.setState({
334
- sortDataSource: [
335
- ...newSortData.filter((item) => item.fixed === 'left'),
336
- ...newSortData.filter((item) => !item.fixed),
337
- ...newSortData.filter((item) => item.fixed === 'right'),
338
- ],
339
- isDefaultValue: false,
340
- dataSource: [
341
- ...this.state.dataSource.map((item) => {
342
- if (item.title === record.title) {
343
- return {
344
- ...item,
345
- fixed: 'right',
346
- };
347
- }
348
- return item;
349
- }),
350
- ],
351
- });
352
- } else {
353
- let newSortData = sortDataSource.map((item) => {
354
- if (item.title === record.title) {
355
- return {
356
- ...item,
357
- fixed: null,
358
- };
359
- }
360
- return item;
361
- });
362
- this.setState({
363
- sortDataSource: [
364
- ...newSortData.filter((item) => item.fixed === 'left'),
365
- ...newSortData.filter((item) => !item.fixed),
366
- ...newSortData.filter((item) => item.fixed === 'right'),
367
- ],
368
- isDefaultValue: false,
369
- dataSource: [
370
- ...this.state.dataSource.map((item) => {
371
- if (item.title === record.title) {
372
- return {
373
- ...item,
374
- fixed: null,
375
- };
376
- }
377
- return item;
378
- }),
379
- ],
380
- });
381
- }
382
- }}
383
- style={{ display: 'inline-block', width: '24px', textAlign: 'center' }}
384
- >
385
- <Tooltip
386
- placement="top"
387
- title={record?.fixed === 'right' ? '取消固定' : '固定列尾'}
388
- >
389
- <img
390
- width={18}
391
- src={record?.fixed === 'right' ? fixedRightActive : fixedRight}
392
- />
393
- </Tooltip>
394
- </span>
395
- );
396
- },
397
- },
398
- {
399
- title: '删除',
400
- dataIndex: 'title1',
401
- render: (text, record) => {
402
- return (
403
- <span
404
- onClick={() => {
405
- this.setState({
406
- sortDataSource: this.state.sortDataSource.filter((item) => {
407
- return item.title !== record.title;
408
- }),
409
- isDefaultValue: false,
410
- dataSource: [
411
- ...this.state.dataSource.map((item) => {
412
- if (item.title === record.title) {
413
- return {
414
- ...item,
415
- hidden: true,
416
- };
417
- }
418
-
419
- return item;
420
- }),
421
- ],
422
- });
423
- }}
424
- >
425
- <img width={24} src={close} />
426
- </span>
427
- );
428
- },
429
- },
430
- {
431
- title: 'Sort',
432
- dataIndex: 'sort',
433
- className: 'drag-visible',
434
- render: () => <DragHandle />,
435
- },
436
- ];
437
-
438
- showModal = () => {
439
- this.setState({
440
- visible: true,
441
- });
442
- this.setInitValue();
443
- };
444
-
445
- handleOk = (e?: React.MouseEvent<HTMLElement>) => {
446
- const { sortDataSource, isDefaultValue, defaultValue } = this.state;
447
- if (!sortDataSource.length) {
448
- message.warning('至少选择一列!');
449
- return;
450
- }
451
- // if (isDefaultValue) {
452
- // this.patchUserColumnConfig('');
453
- // return;
454
- // }
455
- return this.patchUserColumnConfig(sortDataSource);
456
- };
457
-
458
- handleCancel = (e: React.MouseEvent<HTMLElement>) => {
459
- console.log(e);
460
- this.setState({
461
- visible: false,
462
- });
463
- };
464
-
465
- handleTableHeadHidden = (title: string) => {
466
- const { sortDataSource, dataSource } = this.state;
467
- this.setState(
468
- {
469
- sortDataSource: sortDataSource.filter((item) => {
470
- return item.title !== title;
471
- }),
472
- dataSource: [
473
- ...dataSource.map((item) => {
474
- if (item.title === title) {
475
- return {
476
- ...item,
477
- hidden: true,
478
- };
479
- }
480
-
481
- return item;
482
- }),
483
- ],
484
- },
485
- () => {
486
- this.handleOk()
487
- .then((res: any) => {
488
- if (res.status === '0') {
489
- message.success(<span>
490
- 字段已隐藏,如需重新显示请前往<Typography.Link
491
- underline
492
- onClick={this.showModal}
493
- >列设置</Typography.Link>
494
- </span>)
495
- }
496
- });
497
- },
498
- );
499
- };
500
-
501
- onSortEnd = ({ oldIndex, newIndex }) => {
502
- const { sortDataSource } = this.state;
503
- if (oldIndex !== newIndex) {
504
- const newData = arrayMoveImmutable(
505
- [].concat(sortDataSource),
506
- oldIndex,
507
- newIndex,
508
- ).filter((el) => !!el);
509
- this.setState({
510
- sortDataSource: [
511
- ...newData.filter((item) => item.fixed === 'left'),
512
- ...newData.filter((item) => !item.fixed),
513
- ...newData.filter((item) => item.fixed === 'right'),
514
- ],
515
- isDefaultValue: false,
516
- });
517
- }
518
- };
519
-
520
- DraggableContainer = (props) => (
521
- <SortableBody
522
- useDragHandle
523
- disableAutoscroll
524
- helperClass="row-dragging"
525
- onSortEnd={this.onSortEnd}
526
- {...props}
527
- />
528
- );
529
-
530
- DraggableBodyRow = ({ className, style, ...restProps }) => {
531
- const { sortDataSource } = this.state;
532
- // function findIndex base on Table rowKey props and should always be a right array index
533
- const index = sortDataSource.findIndex(
534
- (x) => x.key === restProps['data-row-key'],
535
- );
536
- return <SortableItem index={index} {...restProps} />;
537
- };
538
-
539
- onChange = (e: CheckboxChangeEvent, title) => {
540
- const { sortDataSource, dataSource } = this.state;
541
- if (!e.target.checked) {
542
- this.setState({
543
- sortDataSource: sortDataSource.filter((item) => {
544
- return item.title !== title;
545
- }),
546
- isDefaultValue: false,
547
- dataSource: [
548
- ...dataSource.map((item) => {
549
- if (item.title === title) {
550
- return {
551
- ...item,
552
- hidden: true,
553
- };
554
- }
555
-
556
- return item;
557
- }),
558
- ],
559
- });
560
- } else {
561
- let fixedLeft: any[] = [];
562
- let fixedRight: any[] = [];
563
- let noFixedSortSource: any = [];
564
- let newSortData = [
565
- ...sortDataSource,
566
- ...dataSource
567
- .filter((item) => item.title === title)
568
- .map((source) => {
569
- return {
570
- ...source,
571
- hidden: false,
572
- };
573
- }),
574
- ];
575
- newSortData.forEach((item) => {
576
- if (item?.fixed === 'left') {
577
- fixedLeft.push(item);
578
- } else if (item?.fixed === 'right') {
579
- fixedRight.push(item);
580
- } else {
581
- noFixedSortSource.push(item);
582
- }
583
- });
584
- this.setState({
585
- sortDataSource: [...fixedLeft, ...noFixedSortSource, ...fixedRight],
586
- isDefaultValue: false,
587
- dataSource: [
588
- ...dataSource.map((item) => {
589
- if (item.title === title) {
590
- return {
591
- ...item,
592
- hidden: false,
593
- };
594
- }
595
-
596
- return item;
597
- }),
598
- ],
599
- });
600
- }
601
- };
602
-
603
- handleReset = () => {
604
- this.setInitValue(true);
605
- };
606
-
607
- handleResetSetting = () =>{
608
- this.patchUserColumnConfig('');
609
- }
610
-
611
- onSearch = (e: any) => {
612
- this.setState({
613
- searchDataSource: e.target.value,
614
- });
615
- };
616
-
617
- onSearchSort = (e: any) => {
618
- this.setState({
619
- onSearchSort: e.target.value,
620
- });
621
- };
622
-
623
- render() {
624
- const { onlyModal } = this.props;
625
- const {
626
- dataSource,
627
- searchDataSource,
628
- sortDataSource,
629
- visible,
630
- onSearchSort,
631
- } = this.state;
632
-
633
- let seatchDataSource = dataSource.filter(
634
- (item) => item?.title?.indexOf(searchDataSource || '') > -1,
635
- );
636
-
637
- return (
638
- <div className={'sort_table_wrapper'}>
639
- {visible && (
640
- <Modal
641
- title="设置表头内容"
642
- wrapClassName={'sort_table_wrapper'}
643
- width={820}
644
- visible={visible}
645
- onOk={this.handleOk}
646
- onCancel={this.handleCancel}
647
- footer={[
648
- <div>
649
- <Button key="back" onClick={this.handleReset} style={{marginRight: 0}}>
650
- 恢复默认
651
- </Button>,
652
- <Button key="back" onClick={this.handleResetSetting}>
653
- 重置设置
654
- </Button>
655
- </div>,
656
- <div>
657
- <Button key="submit" onClick={this.handleCancel} style={{marginRight: 0}}>
658
- 取消
659
- </Button>,
660
- <Button key="submit" type="primary" onClick={this.handleOk}>
661
- 确认
662
- </Button>
663
- </div>
664
- ]}
665
- >
666
- <div className={'sort_table'}>
667
- <div className={'sort_table_column_wrapper'}>
668
- <span className={'sort_table_column_count'}>
669
- 可选字段 <span>(共{dataSource.length}个)</span>
670
- </span>
671
- <div className={'sort_table_column'}>
672
- <Input
673
- prefix={<SearchOutlined className="site-form-item-icon" />}
674
- placeholder="搜索"
675
- allowClear
676
- onChange={this.onSearch}
677
- style={{ width: 540 }}
678
- />
679
- <div>
680
- {!searchDataSource && (
681
- <Checkbox
682
- checked={
683
- !dataSource.some((item) => {
684
- if (item.hidden) return true;
685
-
686
- return false;
687
- })
688
- }
689
- onClick={(e) => {
690
- this.setState({
691
- isDefaultValue: false,
692
- dataSource: [
693
- ...dataSource.map((item) => {
694
- return {
695
- ...item,
696
- hidden: !e.target.checked,
697
- };
698
- }),
699
- ],
700
- sortDataSource: e.target.checked
701
- ? [
702
- ...dataSource
703
- .filter((item) => item.fixed === 'left')
704
- .map((item) => ({
705
- ...item,
706
- hidden: false,
707
- })),
708
- ...dataSource
709
- .filter((item) => !item.fixed)
710
- .map((item) => ({
711
- ...item,
712
- hidden: false,
713
- })),
714
- ...dataSource
715
- .filter((item) => item.fixed === 'right')
716
- .map((item) => ({
717
- ...item,
718
- hidden: false,
719
- })),
720
- ]
721
- : [],
722
- });
723
- }}
724
- >
725
- 全选
726
- </Checkbox>
727
- )}
728
- </div>
729
- <div className={'sort_table_column_all'}>
730
- {searchDataSource
731
- ? seatchDataSource.map((item) => {
732
- return (
733
- <Checkbox
734
- checked={!item.hidden}
735
- onChange={(e) => {
736
- this.onChange(e, item.title);
737
- }}
738
- >
739
- {item.title}
740
- </Checkbox>
741
- );
742
- })
743
- : dataSource
744
- .filter(
745
- (item) =>
746
- item?.title?.indexOf('人') === -1 &&
747
- item?.title?.indexOf('日期') === -1,
748
- )
749
- .map((item) => {
750
- return (
751
- <Checkbox
752
- checked={!item.hidden}
753
- onChange={(e) => {
754
- this.onChange(e, item.title);
755
- }}
756
- >
757
- {item.title}
758
- </Checkbox>
759
- );
760
- })}
761
- {!!seatchDataSource.length && (
762
- <span style={{ width: '144px' }}></span>
763
- )}
764
-
765
- {!seatchDataSource.length && (
766
- <div className={'sort_table_column_all_empty'}>
767
- 未查询到结果
768
- </div>
769
- )}
770
- </div>
771
- {!searchDataSource && (
772
- <div>
773
- <div className={'sort_table_column_special'}>
774
- <span>人员时间字段</span>
775
- </div>
776
- <div className={'sort_table_column_all'}>
777
- {[...dataSource]
778
- .filter(
779
- (item) =>
780
- item?.title?.indexOf('人') > -1 ||
781
- item?.title?.indexOf('日期') > -1,
782
- )
783
- .map((item) => {
784
- return (
785
- <Checkbox
786
- checked={!item.hidden}
787
- onChange={(e) => {
788
- this.onChange(e, item.title);
789
- }}
790
- >
791
- {item.title}
792
- </Checkbox>
793
- );
794
- })}
795
- <span style={{ width: '144px' }}></span>
796
- </div>
797
- </div>
798
- )}
799
- </div>
800
- </div>
801
- <div className={'sort_table_content_wrapper'}>
802
- <span className={'sort_table_content_count'}>
803
- 已选字段 <span>(共{sortDataSource.length}个)</span>
804
- </span>
805
- <div className={'sort_table_content'}>
806
- <span style={{ paddingLeft: '10px' }}>
807
- <Input
808
- prefix={
809
- <SearchOutlined className="site-form-item-icon" />
810
- }
811
- placeholder="搜索"
812
- allowClear
813
- onChange={this.onSearchSort}
814
- style={{ width: 190 }}
815
- />
816
- </span>
817
- <Table
818
- pagination={false}
819
- showHeader={false}
820
- dataSource={
821
- onSearchSort
822
- ? sortDataSource.filter(
823
- (item) => item?.title?.indexOf(onSearchSort) > -1,
824
- )
825
- : sortDataSource
826
- }
827
- columns={this.columns}
828
- rowKey="key"
829
- // rowSelection={rowSelection}
830
- components={{
831
- body: {
832
- wrapper: this.DraggableContainer,
833
- row: this.DraggableBodyRow,
834
- },
835
- }}
836
- />
837
- </div>
838
- </div>
839
- </div>
840
- </Modal>
841
- )}
842
- {
843
- !onlyModal
844
- ? <div onClick={this.showModal} style={{fontSize:14}}>列设置</div>
845
- : ''
846
- }
847
- </div>
848
- );
849
- }
850
- }
851
-
852
- export default SortableTable;
1
+ // @ts-nocheck
2
+ import React from 'react';
3
+ import {
4
+ Table,
5
+ message,
6
+ Checkbox,
7
+ Modal,
8
+ Input,
9
+ Button,
10
+ Tooltip,
11
+ Typography,
12
+ } from 'antd';
13
+ import {
14
+ SortableContainer,
15
+ SortableElement,
16
+ SortableHandle,
17
+ } from 'react-sortable-hoc';
18
+ import axios from 'axios';
19
+ import { SearchOutlined } from '@ant-design/icons';
20
+ import { arrayMoveImmutable } from 'array-move';
21
+ import shezhi from '../../../assets/icon-shezhi.svg';
22
+ import close from '../../../assets/close.svg';
23
+ import drag from '../../../assets/drag.svg';
24
+ import fixedLeft from '../../../assets/fixed-left.svg';
25
+ import fixedLeftActive from '../../../assets/fixed-left-active.svg';
26
+ import fixedRight from '../../../assets/fixed-right.svg';
27
+ import fixedRightActive from '../../../assets/fixed-right-active.svg';
28
+ import './index.less';
29
+ import ENUM from '@/utils/enumConfig';
30
+
31
+ const DragHandle = SortableHandle(() => <img width={25} src={drag} />);
32
+
33
+ const SortableItem = SortableElement((props) => <tr {...props} />);
34
+ const SortableBody = SortableContainer((props) => <tbody {...props} />);
35
+
36
+ class SortableTable extends React.Component {
37
+ state = {
38
+ dataSource: [],
39
+ columns: [],
40
+ sortDataSource: [],
41
+ setVisible: false,
42
+ searchDataSource: false,
43
+ onSearchSort: false,
44
+ isDefaultValue: false,
45
+ defaultValue: [],
46
+ bsTableCode: '', //设置table 列的标识
47
+ };
48
+
49
+ patchUserColumnConfig = (config) => {
50
+ let that = this;
51
+ let configvalue = config
52
+ ? config.map((item) => ({
53
+ key: item.key,
54
+ dataIndex: item.dataIndex,
55
+ width: item.width,
56
+ hidden: item.hidden,
57
+ fixed: item.fixed,
58
+ }))
59
+ : '';
60
+ return new Promise((resolve: any, reject: any) => {
61
+ axios({
62
+ // url: '/user/appConfig/saveUserOrder',
63
+ url: '/api/mallops/appConfig/saveUserOrder', //赢家地址
64
+ method: 'POST',
65
+ data: {
66
+ code: that.state.bsTableCode,
67
+ detail: configvalue ? JSON.stringify(configvalue) : '',
68
+ },
69
+ }).then((res:any) => {
70
+ if (res?.data?.status === '0') {
71
+ this.patchConfigToLocalstorage(configvalue);
72
+ resolve({ status: '0' });
73
+ } else {
74
+ message.error('保存表头列自定义失败,请稍后尝试');
75
+ reject('');
76
+ }
77
+ })
78
+ })
79
+ };
80
+
81
+ getConfigFromlocalstorage = () => {
82
+ let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
83
+ let configArray = JSON.parse(config);
84
+ let configSetting = configArray.filter(
85
+ (item) => item.code === this.state.bsTableCode,
86
+ );
87
+
88
+ if (configSetting.length && configSetting[0].detail) {
89
+ return JSON.parse(configSetting[0].detail);
90
+ }
91
+ return [];
92
+ };
93
+
94
+ patchConfigToLocalstorage = (configvalue) => {
95
+ const { setShowColumns, datasource = [] } = this.props;
96
+ const { sortDataSource, bsTableCode } = this.state;
97
+ let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]'
98
+ let configArray = JSON.parse(config)
99
+ let currentSetting = configArray.filter(item => item.code === bsTableCode)
100
+ if (currentSetting.length) {
101
+ currentSetting[0].detail = JSON.stringify(configvalue)
102
+ } else {
103
+ configArray.push({
104
+ "code": bsTableCode,
105
+ "detail": JSON.stringify(configvalue)
106
+ })
107
+ }
108
+
109
+ localStorage.setItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION, JSON.stringify(configArray));
110
+ this.setState({
111
+ visible: false,
112
+ });
113
+ if(configvalue){
114
+ setShowColumns([...sortDataSource]);
115
+ }else{
116
+ this.setState({
117
+ isDefaultValue: true,
118
+ dataSource: [...datasource.map((item)=>({
119
+ ...item,
120
+ hidden: false
121
+ }))],
122
+ sortDataSource: [...datasource.map((item)=>({
123
+ ...item,
124
+ hidden: false
125
+ }))]
126
+ });
127
+ setShowColumns([...datasource]);
128
+ }
129
+ };
130
+
131
+ setInitValue = (isClick = false) => {
132
+ const { datasource, showColumn }: any =
133
+ this.props;
134
+ let config = this.getConfigFromlocalstorage();
135
+
136
+ this.setState({
137
+ isDefaultValue: true,
138
+ dataSource: datasource.map((item) => {
139
+ let innerItem = config.filter(
140
+ (inneritem) => {
141
+ let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
142
+ let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
143
+ return innerKey && innerKey === itemKey;
144
+ }
145
+ );
146
+ return {
147
+ ...item,
148
+ key: item.key || item.dataIndex,
149
+ width: innerItem[0]?.width || item.width,
150
+ hidden: config.length ? !innerItem.length : item.hidden,
151
+ };
152
+ }),
153
+ defaultValue: datasource.map((item) => {
154
+ let innerItem = config.filter(
155
+ (inneritem) => {
156
+ let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
157
+ let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
158
+ return innerKey && innerKey === itemKey;
159
+ }
160
+ );
161
+ return {
162
+ ...item,
163
+ key: item.key || item.dataIndex,
164
+ width: innerItem[0]?.width || item.width,
165
+ hidden: config.length ? !innerItem.length : item.hidden,
166
+ };
167
+ }),
168
+ sortDataSource: [...showColumn]
169
+ });
170
+ };
171
+
172
+ componentDidMount() {
173
+ const { datasource, showColumn, bsTableCode }: any =
174
+ this.props;
175
+ let config = this.getConfigFromlocalstorage();
176
+
177
+ this.setState({
178
+ dataSource: datasource.map((item) => {
179
+ let innerItem = config.filter(
180
+ (inneritem) => {
181
+ let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
182
+ let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
183
+ return innerKey && innerKey === itemKey;
184
+ }
185
+ );
186
+ return {
187
+ ...item,
188
+ key: item.key || item.dataIndex,
189
+ width: innerItem[0]?.width || item.width,
190
+ hidden: config.length ? !innerItem.length : item.hidden,
191
+ };
192
+ }),
193
+ defaultValue: datasource.map((item) => {
194
+ let innerItem = config.filter(
195
+ (inneritem) => {
196
+ let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
197
+ let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
198
+ return innerKey && innerKey === itemKey;
199
+ }
200
+ );
201
+ return {
202
+ ...item,
203
+ key: item.key || item.dataIndex,
204
+ width: innerItem[0]?.width || item.width,
205
+ hidden: config.length ? !innerItem.length : item.hidden,
206
+ };
207
+ }),
208
+ sortDataSource: datasource
209
+ .filter((item) => !item.hidden)
210
+ .map((item) => ({
211
+ ...item,
212
+ key: item.key || item.dataIndex,
213
+ width:
214
+ showColumn.filter(
215
+ (inneritem) => {
216
+ let innerKey = Array.isArray(inneritem.key || inneritem.dataIndex) ? JSON.stringify(inneritem.key || inneritem.dataIndex) : (inneritem.key || inneritem.dataIndex);
217
+ let itemKey = Array.isArray(item.key || item.dataIndex) ? JSON.stringify(item.key || item.dataIndex) : (item.key || item.dataIndex);
218
+ return innerKey && innerKey === itemKey;
219
+ }
220
+ )[0]?.width || item.width,
221
+ })),
222
+ bsTableCode
223
+ });
224
+ }
225
+
226
+ columns = [
227
+ {
228
+ title: '列名称',
229
+ dataIndex: 'title',
230
+ className: 'drag-visible',
231
+ width: 100,
232
+ },
233
+ {
234
+ title: '列首',
235
+ dataIndex: 'fixedLeft',
236
+ render: (text, record) => {
237
+ return (
238
+ <span
239
+ onClick={() => {
240
+ const { sortDataSource } = this.state;
241
+ if (record?.fixed !== 'left') {
242
+ let newSortData = sortDataSource.map((item) => {
243
+ if (item.title === record.title) {
244
+ return {
245
+ ...item,
246
+ fixed: 'left',
247
+ };
248
+ }
249
+ return item;
250
+ });
251
+ this.setState({
252
+ sortDataSource: [
253
+ ...newSortData.filter((item) => item.fixed === 'left'),
254
+ ...newSortData.filter((item) => !item.fixed),
255
+ ...newSortData.filter((item) => item.fixed === 'right'),
256
+ ],
257
+ isDefaultValue: false,
258
+ dataSource: [
259
+ ...this.state.dataSource.map((item) => {
260
+ if (item.title === record.title) {
261
+ return {
262
+ ...item,
263
+ fixed: 'left',
264
+ };
265
+ }
266
+ return item;
267
+ }),
268
+ ],
269
+ });
270
+ } else {
271
+ let newSortData = sortDataSource.map((item) => {
272
+ if (item.title === record.title) {
273
+ return {
274
+ ...item,
275
+ fixed: null,
276
+ };
277
+ }
278
+ return item;
279
+ });
280
+ this.setState({
281
+ sortDataSource: [
282
+ ...newSortData.filter((item) => item.fixed === 'left'),
283
+ ...newSortData.filter((item) => !item.fixed),
284
+ ...newSortData.filter((item) => item.fixed === 'right'),
285
+ ],
286
+ isDefaultValue: false,
287
+ dataSource: [
288
+ ...this.state.dataSource.map((item) => {
289
+ if (item.title === record.title) {
290
+ return {
291
+ ...item,
292
+ fixed: null,
293
+ };
294
+ }
295
+ return item;
296
+ }),
297
+ ],
298
+ });
299
+ }
300
+ }}
301
+ style={{ display: 'inline-block', width: '24px', textAlign: 'center' }}
302
+ >
303
+ <Tooltip
304
+ placement="top"
305
+ title={record?.fixed === 'left' ? '取消固定' : '固定列首'}
306
+ >
307
+ <img
308
+ width={18}
309
+ src={record?.fixed === 'left' ? fixedLeftActive : fixedLeft}
310
+ />
311
+ </Tooltip>
312
+ </span>
313
+ );
314
+ },
315
+ },
316
+ {
317
+ title: '列尾',
318
+ dataIndex: 'fixedRight',
319
+ render: (text, record) => {
320
+ return (
321
+ <span
322
+ onClick={() => {
323
+ const { sortDataSource } = this.state;
324
+ if (record?.fixed !== 'right') {
325
+ let newSortData = sortDataSource.map((item) => {
326
+ if (item.title === record.title) {
327
+ return {
328
+ ...item,
329
+ fixed: 'right',
330
+ };
331
+ }
332
+ return item;
333
+ });
334
+ this.setState({
335
+ sortDataSource: [
336
+ ...newSortData.filter((item) => item.fixed === 'left'),
337
+ ...newSortData.filter((item) => !item.fixed),
338
+ ...newSortData.filter((item) => item.fixed === 'right'),
339
+ ],
340
+ isDefaultValue: false,
341
+ dataSource: [
342
+ ...this.state.dataSource.map((item) => {
343
+ if (item.title === record.title) {
344
+ return {
345
+ ...item,
346
+ fixed: 'right',
347
+ };
348
+ }
349
+ return item;
350
+ }),
351
+ ],
352
+ });
353
+ } else {
354
+ let newSortData = sortDataSource.map((item) => {
355
+ if (item.title === record.title) {
356
+ return {
357
+ ...item,
358
+ fixed: null,
359
+ };
360
+ }
361
+ return item;
362
+ });
363
+ this.setState({
364
+ sortDataSource: [
365
+ ...newSortData.filter((item) => item.fixed === 'left'),
366
+ ...newSortData.filter((item) => !item.fixed),
367
+ ...newSortData.filter((item) => item.fixed === 'right'),
368
+ ],
369
+ isDefaultValue: false,
370
+ dataSource: [
371
+ ...this.state.dataSource.map((item) => {
372
+ if (item.title === record.title) {
373
+ return {
374
+ ...item,
375
+ fixed: null,
376
+ };
377
+ }
378
+ return item;
379
+ }),
380
+ ],
381
+ });
382
+ }
383
+ }}
384
+ style={{ display: 'inline-block', width: '24px', textAlign: 'center' }}
385
+ >
386
+ <Tooltip
387
+ placement="top"
388
+ title={record?.fixed === 'right' ? '取消固定' : '固定列尾'}
389
+ >
390
+ <img
391
+ width={18}
392
+ src={record?.fixed === 'right' ? fixedRightActive : fixedRight}
393
+ />
394
+ </Tooltip>
395
+ </span>
396
+ );
397
+ },
398
+ },
399
+ {
400
+ title: '删除',
401
+ dataIndex: 'title1',
402
+ render: (text, record) => {
403
+ return (
404
+ <span
405
+ onClick={() => {
406
+ this.setState({
407
+ sortDataSource: this.state.sortDataSource.filter((item) => {
408
+ return item.title !== record.title;
409
+ }),
410
+ isDefaultValue: false,
411
+ dataSource: [
412
+ ...this.state.dataSource.map((item) => {
413
+ if (item.title === record.title) {
414
+ return {
415
+ ...item,
416
+ hidden: true,
417
+ };
418
+ }
419
+
420
+ return item;
421
+ }),
422
+ ],
423
+ });
424
+ }}
425
+ >
426
+ <img width={24} src={close} />
427
+ </span>
428
+ );
429
+ },
430
+ },
431
+ {
432
+ title: 'Sort',
433
+ dataIndex: 'sort',
434
+ className: 'drag-visible',
435
+ render: () => <DragHandle />,
436
+ },
437
+ ];
438
+
439
+ showModal = () => {
440
+ this.setState({
441
+ visible: true,
442
+ });
443
+ this.setInitValue();
444
+ };
445
+
446
+ handleOk = (e?: React.MouseEvent<HTMLElement>) => {
447
+ const { sortDataSource, isDefaultValue, defaultValue } = this.state;
448
+ if (!sortDataSource.length) {
449
+ message.warning('至少选择一列!');
450
+ return;
451
+ }
452
+ // if (isDefaultValue) {
453
+ // this.patchUserColumnConfig('');
454
+ // return;
455
+ // }
456
+ return this.patchUserColumnConfig(sortDataSource);
457
+ };
458
+
459
+ handleCancel = (e: React.MouseEvent<HTMLElement>) => {
460
+ console.log(e);
461
+ this.setState({
462
+ visible: false,
463
+ });
464
+ };
465
+
466
+ handleTableHeadHidden = (title: string) => {
467
+ const { sortDataSource, dataSource } = this.state;
468
+ this.setState(
469
+ {
470
+ sortDataSource: sortDataSource.filter((item) => {
471
+ return item.title !== title;
472
+ }),
473
+ dataSource: [
474
+ ...dataSource.map((item) => {
475
+ if (item.title === title) {
476
+ return {
477
+ ...item,
478
+ hidden: true,
479
+ };
480
+ }
481
+
482
+ return item;
483
+ }),
484
+ ],
485
+ },
486
+ () => {
487
+ this.handleOk()
488
+ .then((res: any) => {
489
+ if (res.status === '0') {
490
+ message.success(<span>
491
+ 字段已隐藏,如需重新显示请前往<Typography.Link
492
+ underline
493
+ onClick={this.showModal}
494
+ >列设置</Typography.Link>
495
+ </span>)
496
+ }
497
+ });
498
+ },
499
+ );
500
+ };
501
+
502
+ onSortEnd = ({ oldIndex, newIndex }) => {
503
+ const { sortDataSource } = this.state;
504
+ if (oldIndex !== newIndex) {
505
+ const newData = arrayMoveImmutable(
506
+ [].concat(sortDataSource),
507
+ oldIndex,
508
+ newIndex,
509
+ ).filter((el) => !!el);
510
+ this.setState({
511
+ sortDataSource: [
512
+ ...newData.filter((item) => item.fixed === 'left'),
513
+ ...newData.filter((item) => !item.fixed),
514
+ ...newData.filter((item) => item.fixed === 'right'),
515
+ ],
516
+ isDefaultValue: false,
517
+ });
518
+ }
519
+ };
520
+
521
+ DraggableContainer = (props) => (
522
+ <SortableBody
523
+ useDragHandle
524
+ disableAutoscroll
525
+ helperClass="row-dragging"
526
+ onSortEnd={this.onSortEnd}
527
+ {...props}
528
+ />
529
+ );
530
+
531
+ DraggableBodyRow = ({ className, style, ...restProps }) => {
532
+ const { sortDataSource } = this.state;
533
+ // function findIndex base on Table rowKey props and should always be a right array index
534
+ const index = sortDataSource.findIndex(
535
+ (x) => x.key === restProps['data-row-key'],
536
+ );
537
+ return <SortableItem index={index} {...restProps} />;
538
+ };
539
+
540
+ onChange = (e: CheckboxChangeEvent, title) => {
541
+ const { sortDataSource, dataSource } = this.state;
542
+ if (!e.target.checked) {
543
+ this.setState({
544
+ sortDataSource: sortDataSource.filter((item) => {
545
+ return item.title !== title;
546
+ }),
547
+ isDefaultValue: false,
548
+ dataSource: [
549
+ ...dataSource.map((item) => {
550
+ if (item.title === title) {
551
+ return {
552
+ ...item,
553
+ hidden: true,
554
+ };
555
+ }
556
+
557
+ return item;
558
+ }),
559
+ ],
560
+ });
561
+ } else {
562
+ let fixedLeft: any[] = [];
563
+ let fixedRight: any[] = [];
564
+ let noFixedSortSource: any = [];
565
+ let newSortData = [
566
+ ...sortDataSource,
567
+ ...dataSource
568
+ .filter((item) => item.title === title)
569
+ .map((source) => {
570
+ return {
571
+ ...source,
572
+ hidden: false,
573
+ };
574
+ }),
575
+ ];
576
+ newSortData.forEach((item) => {
577
+ if (item?.fixed === 'left') {
578
+ fixedLeft.push(item);
579
+ } else if (item?.fixed === 'right') {
580
+ fixedRight.push(item);
581
+ } else {
582
+ noFixedSortSource.push(item);
583
+ }
584
+ });
585
+ this.setState({
586
+ sortDataSource: [...fixedLeft, ...noFixedSortSource, ...fixedRight],
587
+ isDefaultValue: false,
588
+ dataSource: [
589
+ ...dataSource.map((item) => {
590
+ if (item.title === title) {
591
+ return {
592
+ ...item,
593
+ hidden: false,
594
+ };
595
+ }
596
+
597
+ return item;
598
+ }),
599
+ ],
600
+ });
601
+ }
602
+ };
603
+
604
+ handleReset = () => {
605
+ this.setInitValue(true);
606
+ };
607
+
608
+ handleResetSetting = () =>{
609
+ this.patchUserColumnConfig('');
610
+ }
611
+
612
+ onSearch = (e: any) => {
613
+ this.setState({
614
+ searchDataSource: e.target.value,
615
+ });
616
+ };
617
+
618
+ onSearchSort = (e: any) => {
619
+ this.setState({
620
+ onSearchSort: e.target.value,
621
+ });
622
+ };
623
+
624
+ render() {
625
+ const { onlyModal } = this.props;
626
+ const {
627
+ dataSource,
628
+ searchDataSource,
629
+ sortDataSource,
630
+ visible,
631
+ onSearchSort,
632
+ } = this.state;
633
+
634
+ let seatchDataSource = dataSource.filter(
635
+ (item) => item?.title?.indexOf(searchDataSource || '') > -1,
636
+ );
637
+
638
+ return (
639
+ <div className={'sort_table_wrapper'}>
640
+ {visible && (
641
+ <Modal
642
+ title="设置表头内容"
643
+ wrapClassName={'sort_table_wrapper'}
644
+ width={820}
645
+ visible={visible}
646
+ onOk={this.handleOk}
647
+ onCancel={this.handleCancel}
648
+ footer={[
649
+ <div>
650
+ <Button key="back" onClick={this.handleReset} style={{marginRight: 0}}>
651
+ 恢复默认
652
+ </Button>,
653
+ <Button key="back" onClick={this.handleResetSetting}>
654
+ 重置设置
655
+ </Button>
656
+ </div>,
657
+ <div>
658
+ <Button key="submit" onClick={this.handleCancel} style={{marginRight: 0}}>
659
+ 取消
660
+ </Button>,
661
+ <Button key="submit" type="primary" onClick={this.handleOk}>
662
+ 确认
663
+ </Button>
664
+ </div>
665
+ ]}
666
+ >
667
+ <div className={'sort_table'}>
668
+ <div className={'sort_table_column_wrapper'}>
669
+ <span className={'sort_table_column_count'}>
670
+ 可选字段 <span>(共{dataSource.length}个)</span>
671
+ </span>
672
+ <div className={'sort_table_column'}>
673
+ <Input
674
+ prefix={<SearchOutlined className="site-form-item-icon" />}
675
+ placeholder="搜索"
676
+ allowClear
677
+ onChange={this.onSearch}
678
+ style={{ width: 540 }}
679
+ />
680
+ <div>
681
+ {!searchDataSource && (
682
+ <Checkbox
683
+ checked={
684
+ !dataSource.some((item) => {
685
+ if (item.hidden) return true;
686
+
687
+ return false;
688
+ })
689
+ }
690
+ onClick={(e) => {
691
+ this.setState({
692
+ isDefaultValue: false,
693
+ dataSource: [
694
+ ...dataSource.map((item) => {
695
+ return {
696
+ ...item,
697
+ hidden: !e.target.checked,
698
+ };
699
+ }),
700
+ ],
701
+ sortDataSource: e.target.checked
702
+ ? [
703
+ ...dataSource
704
+ .filter((item) => item.fixed === 'left')
705
+ .map((item) => ({
706
+ ...item,
707
+ hidden: false,
708
+ })),
709
+ ...dataSource
710
+ .filter((item) => !item.fixed)
711
+ .map((item) => ({
712
+ ...item,
713
+ hidden: false,
714
+ })),
715
+ ...dataSource
716
+ .filter((item) => item.fixed === 'right')
717
+ .map((item) => ({
718
+ ...item,
719
+ hidden: false,
720
+ })),
721
+ ]
722
+ : [],
723
+ });
724
+ }}
725
+ >
726
+ 全选
727
+ </Checkbox>
728
+ )}
729
+ </div>
730
+ <div className={'sort_table_column_all'}>
731
+ {searchDataSource
732
+ ? seatchDataSource.map((item) => {
733
+ return (
734
+ <Checkbox
735
+ checked={!item.hidden}
736
+ onChange={(e) => {
737
+ this.onChange(e, item.title);
738
+ }}
739
+ >
740
+ {item.title}
741
+ </Checkbox>
742
+ );
743
+ })
744
+ : dataSource
745
+ .filter(
746
+ (item) =>
747
+ item?.title?.indexOf('') === -1 &&
748
+ item?.title?.indexOf('日期') === -1,
749
+ )
750
+ .map((item) => {
751
+ return (
752
+ <Checkbox
753
+ checked={!item.hidden}
754
+ onChange={(e) => {
755
+ this.onChange(e, item.title);
756
+ }}
757
+ >
758
+ {item.title}
759
+ </Checkbox>
760
+ );
761
+ })}
762
+ {!!seatchDataSource.length && (
763
+ <span style={{ width: '144px' }}></span>
764
+ )}
765
+
766
+ {!seatchDataSource.length && (
767
+ <div className={'sort_table_column_all_empty'}>
768
+ 未查询到结果
769
+ </div>
770
+ )}
771
+ </div>
772
+ {!searchDataSource && (
773
+ <div>
774
+ <div className={'sort_table_column_special'}>
775
+ <span>人员时间字段</span>
776
+ </div>
777
+ <div className={'sort_table_column_all'}>
778
+ {[...dataSource]
779
+ .filter(
780
+ (item) =>
781
+ item?.title?.indexOf('') > -1 ||
782
+ item?.title?.indexOf('日期') > -1,
783
+ )
784
+ .map((item) => {
785
+ return (
786
+ <Checkbox
787
+ checked={!item.hidden}
788
+ onChange={(e) => {
789
+ this.onChange(e, item.title);
790
+ }}
791
+ >
792
+ {item.title}
793
+ </Checkbox>
794
+ );
795
+ })}
796
+ <span style={{ width: '144px' }}></span>
797
+ </div>
798
+ </div>
799
+ )}
800
+ </div>
801
+ </div>
802
+ <div className={'sort_table_content_wrapper'}>
803
+ <span className={'sort_table_content_count'}>
804
+ 已选字段 <span>(共{sortDataSource.length}个)</span>
805
+ </span>
806
+ <div className={'sort_table_content'}>
807
+ <span style={{ paddingLeft: '10px' }}>
808
+ <Input
809
+ prefix={
810
+ <SearchOutlined className="site-form-item-icon" />
811
+ }
812
+ placeholder="搜索"
813
+ allowClear
814
+ onChange={this.onSearchSort}
815
+ style={{ width: 190 }}
816
+ />
817
+ </span>
818
+ <Table
819
+ pagination={false}
820
+ showHeader={false}
821
+ dataSource={
822
+ onSearchSort
823
+ ? sortDataSource.filter(
824
+ (item) => item?.title?.indexOf(onSearchSort) > -1,
825
+ )
826
+ : sortDataSource
827
+ }
828
+ columns={this.columns}
829
+ rowKey="key"
830
+ // rowSelection={rowSelection}
831
+ components={{
832
+ body: {
833
+ wrapper: this.DraggableContainer,
834
+ row: this.DraggableBodyRow,
835
+ },
836
+ }}
837
+ />
838
+ </div>
839
+ </div>
840
+ </div>
841
+ </Modal>
842
+ )}
843
+ {
844
+ !onlyModal
845
+ ? <div onClick={this.showModal} style={{fontSize:14}}>列设置</div>
846
+ : ''
847
+ }
848
+ </div>
849
+ );
850
+ }
851
+ }
852
+
853
+ export default SortableTable;