@bit-sun/business-component 2.1.6 → 2.1.7

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
@@ -11447,7 +11447,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11447
11447
  }; // 格式化树选择器数据源
11448
11448
 
11449
11449
 
11450
- var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
11450
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue, disabledJudge) {
11451
11451
  var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
11452
11452
  return {
11453
11453
  title: treeDataItem[resKeyValue[1]],
@@ -11455,9 +11455,9 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11455
11455
  parentId: treeDataItem.parent,
11456
11456
  data: _objectSpread2({}, treeDataItem),
11457
11457
  isLeaf: !haveChildren,
11458
- disabled: haveChildren,
11458
+ disabled: disabledJudge !== undefined ? disabledJudge : haveChildren,
11459
11459
  children: haveChildren ? treeDataItem.children.map(function (i) {
11460
- return mapSearchTree(i, resKeyValue);
11460
+ return mapSearchTree(i, resKeyValue, disabledJudge);
11461
11461
  }) : []
11462
11462
  };
11463
11463
  };
@@ -11467,8 +11467,15 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11467
11467
 
11468
11468
  var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
11469
11469
  var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
11470
+ var disabledJudge;
11471
+
11472
+ if (Object.keys(data).length) {
11473
+ data = [data];
11474
+ disabledJudge = false;
11475
+ }
11476
+
11470
11477
  var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
11471
- return mapSearchTree(ites, resKeyValue);
11478
+ return mapSearchTree(ites, resKeyValue, disabledJudge);
11472
11479
  }) || [];
11473
11480
  changeSearchForm[changePosition].field.props.treeData = formatData;
11474
11481
  };
@@ -12839,20 +12846,29 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
12839
12846
  }, // { name: 'qp-employeeNumber-like', label: '员工编码' },
12840
12847
  {
12841
12848
  name: 'qp-code-in',
12842
- type: 'select',
12849
+ type: 'treeSelect',
12843
12850
  label: '所属组织机构',
12844
12851
  field: {
12845
- type: 'select',
12852
+ type: 'treeSelect',
12846
12853
  props: {
12847
- mode: 'multiple',
12848
- notFoundContent: '暂无数据',
12849
- allowClear: true,
12854
+ multiple: true,
12855
+ treeData: [],
12856
+ treeCheckable: false,
12850
12857
  showSearch: true,
12858
+ allowClear: true,
12851
12859
  showArrow: true,
12860
+ treeNodeFilterProp: 'title',
12861
+ treeDefaultExpandAll: true,
12852
12862
  maxTagCount: 1,
12853
- optionFilterProp: 'children',
12854
- filterOption: function filterOption(input, option) {
12855
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
12863
+ placeholder: '请选择',
12864
+ style: {
12865
+ width: '100%'
12866
+ },
12867
+ showCheckedStrategy: 'TreeSelect.SHOW_ALL',
12868
+ dropdownStyle: {
12869
+ maxHeight: 400,
12870
+ maxWidth: 100,
12871
+ overflow: 'auto'
12856
12872
  }
12857
12873
  }
12858
12874
  }
@@ -12863,10 +12879,10 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
12863
12879
  name: 'qp-officeTelephone-like',
12864
12880
  label: '手机号'
12865
12881
  }];
12866
- Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgViewNode/listNoPage"), {
12867
- 'qp-orgViewCode-eq': 'administrative-organization-view'
12882
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgViewNode/common/getTreeForOrgViewAndTenant"), {
12883
+ 'orgViewCode': 'administrative-organization-view'
12868
12884
  })]).then(function (x) {
12869
- formatSource(x, 0, 2, tableSearchForm);
12885
+ formatTreeDataSource(x, 0, 2, tableSearchForm, ['code', 'name']);
12870
12886
  });
12871
12887
  modalTableProps = _objectSpread2({
12872
12888
  modalTableTitle: '添加员工',
package/dist/index.js CHANGED
@@ -11461,7 +11461,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11461
11461
  }; // 格式化树选择器数据源
11462
11462
 
11463
11463
 
11464
- var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
11464
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue, disabledJudge) {
11465
11465
  var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
11466
11466
  return {
11467
11467
  title: treeDataItem[resKeyValue[1]],
@@ -11469,9 +11469,9 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11469
11469
  parentId: treeDataItem.parent,
11470
11470
  data: _objectSpread2({}, treeDataItem),
11471
11471
  isLeaf: !haveChildren,
11472
- disabled: haveChildren,
11472
+ disabled: disabledJudge !== undefined ? disabledJudge : haveChildren,
11473
11473
  children: haveChildren ? treeDataItem.children.map(function (i) {
11474
- return mapSearchTree(i, resKeyValue);
11474
+ return mapSearchTree(i, resKeyValue, disabledJudge);
11475
11475
  }) : []
11476
11476
  };
11477
11477
  };
@@ -11481,8 +11481,15 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
11481
11481
 
11482
11482
  var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
11483
11483
  var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
11484
+ var disabledJudge;
11485
+
11486
+ if (Object.keys(data).length) {
11487
+ data = [data];
11488
+ disabledJudge = false;
11489
+ }
11490
+
11484
11491
  var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
11485
- return mapSearchTree(ites, resKeyValue);
11492
+ return mapSearchTree(ites, resKeyValue, disabledJudge);
11486
11493
  }) || [];
11487
11494
  changeSearchForm[changePosition].field.props.treeData = formatData;
11488
11495
  };
@@ -12853,20 +12860,29 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
12853
12860
  }, // { name: 'qp-employeeNumber-like', label: '员工编码' },
12854
12861
  {
12855
12862
  name: 'qp-code-in',
12856
- type: 'select',
12863
+ type: 'treeSelect',
12857
12864
  label: '所属组织机构',
12858
12865
  field: {
12859
- type: 'select',
12866
+ type: 'treeSelect',
12860
12867
  props: {
12861
- mode: 'multiple',
12862
- notFoundContent: '暂无数据',
12863
- allowClear: true,
12868
+ multiple: true,
12869
+ treeData: [],
12870
+ treeCheckable: false,
12864
12871
  showSearch: true,
12872
+ allowClear: true,
12865
12873
  showArrow: true,
12874
+ treeNodeFilterProp: 'title',
12875
+ treeDefaultExpandAll: true,
12866
12876
  maxTagCount: 1,
12867
- optionFilterProp: 'children',
12868
- filterOption: function filterOption(input, option) {
12869
- return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
12877
+ placeholder: '请选择',
12878
+ style: {
12879
+ width: '100%'
12880
+ },
12881
+ showCheckedStrategy: 'TreeSelect.SHOW_ALL',
12882
+ dropdownStyle: {
12883
+ maxHeight: 400,
12884
+ maxWidth: 100,
12885
+ overflow: 'auto'
12870
12886
  }
12871
12887
  }
12872
12888
  }
@@ -12877,10 +12893,10 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
12877
12893
  name: 'qp-officeTelephone-like',
12878
12894
  label: '手机号'
12879
12895
  }];
12880
- Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgViewNode/listNoPage"), {
12881
- 'qp-orgViewCode-eq': 'administrative-organization-view'
12896
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgViewNode/common/getTreeForOrgViewAndTenant"), {
12897
+ 'orgViewCode': 'administrative-organization-view'
12882
12898
  })]).then(function (x) {
12883
- formatSource(x, 0, 2, tableSearchForm);
12899
+ formatTreeDataSource(x, 0, 2, tableSearchForm, ['code', 'name']);
12884
12900
  });
12885
12901
  modalTableProps = _objectSpread2({
12886
12902
  modalTableTitle: '添加员工',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -35,7 +35,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
35
35
  }
36
36
 
37
37
  // 格式化树选择器数据源
38
- const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
38
+ const mapSearchTree = (treeDataItem: any, resKeyValue: any, disabledJudge?: any) => {
39
39
  const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
40
40
  return {
41
41
  title: treeDataItem[resKeyValue[1]],
@@ -43,16 +43,21 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
43
43
  parentId: treeDataItem.parent,
44
44
  data: { ...treeDataItem },
45
45
  isLeaf: !haveChildren,
46
- disabled: haveChildren,
47
- children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue)) : [],
46
+ disabled: disabledJudge!==undefined? disabledJudge : haveChildren,
47
+ children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue, disabledJudge)) : [],
48
48
  };
49
49
  };
50
50
  const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
51
- const data = reData && reData[position]?.data;
51
+ let data = reData && reData[position]?.data;
52
+ let disabledJudge;
53
+ if(Object.keys(data).length) {
54
+ data = [data];
55
+ disabledJudge=false
56
+ }
52
57
  const formatData = (data &&
53
58
  Array.isArray(data) &&
54
59
  data.length &&
55
- data.map((ites: any) => mapSearchTree(ites, resKeyValue))) ||
60
+ data.map((ites: any) => mapSearchTree(ites, resKeyValue, disabledJudge))) ||
56
61
  []
57
62
  changeSearchForm[changePosition].field.props.treeData = formatData;
58
63
  }
@@ -1296,27 +1301,33 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
1296
1301
  { name: 'qp-username-like', label: '账户名称' },
1297
1302
  { name: 'qp-name-like', label: '显示名称' },
1298
1303
  // { name: 'qp-employeeNumber-like', label: '员工编码' },
1299
- { name: 'qp-code-in', type: 'select', label: '所属组织机构', field: {
1300
- type: 'select',
1304
+ { name: 'qp-code-in', type: 'treeSelect', label: '所属组织机构', field: {
1305
+ type: 'treeSelect',
1301
1306
  props: {
1302
- mode: 'multiple',
1303
- notFoundContent: '暂无数据',
1304
- allowClear: true,
1307
+ multiple: true,
1308
+ treeData: [],
1309
+ treeCheckable: false,
1305
1310
  showSearch: true,
1311
+ allowClear: true,
1306
1312
  showArrow: true,
1313
+ treeNodeFilterProp: 'title',
1314
+ treeDefaultExpandAll: true,
1307
1315
  maxTagCount: 1,
1308
- optionFilterProp: 'children',
1309
- filterOption: (input: string, option: { props: { children: string } }) =>
1310
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1316
+ placeholder: '请选择',
1317
+ style: {
1318
+ width: '100%',
1319
+ },
1320
+ showCheckedStrategy: 'TreeSelect.SHOW_ALL',
1321
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
1311
1322
  },
1312
1323
  } },
1313
1324
  { name: 'qp-email-like', label: '邮箱' },
1314
1325
  { name: 'qp-officeTelephone-like', label: '手机号' },
1315
1326
  ]
1316
1327
  Promise.all([
1317
- loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/listNoPage`, { 'qp-orgViewCode-eq': 'administrative-organization-view' }),
1328
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/common/getTreeForOrgViewAndTenant`, { 'orgViewCode': 'administrative-organization-view' }),
1318
1329
  ]).then((x: any)=>{
1319
- formatSource(x,0, 2, tableSearchForm);
1330
+ formatTreeDataSource(x,0, 2, tableSearchForm,['code', 'name']);
1320
1331
  })
1321
1332
  modalTableProps = {
1322
1333
  modalTableTitle: '添加员工',