mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
perf: 优化聊天窗口群聊已读列表
This commit is contained in:
parent
0ad32ff63d
commit
8acf3b21c7
@ -48,14 +48,13 @@
|
|||||||
<!--时间/阅读-->
|
<!--时间/阅读-->
|
||||||
<div v-if="msgData.created_at" class="dialog-foot">
|
<div v-if="msgData.created_at" class="dialog-foot">
|
||||||
<div class="time" :title="msgData.created_at">{{$A.formatTime(msgData.created_at)}}</div>
|
<div class="time" :title="msgData.created_at">{{$A.formatTime(msgData.created_at)}}</div>
|
||||||
|
|
||||||
|
<div v-if="msgData.send > 1 || dialogType === 'group'" class="percent" @click="openReadPercentage">
|
||||||
<EPopover
|
<EPopover
|
||||||
v-if="msgData.send > 1 || dialogType === 'group'"
|
|
||||||
v-model="popperShow"
|
v-model="popperShow"
|
||||||
ref="percent"
|
ref="percent"
|
||||||
class="percent"
|
|
||||||
placement="left-end"
|
placement="left-end"
|
||||||
:width="360"
|
:width="360">
|
||||||
:offset="-8">
|
|
||||||
<div class="dialog-wrapper-read-poptip-content">
|
<div class="dialog-wrapper-read-poptip-content">
|
||||||
<ul class="read overlay-y">
|
<ul class="read overlay-y">
|
||||||
<li class="read-title"><em>{{ readList.length }}</em>{{ $L('已读') }}</li>
|
<li class="read-title"><em>{{ readList.length }}</em>{{ $L('已读') }}</li>
|
||||||
@ -70,8 +69,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<WCircle slot="reference" :percent="msgData.percentage" :size="14"/>
|
<div slot="reference"></div>
|
||||||
</EPopover>
|
</EPopover>
|
||||||
|
<Loading v-if="popperLoad > 0"/>
|
||||||
|
<WCircle v-else :percent="msgData.percentage" :size="14"/>
|
||||||
|
</div>
|
||||||
<Icon v-else-if="msgData.percentage === 100" class="done" type="md-done-all"/>
|
<Icon v-else-if="msgData.percentage === 100" class="done" type="md-done-all"/>
|
||||||
<Icon v-else class="done" type="md-checkmark"/>
|
<Icon v-else class="done" type="md-checkmark"/>
|
||||||
</div>
|
</div>
|
||||||
@ -102,6 +104,7 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
popperLoad: 0,
|
||||||
popperShow: false,
|
popperShow: false,
|
||||||
allList: [],
|
allList: [],
|
||||||
}
|
}
|
||||||
@ -154,22 +157,6 @@ export default {
|
|||||||
this.msgRead();
|
this.msgRead();
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
|
||||||
popperShow(val) {
|
|
||||||
if (val) {
|
|
||||||
this.$store.dispatch("call", {
|
|
||||||
url: 'dialog/msg/readlist',
|
|
||||||
data: {
|
|
||||||
msg_id: this.msgData.id,
|
|
||||||
},
|
|
||||||
}).then(({data}) => {
|
|
||||||
this.allList = data;
|
|
||||||
setTimeout(this.$refs.percent.updatePopper, 10)
|
|
||||||
}).catch(() => {
|
|
||||||
this.allList = [];
|
|
||||||
setTimeout(this.$refs.percent.updatePopper, 10)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -189,6 +176,32 @@ export default {
|
|||||||
}, 50)
|
}, 50)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
openReadPercentage() {
|
||||||
|
if (this.popperLoad > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.popperShow) {
|
||||||
|
this.popperShow = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.popperLoad++;
|
||||||
|
this.$store.dispatch("call", {
|
||||||
|
url: 'dialog/msg/readlist',
|
||||||
|
data: {
|
||||||
|
msg_id: this.msgData.id,
|
||||||
|
},
|
||||||
|
}).then(({data}) => {
|
||||||
|
this.allList = data;
|
||||||
|
}).catch(() => {
|
||||||
|
this.allList = [];
|
||||||
|
}).finally(_ => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.popperLoad--;
|
||||||
|
this.popperShow = true
|
||||||
|
}, 100)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
textMsg(text) {
|
textMsg(text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user