fix: 网元服务操作接口
This commit is contained in:
@@ -140,3 +140,16 @@ export function saveConfigFile(data: Record<string, any>) {
|
|||||||
data: data,
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,10 +4,13 @@ import { Modal, message } from 'ant-design-vue/lib';
|
|||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { updateNeConfigReload } from '@/api/configManage/configParam';
|
import { updateNeConfigReload } from '@/api/configManage/configParam';
|
||||||
|
import { serviceNeAction } from '@/api/ne/neInfo';
|
||||||
|
import useLockedStore from '@/store/modules/locked';
|
||||||
|
|
||||||
export default function useNeOptions() {
|
export default function useNeOptions() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const lockedStore = useLockedStore();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网元启动
|
* 网元启动
|
||||||
@@ -21,9 +24,13 @@ export default function useNeOptions() {
|
|||||||
oper: t('views.configManage.neManage.start'),
|
oper: t('views.configManage.neManage.start'),
|
||||||
}),
|
}),
|
||||||
onOk() {
|
onOk() {
|
||||||
const key = 'startNf';
|
const key = 'start';
|
||||||
message.loading({ content: t('common.loading'), key });
|
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) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('common.msgSuccess', {
|
content: t('common.msgSuccess', {
|
||||||
@@ -56,10 +63,26 @@ export default function useNeOptions() {
|
|||||||
oper: t('views.configManage.neManage.restart'),
|
oper: t('views.configManage.neManage.restart'),
|
||||||
}),
|
}),
|
||||||
onOk() {
|
onOk() {
|
||||||
const key = 'restartNf';
|
const key = 'restart';
|
||||||
message.loading({ content: t('common.loading'), key });
|
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) {
|
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({
|
message.success({
|
||||||
content: t('common.msgSuccess', {
|
content: t('common.msgSuccess', {
|
||||||
msg: t('views.configManage.neManage.restart'),
|
msg: t('views.configManage.neManage.restart'),
|
||||||
@@ -91,9 +114,13 @@ export default function useNeOptions() {
|
|||||||
oper: t('views.configManage.neManage.stop'),
|
oper: t('views.configManage.neManage.stop'),
|
||||||
}),
|
}),
|
||||||
onOk() {
|
onOk() {
|
||||||
const key = 'restartNf';
|
const key = 'stop';
|
||||||
message.loading({ content: t('common.loading'), key });
|
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) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('common.msgSuccess', {
|
content: t('common.msgSuccess', {
|
||||||
|
|||||||
@@ -554,17 +554,6 @@ onMounted(() => {
|
|||||||
<template #icon><UndoOutlined /></template>
|
<template #icon><UndoOutlined /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</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">
|
<a-tooltip placement="left">
|
||||||
<template #title>{{ t('common.moreText') }}</template>
|
<template #title>{{ t('common.moreText') }}</template>
|
||||||
<a-dropdown placement="bottomRight" trigger="click">
|
<a-dropdown placement="bottomRight" trigger="click">
|
||||||
@@ -581,6 +570,10 @@ onMounted(() => {
|
|||||||
<ThunderboltOutlined />
|
<ThunderboltOutlined />
|
||||||
{{ t('views.configManage.neManage.start') }}
|
{{ t('views.configManage.neManage.start') }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
|
<a-menu-item key="stop">
|
||||||
|
<CloseSquareOutlined />
|
||||||
|
{{ t('views.configManage.neManage.stop') }}
|
||||||
|
</a-menu-item>
|
||||||
<a-menu-item
|
<a-menu-item
|
||||||
key="reload"
|
key="reload"
|
||||||
v-if="
|
v-if="
|
||||||
|
|||||||
Reference in New Issue
Block a user