--中英文国际化

This commit is contained in:
lai
2023-11-09 20:22:57 +08:00
parent c71e56a937
commit 22f2cd9a2e
6 changed files with 54 additions and 53 deletions

View File

@@ -14,7 +14,6 @@ import {
} from '@/api/configManage/backupManage'; } from '@/api/configManage/backupManage';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import {updateConfig } from '@/api/configManage/config';
import {updateBackInfo } from '@/api/configManage/backupManage'; import {updateBackInfo } from '@/api/configManage/backupManage';
import useNeInfoStore from '@/store/modules/neinfo'; import useNeInfoStore from '@/store/modules/neinfo';
const { t } = useI18n(); const { t } = useI18n();
@@ -91,7 +90,7 @@ let tableColumns: ColumnsType = [
width: 3, width: 3,
}, },
{ {
title: '备份说明', title: t('views.configManage.backupManage.remark'),
dataIndex: 'comment', dataIndex: 'comment',
align: 'center', align: 'center',
width: 3, width: 3,
@@ -152,14 +151,14 @@ function fnTableSize({ key }: MenuInfo) {
function fnDownloadFile(row: Record<string, any>) { function fnDownloadFile(row: Record<string, any>) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: `确认下载记录编号为 【${row.id}】 的数据项文件?`, content: t('views.configManage.backupManage.totalSure',{oper:t('common.downloadText'),id:row.id}),
onOk() { onOk() {
const key = 'downloadNeBackup'; const key = 'downloadNeBackup';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
downloadNeBackup(toRaw(row)).then(res => { downloadNeBackup(toRaw(row)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `已完成下载`, content: t('common.msgSuccess', { msg: t('common.downloadText') }),
key, key,
duration: 2, duration: 2,
}); });
@@ -183,14 +182,14 @@ function fnDownloadFile(row: Record<string, any>) {
function fnRecordDelete(row: Record<string, any>) { function fnRecordDelete(row: Record<string, any>) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: `确认删除记录编号为 【${row.id}】 的数据项?`, content: t('views.configManage.backupManage.totalSure',{oper:t('common.deleteText'),id:row.id}),
onOk() { onOk() {
const key = 'delNeBackup'; const key = 'delNeBackup';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
delNeBackup(toRaw(row)).then(res => { delNeBackup(toRaw(row)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `删除成功`, content: t('common.msgSuccess', { msg: t('common.deleteText') }),
key, key,
duration: 2, duration: 2,
}); });
@@ -258,7 +257,7 @@ function fnModalVisibleByEdit(row: Record<string, any>) {
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
modalState.from.backupInfo = row.comment; modalState.from.backupInfo = row.comment;
modalState.from.id = row.id; modalState.from.id = row.id;
modalState.title = '编辑备份文件'; modalState.title = t('views.configManage.backupManage.edit');
modalState.visibleByEdit = true; modalState.visibleByEdit = true;
} }
@@ -266,7 +265,7 @@ function fnModalVisibleByEdit(row: Record<string, any>) {
const modalStateFrom = Form.useForm( const modalStateFrom = Form.useForm(
modalState.from, modalState.from,
reactive({ reactive({
backupInfo: [{ required: true, message: '备份说明不能为空' }], backupInfo: [{ required: true, message: t('views.configManage.backupManage.remark') + t('common.unableNull') }],
}) })
); );
/** /**
@@ -475,7 +474,7 @@ onMounted(() => {
> >
<a-form name="modalStateFrom" layout="horizontal"> <a-form name="modalStateFrom" layout="horizontal">
<a-form-item <a-form-item
label="备注说明" :label="t('views.configManage.backupManage.remark')"
name="backupInfo" name="backupInfo"
v-bind="modalStateFrom.validateInfos.backupInfo" v-bind="modalStateFrom.validateInfos.backupInfo"
> >

View File

@@ -267,7 +267,8 @@ function fnBeforeUploadFile(file: FileType) {
const fileName = file.name; const fileName = file.name;
const suff = fileName.substring(fileName.lastIndexOf('.')); const suff = fileName.substring(fileName.lastIndexOf('.'));
if (!['.ini'].includes(suff)) { if (!['.ini'].includes(suff)) {
message.error('只支持上传文件格式(.ini)', 3); message.error(t('views.configManage.softwareManage.onlyAble',{fileText:'(.ini)'}), 3);
return false; return false;
} }
@@ -294,7 +295,7 @@ onMounted(() => {
fnGetList(); fnGetList();
} else { } else {
message.warning({ message.warning({
content: `暂无网元列表数据`, content: t('views.configManage.softwareManage.nullData'),
duration: 2, duration: 2,
}); });
} }

View File

@@ -78,44 +78,44 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */ /**表格字段列 */
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: '网元类型', title:t('views.configManage.softwareManage.neType'),
dataIndex: 'neType', dataIndex: 'neType',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '网元内部标识', title: t('views.configManage.neManage.neId'),
dataIndex: 'neId', dataIndex: 'neId',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '版本', title: t('views.configManage.softwareManage.versions'),
dataIndex: 'version', dataIndex: 'version',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '升级前版本', title: t('views.configManage.softwareManage.upVersions'),
dataIndex: 'preVersion', dataIndex: 'preVersion',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '回退前版本', title:t('views.configManage.softwareManage.backVersions'),
dataIndex: 'newVersion', dataIndex: 'newVersion',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '状态', title: t('views.configManage.softwareManage.status'),
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
align: 'center', align: 'center',
width: 2, width: 2,
}, },
{ {
title: '激活时间', title: t('views.configManage.softwareManage.letUpTime'),
dataIndex: 'updateTime', dataIndex: 'updateTime',
align: 'center', align: 'center',
customRender(opt) { customRender(opt) {
@@ -210,7 +210,6 @@ watch(
:model="queryParams" :model="queryParams"
name="queryParams" name="queryParams"
layout="horizontal" layout="horizontal"
:label-col="{ span: 5 }"
> >
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
@@ -227,13 +226,12 @@ watch(
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item label="创建时间" name="queryRangePicker"> <a-form-item :label="t('views.configManage.softwareManage.createTime')" name="queryRangePicker">
<a-range-picker <a-range-picker
v-model:value="queryRangePicker" v-model:value="queryRangePicker"
allow-clear allow-clear
bordered bordered
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
:placeholder="['创建开始', '创建结束']"
style="width: 100%" style="width: 100%"
></a-range-picker> ></a-range-picker>
</a-form-item> </a-form-item>

View File

@@ -320,7 +320,7 @@ function fnDownloadFile(row: Record<string, any>) {
downloadNeSoftware(toRaw(row)).then(res => { downloadNeSoftware(toRaw(row)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `已完成下载`, content: t('common.msgSuccess', { msg: t('common.downloadText') }),
key, key,
duration: 2, duration: 2,
}); });
@@ -374,7 +374,7 @@ function fnRecordDelete(row: Record<string, any>) {
function fnGetList(pageNum?: number) { function fnGetList(pageNum?: number) {
if (tableState.loading) return; if (tableState.loading) return;
tableState.loading = true; tableState.loading = true;
if(pageNum){ if (pageNum) {
queryParams.pageNum = pageNum; queryParams.pageNum = pageNum;
} }
listNeSoftware(toRaw(queryParams)).then(res => { listNeSoftware(toRaw(queryParams)).then(res => {
@@ -529,7 +529,8 @@ function fnBeforeUploadFile(file: FileType) {
const fileName = file.name; const fileName = file.name;
const suff = fileName.substring(fileName.lastIndexOf('.')); const suff = fileName.substring(fileName.lastIndexOf('.'));
if (!['.deb', '.rpm'].includes(suff)) { if (!['.deb', '.rpm'].includes(suff)) {
message.error('只支持上传文件格式(.deb、.rpm', 3); message.error(t('views.configManage.softwareManage.onlyAble',{fileText:'(.deb、.rpm)'}), 3);
return false; return false;
} }
return true; return true;
@@ -551,7 +552,7 @@ function fnBeforeUploadCms(file: FileType) {
const fileName = file.name; const fileName = file.name;
const suff = fileName.substring(fileName.lastIndexOf('.')); const suff = fileName.substring(fileName.lastIndexOf('.'));
if (!['.cms'].includes(suff)) { if (!['.cms'].includes(suff)) {
message.error('只支持上传文件格式(.cms', 3); message.error(t('views.configManage.softwareManage.onlyAble',{fileText:'(.cms)'}), 3);
return false; return false;
} }
return true; return true;
@@ -579,7 +580,7 @@ onMounted(() => {
} }
} else { } else {
message.warning({ message.warning({
content: `暂无网元列表数据`, content: t('views.configManage.softwareManage.nullData'),
duration: 2, duration: 2,
}); });
} }

View File

@@ -45,7 +45,7 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */ /**表格字段列 */
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: '序号', title: t('common.rowId'),
dataIndex: 'num', dataIndex: 'num',
width: '50px', width: '50px',
align: 'center', align: 'center',
@@ -55,42 +55,42 @@ let tableColumns: ColumnsType = [
}, },
}, },
{ {
title: '会话编号', title: t('views.monitor.online.mettingId'),
dataIndex: 'tokenId', dataIndex: 'tokenId',
align: 'center', align: 'center',
}, },
{ {
title: '登录账号', title: t('views.monitor.online.account'),
dataIndex: 'userName', dataIndex: 'userName',
align: 'center', align: 'center',
}, },
{ {
title: '所属部门', title: t('views.monitor.online.class'),
dataIndex: 'deptName', dataIndex: 'deptName',
align: 'center', align: 'center',
}, },
{ {
title: '登录主机', title: t('views.monitor.online.host'),
dataIndex: 'ipaddr', dataIndex: 'ipaddr',
align: 'center', align: 'center',
}, },
{ {
title: '登录地点', title: t('views.monitor.online.loginDes'),
dataIndex: 'loginLocation', dataIndex: 'loginLocation',
align: 'center', align: 'center',
}, },
{ {
title: '操作系统', title: t('views.monitor.online.os'),
dataIndex: 'os', dataIndex: 'os',
align: 'center', align: 'center',
}, },
{ {
title: '浏览器', title: t('views.monitor.online.lib'),
dataIndex: 'browser', dataIndex: 'browser',
align: 'center', align: 'center',
}, },
{ {
title: '登录时间', title: t('views.monitor.online.loginTime'),
dataIndex: 'loginTime', dataIndex: 'loginTime',
align: 'center', align: 'center',
customRender(opt) { customRender(opt) {
@@ -99,7 +99,7 @@ let tableColumns: ColumnsType = [
}, },
}, },
{ {
title: '操作', title: t('common.operate'),
key: 'tokenId', key: 'tokenId',
align: 'center', align: 'center',
}, },
@@ -165,14 +165,14 @@ function fnGetList() {
function fnForceLogout(row: Record<string, string>) { function fnForceLogout(row: Record<string, string>) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: `确认强退登录账号为 ${row.userName} 的用户?`, content: t('views.monitor.online.getOutSure',{userName:row.userName}),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
forceLogout(row.tokenId) forceLogout(row.tokenId)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: `已强退用户 ${row.userName}`, content: t('common.msgSuccess', { msg: t('views.monitor.online.getOut') }),
duration: 3, duration: 3,
}); });
} else { } else {
@@ -312,7 +312,7 @@ onMounted(() => {
v-perms:has="['monitor:online:forceLogout']" v-perms:has="['monitor:online:forceLogout']"
> >
<template #icon><LogoutOutlined /></template> <template #icon><LogoutOutlined /></template>
强退 {{ t('views.monitor.online.getOut') }}
</a-button> </a-button>
</template> </template>
</template> </template>

View File

@@ -911,7 +911,7 @@ onMounted(() => {
v-perms:has="['system:user:import']" v-perms:has="['system:user:import']"
> >
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.system.user.export') }} {{ t('views.system.user.import') }}
</a-button> </a-button>
<a-button <a-button
type="dashed" type="dashed"
@@ -919,7 +919,7 @@ onMounted(() => {
v-perms:has="['system:user:export']" v-perms:has="['system:user:export']"
> >
<template #icon><ExportOutlined /></template> <template #icon><ExportOutlined /></template>
{{ t('views.system.user.import') }} {{ t('views.system.user.export') }}
</a-button> </a-button>
</a-space> </a-space>
</template> </template>
@@ -1378,7 +1378,10 @@ onMounted(() => {
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.user.userWork')" name="postIds"> <a-form-item
:label="t('views.system.user.userWork')"
name="postIds"
>
<a-select <a-select
v-model:value="modalState.from.postIds" v-model:value="modalState.from.postIds"
allow-clear allow-clear
@@ -1393,7 +1396,10 @@ onMounted(() => {
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="12" :md="12" :xs="24"> <a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.user.permission')" name="roleIds"> <a-form-item
:label="t('views.system.user.permission')"
name="roleIds"
>
<a-select <a-select
v-model:value="modalState.from.roleIds" v-model:value="modalState.from.roleIds"
:allow-clear="false" :allow-clear="false"
@@ -1409,7 +1415,7 @@ onMounted(() => {
</a-col> </a-col>
</a-row> </a-row>
<a-form-item :label="t('views.system.user.userTip')" name="remark"> <a-form-item :label="t('views.system.user.userTip')" name="remark">
<a-textarea <a-textarea
v-model:value="modalState.from.remark" v-model:value="modalState.from.remark"
:auto-size="{ minRows: 4, maxRows: 6 }" :auto-size="{ minRows: 4, maxRows: 6 }"
@@ -1433,22 +1439,18 @@ onMounted(() => {
> >
<a-form name="modalStateFromByResetPwd" layout="horizontal"> <a-form name="modalStateFromByResetPwd" layout="horizontal">
<a-form-item <a-form-item
:label="t('views.system.user.account')" :label="t('views.system.user.account')"
name="userName" name="userName"
v-bind="modalStateFrom.validateInfos.userName" v-bind="modalStateFrom.validateInfos.userName"
> >
<a-input <a-input :value="modalState.from.userName" disabled :maxlength="30">
:value="modalState.from.userName"
disabled
:maxlength="30"
>
<template #prefix> <template #prefix>
<UserOutlined /> <UserOutlined />
</template> </template>
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:label="t('views.system.user.loginPwd')" :label="t('views.system.user.loginPwd')"
name="password" name="password"
v-bind="modalStateFrom.validateInfos.password" v-bind="modalStateFrom.validateInfos.password"
> >
@@ -1478,7 +1480,7 @@ onMounted(() => {
<a-row :gutter="18" justify="space-between" align="middle"> <a-row :gutter="18" justify="space-between" align="middle">
<a-col :span="12"> <a-col :span="12">
<a-checkbox v-model:checked="uploadImportState.updateSupport"> <a-checkbox v-model:checked="uploadImportState.updateSupport">
{{t('views.system.user.updateSure')}} {{ t('views.system.user.updateSure') }}
</a-checkbox> </a-checkbox>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
@@ -1487,7 +1489,7 @@ onMounted(() => {
:title="t('views.system.user.downloadObj')" :title="t('views.system.user.downloadObj')"
@click.prevent="fnModalUploadImportExportTemplate" @click.prevent="fnModalUploadImportExportTemplate"
> >
{{t('views.system.user.downloadObj')}} {{ t('views.system.user.downloadObj') }}
</a-button> </a-button>
</a-col> </a-col>
</a-row> </a-row>