no message

This commit is contained in:
kuaifan 2022-04-20 16:46:12 +08:00
parent 8acf3b21c7
commit 6b2b072e16
4 changed files with 35 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="chat-input-wrapper" :class="modeClass">
<div ref="editor" class="no-dark-content"></div>
<div ref="editor" class="no-dark-content" :style="editorStyle"></div>
<div class="chat-input-toolbar">
<slot name="toolbarBefore"/>
@ -106,6 +106,7 @@ export default {
_options: {},
modeClass: '',
editorStyle: {},
userList: null,
taskList: null,
@ -268,10 +269,12 @@ export default {
this._content = html
this.$emit('input', this._content)
this.$emit('on-change', { html, text, quill })
this.calcEditStyle();
})
// Emit ready event
this.$emit('on-ready', this.quill)
this.calcEditStyle();
},
focus() {
@ -290,6 +293,16 @@ export default {
this.$emit('on-send')
},
calcEditStyle() {
if (this.$refs.editor.clientWidth < 120 || this.$refs.editor.clientHeight > 40) {
this.editorStyle = {
width: '100%'
};
} else {
this.editorStyle = {};
}
},
onSelectEmoji(item) {
if (!this.quill) {
return;

View File

@ -307,9 +307,18 @@ export default {
this.msgNew = 0;
this.topId = -1;
this.visible = false;
if (this.dialogMsgList.length > 0) {
setTimeout(_ => {
this.onToBottom();
this.visible = true;
}, 10);
}
let startTime = new Date().getTime();
this.$store.dispatch("getDialogMsgs", id).then(_ => {
this.onToBottom();
this.visible = true;
setTimeout(_ => {
this.onToBottom();
this.visible = true;
}, Math.max(0, 100 - (new Date().getTime() - startTime)));
});
}
},

View File

@ -28,8 +28,9 @@
.ql-container {
display: block;
float: left;
width: auto;
max-width: 100%;
min-width: calc(100% - 175px);
min-width: calc(100% - 170px);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
.ql-editor {
@ -216,7 +217,7 @@
align-items: center;
justify-content: flex-end;
float: right;
width: 175px;
width: 170px;
height: 28px;
padding: 0 2px;
.common-loading {

View File

@ -601,6 +601,13 @@
> pre {
.mention {
color: #333333;
&.me {
font-size: 14px;
font-weight: normal;
padding: 3px 0;
background-color: transparent;
}
}
}
}