新增IM聊天

This commit is contained in:
geht
2026-05-28 14:37:05 +08:00
parent 99e574f600
commit 3539eab924
35 changed files with 2864 additions and 36 deletions

View File

@@ -0,0 +1,62 @@
<template>
<BasicModal
v-bind="$attrs"
title="IM聊天"
:width="980"
:footer="null"
:canFullscreen="true"
:destroyOnClose="false"
wrapClassName="im-chat-modal-wrap"
@register="registerModal"
@open-change="handleOpenChange"
>
<div class="im-chat-modal-body">
<ImChat ref="imChatRef" embedded />
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, nextTick } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import ImChat from './ImChat.vue';
defineOptions({ name: 'ImChatModal' });
const imChatRef = ref<InstanceType<typeof ImChat>>();
function restoreChatSession() {
nextTick(() => {
imChatRef.value?.restoreSessionIfNeeded?.();
});
}
const [registerModal] = useModalInner(() => {
restoreChatSession();
});
function handleOpenChange(open: boolean) {
if (open) {
restoreChatSession();
}
}
</script>
<style lang="less">
.im-chat-modal-wrap {
.im-chat-modal-body {
height: 70vh;
min-height: 480px;
}
.im-chat-page--embedded {
height: 100% !important;
padding: 0 !important;
background: transparent !important;
}
.im-chat-row {
border-radius: 4px;
}
}
</style>