feat: 网元软件多语言翻译

This commit is contained in:
TsMask
2024-05-17 17:14:14 +08:00
parent 69f3347a4d
commit d48d5d6c95
4 changed files with 51 additions and 37 deletions

View File

@@ -584,6 +584,7 @@ export default {
ne: {
common: {
neType: 'NE Type',
neTypePlease: "Please select network element type",
neId: 'NE ID',
serialNum: 'Serial Num',
expiryDate: 'Expiry Date',
@@ -645,8 +646,16 @@ export default {
editTitle: "Edit Host Commands",
},
neSoftware: {
uploadTitle: "Update Software",
upload: "Upload",
uploadBatch: "Upload More Software",
name: "File Name",
path: "Software File",
pathPlease: "Please upload the software package file",
version: "Software Version",
versionPlease: "Please enter the software version number",
delTip: "Confirmed to remove the package?",
downTip: "Confirmation to download package [{txt}]?",
},
neVersion: {
upgrade: "Upgrade To New Version",

View File

@@ -584,6 +584,7 @@ export default {
ne: {
common: {
neType: '网元类型',
neTypePlease: "请选择网元类型",
neId: '网元内部标识',
serialNum: '序列号',
expiryDate: '许可证到期时间',
@@ -645,8 +646,16 @@ export default {
editTitle: "编辑主机命令",
},
neSoftware: {
uploadTitle: "上传软件包",
upload: "上传",
uploadBatch: "上传多软件包",
name: "文件名",
path: "软件文件",
pathPlease: "请上传软件包文件",
version: "软件版本",
versionPlease: "请输入软件版本号",
delTip: "确认要删除软件包吗?",
downTip: "确认要下载软件包【{txt}】吗?",
},
neVersion: {
upgrade: "升级到新版本",

View File

@@ -71,7 +71,7 @@ const modalStateFrom = Form.useForm(
required: true,
min: 1,
max: 32,
message: t('views.configManage.softwareManage.neTypePlease'),
message: t('views.ne.common.neTypePlease'),
},
],
version: [
@@ -79,13 +79,13 @@ const modalStateFrom = Form.useForm(
required: true,
min: 1,
max: 64,
message: t('views.configManage.softwareManage.versionPlease'),
message: t('views.ne.neSoftware.versionPlease'),
},
],
path: [
{
required: true,
message: t('views.configManage.softwareManage.updateFilePlease'),
message: t('views.ne.neSoftware.pathPlease'),
},
],
})
@@ -205,7 +205,7 @@ function fnModalVisibleByEdit(id?: string) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
Object.assign(modalState.from, res.data);
modalState.title = 'Update Software';
modalState.title = t('views.ne.neSoftware.uploadTitle');
modalState.visibleByEdit = true;
} else {
message.error(res.msg, 3);
@@ -218,7 +218,7 @@ function fnModalVisibleByEdit(id?: string) {
return;
}
modalState.title = 'Upload Software';
modalState.title = t('views.ne.neSoftware.uploadTitle');
modalState.visibleByEdit = true;
}
@@ -235,7 +235,7 @@ onMounted(() => {});
<template>
<a-modal
width="800px"
width="500px"
:keyboard="false"
:mask-closable="false"
:visible="modalState.visibleByEdit"
@@ -247,12 +247,12 @@ onMounted(() => {});
<a-form
name="modalStateFrom"
layout="horizontal"
:wrapper-col="{ span: 18 }"
:label-col="{ span: 6 }"
:wrapper-col="{ span: 16 }"
:label-col="{ span: 8 }"
:labelWrap="true"
>
<a-form-item
label="Upload File"
:label="t('views.ne.neSoftware.path')"
name="file"
v-bind="modalStateFrom.validateInfos.path"
v-if="modalState.from.id === ''"
@@ -282,7 +282,7 @@ onMounted(() => {});
</a-form-item>
<a-form-item
label="NeType"
:label="t('views.ne.common.neType')"
name="neType"
v-bind="modalStateFrom.validateInfos.neType"
>
@@ -302,7 +302,7 @@ onMounted(() => {});
</a-form-item>
<a-form-item
label="Version"
:label="t('views.ne.neSoftware.version')"
name="version"
v-bind="modalStateFrom.validateInfos.version"
>
@@ -313,7 +313,7 @@ onMounted(() => {});
></a-input>
</a-form-item>
<a-form-item label="Description" name="description">
<a-form-item :label="t('common.description')" name="description">
<a-textarea
v-model:value="modalState.from.description"
:maxlength="500"

View File

@@ -85,13 +85,19 @@ let tableColumns = ref<TableColumnsType>([
width: 100,
},
{
title: 'neType',
title: t('views.ne.common.neType'),
dataIndex: 'neType',
align: 'left',
width: 100,
},
{
title: 'name',
title: t('views.ne.neSoftware.version'),
dataIndex: 'version',
align: 'left',
width: 150,
},
{
title: t('views.ne.neSoftware.name'),
dataIndex: 'name',
align: 'left',
width: 250,
@@ -100,13 +106,7 @@ let tableColumns = ref<TableColumnsType>([
maxWidth: 400,
},
{
title: 'version',
dataIndex: 'version',
align: 'left',
width: 150,
},
{
title: 'description',
title: t('common.description'),
dataIndex: 'description',
key: 'description',
align: 'left',
@@ -116,7 +116,7 @@ let tableColumns = ref<TableColumnsType>([
maxWidth: 400,
},
{
title: 'createTime',
title: t('common.createTime'),
dataIndex: 'createTime',
align: 'center',
customRender(opt) {
@@ -251,9 +251,9 @@ function fnModalEditCancel() {
/**删除软件包 */
function fnRecordDelete(id: string) {
if (!id || modalState.confirmLoading) return;
let msg = 'Removing software packages?';
let msg = t('views.ne.neSoftware.delTip');
if (id === '0') {
msg = `${msg} select ${tableState.selectedRowKeys.length}`;
msg = `${msg} ...${tableState.selectedRowKeys.length}`;
id = tableState.selectedRowKeys.join(',');
}
@@ -285,18 +285,14 @@ function fnRecordDelete(id: string) {
function fnDownloadFile(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.softwareManage.downloadTip', {
fileName: row.name,
}),
content: t('views.ne.neSoftware.downTip', {txt: row.name}),
onOk() {
const hide = message.loading(t('common.loading'), 0);
downloadFile(row.path)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('common.downloadText'),
}),
content: t('common.operateOk'),
duration: 2,
});
saveAs(res.data, `${row.name}`);
@@ -360,7 +356,7 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="neType" name="neId ">
<a-form-item :label="t('views.ne.common.neType')" name="neType ">
<a-auto-complete
v-model:value="queryParams.neType"
:options="NE_TYPE_LIST.map(v => ({ value: v }))"
@@ -370,7 +366,7 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="name" name="name">
<a-form-item :label="t('views.ne.neSoftware.name')" name="name">
<a-input
v-model:value="queryParams.name"
allow-clear
@@ -379,7 +375,7 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="Version" name="version">
<a-form-item :label="t('views.ne.neSoftware.version')" name="version">
<a-input
v-model:value="queryParams.version"
allow-clear
@@ -410,8 +406,8 @@ onMounted(() => {
<template #title>
<a-space :size="8" align="center">
<a-button type="primary" @click.prevent="fnModalVisibleByEdit()">
<template #icon><PlusOutlined /></template>
{{ t('common.addText') }}
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.upload') }}
</a-button>
<a-button
type="primary"
@@ -420,8 +416,8 @@ onMounted(() => {
(modalState.visibleByMoreFile = !modalState.visibleByMoreFile)
"
>
<template #icon><PlusOutlined /></template>
More File Upload
<template #icon><UploadOutlined /></template>
{{ t('views.ne.neSoftware.uploadBatch') }}
</a-button>
<a-button
type="default"