--新增网元的导出 重启 停止 启动按钮
This commit is contained in:
@@ -140,3 +140,56 @@ export async function getNelistAll() {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出网元配置文件
|
||||
* @param
|
||||
* @returns bolb
|
||||
*/
|
||||
export function exportSet(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/cm?ne_id=${data.neId}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启动网元
|
||||
* @param
|
||||
* @returns bolb
|
||||
*/
|
||||
export function startNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/start?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重启网元
|
||||
* @param
|
||||
* @returns bolb
|
||||
*/
|
||||
export function restartNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/restart?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止网元
|
||||
* @param
|
||||
* @returns bolb
|
||||
*/
|
||||
export function stopNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/stop?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
@@ -103,6 +103,13 @@ export default {
|
||||
tipBtn: 'Go to login',
|
||||
},
|
||||
configManage: {
|
||||
neManage: {
|
||||
restart: 'Restart',
|
||||
stop: 'Stop',
|
||||
start: 'Start',
|
||||
export: 'Export',
|
||||
import: 'Import',
|
||||
},
|
||||
backupManage: {
|
||||
setBackupTask: 'Set automatic backup time',
|
||||
neTypePlease: 'Query network element type',
|
||||
|
||||
@@ -103,6 +103,13 @@ export default {
|
||||
tipBtn: '前往登录',
|
||||
},
|
||||
configManage: {
|
||||
neManage: {
|
||||
restart: '重启',
|
||||
stop: '停止',
|
||||
start: '启动',
|
||||
export: '导出',
|
||||
import: '导入',
|
||||
},
|
||||
backupManage: {
|
||||
setBackupTask: '设置自动备份时间',
|
||||
neTypePlease: '查询网元类型',
|
||||
|
||||
@@ -12,6 +12,10 @@ import {
|
||||
addNeInfo,
|
||||
updateNeInfo,
|
||||
delNeInfo,
|
||||
exportSet,
|
||||
startNf,
|
||||
restartNf,
|
||||
stopNf,
|
||||
} from '@/api/configManage/neManage';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
@@ -329,6 +333,106 @@ function fnRecordDelete(row: Record<string, any>) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件对话框弹出显示为 导出导入重启停止启动
|
||||
*/
|
||||
function fnFileModalVisible(type: string | number, row: Record<string, any>) {
|
||||
if (type === 'export') {
|
||||
const key = 'export';
|
||||
console.log(toRaw(row));
|
||||
message.loading({ content: '请稍等...', key });
|
||||
tableState.loading = true;
|
||||
exportSet(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `导出成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
// fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (type === 'start') {
|
||||
const key = 'start';
|
||||
console.log(toRaw(row));
|
||||
message.loading({ content: '请稍等...', key });
|
||||
tableState.loading = true;
|
||||
startNf(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `启动成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
// fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (type === 'restart') {
|
||||
const key = 'restart';
|
||||
console.log(toRaw(row));
|
||||
message.loading({ content: '请稍等...', key });
|
||||
tableState.loading = true;
|
||||
restartNf(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `重启成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
// fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
if (type === 'stop') {
|
||||
const key = 'stop';
|
||||
console.log(toRaw(row));
|
||||
message.loading({ content: '请稍等...', key });
|
||||
tableState.loading = true;
|
||||
stopNf(row).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `重启成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
// fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**查询网元列表 */
|
||||
function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
@@ -474,6 +578,43 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.moreText') }}</template>
|
||||
<a-dropdown
|
||||
placement="bottomRight"
|
||||
:trigger="['hover', 'click']"
|
||||
>
|
||||
<a-button type="link">
|
||||
<template #icon><EllipsisOutlined /> </template>
|
||||
</a-button>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
@click="({ key }:any) => fnFileModalVisible(key, record)"
|
||||
>
|
||||
<a-menu-item key="export">
|
||||
<ExportOutlined />
|
||||
{{ t('views.configManage.neManage.export') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="import">
|
||||
<ImportOutlined />
|
||||
{{ t('views.configManage.neManage.import') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="start">
|
||||
<thunderbolt-outlined />
|
||||
{{ t('views.configManage.neManage.start') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="restart">
|
||||
<loading-outlined />
|
||||
{{ t('views.configManage.neManage.restart') }}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="stop">
|
||||
<pause-outlined />
|
||||
{{ t('views.configManage.neManage.stop') }}
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user