|
@@ -128,25 +128,14 @@ export default {
|
|
|
this.ids=ids
|
|
this.ids=ids
|
|
|
},
|
|
},
|
|
|
selectionChange(selection){
|
|
selectionChange(selection){
|
|
|
- // console.log(this.oldSelection)
|
|
|
|
|
- // this.ids.push(row.id)
|
|
|
|
|
this.oldSelection.push(...selection)
|
|
this.oldSelection.push(...selection)
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
select(selection, row){
|
|
select(selection, row){
|
|
|
- // alert(1)
|
|
|
|
|
- console.log(selection)
|
|
|
|
|
- console.log(row)
|
|
|
|
|
- console.log(selection.find(item=>item.id==row.id))
|
|
|
|
|
if(!selection.find(item=>item.id==row.id)){
|
|
if(!selection.find(item=>item.id==row.id)){
|
|
|
this.ids= this.ids.filter(item=>item!=row.id)
|
|
this.ids= this.ids.filter(item=>item!=row.id)
|
|
|
- console.log(this.ids)
|
|
|
|
|
}else{
|
|
}else{
|
|
|
this.ids.push(row.id)
|
|
this.ids.push(row.id)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // this.ids=this.oldSelection.map(item=>item.id)
|
|
|
|
|
},
|
|
},
|
|
|
onDone(){
|
|
onDone(){
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -164,8 +153,6 @@ export default {
|
|
|
let ids= [...new Set(this.ids)]
|
|
let ids= [...new Set(this.ids)]
|
|
|
this.selection=ids.map(item=>this.oldSelection.find(val=>val.id==item))
|
|
this.selection=ids.map(item=>this.oldSelection.find(val=>val.id==item))
|
|
|
}
|
|
}
|
|
|
- // console.log(this.selection)
|
|
|
|
|
- // return
|
|
|
|
|
this.$emit('choose', this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current)));
|
|
this.$emit('choose', this.type==1?JSON.parse(JSON.stringify(this.selection)):JSON.parse(JSON.stringify(this.current)));
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
}
|
|
}
|