cnhis-design-vue 2.0.10 → 2.0.13
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/CHANGELOG.md +33 -5
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +23 -23
- package/es/button/index.js +2 -2
- package/es/captcha/index.js +3 -3
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +1 -1
- package/es/fabric-chart/index.js +66 -35
- package/es/form-table/index.js +17 -17
- package/es/index/index.js +876 -660
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +91 -76
- package/es/multi-chat/style.css +1 -1
- package/es/multi-chat-client/index.js +57 -43
- package/es/multi-chat-client/style.css +1 -1
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +166 -95
- package/es/multi-chat-setting/style.css +1 -1
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-view/index.js +406 -337
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +3 -3
- package/es/select-label/index.js +3 -3
- package/es/select-person/index.js +76 -39
- package/es/select-person/style.css +1 -1
- package/es/table-filter/index.js +21 -21
- package/es/tag/index.js +1 -1
- package/es/utils/index.js +24 -2
- package/es/verification-code/index.js +2 -2
- package/package.json +1 -1
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +2 -2
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +8 -7
- package/packages/fabric-chart/src/mixins/draw.js +18 -0
- package/packages/multi-chat/chat/chatFooter.vue +11 -2
- package/packages/multi-chat/chat/index.vue +3 -2
- package/packages/multi-chat/chat/scrollList.vue +3 -1
- package/packages/multi-chat/setting/baseInfo/index.vue +55 -1
- package/packages/multi-chat/store/getters.js +3 -0
- package/packages/multi-chat/store/mutation.js +3 -0
- package/packages/multi-chat/store/state.js +1 -0
- package/packages/scale-view/formitem/r-choice.vue +110 -95
- package/packages/scale-view/scaleView.vue +334 -369
- package/packages/select-person/select-person.vue +26 -12
- package/src/utils/index.js +15 -0
|
@@ -126,7 +126,7 @@ import { Icon, Checkbox, Tree, Tooltip, Input, Spin } from 'ant-design-vue';
|
|
|
126
126
|
import searchTree from './search-tree';
|
|
127
127
|
import create from '@/core/create';
|
|
128
128
|
import vexutils from '@/utils/vexutils';
|
|
129
|
-
import { filterTree, deepTraversalFirst } from '@/utils';
|
|
129
|
+
import { filterTree, deepTraversalFirst, getAllParentId } from '@/utils';
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* 查询没有部门的分类时,parent_id_obj 为 undefined a-tree 展示异常。
|
|
@@ -317,13 +317,13 @@ export default create({
|
|
|
317
317
|
// if(!f) return f;
|
|
318
318
|
let { isLeaf, key } = item;
|
|
319
319
|
let parentId = this.getParentId(item);
|
|
320
|
-
let showKeys = [...this.checkedKeys.
|
|
320
|
+
let showKeys = [...this.checkedKeys.main, ...otherItems];
|
|
321
321
|
let checked = showKeys.includes(key);
|
|
322
322
|
// 父级全选,子级不展示
|
|
323
323
|
/** String(parentId) 类型不相等 */
|
|
324
|
-
if (isLeaf && parentId && this.checkedKeys.temp.some(v => v == parentId)) {
|
|
325
|
-
|
|
326
|
-
}
|
|
324
|
+
// if (isLeaf && parentId && this.checkedKeys.temp.some(v => v == parentId)) {
|
|
325
|
+
// checked = false;
|
|
326
|
+
// }
|
|
327
327
|
item.itemType = 'person';
|
|
328
328
|
return checked && item.type == 2;
|
|
329
329
|
});
|
|
@@ -377,8 +377,8 @@ export default create({
|
|
|
377
377
|
return null;
|
|
378
378
|
},
|
|
379
379
|
|
|
380
|
-
currentKey(){
|
|
381
|
-
return
|
|
380
|
+
currentKey() {
|
|
381
|
+
return { person: 'main', dept: 'dept', role: 'role', multiple: 'main' }[this.selectType];
|
|
382
382
|
}
|
|
383
383
|
},
|
|
384
384
|
watch: {
|
|
@@ -601,7 +601,7 @@ export default create({
|
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
|
-
if(this.currentKey === 'main'){
|
|
604
|
+
if (this.currentKey === 'main') {
|
|
605
605
|
this.checkedKeys.temp = this.checkedKeys.main;
|
|
606
606
|
this.treeData.temp = this.treeData.main;
|
|
607
607
|
}
|
|
@@ -1059,10 +1059,10 @@ export default create({
|
|
|
1059
1059
|
.map(i => {
|
|
1060
1060
|
return i.key;
|
|
1061
1061
|
});
|
|
1062
|
-
|
|
1063
|
-
this.checkedKeys.main = this.checkedKeys.main.filter(i => {
|
|
1062
|
+
const checkedKeys = this.checkedKeys.main.filter(i => {
|
|
1064
1063
|
return !needRemoveChildKeys.includes(i);
|
|
1065
1064
|
});
|
|
1065
|
+
this.checkedKeys.main = checkedKeys;
|
|
1066
1066
|
},
|
|
1067
1067
|
|
|
1068
1068
|
removedCheckedkeysMain(tag) {
|
|
@@ -1342,7 +1342,19 @@ export default create({
|
|
|
1342
1342
|
// 如果是选中就把之前选中和现在选中的合并做为temp值(兼容搜索的情况),
|
|
1343
1343
|
if (checked) {
|
|
1344
1344
|
const preChecked = this.checkedKeys[propStr];
|
|
1345
|
-
|
|
1345
|
+
// 搜索时选中上级也要把它所有下级给选中 如果是选中一个下级但是也把其上级选中了要把上级选中给去掉
|
|
1346
|
+
const childKeys = [];
|
|
1347
|
+
let keyData = {};
|
|
1348
|
+
vexutils.searchTree(this.treeData[propStr], item => {
|
|
1349
|
+
if (item.key === node.eventKey) {
|
|
1350
|
+
keyData = item;
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
vexutils.searchTree(keyData.children, item => {
|
|
1354
|
+
childKeys.push(item.key);
|
|
1355
|
+
});
|
|
1356
|
+
const allParentIds = getAllParentId(this.treeData[propStr], node.eventKey).filter(Boolean);
|
|
1357
|
+
totalCheckedKeys = [...new Set(preChecked.concat(checkedKeys, childKeys))].filter(id => !allParentIds.includes(id));
|
|
1346
1358
|
} else {
|
|
1347
1359
|
// 如果是取消从之前的选择中把当前点击的及其子级去除选中作为temp值(兼容搜索的情况)
|
|
1348
1360
|
let keyData = {};
|
|
@@ -1356,7 +1368,9 @@ export default create({
|
|
|
1356
1368
|
vexutils.searchTree(keyData.children, item => {
|
|
1357
1369
|
needCancelKeys.push(item.key);
|
|
1358
1370
|
});
|
|
1359
|
-
|
|
1371
|
+
const allParentIds = getAllParentId(this.treeData[propStr], node.eventKey).filter(Boolean);
|
|
1372
|
+
console.log('cancel: ', this.treeData[propStr], allParentIds);
|
|
1373
|
+
totalCheckedKeys = [...new Set(preChecked.filter(key => !needCancelKeys.includes(key)))].filter(id => !allParentIds.includes(id));
|
|
1360
1374
|
}
|
|
1361
1375
|
this.checkedKeys.temp = totalCheckedKeys;
|
|
1362
1376
|
this.checkedKeys[propStr] = totalCheckedKeys;
|
package/src/utils/index.js
CHANGED
|
@@ -64,3 +64,18 @@ export const deepTraversalFirst = (node, nodeList = []) => {
|
|
|
64
64
|
}
|
|
65
65
|
return nodeList;
|
|
66
66
|
};
|
|
67
|
+
|
|
68
|
+
// 查找节点的父元素
|
|
69
|
+
export function getAllParentId(list, id, key = 'children') {
|
|
70
|
+
for (let i in list) {
|
|
71
|
+
if (list[i].id == id) {
|
|
72
|
+
return [list[i].parentId];
|
|
73
|
+
}
|
|
74
|
+
if (list[i][key]) {
|
|
75
|
+
let node = getAllParentId(list[i][key], id);
|
|
76
|
+
if (node !== undefined) {
|
|
77
|
+
return node.concat(list[i].parentId);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|