diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 1956a2e0..0d9e8a4d 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -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", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 16f6ff7e..e8d13878 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -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: "主机类型", diff --git a/src/views/ne/neInfo/components/OAMModal.vue b/src/views/ne/neInfo/components/OAMModal.vue index 175fd211..b9c56349 100644 --- a/src/views/ne/neInfo/components/OAMModal.vue +++ b/src/views/ne/neInfo/components/OAMModal.vue @@ -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" > - + - + - + - + - + - + ) { 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) { 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) { 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) { 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(); + }); }, }); } diff --git a/src/views/ne/neInfo/index.vue b/src/views/ne/neInfo/index.vue index b4cc352e..d20176d8 100644 --- a/src/views/ne/neInfo/index.vue +++ b/src/views/ne/neInfo/index.vue @@ -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(() => { - + { - {{ t('views.configManage.neManage.log') }} + {{ t('views.ne.common.log') }} @@ -616,7 +598,7 @@ onMounted(() => {
- {{ t('views.ne.neInfo.version') }}: + {{ t('views.ne.neVersion.version') }}: {{ record.serverState.version }}