@bit-sun/business-component 4.0.12-alpha.25 → 4.0.12-alpha.27

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
@@ -4629,6 +4629,8 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4629
4629
  needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4630
4630
  _props$getPopupContai = props.getPopupContainer,
4631
4631
  _getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai,
4632
+ _props$highestPopCont = props.highestPopContainer,
4633
+ highestPopContainer = _props$highestPopCont === void 0 ? undefined : _props$highestPopCont,
4632
4634
  fieldComponent = props.fieldComponent,
4633
4635
  onSaveCallback = props.onSaveCallback,
4634
4636
  selectBusinessType = props.selectBusinessType;
@@ -5812,9 +5814,12 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5812
5814
  selectedRowKeys: currentSRKs,
5813
5815
  preserveSelectedRowKeys: true,
5814
5816
  onChange: function onChange(sks, srs) {
5817
+ // const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
5815
5818
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5816
5819
  return {
5817
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5820
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5821
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5822
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5818
5823
  };
5819
5824
  })) || [];
5820
5825
  var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
@@ -5837,7 +5842,9 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5837
5842
  event.nativeEvent.stopImmediatePropagation();
5838
5843
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5839
5844
  return {
5840
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5845
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5846
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5847
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5841
5848
  };
5842
5849
  })) || [];
5843
5850
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6016,7 +6023,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6016
6023
  }, /*#__PURE__*/React$1.createElement(SearchOutlined, null))
6017
6024
  } : {}), currentSelectProps), {}, {
6018
6025
  getPopupContainer: function getPopupContainer(triggerNode) {
6019
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6026
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6020
6027
  }
6021
6028
  }), items.map(function (item) {
6022
6029
  return /*#__PURE__*/React$1.createElement(Option$1, {
@@ -34403,7 +34410,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34403
34410
  }
34404
34411
  callback(values, valueNames);
34405
34412
  },
34406
- getPopupContainer: function getPopupContainer() {
34413
+ highestPopContainer: function highestPopContainer() {
34407
34414
  return document.body;
34408
34415
  }
34409
34416
  }), /*#__PURE__*/React$1.createElement("span", null, "~"), /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
@@ -34435,27 +34442,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34435
34442
  }
34436
34443
  callback(values, valueNames);
34437
34444
  },
34438
- getPopupContainer: function getPopupContainer() {
34445
+ highestPopContainer: function highestPopContainer() {
34439
34446
  return document.body;
34440
34447
  }
34441
34448
  }));
34442
34449
  } else {
34443
34450
  var _values13;
34444
- var _currentValue12 = dataInputBusinessType === 12 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34451
+ var _currentValue12 = dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34445
34452
  return {
34446
34453
  key: s,
34447
- label: valueNames[vIndex]
34454
+ label: valueNames[vIndex],
34455
+ value: s
34448
34456
  };
34449
34457
  })) || [] : values[0] && {
34450
34458
  key: values[0],
34451
- label: valueNames[0]
34459
+ label: valueNames[0],
34460
+ value: values[0]
34452
34461
  } || {};
34453
34462
  return /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
34454
34463
  selectBusinessType: "brand",
34455
34464
  selectProps: _objectSpread2({
34456
34465
  style: styleCommon,
34457
34466
  placeholder: '请选择品牌'
34458
- }, dataInputBusinessType === 12 ? {
34467
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34459
34468
  mode: 'multiple',
34460
34469
  maxTagCount: 1
34461
34470
  } : {}),
@@ -34466,7 +34475,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34466
34475
  filterInit: 'qp-brandCode-in'
34467
34476
  },
34468
34477
  onChange: function onChange(value) {
34469
- if (dataInputBusinessType === 12) {
34478
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34470
34479
  values = value.map(function (i) {
34471
34480
  return i.key;
34472
34481
  }) || [];
@@ -34479,7 +34488,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34479
34488
  }
34480
34489
  callback(values, valueNames);
34481
34490
  },
34482
- getPopupContainer: function getPopupContainer() {
34491
+ highestPopContainer: function highestPopContainer() {
34483
34492
  return document.body;
34484
34493
  }
34485
34494
  });
package/dist/index.js CHANGED
@@ -4652,6 +4652,8 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4652
4652
  needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4653
4653
  _props$getPopupContai = props.getPopupContainer,
4654
4654
  _getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai,
4655
+ _props$highestPopCont = props.highestPopContainer,
4656
+ highestPopContainer = _props$highestPopCont === void 0 ? undefined : _props$highestPopCont,
4655
4657
  fieldComponent = props.fieldComponent,
4656
4658
  onSaveCallback = props.onSaveCallback,
4657
4659
  selectBusinessType = props.selectBusinessType;
@@ -5835,9 +5837,12 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5835
5837
  selectedRowKeys: currentSRKs,
5836
5838
  preserveSelectedRowKeys: true,
5837
5839
  onChange: function onChange(sks, srs) {
5840
+ // const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
5838
5841
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5839
5842
  return {
5840
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5843
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5844
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5845
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5841
5846
  };
5842
5847
  })) || [];
5843
5848
  var tmpSelectedRows = oldSelect.concat(srs).filter(function (item) {
@@ -5860,7 +5865,9 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5860
5865
  event.nativeEvent.stopImmediatePropagation();
5861
5866
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5862
5867
  return {
5863
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5868
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5869
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5870
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5864
5871
  };
5865
5872
  })) || [];
5866
5873
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6039,7 +6046,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6039
6046
  }, /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, null))
6040
6047
  } : {}), currentSelectProps), {}, {
6041
6048
  getPopupContainer: function getPopupContainer(triggerNode) {
6042
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6049
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6043
6050
  }
6044
6051
  }), items.map(function (item) {
6045
6052
  return /*#__PURE__*/React__default['default'].createElement(Option$1, {
@@ -34426,7 +34433,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34426
34433
  }
34427
34434
  callback(values, valueNames);
34428
34435
  },
34429
- getPopupContainer: function getPopupContainer() {
34436
+ highestPopContainer: function highestPopContainer() {
34430
34437
  return document.body;
34431
34438
  }
34432
34439
  }), /*#__PURE__*/React__default['default'].createElement("span", null, "~"), /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
@@ -34458,27 +34465,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34458
34465
  }
34459
34466
  callback(values, valueNames);
34460
34467
  },
34461
- getPopupContainer: function getPopupContainer() {
34468
+ highestPopContainer: function highestPopContainer() {
34462
34469
  return document.body;
34463
34470
  }
34464
34471
  }));
34465
34472
  } else {
34466
34473
  var _values13;
34467
- var _currentValue12 = dataInputBusinessType === 12 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34474
+ var _currentValue12 = dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34468
34475
  return {
34469
34476
  key: s,
34470
- label: valueNames[vIndex]
34477
+ label: valueNames[vIndex],
34478
+ value: s
34471
34479
  };
34472
34480
  })) || [] : values[0] && {
34473
34481
  key: values[0],
34474
- label: valueNames[0]
34482
+ label: valueNames[0],
34483
+ value: values[0]
34475
34484
  } || {};
34476
34485
  return /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
34477
34486
  selectBusinessType: "brand",
34478
34487
  selectProps: _objectSpread2({
34479
34488
  style: styleCommon,
34480
34489
  placeholder: '请选择品牌'
34481
- }, dataInputBusinessType === 12 ? {
34490
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34482
34491
  mode: 'multiple',
34483
34492
  maxTagCount: 1
34484
34493
  } : {}),
@@ -34489,7 +34498,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34489
34498
  filterInit: 'qp-brandCode-in'
34490
34499
  },
34491
34500
  onChange: function onChange(value) {
34492
- if (dataInputBusinessType === 12) {
34501
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34493
34502
  values = value.map(function (i) {
34494
34503
  return i.key;
34495
34504
  }) || [];
@@ -34502,7 +34511,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34502
34511
  }
34503
34512
  callback(values, valueNames);
34504
34513
  },
34505
- getPopupContainer: function getPopupContainer() {
34514
+ highestPopContainer: function highestPopContainer() {
34506
34515
  return document.body;
34507
34516
  }
34508
34517
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.12-alpha.25",
3
+ "version": "4.0.12-alpha.27",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -426,7 +426,7 @@ export default () => {
426
426
 
427
427
  useEffect(() => {
428
428
  if(tabKey === 'multiple') {
429
- setValue(['1540295745870573570', '1540173160826613762'])
429
+ setValue([])
430
430
  }
431
431
  },[tabKey])
432
432
 
@@ -448,7 +448,7 @@ export default () => {
448
448
  // },
449
449
  // prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
450
450
  selectProps,
451
- // labelInValue: true,
451
+ labelInValue: true,
452
452
  selectBusinessType: 'physicalWarehouse',
453
453
  };
454
454
 
@@ -520,7 +520,7 @@ export default () => {
520
520
  // needStatusSearch: true
521
521
  // },
522
522
  selectProps,
523
- selectBusinessType: 'realWarehouse',
523
+ selectBusinessType: 'brand',
524
524
  };
525
525
 
526
526
  const onTabChange = (key) => {
@@ -28,6 +28,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
28
28
  sourceName,
29
29
  needModalTable = true,
30
30
  getPopupContainer = undefined,
31
+ highestPopContainer = undefined,
31
32
  fieldComponent,
32
33
  onSaveCallback,
33
34
  selectBusinessType,
@@ -1069,7 +1070,12 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
1069
1070
  selectedRowKeys: currentSRKs,
1070
1071
  preserveSelectedRowKeys: true, // 避免搜索之后 没有了选中前的数据 保证sks的正确性
1071
1072
  onChange: (sks, srs) => {
1072
- const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
1073
+ // const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
1074
+ const oldSelect = value?.map(s => ({
1075
+ value: s?.value||s,
1076
+ key: s?.key||s,
1077
+ label: s?.label|| '',
1078
+ }))||[];
1073
1079
  let tmpSelectedRows = oldSelect.concat(srs).filter(item => item != undefined);
1074
1080
  let realSrs = sks.map(key => tmpSelectedRows.filter(item => item.value == key)[0]).filter(item => item != undefined)
1075
1081
  onSelectClick(realSrs, dataSource,false)
@@ -1080,7 +1086,11 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
1080
1086
  event.stopPropagation();
1081
1087
  event.nativeEvent.stopImmediatePropagation();
1082
1088
 
1083
- const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
1089
+ const oldSelect = value?.map(s => ({
1090
+ value: s?.value||s,
1091
+ key: s?.key||s,
1092
+ label: s?.label|| '',
1093
+ }))||[];
1084
1094
  const newSelect = [JSON.parse(JSON.stringify(record))];
1085
1095
  const srs = getRealStr(oldSelect,newSelect,record);
1086
1096
  onSelectClick(srs,dataSource,false)
@@ -1239,7 +1249,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
1239
1249
  suffixIcon: <div className={`search_select_expand_button ${(sDisabled)?'search_select_expand_button_disabled':''}`} onClick={showModal}><SearchOutlined /></div>
1240
1250
  } : {})}
1241
1251
  {...currentSelectProps}
1242
- getPopupContainer={(triggerNode) => triggerNode.parentElement || getPopupContainer && getPopupContainer(triggerNode)}
1252
+ getPopupContainer={(triggerNode) => (highestPopContainer && highestPopContainer()) || triggerNode.parentElement || getPopupContainer && getPopupContainer(triggerNode)}
1243
1253
  >
1244
1254
  {items.map(item => (
1245
1255
  <Option key={item.value} label={item.text}>
@@ -2176,7 +2176,7 @@ export default class RuleField extends Component {
2176
2176
  }
2177
2177
  callback(values, valueNames);
2178
2178
  }}
2179
- getPopupContainer={() => document.body}
2179
+ highestPopContainer={() => document.body}
2180
2180
  />
2181
2181
  <span>~</span>
2182
2182
  <BusinessSearchSelect
@@ -2207,21 +2207,21 @@ export default class RuleField extends Component {
2207
2207
  }
2208
2208
  callback(values, valueNames);
2209
2209
  }}
2210
- getPopupContainer={() => document.body}
2210
+ highestPopContainer={() => document.body}
2211
2211
  />
2212
2212
  </>
2213
2213
  );
2214
2214
  } else {
2215
- const currentValue = dataInputBusinessType === 12 ?
2216
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
2217
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
2215
+ const currentValue = dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ?
2216
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex], value: s}))||[]
2217
+ : values[0]&&{key:values[0],label:valueNames[0], value: values[0]}||{};
2218
2218
  return (
2219
2219
  <BusinessSearchSelect
2220
2220
  selectBusinessType="brand"
2221
2221
  selectProps={{
2222
2222
  style: styleCommon,
2223
2223
  placeholder: '请选择品牌',
2224
- ...(dataInputBusinessType === 12
2224
+ ...(dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1
2225
2225
  ? {
2226
2226
  mode: 'multiple',
2227
2227
  maxTagCount: 1,
@@ -2235,7 +2235,7 @@ export default class RuleField extends Component {
2235
2235
  filterInit: 'qp-brandCode-in',
2236
2236
  }}
2237
2237
  onChange={(value) => {
2238
- if (dataInputBusinessType === 12) {
2238
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
2239
2239
  values = value.map((i) => i.key)||[];
2240
2240
  valueNames = value.map((i) => i.label || '')||[];
2241
2241
  } else {
@@ -2244,7 +2244,7 @@ export default class RuleField extends Component {
2244
2244
  }
2245
2245
  callback(values, valueNames);
2246
2246
  }}
2247
- getPopupContainer={() => document.body}
2247
+ highestPopContainer={() => document.body}
2248
2248
  />
2249
2249
  );
2250
2250
  }