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", neTypePlease: "Please select network element type",
neId: 'NE ID', neId: 'NE ID',
rmUid: 'Resource Unique ID', rmUid: 'Resource Unique ID',
neName: 'NE Name',
ipAddr: 'IP Addr',
port: 'Port',
serialNum: 'Serial Number', serialNum: 'Serial Number',
expiryDate: 'Expiry Date', expiryDate: 'Expiry Date',
normalcy: 'Normal', normalcy: 'Normal',
exceptions: 'Abnormal', exceptions: 'Abnormal',
restart: 'Restart', restart: 'Restart',
restartTip: 'Are you sure you want to restart the network element service?',
start: 'Start', start: 'Start',
startTip: 'Are you sure you want to start the network element service?',
stop: 'Stop', stop: 'Stop',
stopTip: 'Are you sure you want to stop the network element service?',
reload: 'Reload', reload: 'Reload',
reloadTip: 'Confirm that you want to reload the network element configuration information?',
oam: 'OAM', oam: 'OAM',
log: 'Logs',
}, },
neInfo: { neInfo: {
version: "Version", version: "Version",
@@ -610,6 +618,17 @@ export default {
hostConfig: "Connection Configuration", hostConfig: "Connection Configuration",
rmUID: "Data resource location identifiers are used for data tagging such as logging, alarm reporting, etc.", 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", 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: { neHost: {
hostType: "Type", hostType: "Type",

View File

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

View File

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

View File

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

View File

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