@bit-sun/business-component 4.2.0-alpha.19 → 4.2.0-alpha.20

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.
package/dist/index.esm.js CHANGED
@@ -2561,11 +2561,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2561
2561
  cell.v = cell.m;
2562
2562
  }
2563
2563
  }
2564
- // console.log(postion);
2565
2564
  },
2566
2565
  cellAllRenderBefore: function cellAllRenderBefore(data, sheetFile, ctx) {
2567
2566
  sheetFile.config.borderInfo = [];
2568
- // console.info(data,sheetFile,ctx)
2569
2567
  }
2570
2568
  },
2571
2569
  showtoolbarConfig: {
@@ -2733,14 +2731,21 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2733
2731
  };
2734
2732
  };
2735
2733
  _this.getData = function () {
2736
- console.time();
2734
+ // 是否使用字符串值 默认为false
2735
+ var useStringValue = _this.props.useStringValue || false;
2737
2736
  var sheetData = luckysheet.getSheetData();
2738
2737
  var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
2739
2738
  return item[0];
2740
2739
  }).map(function (item) {
2741
2740
  var obj = {};
2742
2741
  item.slice(0, itemsTemp.length).map(function (innerItem, index) {
2743
- obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
2742
+ // 如果使用字符串值,直接赋值字符串
2743
+ if (useStringValue) {
2744
+ obj[_this.state.items[index].code] = innerItem && innerItem.m;
2745
+ } else {
2746
+ // 否则根据值是否相等来判断是否使用字符串值
2747
+ obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
2748
+ }
2744
2749
  });
2745
2750
  return obj;
2746
2751
  });
@@ -2881,7 +2886,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2881
2886
  errorListCheck: false,
2882
2887
  resultData: res
2883
2888
  });
2884
- console.log(setExportData);
2885
2889
  setExportData([123123]);
2886
2890
  }).catch(function (err) {});
2887
2891
  case 3:
@@ -3177,7 +3181,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
3177
3181
  left: '0px',
3178
3182
  top: '0px'
3179
3183
  };
3180
- console.log('itemsTemp', itemsTemp);
3181
3184
  return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
3182
3185
  className: "sheet_table_top"
3183
3186
  }, /*#__PURE__*/React$1.createElement(Space, null, /*#__PURE__*/React$1.createElement("span", null, "\u6392\u5E8F\u5217"), /*#__PURE__*/React$1.createElement(Dropdown, {
@@ -4281,7 +4284,11 @@ var convertBodyParams = function convertBodyParams(params) {
4281
4284
  }
4282
4285
  // body参数来源:sku选择器固定参数 > 调用所传bodyParams > 默认参数-无
4283
4286
  // post 方式参数 来源默认的bodyParams 以及原有搜索项的参数
4284
- return unique_params || omit(_objectSpread2(_objectSpread2({}, params), params === null || params === void 0 ? void 0 : params.bodyParams), ['bodyParams', 'noUrlQueryParams']);
4287
+ return unique_params || (params === null || params === void 0 ? void 0 : params.bodyParams) || null;
4288
+ // return unique_params || omit({
4289
+ // ...params,
4290
+ // ...params?.bodyParams,
4291
+ // },['bodyParams', 'noUrlQueryParams']);
4285
4292
  };
4286
4293
  var convertRes = function convertRes(data, otherParams) {
4287
4294
  var mappingTextField = otherParams.mappingTextField,
@@ -8387,6 +8394,8 @@ var AddSelect = function AddSelect(props) {
8387
8394
  });
8388
8395
  };
8389
8396
  var handleTableChange = function handleTableChange(pagination) {
8397
+ // 设置分页tablePagination
8398
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), pagination));
8390
8399
  getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
8391
8400
  pageSize: pagination.pageSize,
8392
8401
  currentPage: pagination.current
@@ -14059,7 +14068,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14059
14068
  'ctl-withAuth': true
14060
14069
  },
14061
14070
  resType: 'list',
14062
- resPosition: isNoUseItemBarcode ? 3 : 4,
14071
+ resPosition: isNoUseItemBarcode ? 4 : 5,
14063
14072
  resKeyValue: ['id', 'name']
14064
14073
  }, {
14065
14074
  url: "/items/category/queryCategoryTree",
@@ -14068,7 +14077,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14068
14077
  currentPage: 1
14069
14078
  },
14070
14079
  resType: 'treeList',
14071
- resPosition: isNoUseItemBarcode ? 4 : 5
14080
+ resPosition: isNoUseItemBarcode ? 5 : 6
14072
14081
  }];
14073
14082
  var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
14074
14083
  var props = {
@@ -14105,7 +14114,8 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14105
14114
  tableSearchForm: mTpTableSearchForm,
14106
14115
  tableColumns: mTpTableColumn,
14107
14116
  selectColumn: mTpSelectColumn,
14108
- promiseLoadList: mTpPromiseLoadList
14117
+ promiseLoadList: mTpPromiseLoadList,
14118
+ topTablePagination: (parProps === null || parProps === void 0 ? void 0 : parProps.pagination) || {}
14109
14119
  };
14110
14120
  return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
14111
14121
  modalTableProps: modalTableProps
package/dist/index.js CHANGED
@@ -2584,11 +2584,9 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2584
2584
  cell.v = cell.m;
2585
2585
  }
2586
2586
  }
2587
- // console.log(postion);
2588
2587
  },
2589
2588
  cellAllRenderBefore: function cellAllRenderBefore(data, sheetFile, ctx) {
2590
2589
  sheetFile.config.borderInfo = [];
2591
- // console.info(data,sheetFile,ctx)
2592
2590
  }
2593
2591
  },
2594
2592
  showtoolbarConfig: {
@@ -2756,14 +2754,21 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2756
2754
  };
2757
2755
  };
2758
2756
  _this.getData = function () {
2759
- console.time();
2757
+ // 是否使用字符串值 默认为false
2758
+ var useStringValue = _this.props.useStringValue || false;
2760
2759
  var sheetData = luckysheet.getSheetData();
2761
2760
  var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
2762
2761
  return item[0];
2763
2762
  }).map(function (item) {
2764
2763
  var obj = {};
2765
2764
  item.slice(0, itemsTemp.length).map(function (innerItem, index) {
2766
- obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
2765
+ // 如果使用字符串值,直接赋值字符串
2766
+ if (useStringValue) {
2767
+ obj[_this.state.items[index].code] = innerItem && innerItem.m;
2768
+ } else {
2769
+ // 否则根据值是否相等来判断是否使用字符串值
2770
+ obj[_this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
2771
+ }
2767
2772
  });
2768
2773
  return obj;
2769
2774
  });
@@ -2904,7 +2909,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2904
2909
  errorListCheck: false,
2905
2910
  resultData: res
2906
2911
  });
2907
- console.log(setExportData);
2908
2912
  setExportData([123123]);
2909
2913
  }).catch(function (err) {});
2910
2914
  case 3:
@@ -3200,7 +3204,6 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
3200
3204
  left: '0px',
3201
3205
  top: '0px'
3202
3206
  };
3203
- console.log('itemsTemp', itemsTemp);
3204
3207
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
3205
3208
  className: "sheet_table_top"
3206
3209
  }, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement("span", null, "\u6392\u5E8F\u5217"), /*#__PURE__*/React__default['default'].createElement(antd.Dropdown, {
@@ -4304,7 +4307,11 @@ var convertBodyParams = function convertBodyParams(params) {
4304
4307
  }
4305
4308
  // body参数来源:sku选择器固定参数 > 调用所传bodyParams > 默认参数-无
4306
4309
  // post 方式参数 来源默认的bodyParams 以及原有搜索项的参数
4307
- return unique_params || _.omit(_objectSpread2(_objectSpread2({}, params), params === null || params === void 0 ? void 0 : params.bodyParams), ['bodyParams', 'noUrlQueryParams']);
4310
+ return unique_params || (params === null || params === void 0 ? void 0 : params.bodyParams) || null;
4311
+ // return unique_params || omit({
4312
+ // ...params,
4313
+ // ...params?.bodyParams,
4314
+ // },['bodyParams', 'noUrlQueryParams']);
4308
4315
  };
4309
4316
  var convertRes = function convertRes(data, otherParams) {
4310
4317
  var mappingTextField = otherParams.mappingTextField,
@@ -8410,6 +8417,8 @@ var AddSelect = function AddSelect(props) {
8410
8417
  });
8411
8418
  };
8412
8419
  var handleTableChange = function handleTableChange(pagination) {
8420
+ // 设置分页tablePagination
8421
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), pagination));
8413
8422
  getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
8414
8423
  pageSize: pagination.pageSize,
8415
8424
  currentPage: pagination.current
@@ -14082,7 +14091,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14082
14091
  'ctl-withAuth': true
14083
14092
  },
14084
14093
  resType: 'list',
14085
- resPosition: isNoUseItemBarcode ? 3 : 4,
14094
+ resPosition: isNoUseItemBarcode ? 4 : 5,
14086
14095
  resKeyValue: ['id', 'name']
14087
14096
  }, {
14088
14097
  url: "/items/category/queryCategoryTree",
@@ -14091,7 +14100,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14091
14100
  currentPage: 1
14092
14101
  },
14093
14102
  resType: 'treeList',
14094
- resPosition: isNoUseItemBarcode ? 4 : 5
14103
+ resPosition: isNoUseItemBarcode ? 5 : 6
14095
14104
  }];
14096
14105
  var mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
14097
14106
  var props = {
@@ -14128,7 +14137,8 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
14128
14137
  tableSearchForm: mTpTableSearchForm,
14129
14138
  tableColumns: mTpTableColumn,
14130
14139
  selectColumn: mTpSelectColumn,
14131
- promiseLoadList: mTpPromiseLoadList
14140
+ promiseLoadList: mTpPromiseLoadList,
14141
+ topTablePagination: (parProps === null || parProps === void 0 ? void 0 : parProps.pagination) || {}
14132
14142
  };
14133
14143
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
14134
14144
  modalTableProps: modalTableProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.2.0-alpha.19",
3
+ "version": "4.2.0-alpha.20",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -433,7 +433,7 @@ export const AddSkuSelect = (parProps: any) => {
433
433
  'ctl-withAuth': true
434
434
  },
435
435
  resType: 'list',
436
- resPosition: isNoUseItemBarcode ? 3 : 4,
436
+ resPosition: isNoUseItemBarcode ? 4 : 5,
437
437
  resKeyValue: ['id','name']
438
438
  },
439
439
  {
@@ -443,7 +443,7 @@ export const AddSkuSelect = (parProps: any) => {
443
443
  currentPage: 1,
444
444
  },
445
445
  resType: 'treeList',
446
- resPosition: isNoUseItemBarcode ? 4 : 5
446
+ resPosition: isNoUseItemBarcode ? 5 : 6
447
447
  },
448
448
  ]
449
449
  const mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
@@ -486,6 +486,7 @@ export const AddSkuSelect = (parProps: any) => {
486
486
  tableColumns: mTpTableColumn,
487
487
  selectColumn: mTpSelectColumn,
488
488
  promiseLoadList: mTpPromiseLoadList,
489
+ topTablePagination: parProps?.pagination || {},
489
490
  }
490
491
 
491
492
  return (
@@ -669,7 +669,7 @@ const AddSelect = (props: any) => {
669
669
  }
670
670
  // 数据源 不可以有重复key
671
671
  source = Array.isArray(source) ? _.uniqBy(source, 'value') : [];
672
-
672
+
673
673
  setTableData(source)
674
674
  setTablePagination({ ...tablePagination, total: Number(res?.total || res?.totalCount || source.length), pageSize: Number(res?.size || res?.pageSize || (params?.pageSize || pageSize)), current: Number(res?.page || res?.currentPage || (params?.currentPage || currentPage)) })
675
675
  })
@@ -807,6 +807,8 @@ const AddSelect = (props: any) => {
807
807
  }
808
808
 
809
809
  const handleTableChange = (pagination) => {
810
+ // 设置分页tablePagination
811
+ setTablePagination({ ...tablePagination, ...pagination })
810
812
  getData({ ...tableFormParams, pageSize: pagination.pageSize, currentPage: pagination.current }, 2)
811
813
  }
812
814
 
@@ -242,11 +242,9 @@ class DataValidation extends React.Component {
242
242
  cell.v = cell.m
243
243
  }
244
244
  }
245
- // console.log(postion);
246
245
  },
247
246
  cellAllRenderBefore: function (data, sheetFile, ctx) {
248
247
  sheetFile.config.borderInfo = [];
249
- // console.info(data,sheetFile,ctx)
250
248
  },
251
249
  },
252
250
  showtoolbarConfig: {
@@ -411,7 +409,8 @@ class DataValidation extends React.Component {
411
409
  };
412
410
 
413
411
  getData = () => {
414
- console.time();
412
+ // 是否使用字符串值 默认为false
413
+ const useStringValue = this.props.useStringValue || false;
415
414
  let sheetData = luckysheet.getSheetData();
416
415
  let data = JSON.parse(JSON.stringify(sheetData))
417
416
  .filter((item) => item[0])
@@ -419,7 +418,13 @@ class DataValidation extends React.Component {
419
418
  let obj = {};
420
419
 
421
420
  item.slice(0, itemsTemp.length).map((innerItem, index) => {
422
- obj[this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
421
+ // 如果使用字符串值,直接赋值字符串
422
+ if (useStringValue) {
423
+ obj[this.state.items[index].code] = innerItem && innerItem.m;
424
+ } else {
425
+ // 否则根据值是否相等来判断是否使用字符串值
426
+ obj[this.state.items[index].code] = innerItem && (innerItem.v === innerItem.m ? innerItem.m : innerItem.v);
427
+ }
423
428
  });
424
429
 
425
430
  return obj;
@@ -570,7 +575,6 @@ customSort = (a, b) => {
570
575
  resultData: res,
571
576
  });
572
577
 
573
- console.log(setExportData);
574
578
  setExportData([123123]);
575
579
  })
576
580
  .catch((err:any) => { });
@@ -820,7 +824,6 @@ customSort = (a, b) => {
820
824
  top: '0px',
821
825
  };
822
826
 
823
- console.log('itemsTemp', itemsTemp)
824
827
  return (
825
828
  <>
826
829
  <div className="sheet_table_top">
@@ -234,10 +234,11 @@ export const convertBodyParams = (params: any) => {
234
234
 
235
235
  // body参数来源:sku选择器固定参数 > 调用所传bodyParams > 默认参数-无
236
236
  // post 方式参数 来源默认的bodyParams 以及原有搜索项的参数
237
- return unique_params || omit({
238
- ...params,
239
- ...params?.bodyParams,
240
- },['bodyParams', 'noUrlQueryParams']);
237
+ return unique_params || params?.bodyParams || null;
238
+ // return unique_params || omit({
239
+ // ...params,
240
+ // ...params?.bodyParams,
241
+ // },['bodyParams', 'noUrlQueryParams']);
241
242
  }
242
243
 
243
244