select 分组 互斥
data() {
return {
type: []
};
},
resetType() {
let finalArr = []
if (this.type.length > 0) {
// 找到当前组织
let schemaType = this.type[this.type.length - 1]
this.proList.forEach(item => {
let arr = item.children
if (arr.find(item => item.value === schemaType)) {
finalArr = arr
}
})
// 从头遍历,不在组织,数组直接等于最后一个
for (let i = 0; i < this.type.length; i++) {
if (!finalArr.find(item => item.value === this.type[i])) {
this.type = [schemaType]
break
}
}
}
},