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

@@ -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"