From 76ad26281ba3cad7315670cfa6579c5b59009ea2 Mon Sep 17 00:00:00 2001 From: digua Date: Fri, 10 Apr 2026 01:36:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=B3=E7=B3=BB=E5=89=A9=E4=BD=99?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AE=8C=E6=88=90=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US/views.json | 20 +- src/i18n/locales/ja-JP/views.json | 20 +- src/i18n/locales/zh-CN/views.json | 20 +- src/i18n/locales/zh-TW/views.json | 20 +- .../components/view/RelationshipView.vue | 209 +++++++++++++----- 5 files changed, 234 insertions(+), 55 deletions(-) diff --git a/src/i18n/locales/en-US/views.json b/src/i18n/locales/en-US/views.json index 4e1c5e4b..43d8ccd1 100644 --- a/src/i18n/locales/en-US/views.json +++ b/src/i18n/locales/en-US/views.json @@ -69,21 +69,39 @@ "title": "Overall Summary" }, "monthly": { - "title": "Monthly Breakdown" + "title": "Monthly Breakdown", + "totalSessionsPrefix": "Total", + "totalSessionsSuffix": "sessions" }, "trend": { "title": "Initiative Trend", "hint": "Blue line shows {name}'s monthly initiative ratio; 50% line is the balanced baseline" }, + "hero": { + "monthPart": "{month}/{year}", + "timeRange": { + "singleMonth": "In {month},", + "range": "From {start} to {end}," + }, + "totalSessionsPrefix": "You had", + "totalSessionsSuffix": "conversations in total", + "initiativePrefix": "", + "initiativeByPrefix": "of opening messages were started by", + "initiativeBySuffix": "", + "initiateTimes": "starts" + }, "initiator": "Start Conversations", "closer": "End Conversations", + "closerTitle": "Conversation Closer", "closerHint": "Shows who sends the last message when a topic ends.", "initiated": "Initiated {count} times", "closed": "Closed {count} times", "totalSessions": "{count} total sessions", "times": " times", "noActivity": "No activity this month", + "watermarkReport": "Relationship Report", "monthFormat": "{month}/{year}", + "monthShortFormat": "{month}", "monthDetail": "Init {init} / Close {close}", "iceBreaker": { "title": "Ice Breaker", diff --git a/src/i18n/locales/ja-JP/views.json b/src/i18n/locales/ja-JP/views.json index 259a7e07..2f1c8cc7 100644 --- a/src/i18n/locales/ja-JP/views.json +++ b/src/i18n/locales/ja-JP/views.json @@ -69,21 +69,39 @@ "title": "全体概要" }, "monthly": { - "title": "月別明細" + "title": "月別明細", + "totalSessionsPrefix": "会話", + "totalSessionsSuffix": "回" }, "trend": { "title": "主動性の推移", "hint": "青い線は {name} の月別主動発起率。50% 線がバランス基準です" }, + "hero": { + "monthPart": "{year}年{month}月", + "timeRange": { + "singleMonth": "{month}では、", + "range": "{start}から{end}までの期間では、" + }, + "totalSessionsPrefix": "2人の会話は合計", + "totalSessionsSuffix": "回", + "initiativePrefix": "", + "initiativeByPrefix": "の話題の切り出しは", + "initiativeBySuffix": "から始まりました", + "initiateTimes": "回発起" + }, "initiator": "話題を始める", "closer": "話題を終える", + "closerTitle": "会話の締め役", "closerHint": "話題が終わるときに最後に発言した人を集計します。", "initiated": "{count} 回発起", "closed": "{count} 回終了", "totalSessions": "合計 {count} セッション", "times": "回", "noActivity": "今月はやり取りなし", + "watermarkReport": "関係レポート", "monthFormat": "{year}年{month}月", + "monthShortFormat": "{month}月", "monthDetail": "発起 {init} / 終了 {close}", "iceBreaker": { "title": "アイスブレイカー", diff --git a/src/i18n/locales/zh-CN/views.json b/src/i18n/locales/zh-CN/views.json index edc5a058..f24bbe3f 100644 --- a/src/i18n/locales/zh-CN/views.json +++ b/src/i18n/locales/zh-CN/views.json @@ -69,21 +69,39 @@ "title": "整体概览" }, "monthly": { - "title": "月度明细" + "title": "月度明细", + "totalSessionsPrefix": "共对话", + "totalSessionsSuffix": "次" }, "trend": { "title": "主动性趋势", "hint": "蓝色线为 {name} 的月度主动发起占比,50% 线为均衡基准" }, + "hero": { + "monthPart": "{year}年{month}月", + "timeRange": { + "singleMonth": "在 {month} 中,", + "range": "在 {start} 至 {end} 期间," + }, + "totalSessionsPrefix": "你们共进行了", + "totalSessionsSuffix": "次对话", + "initiativePrefix": "其中有", + "initiativeByPrefix": "的开场白由", + "initiativeBySuffix": "发起", + "initiateTimes": "次发起" + }, "initiator": "发起话题", "closer": "结束话题", + "closerTitle": "话题终结者", "closerHint": "统计话题结束时最后发言的人。", "initiated": "发起 {count} 次", "closed": "结束 {count} 次", "totalSessions": "共 {count} 次会话", "times": "次", "noActivity": "本月无互动", + "watermarkReport": "关系报告", "monthFormat": "{year}年{month}月", + "monthShortFormat": "{month}月", "monthDetail": "发起 {init} / 结束 {close}", "iceBreaker": { "title": "破冰达人", diff --git a/src/i18n/locales/zh-TW/views.json b/src/i18n/locales/zh-TW/views.json index 9af9083e..190ac952 100644 --- a/src/i18n/locales/zh-TW/views.json +++ b/src/i18n/locales/zh-TW/views.json @@ -69,21 +69,39 @@ "title": "整體概覽" }, "monthly": { - "title": "月度明細" + "title": "月度明細", + "totalSessionsPrefix": "共對話", + "totalSessionsSuffix": "次" }, "trend": { "title": "主動性趨勢", "hint": "藍色線為 {name} 的月度主動發起佔比,50% 線為均衡基準" }, + "hero": { + "monthPart": "{year}年{month}月", + "timeRange": { + "singleMonth": "在 {month} 期間,", + "range": "在 {start} 至 {end} 期間," + }, + "totalSessionsPrefix": "你們共進行了", + "totalSessionsSuffix": "次對話", + "initiativePrefix": "其中有", + "initiativeByPrefix": "的開場白由", + "initiativeBySuffix": "發起", + "initiateTimes": "次發起" + }, "initiator": "發起話題", "closer": "結束話題", + "closerTitle": "話題終結者", "closerHint": "統計話題結束時最後發言的人。", "initiated": "發起 {count} 次", "closed": "結束 {count} 次", "totalSessions": "共 {count} 次對話", "times": "次", "noActivity": "本月無互動", + "watermarkReport": "關係報告", "monthFormat": "{year}年{month}月", + "monthShortFormat": "{month}月", "monthDetail": "發起 {init} / 結束 {close}", "iceBreaker": { "title": "破冰達人", diff --git a/src/pages/private-chat/components/view/RelationshipView.vue b/src/pages/private-chat/components/view/RelationshipView.vue index 0b2070c6..752780d6 100644 --- a/src/pages/private-chat/components/view/RelationshipView.vue +++ b/src/pages/private-chat/components/view/RelationshipView.vue @@ -103,8 +103,18 @@ const timeRangeString = computed(() => { const sorted = [...stats.value.months].sort((a, b) => a.month.localeCompare(b.month)) const first = sorted[0].month const last = sorted[sorted.length - 1].month - if (first === last) return `在 ${first.replace('-', '年')}月 中,` - return `在 ${first.replace('-', '年')}月 至 ${last.replace('-', '年')}月 期间,` + const [firstYear, firstMonth] = first.split('-') + const [lastYear, lastMonth] = last.split('-') + const firstMonthText = t('views.relationship.hero.monthPart', { + year: firstYear, + month: Number.parseInt(firstMonth, 10), + }) + const lastMonthText = t('views.relationship.hero.monthPart', { + year: lastYear, + month: Number.parseInt(lastMonth, 10), + }) + if (first === last) return t('views.relationship.hero.timeRange.singleMonth', { month: firstMonthText }) + return t('views.relationship.hero.timeRange.range', { start: firstMonthText, end: lastMonthText }) }) function getOverallLabel(): string { @@ -231,12 +241,12 @@ function getMonthCloseRatio(month: RelationshipMonthStats): number { function formatMonth(monthStr: string): string { const [year, month] = monthStr.split('-') - return t('views.relationship.monthFormat', { year, month: parseInt(month) }) + return t('views.relationship.monthFormat', { year, month: Number.parseInt(month, 10) }) } function formatMonthShort(monthStr: string): string { const parts = monthStr.split('-') - return `${parts[1]}月` + return t('views.relationship.monthShortFormat', { month: Number.parseInt(parts[1], 10) }) } function getIceBreakCount(memberId?: number): number { @@ -344,23 +354,33 @@ function formatDuration(seconds: number): string {

- 你们共进行了 + + {{ t('views.relationship.hero.totalSessionsPrefix') }} + {{ stats.totalSessions }} - 次对话 + + {{ t('views.relationship.hero.totalSessionsSuffix') }} +
- 其中有 + + {{ t('views.relationship.hero.initiativePrefix') }} + {{ overallInitiateRatio >= 50 ? overallInitiateRatio : 100 - overallInitiateRatio }}% - 的开场白由 + + {{ t('views.relationship.hero.initiativeByPrefix') }} + {{ overallInitiateRatio >= 50 ? memberA?.name : memberB?.name }} - 发起 + + {{ t('views.relationship.hero.initiativeBySuffix') }} +
@@ -376,7 +396,9 @@ function formatDuration(seconds: number): string {
{{ memberA?.totalInitiateCount }}
-
次发起
+
+ {{ t('views.relationship.hero.initiateTimes') }} +
{{ memberB?.totalInitiateCount }}
-
次发起
+
+ {{ t('views.relationship.hero.initiateTimes') }} +
@@ -422,7 +446,7 @@ function formatDuration(seconds: number): string {
ChatLab
- Relationship Report + + {{ t('views.relationship.watermarkReport') }} + @@ -555,11 +581,17 @@ function formatDuration(seconds: number): string { {{ getMonthLabel(month) }} - +
- 共对话 - {{ month.totalSessions }} - + + {{ t('views.relationship.monthly.totalSessionsPrefix') }} + + + {{ month.totalSessions }} + + + {{ t('views.relationship.monthly.totalSessionsSuffix') }} +
@@ -567,88 +599,163 @@ function formatDuration(seconds: number): string {
-
+
- - {{ t('views.relationship.initiator') }} + + + {{ t('views.relationship.initiator') }} +
- {{ memberA?.name }} - {{ month.members.find(m => m.memberId === memberA?.memberId)?.initiateCount ?? 0 }} + + {{ memberA?.name }} + + + {{ month.members.find((m) => m.memberId === memberA?.memberId)?.initiateCount ?? 0 }} +
- {{ memberB?.name }} - {{ month.members.find(m => m.memberId === memberB?.memberId)?.initiateCount ?? 0 }} + + {{ memberB?.name }} + + + {{ month.members.find((m) => m.memberId === memberB?.memberId)?.initiateCount ?? 0 }} +
-
-
+
+
-
+
- - {{ t('views.relationship.closer') }} + + + {{ t('views.relationship.closer') }} +
- {{ memberA?.name }} - {{ month.members.find(m => m.memberId === memberA?.memberId)?.closeCount ?? 0 }} + + {{ memberA?.name }} + + + {{ month.members.find((m) => m.memberId === memberA?.memberId)?.closeCount ?? 0 }} +
- {{ memberB?.name }} - {{ month.members.find(m => m.memberId === memberB?.memberId)?.closeCount ?? 0 }} + + {{ memberB?.name }} + + + {{ month.members.find((m) => m.memberId === memberB?.memberId)?.closeCount ?? 0 }} +
-
-
+
+
-
+
- - {{ t('views.relationship.responseLatency.title') }} + + + {{ t('views.relationship.responseLatency.title') }} +
- {{ memberA?.name }} - {{ getMemberResponseLatencyText(month.month, memberA?.memberId) }} + + {{ memberA?.name }} + + + {{ getMemberResponseLatencyText(month.month, memberA?.memberId) }} +
- {{ memberB?.name }} - {{ getMemberResponseLatencyText(month.month, memberB?.memberId) }} + + {{ memberB?.name }} + + + {{ getMemberResponseLatencyText(month.month, memberB?.memberId) }} +
-
+
- - {{ t('views.relationship.perseverance.title') }} + + + {{ t('views.relationship.perseverance.title') }} +
- {{ memberA?.name }} - {{ getMemberPerseveranceText(month.month, memberA?.memberId) }} + + {{ memberA?.name }} + + + {{ getMemberPerseveranceText(month.month, memberA?.memberId) }} +
- {{ memberB?.name }} - {{ getMemberPerseveranceText(month.month, memberB?.memberId) }} + + {{ memberB?.name }} + + + {{ getMemberPerseveranceText(month.month, memberB?.memberId) }} +
- -
+ +
{{ t('views.relationship.noActivity') }}