提交 65aeb0b3 authored 作者: quanlili's avatar quanlili

修改复选框问题

上级 1353103f
......@@ -812,45 +812,6 @@ export default {
// console.log(this.resourceLabel, "&*&*&*")
// }
},
selectItem(selection, row) {
let ids = [];
this.resourceLabel.map(item => {
ids.push(item.labelId)
})
//判断selection中有没有row,若果有true,没有false;
if (selection.length != 0) {
selection.map(item => {
if (item.id === row.id && ids.includes(row.id) === false) {//如果二者相等说明点击的row是一开始没有被选中的需要返显到resourceLabel
//this.resourceLabel.unshift(row)
} else { //剩下最后一个再点的时候selection是个空数组,没有元素,没有对应的item.id,所以下边的代码不跑
//没有666说明二者不相等,不相等就删除resourceLabel中的对应项
// this.resourceLabel.map((item2, index) => {
// if (!item2.labelId) {
// this.$set(item2, 'labelId', item2.id)
// }
// if (row.id === item2.labelId) {
// this.resourceLabel.splice(index, 1)
// }
// })
this.clickedLableIds.push(row.id);
}
})
} else {
this.resourceLabel.map((item2, index) => {
if (!item2.labelId) {
this.$set(item2, 'labelId', item2.id)
}
if (row.id === item2.labelId) {
this.resourceLabel.splice(index, 1)
}
})
}
},
sureLable () {
// this.multipleSelection.map((item, index) => {
// if (!this.resourceLabel.includes(item.name)) {
......@@ -870,7 +831,7 @@ export default {
console.log(this.multipleSelection,this.multipleSelection.length,"hahahhahahaahahahah")
if ( this.multipleSelection.length != 0 ) {
this.resourceLabel = this.multipleSelection;
this.resourceLabel = [...this.multipleSelection];
let optIdArr = [];
this.resourceLabel.map((item, index) => {
var obj = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论