@bit-sun/business-component 2.2.1 → 2.2.2

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.
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface TableColumnSettingProps {
4
+ /** tableCode必填,做用户存储关键key,*/
5
+ tableCode: string;
6
+ /** datasource必填,为要操作的表头(即原始表头),*/
7
+ datasource: any;
8
+ /** showColumns必填,为当前用户设置的表头,*/
9
+ showColumns: any;
10
+ /** setShowColumns必填,设置当前表头的方法,*/
11
+ setShowColumns: void;
12
+ /** settingImgAttribute非必填,设置当前设置img样式,*/
13
+ settingImgAttribute: {
14
+ [propName: string]: any;
15
+ };
16
+ [propName: string]: any;
17
+ }
18
+ declare class TableColumnSetting extends React.Component<TableColumnSettingProps> {
19
+ state: {
20
+ dataSource: never[];
21
+ columns: never[];
22
+ selectedRowKeys: never[];
23
+ sortDataSource: never[];
24
+ setVisible: boolean;
25
+ searchDataSource: boolean;
26
+ onSearchSort: boolean;
27
+ };
28
+ patchUserColumnConfig: (config: any) => void;
29
+ setInitValue: (datasource: any[]) => void;
30
+ componentWillReceiveProps(nextProps: any): void;
31
+ componentDidMount(): void;
32
+ columns: ({
33
+ title: string;
34
+ dataIndex: string;
35
+ className: string;
36
+ width: number;
37
+ render?: undefined;
38
+ } | {
39
+ title: string;
40
+ dataIndex: string;
41
+ render: (text: any, record: any) => JSX.Element;
42
+ className?: undefined;
43
+ width?: undefined;
44
+ } | {
45
+ title: string;
46
+ dataIndex: string;
47
+ className: string;
48
+ render: () => JSX.Element;
49
+ width?: undefined;
50
+ })[];
51
+ showModal: () => void;
52
+ handleOk: (e?: React.MouseEvent<HTMLElement>) => void;
53
+ handleCancel: (e: React.MouseEvent<HTMLElement>) => void;
54
+ handleTableHeadHidden: (title: string) => void;
55
+ onSortEnd: ({ oldIndex, newIndex }: any) => void;
56
+ DraggableContainer: (props: any) => JSX.Element;
57
+ DraggableBodyRow: ({ className, style, ...restProps }: any) => JSX.Element;
58
+ onChange: (e: any, title: any) => void;
59
+ handleReset: () => void;
60
+ onSearch: (e: any) => void;
61
+ onSearchSort: (e: any) => void;
62
+ render(): JSX.Element;
63
+ }
64
+ export default TableColumnSetting;
@@ -0,0 +1 @@
1
+ export declare const setInitialShowColumn: (tableCode: string, columns: any[], callback: any) => void;
@@ -0,0 +1,2 @@
1
+ export declare const setConfigTableColumns: (configvalue: any, tableCode: string) => void;
2
+ export declare const getConfigTableColumns: (tableCode: string) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -23,6 +23,27 @@ export default () => {
23
23
  const config = {
24
24
  buttonText: 'context',
25
25
  buttonProps: { disabled: false },
26
+ // exceptColumns: ['count'],
27
+ // tableCodeList: [null,'skuSelect-tableSelectedItemPartCodeNoCount'],
28
+ // additionColumns: [
29
+ // {
30
+ // position: 2,
31
+ // column: {
32
+ // title: '品牌',
33
+ // width: 100,
34
+ // dataIndex: 'brandName',
35
+ // },
36
+ // },
37
+ // {
38
+ // position: 6,
39
+ // column: {
40
+ // title: '国际条码',
41
+ // width: 100,
42
+ // isInputItem: true,
43
+ // dataIndex: 'barCode',
44
+ // },
45
+ // },
46
+ // ],
26
47
  beforeShowModal: () => {
27
48
  return Promise.resolve(true);
28
49
  // return Promise.reject('校验有误');
@@ -22,7 +22,9 @@ function handleSelectColumn(c: any, parentProps: any) {
22
22
  }
23
23
  // 追加
24
24
  if(additionColumns?.length) {
25
- //TODO
25
+ additionColumns.forEach((i: any) => {
26
+ result.splice(i.position,0,i.column)
27
+ })
26
28
  }
27
29
  // 覆盖内容
28
30
  if(coverColumns?.length) {
@@ -123,6 +125,7 @@ export const AddSkuSelect = (parProps: any) => {
123
125
  const props = {
124
126
  buttonText: parProps.buttonText || '新增',
125
127
  buttonProps: parProps.buttonProps || {},
128
+ tableCodeList: parProps.tableCodeList || [],
126
129
  value,
127
130
  // labelInValue: true, // 非必填 默认为false
128
131
  requestConfig: {
@@ -45,7 +45,8 @@ export default () => {
45
45
  console.log('save call', rows);
46
46
  // return Promise.resolve(true);
47
47
  // return Promise.reject('FAILE')
48
- }
48
+ },
49
+ tableCode: 'test1111'
49
50
  };
50
51
  const DictionaryUC000013 = [{ text: '共享', value: '10' }, { text: '私有', value: '20' }]
51
52
  const modalTableProps = {
@@ -10,6 +10,10 @@ import './index.less';
10
10
  import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
11
11
  import { Resizable } from 'react-resizable';
12
12
  import { checkQuantityAccuracy, precisionQuantity } from '@/utils/checkUtils';
13
+ import TableColumnSetting from '@/plugin/TableColumnSetting';
14
+ import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
15
+ import { handleAntdColumnsSpecialParams } from '@/utils/utils';
16
+ import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
13
17
 
14
18
  const loadSelectSource = (url: string, params?: any) => {
15
19
  return new Promise((resolve, reject) => {
@@ -94,7 +98,8 @@ const AddSelect = (props: any) => {
94
98
  onSaveCallback,
95
99
  buttonText = '添加',
96
100
  buttonProps = {},
97
- beforeShowModal
101
+ beforeShowModal,
102
+ tableCodeList = [], // 非必填 默认取组件定义code,如需自定义----数组第一位为供选择商品的table的code,第二位为已选择商品的table的code
98
103
  } = props;
99
104
  const { url, otherParams, isMap, fixedparameter, fieldValToParam, mappingTextField = 'name', mappingTextShowKeyField, mappingValueField = 'code', mappingTextShowTextField } = requestConfig || {};
100
105
  const resultSourceKey = sourceName || requestConfig?.sourceName || 'supplierCode'
@@ -155,28 +160,166 @@ const AddSelect = (props: any) => {
155
160
  const [checkedAll, setCheckedAll] = useState(false)
156
161
  const [indeterminate, setIndeterminate] = useState(false)
157
162
  const [tableFormParams, setTableFormParams] = useState({});
158
- const [tableColumns, setTableColumns] = useState([]);
159
163
  const [confirmLoading, setConfirmLoading] = useState(false);
160
164
  const [confirmContinueLoading, setConfirmContinueLoading] = useState(false);
161
165
 
166
+ const [selectColumns, setSelectColumns] = useState([]);
167
+ const [showColumns, setShowColumns] = useState([]);
168
+ const [tableColumns, setTableColumns] = useState([]);
169
+ const [showToChooseColumns, setShowToChooseColumns] = useState([]);
170
+ const codeToChoose = tableCodeList[0] || 'skuSelect-tableOptionsToChoosePartCode';
171
+ const codeSelected = tableCodeList[1] || 'skuSelect-tableSelectedItemPartCode';
172
+
173
+ useEffect(() => {
174
+ setTableColumns(modalTableProps?.tableColumns)
175
+ }, [modalTableProps?.tableColumns])
176
+
162
177
  useEffect(() => {
163
- setTableColumns(
164
- modalTableProps?.tableColumns.map((item, index) => {
178
+ setSelectColumns([... modalTableProps.selectColumn.map(item => {
179
+ const inputLength = modalTableProps.selectColumn.filter(item => item.isInputItem).length
180
+ const currentIndex = inputIndex
181
+
182
+ if (item.isInputItem) {
183
+ inputIndex++;
165
184
  return {
166
185
  ...item,
167
- width: item.width || 200,
168
- onHeaderCell: (column) => ({
169
- ...item,
170
- width:
171
- typeof column.width === 'number'
172
- ? column.width
173
- : parseInt(column.width.replace('px', '')),
174
- onResize: handleResize(index),
175
- })
186
+ render: (text, record, index) => {
187
+ // let
188
+ if(record.needFocus === true && currentIndex === 0) {
189
+
190
+ }
191
+ let precisionObj={};
192
+ const unitAccuracy = record.packingUnitList?.[0]?.unitAccuracy
193
+ const isCountUnitAccuracyCheck = item.dataIndex =='count' && unitAccuracy !== undefined
194
+ if(isCountUnitAccuracyCheck) {
195
+ precisionObj = {
196
+ onBlur: (e: any) => {
197
+ const { target: { value } } = e;
198
+ if(!checkQuantityAccuracy(value,Number(unitAccuracy))) {
199
+ record[item.dataIndex] = precisionQuantity(value,Number(unitAccuracy))
200
+ const newPopValue = popvalue.map((i: any, innerIndex: number) => {
201
+ if(innerIndex == index) {
202
+ i[item.dataIndex] = record[item.dataIndex]
203
+ }
204
+ return i
205
+ })
206
+ setPopValue(newPopValue)
207
+ }
208
+ }
209
+ // precision: unitAccuracy
210
+ }
211
+ }
212
+ return (
213
+ <InputNumber
214
+ value={text || ''}
215
+ min={0}
216
+ autoFocus={record.needFocus}
217
+ keyboard={false}
218
+ {...precisionObj}
219
+ onChange={(value) => {
220
+ record[item.dataIndex] = value
221
+ const newPopValue = popvalue.map((i: any, innerIndex: number) => {
222
+ if(innerIndex == index) {
223
+ i[item.dataIndex] = record[item.dataIndex]
224
+ }
225
+ return i
226
+ })
227
+ setPopValue(newPopValue)
228
+ }}
229
+ // onFocus={(e)=> {
230
+ // let dom1 = e.currentTarget;
231
+ // dom1.setSelectionRange(100, 0);
232
+ // dom1.select(text);
233
+ // }}
234
+ onKeyDown={(e) => {
235
+ if(e.keyCode === 13 && e.ctrlKey) {
236
+ handleOk(true)
237
+ document.getElementById("first-query")?.focus()
238
+ }
239
+ if(e.keyCode === 8 && e.ctrlKey) {
240
+ message.success('删除当前行')
241
+ e.stopPropagation();
242
+ e.preventDefault();
243
+ let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
244
+ if (dom) {
245
+ dom.select();
246
+ dom.focus();
247
+ dom.scrollIntoView(false)
248
+ }
249
+ dom = null
250
+ deleteRecord(record, popvalue);
251
+ }
252
+ if (e.keyCode === 37 && e.shiftKey) { // 左滑动
253
+ e.stopPropagation();
254
+ e.preventDefault();
255
+ let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
256
+ if (dom) {
257
+ dom.select();
258
+ dom.focus();
259
+ dom.scrollIntoView(false)
260
+ }
261
+ dom = null
262
+ }
263
+ if (e.keyCode === 39 && e.shiftKey) { // 右滑
264
+ e.stopPropagation();
265
+ e.preventDefault();
266
+ let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
267
+ if (dom) {
268
+ dom.select();
269
+ dom.focus();
270
+ dom.scrollIntoView(false)
271
+ }
272
+ dom = null
273
+ }
274
+ if (e.keyCode === 40) {
275
+ e.stopPropagation();
276
+ e.preventDefault();
277
+ let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
278
+ if (dom) {
279
+ dom.select();
280
+ dom.focus();
281
+ dom.scrollIntoView(false)
282
+ }
283
+ dom = null
284
+ } else if (e.keyCode === 38) {
285
+ e.stopPropagation();
286
+ e.preventDefault();
287
+ let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
288
+ if (dom1) {
289
+ // dom1.value=""
290
+ // dom1.setSelectionRange(100, 0);
291
+ dom1.select();
292
+ dom1.focus();
293
+ dom1.scrollIntoViewIfNeeded(false)
294
+ // dom1.value=record['count']
295
+ }
296
+ dom1 = null
297
+ } else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
298
+ e.stopPropagation();
299
+ e.preventDefault();
300
+ }
301
+ }}
302
+ />
303
+ );
304
+ },
176
305
  }
177
- })
178
- )
179
- }, [modalTableProps?.tableColumns])
306
+ }
307
+
308
+ return item
309
+ }), {
310
+ title: '操作',
311
+ width: 50,
312
+ dataIndex: 'operation',
313
+ fixed: 'right',
314
+ render: (text, record, index) => {
315
+ return (
316
+ <span style={{cursor: 'pointer', color: '#005CFF' }} onClick={() => {
317
+ deleteRecord(record)
318
+ }} type={"text"}>删除</span>
319
+ )
320
+ }
321
+ },])
322
+ }, [modalTableProps?.selectColumn,popvalue])
180
323
 
181
324
  // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
182
325
  const getData = (params = {}, type = 1) => {
@@ -706,162 +849,71 @@ const AddSelect = (props: any) => {
706
849
  }
707
850
 
708
851
  let inputIndex = 0;
709
- let selectColumns = [... modalTableProps.selectColumn.map(item => {
710
- const inputLength = modalTableProps.selectColumn.filter(item => item.isInputItem).length
711
- const currentIndex = inputIndex
712
-
713
- if (item.isInputItem) {
714
- inputIndex++;
715
- return {
716
- ...item,
717
- render: (text, record, index) => {
718
- // let
719
- if(record.needFocus === true && currentIndex === 0) {
720
852
 
721
- }
722
- let precisionObj={};
723
- const unitAccuracy = record.packingUnitList?.[0]?.unitAccuracy
724
- const isCountUnitAccuracyCheck = item.dataIndex =='count' && unitAccuracy !== undefined
725
- if(isCountUnitAccuracyCheck) {
726
- precisionObj = {
727
- onBlur: (e: any) => {
728
- const { target: { value } } = e;
729
- if(!checkQuantityAccuracy(value,Number(unitAccuracy))) {
730
- record[item.dataIndex] = precisionQuantity(value,Number(unitAccuracy))
731
- const newPopValue = popvalue.map((i: any, innerIndex: number) => {
732
- if(innerIndex == index) {
733
- i[item.dataIndex] = record[item.dataIndex]
734
- }
735
- return i
736
- })
737
- setPopValue(newPopValue)
738
- }
739
- }
740
- // precision: unitAccuracy
741
- }
742
- }
743
- return (
744
- <InputNumber
745
- value={text || ''}
746
- min={0}
747
- autoFocus={record.needFocus}
748
- keyboard={false}
749
- {...precisionObj}
750
- onChange={(value) => {
751
- record[item.dataIndex] = value
752
- const newPopValue = popvalue.map((i: any, innerIndex: number) => {
753
- if(innerIndex == index) {
754
- i[item.dataIndex] = record[item.dataIndex]
755
- }
756
- return i
757
- })
758
- setPopValue(newPopValue)
759
- }}
760
- // onFocus={(e)=> {
761
- // let dom1 = e.currentTarget;
762
- // dom1.setSelectionRange(100, 0);
763
- // dom1.select(text);
764
- // }}
765
- onKeyDown={(e) => {
766
- if(e.keyCode === 13 && e.ctrlKey) {
767
- handleOk(true)
768
- document.getElementById("first-query")?.focus()
769
- }
770
- if(e.keyCode === 8 && e.ctrlKey) {
771
- message.success('删除当前行')
772
- e.stopPropagation();
773
- e.preventDefault();
774
- let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
775
- if (dom) {
776
- dom.select();
777
- dom.focus();
778
- dom.scrollIntoView(false)
779
- }
780
- dom = null
781
- deleteRecord(record, popvalue);
782
- }
783
- if (e.keyCode === 37 && e.shiftKey) { // 左滑动
784
- e.stopPropagation();
785
- e.preventDefault();
786
- let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex - 1]
787
- if (dom) {
788
- dom.select();
789
- dom.focus();
790
- dom.scrollIntoView(false)
791
- }
792
- dom = null
793
- }
794
- if (e.keyCode === 39 && e.shiftKey) { // 右滑
795
- e.stopPropagation();
796
- e.preventDefault();
797
- let dom = e.nativeEvent.path[5].children[index + 1]?.getElementsByTagName('input')[currentIndex + 1]
798
- if (dom) {
799
- dom.select();
800
- dom.focus();
801
- dom.scrollIntoView(false)
802
- }
803
- dom = null
804
- }
805
- if (e.keyCode === 40) {
806
- e.stopPropagation();
807
- e.preventDefault();
808
- let dom = e.nativeEvent.path[5].children[index + 2]?.getElementsByTagName('input')[currentIndex]
809
- if (dom) {
810
- dom.select();
811
- dom.focus();
812
- dom.scrollIntoView(false)
813
- }
814
- dom = null
815
- } else if (e.keyCode === 38) {
816
- e.stopPropagation();
817
- e.preventDefault();
818
- let dom1 = e.nativeEvent.path[5].children[index]?.getElementsByTagName('input')[currentIndex]
819
- if (dom1) {
820
- // dom1.value=""
821
- // dom1.setSelectionRange(100, 0);
822
- dom1.select();
823
- dom1.focus();
824
- dom1.scrollIntoViewIfNeeded(false)
825
- // dom1.value=record['count']
826
- }
827
- dom1 = null
828
- } else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
829
- e.stopPropagation();
830
- e.preventDefault();
831
- }
832
- }}
833
- />
834
- );
835
- },
853
+ useEffect(() => {
854
+ setInitialShowColumn(codeSelected,selectColumns,(res) => {
855
+ setShowColumnsCallback(res)
856
+ })
857
+ },[selectColumns])
858
+ useEffect(() => {
859
+ setInitialShowColumn(codeToChoose,tableColumns,(res) => {
860
+ setShowToChooseColumnsCallback(res)
861
+ })
862
+ },[tableColumns])
863
+
864
+ const handleResize = (arr,index: any, callback) => (_: any, { size }: any) => {
865
+ let newColumns = arr.map((col: any) => ({ ...col }));
866
+ const handleIndex = (arr: any, indexArr: any) => {
867
+ let i = indexArr.shift();
868
+ if (indexArr.length > 0) {
869
+ handleIndex(arr[i].children, indexArr);
870
+ } else {
871
+ arr[i] = {
872
+ ...arr[i],
873
+ width: size.width,
874
+ };
875
+ handleAntdColumnsSpecialParams(arr[i]);
836
876
  }
837
- }
877
+ };
878
+ handleIndex(newColumns, [...index]);
879
+ callback(newColumns)
880
+ };
838
881
 
839
- return item
840
- }), {
841
- title: '操作',
842
- width: 50,
843
- fixed: 'right',
844
- render: (text, record, index) => {
845
- return (
846
- <span style={{cursor: 'pointer', color: '#005CFF' }} onClick={() => {
847
- deleteRecord(record)
848
- }} type={"text"}>删除</span>
849
- )
850
- }
851
- },]
852
-
853
- const handleResize =
854
- (index) =>
855
- (e, { size }) => {
856
- setTableColumns((columns: any) => {
857
- let newColumns = [...columns];
858
- newColumns[index] = {
859
- ...newColumns[index],
860
- width: size.width,
861
- };
862
- return [...newColumns];
882
+ const setShowColumnsCallback = (newColumns: Array<any>) => {
883
+ setShowColumns([...newColumns])
884
+ }
885
+ const setShowToChooseColumnsCallback = (newColumns: Array<any>) => {
886
+ setShowToChooseColumns([...newColumns])
887
+ }
888
+
889
+ const handleColumns = (arr: any, indexArr: any[], callback: any) => {
890
+ arr.forEach((item: any, index: any) => {
891
+ let indexArrInside = [...indexArr, index].filter((i: any) => i || i === 0)
892
+ if (noEmptyArray(item.children)) {
893
+ handleColumns(item.children, indexArrInside);
894
+ } else {
895
+ item.width = item.width || getItemDefaultWidth(item);
896
+ item.onHeaderCell = (column: any) => ({
897
+ ...item,
898
+ width:
899
+ typeof column.width === 'number'
900
+ ? column.width
901
+ : parseInt(column.width.replace('px', '')),
902
+ onResize: handleResize(arr,indexArrInside, callback),
863
903
  });
864
- };
904
+ }
905
+ })
906
+ };
907
+ let showToChooseCol = showToChooseColumns.map((item: any) => {
908
+ handleAntdColumnsSpecialParams(item);
909
+ return ({ ...item })
910
+ })
911
+ handleColumns(showToChooseCol, [],(res)=> setShowToChooseColumnsCallback(res));
912
+ let showSelectedCol = showColumns.map((item: any) => {
913
+ handleAntdColumnsSpecialParams(item);
914
+ return ({ ...item })
915
+ })
916
+ handleColumns(showSelectedCol, [],(res)=> setShowColumnsCallback(res));
865
917
 
866
918
  return (
867
919
  <div className={'add_select'}>
@@ -884,7 +936,7 @@ const AddSelect = (props: any) => {
884
936
  取消
885
937
  </Button>,
886
938
  <Button
887
- key="submit"
939
+ key="save-and-continue"
888
940
  style={{color: '#005CFF', borderColor: '#005CFF'}}
889
941
  onClick={() => {handleOk(true)}}
890
942
  loading={confirmContinueLoading}
@@ -927,11 +979,22 @@ const AddSelect = (props: any) => {
927
979
  <div>
928
980
  <div className={'select_list_selectTips'}>
929
981
  <div style={{ marginLeft: 8 }}>搜索结果共&nbsp;<span style={themeColor}>{tablePagination?.total || 0}</span>&nbsp;项{selectMode ? <span>, 本次已选&nbsp;<span style={themeColor}>{selectedRowKeys?.length || 0}</span>&nbsp;项</span> : ''}</div>
982
+ <div>
983
+ <span style={{ marginRight: 8 }}>
984
+ <TableColumnSetting
985
+ setShowColumns={setShowToChooseColumnsCallback}
986
+ showColumns={showToChooseColumns}
987
+ datasource={tableColumns || []}
988
+ tableCode={codeToChoose}
989
+ settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
990
+ />
991
+ </span>
992
+ </div>
930
993
  </div>
931
994
  <Table
932
995
  size='small'
933
996
  rowSelection={rowSelection}
934
- columns={tableColumns}
997
+ columns={showToChooseCol}
935
998
  dataSource={tableData}
936
999
  pagination={tablePagination}
937
1000
  loading={fetching}
@@ -965,12 +1028,22 @@ const AddSelect = (props: any) => {
965
1028
  <div className={'add_select_wrapper_select'}>
966
1029
  <div className={'select_list_selectTips'}>
967
1030
  <div style={{ marginLeft: 8 }}><span>本次已选&nbsp;<span style={themeColor}>{selectedRowKeys?.length || 0}</span>&nbsp;项</span></div>
968
- <div style={{ marginRight: 8 }}><span onClick={deleteSelectRows} style={{ ...themeColor, cursor: 'pointer' }}>清空所选商品</span></div>
1031
+ <div style={{ display: 'flex' }}>
1032
+ <span style={{ marginRight: 8 }}>
1033
+ <TableColumnSetting
1034
+ setShowColumns={setShowColumnsCallback}
1035
+ showColumns={showColumns}
1036
+ datasource={selectColumns || []}
1037
+ tableCode={codeSelected}
1038
+ settingImgAttribute={{ width: 20, style: { marginTop: -2 } }}
1039
+ />
1040
+ </span>
1041
+ <div style={{ marginRight: 8 }}><span onClick={deleteSelectRows} style={{ ...themeColor, cursor: 'pointer' }}>清空所选商品</span></div>
1042
+ </div>
969
1043
  </div>
970
1044
  <Table
971
1045
  size='small'
972
- // rowSelection={rowSelection}
973
- columns={selectColumns}
1046
+ columns={showSelectedCol}
974
1047
  dataSource={popvalue}
975
1048
  pagination={false}
976
1049
  // onChange={handleTableChange}
@@ -982,6 +1055,11 @@ const AddSelect = (props: any) => {
982
1055
  onDoubleClick: event => onDoubleClickSelect(event, record),
983
1056
  };
984
1057
  }}
1058
+ components={{
1059
+ header: {
1060
+ cell: ResizeableTitle,
1061
+ },
1062
+ }}
985
1063
  />
986
1064
  </div>
987
1065
  </div>