table,已选中人员回显 重置
This commit is contained in:
@@ -129,24 +129,21 @@ export default {
|
||||
this.startTime = '',
|
||||
this.endTime = ''
|
||||
this.userIdList = []
|
||||
// uni.clearStorageSync('userSelect') //清空会导致状态字典出问题
|
||||
this.createUserId = ''
|
||||
uni.clearStorageSync('userSelect')
|
||||
this.current = 1
|
||||
this.list = []
|
||||
this.getList()
|
||||
this.$dict.load(['mstStatus']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
this.filterShow = false
|
||||
},
|
||||
|
||||
selectConfirm() {
|
||||
if(this.userIdList.length) {
|
||||
this.createUserId = this.userIdList?.[0].userId
|
||||
console.log(this.userIdList,'userIdList');
|
||||
console.log(this.createUserId,'createUserId');
|
||||
}
|
||||
|
||||
// let arr = this.userIdList
|
||||
// console.log(arr[0],222);
|
||||
// console.log(this.userIdList,111);
|
||||
|
||||
|
||||
this.start = this.startTime,
|
||||
this.end = this.endTime
|
||||
let startTmp = this.start.split("-");
|
||||
@@ -172,7 +169,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
document.title = '群发居民群'
|
||||
this.getList()
|
||||
// this.getList()
|
||||
this.$dict.load(['mstStatus']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
|
||||
@@ -65,11 +65,8 @@
|
||||
:data="tableData"
|
||||
:colConfigs="tabIndex==0? colConfigs0 : colConfigs1"
|
||||
v-if="tableData.length">
|
||||
<u-td slot="groupOwnerId" align="center">
|
||||
<template #slot="{ row }">
|
||||
<p>{{row}}</p>
|
||||
<AiOpenData v-if="row.groupOwnerId" type="userName" :openid="row.groupOwnerId"/>
|
||||
</template>
|
||||
<u-td slot="groupOwnerId" slot-scope="{row}">
|
||||
<AiOpenData v-if="row.groupOwnerId" type="userName" :openid="row.groupOwnerId"/>
|
||||
</u-td>
|
||||
</AiTable>
|
||||
<AiEmpty v-if="!tableData.length" description="暂无数据"></AiEmpty>
|
||||
@@ -107,7 +104,7 @@ export default {
|
||||
computed: {
|
||||
colConfigs0() {
|
||||
return [
|
||||
{ slot: "groupOwnerId",label: "成员" },
|
||||
{ slot: "groupOwnerId",label: "成员",prop: "groupOwnerId" },
|
||||
{ label: "预计送达居民群", prop: "groupCount" }
|
||||
];
|
||||
},
|
||||
@@ -115,7 +112,7 @@ export default {
|
||||
return [
|
||||
{ label: "居民群",prop: "groupName" },
|
||||
{ label: "群人数", prop: "memberCount"},
|
||||
{ slot: "groupOwnerId",label: "群主"}
|
||||
{ slot: "groupOwnerId",label: "群主",prop: "groupOwnerId" }
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</div>
|
||||
<!-- 小程序 -->
|
||||
<div class="miniapp" v-show="miniapp.length">
|
||||
<p>小程序地址</p>
|
||||
<p>小程序</p>
|
||||
<div v-for="(item, index) in miniapp" :key="index">{{item.mpTitle}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="header-middle">
|
||||
<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)" />
|
||||
<div class="imgselect" :class="{ 'checked': e.isChecked }" @click.stop="itemCheck(e)" />
|
||||
<img src="./images/tx@2x.png" alt="" class="avatras"/> {{e.userId}}
|
||||
</div>
|
||||
<div class="rights fill">
|
||||
@@ -41,11 +41,10 @@ export default {
|
||||
onLoad() {
|
||||
this.selected = uni.getStorageSync('userSelect') || []
|
||||
this.getDeptsAndUsersByParent()
|
||||
console.log(this.selected);
|
||||
},
|
||||
methods: {
|
||||
isSelected(id) {
|
||||
return !!this.selected.find(e => e.id == id)
|
||||
return this.selected.userId===id
|
||||
},
|
||||
getDeptsAndUsersByParent() {
|
||||
this.userList = []
|
||||
@@ -53,7 +52,7 @@ export default {
|
||||
params: {}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
let userArr = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
|
||||
let userArr = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.createUserId)}))
|
||||
// 数组去重
|
||||
this.userList = []
|
||||
userArr.forEach(item=> {
|
||||
@@ -61,20 +60,27 @@ export default {
|
||||
this.userList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
itemCheck(row) {
|
||||
this.userList.forEach(e => e.isChecked = false)
|
||||
row.isChecked = !row.isChecked
|
||||
this.selected[0] = this.userList.filter(e => e.isChecked == true)
|
||||
this.$forceUpdate()
|
||||
|
||||
const index= this.userList.findIndex(o => {
|
||||
|
||||
return row.userId===o.userId
|
||||
})
|
||||
this.userList[index].isChecked=true
|
||||
this.selected = this.userList[index]
|
||||
console.log( this.selected)
|
||||
// this.$forceUpdate()
|
||||
},
|
||||
submit() {
|
||||
if(!this.selected.length) {
|
||||
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()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user