全局中文化
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<!-- 概览头部 -->
|
||||
<div class="home-header">
|
||||
<div class="header-content">
|
||||
<h1 class="welcome-title">项目总览</h1>
|
||||
<p class="page-subtitle">当前项目运行状态与关键指标</p>
|
||||
<h1 class="welcome-title">{{ TEXT.modules.projectOverview.title }}</h1>
|
||||
<p class="page-subtitle">{{ TEXT.modules.projectOverview.subtitle }}</p>
|
||||
<p class="study-info">
|
||||
<span class="study-name">{{ study.currentStudy.name }}</span>
|
||||
<span class="study-divider">/</span>
|
||||
@@ -12,7 +12,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="header-meta">
|
||||
<el-tag effect="plain" class="role-tag">角色: {{ auth.user?.role }}</el-tag>
|
||||
<el-tag effect="plain" class="role-tag">{{ TEXT.common.labels.role }}: {{ roleLabel }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="stats-grid">
|
||||
<div class="stats-item">
|
||||
<KpiCard
|
||||
title="节点完成率"
|
||||
:title="TEXT.modules.projectOverview.kpiProgress"
|
||||
:value="progress?.milestones_done ?? 0"
|
||||
:unit="` / ${progress?.milestones_total ?? 0}`"
|
||||
:subtext="milestoneCompletionRate"
|
||||
@@ -30,19 +30,19 @@
|
||||
</div>
|
||||
<div class="stats-item">
|
||||
<KpiCard
|
||||
title="逾期 AE"
|
||||
:title="TEXT.modules.projectOverview.kpiOverdueAes"
|
||||
:value="overdueAes"
|
||||
unit="例"
|
||||
subtext="需尽快跟进处理"
|
||||
:unit="TEXT.common.units.case"
|
||||
:subtext="TEXT.modules.projectOverview.kpiOverdueAesHint"
|
||||
:loading="loading.overdueAes"
|
||||
:icon="Warning"
|
||||
/>
|
||||
</div>
|
||||
<div class="stats-item">
|
||||
<KpiCard
|
||||
title="费用总额"
|
||||
:title="TEXT.modules.projectOverview.kpiFinanceTotal"
|
||||
:value="formatAmount(financeSummary?.total_amount ?? 0)"
|
||||
:subtext="`累计已支付:¥${formatAmount(financeSummary?.paid_amount ?? 0)}`"
|
||||
:subtext="`${TEXT.modules.projectOverview.kpiFinancePaid}:¥${formatAmount(financeSummary?.paid_amount ?? 0)}`"
|
||||
:loading="loading.finance"
|
||||
:icon="Money"
|
||||
/>
|
||||
@@ -53,7 +53,7 @@
|
||||
<el-alert
|
||||
v-if="overdueAes > 0"
|
||||
type="warning"
|
||||
title="存在逾期未处理事项,请及时关注项目的合规性与进度。"
|
||||
:title="TEXT.modules.projectOverview.alertWarning"
|
||||
show-icon
|
||||
:closable="false"
|
||||
class="home-alert"
|
||||
@@ -61,7 +61,7 @@
|
||||
<el-alert
|
||||
v-else
|
||||
type="success"
|
||||
title="项目运行状态良好,所有关键指标均在可控范围内。"
|
||||
:title="TEXT.modules.projectOverview.alertOk"
|
||||
show-icon
|
||||
:closable="false"
|
||||
class="home-alert"
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
|
||||
<div v-else class="empty-state-container">
|
||||
<StateEmpty description="请先在顶部选择一个当前项目" />
|
||||
<StateEmpty :description="TEXT.common.empty.selectProject" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -87,6 +87,8 @@ import KpiCard from "../components/KpiCard.vue";
|
||||
import QuickActions from "../components/QuickActions.vue";
|
||||
import { List, Warning, Money } from "@element-plus/icons-vue";
|
||||
import StateEmpty from "../components/StateEmpty.vue";
|
||||
import { displayEnum } from "../utils/display";
|
||||
import { TEXT } from "../locales";
|
||||
|
||||
const auth = useAuthStore();
|
||||
const study = useStudyStore();
|
||||
@@ -103,11 +105,13 @@ const loading = ref({
|
||||
|
||||
const milestoneCompletionRate = computed(() => {
|
||||
const total = progress.value?.milestones_total ?? 0;
|
||||
if (!total) return "暂无节点";
|
||||
if (!total) return TEXT.modules.projectOverview.noMilestones;
|
||||
const rate = (progress.value?.milestones_done ?? 0) / total;
|
||||
return `总体进度: ${(rate * 100).toFixed(0)}%`;
|
||||
return TEXT.modules.projectOverview.progressLabel.replace("{rate}", `${(rate * 100).toFixed(0)}%`);
|
||||
});
|
||||
|
||||
const roleLabel = computed(() => displayEnum(TEXT.enums.userRole, auth.user?.role));
|
||||
|
||||
const formatAmount = (val: number) => {
|
||||
return new Intl.NumberFormat('zh-CN', { minimumFractionDigits: 2 }).format(val);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user