Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
c773711b26 | |||
478b4bdd57 | |||
ecb4b64176 | |||
|
a8fea9ea32 | ||
|
62cb9c87c2 | ||
445f8f2e79 | |||
9503fbe78a |
@ -33,7 +33,6 @@ const props = defineProps({
|
||||
const emit = defineEmits(['editor-event'])
|
||||
const userStore = useUserStore()
|
||||
const dialogueStore = useDialogueStore()
|
||||
console.log('dialogueStore', dialogueStore.talk.talk_type)
|
||||
const editorDraftStore = useEditorDraftStore()
|
||||
const editorRef = ref(null)
|
||||
const content = ref('')
|
||||
@ -172,7 +171,6 @@ const updateMentionPosition = (range) => {
|
||||
}
|
||||
}
|
||||
const insertMention = (member, clonedRange) => {
|
||||
console.log('插入mention', member);
|
||||
const selection = window.getSelection();
|
||||
if (!clonedRange || !selection || !editorRef.value) return;
|
||||
const range = clonedRange;
|
||||
@ -565,20 +563,20 @@ const parseEditorContent = () => {
|
||||
currentTextBuffer += '\n';
|
||||
break;
|
||||
case 'IMG':
|
||||
flushTextBufferIfNeeded();
|
||||
const src = node.getAttribute('src');
|
||||
const alt = node.getAttribute('alt');
|
||||
const isEmojiPic = node.classList.contains('editor-emoji');
|
||||
const isTextEmojiPlaceholder = node.classList.contains('emoji');
|
||||
if (isTextEmojiPlaceholder && alt) {
|
||||
if ((isEmojiPic || isTextEmojiPlaceholder) && alt) {
|
||||
currentTextBuffer += alt;
|
||||
} else if (src) {
|
||||
flushTextBufferIfNeeded();
|
||||
items.push({
|
||||
type: 3,
|
||||
content: src,
|
||||
isEmoji: isEmojiPic,
|
||||
width: node.getAttribute('data-original-width') || node.width || null,
|
||||
height: node.getAttribute('data-original-height') || node.height || null,
|
||||
isEmoji: false,
|
||||
width: node.getAttribute('data-original-width') || node.width,
|
||||
height: node.getAttribute('data-original-height') || node.height
|
||||
});
|
||||
}
|
||||
break;
|
||||
@ -887,12 +885,8 @@ const insertImageEmoji = (imgSrc, altText) => {
|
||||
img.className = 'editor-emoji';
|
||||
img.setAttribute('data-role', 'emoji');
|
||||
range.insertNode(img);
|
||||
const spaceNode = document.createTextNode('\u00A0');
|
||||
range.setStartAfter(img);
|
||||
range.collapse(true);
|
||||
range.insertNode(spaceNode);
|
||||
range.setStartAfter(spaceNode);
|
||||
range.collapse(true);
|
||||
if (selection) {
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
|
@ -186,7 +186,14 @@ class Talk extends Base {
|
||||
|
||||
//群解散时,需要更新群成员权限
|
||||
if ([1106].includes(record.msg_type)) {
|
||||
//更新会话信息
|
||||
useDialogueStore().updateDismiss(true)
|
||||
//更新会话列表中的会话信息
|
||||
useTalkStore().updateItem({
|
||||
index_name: this.getIndexName(),
|
||||
is_dismiss: 1,
|
||||
group_member_num: 0
|
||||
})
|
||||
}
|
||||
|
||||
//群成员被移出时,需要更新群成员权限
|
||||
@ -197,6 +204,12 @@ class Talk extends Base {
|
||||
)
|
||||
if (isMeQuit) {
|
||||
useDialogueStore().updateQuit(true)
|
||||
//更新会话列表中的会话信息
|
||||
useTalkStore().updateItem({
|
||||
index_name: this.getIndexName(),
|
||||
is_quit: 1,
|
||||
group_member_num: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { reactive, computed } from 'vue'
|
||||
import { Peoples, Announcement, MenuUnfoldOne, MenuFoldOne } from '@icon-park/vue-next'
|
||||
import { useDialogueStore } from '@/store'
|
||||
|
||||
@ -30,6 +31,10 @@ defineProps({
|
||||
})
|
||||
|
||||
const dialogueStore = useDialogueStore()
|
||||
const dialogueParams = reactive({
|
||||
isDismiss: computed(() => dialogueStore.isDismiss),
|
||||
isQuit: computed(() => dialogueStore.isQuit)
|
||||
})
|
||||
const emit = defineEmits(['evnet'])
|
||||
|
||||
const onSetMenu = () => {
|
||||
@ -83,7 +88,7 @@ const onSetMenu = () => {
|
||||
:size="18"
|
||||
class="icon"
|
||||
@click="emit('evnet', 'group')"
|
||||
v-show="!dialogueStore.isDismiss && !dialogueStore.isQuit"
|
||||
v-show="!dialogueParams.isDismiss && !dialogueParams.isQuit"
|
||||
>
|
||||
<img
|
||||
style="width: 20px; height: 20px;"
|
||||
|
Loading…
Reference in New Issue
Block a user