mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-16 03:58:12 +00:00
perf: 优化表情发送后搜索关键词逻辑
This commit is contained in:
parent
374d3b85cf
commit
c1381d5f67
@ -14,12 +14,12 @@
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="chat-emoji-menu">
|
||||
<li :class="{active: type === 'emoji'}" @click="type='emoji'">
|
||||
<span class="no-dark-content">😀</span>
|
||||
</li>
|
||||
<li :class="{active: type === 'emosearch'}" @click="type='emosearch'">
|
||||
<i class="taskfont"></i>
|
||||
</li>
|
||||
<li :class="{active: type === 'emoji'}" @click="type='emoji'">
|
||||
<span class="no-dark-content">😀</span>
|
||||
</li>
|
||||
<li v-for="item in emoticonList" :class="{active: type === 'emoticon' && emoticonPath == item.path}" @click="onEmoticon(item.path)">
|
||||
<img :title="item.name" :alt="item.name" :src="item.src"/>
|
||||
</li>
|
||||
@ -51,9 +51,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if (this.searchKey) {
|
||||
this.emosearchKey = this.searchKey;
|
||||
}
|
||||
//
|
||||
},
|
||||
watch: {
|
||||
type() {
|
||||
@ -61,6 +59,12 @@ export default {
|
||||
},
|
||||
emosearchKey() {
|
||||
this.onEmosearch()
|
||||
},
|
||||
searchKey: {
|
||||
handler(val) {
|
||||
this.emosearchKey = val;
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@ -425,7 +425,19 @@ export default {
|
||||
|
||||
showEmoji(val) {
|
||||
if (val) {
|
||||
let text = this.value.replace(/ /g," ")
|
||||
text = text.replace(/<[^>]+>/g, "")
|
||||
if (text
|
||||
&& text.indexOf(" ") === -1
|
||||
&& text.length >= 1
|
||||
&& text.length <= 4) {
|
||||
this.emojiQuickKey = text;
|
||||
} else {
|
||||
this.emojiQuickKey = "";
|
||||
}
|
||||
//
|
||||
this.showMore = false;
|
||||
this.emojiQuickShow = false;
|
||||
if (this.quill) {
|
||||
const range = this.quill.selection.savedRange;
|
||||
this.rangeIndex = range ? range.index : 0
|
||||
@ -712,7 +724,6 @@ export default {
|
||||
&& text.length <= 4
|
||||
&& $A.isArray(window.emoticonData)) {
|
||||
// 显示快捷选择表情窗口
|
||||
this.emojiQuickKey = text;
|
||||
this.emojiQuickItems = [];
|
||||
let baseUrl = $A.apiUrl("../images/emoticon")
|
||||
window.emoticonData.some(data => {
|
||||
@ -888,8 +899,9 @@ export default {
|
||||
},
|
||||
|
||||
hidePopover() {
|
||||
this.showEmoji = false;
|
||||
this.showMore = false;
|
||||
this.showEmoji = false;
|
||||
this.emojiQuickShow = false;
|
||||
},
|
||||
|
||||
onClickCover() {
|
||||
@ -942,6 +954,9 @@ export default {
|
||||
}
|
||||
} else if (item.type === 'emoticon') {
|
||||
this.$emit('on-send', `<img class="emoticon" data-asset="${item.asset}" data-name="${item.name}" src="${item.src}"/>`)
|
||||
if (item.asset === "emosearch") {
|
||||
this.$emit('input', "")
|
||||
}
|
||||
if (this.windowLarge) {
|
||||
this.showEmoji = false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user