fix 79317
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
@expand="onExpand"
|
||||
:autoExpandParent="autoExpandParent"
|
||||
:expandedKeys="expandedKeys"
|
||||
:selectedKeys.sync="selectedKeys"
|
||||
:checkedKeys="checkedKeys">
|
||||
|
||||
<template slot="title" slot-scope="{title}">
|
||||
@@ -72,7 +73,8 @@ export default {
|
||||
checkedRows: [],
|
||||
searchValue: '',
|
||||
checkStrictly: true,
|
||||
fullscreen: false
|
||||
fullscreen: false,
|
||||
selectedKeys: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -104,15 +106,22 @@ export default {
|
||||
this.checkedKeys = []
|
||||
if (textVals) {
|
||||
this.$nextTick(() => {
|
||||
const nodes = this.findKeysByNodes(textVals.split(','))
|
||||
// 如果是多选就以逗号分开查找,否则就直接查找
|
||||
const nodes = this.findKeysByNodes(this.multi ? textVals.split(',') : textVals)
|
||||
this.checkedRows = nodes
|
||||
this.checkedKeys = nodes.map(item => item.key)
|
||||
this.selectedKeys = [...this.checkedKeys]
|
||||
})
|
||||
}
|
||||
},
|
||||
findKeysByNodes (titles) {
|
||||
const _this = this
|
||||
const nodes = []
|
||||
function searchTree (node) {
|
||||
// 如果是单选模式已经找到一个,就不继续查找了
|
||||
if (!_this.multi && nodes.length) {
|
||||
return
|
||||
}
|
||||
if (titles.includes(node.title)) {
|
||||
nodes.push(node)
|
||||
}
|
||||
@@ -353,7 +362,9 @@ export default {
|
||||
// 单选不显示选择框
|
||||
.select-work-group-tree.radio-tree {
|
||||
/deep/.ant-tree-checkbox {
|
||||
display: none;
|
||||
//display: none;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user