mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-16 12:08:12 +00:00
no message
This commit is contained in:
parent
21b6479dbe
commit
70ec88e57d
@ -31,7 +31,7 @@
|
||||
ref="editor"
|
||||
class="no-dark-content"
|
||||
:style="editorStyle"
|
||||
@click.stop=""
|
||||
@click.stop="onClickEditor"
|
||||
@paste="handlePaste"></div>
|
||||
|
||||
<!-- 工具栏 -->
|
||||
@ -465,9 +465,6 @@ export default {
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
this.$nextTick(_ => {
|
||||
this.updateEmojiQuick(this.value)
|
||||
})
|
||||
} else {
|
||||
this.$emit('on-blur')
|
||||
}
|
||||
@ -699,11 +696,13 @@ export default {
|
||||
},
|
||||
|
||||
updateEmojiQuick(text) {
|
||||
if (!this.isFocus) {
|
||||
if (!this.isFocus || !text) {
|
||||
this.emojiQuickShow = false
|
||||
return
|
||||
}
|
||||
this.emojiQuickTimer && clearTimeout(this.emojiQuickTimer)
|
||||
this.emojiQuickTimer = setTimeout(_ => {
|
||||
text = text.replace(/ /g," ")
|
||||
text = text.replace(/<[^>]+>/g, "")
|
||||
if (text
|
||||
&& text.indexOf(" ") === -1
|
||||
@ -730,7 +729,7 @@ export default {
|
||||
}
|
||||
}
|
||||
this.emojiQuickShow = false
|
||||
}, 200)
|
||||
}, 100)
|
||||
},
|
||||
|
||||
setText(value) {
|
||||
@ -766,6 +765,10 @@ export default {
|
||||
}, 600)
|
||||
},
|
||||
|
||||
onClickEditor() {
|
||||
this.updateEmojiQuick(this.value)
|
||||
},
|
||||
|
||||
focus() {
|
||||
this.$nextTick(() => {
|
||||
if (this.quill) {
|
||||
|
||||
23
resources/assets/js/store/actions.js
vendored
23
resources/assets/js/store/actions.js
vendored
@ -2159,6 +2159,29 @@ export default {
|
||||
} else {
|
||||
state.dialogIns.push(data);
|
||||
}
|
||||
// 会话消息总数量大于200时只保留最近打开的5个会话
|
||||
const msg_max = 200
|
||||
const retain_num = 5
|
||||
if (state.dialogMsgs.length > msg_max) {
|
||||
state.dialogHistory = state.dialogHistory.filter(id => id != data.dialog_id)
|
||||
state.dialogHistory.push(data.dialog_id)
|
||||
if (state.dialogHistory.length > retain_num) {
|
||||
const historys = state.dialogHistory.slice().reverse()
|
||||
const newIds = []
|
||||
const delIds = []
|
||||
historys.forEach(id => {
|
||||
if (newIds.length < retain_num || state.dialogIns.findIndex(item => item.dialog_id == id) > -1) {
|
||||
newIds.push(id)
|
||||
} else {
|
||||
delIds.push(id)
|
||||
}
|
||||
})
|
||||
if (delIds.length > 0) {
|
||||
state.dialogMsgs = state.dialogMsgs.filter(item => !delIds.includes(item.dialog_id));
|
||||
}
|
||||
state.dialogHistory = newIds
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -79,6 +79,7 @@ const stateData = {
|
||||
dialogIns: [],
|
||||
dialogMsgs: [],
|
||||
dialogTodos: [],
|
||||
dialogHistory: [],
|
||||
dialogInputCache: $A.getStorageArray("cacheDialogInput"),
|
||||
dialogMsgTransfer: {time: 0},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user