@bit-sun/business-component 4.0.13-alpha.9 → 4.2.0-aiwei-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/.umirc.ts +21 -10
  2. package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
  3. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
  4. package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
  5. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
  6. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
  7. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
  8. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
  9. package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
  11. package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
  12. package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
  13. package/dist/components/Business/BsLayouts/index.d.ts +1 -1
  14. package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
  15. package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
  16. package/dist/components/Business/BsSulaQueryTable/setting.d.ts +11 -8
  17. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
  18. package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
  19. package/dist/components/Business/CommonAlert/index.d.ts +1 -2
  20. package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
  21. package/dist/components/Business/DetailPageWrapper/index.d.ts +11 -6
  22. package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
  23. package/dist/components/Business/ItemPropertySelector/index.d.ts +2 -0
  24. package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
  25. package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
  26. package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
  27. package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
  28. package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
  29. package/dist/components/Business/ModalUtils/index.d.ts +8 -0
  30. package/dist/components/Business/PropertyModal/index.d.ts +1 -2
  31. package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
  32. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  33. package/dist/components/Business/SearchSelect/utils.d.ts +4 -2
  34. package/dist/components/Business/StateFlow/index.d.ts +1 -2
  35. package/dist/components/Business/SystemLog/index.d.ts +78 -0
  36. package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
  37. package/dist/components/Business/columnSettingTable/columnSetting.d.ts +9 -8
  38. package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
  39. package/dist/components/Business/columnSettingTable/index.d.ts +21 -4
  40. package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +22 -5
  41. package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
  42. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
  43. package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
  44. package/dist/components/Common/Section/index.d.ts +1 -1
  45. package/dist/components/Functional/AddSelect/index.d.ts +1 -2
  46. package/dist/components/Functional/AuthButton/index.d.ts +1 -2
  47. package/dist/components/Functional/DataImport/index.d.ts +3 -3
  48. package/dist/components/Functional/DataValidation/index.d.ts +15 -5
  49. package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
  50. package/dist/components/Functional/QueryMutipleInput/index.d.ts +3 -3
  51. package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
  52. package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
  53. package/dist/components/Functional/SearchSelect/utils.d.ts +4 -4
  54. package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
  55. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
  56. package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
  57. package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
  58. package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
  59. package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
  60. package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
  61. package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
  62. package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.esm.js +4238 -2124
  65. package/dist/index.js +4247 -2122
  66. package/dist/plugin/TableColumnSetting/index.d.ts +6 -5
  67. package/dist/utils/RequestCacheManager.d.ts +82 -0
  68. package/dist/utils/TableUtils.d.ts +18 -19
  69. package/dist/utils/cachedRequest.d.ts +76 -0
  70. package/dist/utils/index.d.ts +1 -0
  71. package/dist/utils/utils.d.ts +41 -0
  72. package/package.json +16 -14
  73. package/src/assets/btn-cancel.svg +3 -0
  74. package/src/assets/btn-copy.svg +3 -0
  75. package/src/assets/btn-delete.svg +2 -29
  76. package/src/assets/btn-edit.svg +2 -19
  77. package/src/assets/btn-hangUp.svg +3 -0
  78. package/src/assets/btn-print.svg +3 -0
  79. package/src/assets/btn-refresh.svg +3 -0
  80. package/src/assets/btn-unhook.svg +3 -0
  81. package/src/components/Business/AddSelectBusiness/index.md +8 -2
  82. package/src/components/Business/AddSelectBusiness/index.tsx +4 -1
  83. package/src/components/Business/BsLayouts/Components/ChooseStore/services.ts +1 -1
  84. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +1 -1
  85. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +1 -1
  86. package/src/components/Business/BsLayouts/Components/RightContent/home.less +1 -1
  87. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +2 -2
  88. package/src/components/Business/BsLayouts/service.ts +1 -1
  89. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +6 -5
  90. package/src/components/Business/BsSulaQueryTable/bssulaquerytable.less +0 -4
  91. package/src/components/Business/BsSulaQueryTable/index.less +5 -3
  92. package/src/components/Business/BsSulaQueryTable/index.md +45 -32
  93. package/src/components/Business/BsSulaQueryTable/index.tsx +154 -76
  94. package/src/components/Business/BsSulaQueryTable/setting.tsx +47 -11
  95. package/src/components/Business/BsSulaQueryTable/utils.less +1 -1
  96. package/src/components/Business/BsSulaQueryTable/utils.tsx +15 -12
  97. package/src/components/Business/CommodityEntry/index.md +1 -1
  98. package/src/components/Business/CommodityEntry/index.tsx +11 -9
  99. package/src/components/Business/DetailPageWrapper/index.less +1 -1
  100. package/src/components/Business/DetailPageWrapper/index.tsx +24 -5
  101. package/src/components/Business/DetailPageWrapper/utils.tsx +7 -2
  102. package/src/components/Business/HomePageWrapper/index.less +1 -1
  103. package/src/components/Business/ItemPropertySelector/index.tsx +88 -0
  104. package/src/components/Business/JsonQueryTable/function.ts +1 -1
  105. package/src/components/Business/JsonQueryTable/index.tsx +1 -1
  106. package/src/components/Business/ModalUtils/index.tsx +45 -0
  107. package/src/components/Business/PropertyModal/index.tsx +1 -1
  108. package/src/components/Business/SearchSelect/BusinessUtils.tsx +625 -76
  109. package/src/components/Business/SearchSelect/index.md +4 -4
  110. package/src/components/Business/SearchSelect/utils.ts +27 -5
  111. package/src/components/Business/SystemLog/index.md +37 -0
  112. package/src/components/Business/SystemLog/index.tsx +87 -0
  113. package/src/components/Business/columnSettingTable/columnSetting.tsx +28 -12
  114. package/src/components/Business/columnSettingTable/index.less +5 -3
  115. package/src/components/Business/columnSettingTable/index.md +200 -136
  116. package/src/components/Business/columnSettingTable/index.tsx +168 -39
  117. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +188 -56
  118. package/src/components/Functional/AddSelect/helps.ts +1 -1
  119. package/src/components/Functional/AddSelect/index.tsx +132 -13
  120. package/src/components/Functional/BillEntry/index.less +3 -0
  121. package/src/components/Functional/BillEntry/index.tsx +1 -1
  122. package/src/components/Functional/DataImport/index.tsx +1 -1
  123. package/src/components/Functional/DataValidation/index.md +1 -0
  124. package/src/components/Functional/DataValidation/index.tsx +161 -27
  125. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +1 -1
  126. package/src/components/Functional/QueryMutipleInput/index.tsx +12 -3
  127. package/src/components/Functional/QueryMutipleSelect/index.tsx +3 -2
  128. package/src/components/Functional/SearchSelect/index.less +4 -0
  129. package/src/components/Functional/SearchSelect/index.tsx +68 -24
  130. package/src/components/Functional/SearchSelect/utils.tsx +17 -11
  131. package/src/components/Functional/TreeSearchSelect/index.tsx +3 -2
  132. package/src/components/Solution/RuleComponent/InnerSelect.tsx +1 -0
  133. package/src/components/Solution/RuleComponent/RenderCompItem.tsx +11 -2
  134. package/src/components/Solution/RuleComponent/index.js +75 -4
  135. package/src/components/Solution/RuleComponent/ruleFiled.js +26 -2
  136. package/src/components/Solution/RuleComponent/services.ts +1 -1
  137. package/src/components/Solution/RuleSetter/service.js +1 -1
  138. package/src/index.ts +3 -0
  139. package/src/plugin/TableColumnSetting/index.less +5 -3
  140. package/src/plugin/TableColumnSetting/index.tsx +80 -13
  141. package/src/styles/bsDefault.less +9 -3
  142. package/src/utils/RequestCacheManager.ts +213 -0
  143. package/src/utils/RequestCache_Examples.md +137 -0
  144. package/src/utils/RequestCache_README.md +170 -0
  145. package/src/utils/TableUtils.less +1 -1
  146. package/src/utils/cachedRequest.ts +288 -0
  147. package/src/utils/index.ts +1 -0
  148. package/src/utils/request.ts +8 -4
  149. package/src/utils/requestUtils.ts +1 -1
  150. package/src/utils/utils.ts +52 -16
@@ -150,7 +150,7 @@ export default () => {
150
150
  // },
151
151
  // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
152
152
  selectProps,
153
- selectBusinessType: 'skuCommodity',
153
+ selectBusinessType: 'shopFile2',
154
154
  };
155
155
 
156
156
  const onTabChange = (key) => {
@@ -297,7 +297,7 @@ import {BusinessSearchSelect} from '../../../index.ts';
297
297
  const { TabPane } = Tabs;
298
298
  export default () => {
299
299
  const selectProps = {
300
- // mode: 'multiple',
300
+ mode: 'multiple',
301
301
  // maxTagCount: 1,
302
302
  // disabled: true
303
303
  }
@@ -317,7 +317,7 @@ export default () => {
317
317
  },
318
318
  // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
319
319
  selectProps,
320
- selectBusinessType: 'spuCommodity',
320
+ selectBusinessType: 'spuCommodityWithProperty',
321
321
  };
322
322
 
323
323
  const onTabChange = (key) => {
@@ -520,7 +520,7 @@ export default () => {
520
520
  // needStatusSearch: true
521
521
  // },
522
522
  selectProps,
523
- selectBusinessType: 'brand',
523
+ selectBusinessType: 'realWarehouse',
524
524
  };
525
525
 
526
526
  const onTabChange = (key) => {
@@ -1,5 +1,6 @@
1
- import request from '@/utils/request';
1
+ import request from '@/utils/cachedRequest';
2
2
  import { message } from 'antd';
3
+ import { uniqBy } from 'lodash';
3
4
  import { stringify } from 'querystring';
4
5
  import ENUM from '@/utils/enumConfig';
5
6
  import { judgeIsRequestError } from '@/utils/requestUtils';
@@ -55,10 +56,11 @@ const getDictionaryTextByValue = (dicCode: string, value: string | number) => {
55
56
  return dicItemArray[0].text;
56
57
  };
57
58
 
58
- const loadSelectSource = (url: string, params?: any) => {
59
+ const loadSelectSource = (url: string, params?: any,options?:any) => {
60
+ const realOptions = options || {};
59
61
  return new Promise((resolve, reject) => {
60
62
  request
61
- .get(`${url}?${stringify(params)}`)
63
+ .get(`${url}?${stringify(params)}`, realOptions)
62
64
  .then((result: any) => {
63
65
  result = result.data;
64
66
  if (judgeIsRequestError(result)) {
@@ -79,7 +81,7 @@ const handleDefaultPrefixUrl = (type: string) => {
79
81
  case 'supplier2': case 'customer2': case 'shopFile2': case 'platCompany': case 'market-channel':
80
82
  result = '/channel-manage';
81
83
  break;
82
- case 'skuCommodity': case 'skuPropertyValue': case 'spuCommodity': case 'skcCommodity': case 'brand':
84
+ case 'skuCommodity': case 'skuPropertyValue': case 'spuCommodity': case 'skcCommodity': case 'brand': case 'spuCommodityWithProperty':
83
85
  result = '/items';
84
86
  break;
85
87
  case 'physicalWarehouse': case 'realWarehouse': case 'virtualWarehouse': case 'channelWarehouse': case 'ownerWarehouse':
@@ -125,4 +127,24 @@ const getFieldIndex = (tableSearchForm: any, name: string) =>{
125
127
  return tableSearchForm.findIndex((i: any) => i.name.includes(name));
126
128
  }
127
129
 
128
- export { getDictionarySource, getDictionaryTextByValue, loadSelectSource, handleDefaultPrefixUrl, handleHiddenFields, handleHiddenFieldsRequest, getFieldIndex }
130
+ // 获取选择器-弹窗中-下拉框查询接口-头部的请求头
131
+ const getQueryHeadersList = (params: any) => {
132
+ const { defaultQSHL = [], querySelectHeadersList = [], extralHeaders = {} } = params;
133
+
134
+ const realQSHL = uniqBy([...querySelectHeadersList, ...defaultQSHL],'queryKey')||[]; // 去重,保留最先出现的元素,故defaultQSHL需要放在后面
135
+
136
+
137
+ let result: any = {};
138
+ realQSHL.forEach((item: any) => {
139
+ const { queryKey, isOpen, extralHeaders:QSH } = item;
140
+ if (isOpen && queryKey) {
141
+ result[queryKey] = { headers: { ...extralHeaders, ...(QSH || {}) } };
142
+ }
143
+ });
144
+
145
+ return result;
146
+ }
147
+
148
+ const getQueryHeadersItem = (queryHeaders: any, queryKey: any) => queryHeaders?.[queryKey] || {};
149
+
150
+ export { getDictionarySource, getDictionaryTextByValue, loadSelectSource, handleDefaultPrefixUrl, handleHiddenFields, handleHiddenFieldsRequest, getFieldIndex, getQueryHeadersList, getQueryHeadersItem }
@@ -0,0 +1,37 @@
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 日志组件
9
+ order: 1
10
+ ---
11
+
12
+ # SystemLog
13
+
14
+
15
+ ## 日志业务组件
16
+
17
+ ```tsx
18
+ import React, { useState } from 'react';
19
+ import { SystemLog } from '../../../index.ts';
20
+
21
+ export default () => {
22
+ const [modeType, setModeType] = useState('view');
23
+ const renderLogRef = useRef<any>();
24
+
25
+ return {
26
+ fields: [
27
+ SystemLog({
28
+ modeType,
29
+ code: '123',
30
+ containerName: 'Test_Log_Info',
31
+ renderLogRef,
32
+ extraParams: {},
33
+ })
34
+ ],
35
+ };
36
+ };
37
+ ```
@@ -0,0 +1,87 @@
1
+ import { handleCommonTimeRender } from '@/utils/TableUtils';
2
+ import { formContainerAndItemLayout, handleConvertResponse } from '@/utils/utils';
3
+ import { Table as BsTable } from 'bssula';
4
+ import React from 'react';
5
+
6
+ //操作日志
7
+ const SystemLog = ({
8
+ modeType,
9
+ code,
10
+ containerName,
11
+ renderLogRef = {},
12
+ extraParams = {},
13
+ }: {
14
+ modeType: string,
15
+ code: any
16
+ containerName: string,
17
+ renderLogRef: object,
18
+ extraParams?: object,
19
+ }) => {
20
+ return {
21
+ ...formContainerAndItemLayout('table', '操作日志', containerName),
22
+ initialVisible: modeType != 'create',
23
+ fields: [
24
+ {
25
+ name: 'table',
26
+ label: false,
27
+ itemLayout: {
28
+ span: 24,
29
+ labelCol: {
30
+ span: 0,
31
+ },
32
+ wrapperCol: {
33
+ span: 24,
34
+ },
35
+ },
36
+ field: (ctx: any) => {
37
+ return code && <BsTable
38
+ remoteDataSource={{
39
+ url: `/oms-ops/logInfo?qp-businessCode-eq=${code}`,
40
+ convertParams: ({ params }: any) => {
41
+ return {
42
+ pageSize: params.pageSize,
43
+ currentPage: params.current,
44
+ ...extraParams,
45
+ };
46
+ },
47
+ converter: ({ data }: any) => {
48
+ return {
49
+ ...handleConvertResponse(data.list, data.total || data.totalCount),
50
+ };
51
+ },
52
+ }}
53
+ columns={[
54
+ {
55
+ title: '操作人',
56
+ dataIndex: 'handlerName',
57
+ },
58
+ {
59
+ title: '操作名称',
60
+ dataIndex: 'handlerType',
61
+ },
62
+ {
63
+ title: '操作时间',
64
+ dataIndex: 'handlerTime',
65
+ render: ({ text }: { text: any }) => handleCommonTimeRender(text)
66
+ },
67
+ {
68
+ title: '操作内容',
69
+ dataIndex: 'logcontent',
70
+ },
71
+ ]}
72
+ style={{ width: '100%', marginTop: '-16px', padding: '0px' }}
73
+ rowKey="id"
74
+ scroll={{ x: 'max-content' }}
75
+ pagination={{
76
+ showTotal: (total: any) => `共 ${total} 条`,
77
+ showQuickJumper: true,
78
+ hideOnSinglePage: true,
79
+ }}
80
+ ref={renderLogRef}
81
+ />
82
+ },
83
+ },
84
+ ],
85
+ }
86
+ }
87
+ export default SystemLog
@@ -15,7 +15,7 @@ import fixedLeft from '../../../assets/fixed-left.svg';
15
15
  import fixedLeftActive from '../../../assets/fixed-left-active.svg';
16
16
  import fixedRight from '../../../assets/fixed-right.svg';
17
17
  import fixedRightActive from '../../../assets/fixed-right-active.svg';
18
- import request from '@/utils/request';
18
+ import request from '@/utils/cachedRequest';
19
19
  // import { request } from 'umi';
20
20
  import './index.less';
21
21
  import ENUM from '@/utils/enumConfig';
@@ -67,9 +67,10 @@ class SortableTable extends React.Component<SortTableProps> {
67
67
  onSearchSort: false,
68
68
  };
69
69
 
70
- patchUserColumnConfig = (config: any) => {
70
+ patchUserColumnConfig = (config: any, tableCodes: any) => {
71
71
  const { tableCode, appRequestConfig }: any = this.props;
72
- if (!tableCode) return;
72
+ const newTableCode = tableCodes || tableCode;
73
+ if (!newTableCode) return;
73
74
  let configvalue = config ? config.map((item:any) => ({
74
75
  key: item.key || item.dataIndex,
75
76
  dataIndex: item.dataIndex || item.key,
@@ -82,21 +83,22 @@ class SortableTable extends React.Component<SortTableProps> {
82
83
  url: handleRequestUrl('/user','/appConfig/saveUserOrder',appRequestConfig),
83
84
  method:'POST',
84
85
  data: {
85
- "code": tableCode,
86
+ "code": newTableCode,
86
87
  "detail": configvalue ? JSON.stringify(configvalue) : ''
87
88
  },
88
89
  }).then((res:any) => {
89
90
  if (judgeIsRequestSuccess(res?.data)) {
90
- this.patchConfigToLocalstorage(configvalue, tableCode)
91
+ this.patchConfigToLocalstorage(configvalue, newTableCode, config)
91
92
  } else {
92
93
  message.error('保存表头列自定义失败,请稍后尝试');
93
94
  }
94
95
  })
95
96
  }
96
97
 
97
- patchConfigToLocalstorage = (configvalue:any, tableCode:string) => {
98
+ patchConfigToLocalstorage = (configvalue:any, tableCode:string, newDataSource: any) => {
98
99
  const { setShowColumns, datasource = [] }: any = this.props;
99
100
  const { sortDataSource } = this.state;
101
+ const sourceList = newDataSource || sortDataSource;
100
102
  let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]'
101
103
  let configArray = JSON.parse(config)
102
104
  let currentSetting = configArray.filter((item:any) => item.code === tableCode)
@@ -114,7 +116,7 @@ class SortableTable extends React.Component<SortTableProps> {
114
116
  visible: false,
115
117
  });
116
118
  if (configvalue) {
117
- setShowColumns([...sortDataSource]);
119
+ setShowColumns([...sourceList]);
118
120
  } else {
119
121
  this.setState({
120
122
  dataSource: [
@@ -175,15 +177,28 @@ class SortableTable extends React.Component<SortTableProps> {
175
177
  return preKeyStr !== nextKeyStr;
176
178
  }
177
179
 
180
+ // 提取逻辑到单独的方法
181
+ validateLocalStorageConfig = (datasource: any, tableCode: string) => {
182
+ let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
183
+ let configArray = JSON.parse(config);
184
+ let currentSetting = configArray.filter((item:any) => item.code === tableCode);
185
+ let configvalue = currentSetting?.[0]?.detail ? JSON.parse(currentSetting[0].detail) : [];
186
+ if (currentSetting.length === 0 || configvalue.length === 0 ) {
187
+ this.patchUserColumnConfig(datasource || [], tableCode);
188
+ }
189
+ }
190
+
178
191
  componentWillReceiveProps(nextProps: any) {
179
192
  if (this.isColumnsChange(this.props?.datasource, nextProps?.datasource)) {
180
193
  this.setInitValue(nextProps?.datasource || []);
194
+ this.validateLocalStorageConfig(nextProps?.datasource, nextProps?.tableCode);
181
195
  }
182
196
  }
183
197
 
184
198
  componentDidMount() {
185
- const { datasource = [] }: any = this.props;
199
+ const { datasource = [], tableCode }: any = this.props;
186
200
  this.setInitValue(datasource);
201
+ this.validateLocalStorageConfig(datasource, tableCode);
187
202
  }
188
203
 
189
204
  columns = [
@@ -415,7 +430,7 @@ class SortableTable extends React.Component<SortTableProps> {
415
430
  visible: false,
416
431
  });
417
432
  setShowColumns([...sortDataSource]);
418
- this.patchUserColumnConfig(sortDataSource)
433
+ this.patchUserColumnConfig(sortDataSource, null)
419
434
  };
420
435
 
421
436
  handleCancel = (e: React.MouseEvent<HTMLElement>) => {
@@ -476,7 +491,7 @@ class SortableTable extends React.Component<SortTableProps> {
476
491
  DraggableContainer = (props: any) => (
477
492
  <SortableBody
478
493
  useDragHandle
479
- disableAutoscroll
494
+ lockAxis='y'
480
495
  helperClass="row-dragging"
481
496
  onSortEnd={this.onSortEnd}
482
497
  {...props}
@@ -487,9 +502,9 @@ class SortableTable extends React.Component<SortTableProps> {
487
502
  const { sortDataSource } = this.state;
488
503
  // function findIndex base on Table rowKey props and should always be a right array index
489
504
  const index = sortDataSource.findIndex(
490
- (x:any) => x.key === restProps['data-row-key'],
505
+ (x) => (x.key||x.dataIndex) == restProps['data-row-key'],
491
506
  );
492
- return <SortableItem index={index} {...restProps} />;
507
+ return <SortableItem key={restProps['data-row-key']} index={index} {...restProps} />;
493
508
  };
494
509
 
495
510
  onChange = (e: any, title: any) => {
@@ -854,6 +869,7 @@ class SortableTable extends React.Component<SortTableProps> {
854
869
  row: this.DraggableBodyRow,
855
870
  },
856
871
  }}
872
+ scroll={{ y: 364 }}
857
873
  />
858
874
  </div>
859
875
  </div>
@@ -151,16 +151,18 @@
151
151
  }
152
152
  }
153
153
 
154
- .ant-table-wrapper::-webkit-scrollbar {
154
+ .ant-table-tbody::-webkit-scrollbar {
155
155
  display: none;
156
156
  }
157
157
 
158
158
  .ant-table-wrapper {
159
159
  margin-top: 10px;
160
- height: 364px;
161
- overflow: scroll;
162
160
  padding-bottom: 50px;
163
161
 
162
+ tbody tr:first-child {
163
+ display: none;
164
+ }
165
+
164
166
  tr {
165
167
  height: 30px;
166
168
  td {