| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <script lang="ts" setup> |
| | | import type { ImManagerPrivateMessageApi } from '#/api/im/manager/message/private'; |
| | | |
| | | import { ref } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '#/packages/constants/src'; |
| | | |
| | | import { Descriptions, DescriptionsItem, Modal } from 'ant-design-vue'; |
| | | |
| | | import { DictTag } from '#/components/dict-tag'; |
| | | import { |
| | | formatDateTimeText, |
| | | formatJsonText, |
| | | formatUserLabel, |
| | | } from '#/views/im/manager/utils/format'; |
| | | import { MESSAGE_PRIVATE_READ_ENABLED } from '#/views/im/utils/config'; |
| | | |
| | | import { MessageContentPreview } from '../..'; |
| | | |
| | | const visible = ref(false); |
| | | const detail = ref<ImManagerPrivateMessageApi.PrivateMessage>( |
| | | {} as ImManagerPrivateMessageApi.PrivateMessage, |
| | | ); |
| | | |
| | | /** æå¼è¯¦æ
*/ |
| | | function open(row: ImManagerPrivateMessageApi.PrivateMessage) { |
| | | detail.value = row; |
| | | visible.value = true; |
| | | } |
| | | |
| | | defineExpose({ open }); |
| | | </script> |
| | | |
| | | <template> |
| | | <Modal v-model:open="visible" :footer="null" title="ç§èæ¶æ¯è¯¦æ
" width="700px"> |
| | | <Descriptions bordered :column="2"> |
| | | <DescriptionsItem label="ç¼å·">{{ detail.id }}</DescriptionsItem> |
| | | <DescriptionsItem label="客æ·ç«¯ç¼å·"> |
| | | {{ detail.clientMessageId || '-' }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="åé人"> |
| | | {{ formatUserLabel(detail.senderNickname, detail.senderId) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="æ¥æ¶äºº"> |
| | | {{ formatUserLabel(detail.receiverNickname, detail.receiverId) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="ç±»å"> |
| | | <DictTag :type="DICT_TYPE.IM_CONTENT_TYPE" :value="detail.type" /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="ç¶æ"> |
| | | <DictTag :type="DICT_TYPE.IM_MESSAGE_STATUS" :value="detail.status" /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem v-if="MESSAGE_PRIVATE_READ_ENABLED" label="åæ§"> |
| | | <!-- åæ§ç¶æï¼ç§è / 群èå
±ç¨ im_message_receipt_statusï¼ï¼ä¸æºç«¯ç§è详æ
ãåæ§ãå¯¹é½ --> |
| | | <DictTag |
| | | :type="DICT_TYPE.IM_MESSAGE_RECEIPT_STATUS" |
| | | :value="detail.receiptStatus" |
| | | /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="åéæ¶é´" :span="2"> |
| | | {{ formatDateTimeText(detail.sendTime) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="æ¶æ¯å
容" :span="2"> |
| | | <MessageContentPreview |
| | | :content="detail.content" |
| | | :sender-nickname="detail.senderNickname" |
| | | :type="detail.type" |
| | | /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="åå§ JSON" :span="2"> |
| | | <pre class="m-0 whitespace-pre-wrap break-all rounded bg-gray-100 p-2 font-mono text-xs">{{ formatJsonText(detail.content) }}</pre> |
| | | </DescriptionsItem> |
| | | </Descriptions> |
| | | </Modal> |
| | | </template> |