mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
fix: 消息输入框回复冲突
This commit is contained in:
parent
eda9eb08d5
commit
c0a90ae89d
@ -222,6 +222,7 @@ import touchclick from "../../../../directives/touchclick";
|
||||
import TransferDom from "../../../../directives/transfer-dom";
|
||||
import clickoutside from "../../../../directives/clickoutside";
|
||||
import longpress from "../../../../directives/longpress";
|
||||
import {inputLoadAdd, inputLoadIsLast, inputLoadRemove} from "./one";
|
||||
import {isMarkdownFormat} from "../../../../store/markdown";
|
||||
import {Store} from "le5le-store";
|
||||
|
||||
@ -342,6 +343,9 @@ export default {
|
||||
fullQuill: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
inputLoadAdd(this.dialogId, this._uid)
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
//
|
||||
@ -370,6 +374,7 @@ export default {
|
||||
$A.loadScript('js/emoticon.all.js')
|
||||
},
|
||||
beforeDestroy() {
|
||||
inputLoadRemove(this.dialogId, this._uid)
|
||||
if (this.quill) {
|
||||
this.quill.getModule("mention")?.hideMentionList();
|
||||
this.quill = null
|
||||
@ -1361,6 +1366,9 @@ export default {
|
||||
if (!this.quill) {
|
||||
return;
|
||||
}
|
||||
if (!inputLoadIsLast(this.dialogId, this._uid)) {
|
||||
return;
|
||||
}
|
||||
const {index} = this.quill.getSelection(true);
|
||||
this.quill.insertEmbed(index, "mention", data, Quill.sources.USER);
|
||||
this.quill.insertText(index + 1, " ", Quill.sources.USER);
|
||||
|
||||
@ -2,6 +2,29 @@ import Vue from 'vue';
|
||||
import Emoji from "./emoji.vue";
|
||||
import {Modal} from "view-design-hi";
|
||||
|
||||
const inputLoadUid = {}
|
||||
|
||||
function inputLoadAdd(dialogId, uid) {
|
||||
if (typeof inputLoadUid[dialogId] === "undefined") {
|
||||
inputLoadUid[dialogId] = [];
|
||||
}
|
||||
inputLoadUid[dialogId].push(uid)
|
||||
}
|
||||
|
||||
function inputLoadRemove(dialogId, uid) {
|
||||
if (typeof inputLoadUid[dialogId] === "undefined") {
|
||||
return;
|
||||
}
|
||||
inputLoadUid[dialogId] = inputLoadUid[dialogId].filter(v => v !== uid)
|
||||
}
|
||||
|
||||
function inputLoadIsLast(dialogId, uid) {
|
||||
if (typeof inputLoadUid[dialogId] === "undefined") {
|
||||
return false;
|
||||
}
|
||||
return inputLoadUid[dialogId][inputLoadUid[dialogId].length - 1] === uid
|
||||
}
|
||||
|
||||
function choiceEmojiOne() {
|
||||
return new Promise(resolve => {
|
||||
const Instance = new Vue({
|
||||
@ -53,4 +76,4 @@ function choiceEmojiOne() {
|
||||
})
|
||||
}
|
||||
|
||||
export {choiceEmojiOne}
|
||||
export {choiceEmojiOne, inputLoadAdd, inputLoadRemove, inputLoadIsLast}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user