style: 快速开站多语言翻译

This commit is contained in:
TsMask
2024-05-24 09:41:20 +08:00
parent 7c78eab431
commit f94b1ef44a
8 changed files with 335 additions and 255 deletions

View File

@@ -601,7 +601,7 @@ export default {
ipAddrPlease: 'Please enter the IP address of the network element',
ipAddrTip: "Support IPV4/IPV6, synchronized change of configuration address",
port: 'Port',
portTip: "Network element default:33030",
portTip: "Network element port default:33030",
serialNum: 'Serial Number',
expiryDate: 'Expiry Date',
normalcy: 'Normal',
@@ -719,7 +719,7 @@ export default {
status: "License Status",
change: "Change License",
reload: "Refresh Info",
reloadTip: "Confirmed to refresh the [{txt}] license information?",
reloadTip: "Confirmed to refresh license information?",
reloadBatch: "Batch Refresh",
reloadBatchTip: "Do you do an information refresh on checked records?",
updateTtile: "Update License",
@@ -727,6 +727,8 @@ export default {
activationRequestCode: "License Activation Code",
licensePath: "License File",
licensePathTip: "Please upload license file",
upload: 'Upload',
uploadBatch: "Upload License",
},
neConfPara5G: {
title: 'Save Info',
@@ -1872,7 +1874,8 @@ export default {
finish: 'Complete Setup',
stepPrev: 'Previous',
stepNext: 'Next',
exit: 'Exit',
save: 'Save Info',
sysTitle: 'System Configuration',
sysAdmin: 'Administrator',
sysInfo: 'System Info',
@@ -1887,13 +1890,37 @@ export default {
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?',
stepNeInfoTitle: "Service Configuration",
stepNeInfoDesc: "Setting the service terminal corresponding to a network element",
stepNeInfoStepPrev: 'Confirming that you want to exit the network element installation step?',
stepNeInfoStepNext: 'Confirm that you want to proceed to the next step to configure the parameters of the network element?',
stepPara5GTitle: "Configuration Parameter",
stepPara5GDesc: "Setting network element global parameter information",
stepPara5GStepPrev: 'Confirm that you want to abandon the current change and return to the previous step?',
stepPara5GStepNext: 'Confirm that you want to proceed to the next step for the network element service installation?',
stepInstallTitle: "Service Install",
stepInstallDesc: "Installation of network element services to service terminals",
stepInstallStepPrev: 'Confirm that you want to abandon the current change and return to the previous step?',
stepInstallStepNext: 'Confirm that you want to proceed to the next step for network element license authorization?',
stepInstallText: 'Select Install',
stepInstallTip: 'Confirm the installation of the new version of the chosen Net Meta?',
stepInstallModal: 'Network Element For Install',
stepLicenseTitle: "Service License",
stepLicenseDesc: "Obtaining a license activation code for authorization authentication",
stepLicenseReload: 'Select Refresh',
stepLicenseReloadTip: 'Confirm refreshing selected license information?',
stepLicenseDownCode: 'Select Download Activation Code',
stepLicenseDownCodeTip: 'Confirmed to download the selected network element license activation code to a text file?',
stepLicenseStepPrev: 'Confirm that you want to abandon the current change and return to the previous step?',
stepLicenseStepNext: 'Confirmed to end the network element installation step?',
stepLicenseStepNext2: 'Please download the Net Element License Authorization Code file to save it and contact the Net Element vendor to get the authorization license',
stepLicenseEnd: 'End',
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',
doneNEDesc: 'In case of abnormal network elements, the license can be reinstalled in the system',
doneSkipTitle: 'No network element installation configuration',
doneSkipDesc: 'The system will initialize the network element information by default, which can be modified or installed within the system.',
donePrevTip: 'Confirmed to go back to the previous step?',
doneOkTip: 'Confirm that you have completed the setup and started using it?',
},

View File

@@ -597,11 +597,11 @@ export default {
rmUidTip: "用于网元日志、告警、指标等数据上报的标记",
neName: '网元名称',
neNamePlease: '请输入网元名称',
ipAddr: '网元服务IP',
ipAddrPlease: '请输入网元IP地址',
ipAddr: '服务IP',
ipAddrPlease: '请输入网元服务IP地址',
ipAddrTip: "支持IPV4/IPV6,同步变更配置地址",
port: '网元服务端口',
portTip: "网元默认:33030",
port: '服务端口',
portTip: "网元服务端口,默认:33030",
serialNum: '序列号',
expiryDate: '许可证到期日期',
normalcy: '正常',
@@ -719,7 +719,7 @@ export default {
status: "许可证状态",
change: "变更许可证",
reload: "刷新信息",
reloadTip: "确认要刷新【{txt}】许可证信息吗?",
reloadTip: "确认要刷新许可证信息吗?",
reloadBatch: "批量刷新",
reloadBatchTip: "对勾选的记录进行信息刷新吗?",
updateTtile: "更新许可证",
@@ -727,6 +727,8 @@ export default {
activationRequestCode: "许可激活码",
licensePath: "许可证文件",
licensePathTip: "请上传许可证文件",
upload: '上传',
uploadBatch: "上传许可证",
},
neConfPara5G: {
title: '保存信息',
@@ -1872,7 +1874,8 @@ export default {
finish: '完成设置',
stepPrev: '上一步',
stepNext: '下一步',
exit: '退出',
save: '保存信息',
sysTitle: '系统配置',
sysAdmin: '管理员',
sysInfo: '系统信息',
@@ -1887,13 +1890,37 @@ export default {
sysPrevTip: '确认要返回上一个步骤吗?',
sysNextNe: '确认要进行网元安装吗?',
sysNextDone: '确认要跳过网元安装吗?',
stepNeInfoTitle: "网元服务配置",
stepNeInfoDesc: "设置网元对应的服务终端",
stepNeInfoStepPrev: '确认要退出网元安装步骤吗?',
stepNeInfoStepNext: '确认要下一步进行网元配置参数?',
stepPara5GTitle: "网元配置参数",
stepPara5GDesc: "设置网元全局参数信息",
stepPara5GStepPrev: '确认要放弃当前变更返回上一步吗?',
stepPara5GStepNext: '确认要下一步进行网元服务安装吗?',
stepInstallTitle: "网元服务安装",
stepInstallDesc: "将网元服务安装到服务终端",
stepInstallStepPrev: '确认要放弃当前变更返回上一步吗?',
stepInstallStepNext: '确认要下一步进行网元许可授权吗?',
stepInstallText: '选择安装',
stepInstallTip: '确认安装选择的网元新版本吗?',
stepInstallModal: '网元进行安装',
stepLicenseTitle: "网元许可授权",
stepLicenseDesc: "获取网元许可激活码进行授权认证",
stepLicenseReload: '选择刷新许可证',
stepLicenseReloadTip: '确认刷新选择的许可证信息吗?',
stepLicenseDownCode: '选择下载网元许可激活码',
stepLicenseDownCodeTip: '确认下载选择的网元许可激活码到文本文件吗?',
stepLicenseStepPrev: '确认要放弃当前变更返回上一步吗?',
stepLicenseStepNext: '确认要结束网元安装步骤吗?',
stepLicenseStepNext2: '请下载网元许可授权码文件保存,并联系网元厂商获取授权许可证',
stepLicenseEnd: '结束',
doneTitle: "完成配置",
doneTip: '请进入系统后,根据情况进行更多相关配置',
doneNETitle: '已经进行网元安装配置',
doneNEDesc: '如有部分异常网元请进入系统后自行配置',
doneSkipTitle: '未进行安装配置网元',
doneSkipDesc: '系统将会默认初始网元信息,可自行修改信息',
doneNEDesc: '如有异常网元,可在系统内重新安装授权许可',
doneSkipTitle: '未进行网元安装配置',
doneSkipDesc: '系统将会默认初始网元信息,可在系统内自行修改或进行安装',
donePrevTip: '确认要返回上一个步骤吗?',
doneOkTip: '确认完成设置并开始使用吗?',
},

View File

@@ -59,7 +59,7 @@ function fnTabClose(key: string) {
const item = tabState.panes[tabIndex];
Modal.confirm({
title: t('common.tipTitle'),
content: `确认要删除${item.data.neType}@${item.data.neId}网元信息?`,
content: `${item.data.neName} ${t('views.ne.neInfo.delTip')}`,
onOk() {
delNeInfo(item.data.id).finally(() => {
tabState.panes.splice(tabIndex, 1);
@@ -99,8 +99,8 @@ function fnTabCreate() {
addr: '',
port: 22,
user: '',
authMode: '2',
password: 'user',
authMode: '0',
password: '',
privateKey: '',
passPhrase: '',
remark: '',
@@ -153,7 +153,7 @@ function fnHostTest(row: Record<string, any>) {
/**测试主机连接-免密直连 */
function fnHostAuthorized(row: Record<string, any>) {
if (tabState.confirmLoading) return;
if (tabState.confirmLoading || !row.addr) return;
Modal.confirm({
title: t('common.tipTitle'),
@@ -255,7 +255,7 @@ function fnSaveFinish(pane: any) {
tabItem.status = true;
}
message.success({
content: '操作成功',
content: t('common.operateOk'),
duration: 3,
});
} else {
@@ -288,7 +288,7 @@ function fnSaveFinishFailed(e: any) {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要退出网元安装吗?',
content: t('views.system.quickStart.stepNeInfoStepPrev'),
onOk() {
fnToStepName('SystemConfig');
},
@@ -300,7 +300,7 @@ function fnStepNext(stepName: 'NeInfoConfigPara5G') {
if (stepName === 'NeInfoConfigPara5G') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要下一步进行网元公共参数的设置?',
content: t('views.system.quickStart.stepNeInfoStepNext'),
onOk() {
fnToStepName('NeInfoConfigPara5G');
},
@@ -370,7 +370,9 @@ onMounted(() => {
<template #rightExtra>
<a-space :size="8" align="center">
<a-tooltip placement="topRight">
<template #title> 新增网元 </template>
<template #title>
{{ t('views.ne.neInfo.addTitle') }}
</template>
<a-button type="default" shape="circle" @click="fnTabCreate()">
<template #icon><PlusOutlined /></template>
</a-button>
@@ -404,11 +406,11 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.neType')"
:label="t('views.ne.common.neType')"
name="neType"
:rules="{
required: true,
message: '请输入网元类型',
message: t('views.ne.common.neTypePlease'),
}"
>
<a-auto-complete
@@ -422,13 +424,13 @@ onMounted(() => {
>
<a-input
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.neTypePlease')"
:maxlength="32"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.configManage.neManage.neTypeTip') }}
{{ t('views.ne.common.neTypeTip') }}
</template>
<InfoCircleOutlined
style="color: rgba(0, 0, 0, 0.45)"
@@ -441,23 +443,23 @@ onMounted(() => {
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.neId')"
:label="t('views.ne.common.neId')"
name="neId"
:rules="{
required: true,
message: '请输入网元标识',
message: t('views.ne.common.neIdPlease'),
}"
>
<a-input
v-model:value="pane.data.neId"
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.neIdPlease')"
:maxlength="24"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.configManage.neManage.neIdTip') }}
{{ t('views.ne.common.neIdTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
@@ -470,7 +472,7 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.ip')"
:label="t('views.ne.common.ipAddr')"
name="ip"
:rules="{
required: true,
@@ -480,7 +482,7 @@ onMounted(() => {
<a-input
v-model:value="pane.data.ip"
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.ipAddrPlease')"
:maxlength="128"
@change="e => fnNeIPChange(e, pane.data)"
>
@@ -488,7 +490,7 @@ onMounted(() => {
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.ne.neInfo.ipAddr') }}
{{ t('views.ne.common.ipAddrTip') }}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
@@ -497,54 +499,20 @@ onMounted(() => {
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.port')"
name="port"
:rules="{
required: true,
message: '请输入网元端口',
}"
>
<a-input-number
v-model:value="pane.data.port"
style="width: 100%"
:min="1"
:max="65535"
:maxlength="5"
placeholder="<=65535"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.configManage.neManage.portTip') }}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input-number>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24"> </a-col>
</a-row>
<template v-if="pane.data.hosts.length > 0">
<a-divider orientation="left">
{{ t('views.ne.neInfo.hostConfig') }}
</a-divider>
<!-- 主机连接配置 -->
<a-collapse class="collapse" ghost>
<a-collapse-panel
v-for="host in pane.data.hosts.filter((s:any)=>s.hostType === 'ssh')"
:key="host.title"
:header="`${host.hostType.toUpperCase()} ${host.port}`"
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.addr')">
<a-input
v-model:value="host.addr"
v-model:value="pane.data.hosts[0].addr"
allow-clear
:maxlength="128"
:placeholder="t('common.inputPlease')"
@@ -555,11 +523,12 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.port')" name="port">
<a-input-number
v-model:value="host.port"
v-model:value="pane.data.hosts[0].port"
:min="10"
:max="65535"
:step="1"
:maxlength="5"
:placeholder="t('common.inputPlease')"
style="width: 100%"
></a-input-number>
</a-form-item>
@@ -570,7 +539,7 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.user')">
<a-input
v-model:value="host.user"
v-model:value="pane.data.hosts[0].user"
allow-clear
:maxlength="32"
:placeholder="t('common.inputPlease')"
@@ -581,10 +550,9 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.authMode')">
<a-select
v-model:value="host.authMode"
v-model:value="pane.data.hosts[0].authMode"
default-value="0"
:options="dict.neHostAuthMode"
:disabled="host.hostType === 'telnet'"
>
</a-select>
</a-form-item>
@@ -592,27 +560,27 @@ onMounted(() => {
</a-row>
<a-form-item
v-if="host.authMode === '0'"
v-if="pane.data.hosts[0].authMode === '0'"
:label="t('views.ne.neHost.password')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-input-password
v-model:value="host.password"
v-model:value="pane.data.hosts[0].password"
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input-password>
</a-form-item>
<template v-if="host.authMode === '1'">
<template v-if="pane.data.hosts[0].authMode === '1'">
<a-form-item
:label="t('views.ne.neHost.privateKey')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-textarea
v-model:value="host.privateKey"
v-model:value="pane.data.hosts[0].privateKey"
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="3000"
:show-count="true"
@@ -626,7 +594,7 @@ onMounted(() => {
:label-wrap="true"
>
<a-input-password
v-model:value="host.passPhrase"
v-model:value="pane.data.hosts[0].passPhrase"
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
@@ -641,33 +609,36 @@ onMounted(() => {
:label-wrap="true"
>
<a-button
type="primary"
type="dashed"
shape="round"
@click="fnHostTest(host)"
:loading="tabState.confirmLoading"
@click="fnHostTest(pane.data.hosts[0])"
:disabled="tabState.confirmLoading"
>
<template #icon><LinkOutlined /></template>
</a-button>
<a-button
type="link"
@click="fnHostAuthorized(host)"
:loading="tabState.confirmLoading"
v-if="host.hostType === 'ssh' && host.authMode !== '2'"
@click="fnHostAuthorized(pane.data.hosts[0])"
:disabled="tabState.confirmLoading"
v-if="
pane.data.hosts[0].hostType === 'ssh' &&
pane.data.hosts[0].authMode !== '2'
"
>
免密授权
{{ t('views.ne.neHost.authRSA') }}
</a-button>
</a-form-item>
</a-collapse-panel>
</a-collapse>
</template>
<a-form-item :wrapper-col="{ offset: 10, span: 4 }">
<a-button
type="primary"
ghost
html-type="submit"
:loading="tabState.confirmLoading"
:disabled="tabState.confirmLoading"
>
保存信息
{{ t('views.system.quickStart.save') }}
</a-button>
</a-form-item>
</a-form>
@@ -676,10 +647,12 @@ onMounted(() => {
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 退出 </a-button>
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.exit') }}
</a-button>
<a-button type="dashed" @click="fnStepNext('NeInfoConfigPara5G')">
下一步
<a-button type="primary" @click="fnStepNext('NeInfoConfigPara5G')">
{{ t('views.system.quickStart.stepNext') }}
</a-button>
</a-space>
</div>

View File

@@ -160,7 +160,7 @@ function fnGetList() {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要放弃当前变更返回上一步吗?',
content: t('views.system.quickStart.stepPara5GStepPrev'),
onOk() {
fnToStepName('NeInfoConfig');
},
@@ -172,7 +172,7 @@ function fnStepNext(stepName: 'NeInfoSoftwareInstall') {
if (stepName === 'NeInfoSoftwareInstall') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要下一步进行各网元安装吗?',
content: t('views.system.quickStart.stepPara5GStepNext'),
onOk() {
fnToStepName('NeInfoSoftwareInstall');
},
@@ -354,20 +354,23 @@ onMounted(() => {
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 上一步 </a-button>
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.stepPrev') }}
</a-button>
<a-button
type="primary"
ghost
:loading="state.confirmLoading"
@click="fnSave()"
>
保存信息
{{ t('views.system.quickStart.save') }}
</a-button>
<a-button
type="dashed"
type="primary"
@click="fnStepNext('NeInfoSoftwareInstall')"
:disabled="!state.saveFile"
>
下一步
{{ t('views.system.quickStart.stepNext') }}
</a-button>
</a-space>
</div>

View File

@@ -1,6 +1,11 @@
<script setup lang="ts">
import { Modal, TableColumnsType, message } from 'ant-design-vue/lib';
import { defineAsyncComponent, onMounted, reactive, ref, toRaw } from 'vue';
import {
Modal,
TableColumnsType,
message,
notification,
} from 'ant-design-vue/lib';
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { fnToStepName } from '../hooks/useStep';
import useI18n from '@/hooks/useI18n';
import useDictStore from '@/store/modules/dict';
@@ -19,19 +24,19 @@ let dictStatus = ref<DictType[]>([]);
/**表格字段列 */
let tableColumns = ref<TableColumnsType>([
{
title: 'neType',
title: t('views.ne.common.neType'),
dataIndex: 'neType',
align: 'left',
width: 100,
},
{
title: 'neId',
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
title: 'version',
title: t('views.ne.neVersion.version'),
dataIndex: 'version',
align: 'left',
width: 100,
@@ -40,7 +45,7 @@ let tableColumns = ref<TableColumnsType>([
maxWidth: 200,
},
{
title: 'New Version',
title: t('views.ne.neVersion.newVersion'),
dataIndex: 'newVersion',
align: 'left',
width: 100,
@@ -49,7 +54,7 @@ let tableColumns = ref<TableColumnsType>([
maxWidth: 200,
},
{
title: 'status',
title: t('views.ne.neVersion.status'),
dataIndex: 'status',
key: 'status',
align: 'left',
@@ -67,8 +72,8 @@ type StateType = {
selectedRowKeys: (string | number)[];
/**多文件上传 */
visibleByMoreFile: boolean;
/**勾选升级情况 */
visibleByUpgrade: boolean;
/**勾选安装弹窗 */
visibleByInstall: boolean;
/**操作数据进行版本升级 */
operateDataUpgrade: any[];
/**确定按钮 loading */
@@ -81,7 +86,7 @@ let state: StateType = reactive({
data: [],
selectedRowKeys: [],
visibleByMoreFile: false,
visibleByUpgrade: false,
visibleByInstall: false,
operateDataUpgrade: [],
confirmLoading: false,
});
@@ -94,7 +99,7 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
/**对话框弹出确认执行函数*/
function fnModalOk() {
fnGetList();
if (state.visibleByUpgrade) {
if (state.visibleByInstall) {
fnModalCancel();
}
}
@@ -102,7 +107,7 @@ function fnModalOk() {
/**对话框弹出关闭执行函数*/
function fnModalCancel() {
state.visibleByMoreFile = false;
state.visibleByUpgrade = false;
state.visibleByInstall = false;
state.operateDataUpgrade = [];
}
@@ -110,11 +115,16 @@ function fnModalCancel() {
function fnRecordInstall() {
Modal.confirm({
title: t('common.tipTitle'),
content: `check install version?`,
content: t('views.system.quickStart.stepInstallTip'),
onOk() {
if (state.confirmLoading) return;
state.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
const notificationKey = 'NE_Select_Install';
notification.info({
key: notificationKey,
duration: 0,
message: t('common.loading'),
});
// 操作升级的网元数据
const selectRows = state.data.filter(item =>
state.selectedRowKeys.includes(item.id)
@@ -145,7 +155,7 @@ function fnRecordInstall() {
}
// 发请求信息
state.visibleByUpgrade = true;
state.visibleByInstall = true;
Promise.allSettled(
state.operateDataUpgrade
.filter(s => s.status !== 'fail')
@@ -169,7 +179,7 @@ function fnRecordInstall() {
});
})
.finally(() => {
hide();
notification.close(notificationKey);
state.confirmLoading = false;
});
},
@@ -201,7 +211,7 @@ function fnGetList() {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要放弃当前变更返回上一步吗?',
content: t('views.system.quickStart.stepInstallStepPrev'),
onOk() {
fnToStepName('NeInfoConfigPara5G');
},
@@ -213,7 +223,7 @@ function fnStepNext(stepName: 'NeInfoSoftwareLicense') {
if (stepName === 'NeInfoSoftwareLicense') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要下一步进行网元授权吗?',
content: t('views.system.quickStart.stepInstallStepNext'),
onOk() {
fnToStepName('NeInfoSoftwareLicense');
},
@@ -267,16 +277,16 @@ onMounted(() => {
@cancel="fnModalCancel"
></UploadMoreFile>
<!-- 勾选版本升级 -->
<!-- 勾选网元版本进行安装框 -->
<a-modal
width="800px"
:keyboard="false"
:mask-closable="false"
:visible="state.visibleByUpgrade"
title="Upgrade Version"
:visible="state.visibleByInstall"
:title="t('views.system.quickStart.stepInstallModal')"
:confirm-loading="state.confirmLoading"
:closable="false"
:cancelButtonProps="{ disabled: state.visibleByUpgrade }"
:cancelButtonProps="{ disabled: state.visibleByInstall }"
@ok="fnModalOk"
@cancel="fnModalCancel"
>
@@ -288,31 +298,34 @@ onMounted(() => {
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 上一步 </a-button>
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.stepPrev') }}
</a-button>
<a-button
type="primary"
type="dashed"
@click.prevent="
() => (state.visibleByMoreFile = !state.visibleByMoreFile)
"
>
<template #icon><PlusOutlined /></template>
Upload More Software
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
</a-button>
<a-button
type="default"
danger
type="primary"
ghost
:disabled="state.selectedRowKeys.length <= 0"
:loading="state.confirmLoading"
@click.prevent="fnRecordInstall()"
>
<template #icon><ThunderboltOutlined /></template>
Check Install
{{ t('views.system.quickStart.stepInstallText') }}
{{ state.selectedRowKeys.length || '' }}
</a-button>
<a-button type="dashed" @click="fnStepNext('NeInfoSoftwareLicense')">
下一步
<a-button type="primary" @click="fnStepNext('NeInfoSoftwareLicense')">
{{ t('views.system.quickStart.stepNext') }}
</a-button>
</a-space>
</div>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { Modal, TableColumnsType, message } from 'ant-design-vue/lib';
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
import { defineAsyncComponent, h, onMounted, reactive, ref } from 'vue';
import { fnToStepName, stepState } from '../hooks/useStep';
import useI18n from '@/hooks/useI18n';
import useDictStore from '@/store/modules/dict';
@@ -23,32 +23,32 @@ let dictStatus = ref<DictType[]>([]);
/**表格字段列 */
let tableColumns = ref<TableColumnsType>([
{
title: 'neType',
title: t('views.ne.common.neType'),
dataIndex: 'neType',
align: 'left',
width: 100,
},
{
title: 'neId',
title: t('views.ne.common.neId'),
dataIndex: 'neId',
align: 'left',
width: 100,
},
{
title: 'status',
title: t('views.ne.neLicense.status'),
dataIndex: 'status',
key: 'status',
align: 'left',
width: 100,
},
{
title: 'serialNum',
title: t('views.ne.common.serialNum'),
dataIndex: 'serialNum',
align: 'left',
width: 100,
},
{
title: 'expiryDate',
title: t('views.ne.common.expiryDate'),
dataIndex: 'expiryDate',
align: 'left',
width: 100,
@@ -115,7 +115,7 @@ function fnModalOpen() {
function fnRecordState() {
Modal.confirm({
title: t('common.tipTitle'),
content: `check refresh license state?`,
content: t('views.system.quickStart.stepLicenseReloadTip'),
onOk: async () => {
if (state.confirmLoading) return;
state.confirmLoading = true;
@@ -149,7 +149,7 @@ function fnRecordState() {
function fnRecordCode() {
Modal.confirm({
title: t('common.tipTitle'),
content: `check download license activation code file?`,
content: t('views.system.quickStart.stepLicenseDownCodeTip'),
onOk: async () => {
if (state.confirmLoading) return;
state.confirmLoading = true;
@@ -168,7 +168,7 @@ function fnRecordCode() {
if (res.code === RESULT_CODE_SUCCESS) {
const activationRequestCode = res.data;
row.activationRequestCode = activationRequestCode;
codeArr.push(`[${row.neType} ${row.neId}]:${activationRequestCode}`);
codeArr.push(`[${row.neType} ${row.neId}]: ${activationRequestCode}`);
}
}
@@ -176,7 +176,7 @@ function fnRecordCode() {
const blob = new Blob([codeArr.join('\r\n')], {
type: 'text/plain',
});
saveAs(blob, `CheckRecordActivationCode_${new Date().getTime()}.txt`);
saveAs(blob, `Activation_Request_Code_${new Date().getTime()}.txt`);
}
hide();
@@ -210,7 +210,7 @@ function fnGetList() {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要放弃当前变更返回上一步吗?',
content: t('views.system.quickStart.stepLicenseStepPrev'),
onOk() {
fnToStepName('NeInfoSoftwareInstall');
},
@@ -222,7 +222,14 @@ function fnStepNext(stepName: 'Done') {
if (stepName === 'Done') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要结束网元安装吗?',
content: h('div', {}, [
h('p', t('views.system.quickStart.stepLicenseStepNext')),
h(
'div',
{ style: { color: '#ff4d4f' } },
t('views.system.quickStart.stepLicenseStepNext2')
),
]),
onOk() {
stepState.setupNE = true;
fnToStepName('Done');
@@ -280,35 +287,42 @@ onMounted(() => {
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 上一步 </a-button>
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.stepPrev') }}
</a-button>
<a-button type="primary" @click.prevent="fnModalOpen">
<a-button type="dashed" @click.prevent="fnModalOpen">
<template #icon><UploadOutlined /></template>
Upload License
{{ t('views.ne.neLicense.uploadBatch') }}
</a-button>
<a-button
type="default"
danger
type="primary"
ghost
:disabled="state.selectedRowKeys.length <= 0"
:loading="state.confirmLoading"
@click.prevent="fnRecordState()"
>
<template #icon><ReloadOutlined /></template>
Refresh State
<template #icon><SecurityScanOutlined /></template>
{{ t('views.system.quickStart.stepLicenseReload') }}
{{ state.selectedRowKeys.length || '' }}
</a-button>
<a-button
type="ghost"
type="primary"
ghost
:disabled="state.selectedRowKeys.length <= 0"
:loading="state.confirmLoading"
@click.prevent="fnRecordCode()"
>
<template #icon><DownloadOutlined /></template>
Download Activation Code
{{ t('views.system.quickStart.stepLicenseDownCode') }}
{{ state.selectedRowKeys.length || '' }}
</a-button>
<a-button type="dashed" @click="fnStepNext('Done')"> 结束 </a-button>
<a-button type="primary" @click="fnStepNext('Done')">
{{ t('views.system.quickStart.stepLicenseEnd') }}
</a-button>
</a-space>
</div>
</div>

View File

@@ -18,30 +18,51 @@ export const stepState: StepStateType = reactive({
setupNE: false,
neSteps: [
{
title: '配置网元信息',
description: '服务端与网元服务',
title: '网元服务配置',
description: '设置网元对应的服务终端',
},
{
title: '网元公共参数',
description: '全局公共参数配置',
title: '网元全局参数',
description: '设置网元基础配置信息',
},
{
title: '网元软件安装',
description: '软件安装到服务端',
title: '网元服务安装',
description: '将网元服务安装到服务端',
},
{
title: '网元授权激活',
description: '网元服务授权激活',
title: '网元许可授权',
description: '获取网元许可激活码进行授权认证',
},
],
neStepsCurrent: -1,
});
/**步骤信息状态复位 */
export function fnRestStepState() {
export function fnRestStepState(t?: any) {
stepState.stepName = 'Start';
stepState.setupNE = false;
stepState.neStepsCurrent = -1;
// 多语言翻译
if (t) {
stepState.neSteps = [
{
title: t('views.system.quickStart.stepNeInfoTitle'),
description: t('views.system.quickStart.stepNeInfoDesc'),
},
{
title: t('views.system.quickStart.stepPara5GTitle'),
description: t('views.system.quickStart.stepPara5GDesc'),
},
{
title: t('views.system.quickStart.stepInstallTitle'),
description: t('views.system.quickStart.stepInstallDesc'),
},
{
title: t('views.system.quickStart.stepLicenseTitle'),
description: t('views.system.quickStart.stepLicenseDesc'),
},
];
}
}
/**跳转步骤组件 */

View File

@@ -6,10 +6,12 @@ import {
shallowRef,
watch,
} from 'vue';
import useAppStore from '@/store/modules/app';
import { parseUrlPath } from '@/plugins/file-static-url';
import { fnRestStepState, stepState } from './hooks/useStep';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n';
const appStore = useAppStore();
const { t } = useI18n();
// 判断是否有背景地址
const calcBG = computed(() => {
@@ -40,7 +42,7 @@ watch(
);
onMounted(() => {
fnRestStepState();
fnRestStepState(t);
});
</script>