@bit-sun/business-component 4.0.12-alpha.2 → 4.0.12-alpha.3

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
@@ -4120,8 +4120,8 @@ var getRealStr = function getRealStr(oldSelect, newSelect, record) {
4120
4120
  };
4121
4121
  var getTableHeigth = function getTableHeigth(list) {
4122
4122
  var totalRows = Math.ceil(((list === null || list === void 0 ? void 0 : list.length) + 1) / 4);
4123
- if (totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
4124
- return 488 - totalRows * 10;
4123
+ if (totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
4124
+ return 411 - totalRows * 10;
4125
4125
  };
4126
4126
 
4127
4127
  var zhankaitiaojian = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3Ezhankaitiaojian-icon%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Crect%20id%3D%22path-1%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2224%22%20height%3D%2224%22%3E%3C%2Frect%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22%E9%A1%B5%E9%9D%A2-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22icon%22%20transform%3D%22translate%28-702.000000%2C%20-498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22zhankaitiaojian-icon%22%20transform%3D%22translate%28702.000000%2C%20498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmask%20id%3D%22mask-2%22%20fill%3D%22white%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fmask%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20id%3D%22%E8%92%99%E7%89%88%22%20fill%3D%22%23D8D8D8%22%20opacity%3D%220%22%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0142082%2C6%20L18%2C11.9972435%20L12.0142082%2C18%20L11.04209%2C17.0260337%20L16.0562218%2C11.9972435%20L11.04209%2C6.97396631%20L12.0142082%2C6%20Z%20M6.97257658%2C6%20L12.9583683%2C11.9972435%20L6.97257658%2C18%20L6.00091666%2C17.0260337%20L11.0150485%2C11.9972435%20L6%2C6.97396631%20L6.97257658%2C6%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%20fill%3D%22%23005CFF%22%20fill-rule%3D%22nonzero%22%20mask%3D%22url%28%23mask-2%29%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%28-270.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
@@ -4736,22 +4736,20 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4736
4736
  };
4737
4737
  var handleSelectOver = function handleSelectOver(selectedValue) {
4738
4738
  if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
4739
- var _ctx$form2;
4740
4739
  // 解决选择最后1页的sku,返回后,不显示名称问题
4741
- var source = _.uniqBy(items.concat(selectedValue), 'value');
4742
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
4743
- setSelectDataSource(source, source === null || source === void 0 ? void 0 : source.length);
4740
+ updateSelectDataSource(selectedValue);
4744
4741
  formaData(selectedValue, source);
4745
4742
  } else {
4746
4743
  var formatResult = selectMode ? [] : null;
4747
4744
  onChange(formatResult, selectedValue);
4748
4745
  }
4749
4746
  };
4750
- var handleOk = function handleOk() {
4747
+ var handleOk = function handleOk(sValue) {
4748
+ var pValue = sValue || popvalue;
4751
4749
  // 按钮保存可传入
4752
4750
  if (onSaveCallback) {
4753
4751
  setConfirmLoading(true);
4754
- onSaveCallback(popvalue).then(function (res) {
4752
+ onSaveCallback(pValue).then(function (res) {
4755
4753
  {
4756
4754
  var _Object$keys;
4757
4755
  // 成功信息可以在调用处处理 即resolve({messageSuccessBackInfo: { needThrowSuccess: false } })、resolve({messageSuccessBackInfo: { needThrowSuccess: true, successMessage: '已保存' } })
@@ -4774,10 +4772,18 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4774
4772
  setConfirmLoading(false);
4775
4773
  });
4776
4774
  } else {
4777
- handleSelectOver(popvalue);
4775
+ handleSelectOver(pValue);
4778
4776
  handleCancel();
4779
4777
  }
4780
4778
  };
4779
+ // 更新选中数据位置
4780
+ var updateSelectDataSource = function updateSelectDataSource(selectedValues) {
4781
+ var _ctx$form2;
4782
+ var nSource = _.uniqBy(selectedValues.concat(items), 'value');
4783
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, nSource);
4784
+ setSelectDataSource(nSource, nSource === null || nSource === void 0 ? void 0 : nSource.length);
4785
+ };
4786
+ // 下拉框 / 弹窗 选中数据之后 最终都会执行此函数
4781
4787
  var formaData = function formaData(value, source) {
4782
4788
  if (labelInValue) {
4783
4789
  var formatResult = value.map(function (i) {
@@ -4880,8 +4886,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4880
4886
  })) || [];
4881
4887
  // 单选 默认直接选中 不需要确定 配置了modalRadioNeedFooter就需要确定
4882
4888
  if (!selectMode && !(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalRadioNeedFooter)) {
4883
- handleSelectOver(selectRows);
4884
- handleCancel();
4889
+ handleOk(selectRows);
4885
4890
  }
4886
4891
  setSelectedRowKeys(sksResult);
4887
4892
  setSelectedRows(selectRows);
@@ -5071,10 +5076,10 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5071
5076
  // />
5072
5077
  var renderShowTable = function renderShowTable(tableList, type) {
5073
5078
  var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
5074
- var oSY = "calc(100vh - 391px - 82px)"; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
5079
+ var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - 82px)"); // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
5075
5080
  return /*#__PURE__*/React$1.createElement("div", {
5076
5081
  style: {
5077
- height: "calc(100vh - 391px)"
5082
+ height: "calc(100vh - ".concat(tableBoxHeighth, "px)")
5078
5083
  }
5079
5084
  }, /*#__PURE__*/React$1.createElement(Table, _objectSpread2(_objectSpread2({
5080
5085
  bordered: true,
@@ -5135,7 +5140,13 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5135
5140
  init && run('init');
5136
5141
  };
5137
5142
  var onClear = function onClear() {
5143
+ var _props$onClear;
5144
+ // 执行父组件 onClear 事件
5145
+ props === null || props === void 0 ? void 0 : (_props$onClear = props.onClear) === null || _props$onClear === void 0 ? void 0 : _props$onClear.call(props);
5146
+ // 清空下拉框 / 弹窗 选中数据
5138
5147
  formaData([], items);
5148
+ onChangeSelectedKeys([], []);
5149
+ // 重置下拉框数据源
5139
5150
  resetSelectDataSource();
5140
5151
  };
5141
5152
  var onDeselect = function onDeselect() {
@@ -8958,7 +8969,7 @@ function commonFun(type, prefixUrl, parentProps) {
8958
8969
  name: 'qp-skuName-like',
8959
8970
  label: 'SKU名称'
8960
8971
  }, {
8961
- name: 'qp-spuCode-like',
8972
+ name: 'qp-itemCode-like',
8962
8973
  label: '外部SPU编码'
8963
8974
  }, {
8964
8975
  name: 'qp-eancode-in',
@@ -14320,7 +14331,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14320
14331
  restProps = _objectWithoutProperties(_this$props3, _excluded2$4);
14321
14332
  var otherTableInfo = _objectSpread2({}, restProps);
14322
14333
  var showSummary = null;
14323
- if (this.state.showColumns.length) {
14334
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
14324
14335
  if (summary && summary().diy) {
14325
14336
  showSummary = this.getTableSummaryInfo();
14326
14337
  } else {
@@ -14358,9 +14369,10 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14358
14369
  y: 400
14359
14370
  }, scroll), {}, {
14360
14371
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
14361
- }),
14372
+ })
14373
+ }, showSummary ? {
14362
14374
  summary: showSummary
14363
- });
14375
+ } : {});
14364
14376
  return /*#__PURE__*/React$1.createElement("div", {
14365
14377
  style: {
14366
14378
  position: 'relative'
@@ -14388,7 +14400,32 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14388
14400
  cell: this.ResizeableTitle
14389
14401
  }
14390
14402
  }
14391
- }, otherTableInfo)));
14403
+ }, otherTableInfo)), Array.isArray(summary) && ( /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
14404
+ className: 'table-bssula-summary',
14405
+ style: {
14406
+ right: '20%',
14407
+ bottom: 0,
14408
+ whiteSpace: 'nowrap',
14409
+ overflowX: 'auto'
14410
+ }
14411
+ }, summary.map(function (item) {
14412
+ return /*#__PURE__*/React$1.createElement(Text, {
14413
+ type: 'danger'
14414
+ }, item.label, ": ", /*#__PURE__*/React$1.createElement("span", {
14415
+ className: 'table-bssula-summary-count'
14416
+ }, item.count || 0));
14417
+ })), /*#__PURE__*/React$1.createElement("div", {
14418
+ style: {
14419
+ width: '16px',
14420
+ height: '26px',
14421
+ opacity: 0.32,
14422
+ transform: 'scaleX(-1)',
14423
+ backgroundImage: 'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
14424
+ right: '20%',
14425
+ position: 'absolute',
14426
+ bottom: 0
14427
+ }
14428
+ }))));
14392
14429
  }
14393
14430
  }]);
14394
14431
  }(React$1.Component);
@@ -14563,7 +14600,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14563
14600
  restProps = _objectWithoutProperties(_this$props3, _excluded2$5);
14564
14601
  var otherTableInfo = _objectSpread2({}, restProps);
14565
14602
  var showSummary = null;
14566
- if (this.state.showColumns.length) {
14603
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
14567
14604
  if (summary && summary().diy) {
14568
14605
  showSummary = this.getTableSummaryInfo();
14569
14606
  } else {
@@ -14601,9 +14638,10 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14601
14638
  y: 400
14602
14639
  }, scroll), {}, {
14603
14640
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
14604
- }),
14641
+ })
14642
+ }, showSummary ? {
14605
14643
  summary: showSummary
14606
- });
14644
+ } : {});
14607
14645
  return /*#__PURE__*/React$1.createElement("div", {
14608
14646
  style: {
14609
14647
  position: 'relative'
@@ -14631,7 +14669,32 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14631
14669
  cell: this.ResizeableTitle
14632
14670
  }
14633
14671
  }
14634
- }, otherTableInfo)));
14672
+ }, otherTableInfo)), Array.isArray(summary) && ( /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("div", {
14673
+ className: 'table-bssula-summary',
14674
+ style: {
14675
+ right: '20%',
14676
+ bottom: 0,
14677
+ whiteSpace: 'nowrap',
14678
+ overflowX: 'auto'
14679
+ }
14680
+ }, summary.map(function (item) {
14681
+ return /*#__PURE__*/React$1.createElement(Text$1, {
14682
+ type: 'danger'
14683
+ }, item.label, ": ", /*#__PURE__*/React$1.createElement("span", {
14684
+ className: 'table-bssula-summary-count'
14685
+ }, item.count || 0));
14686
+ })), /*#__PURE__*/React$1.createElement("div", {
14687
+ style: {
14688
+ width: '16px',
14689
+ height: '26px',
14690
+ opacity: 0.32,
14691
+ transform: 'scaleX(-1)',
14692
+ backgroundImage: 'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
14693
+ right: '20%',
14694
+ position: 'absolute',
14695
+ bottom: 0
14696
+ }
14697
+ }))));
14635
14698
  }
14636
14699
  }]);
14637
14700
  }(React$1.Component);
package/dist/index.js CHANGED
@@ -4143,8 +4143,8 @@ var getRealStr = function getRealStr(oldSelect, newSelect, record) {
4143
4143
  };
4144
4144
  var getTableHeigth = function getTableHeigth(list) {
4145
4145
  var totalRows = Math.ceil(((list === null || list === void 0 ? void 0 : list.length) + 1) / 4);
4146
- if (totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
4147
- return 488 - totalRows * 10;
4146
+ if (totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
4147
+ return 411 - totalRows * 10;
4148
4148
  };
4149
4149
 
4150
4150
  var zhankaitiaojian = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3Ezhankaitiaojian-icon%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Crect%20id%3D%22path-1%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2224%22%20height%3D%2224%22%3E%3C%2Frect%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22%E9%A1%B5%E9%9D%A2-1%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22icon%22%20transform%3D%22translate%28-702.000000%2C%20-498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22zhankaitiaojian-icon%22%20transform%3D%22translate%28702.000000%2C%20498.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cmask%20id%3D%22mask-2%22%20fill%3D%22white%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fmask%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20id%3D%22%E8%92%99%E7%89%88%22%20fill%3D%22%23D8D8D8%22%20opacity%3D%220%22%20xlink%3Ahref%3D%22%23path-1%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0142082%2C6%20L18%2C11.9972435%20L12.0142082%2C18%20L11.04209%2C17.0260337%20L16.0562218%2C11.9972435%20L11.04209%2C6.97396631%20L12.0142082%2C6%20Z%20M6.97257658%2C6%20L12.9583683%2C11.9972435%20L6.97257658%2C18%20L6.00091666%2C17.0260337%20L11.0150485%2C11.9972435%20L6%2C6.97396631%20L6.97257658%2C6%20Z%22%20id%3D%22%E5%BD%A2%E7%8A%B6%22%20fill%3D%22%23005CFF%22%20fill-rule%3D%22nonzero%22%20mask%3D%22url%28%23mask-2%29%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%28-270.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
@@ -4759,22 +4759,20 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4759
4759
  };
4760
4760
  var handleSelectOver = function handleSelectOver(selectedValue) {
4761
4761
  if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
4762
- var _ctx$form2;
4763
4762
  // 解决选择最后1页的sku,返回后,不显示名称问题
4764
- var source = ___default['default'].uniqBy(items.concat(selectedValue), 'value');
4765
- ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
4766
- setSelectDataSource(source, source === null || source === void 0 ? void 0 : source.length);
4763
+ updateSelectDataSource(selectedValue);
4767
4764
  formaData(selectedValue, source);
4768
4765
  } else {
4769
4766
  var formatResult = selectMode ? [] : null;
4770
4767
  onChange(formatResult, selectedValue);
4771
4768
  }
4772
4769
  };
4773
- var handleOk = function handleOk() {
4770
+ var handleOk = function handleOk(sValue) {
4771
+ var pValue = sValue || popvalue;
4774
4772
  // 按钮保存可传入
4775
4773
  if (onSaveCallback) {
4776
4774
  setConfirmLoading(true);
4777
- onSaveCallback(popvalue).then(function (res) {
4775
+ onSaveCallback(pValue).then(function (res) {
4778
4776
  {
4779
4777
  var _Object$keys;
4780
4778
  // 成功信息可以在调用处处理 即resolve({messageSuccessBackInfo: { needThrowSuccess: false } })、resolve({messageSuccessBackInfo: { needThrowSuccess: true, successMessage: '已保存' } })
@@ -4797,10 +4795,18 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4797
4795
  setConfirmLoading(false);
4798
4796
  });
4799
4797
  } else {
4800
- handleSelectOver(popvalue);
4798
+ handleSelectOver(pValue);
4801
4799
  handleCancel();
4802
4800
  }
4803
4801
  };
4802
+ // 更新选中数据位置
4803
+ var updateSelectDataSource = function updateSelectDataSource(selectedValues) {
4804
+ var _ctx$form2;
4805
+ var nSource = ___default['default'].uniqBy(selectedValues.concat(items), 'value');
4806
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, nSource);
4807
+ setSelectDataSource(nSource, nSource === null || nSource === void 0 ? void 0 : nSource.length);
4808
+ };
4809
+ // 下拉框 / 弹窗 选中数据之后 最终都会执行此函数
4804
4810
  var formaData = function formaData(value, source) {
4805
4811
  if (labelInValue) {
4806
4812
  var formatResult = value.map(function (i) {
@@ -4903,8 +4909,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4903
4909
  })) || [];
4904
4910
  // 单选 默认直接选中 不需要确定 配置了modalRadioNeedFooter就需要确定
4905
4911
  if (!selectMode && !(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalRadioNeedFooter)) {
4906
- handleSelectOver(selectRows);
4907
- handleCancel();
4912
+ handleOk(selectRows);
4908
4913
  }
4909
4914
  setSelectedRowKeys(sksResult);
4910
4915
  setSelectedRows(selectRows);
@@ -5094,10 +5099,10 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5094
5099
  // />
5095
5100
  var renderShowTable = function renderShowTable(tableList, type) {
5096
5101
  var tableBoxHeighth = getTableHeigth(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm);
5097
- var oSY = "calc(100vh - 391px - 82px)"; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
5102
+ var oSY = "calc(100vh - ".concat(tableBoxHeighth, "px - 82px)"); // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
5098
5103
  return /*#__PURE__*/React__default['default'].createElement("div", {
5099
5104
  style: {
5100
- height: "calc(100vh - 391px)"
5105
+ height: "calc(100vh - ".concat(tableBoxHeighth, "px)")
5101
5106
  }
5102
5107
  }, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({
5103
5108
  bordered: true,
@@ -5158,7 +5163,13 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5158
5163
  init && run('init');
5159
5164
  };
5160
5165
  var onClear = function onClear() {
5166
+ var _props$onClear;
5167
+ // 执行父组件 onClear 事件
5168
+ props === null || props === void 0 ? void 0 : (_props$onClear = props.onClear) === null || _props$onClear === void 0 ? void 0 : _props$onClear.call(props);
5169
+ // 清空下拉框 / 弹窗 选中数据
5161
5170
  formaData([], items);
5171
+ onChangeSelectedKeys([], []);
5172
+ // 重置下拉框数据源
5162
5173
  resetSelectDataSource();
5163
5174
  };
5164
5175
  var onDeselect = function onDeselect() {
@@ -8981,7 +8992,7 @@ function commonFun(type, prefixUrl, parentProps) {
8981
8992
  name: 'qp-skuName-like',
8982
8993
  label: 'SKU名称'
8983
8994
  }, {
8984
- name: 'qp-spuCode-like',
8995
+ name: 'qp-itemCode-like',
8985
8996
  label: '外部SPU编码'
8986
8997
  }, {
8987
8998
  name: 'qp-eancode-in',
@@ -14343,7 +14354,7 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14343
14354
  restProps = _objectWithoutProperties(_this$props3, _excluded2$4);
14344
14355
  var otherTableInfo = _objectSpread2({}, restProps);
14345
14356
  var showSummary = null;
14346
- if (this.state.showColumns.length) {
14357
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
14347
14358
  if (summary && summary().diy) {
14348
14359
  showSummary = this.getTableSummaryInfo();
14349
14360
  } else {
@@ -14381,9 +14392,10 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14381
14392
  y: 400
14382
14393
  }, scroll), {}, {
14383
14394
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
14384
- }),
14395
+ })
14396
+ }, showSummary ? {
14385
14397
  summary: showSummary
14386
- });
14398
+ } : {});
14387
14399
  return /*#__PURE__*/React__default['default'].createElement("div", {
14388
14400
  style: {
14389
14401
  position: 'relative'
@@ -14411,7 +14423,32 @@ var ColumnSettingSulaTable = /*#__PURE__*/function (_React$Component) {
14411
14423
  cell: this.ResizeableTitle
14412
14424
  }
14413
14425
  }
14414
- }, otherTableInfo)));
14426
+ }, otherTableInfo)), Array.isArray(summary) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
14427
+ className: 'table-bssula-summary',
14428
+ style: {
14429
+ right: '20%',
14430
+ bottom: 0,
14431
+ whiteSpace: 'nowrap',
14432
+ overflowX: 'auto'
14433
+ }
14434
+ }, summary.map(function (item) {
14435
+ return /*#__PURE__*/React__default['default'].createElement(Text, {
14436
+ type: 'danger'
14437
+ }, item.label, ": ", /*#__PURE__*/React__default['default'].createElement("span", {
14438
+ className: 'table-bssula-summary-count'
14439
+ }, item.count || 0));
14440
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
14441
+ style: {
14442
+ width: '16px',
14443
+ height: '26px',
14444
+ opacity: 0.32,
14445
+ transform: 'scaleX(-1)',
14446
+ backgroundImage: 'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
14447
+ right: '20%',
14448
+ position: 'absolute',
14449
+ bottom: 0
14450
+ }
14451
+ }))));
14415
14452
  }
14416
14453
  }]);
14417
14454
  }(React__default['default'].Component);
@@ -14586,7 +14623,7 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14586
14623
  restProps = _objectWithoutProperties(_this$props3, _excluded2$5);
14587
14624
  var otherTableInfo = _objectSpread2({}, restProps);
14588
14625
  var showSummary = null;
14589
- if (this.state.showColumns.length) {
14626
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
14590
14627
  if (summary && summary().diy) {
14591
14628
  showSummary = this.getTableSummaryInfo();
14592
14629
  } else {
@@ -14624,9 +14661,10 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14624
14661
  y: 400
14625
14662
  }, scroll), {}, {
14626
14663
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
14627
- }),
14664
+ })
14665
+ }, showSummary ? {
14628
14666
  summary: showSummary
14629
- });
14667
+ } : {});
14630
14668
  return /*#__PURE__*/React__default['default'].createElement("div", {
14631
14669
  style: {
14632
14670
  position: 'relative'
@@ -14654,7 +14692,32 @@ var ColumnSettingTable = /*#__PURE__*/function (_React$Component) {
14654
14692
  cell: this.ResizeableTitle
14655
14693
  }
14656
14694
  }
14657
- }, otherTableInfo)));
14695
+ }, otherTableInfo)), Array.isArray(summary) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
14696
+ className: 'table-bssula-summary',
14697
+ style: {
14698
+ right: '20%',
14699
+ bottom: 0,
14700
+ whiteSpace: 'nowrap',
14701
+ overflowX: 'auto'
14702
+ }
14703
+ }, summary.map(function (item) {
14704
+ return /*#__PURE__*/React__default['default'].createElement(Text$1, {
14705
+ type: 'danger'
14706
+ }, item.label, ": ", /*#__PURE__*/React__default['default'].createElement("span", {
14707
+ className: 'table-bssula-summary-count'
14708
+ }, item.count || 0));
14709
+ })), /*#__PURE__*/React__default['default'].createElement("div", {
14710
+ style: {
14711
+ width: '16px',
14712
+ height: '26px',
14713
+ opacity: 0.32,
14714
+ transform: 'scaleX(-1)',
14715
+ backgroundImage: 'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
14716
+ right: '20%',
14717
+ position: 'absolute',
14718
+ bottom: 0
14719
+ }
14720
+ }))));
14658
14721
  }
14659
14722
  }]);
14660
14723
  }(React__default['default'].Component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.12-alpha.2",
3
+ "version": "4.0.12-alpha.3",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -326,7 +326,7 @@ export function commonFun (type?: string, prefixUrl: any, parentProps?:any) {
326
326
  tableSearchForm = [
327
327
  { name: 'qp-skuCode-in', label: 'SKU编码',type:'multipleQueryInput' },
328
328
  { name: 'qp-skuName-like', label: 'SKU名称' },
329
- { name: 'qp-spuCode-like', label: '外部SPU编码' },
329
+ { name: 'qp-itemCode-like', label: '外部SPU编码' },
330
330
  { name: 'qp-eancode-in', label: '商品条码', field: {
331
331
  type: 'multipleQueryInput',
332
332
  props: {
@@ -212,4 +212,4 @@
212
212
  .ant-dropdown-link {
213
213
  cursor: pointer;
214
214
  }
215
- }
215
+ }
@@ -159,7 +159,7 @@ export default class ColumnSettingTable extends React.Component {
159
159
  ...restProps,
160
160
  };
161
161
  let showSummary = null;
162
- if (this.state.showColumns.length) {
162
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
163
163
  if (summary && summary().diy) {
164
164
  showSummary = this.getTableSummaryInfo();
165
165
  } else {
@@ -201,7 +201,9 @@ export default class ColumnSettingTable extends React.Component {
201
201
  ...scroll,
202
202
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
203
203
  },
204
- summary: showSummary,
204
+ ...(
205
+ showSummary ? { summary: showSummary } : {}
206
+ )
205
207
  }
206
208
  return (
207
209
  <div style={{ position: 'relative' }}>
@@ -227,6 +229,35 @@ export default class ColumnSettingTable extends React.Component {
227
229
  ...otherTableInfo
228
230
  }
229
231
  />
232
+ {Array.isArray(summary) && (
233
+ <>
234
+ <div
235
+ className='table-bssula-summary'
236
+ style={{
237
+ right: '20%',
238
+ bottom: 0,
239
+ whiteSpace: 'nowrap',
240
+ overflowX: 'auto',
241
+ }}
242
+ >
243
+ {summary.map(item => (
244
+ <Text type='danger'>
245
+ {item.label}: <span className='table-bssula-summary-count'>{item.count || 0}</span>
246
+ </Text>
247
+ ))}
248
+ </div>
249
+ <div style={{
250
+ width: '16px',
251
+ height: '26px',
252
+ opacity: 0.32,
253
+ transform: 'scaleX(-1)',
254
+ backgroundImage:'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
255
+ right: '20%',
256
+ position: 'absolute',
257
+ bottom: 0,
258
+ }}></div>
259
+ </>
260
+ )}
230
261
  </div >
231
262
  )
232
263
  }
@@ -156,7 +156,7 @@ export default class ColumnSettingSulaTable extends React.Component {
156
156
  ...restProps,
157
157
  };
158
158
  let showSummary = null;
159
- if (this.state.showColumns.length) {
159
+ if (this.state.showColumns.length && !Array.isArray(summary)) {
160
160
  if (summary && summary().diy) {
161
161
  showSummary = this.getTableSummaryInfo();
162
162
  } else {
@@ -197,7 +197,9 @@ export default class ColumnSettingSulaTable extends React.Component {
197
197
  ...scroll,
198
198
  x: restProps.overScrollX || this.getTableScrollXWidth(showCol)
199
199
  },
200
- summary: showSummary,
200
+ ...(
201
+ showSummary ? { summary: showSummary } : {}
202
+ )
201
203
  }
202
204
  return (
203
205
  <div style={{ position: 'relative' }}>
@@ -223,6 +225,35 @@ export default class ColumnSettingSulaTable extends React.Component {
223
225
  ...otherTableInfo
224
226
  }
225
227
  />
228
+ {Array.isArray(summary) && (
229
+ <>
230
+ <div
231
+ className='table-bssula-summary'
232
+ style={{
233
+ right: '20%',
234
+ bottom: 0,
235
+ whiteSpace: 'nowrap',
236
+ overflowX: 'auto',
237
+ }}
238
+ >
239
+ {summary.map(item => (
240
+ <Text type='danger'>
241
+ {item.label}: <span className='table-bssula-summary-count'>{item.count || 0}</span>
242
+ </Text>
243
+ ))}
244
+ </div>
245
+ <div style={{
246
+ width: '16px',
247
+ height: '26px',
248
+ opacity: 0.32,
249
+ transform: 'scaleX(-1)',
250
+ backgroundImage:'linear-gradient(270deg, #ffffff00 0%, #A4A4A4 100%)',
251
+ right: '20%',
252
+ position: 'absolute',
253
+ bottom: 0,
254
+ }}></div>
255
+ </>
256
+ )}
226
257
  </div >
227
258
  )
228
259
  }
@@ -531,20 +531,19 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
531
531
  const handleSelectOver = (selectedValue: any) => {
532
532
  if (selectedValue?.length) {
533
533
  // 解决选择最后1页的sku,返回后,不显示名称问题
534
- const source = _.uniqBy(items.concat(selectedValue), 'value')
535
- ctx?.form?.setFieldSource(resultSourceKey, source)
536
- setSelectDataSource(source,source?.length)
534
+ updateSelectDataSource(selectedValue)
537
535
  formaData(selectedValue, source);
538
536
  } else {
539
537
  const formatResult = selectMode ? [] : null
540
538
  onChange(formatResult, selectedValue)
541
539
  }
542
540
  }
543
- const handleOk = () => {
541
+ const handleOk = (sValue?:any) => {
542
+ const pValue = sValue || popvalue
544
543
  // 按钮保存可传入
545
544
  if(onSaveCallback) {
546
545
  setConfirmLoading(true)
547
- onSaveCallback(popvalue).then(res => {
546
+ onSaveCallback(pValue).then(res => {
548
547
  if(true) {
549
548
  // 成功信息可以在调用处处理 即resolve({messageSuccessBackInfo: { needThrowSuccess: false } })、resolve({messageSuccessBackInfo: { needThrowSuccess: true, successMessage: '已保存' } })
550
549
  let initSuccessMessage = '保存成功'
@@ -567,11 +566,19 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
567
566
  setConfirmLoading(false)
568
567
  })
569
568
  } else {
570
- handleSelectOver(popvalue)
569
+ handleSelectOver(pValue)
571
570
  handleCancel();
572
571
  }
573
572
  };
574
573
 
574
+ // 更新选中数据位置
575
+ const updateSelectDataSource = (selectedValues) => {
576
+ const nSource = _.uniqBy(selectedValues.concat(items), 'value')
577
+ ctx?.form?.setFieldSource(resultSourceKey, nSource)
578
+ setSelectDataSource(nSource,nSource?.length)
579
+ };
580
+
581
+ // 下拉框 / 弹窗 选中数据之后 最终都会执行此函数
575
582
  const formaData = (value: any, source: any) => {
576
583
  if (labelInValue) {
577
584
  const formatResult = value.map((i: any) => ({ key: i[mappingValueField] || i.key, label: i[mappingTextField] || i.label, value: i[mappingValueField] || i.value }))
@@ -686,8 +693,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
686
693
 
687
694
  // 单选 默认直接选中 不需要确定 配置了modalRadioNeedFooter就需要确定
688
695
  if(!selectMode && !modalTableProps?.modalRadioNeedFooter) {
689
- handleSelectOver(selectRows)
690
- handleCancel();
696
+ handleOk(selectRows)
691
697
  }
692
698
 
693
699
  setSelectedRowKeys(sksResult)
@@ -834,9 +840,9 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
834
840
 
835
841
  const renderShowTable = (tableList, type) => {
836
842
  const tableBoxHeighth = getTableHeigth(modalTableProps?.tableSearchForm);
837
- const oSY = `calc(100vh - 391px - 82px)`; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
843
+ const oSY = `calc(100vh - ${tableBoxHeighth}px - 82px)`; // 分页 24+16*2+10 「高 + margin * 2 + paddingBottom 10 」
838
844
  return (
839
- <div style={{ height: `calc(100vh - 391px)` }}>
845
+ <div style={{ height: `calc(100vh - ${tableBoxHeighth}px)` }}>
840
846
  <Table
841
847
  bordered
842
848
  size="middle"
@@ -889,7 +895,12 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
889
895
  }
890
896
 
891
897
  const onClear = () => {
898
+ // 执行父组件 onClear 事件
899
+ props?.onClear?.();
900
+ // 清空下拉框 / 弹窗 选中数据
892
901
  formaData([], items);
902
+ onChangeSelectedKeys([], [])
903
+ // 重置下拉框数据源
893
904
  resetSelectDataSource();
894
905
  }
895
906
 
@@ -33,6 +33,6 @@ export const getRealStr = (oldSelect: any,newSelect: any, record: any) => {
33
33
 
34
34
  export const getTableHeigth = (list: any) => {
35
35
  const totalRows = Math.ceil((list?.length+1) / 4);
36
- if(totalRows == 1) return 502; // modal弹窗760 调整为700 适应小屏
37
- return 488 - totalRows*10
36
+ if(totalRows == 1) return 358; // modal弹窗760 调整为700 适应小屏
37
+ return 411 - totalRows*10
38
38
  }