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