cnhis-design-vue 2.0.7 → 2.0.10

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/es/age/index.js +2 -2
  3. package/es/back-top/index.js +2 -2
  4. package/es/big-table/index.js +52 -47
  5. package/es/big-table/style.css +1 -1
  6. package/es/button/index.js +2 -2
  7. package/es/captcha/index.js +3 -3
  8. package/es/checkbox/index.js +1 -1
  9. package/es/color-picker/index.js +1 -1
  10. package/es/drag-layout/index.js +3 -3
  11. package/es/editor/index.js +1 -1
  12. package/es/fabric-chart/index.js +9 -9
  13. package/es/form-table/index.js +17 -17
  14. package/es/index/index.js +322 -281
  15. package/es/index/style.css +1 -1
  16. package/es/input/index.js +1 -1
  17. package/es/map/index.js +1 -1
  18. package/es/multi-chat/index.js +51 -49
  19. package/es/multi-chat/style.css +1 -1
  20. package/es/multi-chat-client/index.js +18 -18
  21. package/es/multi-chat-history/index.js +4 -4
  22. package/es/multi-chat-record/index.js +4 -4
  23. package/es/multi-chat-setting/index.js +20 -20
  24. package/es/multi-chat-sip/index.js +1 -1
  25. package/es/radio/index.js +1 -1
  26. package/es/scale-view/index.js +67 -67
  27. package/es/scale-view/style.css +1 -1
  28. package/es/select/index.js +3 -3
  29. package/es/select-label/index.js +3 -3
  30. package/es/select-person/index.js +75 -41
  31. package/es/select-person/style.css +1 -1
  32. package/es/table-filter/index.js +21 -21
  33. package/es/tag/index.js +1 -1
  34. package/es/verification-code/index.js +2 -2
  35. package/package.json +1 -1
  36. package/packages/big-table/src/BigTable.vue +9 -4
  37. package/packages/multi-chat/chat/index.vue +2 -0
  38. package/packages/scale-view/scaleView.vue +22 -22
  39. package/packages/select-person/select-person.vue +37 -10
@@ -313,13 +313,15 @@ export default create({
313
313
  return this.checkedKeys.other.includes(item.key);
314
314
  });
315
315
  let mainItems = this.dataList.main.filter(item => {
316
+ // let f = this.currentKey === 'main';
317
+ // if(!f) return f;
316
318
  let { isLeaf, key } = item;
317
319
  let parentId = this.getParentId(item);
318
- let showKeys = [...this.checkedKeys.main, ...otherItems];
320
+ let showKeys = [...this.checkedKeys.temp, ...otherItems];
319
321
  let checked = showKeys.includes(key);
320
322
  // 父级全选,子级不展示
321
323
  /** String(parentId) 类型不相等 */
322
- if (isLeaf && parentId && this.checkedKeys.main.some(v => v == parentId)) {
324
+ if (isLeaf && parentId && this.checkedKeys.temp.some(v => v == parentId)) {
323
325
  checked = false;
324
326
  }
325
327
  item.itemType = 'person';
@@ -373,6 +375,10 @@ export default create({
373
375
  return this.onLoadData;
374
376
  }
375
377
  return null;
378
+ },
379
+
380
+ currentKey(){
381
+ return { person: 'main', dept: 'dept', role: 'role', multiple: 'main' }[this.selectType]
376
382
  }
377
383
  },
378
384
  watch: {
@@ -595,6 +601,10 @@ export default create({
595
601
  }
596
602
  }
597
603
  });
604
+ if(this.currentKey === 'main'){
605
+ this.checkedKeys.temp = this.checkedKeys.main;
606
+ this.treeData.temp = this.treeData.main;
607
+ }
598
608
  this.spinning = false;
599
609
  } catch (error) {
600
610
  this.spinning = false;
@@ -1086,7 +1096,6 @@ export default create({
1086
1096
  let checkedKeys = this.checkedKeys.dept;
1087
1097
  let parentId = this.getParentId(tag);
1088
1098
  for (let i = 0; i < checkedKeys.length; i++) {
1089
- console.log(tag, checkedKeys[i], parentId, 'forfor');
1090
1099
  if (tag.key == checkedKeys[i] && tag.key == parentId) {
1091
1100
  this.removeCheckedkeysIncludeChildrenDept(tag.key);
1092
1101
  return false;
@@ -1254,7 +1263,7 @@ export default create({
1254
1263
  if (!this.title) {
1255
1264
  // 如果为空恢复默认数据
1256
1265
  const key = ['main', 'dept', 'role'][this.typeActiveIndex];
1257
- this.treeData.temp = this.treeData[key];
1266
+ this.$set(this.treeData, 'temp', this.treeData[key]);
1258
1267
  return;
1259
1268
  }
1260
1269
  let copyData = JSON.parse(JSON.stringify(this.treeData.temp));
@@ -1271,7 +1280,7 @@ export default create({
1271
1280
  item.children = item.children.filter(child => child.visible);
1272
1281
  }
1273
1282
  });
1274
- this.treeData.temp = copyData;
1283
+ this.$set(this.treeData, 'temp', copyData);
1275
1284
  this.expandedKeys = expandedKeys;
1276
1285
  },
1277
1286
  getStaticSearchParentKey(treeData, expandedKeys, orgId) {
@@ -1313,7 +1322,6 @@ export default create({
1313
1322
  // 断掉了父子关系 要不然当存在一二级科室的时候 搜索二级科室 再选中会把一级也选中 ; 后续与产品沟通 不需要断 只取最后一级科室
1314
1323
  const propStr = ['main', 'dept', 'role'][this.typeActiveIndex];
1315
1324
  let totalCheckedKeys = [];
1316
- const childKeys = [];
1317
1325
  // const keyData = this.dataList[propStr].find(item => item.key === node.eventKey);
1318
1326
  // let keyData = {};
1319
1327
  // vexutils.searchTree(this.treeData[propStr], item => {
@@ -1331,10 +1339,29 @@ export default create({
1331
1339
  // // totalCheckedKeys = checkedKeys;
1332
1340
  // totalCheckedKeys = this.isSingleCheck ? [] : checkedKeys.filter(key => !childKeys.includes(key));
1333
1341
  // }
1334
- this.checkedKeys.temp = checkedKeys;
1335
- this.checkedKeys[propStr] = checkedKeys;
1336
- this.isAllCheck(checkedKeys);
1337
- this.isSearchAllCheck(checkedKeys);
1342
+ // 如果是选中就把之前选中和现在选中的合并做为temp值(兼容搜索的情况),
1343
+ if (checked) {
1344
+ const preChecked = this.checkedKeys[propStr];
1345
+ totalCheckedKeys = [...new Set(preChecked.concat(checkedKeys))];
1346
+ } else {
1347
+ // 如果是取消从之前的选择中把当前点击的及其子级去除选中作为temp值(兼容搜索的情况)
1348
+ let keyData = {};
1349
+ const needCancelKeys = [node.eventKey];
1350
+ const preChecked = this.checkedKeys[propStr];
1351
+ vexutils.searchTree(this.treeData[propStr], item => {
1352
+ if (item.key === node.eventKey) {
1353
+ keyData = item;
1354
+ }
1355
+ });
1356
+ vexutils.searchTree(keyData.children, item => {
1357
+ needCancelKeys.push(item.key);
1358
+ });
1359
+ totalCheckedKeys = [...new Set(preChecked.filter(key => !needCancelKeys.includes(key)))];
1360
+ }
1361
+ this.checkedKeys.temp = totalCheckedKeys;
1362
+ this.checkedKeys[propStr] = totalCheckedKeys;
1363
+ this.isAllCheck(totalCheckedKeys);
1364
+ this.isSearchAllCheck(totalCheckedKeys);
1338
1365
  this.$emit('pubCheckedTreeItem', [...this.checkedTreeItem, ...this.defaultShowList]);
1339
1366
  this.$emit('check', [...this.checkedTreeItem, ...this.defaultShowList]);
1340
1367
  },