消息模块-功能联调

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

@ -22,15 +22,15 @@
<el-dropdown @command="handleFontSizeChange"> <el-dropdown @command="handleFontSizeChange">
<el-button type="text"> A </el-button> <el-button type="text"> A </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="10">10px</el-dropdown-item> <el-dropdown-item command="10">10</el-dropdown-item>
<el-dropdown-item command="11">11px</el-dropdown-item> <el-dropdown-item command="11">11</el-dropdown-item>
<el-dropdown-item command="12">12px</el-dropdown-item> <el-dropdown-item command="12">12</el-dropdown-item>
<el-dropdown-item command="13">13px</el-dropdown-item> <el-dropdown-item command="13">13</el-dropdown-item>
<el-dropdown-item command="14">14px</el-dropdown-item> <el-dropdown-item command="14">14</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </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-button type="text"> @ </el-button>
<el-dropdown-menu <el-dropdown-menu
slot="dropdown" slot="dropdown"
@ -242,13 +242,9 @@ export default {
} }
}, },
// // -
handleFontSizeChange(size) { handleFontSizeChange(size) {
const quillSize = this.fontSizeMap[size]; this.$emit("font-size-change", parseInt(size));
if (this.quill) {
this.quill.format("size", quillSize);
this.$refs.quillEditor.style.fontSize = size + "px";
}
}, },
// //

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

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

Loading…
Cancel
Save