|
@@ -231,13 +231,13 @@ export default {
|
|
},
|
|
},
|
|
onCheck(checkedKeys) {
|
|
onCheck(checkedKeys) {
|
|
console.log(checkedKeys, 'checkedKeys-checkedKeys');
|
|
console.log(checkedKeys, 'checkedKeys-checkedKeys');
|
|
- this.checkedKeys = checkedKeys;
|
|
|
|
|
|
+ // this.checkedKeys = checkedKeys;
|
|
this.nodes(this.treeData, checkedKeys);
|
|
this.nodes(this.treeData, checkedKeys);
|
|
console.log(this.selectRightData, 'this.selectRightData');
|
|
console.log(this.selectRightData, 'this.selectRightData');
|
|
this.applyTypeOption = this.Es6duplicate([...this.selectRightData], 'key');
|
|
this.applyTypeOption = this.Es6duplicate([...this.selectRightData], 'key');
|
|
console.log(this.applyTypeOption, 'this.applyTypeOption');
|
|
console.log(this.applyTypeOption, 'this.applyTypeOption');
|
|
const changeSelectData = this.applyTypeOption.map(item => item.key);
|
|
const changeSelectData = this.applyTypeOption.map(item => item.key);
|
|
- // this.checkedKeys = changeSelectData;
|
|
|
|
|
|
+ this.checkedKeys = changeSelectData;
|
|
if (this.applyTypeOption.length > 100) {
|
|
if (this.applyTypeOption.length > 100) {
|
|
const lastOptionKey = this.applyTypeOption[99].key;
|
|
const lastOptionKey = this.applyTypeOption[99].key;
|
|
const lastIndex = changeSelectData.findIndex(item => item === lastOptionKey);
|
|
const lastIndex = changeSelectData.findIndex(item => item === lastOptionKey);
|
|
@@ -247,6 +247,10 @@ export default {
|
|
this.$emit('applyType', this.applyTypeOption);
|
|
this.$emit('applyType', this.applyTypeOption);
|
|
},
|
|
},
|
|
nodes(data, checkedKeys) {
|
|
nodes(data, checkedKeys) {
|
|
|
|
+ if (!checkedKeys.length) {
|
|
|
|
+ this.selectRightData = new Set();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
if (item.children) {
|
|
if (item.children) {
|
|
this.nodes(item.children, checkedKeys);
|
|
this.nodes(item.children, checkedKeys);
|