fix: 网元管理更多操作提示
This commit is contained in:
@@ -334,102 +334,143 @@ function fnRecordDelete(row: Record<string, any>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件对话框弹出显示为 导出导入重启停止启动
|
* 网元导出配置
|
||||||
|
* @param row 网元编号ID
|
||||||
*/
|
*/
|
||||||
function fnFileModalVisible(type: string | number, row: Record<string, any>) {
|
function fnRecordExport(row: Record<string, any>) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: `确认导出网元编号为 【${row.id}】 的配置信息?`,
|
||||||
|
onOk() {
|
||||||
|
const key = 'exportSet';
|
||||||
|
message.loading({ content: '请稍等...', key });
|
||||||
|
exportSet(row).then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
|
message.success({
|
||||||
|
content: `导出成功`,
|
||||||
|
key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
key: key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网元重启
|
||||||
|
* @param row 网元编号ID
|
||||||
|
*/
|
||||||
|
function fnRecordRestart(row: Record<string, any>) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: `确认重启网元编号为 【${row.id}】 的网元?`,
|
||||||
|
onOk() {
|
||||||
|
const key = 'restartNf';
|
||||||
|
message.loading({ content: '请稍等...', key });
|
||||||
|
restartNf(row).then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
|
message.success({
|
||||||
|
content: `重启执行成功`,
|
||||||
|
key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
key: key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网元启动
|
||||||
|
* @param row 网元编号ID
|
||||||
|
*/
|
||||||
|
function fnRecordStart(row: Record<string, any>) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: `确认启动网元编号为 【${row.id}】 的网元?`,
|
||||||
|
onOk() {
|
||||||
|
const key = 'startNf';
|
||||||
|
message.loading({ content: '请稍等...', key });
|
||||||
|
startNf(row).then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
|
message.success({
|
||||||
|
content: `启动执行成功`,
|
||||||
|
key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
key: key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网元停止
|
||||||
|
* @param row 网元编号ID
|
||||||
|
*/
|
||||||
|
function fnRecordStop(row: Record<string, any>) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: `确认停止网元编号为 【${row.id}】 的网元?`,
|
||||||
|
onOk() {
|
||||||
|
const key = 'stopNf';
|
||||||
|
message.loading({ content: '请稍等...', key });
|
||||||
|
stopNf(row).then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
|
message.success({
|
||||||
|
content: `停止执行成功`,
|
||||||
|
key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
key: key,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录多项选择
|
||||||
|
*/
|
||||||
|
function fnRecordMore(type: string | number, row: Record<string, any>) {
|
||||||
if (type === 'export') {
|
if (type === 'export') {
|
||||||
const key = 'export';
|
fnRecordExport(row);
|
||||||
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') {
|
if (type === 'start') {
|
||||||
const key = 'start';
|
fnRecordStart(row);
|
||||||
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') {
|
if (type === 'restart') {
|
||||||
const key = 'restart';
|
fnRecordRestart(row);
|
||||||
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') {
|
if (type === 'stop') {
|
||||||
const key = 'stop';
|
fnRecordStop(row);
|
||||||
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;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,9 +629,7 @@ onMounted(() => {
|
|||||||
<template #icon><EllipsisOutlined /> </template>
|
<template #icon><EllipsisOutlined /> </template>
|
||||||
</a-button>
|
</a-button>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu
|
<a-menu @click="({ key }:any) => fnRecordMore(key, record)">
|
||||||
@click="({ key }:any) => fnFileModalVisible(key, record)"
|
|
||||||
>
|
|
||||||
<a-menu-item key="export">
|
<a-menu-item key="export">
|
||||||
<ExportOutlined />
|
<ExportOutlined />
|
||||||
{{ t('views.configManage.neManage.export') }}
|
{{ t('views.configManage.neManage.export') }}
|
||||||
@@ -604,7 +643,7 @@ onMounted(() => {
|
|||||||
{{ t('views.configManage.neManage.start') }}
|
{{ t('views.configManage.neManage.start') }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-menu-item key="restart">
|
<a-menu-item key="restart">
|
||||||
<loading-outlined />
|
<UndoOutlined />
|
||||||
{{ t('views.configManage.neManage.restart') }}
|
{{ t('views.configManage.neManage.restart') }}
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-menu-item key="stop">
|
<a-menu-item key="stop">
|
||||||
|
|||||||
Reference in New Issue
Block a user