fix: 消息展示修正

This commit is contained in:
zxr
2026-07-15 13:06:09 +08:00
parent e5df404aaa
commit 947fa2f9b9
3 changed files with 56 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
<template> <template>
<a-spin style="display: block" :loading="loading"> <a-spin class="message-box" :class="{ 'is-empty': !renderList.length }" style="display: block" :loading="loading">
<a-tabs v-model:activeKey="messageType" type="rounded" destroy-on-hide> <a-tabs v-model:activeKey="messageType" type="rounded" destroy-on-hide>
<a-tab-pane v-for="item in tabList" :key="item.key"> <a-tab-pane v-for="item in tabList" :key="item.key">
<template #title> <template #title>
<span>{{ item.title }}{{ formatUnreadLength(item.key) }}</span> <span>{{ item.title }}{{ formatUnreadLength(item.key) }}</span>
</template> </template>
<a-result v-if="!renderList.length" status="404"> <a-result v-if="!renderList.length" class="message-empty" status="404">
<template #subtitle>{{ $t('messageBox.noContent') }}</template> <template #subtitle>{{ $t('messageBox.noContent') }}</template>
</a-result> </a-result>
<List <List
@@ -193,6 +193,32 @@ useNotificationSocket<MessageRecord>({
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.message-box {
width: 400px;
overflow: hidden;
:deep(.arco-spin-children) {
overflow: hidden;
}
:deep(.arco-tabs-content) {
max-height: 360px;
overflow-x: hidden;
overflow-y: auto;
}
&.is-empty {
:deep(.arco-tabs-content) {
max-height: none;
overflow: hidden;
}
:deep(.message-empty) {
padding: 34px 0 22px;
}
}
}
:deep(.arco-popover-popup-content) { :deep(.arco-popover-popup-content) {
padding: 0; padding: 0;
} }

View File

@@ -54,7 +54,7 @@
</div> </div>
</a-list-item> </a-list-item>
<template #footer> <template #footer>
<a-space fill :size="0" :class="{ 'add-border-top': renderList.length < showMax }"> <a-space fill :size="0" class="message-footer-actions" :class="{ 'add-border-top': renderList.length < showMax }">
<div class="footer-wrap"> <div class="footer-wrap">
<a-link @click="allRead">{{ $t('messageBox.allRead') }}</a-link> <a-link @click="allRead">{{ $t('messageBox.allRead') }}</a-link>
</div> </div>
@@ -147,10 +147,20 @@ const showMax = 3
.arco-list-footer { .arco-list-footer {
padding: 0; padding: 0;
height: 50px; height: 50px;
line-height: 50px; line-height: normal;
border-top: none; border-top: none;
.arco-space-item {
.message-footer-actions {
display: flex;
width: 100%; width: 100%;
height: 50px;
}
.arco-space-item {
display: flex;
flex: 1;
width: 50%;
height: 50px;
border-right: 1px solid rgb(var(--gray-3)); border-right: 1px solid rgb(var(--gray-3));
&:last-child { &:last-child {
border-right: none; border-right: none;
@@ -161,7 +171,20 @@ const showMax = 3
} }
} }
.footer-wrap { .footer-wrap {
text-align: center; display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 50px;
:deep(.arco-link) {
line-height: 1;
}
:deep(.arco-link:focus-visible) {
background-color: transparent;
box-shadow: none;
}
} }
.arco-typography { .arco-typography {
margin-bottom: 0; margin-bottom: 0;

View File

@@ -62,7 +62,7 @@
<a-popover <a-popover
trigger="click" trigger="click"
:arrow-style="{ display: 'none' }" :arrow-style="{ display: 'none' }"
:content-style="{ padding: 0, minWidth: '400px' }" :content-style="{ padding: 0, minWidth: '400px', overflow: 'hidden' }"
content-class="message-popover" content-class="message-popover"
> >
<div ref="refBtn" class="ref-btn"></div> <div ref="refBtn" class="ref-btn"></div>