Commit fcf571c7 authored by jiaxu.yan's avatar jiaxu.yan

feat: 关联勾选

parent b5d1bdbf
......@@ -100,18 +100,16 @@ export default {
}
}
})
console.log(this.model.list)
this.model.value = old
},
checkOne(i, e) {
if (this.merge) {
this.$emit('mergeVal', {
name: e,
flag: i.flag ? i.flag.split(',') : []
})
removeItem(array, item) {
let arr = []
array.map(i => {
if (i !== item) {
arr.push(i)
}
})
return arr
},
input(val) {
let arr = []
......
......@@ -136,11 +136,17 @@ export default {
}
}
})
console.log(this.model.list)
this.model.value = old
},
removeItem(array, item) {
let arr = []
array.map(i => {
if (i !== item) {
arr.push(i)
}
})
return arr
},
checkOne(i, e) {
if (this.merge) {
this.$emit('mergeVal', {
......
......@@ -70,6 +70,7 @@ export default {
return
}
let old = this.value || []
if (this.prop == 'chcek2' || this.prop == 'chcek0') {
this.items.options.map(i => {
if (name) {
if (Array.isArray(old) && flag.includes(String(i.id))) {
......@@ -77,22 +78,27 @@ export default {
}
} else {
if (flag.includes(String(i.id))) {
console.log(i.id)
old = this.removeItem(old, i.id) || []
}
}
})
}
this.value = old
},
removeItem(array, item) {
const index = array.indexOf(item)
if (index !== -1) {
array.splice(index, 1)
let arr = []
array.map(i => {
if (i !== item) {
arr.push(i)
}
})
return arr
},
checkOne(i, e) {
if (this.merge) {
this.$emit('mergeVal', {
name: e,
......
......@@ -117,10 +117,13 @@ export default {
},
removeItem(array, item) {
const index = array.indexOf(item)
if (index !== -1) {
array.splice(index, 1)
let arr = []
array.map(i => {
if (i !== item) {
arr.push(i)
}
})
return arr
},
checkOne(i, e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment