perf: 消息快捷发送菜单

This commit is contained in:
kuaifan 2023-03-05 23:01:09 +08:00
parent c27a15fce2
commit 4c76b3e60c
3 changed files with 23 additions and 7 deletions

View File

@ -84,6 +84,7 @@ class WebSocketDialog extends AbstractModel
$this->top_at = $this->top_at ?? $dialogUserFun('top_at');
$this->user_at = $this->user_at ?? $dialogUserFun('updated_at');
$this->user_ms = WebSocketDialogUser::userMs($this->user_at);
$this->quick_msg = [];
//
if (isset($this->search_msg_id)) {
// 最后消息 (搜索预览消息)

View File

@ -164,11 +164,18 @@
@on-progress="chatFile('progress', $event)"
@on-success="chatFile('success', $event)"
@on-error="chatFile('error', $event)"/>
<div v-if="todoShow" class="chat-todo">
<div class="todo-label">{{$L('待办')}}:</div>
<div v-if="todoShow" class="chat-bottom-menu">
<div class="bottom-menu-label">{{$L('待办')}}:</div>
<ul class="scrollbar-hidden">
<li v-for="item in todoList" @click.stop="onViewTodo(item)">
<div class="todo-desc no-dark-content">{{$A.getMsgSimpleDesc(item.msg_data)}}</div>
<div class="bottom-menu-desc no-dark-content">{{$A.getMsgSimpleDesc(item.msg_data)}}</div>
</li>
</ul>
</div>
<div v-else-if="quickShow" class="chat-bottom-menu">
<ul class="scrollbar-hidden">
<li v-for="text in quickMsg" @click.stop="sendMsg(text)">
<div class="bottom-menu-desc no-dark-content">{{text}}</div>
</li>
</ul>
</div>
@ -723,6 +730,14 @@ export default {
return array
},
quickMsg() {
return this.dialogData.quick_msg || []
},
quickShow() {
return this.quickMsg.length > 0 && this.windowScrollY === 0 && this.replyId === 0
},
todoList() {
if (!this.dialogData.todo_num) {
return []
@ -2355,7 +2370,7 @@ export default {
userids: [],
msg_id: this.operateItem.id,
my_id: this.userId,
you_id: youId != this.userId ? youId : 0,
you_id: youId != this.userId && !this.dialogData.bot ? youId : 0,
}
if (this.operateItem.todo) {
$A.modalConfirm({

View File

@ -1187,12 +1187,12 @@
overflow: hidden;
}
.chat-todo {
.chat-bottom-menu {
display: flex;
align-items: center;
padding: 8px 0;
.todo-label {
.bottom-menu-label {
flex-shrink: 0;
padding-right: 8px;
}
@ -1216,7 +1216,7 @@
display: flex;
align-items: center;
.todo-desc {
.bottom-menu-desc {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;