update notify style
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
<template>
|
||||
<div v-can="corePermissionCodes.notify.read" class="notify-detail">
|
||||
<article v-if="detail" class="article">
|
||||
<header class="header">
|
||||
<h1 v-text="getSubject(detail)" />
|
||||
<div class="sender">
|
||||
发送用户:<span v-text="getSenderName(detail)" />
|
||||
</div>
|
||||
<pass-time-label class="time" :timestamp="detail.sendAt" underline />
|
||||
</header>
|
||||
<section class="body">
|
||||
<notify-view
|
||||
:detail="detail"
|
||||
empty-text="暂无通知内容"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
</section>
|
||||
</article>
|
||||
<notify-content
|
||||
v-if="detail"
|
||||
:detail="detail"
|
||||
:sender="getSenderName(detail)"
|
||||
:timestamp="detail.sendAt"
|
||||
:resolve-attachment-url="resolveAttachmentUrl"
|
||||
/>
|
||||
<t-empty
|
||||
v-else
|
||||
:description="isLoading ? '正在加载通知' : '通知不存在'"
|
||||
@@ -24,8 +15,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { NotifyView } from "timi-tdesign-mobile";
|
||||
import { PassTimeLabel } from "timi-web";
|
||||
import { NotifyAPI, type NotifyDetail } from "timi-web-api";
|
||||
import { DialogPlugin } from "tdesign-mobile-vue";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
@@ -33,6 +22,7 @@ import { getErrorMessage } from "@/utils/error";
|
||||
import { getAttachmentReadURL } from "@/utils/attachment";
|
||||
import { corePermissionCodes } from "@/utils/permission";
|
||||
import { Message } from "@/utils/message.ts";
|
||||
import NotifyContent from "@/pages/notify/component/NotifyContent.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -145,10 +135,6 @@ async function markRead(item: NotifyDetail, requestToken: number): Promise<void>
|
||||
|
||||
// ---------- 展示 ----------
|
||||
|
||||
function getSubject(item: NotifyDetail): string {
|
||||
return item.subject?.trim() || "站内通知";
|
||||
}
|
||||
|
||||
function getSenderName(item: NotifyDetail): string {
|
||||
return item.fromUser?.nick?.trim() || item.fromUser?.name?.trim() || "系统通知";
|
||||
}
|
||||
@@ -179,71 +165,5 @@ onUnmounted(() => {
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.article {
|
||||
padding: 1.25rem 1rem;
|
||||
margin: 0 1rem;
|
||||
background: rgba(255, 255, 255, .92);
|
||||
box-shadow: var(--td-shadow-1);
|
||||
border-radius: 1.4rem;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
border-bottom: 1px solid rgba(148, 163, 184, .2);
|
||||
padding-bottom: 1rem;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #64748b;
|
||||
margin-top: .5rem;
|
||||
font-size: .8125rem;
|
||||
}
|
||||
|
||||
.sender {
|
||||
color: #64748b;
|
||||
margin-top: .5rem;
|
||||
font-size: .8125rem;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
color: #334155;
|
||||
padding-top: 1rem;
|
||||
font-size: .9375rem;
|
||||
line-height: 1.8;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
:global(html.theme-dark) {
|
||||
.notify-detail {
|
||||
.article {
|
||||
background: rgba(15, 23, 42, .88);
|
||||
box-shadow: 0 .75rem 2rem rgba(2, 6, 23, .32);
|
||||
}
|
||||
|
||||
.header {
|
||||
border-bottom-color: rgba(148, 163, 184, .16);
|
||||
|
||||
.time {
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.sender {
|
||||
color: #94a3b8;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
color: #cbd5e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user