消息模块-功能联调

main
ysn 3 days ago
parent 864215e901
commit d5ad00bd09
  1. 12
      src/views/message/components/MessageDisplay.vue
  2. 20
      src/views/message/components/MessageEditor.vue
  3. 3
      src/views/message/components/SearchRecord.vue
  4. 8
      src/views/message/index.vue

@ -5,7 +5,7 @@
<div class="chat-title">
<span class="name" v-if="currentChat">{{ currentChat.name }}</span>
<span v-if="currentChat && currentChat.scene === ContactsScene.GROUP">
({{ currentChat.user_num - 1 }})
({{ currentChat.user_num }})
</span>
</div>
<div class="chat-actions">
@ -377,6 +377,7 @@ export default {
previewVisible: false,
previewImageUrl: "",
isNearBottom: true,
fontSize: 14,
lastScrollTop: 0,
meetingModes: meetingModes(),
};
@ -880,6 +881,15 @@ export default {
this.setMessages({ key, messages: list });
}
},
//
setFontSize(fontSize) {
this.fontSize = fontSize;
const container = this.$refs.messageContainer;
if (container) {
container.style.fontSize = fontSize + "px";
}
},
},
};
</script>

@ -22,15 +22,15 @@
<el-dropdown @command="handleFontSizeChange">
<el-button type="text"> A </el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="10">10px</el-dropdown-item>
<el-dropdown-item command="11">11px</el-dropdown-item>
<el-dropdown-item command="12">12px</el-dropdown-item>
<el-dropdown-item command="13">13px</el-dropdown-item>
<el-dropdown-item command="14">14px</el-dropdown-item>
<el-dropdown-item command="10">10</el-dropdown-item>
<el-dropdown-item command="11">11</el-dropdown-item>
<el-dropdown-item command="12">12</el-dropdown-item>
<el-dropdown-item command="13">13</el-dropdown-item>
<el-dropdown-item command="14">14</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- @成员下拉 仅群聊显示 -->
<el-dropdown @command="handleAtSelect" v-if="currentChat.scene == 4">
<el-dropdown @command="handleAtSelect" v-if="currentChat.scene == 4&&groupInfo">
<el-button type="text"> @ </el-button>
<el-dropdown-menu
slot="dropdown"
@ -242,13 +242,9 @@ export default {
}
},
//
// -
handleFontSizeChange(size) {
const quillSize = this.fontSizeMap[size];
if (this.quill) {
this.quill.format("size", quillSize);
this.$refs.quillEditor.style.fontSize = size + "px";
}
this.$emit("font-size-change", parseInt(size));
},
//

@ -4,9 +4,6 @@
:visible.sync="visible"
width="40%"
append-to-body
:close-on-click-modal="true"
destroy-on-close
:before-close="() => (visible = false)"
>
<div class="search-record">
<!-- 分类标签 -->

@ -15,11 +15,13 @@
:group-info="groupInfo"
@send-message="handleSendMessage"
@update-message-status="handleUpdateMessageStatus"
@font-size-change="handleFontSizeChange"
/>
</div>
<!-- 群设置弹窗 -->
<GroupSetting
v-if="groupInfo"
ref="groupSettingRef"
:chat="currentChat"
:group-info="groupInfo"
@ -343,6 +345,12 @@ export default {
}
},
handleFontSizeChange(fontSize) {
if (this.$refs.messageDisplay) {
this.$refs.messageDisplay.setFontSize(fontSize);
}
},
handleSendFiles(files) {
if (this.$refs.messageEditor) {
files.forEach((file) => {

Loading…
Cancel
Save