|
@@ -69,7 +69,8 @@ export default {
|
|
applyTypeOption: [],
|
|
applyTypeOption: [],
|
|
selectRightData: new Set(),
|
|
selectRightData: new Set(),
|
|
spinning: true,
|
|
spinning: true,
|
|
- leftTreeNoData: false
|
|
|
|
|
|
+ leftTreeNoData: false,
|
|
|
|
+ middleValue: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -146,6 +147,12 @@ export default {
|
|
onChange(e) {
|
|
onChange(e) {
|
|
const value = e.target.value;
|
|
const value = e.target.value;
|
|
this.treeData = value !== '' ? this.getNewTreeData(this.updateTreeData, value) : [...this.updateTreeData];
|
|
this.treeData = value !== '' ? this.getNewTreeData(this.updateTreeData, value) : [...this.updateTreeData];
|
|
|
|
+ if(value !== '') {
|
|
|
|
+ this.middleValue = this.checkedKeys.filter(item=>typeof item === 'number')
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.middleValue = []
|
|
|
|
+ }
|
|
if (!this.treeData.length) {
|
|
if (!this.treeData.length) {
|
|
this.spinning = false;
|
|
this.spinning = false;
|
|
this.leftTreeNoData = true;
|
|
this.leftTreeNoData = true;
|
|
@@ -233,7 +240,7 @@ export default {
|
|
// this.checkedKeys = checkedKeys;
|
|
// this.checkedKeys = checkedKeys;
|
|
this.nodes(this.treeData, checkedKeys);
|
|
this.nodes(this.treeData, checkedKeys);
|
|
const filterCheckKey = this.checkedKeys.filter(item=>typeof item ==='number');
|
|
const filterCheckKey = this.checkedKeys.filter(item=>typeof item ==='number');
|
|
- let filterCheckKeySet = new Set(filterCheckKey);
|
|
|
|
|
|
+ let filterCheckKeySet = new Set(filterCheckKey.concat(this.middleValue));
|
|
let selectRightDataSet = new Set(this.selectRightData);
|
|
let selectRightDataSet = new Set(this.selectRightData);
|
|
let difference = new Set([...selectRightDataSet].filter((item) => !filterCheckKeySet.has(item.key)));
|
|
let difference = new Set([...selectRightDataSet].filter((item) => !filterCheckKeySet.has(item.key)));
|
|
this.selectRightData.delete(...difference);
|
|
this.selectRightData.delete(...difference);
|