fix(@vben/web-antdv-next): normalize IM table slots and map select values
- use bodyCell text for IM table fallback rendering - handle object payloads from map Select selectionpull/369/head
parent
3c146eb925
commit
0f85d0b5ac
|
|
@ -136,9 +136,13 @@ function autoSearch(queryValue: string) {
|
|||
}
|
||||
|
||||
/** 处理地址选择 */
|
||||
function handleAddressSelect(value: string) {
|
||||
if (value) {
|
||||
regeoCode(value);
|
||||
function handleAddressSelect(value: unknown) {
|
||||
const selectedValue =
|
||||
typeof value === 'object' && value !== null && 'value' in value
|
||||
? (value as { value?: number | string }).value
|
||||
: value;
|
||||
if (selectedValue !== undefined && selectedValue !== null) {
|
||||
regeoCode(String(selectedValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,12 @@ defineExpose({ open });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Drawer v-model:open="visible" destroy-on-hidden title="群详情" :styles="{ wrapper: { width: '900px' } }">
|
||||
<Drawer
|
||||
v-model:open="visible"
|
||||
destroy-on-hidden
|
||||
title="群详情"
|
||||
:styles="{ wrapper: { width: '900px' } }"
|
||||
>
|
||||
<Descriptions bordered :column="2">
|
||||
<DescriptionsItem label="群编号">{{ detail.id }}</DescriptionsItem>
|
||||
<DescriptionsItem label="群名称">{{ detail.name }}</DescriptionsItem>
|
||||
|
|
@ -77,12 +82,17 @@ defineExpose({ open });
|
|||
<DescriptionsItem label="群主">
|
||||
{{ formatUserLabel(detail.ownerNickname, detail.ownerUserId) }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="成员数">{{ detail.memberCount || 0 }}</DescriptionsItem>
|
||||
<DescriptionsItem label="成员数">
|
||||
{{ detail.memberCount || 0 }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="群状态">
|
||||
<DictTag :type="DICT_TYPE.IM_GROUP_STATUS" :value="detail.status" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="封禁状态">
|
||||
<DictTag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="detail.banned" />
|
||||
<DictTag
|
||||
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
|
||||
:value="detail.banned"
|
||||
/>
|
||||
<span v-if="detail.banned" class="ml-2 text-gray-400">
|
||||
{{ detail.bannedReason }}
|
||||
</span>
|
||||
|
|
@ -112,17 +122,23 @@ defineExpose({ open });
|
|||
row-key="userId"
|
||||
size="small"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template #bodyCell="{ column, record, text }">
|
||||
<template v-if="column.dataIndex === 'avatar'">
|
||||
<Avatar :src="record.avatar" :size="40">
|
||||
{{ record.nickname?.charAt(0) || '?' }}
|
||||
</Avatar>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'role'">
|
||||
<DictTag :type="DICT_TYPE.IM_GROUP_MEMBER_ROLE" :value="record.role" />
|
||||
<DictTag
|
||||
:type="DICT_TYPE.IM_GROUP_MEMBER_ROLE"
|
||||
:value="record.role"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'silent'">
|
||||
<DictTag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="record.silent" />
|
||||
<DictTag
|
||||
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
|
||||
:value="record.silent"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'status'">
|
||||
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="record.status" />
|
||||
|
|
@ -134,7 +150,11 @@ defineExpose({ open });
|
|||
{{ formatDateTimeText(record.quitTime) }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'muteEndTime'">
|
||||
<template v-if="record.muteEndTime && new Date(record.muteEndTime) > new Date()">
|
||||
<template
|
||||
v-if="
|
||||
record.muteEndTime && new Date(record.muteEndTime) > new Date()
|
||||
"
|
||||
>
|
||||
<Tag color="error">禁言中</Tag>
|
||||
<div class="mt-1 text-xs text-gray-400">
|
||||
{{ formatDateTimeText(record.muteEndTime) }}
|
||||
|
|
@ -143,7 +163,7 @@ defineExpose({ open });
|
|||
<span v-else>-</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ record[column.dataIndex] || '-' }}
|
||||
{{ text || '-' }}
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
|
|
|
|||
|
|
@ -51,21 +51,34 @@ defineExpose({ open });
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Drawer v-model:open="visible" destroy-on-hidden title="通话记录详情" :styles="{ wrapper: { width: '900px' } }">
|
||||
<Drawer
|
||||
v-model:open="visible"
|
||||
destroy-on-hidden
|
||||
title="通话记录详情"
|
||||
:styles="{ wrapper: { width: '900px' } }"
|
||||
>
|
||||
<Descriptions bordered :column="2">
|
||||
<DescriptionsItem label="编号">{{ detail.id }}</DescriptionsItem>
|
||||
<DescriptionsItem label="业务通话编号">{{ detail.room }}</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" />
|
||||
<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" />
|
||||
<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" />
|
||||
|
|
@ -100,18 +113,30 @@ defineExpose({ open });
|
|||
row-key="id"
|
||||
size="small"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template #bodyCell="{ column, record, text }">
|
||||
<template v-if="column.dataIndex === 'role'">
|
||||
<DictTag :type="DICT_TYPE.IM_RTC_PARTICIPANT_ROLE" :value="record.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" />
|
||||
<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(record[column.dataIndex]) }}
|
||||
<template
|
||||
v-else-if="
|
||||
['inviteTime', 'acceptTime', 'leaveTime'].includes(
|
||||
column.dataIndex as string,
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ formatDateTimeText(text) }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ record[column.dataIndex] || '-' }}
|
||||
{{ text || '-' }}
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue