成员管理总数在线人数调整

This commit is contained in:
fan 2020-07-10 10:00:20 +08:00
parent cb1e54b410
commit ac3da3ef00

View File

@ -2,7 +2,7 @@
<div class="member">
<div class="member__head">
<div class="member__head--title"> 成员列表</div>
<div class="member__head--notes"> {{ members.length }}/{{ room.totalNum }}</div>
<div class="member__head--notes"> {{ onlineNum }}/{{ members.length }}</div>
</div>
<div class="member__container">
<el-input v-model="filterText" :placeholder="this.$t('global.enterNameToFilter')" clearable />
@ -58,7 +58,8 @@ export default {
return {
filterText: '',
clickUserId: '',
menuDisabled: false
menuDisabled: false,
onlineNum: 1
};
},
computed: {
@ -75,6 +76,23 @@ export default {
return this.$store.state.user ? this.$store.state.user.id : '';
}
},
watch: {
members: {
handler(n, o) {
let num = 0;
if (n && n.length) {
n.forEach(item => {
if (item.online) {
num++;
}
});
}
this.onlineNum = num;
},
immediate: true,
deep: true
}
},
methods: {
handleFilterNode(value, data) {
if (!value) return true;