From 27c57d8c49fa31adbec3d9d2e241c9389068f95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Wed, 28 Aug 2024 10:39:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E4=B8=BB=E5=AD=90=E9=98=B5=E5=9C=B0v1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webs/ams-web/src/services/cmdb/module.js | 3 +- webs/ams-web/src/services/index.ts | 7 ++- .../src/services/resource/moduleInstance.ts | 3 +- .../module/attribute-pool/components/index.js | 1 - webs/ams-web/src/views/resource/menu/List.vue | 14 +++--- .../views/resource/menu/detail/AuthList.vue | 6 ++- .../ams-web/src/views/resource/menu/index.vue | 45 ++++++++++++++++--- webs/ams-web/src/views/usePostion.ts | 33 ++++++++++++++ 8 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 webs/ams-web/src/views/usePostion.ts diff --git a/webs/ams-web/src/services/cmdb/module.js b/webs/ams-web/src/services/cmdb/module.js index eab03b2..fc23888 100644 --- a/webs/ams-web/src/services/cmdb/module.js +++ b/webs/ams-web/src/services/cmdb/module.js @@ -3,6 +3,7 @@ */ import { request } from '@cmp/cmp-element' import { wrapperParams } from 'utils' +import { getSelectPosition } from '@/views/usePostion' export function getPropertiesByCode(code) { return request.get('/ims/v1/properties', { params: wrapperParams({ code }), @@ -70,7 +71,7 @@ export function getModuleGroupRoot() { } export function getModuleGroupChildren(groupId, params) { - return request.get(`${baseUrl}/group/${groupId}/children`, { params }) + return request.get(`${baseUrl}/group/${groupId}/children`, { params: { positionKey: getSelectPosition(), ...params } }) } export function getRootGroups(groupId) { diff --git a/webs/ams-web/src/services/index.ts b/webs/ams-web/src/services/index.ts index 9cd7f3f..5d9d207 100644 --- a/webs/ams-web/src/services/index.ts +++ b/webs/ams-web/src/services/index.ts @@ -1,4 +1,5 @@ import { request } from '@cmp/cmp-element' +import { getSelectPosition } from '@/views/usePostion' export function getValidateRules(type: string) { return request.get('/ams/v1/regexps', { @@ -7,7 +8,11 @@ export function getValidateRules(type: string) { } export function getPropertyByModule(moduleId: number) { - return request.get(`/ams/v1/module/${moduleId}/properties`) + return request.get(`/ams/v1/module/${moduleId}/properties`, { + params: { + positionKey: getSelectPosition(), + }, + }) } export function getModuleRelation(params: { sourceId: number; targetId: number; relationCategoryId: number }) { diff --git a/webs/ams-web/src/services/resource/moduleInstance.ts b/webs/ams-web/src/services/resource/moduleInstance.ts index 22ac9a9..0dcd030 100644 --- a/webs/ams-web/src/services/resource/moduleInstance.ts +++ b/webs/ams-web/src/services/resource/moduleInstance.ts @@ -1,8 +1,9 @@ import { request, downloadFile } from '@cmp/cmp-element' +import { getSelectPosition } from '@/views/usePostion' const baseUrl = '/ams/v1/instances' export function getInstance(params: Base.IListParams) { - return request.get(baseUrl, { params }) + return request.get(baseUrl, { params: { positionKey: getSelectPosition(), ...params } }) } export function getInstanceDetail(id: number) { return request.get(`${baseUrl}/${id}`) diff --git a/webs/ams-web/src/views/module/attribute-pool/components/index.js b/webs/ams-web/src/views/module/attribute-pool/components/index.js index 56f935d..6663009 100644 --- a/webs/ams-web/src/views/module/attribute-pool/components/index.js +++ b/webs/ams-web/src/views/module/attribute-pool/components/index.js @@ -19,7 +19,6 @@ const codeMap = new Map([ ['MULTILINETABLE', 'table-module'], ]) const vueFiles = require.context('./', true, /\.vue$/) -console.log(vueFiles) export const components = getModules(vueFiles) export function getCurrentComponent(type) { diff --git a/webs/ams-web/src/views/resource/menu/List.vue b/webs/ams-web/src/views/resource/menu/List.vue index 3b504f6..a252092 100644 --- a/webs/ams-web/src/views/resource/menu/List.vue +++ b/webs/ams-web/src/views/resource/menu/List.vue @@ -1,7 +1,7 @@