@bit-sun/business-component 2.4.10 → 2.4.12-beta01

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.
@@ -34,6 +34,7 @@ export declare const choiceType: Readonly<{
34
34
  340: "规则模板选择器";
35
35
  350: "营销区域选择器";
36
36
  360: "角色选择器";
37
+ 370: "销售渠道选择器";
37
38
  }>;
38
39
  export declare const inputType: any;
39
40
  export declare const valueType: any;
package/dist/index.esm.js CHANGED
@@ -1279,9 +1279,13 @@ var formatter = function formatter(data, parentAuthority, parentName) {
1279
1279
  });
1280
1280
  };
1281
1281
  var memoizeOneFormatter = index$1(formatter, isEqual);
1282
- var go2BackAndClose = function go2BackAndClose() {
1282
+ var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
1283
1283
  localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
1284
- history.goBack();
1284
+ if (backHistoryPath) {
1285
+ history.push(backHistoryPath);
1286
+ } else {
1287
+ history.goBack();
1288
+ }
1285
1289
  };
1286
1290
  /**
1287
1291
  * 处理bssulaTable的公共回显样式
@@ -2719,7 +2723,7 @@ var handleSourceName = function handleSourceName(sName) {
2719
2723
  var Option$1 = Select.Option;
2720
2724
  var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
2721
2725
  var value = props.value,
2722
- onChange = props.onChange,
2726
+ onChangeTemp = props.onChange,
2723
2727
  _props$selectProps = props.selectProps,
2724
2728
  selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
2725
2729
  _props$modalTableProp = props.modalTableProps,
@@ -3138,7 +3142,18 @@ var SearchSelect = /*#__PURE__*/forwardRef(function (props, ref) {
3138
3142
  }); // 调用api方法
3139
3143
  }
3140
3144
  };
3141
-
3145
+ // 下拉框改变事件
3146
+ var onChange = function onChange() {
3147
+ var _props$selectProps2;
3148
+ onChangeTemp.apply(void 0, arguments);
3149
+ if (props === null || props === void 0 ? void 0 : props.selectChangeCallback) {
3150
+ props.selectChangeCallback.apply(props, arguments);
3151
+ }
3152
+ if (props === null || props === void 0 ? void 0 : (_props$selectProps2 = props.selectProps) === null || _props$selectProps2 === void 0 ? void 0 : _props$selectProps2.selectChangeCallback) {
3153
+ var _props$selectProps3;
3154
+ (_props$selectProps3 = props.selectProps).selectChangeCallback.apply(_props$selectProps3, arguments);
3155
+ }
3156
+ };
3142
3157
  useEffect(function () {
3143
3158
  if (init) {
3144
3159
  run('init');
@@ -10173,19 +10188,23 @@ var TreeSearchSelect = function TreeSearchSelect(props) {
10173
10188
  _remoteSource$resKeyV = remoteSource.resKeyValue,
10174
10189
  resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
10175
10190
  _remoteSource$initial = remoteSource.initialParams,
10176
- initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
10191
+ initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial,
10192
+ _remoteSource$treeChi = remoteSource.treeChildrenRoom,
10193
+ treeChildrenRoom = _remoteSource$treeChi === void 0 ? 'children' : _remoteSource$treeChi,
10194
+ _remoteSource$special = remoteSource.specialBracket,
10195
+ specialBracket = _remoteSource$special === void 0 ? false : _remoteSource$special;
10177
10196
  var mapSearchTree = function mapSearchTree(treeDataItem) {
10178
- var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0; // 盘算是否为父节点
10197
+ var haveChildren = Array.isArray(treeDataItem[treeChildrenRoom]) && treeDataItem[treeChildrenRoom].length > 0; // 盘算是否为父节点
10179
10198
  var isRoot = (treeDataItem === null || treeDataItem === void 0 ? void 0 : treeDataItem.id) == '0'; // 判断是否为根节点
10180
10199
  return {
10181
- title: treeDataItem[resKeyValue[1]],
10200
+ title: specialBracket ? "\u3010".concat(treeDataItem[resKeyValue[0]], "\u3011").concat(treeDataItem[resKeyValue[1]]) : treeDataItem[resKeyValue[1]],
10182
10201
  key: treeDataItem[resKeyValue[0]],
10183
10202
  value: treeDataItem[resKeyValue[0]],
10184
10203
  parentId: treeDataItem.parent,
10185
10204
  data: _objectSpread2({}, treeDataItem),
10186
10205
  isLeaf: !haveChildren,
10187
10206
  disabled: isDisabled(haveChildren, isRoot),
10188
- children: haveChildren ? treeDataItem.children.map(function (i) {
10207
+ children: haveChildren ? treeDataItem[treeChildrenRoom].map(function (i) {
10189
10208
  return mapSearchTree(i);
10190
10209
  }) : []
10191
10210
  };
@@ -10273,8 +10292,8 @@ var TreeSearchSelect = function TreeSearchSelect(props) {
10273
10292
  var parallelData = function parallelData(data, result) {
10274
10293
  data.forEach(function (i) {
10275
10294
  result.push(i);
10276
- if (i.children) {
10277
- parallelData(i.children, result);
10295
+ if (i[treeChildrenRoom]) {
10296
+ parallelData(i[treeChildrenRoom], result);
10278
10297
  }
10279
10298
  });
10280
10299
  return result;
@@ -10468,6 +10487,16 @@ var handleDefaultProps = function handleDefaultProps(type, otherRequestConfig) {
10468
10487
  }, otherRequestConfig)
10469
10488
  };
10470
10489
  break;
10490
+ case 'market-channel':
10491
+ result = {
10492
+ isChoose: true,
10493
+ remoteSource: _objectSpread2({
10494
+ url: "/channel-manage/channelInfo/tree",
10495
+ headers: otherRequestConfig === null || otherRequestConfig === void 0 ? void 0 : otherRequestConfig.extralHeaders,
10496
+ resKeyValue: ['code', 'name']
10497
+ }, otherRequestConfig)
10498
+ };
10499
+ break;
10471
10500
  default:
10472
10501
  result = {
10473
10502
  treeCheckable: true,
@@ -11964,7 +11993,8 @@ var DetailWrapper = /*#__PURE__*/React.memo(function (_ref) {
11964
11993
  _ref$donotNeedShowScr = _ref.donotNeedShowScreenIcon,
11965
11994
  donotNeedShowScreenIcon = _ref$donotNeedShowScr === void 0 ? false : _ref$donotNeedShowScr,
11966
11995
  title = _ref.title,
11967
- pathToRegexp = _ref.pathToRegexp;
11996
+ pathToRegexp = _ref.pathToRegexp,
11997
+ backHistoryPath = _ref.backHistoryPath;
11968
11998
  var _useState3 = useState(false),
11969
11999
  _useState4 = _slicedToArray(_useState3, 2),
11970
12000
  isFullScreen = _useState4[0],
@@ -12088,7 +12118,7 @@ var DetailWrapper = /*#__PURE__*/React.memo(function (_ref) {
12088
12118
  }, /*#__PURE__*/React.createElement("div", {
12089
12119
  className: 'back_home_img_content',
12090
12120
  onClick: function onClick() {
12091
- go2BackAndClose();
12121
+ go2BackAndClose(backHistoryPath);
12092
12122
  // history.goBack();
12093
12123
  }
12094
12124
  }, /*#__PURE__*/React.createElement(ArrowLeftOutlined, null)), /*#__PURE__*/React.createElement("div", {
@@ -24630,6 +24660,19 @@ var inputTypes = {
24630
24660
  filter: 'qp-name,code-orGroup-in'
24631
24661
  }
24632
24662
  })
24663
+ },
24664
+ 370: {
24665
+ type: 'bs-marketChannelSelect',
24666
+ props: _objectSpread2({
24667
+ treeCheckable: false,
24668
+ requestConfig: {
24669
+ treeChildrenRoom: 'channelInfoSon',
24670
+ initialParams: {
24671
+ 'qp-isMain-eq': 1,
24672
+ 'qp-type-eq': 1
24673
+ }
24674
+ }
24675
+ }, normalSingleSelectProps)
24633
24676
  }
24634
24677
  },
24635
24678
  30: {
@@ -24795,6 +24838,20 @@ var inputTypes = {
24795
24838
  filter: 'qp-name,code-orGroup-in'
24796
24839
  }
24797
24840
  })
24841
+ },
24842
+ 370: {
24843
+ type: 'bs-marketChannelSelect',
24844
+ props: _objectSpread2({
24845
+ treeCheckable: true,
24846
+ treeCheckStrictly: true,
24847
+ requestConfig: {
24848
+ treeChildrenRoom: 'channelInfoSon',
24849
+ initialParams: {
24850
+ 'qp-isMain-eq': 1,
24851
+ 'qp-type-eq': 1
24852
+ }
24853
+ }
24854
+ }, normalSingleSelectProps)
24798
24855
  }
24799
24856
  }
24800
24857
  };
@@ -24827,7 +24884,8 @@ var choiceType = Object.freeze({
24827
24884
  330: '变量',
24828
24885
  340: '规则模板选择器',
24829
24886
  350: '营销区域选择器',
24830
- 360: '角色选择器'
24887
+ 360: '角色选择器',
24888
+ 370: '销售渠道选择器'
24831
24889
  });
24832
24890
  var inputType = {
24833
24891
  10: '输入',
@@ -29816,9 +29874,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
29816
29874
  };
29817
29875
  }) || undefined;
29818
29876
  _this.propertyCodeToRangeIdMap["".concat(item.code, ".").concat(element.code)] = list;
29819
- } else {
29820
- _this.propertyCodeToRangeIdMap["".concat(item.code, ".").concat(element.code)] = Object.keys(infoVo).length ? infoVo : undefined;
29821
- }
29877
+ } else ;
29822
29878
  var child = {
29823
29879
  title: "".concat(item.name, "-").concat(element.name),
29824
29880
  key: element.id,
@@ -29860,9 +29916,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
29860
29916
  };
29861
29917
  }) || undefined;
29862
29918
  _this.propertyCodeToRangeIdMap["".concat(rootObjCode, ".").concat(parentKey, ".").concat(element.code)] = _list;
29863
- } else {
29864
- _this.propertyCodeToRangeIdMap["".concat(rootObjCode, ".").concat(parentKey, ".").concat(element.code)] = Object.keys(infoVo).length ? infoVo : undefined;
29865
- }
29919
+ } else ;
29866
29920
  var child = {
29867
29921
  title: "".concat(parentTitle, "-").concat(element.name),
29868
29922
  key: "".concat(parentKey, ".").concat(element.id),
package/dist/index.js CHANGED
@@ -1299,9 +1299,13 @@ var formatter = function formatter(data, parentAuthority, parentName) {
1299
1299
  });
1300
1300
  };
1301
1301
  var memoizeOneFormatter = index$1(formatter, isEqual__default['default']);
1302
- var go2BackAndClose = function go2BackAndClose() {
1302
+ var go2BackAndClose = function go2BackAndClose(backHistoryPath) {
1303
1303
  localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
1304
- umi.history.goBack();
1304
+ if (backHistoryPath) {
1305
+ umi.history.push(backHistoryPath);
1306
+ } else {
1307
+ umi.history.goBack();
1308
+ }
1305
1309
  };
1306
1310
  /**
1307
1311
  * 处理bssulaTable的公共回显样式
@@ -2739,7 +2743,7 @@ var handleSourceName = function handleSourceName(sName) {
2739
2743
  var Option$1 = antd.Select.Option;
2740
2744
  var SearchSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
2741
2745
  var value = props.value,
2742
- onChange = props.onChange,
2746
+ onChangeTemp = props.onChange,
2743
2747
  _props$selectProps = props.selectProps,
2744
2748
  selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
2745
2749
  _props$modalTableProp = props.modalTableProps,
@@ -3158,7 +3162,18 @@ var SearchSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
3158
3162
  }); // 调用api方法
3159
3163
  }
3160
3164
  };
3161
-
3165
+ // 下拉框改变事件
3166
+ var onChange = function onChange() {
3167
+ var _props$selectProps2;
3168
+ onChangeTemp.apply(void 0, arguments);
3169
+ if (props === null || props === void 0 ? void 0 : props.selectChangeCallback) {
3170
+ props.selectChangeCallback.apply(props, arguments);
3171
+ }
3172
+ if (props === null || props === void 0 ? void 0 : (_props$selectProps2 = props.selectProps) === null || _props$selectProps2 === void 0 ? void 0 : _props$selectProps2.selectChangeCallback) {
3173
+ var _props$selectProps3;
3174
+ (_props$selectProps3 = props.selectProps).selectChangeCallback.apply(_props$selectProps3, arguments);
3175
+ }
3176
+ };
3162
3177
  React.useEffect(function () {
3163
3178
  if (init) {
3164
3179
  run('init');
@@ -10193,19 +10208,23 @@ var TreeSearchSelect = function TreeSearchSelect(props) {
10193
10208
  _remoteSource$resKeyV = remoteSource.resKeyValue,
10194
10209
  resKeyValue = _remoteSource$resKeyV === void 0 ? ['id', 'name'] : _remoteSource$resKeyV,
10195
10210
  _remoteSource$initial = remoteSource.initialParams,
10196
- initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial;
10211
+ initialParams = _remoteSource$initial === void 0 ? {} : _remoteSource$initial,
10212
+ _remoteSource$treeChi = remoteSource.treeChildrenRoom,
10213
+ treeChildrenRoom = _remoteSource$treeChi === void 0 ? 'children' : _remoteSource$treeChi,
10214
+ _remoteSource$special = remoteSource.specialBracket,
10215
+ specialBracket = _remoteSource$special === void 0 ? false : _remoteSource$special;
10197
10216
  var mapSearchTree = function mapSearchTree(treeDataItem) {
10198
- var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0; // 盘算是否为父节点
10217
+ var haveChildren = Array.isArray(treeDataItem[treeChildrenRoom]) && treeDataItem[treeChildrenRoom].length > 0; // 盘算是否为父节点
10199
10218
  var isRoot = (treeDataItem === null || treeDataItem === void 0 ? void 0 : treeDataItem.id) == '0'; // 判断是否为根节点
10200
10219
  return {
10201
- title: treeDataItem[resKeyValue[1]],
10220
+ title: specialBracket ? "\u3010".concat(treeDataItem[resKeyValue[0]], "\u3011").concat(treeDataItem[resKeyValue[1]]) : treeDataItem[resKeyValue[1]],
10202
10221
  key: treeDataItem[resKeyValue[0]],
10203
10222
  value: treeDataItem[resKeyValue[0]],
10204
10223
  parentId: treeDataItem.parent,
10205
10224
  data: _objectSpread2({}, treeDataItem),
10206
10225
  isLeaf: !haveChildren,
10207
10226
  disabled: isDisabled(haveChildren, isRoot),
10208
- children: haveChildren ? treeDataItem.children.map(function (i) {
10227
+ children: haveChildren ? treeDataItem[treeChildrenRoom].map(function (i) {
10209
10228
  return mapSearchTree(i);
10210
10229
  }) : []
10211
10230
  };
@@ -10293,8 +10312,8 @@ var TreeSearchSelect = function TreeSearchSelect(props) {
10293
10312
  var parallelData = function parallelData(data, result) {
10294
10313
  data.forEach(function (i) {
10295
10314
  result.push(i);
10296
- if (i.children) {
10297
- parallelData(i.children, result);
10315
+ if (i[treeChildrenRoom]) {
10316
+ parallelData(i[treeChildrenRoom], result);
10298
10317
  }
10299
10318
  });
10300
10319
  return result;
@@ -10488,6 +10507,16 @@ var handleDefaultProps = function handleDefaultProps(type, otherRequestConfig) {
10488
10507
  }, otherRequestConfig)
10489
10508
  };
10490
10509
  break;
10510
+ case 'market-channel':
10511
+ result = {
10512
+ isChoose: true,
10513
+ remoteSource: _objectSpread2({
10514
+ url: "/channel-manage/channelInfo/tree",
10515
+ headers: otherRequestConfig === null || otherRequestConfig === void 0 ? void 0 : otherRequestConfig.extralHeaders,
10516
+ resKeyValue: ['code', 'name']
10517
+ }, otherRequestConfig)
10518
+ };
10519
+ break;
10491
10520
  default:
10492
10521
  result = {
10493
10522
  treeCheckable: true,
@@ -11984,7 +12013,8 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
11984
12013
  _ref$donotNeedShowScr = _ref.donotNeedShowScreenIcon,
11985
12014
  donotNeedShowScreenIcon = _ref$donotNeedShowScr === void 0 ? false : _ref$donotNeedShowScr,
11986
12015
  title = _ref.title,
11987
- pathToRegexp = _ref.pathToRegexp;
12016
+ pathToRegexp = _ref.pathToRegexp,
12017
+ backHistoryPath = _ref.backHistoryPath;
11988
12018
  var _useState3 = React.useState(false),
11989
12019
  _useState4 = _slicedToArray(_useState3, 2),
11990
12020
  isFullScreen = _useState4[0],
@@ -12108,7 +12138,7 @@ var DetailWrapper = /*#__PURE__*/React__default['default'].memo(function (_ref)
12108
12138
  }, /*#__PURE__*/React__default['default'].createElement("div", {
12109
12139
  className: 'back_home_img_content',
12110
12140
  onClick: function onClick() {
12111
- go2BackAndClose();
12141
+ go2BackAndClose(backHistoryPath);
12112
12142
  // history.goBack();
12113
12143
  }
12114
12144
  }, /*#__PURE__*/React__default['default'].createElement(icons.ArrowLeftOutlined, null)), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -24650,6 +24680,19 @@ var inputTypes = {
24650
24680
  filter: 'qp-name,code-orGroup-in'
24651
24681
  }
24652
24682
  })
24683
+ },
24684
+ 370: {
24685
+ type: 'bs-marketChannelSelect',
24686
+ props: _objectSpread2({
24687
+ treeCheckable: false,
24688
+ requestConfig: {
24689
+ treeChildrenRoom: 'channelInfoSon',
24690
+ initialParams: {
24691
+ 'qp-isMain-eq': 1,
24692
+ 'qp-type-eq': 1
24693
+ }
24694
+ }
24695
+ }, normalSingleSelectProps)
24653
24696
  }
24654
24697
  },
24655
24698
  30: {
@@ -24815,6 +24858,20 @@ var inputTypes = {
24815
24858
  filter: 'qp-name,code-orGroup-in'
24816
24859
  }
24817
24860
  })
24861
+ },
24862
+ 370: {
24863
+ type: 'bs-marketChannelSelect',
24864
+ props: _objectSpread2({
24865
+ treeCheckable: true,
24866
+ treeCheckStrictly: true,
24867
+ requestConfig: {
24868
+ treeChildrenRoom: 'channelInfoSon',
24869
+ initialParams: {
24870
+ 'qp-isMain-eq': 1,
24871
+ 'qp-type-eq': 1
24872
+ }
24873
+ }
24874
+ }, normalSingleSelectProps)
24818
24875
  }
24819
24876
  }
24820
24877
  };
@@ -24847,7 +24904,8 @@ var choiceType = Object.freeze({
24847
24904
  330: '变量',
24848
24905
  340: '规则模板选择器',
24849
24906
  350: '营销区域选择器',
24850
- 360: '角色选择器'
24907
+ 360: '角色选择器',
24908
+ 370: '销售渠道选择器'
24851
24909
  });
24852
24910
  var inputType = {
24853
24911
  10: '输入',
@@ -29836,9 +29894,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
29836
29894
  };
29837
29895
  }) || undefined;
29838
29896
  _this.propertyCodeToRangeIdMap["".concat(item.code, ".").concat(element.code)] = list;
29839
- } else {
29840
- _this.propertyCodeToRangeIdMap["".concat(item.code, ".").concat(element.code)] = Object.keys(infoVo).length ? infoVo : undefined;
29841
- }
29897
+ } else ;
29842
29898
  var child = {
29843
29899
  title: "".concat(item.name, "-").concat(element.name),
29844
29900
  key: element.id,
@@ -29880,9 +29936,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
29880
29936
  };
29881
29937
  }) || undefined;
29882
29938
  _this.propertyCodeToRangeIdMap["".concat(rootObjCode, ".").concat(parentKey, ".").concat(element.code)] = _list;
29883
- } else {
29884
- _this.propertyCodeToRangeIdMap["".concat(rootObjCode, ".").concat(parentKey, ".").concat(element.code)] = Object.keys(infoVo).length ? infoVo : undefined;
29885
- }
29939
+ } else ;
29886
29940
  var child = {
29887
29941
  title: "".concat(parentTitle, "-").concat(element.name),
29888
29942
  key: "".concat(parentKey, ".").concat(element.id),
@@ -1,7 +1,7 @@
1
1
  export declare function downloadExcel(data: any, fileName?: any, isResUrl?: boolean): void;
2
2
  export declare const formatter: (data: any, parentAuthority: any, parentName: any) => any;
3
3
  export declare const memoizeOneFormatter: any;
4
- export declare const go2BackAndClose: () => void;
4
+ export declare const go2BackAndClose: (backHistoryPath: any) => void;
5
5
  /**
6
6
  * 处理bssulaTable的公共回显样式
7
7
  * @param col 每一具体行
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.4.10",
3
+ "version": "2.4.12-beta01",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -63,6 +63,7 @@ const DetailWrapper = React.memo(
63
63
  donotNeedShowScreenIcon=false,
64
64
  title,
65
65
  pathToRegexp,
66
+ backHistoryPath,
66
67
  }: any) => {
67
68
  const [isFullScreen, setIsFnllScreen]: any = useState(false);
68
69
  const [breadcrumbArr, setBreadCrumbArr]: any = useState([]);
@@ -218,7 +219,7 @@ const DetailWrapper = React.memo(
218
219
  <div
219
220
  className={'back_home_img_content'}
220
221
  onClick={() => {
221
- go2BackAndClose();
222
+ go2BackAndClose(backHistoryPath);
222
223
  // history.goBack();
223
224
  }}
224
225
  >
@@ -311,4 +312,4 @@ const DetailWrapper = React.memo(
311
312
  }
312
313
  return true;
313
314
  },
314
- );
315
+ );
@@ -178,6 +178,17 @@ export const inputTypes:any = {
178
178
  },
179
179
  },
180
180
  },
181
+ 370: {
182
+ type: 'bs-marketChannelSelect',
183
+ props: {
184
+ treeCheckable: false,
185
+ requestConfig: {
186
+ treeChildrenRoom: 'channelInfoSon',
187
+ initialParams: { 'qp-isMain-eq': 1, 'qp-type-eq': 1 },
188
+ },
189
+ ...normalSingleSelectProps,
190
+ },
191
+ },
181
192
  },
182
193
  30: {
183
194
  10: {
@@ -361,6 +372,18 @@ export const inputTypes:any = {
361
372
  },
362
373
  },
363
374
  },
375
+ 370: {
376
+ type: 'bs-marketChannelSelect',
377
+ props: {
378
+ treeCheckable: true,
379
+ treeCheckStrictly: true,
380
+ requestConfig: {
381
+ treeChildrenRoom: 'channelInfoSon',
382
+ initialParams: { 'qp-isMain-eq': 1, 'qp-type-eq': 1 }
383
+ },
384
+ ...normalSingleSelectProps,
385
+ },
386
+ },
364
387
  },
365
388
  };
366
389
 
@@ -403,6 +426,7 @@ export const choiceType = Object.freeze({
403
426
  340: '规则模板选择器',
404
427
  350: '营销区域选择器',
405
428
  360: '角色选择器',
429
+ 370: '销售渠道选择器',
406
430
  });
407
431
  export const inputType:any ={
408
432
  10: '输入',
@@ -73,6 +73,17 @@ const handleDefaultProps = (type: string, otherRequestConfig: {extralHeaders?: s
73
73
  },
74
74
  };
75
75
  break;
76
+ case 'market-channel':
77
+ result = {
78
+ isChoose: true,
79
+ remoteSource: {
80
+ url: `/channel-manage/channelInfo/tree`,
81
+ headers: otherRequestConfig?.extralHeaders,
82
+ resKeyValue: ['code', 'name'],
83
+ ...otherRequestConfig,
84
+ },
85
+ };
86
+ break;
76
87
  default:
77
88
  result = {
78
89
  treeCheckable: true,
@@ -16,7 +16,7 @@ const { Option } = Select;
16
16
  const SearchSelect = forwardRef((props: any, ref: any) => {
17
17
  const {
18
18
  value, // 必传
19
- onChange,
19
+ onChange: onChangeTemp,
20
20
  selectProps = {},
21
21
  modalTableProps = {},
22
22
  labelInValue = false,
@@ -390,6 +390,17 @@ const SearchSelect = forwardRef((props: any, ref: any) => {
390
390
  }
391
391
  }
392
392
 
393
+ // 下拉框改变事件
394
+ const onChange = (...arg) => {
395
+ onChangeTemp(...arg)
396
+ if(props?.selectChangeCallback){
397
+ props.selectChangeCallback(...arg)
398
+ }
399
+ if(props?.selectProps?.selectChangeCallback) {
400
+ props.selectProps.selectChangeCallback(...arg)
401
+ }
402
+ }
403
+
393
404
  useEffect(() => {
394
405
  if (init) {
395
406
  run('init')
@@ -40,26 +40,30 @@ const TreeSearchSelect = (props: any) => {
40
40
  paramsKey = 'qp-name-like',
41
41
  resKeyValue = ['id', 'name'],
42
42
  initialParams = {},
43
+ treeChildrenRoom = 'children',// 树状结构的子集容器 默认为 'children'
44
+ specialBracket = false
43
45
  } = remoteSource;
44
46
 
45
47
  const mapSearchTree = (treeDataItem: any) => {
46
- const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0; // 盘算是否为父节点
48
+ const haveChildren = Array.isArray(treeDataItem[treeChildrenRoom]) && treeDataItem[treeChildrenRoom].length > 0; // 盘算是否为父节点
47
49
  const isRoot = treeDataItem?.id == '0'; // 判断是否为根节点
48
50
  return {
49
- title: treeDataItem[resKeyValue[1]],
51
+ title: specialBracket
52
+ ? `【${treeDataItem[resKeyValue[0]]}】${treeDataItem[resKeyValue[1]]}`
53
+ : treeDataItem[resKeyValue[1]],
50
54
  key: treeDataItem[resKeyValue[0]],
51
55
  value: treeDataItem[resKeyValue[0]],
52
56
  parentId: treeDataItem.parent,
53
57
  data: { ...treeDataItem },
54
58
  isLeaf: !haveChildren,
55
- disabled: isDisabled(haveChildren,isRoot),
56
- children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i)) : [],
59
+ disabled: isDisabled(haveChildren, isRoot),
60
+ children: haveChildren ? treeDataItem[treeChildrenRoom].map((i: any) => mapSearchTree(i)) : [],
57
61
  };
58
62
  };
59
63
 
60
- const isDisabled = (isParent: boolean,isRoot: boolean) => {
64
+ const isDisabled = (isParent: boolean, isRoot: boolean) => {
61
65
  if (isChoose) {
62
- if(rootDisabled && isRoot){
66
+ if (rootDisabled && isRoot) {
63
67
  return rootDisabled
64
68
  }
65
69
  return false;
@@ -73,11 +77,11 @@ const TreeSearchSelect = (props: any) => {
73
77
  [`${paramsKey}`]: q,
74
78
  ...initialParams,
75
79
  }
76
- axios.get(`${url}?${stringify(paramsData)}`, {headers}).then(async (res: any) => {
80
+ axios.get(`${url}?${stringify(paramsData)}`, { headers }).then(async (res: any) => {
77
81
  const resData = res?.data || [];
78
82
  let coverData;
79
83
 
80
- if(judgeIsRequestSuccess(resData)) {
84
+ if (judgeIsRequestSuccess(resData)) {
81
85
  const { data } = resData;
82
86
  if (remoteSource.converter) {
83
87
  coverData = await remoteSource.converter({ data: [data] })
@@ -96,47 +100,47 @@ const TreeSearchSelect = (props: any) => {
96
100
 
97
101
  const formatData = (value: any) => {
98
102
  if (labelInValue) {
99
- const formatResult = multiple||treeCheckable ? value.map((i: any) => ({...i, key: i.value})) : { ...value, key: value?.value };
103
+ const formatResult = multiple || treeCheckable ? value.map((i: any) => ({ ...i, key: i.value })) : { ...value, key: value?.value };
100
104
  return formatResult
101
105
  } else {
102
- const formatResult = multiple||treeCheckable ? value.map((i: any) => (i?.value || i)) : (_.get(value?.[0], 'value') || value)
106
+ const formatResult = multiple || treeCheckable ? value.map((i: any) => (i?.value || i)) : (_.get(value?.[0], 'value') || value)
103
107
  return formatResult
104
108
  }
105
109
  }
106
- const parallelData = (data: any,result: any) => {
110
+ const parallelData = (data: any, result: any) => {
107
111
  data.forEach((i: any) => {
108
112
  result.push(i);
109
- if (i.children) {
110
- parallelData(i.children, result);
113
+ if (i[treeChildrenRoom]) {
114
+ parallelData(i[treeChildrenRoom], result);
111
115
  }
112
116
  });
113
117
  return result;
114
118
  }
115
- const getSelectItem = (tData: any,selectValue: any) => {
116
- const handleList = tData||[];
119
+ const getSelectItem = (tData: any, selectValue: any) => {
120
+ const handleList = tData || [];
117
121
  let result = [];
118
- if(labelInValue) {
119
- result = multiple||treeCheckable ? (selectValue?.map((i: any) => {
120
- if(handleList.some((s: any) => s.key == i.value)){
122
+ if (labelInValue) {
123
+ result = multiple || treeCheckable ? (selectValue?.map((i: any) => {
124
+ if (handleList.some((s: any) => s.key == i.value)) {
121
125
  return handleList.find((s: any) => s.key == i.value)
122
126
  }
123
- }) || []) : (handleList?.find((s: any) => s.key == selectValue?.value)||{})
127
+ }) || []) : (handleList?.find((s: any) => s.key == selectValue?.value) || {})
124
128
  } else {
125
129
  const cValue = _.get(selectValue?.[0], 'value', selectValue);
126
- result = multiple||treeCheckable ? (selectValue?.map((i: any) => {
127
- if(handleList.some((s: any) => s.key == i)){
130
+ result = multiple || treeCheckable ? (selectValue?.map((i: any) => {
131
+ if (handleList.some((s: any) => s.key == i)) {
128
132
  return handleList.find((s: any) => s.key == i)
129
133
  }
130
- }) || []) : (handleList?.find((s: any) => s.key == cValue)||{})
134
+ }) || []) : (handleList?.find((s: any) => s.key == cValue) || {})
131
135
  }
132
136
  return result;
133
137
  }
134
138
  const handleChange = (data: any, dataName: any) => {
135
139
  const handleData = formatData(data);
136
140
  // 获取选中树节点当条数据,并返回给调用业务
137
- const parallelTreeData = parallelData(treeData,[])
138
- const currentItem = getSelectItem(parallelTreeData,data)
139
- onChange(handleData,data,currentItem,parallelTreeData);
141
+ const parallelTreeData = parallelData(treeData, [])
142
+ const currentItem = getSelectItem(parallelTreeData, data)
143
+ onChange(handleData, data, currentItem, parallelTreeData);
140
144
  onChangeName && onChangeName(dataName);
141
145
  getTreeData && getTreeData(treeData); // 把树节点暴露出去
142
146
  ctx?.form?.setFieldValue(ctx.name, handleData);
@@ -147,17 +151,17 @@ const TreeSearchSelect = (props: any) => {
147
151
  }, []);
148
152
 
149
153
  const maxTagPlaceholder = (selectedValues: any) => {
150
- const onClose = (e: any,item: any) => {
154
+ const onClose = (e: any, item: any) => {
151
155
  e.preventDefault();
152
- const newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter((i: any) => i.value !== item.value): JSON.parse(JSON.stringify(value)).filter((i: any) => i !== item.value)
153
- const newValueName = labelInValue ? null: JSON.parse(JSON.stringify(valueName)).filter((i: any) => i !== item.label)
156
+ const newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter((i: any) => i.value !== item.value) : JSON.parse(JSON.stringify(value)).filter((i: any) => i !== item.value)
157
+ const newValueName = labelInValue ? null : JSON.parse(JSON.stringify(valueName)).filter((i: any) => i !== item.label)
154
158
  handleChange(newValue, newValueName);
155
159
  }
156
160
  return (
157
161
  <Tooltip title={selectedValues.map((i: any) => (
158
162
  <Tag
159
163
  closable={true}
160
- onClose={(e) => onClose(e,i)}
164
+ onClose={(e) => onClose(e, i)}
161
165
  style={{ marginRight: 3, background: '#f5f5f5', height: '24px', border: '1px solid #f0f0f0' }}
162
166
  >
163
167
  {i.label}
@@ -189,7 +193,7 @@ const TreeSearchSelect = (props: any) => {
189
193
  multiple={multiple} // 支持多选(当设置 treeCheckable 时自动变为 true)
190
194
  maxTagPlaceholder={maxTagPlaceholder}
191
195
  onChange={handleChange}
192
- disabled={disabled || mode==='view' || ctx?.mode === 'view'}
196
+ disabled={disabled || mode === 'view' || ctx?.mode === 'view'}
193
197
  getPopupContainer={(triggerNode) => (getPopupContainer && getPopupContainer(triggerNode)) || document.body}
194
198
  >
195
199
  </TreeSelect>
@@ -138,9 +138,9 @@ class RuleObjectComponent extends Component {
138
138
  `${item.code}.${element.code}`
139
139
  ] = list;
140
140
  } else {
141
- this.propertyCodeToRangeIdMap[
142
- `${item.code}.${element.code}`
143
- ] = Object.keys(infoVo).length ? infoVo : undefined;
141
+ // this.propertyCodeToRangeIdMap[
142
+ // `${item.code}.${element.code}`
143
+ // ] = Object.keys(infoVo).length ? infoVo : undefined;
144
144
  }
145
145
  let child = {
146
146
  title: `${item.name}-${element.name}`,
@@ -200,9 +200,9 @@ class RuleObjectComponent extends Component {
200
200
  `${rootObjCode}.${parentKey}.${element.code}`
201
201
  ] = list;
202
202
  } else {
203
- this.propertyCodeToRangeIdMap[
204
- `${rootObjCode}.${parentKey}.${element.code}`
205
- ] = Object.keys(infoVo).length ? infoVo : undefined;
203
+ // this.propertyCodeToRangeIdMap[
204
+ // `${rootObjCode}.${parentKey}.${element.code}`
205
+ // ] = Object.keys(infoVo).length ? infoVo : undefined;
206
206
  }
207
207
  let child = {
208
208
  title: `${parentTitle}-${element.name}`,
@@ -60,9 +60,13 @@ export const formatter = (data, parentAuthority, parentName) => {
60
60
 
61
61
  export const memoizeOneFormatter = memoizeOne(formatter, isEqual);
62
62
 
63
- export const go2BackAndClose = () => {
63
+ export const go2BackAndClose = (backHistoryPath) => {
64
64
  localStorage.setItem(ENUM.BROWSER_CACHE.CHILD_APP_BACK, 1);
65
- history.goBack();
65
+ if(backHistoryPath){
66
+ history.push(backHistoryPath)
67
+ } else {
68
+ history.goBack();
69
+ }
66
70
  }
67
71
 
68
72
  /**
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import './index.less';
3
- declare const MenuSetting: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
- export default MenuSetting;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './drawContent.less';
3
- declare const DrawContent: ({ onClose, originRoutes, itemPath }: any) => React.JSX.Element;
4
- export default DrawContent;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare const CustomerMenuHeader: ({ collapsed, handleClose, originRoutes, itemPath }: any) => React.JSX.Element;
3
- export default CustomerMenuHeader;