fix list style
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
:options="recipientFilterOptions"
|
||||
v-entrance-transition
|
||||
/>
|
||||
<t-cell-group v-if="filteredDetailList.length" title="发送用户" theme="card" class="recipients">
|
||||
<t-cell-group v-if="filteredDetailList.length" theme="card" class="recipients">
|
||||
<t-cell
|
||||
v-for="(item, index) in filteredDetailList"
|
||||
:key="item.id"
|
||||
@@ -17,17 +17,27 @@
|
||||
<template #title>
|
||||
<div class="recipient-title">
|
||||
<span v-text="getRecipientName(item)" />
|
||||
<t-tag size="small" :theme="getReadTheme(item)" :content="getReadText(item)" />
|
||||
</div>
|
||||
</template>
|
||||
<template #description>
|
||||
<template v-if="recipientFilter === 'all'" #description>
|
||||
<div class="recipient-description">
|
||||
<span v-text="getRecipientContact(item)" />
|
||||
<pass-time-label :timestamp="item.sendAt" underline />
|
||||
<span v-if="item.resultDesc" v-text="item.resultDesc" />
|
||||
</div>
|
||||
</template>
|
||||
<template #note>
|
||||
<span v-text="getReadTime(item)" />
|
||||
<t-tag
|
||||
v-if="recipientFilter === 'all'"
|
||||
size="small"
|
||||
:theme="getStatusTheme(item)"
|
||||
:content="getStatusText(item)"
|
||||
/>
|
||||
<pass-time-label
|
||||
v-else-if="recipientFilter === 'read'"
|
||||
:timestamp="item.readAt"
|
||||
underline
|
||||
/>
|
||||
<telephone-link v-else :value="item.toUser?.phoneNo" />
|
||||
</template>
|
||||
</t-cell>
|
||||
</t-cell-group>
|
||||
@@ -41,7 +51,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Time } from "timi-web";
|
||||
import { PassTimeLabel, Time } from "timi-web";
|
||||
import { NotifyAPI, type Notify, type NotifyDetail } from "timi-web-api";
|
||||
import { Message } from "@/utils/message";
|
||||
import { getErrorMessage } from "@/utils/error";
|
||||
@@ -121,11 +131,7 @@ function getRecipientName(item: NotifyDetail): string {
|
||||
return item.toUser?.nick?.trim() || item.toUser?.name?.trim() || item.sendTo || "未知用户";
|
||||
}
|
||||
|
||||
function getRecipientContact(item: NotifyDetail): string {
|
||||
return item.toUser?.phoneNo || item.sendTo || "-";
|
||||
}
|
||||
|
||||
function getReadText(item: NotifyDetail): string {
|
||||
function getStatusText(item: NotifyDetail): string {
|
||||
if (isCancelable(item)) {
|
||||
return "待发送";
|
||||
}
|
||||
@@ -138,7 +144,7 @@ function getReadText(item: NotifyDetail): string {
|
||||
return item.readAt ? "已读" : "未读";
|
||||
}
|
||||
|
||||
function getReadTheme(item: NotifyDetail): NotifyTagTheme {
|
||||
function getStatusTheme(item: NotifyDetail): NotifyTagTheme {
|
||||
if (isCancelable(item)) {
|
||||
return "warning";
|
||||
}
|
||||
@@ -148,10 +154,6 @@ function getReadTheme(item: NotifyDetail): NotifyTagTheme {
|
||||
return item.readAt ? "primary" : "default";
|
||||
}
|
||||
|
||||
function getReadTime(item: NotifyDetail): string {
|
||||
return item.readAt ? `已读 ${Time.toDateTime(item.readAt)}` : "未读";
|
||||
}
|
||||
|
||||
// ---------- 生命周期 ----------
|
||||
|
||||
watch(() => route.params.id, async () => {
|
||||
|
||||
Reference in New Issue
Block a user