change2(data,checked,msg3){
const indexs = this.selectOrg.orgsid.indexOf(data.id)
if (indexs < 0 && this.selectOrg.orgsid.length === 1 && checked) {
console.log(‘only one‘)
this.$message({
message: ‘只能选择一个部门!‘,
type: ‘error‘,
showClose: true
})
this.$refs.treedep.setChecked(data, false)
} else if (this.selectOrg.orgsid.length === 0 && checked) {
this.selectOrg.orgsid = []
this.selectOrg.orgsid.push(data.id)
} else if (
indexs >= 0 &&
this.selectOrg.orgsid.length === 1 &&
!checked
) {
this.selectOrg.orgsid = []
}
},