全局中文化
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
<el-dropdown trigger="click" class="study-selector-dropdown" @command="onCommand">
|
||||
<div class="selector-trigger">
|
||||
<el-icon class="trigger-icon"><OfficeBuilding /></el-icon>
|
||||
<span class="current-study-name">{{ study.currentStudy?.name || "选择项目" }}</span>
|
||||
<span class="current-study-name">{{ study.currentStudy?.name || TEXT.common.empty.selectProject }}</span>
|
||||
<el-icon class="arrow-icon"><ArrowDown /></el-icon>
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="study-dropdown">
|
||||
<el-dropdown-item v-if="loading" disabled>
|
||||
<el-icon><Loading /></el-icon>加载项目中...
|
||||
<el-icon><Loading /></el-icon>{{ TEXT.common.loading }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-else-if="!studies.length" disabled>暂无可用项目</el-dropdown-item>
|
||||
<el-dropdown-item v-else-if="!studies.length" disabled>{{ TEXT.common.empty.noData }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-for="item in studies"
|
||||
:key="item.id"
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided command="clear" class="danger-item">
|
||||
<el-icon><Close /></el-icon>退出当前项目
|
||||
<el-icon><Close /></el-icon>{{ TEXT.common.actions.exitProject }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
@@ -38,6 +38,7 @@ import { useStudyStore } from "../store/study";
|
||||
import { fetchStudies } from "../api/studies";
|
||||
import type { Study } from "../types/api";
|
||||
import { OfficeBuilding, ArrowDown, Close, Loading } from "@element-plus/icons-vue";
|
||||
import { TEXT } from "../locales";
|
||||
|
||||
const router = useRouter();
|
||||
const study = useStudyStore();
|
||||
@@ -50,7 +51,7 @@ const loadStudies = async () => {
|
||||
const { data } = await fetchStudies();
|
||||
studies.value = data.items || [];
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.response?.data?.message || "项目列表加载失败");
|
||||
ElMessage.error(e?.response?.data?.message || TEXT.common.messages.loadFailed);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user