fix 79317

This commit is contained in:
danshihao
2023-12-19 11:07:57 +08:00
parent 08b209b6a8
commit ecee848592
8 changed files with 34 additions and 18 deletions
@@ -1,9 +1,9 @@
<template>
<div class="selection-wrapper">
<div class="box-title-text">
<a-input class="box-input" v-model="textVals" :title="textVals"
<a-input class="box-input" :value="value" :title="value" @input="indexClick"
:disabled="disabledInput" :placeholder="placeholder">
<a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
<a-icon v-show="value" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
</a-input>
<a-button v-if="!disabled" type="primary" class="button-box" @click="workGroupClick">
{{this.$t('workGroupSelect.select')}}
@@ -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;
}
}