feat: 网元信息OAM多语言翻译

This commit is contained in:
TsMask
2024-05-20 11:58:25 +08:00
parent 9b9d6222e1
commit 48f278997f
5 changed files with 139 additions and 138 deletions

View File

@@ -587,15 +587,23 @@ export default {
neTypePlease: "Please select network element type",
neId: 'NE ID',
rmUid: 'Resource Unique ID',
neName: 'NE Name',
ipAddr: 'IP Addr',
port: 'Port',
serialNum: 'Serial Number',
expiryDate: 'Expiry Date',
normalcy: 'Normal',
exceptions: 'Abnormal',
restart: 'Restart',
restartTip: 'Are you sure you want to restart the network element service?',
start: 'Start',
startTip: 'Are you sure you want to start the network element service?',
stop: 'Stop',
stopTip: 'Are you sure you want to stop the network element service?',
reload: 'Reload',
reloadTip: 'Confirm that you want to reload the network element configuration information?',
oam: 'OAM',
log: 'Logs',
},
neInfo: {
version: "Version",
@@ -610,6 +618,17 @@ export default {
hostConfig: "Connection Configuration",
rmUID: "Data resource location identifiers are used for data tagging such as logging, alarm reporting, etc.",
ipAddr: "Support IPV4/IPV6, synchronize the change of the configuration address of the following configuration",
delTip: 'Confirm deletion of network element information data items?',
oam: {
title: 'OAM Configuration',
sync: 'Sync to NE',
oamEnable: 'Service',
oamPort: 'Port',
snmpEnable: 'Service',
snmpPort: 'Port',
kpiEnable: 'Report',
kpiTimer: 'Reporting Cycle',
},
},
neHost: {
hostType: "Type",

View File

@@ -587,15 +587,23 @@ export default {
neTypePlease: "请选择网元类型",
neId: '网元内部标识',
rmUid: '资源唯一标识',
neName: '网元名称',
ipAddr: '网元服务IP',
port: '网元服务端口',
serialNum: '序列号',
expiryDate: '许可证到期日期',
normalcy: '正常',
exceptions: '异常',
restart: '重启',
restartTip: '确认要重新启动网元服务吗?',
start: '启动',
startTip: '确认要启动网元服务吗?',
stop: '停止',
stopTip: '确认要停止网元服务吗?',
reload: '重载',
reloadTip: '确认要重载网元配置信息吗?',
oam: 'OAM',
log: '日志',
},
neInfo: {
version: "网元版本",
@@ -610,6 +618,17 @@ export default {
hostConfig: "终端连接配置",
rmUID: "数据资源定位标识符用于日志、告警上报等数据标记",
ipAddr: "支持IPV4/IPV6,同步变更下方配置的配置地址",
delTip: '确认删除网元信息数据项吗?',
oam: {
title: 'OAM配置',
sync: '同步到网元',
oamEnable: '服务',
oamPort: '端口',
snmpEnable: '服务',
snmpPort: '端口',
kpiEnable: '上报',
kpiTimer: '上报周期',
},
},
neHost: {
hostType: "主机类型",

View File

@@ -84,7 +84,7 @@ function fnModalVisibleByTypeAndId(neType: string, neId: string) {
kpiEnable: data.kpiConfig.enable,
kpiTimer: data.kpiConfig.timer,
});
modalState.title = 'OAM Configuration';
modalState.title = t('views.ne.neInfo.oam.title');
modalState.visibleByEdit = true;
} else {
message.error(res.msg, 3);
@@ -182,7 +182,7 @@ watch(
:labelWrap="true"
>
<a-form-item
label="Sync To NE"
:label="t('views.ne.neInfo.oam.sync')"
name="sync"
:label-col="{ span: 6 }"
:labelWrap="true"
@@ -198,7 +198,10 @@ watch(
<a-collapse-panel header="OAM">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Enable" name="from.oamEnable">
<a-form-item
:label="t('views.ne.neInfo.oam.oamEnable')"
name="oamEnable"
>
<a-switch
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
@@ -207,7 +210,11 @@ watch(
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Port" name="from.oamPort">
<a-form-item
:label="t('views.ne.neInfo.oam.oamPort')"
name="oamPort"
v-bind="modalStateFrom.validateInfos.oamPort"
>
<a-input-number
:min="3000"
:max="65535"
@@ -223,7 +230,10 @@ watch(
<a-collapse-panel header="SNMP">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Enable" name="from.snmpEnable">
<a-form-item
:label="t('views.ne.neInfo.oam.snmpEnable')"
name="snmpEnable"
>
<a-switch
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
@@ -232,7 +242,11 @@ watch(
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Port" name="from.snmpPort">
<a-form-item
:label="t('views.ne.neInfo.oam.snmpPort')"
name="snmpPort"
v-bind="modalStateFrom.validateInfos.snmpPort"
>
<a-input-number
:min="3000"
:max="65535"
@@ -248,7 +262,10 @@ watch(
<a-collapse-panel header="KPI">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Enable" name="from.kpiEnable">
<a-form-item
:label="t('views.ne.neInfo.oam.kpiEnable')"
name="kpiEnable"
>
<a-switch
:checked-children="t('common.switch.open')"
:un-checked-children="t('common.switch.shut')"
@@ -257,7 +274,11 @@ watch(
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Timer" name="from.kpiTimer">
<a-form-item
:label="t('views.ne.neInfo.oam.kpiTimer')"
name="kpiTimer"
v-bind="modalStateFrom.validateInfos.kpiTimer"
>
<a-input-number
:min="5"
:max="3600"

View File

@@ -19,34 +19,24 @@ export default function useNeOptions() {
function fnNeStart(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.neManage.totalSure', {
msg: row.neName,
oper: t('views.configManage.neManage.start'),
}),
content: t('views.ne.common.startTip'),
onOk() {
const key = 'start';
message.loading({ content: t('common.loading'), key });
const hide = message.loading(t('common.loading'), 0);
serviceNeAction({
neType: row.neType,
neId: row.neId,
action: 'start',
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.start'),
}),
key,
duration: 2,
});
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 2,
});
}
});
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
} else {
message.error(`${res.msg}`, 3);
}
})
.finally(() => {
hide();
});
},
});
}
@@ -58,46 +48,36 @@ export default function useNeOptions() {
function fnNeRestart(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.neManage.totalSure', {
msg: row.neName,
oper: t('views.configManage.neManage.restart'),
}),
content: t('views.ne.common.restartTip'),
onOk() {
const key = 'restart';
message.loading({ content: t('common.loading'), key });
const hide = message.loading(t('common.loading'), 0);
serviceNeAction({
neType: row.neType,
neId: row.neId,
action: 'restart',
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// OMC自升级
if (row.neType.toUpperCase() === 'OMC') {
if (res.code === RESULT_CODE_SUCCESS) {
lockedStore.fnLock('reload');
} else {
message.error({
content: `${res.msg}`,
duration: 3,
});
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
// OMC自升级
if (row.neType.toUpperCase() === 'OMC') {
if (res.code === RESULT_CODE_SUCCESS) {
lockedStore.fnLock('reload');
} else {
message.error({
content: `${res.msg}`,
duration: 3,
});
}
return;
}
return;
message.success(t('common.operateOk'), 3);
} else {
message.error(`${res.msg}`, 3);
}
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.restart'),
}),
key,
duration: 3,
});
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 3,
});
}
});
})
.finally(() => {
hide();
});
},
});
}
@@ -109,34 +89,24 @@ export default function useNeOptions() {
function fnNeStop(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.neManage.totalSure', {
msg: row.neName,
oper: t('views.configManage.neManage.stop'),
}),
content: t('views.ne.common.stopTip'),
onOk() {
const key = 'stop';
message.loading({ content: t('common.loading'), key });
const hide = message.loading(t('common.loading'), 0);
serviceNeAction({
neType: row.neType,
neId: row.neId,
action: 'stop',
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.stop'),
}),
key: key,
duration: 3,
});
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 3,
});
}
});
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
} else {
message.error(`${res.msg}`, 3);
}
})
.finally(() => {
hide();
});
},
});
}
@@ -148,30 +118,20 @@ export default function useNeOptions() {
function fnNeReload(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.neManage.totalSure', {
msg: row.neName,
oper: t('views.configManage.neManage.reload'),
}),
content: t('views.ne.common.reloadTip'),
onOk() {
const key = 'stopNf';
message.loading({ content: t('common.loading'), key });
updateNeConfigReload(row.neType, row.neId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.reload'),
}),
key,
duration: 2,
});
} else {
message.error({
content: `${res.msg}`,
key: key,
duration: 2,
});
}
});
const hide = message.loading(t('common.loading'), 0);
updateNeConfigReload(row.neType, row.neId)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.operateOk'), 3);
} else {
message.error(`${res.msg}`, 3);
}
})
.finally(() => {
hide();
});
},
});
}

View File

@@ -100,19 +100,19 @@ let tableColumns: ColumnsType = [
width: 150,
},
{
title: t('views.configManage.neManage.neName'),
title: t('views.ne.common.neName'),
dataIndex: 'neName',
align: 'left',
width: 150,
},
{
title: t('views.configManage.neManage.ip'),
title: t('views.ne.common.ipAddr'),
dataIndex: 'ip',
align: 'left',
width: 150,
},
{
title: t('views.configManage.neManage.port'),
title: t('views.ne.common.port'),
dataIndex: 'port',
align: 'left',
width: 100,
@@ -231,36 +231,21 @@ function fnModalEditCancel() {
*/
function fnRecordDelete(id: string) {
if (!id || modalState.confirmLoading) return;
let msg = '';
let msg = t('views.ne.neInfo.delTip');
if (id === '0') {
const neInfo: any = tableState.data.find(
(item: any) => item.id === tableState.selectedRowKeys[0]
);
if (neInfo) {
msg = neInfo.neName;
}
msg = `${msg}... ${tableState.selectedRowKeys.length}`;
id = tableState.selectedRowKeys.join(',');
} else {
const neInfo: any = tableState.data.find((item: any) => item.id === id);
if (neInfo) {
msg = neInfo.neName;
}
msg = `${msg} ...${tableState.selectedRowKeys.length}`;
}
Modal.confirm({
title: t('common.tipTitle'),
content: `确认删除网元名称为【${msg}】的数据项?`,
content: msg,
onOk() {
modalState.confirmLoading = true;
const hide = message.loading(t('common.loading'), 0);
delNeInfo(id)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `操作成功`,
duration: 3,
});
message.success(t('common.operateOk'), 3);
fnGetList(1);
} else {
message.error({
@@ -414,10 +399,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="t('views.ne.common.neType')"
name="neType "
>
<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 }))"
@@ -563,7 +545,7 @@ onMounted(() => {
<a-menu @click="({ key }:any) => fnRecordMore(key, record)">
<a-menu-item key="log">
<FileTextOutlined />
{{ t('views.configManage.neManage.log') }}
{{ t('views.ne.common.log') }}
</a-menu-item>
<a-menu-item key="start">
<ThunderboltOutlined />
@@ -616,7 +598,7 @@ onMounted(() => {
</a-tag>
</div>
<div>
<span>{{ t('views.ne.neInfo.version') }}</span>
<span>{{ t('views.ne.neVersion.version') }}</span>
<span>{{ record.serverState.version }}</span>
</div>
<div>