feat: MML网元操作支持区分接口类型
This commit is contained in:
@@ -30,17 +30,19 @@ export async function getMMLByNE(neType: string) {
|
|||||||
* 发送网元的mml命令
|
* 发送网元的mml命令
|
||||||
* @param neType 网元类型
|
* @param neType 网元类型
|
||||||
* @param neId 网元ID
|
* @param neId 网元ID
|
||||||
|
* @param objectType 接口类型
|
||||||
* @param cmdStr 命令串
|
* @param cmdStr 命令串
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export async function sendMMlByNE(
|
export async function sendMMlByNE(
|
||||||
neType: string,
|
neType: string,
|
||||||
neId: string,
|
neId: string,
|
||||||
|
objectType: string,
|
||||||
cmdArr: string[]
|
cmdArr: string[]
|
||||||
) {
|
) {
|
||||||
// 发起请求
|
// 发起请求
|
||||||
const result = await request({
|
const result = await request({
|
||||||
url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/${objectType}?ne_id=${neId}`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: { mml: cmdArr },
|
data: { mml: cmdArr },
|
||||||
timeout: 180_000,
|
timeout: 180_000,
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ let state: StateType = reactive({
|
|||||||
key: '',
|
key: '',
|
||||||
operation: '',
|
operation: '',
|
||||||
object: '',
|
object: '',
|
||||||
|
objectType: 'mml',
|
||||||
param: [],
|
param: [],
|
||||||
},
|
},
|
||||||
from: {
|
from: {
|
||||||
@@ -102,6 +103,7 @@ function fnCleanFrom() {
|
|||||||
key: '',
|
key: '',
|
||||||
operation: '',
|
operation: '',
|
||||||
object: '',
|
object: '',
|
||||||
|
objectType: 'mml',
|
||||||
param: [],
|
param: [],
|
||||||
};
|
};
|
||||||
state.from = {};
|
state.from = {};
|
||||||
@@ -114,14 +116,12 @@ function fnSendMML() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let cmdArr: string[] = [];
|
let cmdArr: string[] = [];
|
||||||
const operation = state.mmlSelect.operation;
|
const { operation, object, objectType, param } = state.mmlSelect;
|
||||||
const object = state.mmlSelect.object;
|
|
||||||
// 根据参数取值
|
// 根据参数取值
|
||||||
let argsArr: string[] = [];
|
let argsArr: string[] = [];
|
||||||
const param = toRaw(state.mmlSelect.param) || [];
|
|
||||||
if (operation && Array.isArray(param)) {
|
if (operation && Array.isArray(param)) {
|
||||||
const from = toRaw(state.from);
|
const from = toRaw(state.from);
|
||||||
for (const item of param) {
|
for (const item of toRaw(param)) {
|
||||||
const value = from[item.name];
|
const value = from[item.name];
|
||||||
|
|
||||||
// 是否必填项且有效值
|
// 是否必填项且有效值
|
||||||
@@ -175,7 +175,7 @@ function fnSendMML() {
|
|||||||
// 发送
|
// 发送
|
||||||
state.from.sendLoading = true;
|
state.from.sendLoading = true;
|
||||||
const [neType, neId] = state.neType;
|
const [neType, neId] = state.neType;
|
||||||
sendMMlByNE(neType, neId, cmdArr)
|
sendMMlByNE(neType, neId, objectType, cmdArr)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
state.from.sendLoading = false;
|
state.from.sendLoading = false;
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
@@ -333,6 +333,7 @@ function fnNeChange(keys: any, _: any) {
|
|||||||
key: '',
|
key: '',
|
||||||
operation: '',
|
operation: '',
|
||||||
object: '',
|
object: '',
|
||||||
|
objectType: 'mml',
|
||||||
param: {},
|
param: {},
|
||||||
};
|
};
|
||||||
fnGetList();
|
fnGetList();
|
||||||
@@ -352,6 +353,7 @@ function fnGetList() {
|
|||||||
for (const item of res.data) {
|
for (const item of res.data) {
|
||||||
const id = item['id'];
|
const id = item['id'];
|
||||||
const object = item['object'];
|
const object = item['object'];
|
||||||
|
const objectType = item['objectType'];
|
||||||
const operation = item['operation'];
|
const operation = item['operation'];
|
||||||
const mmlDisplay = item['mmlDisplay'];
|
const mmlDisplay = item['mmlDisplay'];
|
||||||
// 可选属性参数
|
// 可选属性参数
|
||||||
@@ -370,20 +372,37 @@ function fnGetList() {
|
|||||||
key: item['category'],
|
key: item['category'],
|
||||||
selectable: false,
|
selectable: false,
|
||||||
children: [
|
children: [
|
||||||
{ key: id, title: mmlDisplay, object, operation, param },
|
{
|
||||||
|
key: id,
|
||||||
|
title: mmlDisplay,
|
||||||
|
object,
|
||||||
|
objectType,
|
||||||
|
operation,
|
||||||
|
param,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
autoCompleteArr.push({
|
autoCompleteArr.push({
|
||||||
value: item['catDisplay'],
|
value: item['catDisplay'],
|
||||||
key: item['category'],
|
key: item['category'],
|
||||||
selectable: false,
|
selectable: false,
|
||||||
options: [{ key: id, value: mmlDisplay, object, operation, param }],
|
options: [
|
||||||
|
{
|
||||||
|
key: id,
|
||||||
|
value: mmlDisplay,
|
||||||
|
object,
|
||||||
|
objectType,
|
||||||
|
operation,
|
||||||
|
param,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
treeArr[treeItemIndex].children.push({
|
treeArr[treeItemIndex].children.push({
|
||||||
key: id,
|
key: id,
|
||||||
title: mmlDisplay,
|
title: mmlDisplay,
|
||||||
object,
|
object,
|
||||||
|
objectType,
|
||||||
operation,
|
operation,
|
||||||
param,
|
param,
|
||||||
});
|
});
|
||||||
@@ -391,6 +410,7 @@ function fnGetList() {
|
|||||||
key: id,
|
key: id,
|
||||||
value: mmlDisplay,
|
value: mmlDisplay,
|
||||||
object,
|
object,
|
||||||
|
objectType,
|
||||||
operation,
|
operation,
|
||||||
param,
|
param,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user