From 23b792bac590a6c702f1595163dd1e282391c704 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 12 Mar 2024 16:29:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=85=B3=E7=B3=BB=E8=BF=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/api-test/management.ts | 7 +++++++ .../src/api/requrls/api-test/management.ts | 5 +++++ frontend/src/models/apiTest/management.ts | 5 +++++ .../management/api/preview/quote.vue | 20 +++---------------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 275587e253..8d36aadcef 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -10,6 +10,7 @@ import { DebugDefinitionUrl, DefinitionMockPageUrl, DefinitionPageUrl, + DefinitionReferenceUrl, DeleteDefinitionScheduleUrl, DeleteDefinitionUrl, DeleteMockUrl, @@ -55,6 +56,7 @@ import { CreateImportApiDefinitionScheduleParams, DefinitionHistoryItem, DefinitionHistoryPageParams, + DefinitionReferencePageParams, EnvModule, ImportApiDefinitionParams, mockParams, @@ -230,6 +232,11 @@ export function recoverOperationHistory(data: RecoverDefinitionParams) { return MSR.post({ url: RecoverOperationHistoryUrl, data }); } +// 接口定义-引用关系 +export function getDefinitionReference(data: DefinitionReferencePageParams) { + return MSR.post({ url: DefinitionReferenceUrl, data }); +} + /** * Mock */ diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index 36d02b0a21..45baf9786f 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -41,3 +41,8 @@ export const RecoverOperationHistoryUrl = '/api/definition/operation-history/rec export const DefinitionMockPageUrl = '/api/definition/mock/page'; // mock列表 export const UpdateMockStatusUrl = '/api/definition/mock/enable/'; // 更新mock状态 export const DeleteMockUrl = '/api/definition/mock/delete'; // 刪除mock + +/** + * 接口引用关系 + */ +export const DefinitionReferenceUrl = '/api/definition/get-reference'; // 获取接口引用关系 diff --git a/frontend/src/models/apiTest/management.ts b/frontend/src/models/apiTest/management.ts index bf6202c08f..acfa34780f 100644 --- a/frontend/src/models/apiTest/management.ts +++ b/frontend/src/models/apiTest/management.ts @@ -257,3 +257,8 @@ export interface RecoverDefinitionParams { sourceId: string | number; versionId?: string; } + +// 引用关系列表查询参数 +export interface DefinitionReferencePageParams extends TableQueryParams { + resourceId: string; +} diff --git a/frontend/src/views/api-test/management/components/management/api/preview/quote.vue b/frontend/src/views/api-test/management/components/management/api/preview/quote.vue index 1fae6f6be3..9db93b7a05 100644 --- a/frontend/src/views/api-test/management/components/management/api/preview/quote.vue +++ b/frontend/src/views/api-test/management/components/management/api/preview/quote.vue @@ -24,6 +24,7 @@ import { MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; + import { getDefinitionReference } from '@/api/modules/api-test/management'; import { useI18n } from '@/hooks/useI18n'; import useAppStore from '@/store/modules/app'; @@ -78,20 +79,7 @@ }, ]; const { propsRes, propsEvent, loadList, setLoadListParams } = useTable( - () => - Promise.resolve({ - list: [ - { - id: '1', - resourceName: '资源名称', - resourceType: '资源类型', - quoteType: '引用类型', - belongOrg: '所属组织', - belongProject: '所属项目', - }, - ], - total: 1, - }), + getDefinitionReference, { columns, scroll: { x: '100%' }, @@ -106,9 +94,7 @@ function loadQuoteList() { setLoadListParams({ - projectId: appStore.currentProjectId, - sourceId: props.sourceId, - keyword: keyword.value, + resourceId: props.sourceId, }); loadList(); }