| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <script lang="ts" setup> |
| | | import type { ImManagerRtcApi } from '#/api/im/manager/rtc'; |
| | | |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '#/packages/constants/src'; |
| | | |
| | | import { Descriptions, DescriptionsItem, Drawer, Table } from 'ant-design-vue'; |
| | | |
| | | import { getManagerRtcCallParticipantList } from '#/api/im/manager/rtc'; |
| | | import { DictTag } from '#/components/dict-tag'; |
| | | import { |
| | | formatDateTimeText, |
| | | formatGroupLabel, |
| | | formatUserLabel, |
| | | } from '#/views/im/manager/utils/format'; |
| | | import { resolveCallDuration } from '#/views/im/utils/time'; |
| | | |
| | | const visible = ref(false); |
| | | const detail = ref<ImManagerRtcApi.RtcCall>({} as ImManagerRtcApi.RtcCall); |
| | | const loading = ref(false); |
| | | const participants = ref<ImManagerRtcApi.RtcParticipant[]>([]); |
| | | |
| | | const duration = computed(() => |
| | | resolveCallDuration(detail.value.acceptTime, detail.value.endTime), |
| | | ); |
| | | |
| | | const columns = [ |
| | | { title: 'ç¨æ·ç¼å·', dataIndex: 'userId', width: 120 }, |
| | | { title: 'æµç§°', dataIndex: 'userNickname' }, |
| | | { title: 'åä¸è§è²', dataIndex: 'role', width: 120 }, |
| | | { title: 'åä¸ç¶æ', dataIndex: 'status', width: 120 }, |
| | | { title: '被é请æ¶é´', dataIndex: 'inviteTime', width: 180 }, |
| | | { title: 'æ¥å¬æ¶é´', dataIndex: 'acceptTime', width: 180 }, |
| | | { title: 'ç¦»å¼æ¶é´', dataIndex: 'leaveTime', width: 180 }, |
| | | ]; |
| | | |
| | | /** æå¼è¯¦æ
*/ |
| | | async function open(row: ImManagerRtcApi.RtcCall) { |
| | | detail.value = row; |
| | | visible.value = true; |
| | | loading.value = true; |
| | | try { |
| | | participants.value = await getManagerRtcCallParticipantList(row.id); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | |
| | | defineExpose({ open }); |
| | | </script> |
| | | |
| | | <template> |
| | | <Drawer v-model:open="visible" destroy-on-close title="éè¯è®°å½è¯¦æ
" width="900"> |
| | | <Descriptions bordered :column="2"> |
| | | <DescriptionsItem label="ç¼å·">{{ detail.id }}</DescriptionsItem> |
| | | <DescriptionsItem label="ä¸å¡éè¯ç¼å·">{{ detail.room }}</DescriptionsItem> |
| | | <DescriptionsItem label="å起人"> |
| | | {{ formatUserLabel(detail.inviterNickname, detail.inviterUserId) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="ä¼è¯ç±»å"> |
| | | <DictTag :type="DICT_TYPE.IM_RTC_CALL_CONVERSATION_TYPE" :value="detail.conversationType" /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="群"> |
| | | {{ formatGroupLabel(detail.groupName, detail.groupId) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="åªä½ç±»å"> |
| | | <DictTag :type="DICT_TYPE.IM_RTC_CALL_MEDIA_TYPE" :value="detail.mediaType" /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="éè¯ç¶æ"> |
| | | <DictTag :type="DICT_TYPE.IM_RTC_CALL_STATUS" :value="detail.status" /> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="ç»æåå "> |
| | | <DictTag |
| | | v-if="detail.endReason" |
| | | :type="DICT_TYPE.IM_RTC_CALL_END_REASON" |
| | | :value="detail.endReason" |
| | | /> |
| | | <span v-else>-</span> |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="åèµ·æ¶é´"> |
| | | {{ formatDateTimeText(detail.startTime) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="æ¥éæ¶é´"> |
| | | {{ formatDateTimeText(detail.acceptTime) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="ç»ææ¶é´"> |
| | | {{ formatDateTimeText(detail.endTime) }} |
| | | </DescriptionsItem> |
| | | <DescriptionsItem label="éè¯æ¶é¿">{{ duration }}</DescriptionsItem> |
| | | </Descriptions> |
| | | |
| | | <div class="mb-4 mt-5 font-bold">åä¸è
å表</div> |
| | | <Table |
| | | :columns="columns" |
| | | :data-source="participants" |
| | | :loading="loading" |
| | | :pagination="false" |
| | | bordered |
| | | row-key="id" |
| | | size="small" |
| | | > |
| | | <template #bodyCell="{ column, record, text }"> |
| | | <template v-if="column.dataIndex === 'role'"> |
| | | <DictTag :type="DICT_TYPE.IM_RTC_PARTICIPANT_ROLE" :value="record.role" /> |
| | | </template> |
| | | <template v-else-if="column.dataIndex === 'status'"> |
| | | <DictTag :type="DICT_TYPE.IM_RTC_PARTICIPANT_STATUS" :value="record.status" /> |
| | | </template> |
| | | <template v-else-if="['inviteTime', 'acceptTime', 'leaveTime'].includes(column.dataIndex as string)"> |
| | | {{ formatDateTimeText(text) }} |
| | | </template> |
| | | <template v-else> |
| | | {{ text || '-' }} |
| | | </template> |
| | | </template> |
| | | </Table> |
| | | </Drawer> |
| | | </template> |