style: 快速开站多语言翻译
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user