@bit-sun/business-component 3.1.10-alpha.12 → 3.1.10-alpha.14

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
@@ -4468,7 +4468,7 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
4468
4468
  if (type === 1) {
4469
4469
  var _ctx$form;
4470
4470
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
4471
- if (onlyOneDateSelected === true && source.length === 1) {
4471
+ if (onlyOneDateSelected === true && source.length === 1 && isNil(value)) {
4472
4472
  var _ctx$form2;
4473
4473
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(resultSourceKey, source[0]['value']);
4474
4474
  }
@@ -31688,7 +31688,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
31688
31688
  requestConfig: {
31689
31689
  initialParams: {
31690
31690
  'orgViewCode': 'administrative-organization-view',
31691
- 'qp-idPath-like': getCurrentTargetBgId() || ''
31691
+ 'orgId': getCurrentTargetBgId() || ''
31692
31692
  }
31693
31693
  },
31694
31694
  getPopupContainer: function getPopupContainer() {
@@ -31719,7 +31719,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
31719
31719
  requestConfig: {
31720
31720
  initialParams: {
31721
31721
  'orgViewCode': 'administrative-organization-view',
31722
- 'qp-idPath-like': getCurrentTargetBgId() || ''
31722
+ 'orgId': getCurrentTargetBgId() || ''
31723
31723
  }
31724
31724
  },
31725
31725
  getPopupContainer: function getPopupContainer() {
@@ -34318,7 +34318,7 @@ function RenderCompItem(props) {
34318
34318
  requestConfig: {
34319
34319
  initialParams: {
34320
34320
  'orgViewCode': 'administrative-organization-view',
34321
- 'qp-idPath-like': getCurrentTargetBgId() || ''
34321
+ 'orgId': getCurrentTargetBgId() || ''
34322
34322
  }
34323
34323
  },
34324
34324
  getPopupContainer: function getPopupContainer() {
@@ -35366,19 +35366,23 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
35366
35366
  }
35367
35367
  }
35368
35368
  if ((configItem === null || configItem === void 0 ? void 0 : configItem.inputType) === 30) {
35369
- var _pCode$split;
35370
- var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
35371
- return isObj(s) ? s : {
35372
- key: s,
35373
- value: s
35374
- };
35375
- }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
35376
- return {
35377
- key: s,
35378
- value: s
35379
- };
35380
- });
35381
- return _newPCode || pCode || defaultValue;
35369
+ if (isNil(pCode) || pCode === '') {
35370
+ return [];
35371
+ } else {
35372
+ var _pCode$split;
35373
+ var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
35374
+ return isObj(s) ? s : {
35375
+ key: s,
35376
+ value: s
35377
+ };
35378
+ }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
35379
+ return {
35380
+ key: s,
35381
+ value: s
35382
+ };
35383
+ });
35384
+ return _newPCode || pCode || defaultValue;
35385
+ }
35382
35386
  }
35383
35387
  return pCode || defaultValue;
35384
35388
  };
package/dist/index.js CHANGED
@@ -4491,7 +4491,7 @@ var SearchSelect = /*#__PURE__*/React$1.forwardRef(function (props, ref) {
4491
4491
  if (type === 1) {
4492
4492
  var _ctx$form;
4493
4493
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
4494
- if (onlyOneDateSelected === true && source.length === 1) {
4494
+ if (onlyOneDateSelected === true && source.length === 1 && _.isNil(value)) {
4495
4495
  var _ctx$form2;
4496
4496
  ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldValue(resultSourceKey, source[0]['value']);
4497
4497
  }
@@ -31711,7 +31711,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
31711
31711
  requestConfig: {
31712
31712
  initialParams: {
31713
31713
  'orgViewCode': 'administrative-organization-view',
31714
- 'qp-idPath-like': getCurrentTargetBgId() || ''
31714
+ 'orgId': getCurrentTargetBgId() || ''
31715
31715
  }
31716
31716
  },
31717
31717
  getPopupContainer: function getPopupContainer() {
@@ -31742,7 +31742,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
31742
31742
  requestConfig: {
31743
31743
  initialParams: {
31744
31744
  'orgViewCode': 'administrative-organization-view',
31745
- 'qp-idPath-like': getCurrentTargetBgId() || ''
31745
+ 'orgId': getCurrentTargetBgId() || ''
31746
31746
  }
31747
31747
  },
31748
31748
  getPopupContainer: function getPopupContainer() {
@@ -34341,7 +34341,7 @@ function RenderCompItem(props) {
34341
34341
  requestConfig: {
34342
34342
  initialParams: {
34343
34343
  'orgViewCode': 'administrative-organization-view',
34344
- 'qp-idPath-like': getCurrentTargetBgId() || ''
34344
+ 'orgId': getCurrentTargetBgId() || ''
34345
34345
  }
34346
34346
  },
34347
34347
  getPopupContainer: function getPopupContainer() {
@@ -35389,19 +35389,23 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
35389
35389
  }
35390
35390
  }
35391
35391
  if ((configItem === null || configItem === void 0 ? void 0 : configItem.inputType) === 30) {
35392
- var _pCode$split;
35393
- var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
35394
- return isObj(s) ? s : {
35395
- key: s,
35396
- value: s
35397
- };
35398
- }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
35399
- return {
35400
- key: s,
35401
- value: s
35402
- };
35403
- });
35404
- return _newPCode || pCode || defaultValue;
35392
+ if (_.isNil(pCode) || pCode === '') {
35393
+ return [];
35394
+ } else {
35395
+ var _pCode$split;
35396
+ var _newPCode = Array.isArray(pCode) ? pCode === null || pCode === void 0 ? void 0 : pCode.map(function (s) {
35397
+ return isObj(s) ? s : {
35398
+ key: s,
35399
+ value: s
35400
+ };
35401
+ }) : pCode === null || pCode === void 0 ? void 0 : (_pCode$split = pCode.split(',')) === null || _pCode$split === void 0 ? void 0 : _pCode$split.map(function (s) {
35402
+ return {
35403
+ key: s,
35404
+ value: s
35405
+ };
35406
+ });
35407
+ return _newPCode || pCode || defaultValue;
35408
+ }
35405
35409
  }
35406
35410
  return pCode || defaultValue;
35407
35411
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "3.1.10-alpha.12",
3
+ "version": "3.1.10-alpha.14",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -373,7 +373,7 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
373
373
  } else {
374
374
  if (type === 1) {
375
375
  ctx?.form?.setFieldSource(resultSourceKey, source)
376
- if (onlyOneDateSelected === true && source.length === 1) {
376
+ if (onlyOneDateSelected === true && source.length === 1 && isNil(value)) {
377
377
  ctx?.form?.setFieldValue(resultSourceKey, source[0]['value']);
378
378
  }
379
379
  setItems(source)
@@ -423,7 +423,7 @@ export default function RenderCompItem(props:any){
423
423
  requestConfig={{
424
424
  initialParams:{
425
425
  'orgViewCode': 'administrative-organization-view',
426
- 'qp-idPath-like': getCurrentTargetBgId() || '',
426
+ 'orgId': getCurrentTargetBgId() || '',
427
427
  }
428
428
  }}
429
429
  getPopupContainer={() => document.body}
@@ -45,6 +45,7 @@ import { request } from 'bssula';
45
45
  import Formula from './Formula';
46
46
  import RenderSpecificAction from './renderSpecificAction';
47
47
  import RenderCompItem from './RenderCompItem';
48
+ import { isNil } from 'lodash';
48
49
 
49
50
  const { RangePicker } = DatePicker;
50
51
 
@@ -1069,16 +1070,20 @@ class RuleObjectComponent extends Component {
1069
1070
  if (type === 'input') {
1070
1071
  return pCode === undefined ? pCode : pCode || defaultValue;
1071
1072
  }
1072
- if(['date','dateTime','rangeTime'].includes(type)) {
1073
- if(['date','dateTime'].includes(type)) return pCode ? moment(pCode) : pCode;
1074
- if(['rangeTime'].includes(type)) {
1073
+ if (['date', 'dateTime', 'rangeTime'].includes(type)) {
1074
+ if (['date', 'dateTime'].includes(type)) return pCode ? moment(pCode) : pCode;
1075
+ if (['rangeTime'].includes(type)) {
1075
1076
  const newPCode = Array.isArray(pCode) ? pCode : pCode?.split(',');
1076
1077
  return pCode ? newPCode?.map((i) => moment(i)) : pCode;
1077
1078
  }
1078
1079
  }
1079
- if(configItem?.inputType === 30) {
1080
- const newPCode = Array.isArray(pCode) ? pCode?.map(s => isObj(s) ? s : ({ key: s, value: s })) : pCode?.split(',')?.map(s => ({ key: s, value: s }));
1081
- return newPCode || pCode || defaultValue;
1080
+ if (configItem?.inputType === 30) {
1081
+ if (isNil(pCode) || pCode === '') {
1082
+ return [];
1083
+ } else {
1084
+ const newPCode = Array.isArray(pCode) ? pCode?.map(s => isObj(s) ? s : ({ key: s, value: s })) : pCode?.split(',')?.map(s => ({ key: s, value: s }));
1085
+ return newPCode || pCode || defaultValue;
1086
+ }
1082
1087
  }
1083
1088
  return pCode || defaultValue;
1084
1089
  };
@@ -1245,7 +1245,7 @@ export default class RuleField extends Component {
1245
1245
  requestConfig={{
1246
1246
  initialParams:{
1247
1247
  'orgViewCode': 'administrative-organization-view',
1248
- 'qp-idPath-like': getCurrentTargetBgId() || '',
1248
+ 'orgId': getCurrentTargetBgId() || '',
1249
1249
  }
1250
1250
  }}
1251
1251
  getPopupContainer={() => document.body}
@@ -1272,7 +1272,7 @@ export default class RuleField extends Component {
1272
1272
  requestConfig={{
1273
1273
  initialParams:{
1274
1274
  'orgViewCode': 'administrative-organization-view',
1275
- 'qp-idPath-like': getCurrentTargetBgId() || '',
1275
+ 'orgId': getCurrentTargetBgId() || '',
1276
1276
  }
1277
1277
  }}
1278
1278
  getPopupContainer={() => document.body}