This commit is contained in:
shijingjing
2022-07-21 09:33:17 +08:00
parent 3958df4f29
commit 65673d30e1
4 changed files with 46 additions and 20 deletions

View File

@@ -52,21 +52,21 @@ export default {
params: {}
}).then(res => {
if (res?.data) {
this.userList = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
console.log(this.userList, '123456');
let userArr = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
// 数组去重
this.userList = []
userArr.forEach(item=> {
if(!this.userList.find(o=> o.userId === item.userId)) {
this.userList.push(item)
}
})
}
})
},
itemCheck(row) {
this.userList.forEach(e => e.isChecked = false)
row.isChecked = !row.isChecked
if (row.isChecked) {
this.selected[0] = row
}
console.log(this.selected, '胡很顾及到凤凰国际');
// else {
// let index = this.selected.findIndex(e => e.id == row.id)
// this.selected.splice(index, 1)
// }
this.selected[0] = this.userList.filter(e => e.isChecked == true)
this.$forceUpdate()
},
submit() {