From d00c8cf3eb4085516006441b9be27de5db793a15 Mon Sep 17 00:00:00 2001
From: hzm <934585316@qq.com>
Date: Thu, 12 Mar 2026 20:22:09 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E9=83=A8=E5=88=86=E4=BC=B0=E5=80=BC?=
=?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=86=85=E5=AE=B9=E5=8E=BB=E9=99=A4=E5=B9=B4?=
=?UTF-8?q?=E4=BB=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/components/CloudConfigModal.jsx | 4 ++--
app/components/FundCard.jsx | 17 +++++++++++++-
app/components/MobileFundTable.jsx | 16 +++++++++----
app/components/PcFundTable.jsx | 36 +++++++++++++++++++----------
4 files changed, 54 insertions(+), 19 deletions(-)
diff --git a/app/components/CloudConfigModal.jsx b/app/components/CloudConfigModal.jsx
index d62781a..da39be0 100644
--- a/app/components/CloudConfigModal.jsx
+++ b/app/components/CloudConfigModal.jsx
@@ -41,10 +41,10 @@ export default function CloudConfigModal({ onConfirm, onCancel, type = 'empty' }
: '是否将本地配置同步到云端?'}
-
diff --git a/app/components/FundCard.jsx b/app/components/FundCard.jsx
index a929907..75fd361 100644
--- a/app/components/FundCard.jsx
+++ b/app/components/FundCard.jsx
@@ -34,6 +34,17 @@ const getBrowserTimeZone = () => {
const TZ = getBrowserTimeZone();
const toTz = (input) => (input ? dayjs.tz(input, TZ) : dayjs().tz(TZ));
+const formatDisplayDate = (value) => {
+ if (!value) return '-';
+
+ const d = toTz(value);
+ if (!d.isValid()) return value;
+
+ const hasTime = /[T\s]\d{2}:\d{2}/.test(String(value));
+
+ return hasTime ? d.format('MM-DD HH:mm') : d.format('MM-DD');
+};
+
export default function FundCard({
fund: f,
todayStr,
@@ -126,7 +137,11 @@ export default function FundCard({
{f.noValuation ? '净值日期' : '估值时间'}
- {f.noValuation ? (f.jzrq || '-') : (f.gztime || f.time || '-')}
+
+ {f.noValuation
+ ? formatDisplayDate(f.jzrq)
+ : formatDisplayDate(f.gztime || f.time)}
+
5 ? date.slice(5) : date;
+ const estimateNav = info.getValue();
+ const hasEstimateNav = estimateNav != null && estimateNav !== '—';
return (
- {info.getValue() ?? '—'}
+ {estimateNav ?? '—'}
- {displayDate}
+ {hasEstimateNav && displayDate && displayDate !== '-' ? (
+ {displayDate}
+ ) : null}
);
},
@@ -723,12 +727,16 @@ export default function MobileFundTable({
const time = original.estimateTime ?? '-';
const displayTime = typeof time === 'string' && time.length > 5 ? time.slice(5) : time;
const cls = isMuted ? 'muted' : value > 0 ? 'up' : value < 0 ? 'down' : '';
+ const text = info.getValue();
+ const hasText = text != null && text !== '—';
return (
- {info.getValue() ?? '—'}
+ {text ?? '—'}
- {displayTime}
+ {hasText && displayTime && displayTime !== '-' ? (
+ {displayTime}
+ ) : null}
);
},
diff --git a/app/components/PcFundTable.jsx b/app/components/PcFundTable.jsx
index 752780c..9cd8db9 100644
--- a/app/components/PcFundTable.jsx
+++ b/app/components/PcFundTable.jsx
@@ -570,7 +570,8 @@ export default function PcFundTable({
minSize: 80,
cell: (info) => {
const original = info.row.original || {};
- const date = original.latestNavDate ?? '-';
+ const rawDate = original.latestNavDate ?? '-';
+ const date = typeof rawDate === 'string' && rawDate.length > 5 ? rawDate.slice(5) : rawDate;
return (
@@ -594,15 +595,20 @@ export default function PcFundTable({
minSize: 80,
cell: (info) => {
const original = info.row.original || {};
- const date = original.estimateNavDate ?? '-';
+ const rawDate = original.estimateNavDate ?? '-';
+ const date = typeof rawDate === 'string' && rawDate.length > 5 ? rawDate.slice(5) : rawDate;
+ const estimateNav = info.getValue();
+ const hasEstimateNav = estimateNav != null && estimateNav !== '—';
return (
- {info.getValue() ?? '—'}
+ {estimateNav ?? '—'}
-
- {date}
-
+ {hasEstimateNav && date && date !== '-' ? (
+
+ {date}
+
+ ) : null}
);
},
@@ -619,7 +625,8 @@ export default function PcFundTable({
cell: (info) => {
const original = info.row.original || {};
const value = original.yesterdayChangeValue;
- const date = original.yesterdayDate ?? '-';
+ const rawDate = original.yesterdayDate ?? '-';
+ const date = typeof rawDate === 'string' && rawDate.length > 5 ? rawDate.slice(5) : rawDate;
const cls = value > 0 ? 'up' : value < 0 ? 'down' : '';
return (
@@ -646,16 +653,21 @@ export default function PcFundTable({
const original = info.row.original || {};
const value = original.estimateChangeValue;
const isMuted = original.estimateChangeMuted;
- const time = original.estimateTime ?? '-';
+ const rawTime = original.estimateTime ?? '-';
+ const time = typeof rawTime === 'string' && rawTime.length > 5 ? rawTime.slice(5) : rawTime;
const cls = isMuted ? 'muted' : value > 0 ? 'up' : value < 0 ? 'down' : '';
+ const text = info.getValue();
+ const hasText = text != null && text !== '—';
return (
- {info.getValue() ?? '—'}
+ {text ?? '—'}
-
- {time}
-
+ {hasText && time && time !== '-' ? (
+
+ {time}
+
+ ) : null}
);
},