diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 2830cbe44e..50ba1a75cd 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -1,5 +1,6 @@ import MSR from '@/api/http/index'; import { + AddCaseUrl, AddDefinitionScheduleUrl, AddDefinitionUrl, AddModuleUrl, @@ -53,6 +54,7 @@ import { import { ExecuteRequestParams } from '@/models/apiTest/common'; import { + AddApiCaseParams, ApiCaseBatchEditParams, ApiCaseBatchParams, ApiCaseDetail, @@ -342,3 +344,8 @@ export function batchEditCase(data: ApiCaseBatchEditParams) { export function dragSort(data: DragSortParams) { return MSR.post({ url: SortCaseUrl, data }); } + +// 添加接口用例 +export function addCase(data: AddApiCaseParams) { + return MSR.post({ url: AddCaseUrl, data }); +} diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index 8829515582..393acb561a 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -34,6 +34,7 @@ export const ToggleFollowDefinitionUrl = '/api/definition/follow'; // 接口定 export const OperationHistoryUrl = '/api/definition/operation-history'; // 接口定义-变更历史 export const SaveOperationHistoryUrl = '/api/definition/operation-history/save'; // 接口定义-另存变更历史为指定版本 export const RecoverOperationHistoryUrl = '/api/definition/operation-history/recover'; // 接口定义-变更历史恢复 +export const DefinitionReferenceUrl = '/api/definition/get-reference'; // 获取接口引用关系 /** * Mock @@ -42,11 +43,6 @@ 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'; // 获取接口引用关系 - /** * api回收站 */ @@ -65,3 +61,4 @@ export const DeleteCaseUrl = '/api/case/delete'; // 删除接口用例 export const BatchDeleteCaseUrl = '/api/case/batch/delete'; // 批量删除接口用例 export const BatchEditCaseUrl = '/api/case/batch/edit'; // 批量编辑接口用例 export const SortCaseUrl = '/api/case/edit/pos'; // 接口用例拖拽 +export const AddCaseUrl = '/api/case/add'; // 添加用例 diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index f0eda24eb6..24fe0dc217 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -243,9 +243,6 @@ }); const buttonDropDownVisible = ref(false); - watchEffect(() => { - console.log('innerFileList', innerFileList.value); - }); onBeforeMount(() => { // 回显文件 const defaultFiles = innerFileList.value.filter((item) => item) || []; diff --git a/frontend/src/components/business/ms-params-input/index.vue b/frontend/src/components/business/ms-params-input/index.vue index 62a24a7586..556c362d84 100644 --- a/frontend/src/components/business/ms-params-input/index.vue +++ b/frontend/src/components/business/ms-params-input/index.vue @@ -193,9 +193,6 @@
{{ t('ms.paramsInput.value') }}
-
- {{ t('ms.paramsInput.value') }} -
{{ innerValue }}
@@ -702,7 +699,7 @@ margin-bottom: 2px; font-size: 12px; line-height: 16px; - color: var(--color-text-4); + color: var(--color-text-1); } .ms-params-popover-value { min-width: 100px; diff --git a/frontend/src/components/pure/ms-detail-card/index.vue b/frontend/src/components/pure/ms-detail-card/index.vue index 88b1a9f9ce..63f94441e7 100644 --- a/frontend/src/components/pure/ms-detail-card/index.vue +++ b/frontend/src/components/pure/ms-detail-card/index.vue @@ -21,7 +21,10 @@ :style="{ width: item.width }" >
{{ t(item.locale) }}
- +
+ +
-
+
{{ item.value || '-' }}
diff --git a/frontend/src/components/pure/ms-split-box/index.vue b/frontend/src/components/pure/ms-split-box/index.vue index 19587e9dc9..6155a2f95c 100644 --- a/frontend/src/components/pure/ms-split-box/index.vue +++ b/frontend/src/components/pure/ms-split-box/index.vue @@ -21,13 +21,13 @@ >
@@ -43,13 +43,13 @@
diff --git a/frontend/src/enums/apiEnum.ts b/frontend/src/enums/apiEnum.ts index 9755be3f06..458598d10c 100644 --- a/frontend/src/enums/apiEnum.ts +++ b/frontend/src/enums/apiEnum.ts @@ -207,3 +207,9 @@ export enum RequestExtractResultMatchingRule { RANDOM = 'RANDOM', // 随机匹配 SPECIFIC = 'SPECIFIC', // 指定匹配 } +// 接口用例状态 +export enum RequestCaseStatus { + DEPRECATED = 'DEPRECATED', + PROCESSING = 'PROCESSING', + DONE = 'DONE', +} diff --git a/frontend/src/locale/en-US/common.ts b/frontend/src/locale/en-US/common.ts index 3dd2d2b125..66a8d3ef2b 100644 --- a/frontend/src/locale/en-US/common.ts +++ b/frontend/src/locale/en-US/common.ts @@ -131,4 +131,5 @@ export default { 'common.unFollowSuccess': 'Unfollow successfully', 'common.share': 'Share', 'common.notRemind': `Don't remind again`, + 'common.status': 'Status', }; diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 322cb8bd26..7ac3d7d7fc 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -134,4 +134,5 @@ export default { 'common.unFollowSuccess': '取消关注成功', 'common.share': '分享', 'common.notRemind': '不再提醒', + 'common.status': '状态', }; diff --git a/frontend/src/models/apiTest/management.ts b/frontend/src/models/apiTest/management.ts index ccc054bb2f..d47eea895a 100644 --- a/frontend/src/models/apiTest/management.ts +++ b/frontend/src/models/apiTest/management.ts @@ -331,3 +331,11 @@ export interface ApiCaseBatchEditParams extends ApiCaseBatchParams { environmentId?: string; type: string; } +// 添加用例参数 +export interface AddApiCaseParams extends ExecuteRequestParams { + name: string; + priority: string; + status: string; + apiDefinitionId: string | number; + tags: string[]; +} diff --git a/frontend/src/models/projectManagement/environmental.ts b/frontend/src/models/projectManagement/environmental.ts index 597154e78d..fbecad7e67 100644 --- a/frontend/src/models/projectManagement/environmental.ts +++ b/frontend/src/models/projectManagement/environmental.ts @@ -51,6 +51,7 @@ export interface CommonParams { [key: string]: any; } export interface EnvConfig { + id?: string; commonParams?: CommonParams; commonVariables: EnvConfigItem[]; httpConfig: EnvConfigItem[]; diff --git a/frontend/src/views/api-test/components/condition/content.vue b/frontend/src/views/api-test/components/condition/content.vue index 8a740dd7db..3730841ec9 100644 --- a/frontend/src/views/api-test/components/condition/content.vue +++ b/frontend/src/views/api-test/components/condition/content.vue @@ -273,7 +273,7 @@
@@ -309,7 +310,7 @@
([]); onBeforeMount(async () => { try { + // TODO:数据从外面传进来 protocolList.value = await getProtocolList(appStore.currentOrgId); } catch (error) { + // eslint-disable-next-line no-console console.log(error); } }); @@ -899,12 +902,6 @@ if (!result){ line-height: 16px; color: var(--color-text-1); } - .param-popover-subtitle { - margin-bottom: 2px; - font-size: 12px; - line-height: 16px; - color: var(--color-text-4); - } .param-popover-value { min-width: 100px; max-width: 280px; diff --git a/frontend/src/views/api-test/components/config.ts b/frontend/src/views/api-test/components/config.ts index 893cd6e04a..1252f18ad3 100644 --- a/frontend/src/views/api-test/components/config.ts +++ b/frontend/src/views/api-test/components/config.ts @@ -5,7 +5,13 @@ import { KeyValueParam, ResponseDefinition, } from '@/models/apiTest/common'; -import { RequestContentTypeEnum, RequestParamsType, ResponseBodyFormat, ResponseComposition } from '@/enums/apiEnum'; +import { + RequestCaseStatus, + RequestContentTypeEnum, + RequestParamsType, + ResponseBodyFormat, + ResponseComposition, +} from '@/enums/apiEnum'; // 请求 body 参数表格默认行的值 export const defaultBodyParamsItem: ExecuteRequestFormBodyFormValue = { @@ -83,3 +89,18 @@ export const defaultKeyValueParamItem: KeyValueParam = { // 请求的响应 response 的响应状态码集合 export const statusCodes = [200, 201, 202, 203, 204, 205, 400, 401, 402, 403, 404, 405, 500, 501, 502, 503, 504, 505]; + +// 用例等级选项 +export const casePriorityOptions = [ + { label: 'P0', value: 'P0' }, + { label: 'P1', value: 'P1' }, + { label: 'P2', value: 'P2' }, + { label: 'P3', value: 'P3' }, +]; + +// 用例状态选项 +export const caseStatusOptions = [ + { label: 'apiTestManagement.processing', value: RequestCaseStatus.PROCESSING }, + { label: 'apiTestManagement.deprecate', value: RequestCaseStatus.DEPRECATED }, + { label: 'apiTestManagement.done', value: RequestCaseStatus.DONE }, +]; diff --git a/frontend/src/views/api-test/components/paramDescInput.vue b/frontend/src/views/api-test/components/paramDescInput.vue index d2984e6313..c7d2a97c70 100644 --- a/frontend/src/views/api-test/components/paramDescInput.vue +++ b/frontend/src/views/api-test/components/paramDescInput.vue @@ -66,12 +66,6 @@ line-height: 16px; color: var(--color-text-1); } - .param-popover-subtitle { - margin-bottom: 2px; - font-size: 12px; - line-height: 16px; - color: var(--color-text-4); - } .param-popover-value { min-width: 100px; max-width: 280px; diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 63b28d3016..60dbcc5e7b 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -1,5 +1,5 @@ @@ -138,132 +138,251 @@
-
+
+ +
+
- diff --git a/frontend/src/views/api-test/management/components/moduleTree.vue b/frontend/src/views/api-test/management/components/moduleTree.vue index e6a3911c4b..5cdea448cd 100644 --- a/frontend/src/views/api-test/management/components/moduleTree.vue +++ b/frontend/src/views/api-test/management/components/moduleTree.vue @@ -32,7 +32,8 @@ :content="isExpandApi ? t('apiTestManagement.collapseApi') : t('apiTestManagement.expandApi')" > - + + diff --git a/frontend/src/views/api-test/management/index.vue b/frontend/src/views/api-test/management/index.vue index 0ac5d40793..6cfcb24d94 100644 --- a/frontend/src/views/api-test/management/index.vue +++ b/frontend/src/views/api-test/management/index.vue @@ -1,8 +1,8 @@