style: 快速开站多语言翻译

This commit is contained in:
TsMask
2024-05-21 17:10:45 +08:00
parent 814b7b0058
commit 7c78eab431
5 changed files with 111 additions and 41 deletions

View File

@@ -1583,7 +1583,7 @@ export default {
userWork:'User position',
userWorkPlease: 'Please select user post',
userTip:'User Description',
loginPwd:'Login password',
loginPwd:'Password',
updateSure:'Do you want to update existing data',
downloadObj:'Download Tpl',
importTitle:'User Import',
@@ -1866,6 +1866,37 @@ export default {
exportOk: "Completed export",
typeDataErr: "Failed to get dictionary type information",
},
quickStart: {
start: 'Start Setup',
skip: 'Skip',
finish: 'Complete Setup',
stepPrev: 'Previous',
stepNext: 'Next',
sysTitle: 'System Configuration',
sysAdmin: 'Administrator',
sysInfo: 'System Info',
sysLogo: 'System Logo',
sysLogoTip: 'Show the image to the system logo area to see the effect, please use a transparent background, the size of the proportion to adapt to the size of the area',
sysName: 'System Name',
sysNameTip: 'Limit system name to 20 characters in length',
sysUploadLogo: 'Confirmation of uploading the system logo file?',
sysUploadOk: 'File uploaded successfully, please save the information',
sysSave: 'Save',
sysSaveOk: 'Info saved successfully!',
sysPrevTip: 'Confirmed to go back to the previous step?',
sysNextNe: 'Confirming that you want to do a network element installation?',
sysNextDone: 'Confirmed to skip the network element installation?',
doneTitle: "Completing the Configuration",
doneTip: 'Please enter the system and configure it as appropriate.',
doneNETitle: 'Configuration of the network element installation has been performed',
doneNEDesc: 'If there are some abnormal network elements, please enter the system and configure it by yourself.',
doneSkipTitle: 'No installation configuration of network elements',
doneSkipDesc: 'The system will default to the initial network element information, you can modify the information yourself',
donePrevTip: 'Confirmed to go back to the previous step?',
doneOkTip: 'Confirm that you have completed the setup and started using it?',
},
},
mmlManage: {
cmdTitle: "Command Navigator",

View File

@@ -1583,7 +1583,7 @@ export default {
userWork:'用户岗位',
userWorkPlease: '请选择用户岗位',
userTip:'用户说明',
loginPwd:'登密码',
loginPwd:'登密码',
updateSure:'是否更新已经存在的数据',
downloadObj:'下载模板',
importTitle:'用户导入',
@@ -1866,6 +1866,37 @@ export default {
exportOk: "已完成导出",
typeDataErr: "获取字典类型信息失败",
},
quickStart: {
start: '开始设置',
skip: '跳过',
finish: '完成设置',
stepPrev: '上一步',
stepNext: '下一步',
sysTitle: '系统配置',
sysAdmin: '管理员',
sysInfo: '系统信息',
sysLogo: '系统LOGO',
sysLogoTip: '将图片展示到系统LOGO区域查看效果请使用透明背景尺寸比例适应区域大小',
sysName: '系统名称',
sysNameTip: '系统名称限制20个字符长度',
sysUploadLogo: '确认要上传系统LOGO文件吗?',
sysUploadOk: '文件上传成功,请进行保存信息',
sysSave: '保存',
sysSaveOk: '信息保存成功!',
sysPrevTip: '确认要返回上一个步骤吗?',
sysNextNe: '确认要进行网元安装吗?',
sysNextDone: '确认要跳过网元安装吗?',
doneTitle: "完成配置",
doneTip: '请进入系统后,根据情况进行更多相关配置',
doneNETitle: '已经进行网元安装配置',
doneNEDesc: '如有部分异常网元请进入系统后自行配置',
doneSkipTitle: '未进行安装配置网元',
doneSkipDesc: '系统将会默认初始网元信息,可自行修改信息',
donePrevTip: '确认要返回上一个步骤吗?',
doneOkTip: '确认完成设置并开始使用吗?',
},
},
mmlManage: {
cmdTitle: "命令导航",

View File

@@ -19,16 +19,16 @@ function fnGetList() {
if (!stepState.setupNE) {
infoList.value.push({
type: 'error',
title: '未进行安装配置网元',
description: '系统将会默认初始网元信息,可自行修改信息',
title: t('views.system.quickStart.doneSkipTitle'),
description: t('views.system.quickStart.doneSkipDesc'),
});
return;
}
infoList.value.push({
type: 'warning',
title: '已经进行网元安装配置',
description: '如有部分异常网元请进入系统后自行配置',
title: t('views.system.quickStart.doneNETitle'),
description: t('views.system.quickStart.doneNEDesc'),
});
}
@@ -36,7 +36,7 @@ function fnGetList() {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要返回上一步吗?',
content: t('views.system.quickStart.donePrevTip'),
onOk() {
let stepName = 'NeInfoSoftwareLicense';
if (!stepState.setupNE) {
@@ -51,7 +51,7 @@ function fnStepPrev() {
function fnGuideDone() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认开始使用吗?',
content: t('views.system.quickStart.doneOkTip'),
onOk() {
bootloaderDone()
.then(res => {
@@ -75,16 +75,16 @@ onMounted(() => {
<template>
<a-result
status="success"
title="完成配置"
sub-title="请进入系统后根据情况进行更多相关配置"
:title="t('views.system.quickStart.doneTitle')"
:sub-title="t('views.system.quickStart.doneTip')"
>
<template #extra>
<a-space direction="vertical" style="width: 40%">
<a-button block type="primary" @click="fnGuideDone()">
开始使用
{{ t('views.system.quickStart.finish') }}
</a-button>
<a-button block type="default" @click="fnStepPrev()">
返回上一步
{{ t('views.system.quickStart.stepPrev') }}
</a-button>
</a-space>
</template>

View File

@@ -1,12 +1,12 @@
<script setup lang="ts">
import { onMounted } from 'vue';
import { fnToStepName } from '../hooks/useStep';
import { useRouter } from 'vue-router';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { TOKEN_RESPONSE_FIELD } from '@/constants/token-constants';
import { getToken, setToken } from '@/plugins/auth-token';
import { useRouter } from 'vue-router';
import useI18n from '@/hooks/useI18n';
import { bootloaderStart } from '@/api/system/quick-start/bootloader';
import useI18n from '@/hooks/useI18n';
import { fnToStepName } from '../hooks/useStep';
const { t, changeLocale, optionsLocale } = useI18n();
const router = useRouter();
@@ -40,7 +40,7 @@ onMounted(() => {
<div class="ne-main">
<a-space direction="vertical" style="width: 30%">
<a-button block type="primary" @click="fnToStepName('SystemConfig')">
开始
{{ t('views.system.quickStart.start') }}
</a-button>
</a-space>
</div>

View File

@@ -67,14 +67,11 @@ function fnBeforeUpload(file: FileType) {
if (state.confirmLoading) return false;
const isJpgOrPng = ['image/jpeg', 'image/png'].includes(file.type);
if (!isJpgOrPng) {
message.error(
t('views.system.setting.uploadFormat', { format: 'jpg、png' }),
3
);
message.error(`${t('components.UploadModal.onlyAllow')} jpg、png`, 3);
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error(t('views.system.setting.uploadSize', { size: 2 }), 3);
message.error(`${t('components.UploadModal.allowFilter')} 2MB`, 3);
}
return isJpgOrPng && isLt2M;
}
@@ -83,7 +80,7 @@ function fnBeforeUpload(file: FileType) {
function fnUpload(up: UploadRequestOption) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.system.setting.sysLogoTipContentUpload'),
content: t('views.system.quickStart.sysUploadLogo'),
onOk() {
// 发送请求
const hide = message.loading(t('common.loading'), 0);
@@ -95,7 +92,7 @@ function fnUpload(up: UploadRequestOption) {
state.confirmLoading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.system.setting.uploadSuccess'), 3);
message.success(t('views.system.quickStart.sysUploadOk'), 3);
state.filePath = res.data.fileName;
// 兼容旧前端可改配置文件
const baseUrl = import.meta.env.PROD
@@ -122,7 +119,7 @@ function fnSaveAcount() {
bootloaderAccount(state.username, state.password).then(res => {
console.log(res);
if (res.code === RESULT_CODE_SUCCESS) {
message.success('保存成功!');
message.success(t('common.operateOk'));
} else {
message.warning(res.msg);
}
@@ -162,7 +159,7 @@ function fnSaveSystem() {
state.confirmLoading = true;
Promise.all(reqArr).then(resArr => {
console.log(resArr);
message.success('保存成功!');
message.success(t('views.system.quickStart.sysSaveOk'));
state.confirmLoading = false;
});
}
@@ -171,7 +168,7 @@ function fnSaveSystem() {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要返回上一步吗?',
content: t('views.system.quickStart.sysPrevTip'),
onOk() {
fnToStepName('Start');
},
@@ -183,7 +180,7 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
if (stepName === 'NeInfoConfig') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要进行网元快速安装吗?',
content: t('views.system.quickStart.sysNextNe'),
onOk() {
fnToStepName('NeInfoConfig');
},
@@ -192,7 +189,7 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
if (stepName === 'Done') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要直接使用核心网管理平台吗?',
content: t('views.system.quickStart.sysNextDone'),
onOk() {
stepState.setupNE = false;
fnToStepName('Done');
@@ -204,7 +201,7 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
<template>
<div class="ne">
<h2>系统配置</h2>
<h2>{{ t('views.system.quickStart.sysTitle') }}</h2>
<a-form
:label-col="{ span: 4 }"
@@ -212,7 +209,9 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
:wrapper-col="{ span: 10 }"
style="flex: 1"
>
<a-divider orientation="left">管理员账号</a-divider>
<a-divider orientation="left">
{{ t('views.system.quickStart.sysAdmin') }}
</a-divider>
<a-form-item :label="t('views.system.user.account')" name="username">
<a-input v-model:value="state.username" :maxlength="30">
<template #prefix>
@@ -233,14 +232,16 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
:loading="state.confirmLoading"
@click="fnSaveAcount()"
>
保存
{{ t('views.system.quickStart.sysSave') }}
</a-button>
</a-form-item>
<a-divider orientation="left">系统信息</a-divider>
<a-divider orientation="left">
{{ t('views.system.quickStart.sysInfo') }}
</a-divider>
<a-form-item
label="系统LOGO"
help="将整张图片展示到系统LOGO区域请使用透明背景尺寸比例适应区域大小"
:label="t('views.system.quickStart.sysLogo')"
:help="t('views.system.quickStart.sysLogoTip')"
:wrapper-col="{ span: 18 }"
>
<a-space direction="horizontal" :size="18">
@@ -282,7 +283,10 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
</div>
</div>
</a-form-item>
<a-form-item label="系统名称" help="系统名称限制20个字符长度">
<a-form-item
:label="t('views.system.quickStart.sysName')"
:help="t('views.system.quickStart.sysNameTip')"
>
<a-input
v-model:value="state.title"
allow-clear
@@ -307,19 +311,23 @@ function fnStepNext(stepName: 'NeInfoConfig' | 'Done') {
:loading="state.confirmLoading"
@click="fnSaveSystem()"
>
保存
{{ t('views.system.quickStart.sysSave') }}
</a-button>
</a-form-item>
</a-form>
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 上一步 </a-button>
<a-button type="dashed" @click="fnStepNext('NeInfoConfig')">
下一步
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.stepPrev') }}
</a-button>
<a-button type="primary" @click="fnStepNext('NeInfoConfig')">
{{ t('views.system.quickStart.stepNext') }}
</a-button>
<a-button type="dashed" @click="fnStepNext('Done')">
{{ t('views.system.quickStart.skip') }}
</a-button>
<a-button type="ghost" @click="fnStepNext('Done')"> 跳过 </a-button>
</a-space>
</div>
</div>