去掉console

This commit is contained in:
shijingjing
2022-07-26 11:05:58 +08:00
parent 601640eea1
commit 048aa08ab1
4 changed files with 8 additions and 14 deletions

View File

@@ -4,7 +4,7 @@
<div class="userCards" v-for="e in userList" :key="e.userId">
<div class="imges">
<div class="imgselect" :class="{ 'checked': e.isChecked }" @click.stop="itemCheck(e)" />
<img src="./images/tx@2x.png" alt="" class="avatras"/> {{e.userId}}
<img src="./images/tx@2x.png" alt="" class="avatras"/>
</div>
<div class="rights fill">
<div class="applicationNames">
@@ -53,34 +53,28 @@ export default {
}).then(res => {
if (res?.data) {
let userArr = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.createUserId)}))
// 数组去重
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)
const index= this.userList.findIndex(o => {
const index = this.userList.findIndex(o => {
return row.userId===o.userId
})
this.userList[index].isChecked=true
this.userList[index].isChecked = true
this.selected = this.userList[index]
console.log( this.selected)
// this.$forceUpdate()
},
submit() {
if(!this.selected.userId) {
return this.$u.toast('请选择创建人')
}
uni.$emit("pagePicker:custom",[ this.selected])
uni.$emit("pagePicker:custom", [this.selected])
uni.setStorageSync('userSelect', this.selected)
uni.navigateBack()
},