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