fix sendAt style

This commit is contained in:
Timi
2026-08-28 22:52:41 +08:00
parent 5ff6905c8f
commit 551917a5de
+6 -45
View File
@@ -17,7 +17,7 @@
class="item"
v-entrance-transition="index * 30"
>
<t-cell :description="getSendTime(item)" arrow @click="toDetail(item)">
<t-cell arrow @click="toDetail(item)">
<template #leftIcon>
<div class="icon" :class="{ scheduled: isScheduled(item) }">
<t-icon :name="isScheduled(item) ? 'time' : 'notification'" size="1.25rem" />
@@ -28,6 +28,10 @@
<span v-text="getSubject(item)" />
</div>
</template>
<template #description>
<span v-if="isScheduled(item)" v-text="`定时 ${Time.toDateTime(item.sendAt)}`" />
<pass-time-label v-else :timestamp="item.sendAt || item.createdAt" underline />
</template>
<template #note>
<t-tag size="small" :theme="getStatusTheme(item)" :content="getStatusText(item)" />
</template>
@@ -55,7 +59,7 @@
</template>
<script setup lang="ts">
import { Time } from "timi-web";
import { PassTimeLabel, Time } from "timi-web";
import { NotifyAPI, type Notify, type NotifyManagementItem, type Page, type PageResult, useUserStore } from "timi-web-api";
import { DialogPlugin } from "tdesign-mobile-vue";
import { Message } from "@/utils/message";
@@ -140,13 +144,6 @@ function getStatusTheme(item: NotifyManagementItem): NotifyTagTheme {
return "success";
}
function getSendTime(item: NotifyManagementItem): string {
if (isScheduled(item)) {
return `定时 ${Time.toDateTime(item.sendAt)}`;
}
return Time.toPassedDateTime(item.sendAt || item.createdAt) || "-";
}
function canCancel(item: NotifyManagementItem): boolean {
return canCancelNotify.value && isScheduled(item);
}
@@ -287,21 +284,6 @@ onUnmounted(() => navBarStore.clearRight());
border-radius: 0;
}
:deep(.t-cell__title) {
flex: 1 1 0;
min-width: 0;
}
:deep(.t-cell__description) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
:deep(.t-cell__note) {
white-space: nowrap;
}
.icon {
width: 3.5rem;
height: 3.5rem;
@@ -317,27 +299,6 @@ onUnmounted(() => navBarStore.clearRight());
background: #fef3c7;
}
}
.title,
.description {
display: flex;
align-items: center;
}
.title {
gap: .5rem;
> span:first-child {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.description {
gap: .75rem;
}
}
}
}