From 84b0575ab41563757a603e9784da78c63210a22e Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 28 Feb 2024 10:27:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20MML=E7=BD=91=E5=85=83=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8C=BA=E5=88=86=E6=8E=A5=E5=8F=A3=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mmlManage/neOperate.ts | 4 ++- src/views/mmlManage/neOperate/index.vue | 34 ++++++++++++++++++++----- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/api/mmlManage/neOperate.ts b/src/api/mmlManage/neOperate.ts index 48777a4d..a8fe280d 100644 --- a/src/api/mmlManage/neOperate.ts +++ b/src/api/mmlManage/neOperate.ts @@ -30,17 +30,19 @@ export async function getMMLByNE(neType: string) { * 发送网元的mml命令 * @param neType 网元类型 * @param neId 网元ID + * @param objectType 接口类型 * @param cmdStr 命令串 * @returns */ export async function sendMMlByNE( neType: string, neId: string, + objectType: string, cmdArr: string[] ) { // 发起请求 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', data: { mml: cmdArr }, timeout: 180_000, diff --git a/src/views/mmlManage/neOperate/index.vue b/src/views/mmlManage/neOperate/index.vue index fb94cad5..1d2d9a8b 100644 --- a/src/views/mmlManage/neOperate/index.vue +++ b/src/views/mmlManage/neOperate/index.vue @@ -48,6 +48,7 @@ let state: StateType = reactive({ key: '', operation: '', object: '', + objectType: 'mml', param: [], }, from: { @@ -102,6 +103,7 @@ function fnCleanFrom() { key: '', operation: '', object: '', + objectType: 'mml', param: [], }; state.from = {}; @@ -114,14 +116,12 @@ function fnSendMML() { } let cmdArr: string[] = []; - const operation = state.mmlSelect.operation; - const object = state.mmlSelect.object; + const { operation, object, objectType, param } = state.mmlSelect; // 根据参数取值 let argsArr: string[] = []; - const param = toRaw(state.mmlSelect.param) || []; if (operation && Array.isArray(param)) { const from = toRaw(state.from); - for (const item of param) { + for (const item of toRaw(param)) { const value = from[item.name]; // 是否必填项且有效值 @@ -175,7 +175,7 @@ function fnSendMML() { // 发送 state.from.sendLoading = true; const [neType, neId] = state.neType; - sendMMlByNE(neType, neId, cmdArr) + sendMMlByNE(neType, neId, objectType, cmdArr) .then(res => { state.from.sendLoading = false; if (res.code === RESULT_CODE_SUCCESS) { @@ -333,6 +333,7 @@ function fnNeChange(keys: any, _: any) { key: '', operation: '', object: '', + objectType: 'mml', param: {}, }; fnGetList(); @@ -352,6 +353,7 @@ function fnGetList() { for (const item of res.data) { const id = item['id']; const object = item['object']; + const objectType = item['objectType']; const operation = item['operation']; const mmlDisplay = item['mmlDisplay']; // 可选属性参数 @@ -370,20 +372,37 @@ function fnGetList() { key: item['category'], selectable: false, children: [ - { key: id, title: mmlDisplay, object, operation, param }, + { + key: id, + title: mmlDisplay, + object, + objectType, + operation, + param, + }, ], }); autoCompleteArr.push({ value: item['catDisplay'], key: item['category'], selectable: false, - options: [{ key: id, value: mmlDisplay, object, operation, param }], + options: [ + { + key: id, + value: mmlDisplay, + object, + objectType, + operation, + param, + }, + ], }); } else { treeArr[treeItemIndex].children.push({ key: id, title: mmlDisplay, object, + objectType, operation, param, }); @@ -391,6 +410,7 @@ function fnGetList() { key: id, value: mmlDisplay, object, + objectType, operation, param, });