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

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;
@@ -5837,7 +5839,9 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5837
5839
  event.nativeEvent.stopImmediatePropagation();
5838
5840
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5839
5841
  return {
5840
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5842
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5843
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5844
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5841
5845
  };
5842
5846
  })) || [];
5843
5847
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6016,7 +6020,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6016
6020
  }, /*#__PURE__*/React$1.createElement(SearchOutlined, null))
6017
6021
  } : {}), currentSelectProps), {}, {
6018
6022
  getPopupContainer: function getPopupContainer(triggerNode) {
6019
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6023
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6020
6024
  }
6021
6025
  }), items.map(function (item) {
6022
6026
  return /*#__PURE__*/React$1.createElement(Option$1, {
@@ -34403,7 +34407,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34403
34407
  }
34404
34408
  callback(values, valueNames);
34405
34409
  },
34406
- getPopupContainer: function getPopupContainer() {
34410
+ highestPopContainer: function highestPopContainer() {
34407
34411
  return document.body;
34408
34412
  }
34409
34413
  }), /*#__PURE__*/React$1.createElement("span", null, "~"), /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
@@ -34435,27 +34439,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34435
34439
  }
34436
34440
  callback(values, valueNames);
34437
34441
  },
34438
- getPopupContainer: function getPopupContainer() {
34442
+ highestPopContainer: function highestPopContainer() {
34439
34443
  return document.body;
34440
34444
  }
34441
34445
  }));
34442
34446
  } else {
34443
34447
  var _values13;
34444
- var _currentValue12 = dataInputBusinessType === 12 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34448
+ var _currentValue12 = dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34445
34449
  return {
34446
34450
  key: s,
34447
- label: valueNames[vIndex]
34451
+ label: valueNames[vIndex],
34452
+ value: s
34448
34453
  };
34449
34454
  })) || [] : values[0] && {
34450
34455
  key: values[0],
34451
- label: valueNames[0]
34456
+ label: valueNames[0],
34457
+ value: values[0]
34452
34458
  } || {};
34453
34459
  return /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
34454
34460
  selectBusinessType: "brand",
34455
34461
  selectProps: _objectSpread2({
34456
34462
  style: styleCommon,
34457
34463
  placeholder: '请选择品牌'
34458
- }, dataInputBusinessType === 12 ? {
34464
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34459
34465
  mode: 'multiple',
34460
34466
  maxTagCount: 1
34461
34467
  } : {}),
@@ -34466,7 +34472,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34466
34472
  filterInit: 'qp-brandCode-in'
34467
34473
  },
34468
34474
  onChange: function onChange(value) {
34469
- if (dataInputBusinessType === 12) {
34475
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34470
34476
  values = value.map(function (i) {
34471
34477
  return i.key;
34472
34478
  }) || [];
@@ -34479,7 +34485,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34479
34485
  }
34480
34486
  callback(values, valueNames);
34481
34487
  },
34482
- getPopupContainer: function getPopupContainer() {
34488
+ highestPopContainer: function highestPopContainer() {
34483
34489
  return document.body;
34484
34490
  }
34485
34491
  });
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;
@@ -5860,7 +5862,9 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5860
5862
  event.nativeEvent.stopImmediatePropagation();
5861
5863
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5862
5864
  return {
5863
- value: (s === null || s === void 0 ? void 0 : s.value) || s
5865
+ value: (s === null || s === void 0 ? void 0 : s.value) || s,
5866
+ key: (s === null || s === void 0 ? void 0 : s.key) || s,
5867
+ label: (s === null || s === void 0 ? void 0 : s.label) || ''
5864
5868
  };
5865
5869
  })) || [];
5866
5870
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6039,7 +6043,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6039
6043
  }, /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, null))
6040
6044
  } : {}), currentSelectProps), {}, {
6041
6045
  getPopupContainer: function getPopupContainer(triggerNode) {
6042
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6046
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6043
6047
  }
6044
6048
  }), items.map(function (item) {
6045
6049
  return /*#__PURE__*/React__default['default'].createElement(Option$1, {
@@ -34426,7 +34430,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34426
34430
  }
34427
34431
  callback(values, valueNames);
34428
34432
  },
34429
- getPopupContainer: function getPopupContainer() {
34433
+ highestPopContainer: function highestPopContainer() {
34430
34434
  return document.body;
34431
34435
  }
34432
34436
  }), /*#__PURE__*/React__default['default'].createElement("span", null, "~"), /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
@@ -34458,27 +34462,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34458
34462
  }
34459
34463
  callback(values, valueNames);
34460
34464
  },
34461
- getPopupContainer: function getPopupContainer() {
34465
+ highestPopContainer: function highestPopContainer() {
34462
34466
  return document.body;
34463
34467
  }
34464
34468
  }));
34465
34469
  } else {
34466
34470
  var _values13;
34467
- var _currentValue12 = dataInputBusinessType === 12 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34471
+ var _currentValue12 = dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? ((_values13 = values) === null || _values13 === void 0 ? void 0 : _values13.map(function (s, vIndex) {
34468
34472
  return {
34469
34473
  key: s,
34470
- label: valueNames[vIndex]
34474
+ label: valueNames[vIndex],
34475
+ value: s
34471
34476
  };
34472
34477
  })) || [] : values[0] && {
34473
34478
  key: values[0],
34474
- label: valueNames[0]
34479
+ label: valueNames[0],
34480
+ value: values[0]
34475
34481
  } || {};
34476
34482
  return /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
34477
34483
  selectBusinessType: "brand",
34478
34484
  selectProps: _objectSpread2({
34479
34485
  style: styleCommon,
34480
34486
  placeholder: '请选择品牌'
34481
- }, dataInputBusinessType === 12 ? {
34487
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34482
34488
  mode: 'multiple',
34483
34489
  maxTagCount: 1
34484
34490
  } : {}),
@@ -34489,7 +34495,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34489
34495
  filterInit: 'qp-brandCode-in'
34490
34496
  },
34491
34497
  onChange: function onChange(value) {
34492
- if (dataInputBusinessType === 12) {
34498
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34493
34499
  values = value.map(function (i) {
34494
34500
  return i.key;
34495
34501
  }) || [];
@@ -34502,7 +34508,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34502
34508
  }
34503
34509
  callback(values, valueNames);
34504
34510
  },
34505
- getPopupContainer: function getPopupContainer() {
34511
+ highestPopContainer: function highestPopContainer() {
34506
34512
  return document.body;
34507
34513
  }
34508
34514
  });
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.26",
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,
@@ -1080,7 +1081,11 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
1080
1081
  event.stopPropagation();
1081
1082
  event.nativeEvent.stopImmediatePropagation();
1082
1083
 
1083
- const oldSelect = value?.map(s => ({ value: s?.value||s }))||[];
1084
+ const oldSelect = value?.map(s => ({
1085
+ value: s?.value||s,
1086
+ key: s?.key||s,
1087
+ label: s?.label|| '',
1088
+ }))||[];
1084
1089
  const newSelect = [JSON.parse(JSON.stringify(record))];
1085
1090
  const srs = getRealStr(oldSelect,newSelect,record);
1086
1091
  onSelectClick(srs,dataSource,false)
@@ -1239,7 +1244,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
1239
1244
  suffixIcon: <div className={`search_select_expand_button ${(sDisabled)?'search_select_expand_button_disabled':''}`} onClick={showModal}><SearchOutlined /></div>
1240
1245
  } : {})}
1241
1246
  {...currentSelectProps}
1242
- getPopupContainer={(triggerNode) => triggerNode.parentElement || getPopupContainer && getPopupContainer(triggerNode)}
1247
+ getPopupContainer={(triggerNode) => (highestPopContainer && highestPopContainer()) || triggerNode.parentElement || getPopupContainer && getPopupContainer(triggerNode)}
1243
1248
  >
1244
1249
  {items.map(item => (
1245
1250
  <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
  }