@bit-sun/business-component 4.0.12-alpha.24 → 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
@@ -4472,6 +4472,7 @@ var PropertySelector = function PropertySelector(_ref) {
4472
4472
  });
4473
4473
  }, [choosedClassify]);
4474
4474
  useEffect(function () {
4475
+ var _classifyOptionList$2;
4475
4476
  if (visible) {
4476
4477
  var _classifyOptionList$;
4477
4478
  // 获取选中品类信息
@@ -4488,7 +4489,9 @@ var PropertySelector = function PropertySelector(_ref) {
4488
4489
  })) {
4489
4490
  setShowNotCommon(true);
4490
4491
  }
4491
- settingValue.current = _objectSpread2({}, value);
4492
+ settingValue.current = _objectSpread2(_objectSpread2({}, value), {}, {
4493
+ classifyCode: (value === null || value === void 0 ? void 0 : value.classifyCode) || ((_classifyOptionList$2 = classifyOptionList[0]) === null || _classifyOptionList$2 === void 0 ? void 0 : _classifyOptionList$2.value)
4494
+ });
4492
4495
  setChoosedValues(choosedPropertyList);
4493
4496
  }, [value, visible]);
4494
4497
  // 关闭弹窗回传组件值
@@ -4626,6 +4629,8 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4626
4629
  needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4627
4630
  _props$getPopupContai = props.getPopupContainer,
4628
4631
  _getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai,
4632
+ _props$highestPopCont = props.highestPopContainer,
4633
+ highestPopContainer = _props$highestPopCont === void 0 ? undefined : _props$highestPopCont,
4629
4634
  fieldComponent = props.fieldComponent,
4630
4635
  onSaveCallback = props.onSaveCallback,
4631
4636
  selectBusinessType = props.selectBusinessType;
@@ -5834,7 +5839,9 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
5834
5839
  event.nativeEvent.stopImmediatePropagation();
5835
5840
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5836
5841
  return {
5837
- 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) || ''
5838
5845
  };
5839
5846
  })) || [];
5840
5847
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6013,7 +6020,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
6013
6020
  }, /*#__PURE__*/React$1.createElement(SearchOutlined, null))
6014
6021
  } : {}), currentSelectProps), {}, {
6015
6022
  getPopupContainer: function getPopupContainer(triggerNode) {
6016
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6023
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6017
6024
  }
6018
6025
  }), items.map(function (item) {
6019
6026
  return /*#__PURE__*/React$1.createElement(Option$1, {
@@ -34400,7 +34407,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34400
34407
  }
34401
34408
  callback(values, valueNames);
34402
34409
  },
34403
- getPopupContainer: function getPopupContainer() {
34410
+ highestPopContainer: function highestPopContainer() {
34404
34411
  return document.body;
34405
34412
  }
34406
34413
  }), /*#__PURE__*/React$1.createElement("span", null, "~"), /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
@@ -34432,27 +34439,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34432
34439
  }
34433
34440
  callback(values, valueNames);
34434
34441
  },
34435
- getPopupContainer: function getPopupContainer() {
34442
+ highestPopContainer: function highestPopContainer() {
34436
34443
  return document.body;
34437
34444
  }
34438
34445
  }));
34439
34446
  } else {
34440
34447
  var _values13;
34441
- 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) {
34442
34449
  return {
34443
34450
  key: s,
34444
- label: valueNames[vIndex]
34451
+ label: valueNames[vIndex],
34452
+ value: s
34445
34453
  };
34446
34454
  })) || [] : values[0] && {
34447
34455
  key: values[0],
34448
- label: valueNames[0]
34456
+ label: valueNames[0],
34457
+ value: values[0]
34449
34458
  } || {};
34450
34459
  return /*#__PURE__*/React$1.createElement(BusinessSearchSelect$1, {
34451
34460
  selectBusinessType: "brand",
34452
34461
  selectProps: _objectSpread2({
34453
34462
  style: styleCommon,
34454
34463
  placeholder: '请选择品牌'
34455
- }, dataInputBusinessType === 12 ? {
34464
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34456
34465
  mode: 'multiple',
34457
34466
  maxTagCount: 1
34458
34467
  } : {}),
@@ -34463,7 +34472,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34463
34472
  filterInit: 'qp-brandCode-in'
34464
34473
  },
34465
34474
  onChange: function onChange(value) {
34466
- if (dataInputBusinessType === 12) {
34475
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34467
34476
  values = value.map(function (i) {
34468
34477
  return i.key;
34469
34478
  }) || [];
@@ -34476,7 +34485,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34476
34485
  }
34477
34486
  callback(values, valueNames);
34478
34487
  },
34479
- getPopupContainer: function getPopupContainer() {
34488
+ highestPopContainer: function highestPopContainer() {
34480
34489
  return document.body;
34481
34490
  }
34482
34491
  });
package/dist/index.js CHANGED
@@ -4495,6 +4495,7 @@ var PropertySelector = function PropertySelector(_ref) {
4495
4495
  });
4496
4496
  }, [choosedClassify]);
4497
4497
  React$1.useEffect(function () {
4498
+ var _classifyOptionList$2;
4498
4499
  if (visible) {
4499
4500
  var _classifyOptionList$;
4500
4501
  // 获取选中品类信息
@@ -4511,7 +4512,9 @@ var PropertySelector = function PropertySelector(_ref) {
4511
4512
  })) {
4512
4513
  setShowNotCommon(true);
4513
4514
  }
4514
- settingValue.current = _objectSpread2({}, value);
4515
+ settingValue.current = _objectSpread2(_objectSpread2({}, value), {}, {
4516
+ classifyCode: (value === null || value === void 0 ? void 0 : value.classifyCode) || ((_classifyOptionList$2 = classifyOptionList[0]) === null || _classifyOptionList$2 === void 0 ? void 0 : _classifyOptionList$2.value)
4517
+ });
4515
4518
  setChoosedValues(choosedPropertyList);
4516
4519
  }, [value, visible]);
4517
4520
  // 关闭弹窗回传组件值
@@ -4649,6 +4652,8 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4649
4652
  needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4650
4653
  _props$getPopupContai = props.getPopupContainer,
4651
4654
  _getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai,
4655
+ _props$highestPopCont = props.highestPopContainer,
4656
+ highestPopContainer = _props$highestPopCont === void 0 ? undefined : _props$highestPopCont,
4652
4657
  fieldComponent = props.fieldComponent,
4653
4658
  onSaveCallback = props.onSaveCallback,
4654
4659
  selectBusinessType = props.selectBusinessType;
@@ -5857,7 +5862,9 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
5857
5862
  event.nativeEvent.stopImmediatePropagation();
5858
5863
  var oldSelect = (value === null || value === void 0 ? void 0 : value.map(function (s) {
5859
5864
  return {
5860
- 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) || ''
5861
5868
  };
5862
5869
  })) || [];
5863
5870
  var newSelect = [JSON.parse(JSON.stringify(record))];
@@ -6036,7 +6043,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
6036
6043
  }, /*#__PURE__*/React__default['default'].createElement(icons.SearchOutlined, null))
6037
6044
  } : {}), currentSelectProps), {}, {
6038
6045
  getPopupContainer: function getPopupContainer(triggerNode) {
6039
- return triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6046
+ return highestPopContainer && highestPopContainer() || triggerNode.parentElement || _getPopupContainer && _getPopupContainer(triggerNode);
6040
6047
  }
6041
6048
  }), items.map(function (item) {
6042
6049
  return /*#__PURE__*/React__default['default'].createElement(Option$1, {
@@ -34423,7 +34430,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34423
34430
  }
34424
34431
  callback(values, valueNames);
34425
34432
  },
34426
- getPopupContainer: function getPopupContainer() {
34433
+ highestPopContainer: function highestPopContainer() {
34427
34434
  return document.body;
34428
34435
  }
34429
34436
  }), /*#__PURE__*/React__default['default'].createElement("span", null, "~"), /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
@@ -34455,27 +34462,29 @@ var RuleField = /*#__PURE__*/function (_Component) {
34455
34462
  }
34456
34463
  callback(values, valueNames);
34457
34464
  },
34458
- getPopupContainer: function getPopupContainer() {
34465
+ highestPopContainer: function highestPopContainer() {
34459
34466
  return document.body;
34460
34467
  }
34461
34468
  }));
34462
34469
  } else {
34463
34470
  var _values13;
34464
- 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) {
34465
34472
  return {
34466
34473
  key: s,
34467
- label: valueNames[vIndex]
34474
+ label: valueNames[vIndex],
34475
+ value: s
34468
34476
  };
34469
34477
  })) || [] : values[0] && {
34470
34478
  key: values[0],
34471
- label: valueNames[0]
34479
+ label: valueNames[0],
34480
+ value: values[0]
34472
34481
  } || {};
34473
34482
  return /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, {
34474
34483
  selectBusinessType: "brand",
34475
34484
  selectProps: _objectSpread2({
34476
34485
  style: styleCommon,
34477
34486
  placeholder: '请选择品牌'
34478
- }, dataInputBusinessType === 12 ? {
34487
+ }, dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1 ? {
34479
34488
  mode: 'multiple',
34480
34489
  maxTagCount: 1
34481
34490
  } : {}),
@@ -34486,7 +34495,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34486
34495
  filterInit: 'qp-brandCode-in'
34487
34496
  },
34488
34497
  onChange: function onChange(value) {
34489
- if (dataInputBusinessType === 12) {
34498
+ if (dataInputBusinessType === 12 || SET_TYPE.indexOf(selectOperation) > -1) {
34490
34499
  values = value.map(function (i) {
34491
34500
  return i.key;
34492
34501
  }) || [];
@@ -34499,7 +34508,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
34499
34508
  }
34500
34509
  callback(values, valueNames);
34501
34510
  },
34502
- getPopupContainer: function getPopupContainer() {
34511
+ highestPopContainer: function highestPopContainer() {
34503
34512
  return document.body;
34504
34513
  }
34505
34514
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "4.0.12-alpha.24",
3
+ "version": "4.0.12-alpha.26",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -113,7 +113,10 @@ const PropertySelector = ({
113
113
  if ((value?.propertyList || []).some(item => !item.isCommonUse)) {
114
114
  setShowNotCommon(true);
115
115
  }
116
- settingValue.current = {...value};
116
+ settingValue.current = {
117
+ ...value,
118
+ classifyCode: value?.classifyCode || classifyOptionList[0]?.value,
119
+ };
117
120
  setChoosedValues(choosedPropertyList);
118
121
 
119
122
  }, [value, visible])
@@ -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
  }