feat(ui): 国际化适配完成
parent
8b54b73b1d
commit
6d586f4d5b
|
|
@ -12,35 +12,35 @@
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeMainMenu === '/application' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeMainMenu === '/application' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
AI应用
|
{{ menuText.aiApplication }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/mindmap"
|
to="/mindmap"
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeMainMenu === '/mindmap' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeMainMenu === '/mindmap' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
思维导图
|
{{ menuText.mindmap }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/knowledge"
|
to="/knowledge"
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeMainMenu === '/knowledge' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeMainMenu === '/knowledge' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
知识库
|
{{ menuText.knowledge }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/tool"
|
to="/tool"
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeMainMenu === '/tool' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeMainMenu === '/tool' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
工具管理
|
{{ menuText.toolManagement }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/model"
|
to="/model"
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeMainMenu === '/model' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeMainMenu === '/model' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
模型管理
|
{{ menuText.modelManagement }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
style="display: block; padding: 10px 16px; border-radius: 8px; text-decoration: none; color: #333; font-size: 14px;"
|
||||||
:style="activeSystemMenu === '/system/user' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/user' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
用户管理
|
{{ menuText.userManagement }}
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
:style="activeSystemMenu.startsWith('/system/authorization') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu.startsWith('/system/authorization') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
@click="toggleResourceAuth"
|
@click="toggleResourceAuth"
|
||||||
>
|
>
|
||||||
<span>资源授权</span>
|
<span>{{ menuText.resourceAuthorization }}</span>
|
||||||
<span>{{ resourceAuthExpanded ? '▾' : '▸' }}</span>
|
<span>{{ resourceAuthExpanded ? '▾' : '▸' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -71,28 +71,28 @@
|
||||||
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
||||||
:style="activeSystemMenu === '/system/authorization/application' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/authorization/application' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
AI应用
|
{{ menuText.aiApplication }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/system/authorization/knowledge"
|
to="/system/authorization/knowledge"
|
||||||
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
||||||
:style="activeSystemMenu === '/system/authorization/knowledge' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/authorization/knowledge' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
知识库
|
{{ menuText.knowledge }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/system/authorization/tool"
|
to="/system/authorization/tool"
|
||||||
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
||||||
:style="activeSystemMenu === '/system/authorization/tool' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/authorization/tool' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
工具管理
|
{{ menuText.toolManagement }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link
|
<router-link
|
||||||
to="/system/authorization/model"
|
to="/system/authorization/model"
|
||||||
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
||||||
:style="activeSystemMenu === '/system/authorization/model' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/authorization/model' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
模型管理
|
{{ menuText.modelManagement }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
:style="activeSystemMenu.startsWith('/system/email') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu.startsWith('/system/email') ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
@click="toggleSystemSettings"
|
@click="toggleSystemSettings"
|
||||||
>
|
>
|
||||||
<span>系统设置</span>
|
<span>{{ menuText.systemSettings }}</span>
|
||||||
<span>{{ systemSettingsExpanded ? '▾' : '▸' }}</span>
|
<span>{{ systemSettingsExpanded ? '▾' : '▸' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
style="display: block; padding: 8px 16px; border-radius: 8px; text-decoration: none; color: #666; font-size: 13px;"
|
||||||
:style="activeSystemMenu === '/system/email' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
:style="activeSystemMenu === '/system/email' ? { backgroundColor: '#e6f0ff', color: '#1890ff' } : {}"
|
||||||
>
|
>
|
||||||
邮件设置
|
{{ menuText.emailSettings }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -131,9 +131,51 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
import UserAvatar from '@/layout/layout-header/avatar/index.vue'
|
import UserAvatar from '@/layout/layout-header/avatar/index.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const { locale } = useI18n({ useScope: 'global' })
|
||||||
|
|
||||||
|
const menuText = computed(() => {
|
||||||
|
if (locale.value === 'en-US') {
|
||||||
|
return {
|
||||||
|
aiApplication: 'AI Applications',
|
||||||
|
mindmap: 'Mind Map',
|
||||||
|
knowledge: 'Knowledge Base',
|
||||||
|
toolManagement: 'Tool Management',
|
||||||
|
modelManagement: 'Model Management',
|
||||||
|
userManagement: 'User Management',
|
||||||
|
resourceAuthorization: 'Resource Authorization',
|
||||||
|
systemSettings: 'System Settings',
|
||||||
|
emailSettings: 'Email Settings',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (locale.value === 'zh-Hant') {
|
||||||
|
return {
|
||||||
|
aiApplication: 'AI應用',
|
||||||
|
mindmap: '思維導圖',
|
||||||
|
knowledge: '知識庫',
|
||||||
|
toolManagement: '工具管理',
|
||||||
|
modelManagement: '模型管理',
|
||||||
|
userManagement: '用戶管理',
|
||||||
|
resourceAuthorization: '資源授權',
|
||||||
|
systemSettings: '系統設定',
|
||||||
|
emailSettings: '郵件設定',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
aiApplication: 'AI应用',
|
||||||
|
mindmap: '思维导图',
|
||||||
|
knowledge: '知识库',
|
||||||
|
toolManagement: '工具管理',
|
||||||
|
modelManagement: '模型管理',
|
||||||
|
userManagement: '用户管理',
|
||||||
|
resourceAuthorization: '资源授权',
|
||||||
|
systemSettings: '系统设置',
|
||||||
|
emailSettings: '邮件设置',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const isSystemManagement = computed(() => {
|
const isSystemManagement = computed(() => {
|
||||||
const path = route.path
|
const path = route.path
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<router-link v-if="isSystemManagement" to="/application" class="back-link">
|
<router-link v-if="isSystemManagement" to="/application" class="back-link">
|
||||||
<span class="back-icon">←</span>
|
<span class="back-icon">←</span>
|
||||||
返回工作空间
|
{{menuText.back}}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -19,7 +19,25 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
import ChinaMobileIcon from '@/components/china-mobile-icon/index.vue'
|
import ChinaMobileIcon from '@/components/china-mobile-icon/index.vue'
|
||||||
|
const { locale } = useI18n({ useScope: 'global' })
|
||||||
|
const menuText = computed(() => {
|
||||||
|
if (locale.value === 'en-US') {
|
||||||
|
return {
|
||||||
|
back: 'Return to workspace',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (locale.value === 'zh-Hant') {
|
||||||
|
return {
|
||||||
|
back: '返回工作空間',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
back: '返回工作空间',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
title: 'APP',
|
title: 'AI Applications',
|
||||||
createApplication: 'Create Simple APP',
|
createApplication: 'Create Simple APP',
|
||||||
createWorkFlowApplication: 'Create Workflow APP',
|
createWorkFlowApplication: 'Create Workflow APP',
|
||||||
importApplication: 'Import APP',
|
importApplication: 'Import APP',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
title: 'Tool',
|
title: 'Tool Management',
|
||||||
all: 'All',
|
all: 'All',
|
||||||
createTool: 'Create Tool',
|
createTool: 'Create Tool',
|
||||||
editTool: 'Edit Tool',
|
editTool: 'Edit Tool',
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import tool from '@/api/tool/tool'
|
import tool from '@/api/tool/tool'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: '应用',
|
title: 'AI应用',
|
||||||
createApplication: '创建简易应用',
|
createApplication: '创建简易应用',
|
||||||
createWorkFlowApplication: '创建高级编排应用',
|
createWorkFlowApplication: '创建高级编排应用',
|
||||||
importApplication: '导入应用',
|
importApplication: '导入应用',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
title: '工具',
|
title: '工具管理',
|
||||||
all: '全部',
|
all: '全部',
|
||||||
createTool: '创建工具',
|
createTool: '创建工具',
|
||||||
editTool: '编辑工具',
|
editTool: '编辑工具',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
title: '應用',
|
title: 'AI應用',
|
||||||
createApplication: '建立簡易應用',
|
createApplication: '建立簡易應用',
|
||||||
createWorkFlowApplication: '建立進階編排應用',
|
createWorkFlowApplication: '建立進階編排應用',
|
||||||
importApplication: '匯入應用',
|
importApplication: '匯入應用',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
title: '工具',
|
title: '工具管理',
|
||||||
all: '全部',
|
all: '全部',
|
||||||
createTool: '建立工具',
|
createTool: '建立工具',
|
||||||
editTool: '編輯工具',
|
editTool: '編輯工具',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue