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

@@ -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();
});
},
});
}