diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 57954f205d..2978538050 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -81,6 +81,7 @@ import { ApiCaseChangeHistoryParams, ApiCaseDependencyParams, ApiCaseDetail, + ApiCaseExecuteHistoryItem, ApiCaseExecuteHistoryParams, ApiCasePageParams, ApiDefinitionBatchDeleteParams, @@ -115,7 +116,6 @@ import { DragSortParams, ModuleTreeNode, MoveModules, - TableQueryParams, TransferFileParams, } from '@/models/common'; import { ResourcePoolItem } from '@/models/setting/resourcePool'; @@ -457,7 +457,7 @@ export function getEnvList(projectId: string) { // 获取接口用例-执行历史 export function getApiCaseExecuteHistory(data: ApiCaseExecuteHistoryParams) { - return MSR.post({ url: GetExecuteHistoryUrl, data }); + return MSR.post>({ url: GetExecuteHistoryUrl, data }); } // 获取接口用例-变更历史 diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index 596a7c8447..2f48171fc6 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -70,7 +70,7 @@ export const GetCaseDetailUrl = '/api/case/get-detail'; // 获取接口用例详 export const GetEnvListUrl = '/api/test/env-list'; // 接口测试-环境列表 export const BatchExecuteCaseUrl = '/api/case/batch/run'; // 批量执行接口用例 export const ExecuteCaseUrl = '/api/case/run/'; // 单独执行接口用例 -export const GetExecuteHistoryUrl = 'api/case/execute/page'; // 获取用的执行历史 +export const GetExecuteHistoryUrl = '/api/case/execute/page'; // 获取用的执行历史 export const GetDependencyUrl = '/api/case/get-reference'; // 获取用例的依赖关系 export const GetChangeHistoryUrl = '/api/case/operation-history/page'; // 获取用例的依赖关系 export const ToggleFollowCaseUrl = '/api/case/follow'; // 接口定义-关注/取消关注 diff --git a/frontend/src/enums/apiEnum.ts b/frontend/src/enums/apiEnum.ts index 5698cfd47e..7c1918917d 100644 --- a/frontend/src/enums/apiEnum.ts +++ b/frontend/src/enums/apiEnum.ts @@ -278,3 +278,11 @@ export enum ExecuteStatusFilters { FAKE_ERROR = 'FAKE_ERROR', STOPPED = 'STOPPED', } + +// 变更历史类型 +export enum ChangeHistoryStatusFilters { + ADD = 'ADD', + UPDATE = 'UPDATE', + IMPORT = 'IMPORT', + DELETE = 'DELETE', +} diff --git a/frontend/src/models/apiTest/management.ts b/frontend/src/models/apiTest/management.ts index eb2e402e49..74f3ff16ca 100644 --- a/frontend/src/models/apiTest/management.ts +++ b/frontend/src/models/apiTest/management.ts @@ -383,3 +383,15 @@ export interface ApiCaseChangeHistoryParams extends TableQueryParams { export interface ApiCaseDependencyParams extends TableQueryParams { resourceId: string; } + +// 用例-执行历史-请求参数 +export interface ApiCaseExecuteHistoryItem { + id: string; + num: string; + name: string; + operationUser: string; + createUser: string; + startTime: number; + status: string; + triggerMode: string; +} diff --git a/frontend/src/views/api-test/management/components/management/case/caseDetail.vue b/frontend/src/views/api-test/management/components/management/case/caseDetail.vue index 1c120a81ca..b7d138508c 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseDetail.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseDetail.vue @@ -50,12 +50,15 @@ - + + + + - + @@ -72,11 +75,12 @@ import caseLevel from '@/components/business/ms-case-associate/caseLevel.vue'; import type { CaseLevel } from '@/components/business/ms-case-associate/types'; import detailTab from '../api/preview/detail.vue'; - import history from '../api/preview/history.vue'; - import quote from '../api/preview/quote.vue'; import createAndEditCaseDrawer from './createAndEditCaseDrawer.vue'; import apiMethodName from '@/views/api-test/components/apiMethodName.vue'; import { RequestParam } from '@/views/api-test/components/requestComposition/index.vue'; + import TabCaseChangeHistory from '@/views/api-test/management/components/management/case/tabContent/tabCaseChangeHistory.vue'; + import TabCaseDependency from '@/views/api-test/management/components/management/case/tabContent/tabCaseDependency.vue'; + import TabCaseExecuteHistory from '@/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue'; import { getProtocolList } from '@/api/modules/api-test/common'; import { toggleFollowCase } from '@/api/modules/api-test/management'; diff --git a/frontend/src/views/api-test/management/components/management/case/tabContent/tabApiCaseChangeHistory.vue b/frontend/src/views/api-test/management/components/management/case/tabContent/tabApiCaseChangeHistory.vue deleted file mode 100644 index cf8afde18c..0000000000 --- a/frontend/src/views/api-test/management/components/management/case/tabContent/tabApiCaseChangeHistory.vue +++ /dev/null @@ -1,264 +0,0 @@ - - - - - diff --git a/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseChangeHistory.vue b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseChangeHistory.vue new file mode 100644 index 0000000000..ce00fb0666 --- /dev/null +++ b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseChangeHistory.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseDependency.vue b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseDependency.vue new file mode 100644 index 0000000000..dbbd4fddc6 --- /dev/null +++ b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseDependency.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue new file mode 100644 index 0000000000..86e07a03da --- /dev/null +++ b/frontend/src/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue @@ -0,0 +1,216 @@ + + + + + diff --git a/frontend/src/views/api-test/management/locale/en-US.ts b/frontend/src/views/api-test/management/locale/en-US.ts index 6a736dcf07..36f0e3f8e7 100644 --- a/frontend/src/views/api-test/management/locale/en-US.ts +++ b/frontend/src/views/api-test/management/locale/en-US.ts @@ -18,6 +18,7 @@ export default { 'apiTestManagement.moveSearchTip': 'Please enter the module name to search', 'apiTestManagement.noMatchModule': 'No matching module/api yet', 'apiTestManagement.execute': 'Execute', + 'apiTestManagement.executeMethod': 'Execute method', 'apiTestManagement.recycle.batchRecover': 'Recover', 'apiTestManagement.recycle.recoveredSuccessfully': 'recovery was successful', 'apiTestManagement.recycle.batchCleanOut': 'Completely delete', @@ -133,6 +134,7 @@ export default { 'apiTestManagement.reference': 'Reference', 'apiTestManagement.dependencies': 'Dependency', 'apiTestManagement.changeHistory': 'Change history', + 'apiTestManagement.executeHistory': 'Execute history', 'apiTestManagement.requestParams': 'Request parameters', 'apiTestManagement.responseContent': 'Response content', 'apiTestManagement.requestHeader': 'Request header', @@ -144,6 +146,7 @@ export default { 'apiTestManagement.historyListTip': 'View and compare historical changes. According to the rules set by the administrator, the change history data will be automatically deleted.', 'apiTestManagement.changeOrder': 'Change serial number', + 'apiTestManagement.order': 'Serial number', 'apiTestManagement.type': 'Type', 'apiTestManagement.recover': 'Recover', 'apiTestManagement.quote': 'Quote', @@ -200,4 +203,7 @@ export default { 'case.detail.operator': 'operator', 'case.detail.tableColumnUpdateTime': 'UpdateTime', 'case.detail.execute.success': 'Execute success', + 'case.detail.execute.history.list': 'Execution history list', + 'case.detail.dependency.list': 'Reference relationship list', + 'case.detail.resource.api': 'API', }; diff --git a/frontend/src/views/api-test/management/locale/zh-CN.ts b/frontend/src/views/api-test/management/locale/zh-CN.ts index 18e5480024..a8cd5522a4 100644 --- a/frontend/src/views/api-test/management/locale/zh-CN.ts +++ b/frontend/src/views/api-test/management/locale/zh-CN.ts @@ -18,6 +18,7 @@ export default { 'apiTestManagement.moveSearchTip': '请输入模块名称搜索', 'apiTestManagement.noMatchModule': '暂无匹配的模块/接口', 'apiTestManagement.execute': '执行', + 'apiTestManagement.executeMethod': '执行方式', 'apiTestManagement.recycle.batchRecover': '恢复', 'apiTestManagement.recycle.recoveredSuccessfully': '恢复成功', 'apiTestManagement.recycle.batchCleanOut': '彻底删除', @@ -126,6 +127,7 @@ export default { 'apiTestManagement.reference': '引用关系', 'apiTestManagement.dependencies': '依赖关系', 'apiTestManagement.changeHistory': '变更历史', + 'apiTestManagement.executeHistory': '执行历史', 'apiTestManagement.requestParams': '请求参数', 'apiTestManagement.responseContent': '响应内容', 'apiTestManagement.requestHeader': '请求头', @@ -136,6 +138,7 @@ export default { 'apiTestManagement.apiNameRequired': '接口名称不能为空', 'apiTestManagement.historyListTip': '查看、对比历史修改,根据管理员设置规则,变更历史数据将自动删除', 'apiTestManagement.changeOrder': '变更序号', + 'apiTestManagement.order': '序号', 'apiTestManagement.type': '类型', 'apiTestManagement.recover': '恢复', 'apiTestManagement.quote': '引用', @@ -192,4 +195,7 @@ export default { 'case.detail.operator': '操作人', 'case.detail.tableColumnUpdateTime': '更新时间', 'case.detail.execute.success': '执行成功', + 'case.detail.execute.history.list': '执行历史列表', + 'case.detail.dependency.list': '引用关系列表', + 'case.detail.resource.api': '接口测试', };