fix: 网元服务操作接口

This commit is contained in:
TsMask
2024-04-12 20:18:01 +08:00
parent 6bc10babba
commit 4e7fb90544
3 changed files with 50 additions and 17 deletions

View File

@@ -140,3 +140,16 @@ export function saveConfigFile(data: Record<string, any>) {
data: data,
});
}
/**
* 网元服务操作
* @param data 对象 {neType,neId,action}
* @returns object
*/
export function serviceNeAction(data: Record<string, any>) {
return request({
url: `/ne/action/service`,
method: 'put',
data: data,
});
}

View File

@@ -4,10 +4,13 @@ import { Modal, message } from 'ant-design-vue/lib';
import useI18n from '@/hooks/useI18n';
import { useRouter } from 'vue-router';
import { updateNeConfigReload } from '@/api/configManage/configParam';
import { serviceNeAction } from '@/api/ne/neInfo';
import useLockedStore from '@/store/modules/locked';
export default function useNeOptions() {
const router = useRouter();
const { t } = useI18n();
const lockedStore = useLockedStore();
/**
* 网元启动
@@ -21,9 +24,13 @@ export default function useNeOptions() {
oper: t('views.configManage.neManage.start'),
}),
onOk() {
const key = 'startNf';
const key = 'start';
message.loading({ content: t('common.loading'), key });
startNf(row).then(res => {
serviceNeAction({
neType: row.neType,
neId: row.neId,
action: 'start',
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {
@@ -56,10 +63,26 @@ export default function useNeOptions() {
oper: t('views.configManage.neManage.restart'),
}),
onOk() {
const key = 'restartNf';
const key = 'restart';
message.loading({ content: t('common.loading'), key });
restartNf(row).then(res => {
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,
});
}
return;
}
message.success({
content: t('common.msgSuccess', {
msg: t('views.configManage.neManage.restart'),
@@ -91,9 +114,13 @@ export default function useNeOptions() {
oper: t('views.configManage.neManage.stop'),
}),
onOk() {
const key = 'restartNf';
const key = 'stop';
message.loading({ content: t('common.loading'), key });
stopNf(row).then(res => {
serviceNeAction({
neType: row.neType,
neId: row.neId,
action: 'stop',
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', {

View File

@@ -554,17 +554,6 @@ onMounted(() => {
<template #icon><UndoOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>
{{ t('views.configManage.neManage.stop') }}
</template>
<a-button
type="link"
@click.prevent="fnRecordMore('stop', record)"
>
<template #icon><CloseSquareOutlined /> </template>
</a-button>
</a-tooltip>
<a-tooltip placement="left">
<template #title>{{ t('common.moreText') }}</template>
<a-dropdown placement="bottomRight" trigger="click">
@@ -581,6 +570,10 @@ onMounted(() => {
<ThunderboltOutlined />
{{ t('views.configManage.neManage.start') }}
</a-menu-item>
<a-menu-item key="stop">
<CloseSquareOutlined />
{{ t('views.configManage.neManage.stop') }}
</a-menu-item>
<a-menu-item
key="reload"
v-if="