diff --git a/frontend/src/api/modules/project-management/envManagement.ts b/frontend/src/api/modules/project-management/envManagement.ts index 5c0285507d..6fe01d5b12 100644 --- a/frontend/src/api/modules/project-management/envManagement.ts +++ b/frontend/src/api/modules/project-management/envManagement.ts @@ -3,13 +3,15 @@ import { FileItem } from '@arco-design/web-vue'; import MSR from '@/api/http/index'; import * as envURL from '@/api/requrls/project-management/envManagement'; +import { DragCase } from '@/models/caseManagement/featureCase'; import type { + DragParam, EnvDetailItem, EnvGroupListItem, - EnvGroupProjectListItem, EnvListItem, EnvPluginListItem, GlobalParams, + GroupItem, ProjectOptionItem, } from '@/models/projectManagement/environmental'; import { OptionsItem } from '@/models/setting/log'; @@ -56,24 +58,27 @@ export function getDetailEnv(id: string) { export function deleteEnv(data: EnvListItem) { return MSR.post({ url: envURL.deleteEnvUrl, data }); } -export function groupUpdateEnv(data: EnvListItem) { +export function groupUpdateEnv(data: any) { return MSR.post({ url: envURL.groupUpdateEnvUrl, data }); } export function groupListEnv(data: { projectId: string; keyword: string }) { return MSR.post({ url: envURL.groupListEnvUrl, data }); } -export function groupEditPosEnv(data: EnvGroupListItem) { +export function groupEditPosEnv(data: DragParam) { return MSR.post({ url: envURL.groupEditPosEnvUrl, data }); } -export function groupAddEnv(data: EnvGroupListItem) { +export function groupAddEnv(data: any) { return MSR.post({ url: envURL.groupAddEnvUrl, data }); } +export function deleteEnvGroup(id: string) { + return MSR.get({ url: envURL.groupDeleteEnvUrl + id }); +} export function getEnvPlugin(projectId: string) { return MSR.get({ url: envURL.getEnvPluginUrl + projectId }); } // 项目管理-项目组-详情 -export function groupDetailEnv(id: string) { - return MSR.get({ url: `${envURL.groupDetailEnvUrl}${id}` }); +export function getGroupDetailEnv(id: string) { + return MSR.get({ url: `${envURL.groupDetailEnvUrl}${id}` }); } export function groupDeleteEnv(data: EnvListItem) { return MSR.post({ url: envURL.groupDeleteEnvUrl, data }); diff --git a/frontend/src/enums/envEnum.ts b/frontend/src/enums/envEnum.ts index 73128c5fc5..7c75b1ebd6 100644 --- a/frontend/src/enums/envEnum.ts +++ b/frontend/src/enums/envEnum.ts @@ -7,4 +7,5 @@ export enum EnvAuthTypeEnum { GLOBAL = 'GLOBAL', // 全局参数 ENVIRONMENT = 'ENVIRONMENT', // 环境 ENVIRONMENT_PARAM = 'ENVIRONMENT_PARAM', // 环境参数 + ENVIRONMENT_GROUP = 'ENVIRONMENT_GROUP', // 环境组 } diff --git a/frontend/src/models/caseManagement/featureCase.ts b/frontend/src/models/caseManagement/featureCase.ts index 348ff3365e..f168e49a98 100644 --- a/frontend/src/models/caseManagement/featureCase.ts +++ b/frontend/src/models/caseManagement/featureCase.ts @@ -350,9 +350,10 @@ export interface ChangeHistoryItem { createUserName: string; versionName: string; } -//取消前后置依赖关系 + +// 取消前后置依赖关系 export interface DeleteDependencyParams { id: string; caseId: string; type: string; -} \ No newline at end of file +} diff --git a/frontend/src/models/projectManagement/environmental.ts b/frontend/src/models/projectManagement/environmental.ts index a0a583428c..a47bdf0005 100644 --- a/frontend/src/models/projectManagement/environmental.ts +++ b/frontend/src/models/projectManagement/environmental.ts @@ -89,3 +89,23 @@ export interface EnvPluginListItem { pluginId: string; script: EnvPluginScript; } + +export interface EnvGroupProjectItem { + projectId: string; + environmentId: string; +} + +export interface GroupItem { + id: string; + name: string; + description: string; + projectId: string; + envGroupProject: EnvGroupProjectItem[]; +} + +export interface DragParam { + projectId: string; + targetId: string; + moveMode: string; + moveId: string; +} diff --git a/frontend/src/store/modules/setting/useProjectEnvStore.ts b/frontend/src/store/modules/setting/useProjectEnvStore.ts index 25dc66114f..6b88d9ab9c 100644 --- a/frontend/src/store/modules/setting/useProjectEnvStore.ts +++ b/frontend/src/store/modules/setting/useProjectEnvStore.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia'; import localforage from 'localforage'; -import { getDetailEnv, getGlobalParamDetail, groupDetailEnv } from '@/api/modules/project-management/envManagement'; +import { getDetailEnv, getGlobalParamDetail } from '@/api/modules/project-management/envManagement'; import { useAppStore } from '@/store'; import { isArraysEqualWithOrder } from '@/utils/equal'; @@ -21,8 +21,6 @@ const useProjectEnvStore = defineStore( const currentEnvDetailInfo = ref({ projectId: '', name: '', config: {} }); // 当前选中的环境详情 const backupEnvDetailInfo = ref({ projectId: '', name: '', config: {} }); // 当前选中的环境详情-备份 const allParamDetailInfo = ref(); // 全局参数详情 - // 当前选中的项目组详情 - const groupDetailInfo = ref(); const httpNoWarning = ref(true); const getHttpNoWarning = computed(() => httpNoWarning.value); @@ -62,16 +60,6 @@ const useProjectEnvStore = defineStore( console.log(e); } } - // 初始化项目组详情 - async function initGroupDetail() { - try { - const id = currentGroupId.value; - groupDetailInfo.value = await groupDetailEnv(id); - } catch (e) { - // eslint-disable-next-line no-console - console.log(e); - } - } // 初始化内容tab列表 async function initContentTabList(arr: ContentTabItem[]) { @@ -127,13 +115,11 @@ const useProjectEnvStore = defineStore( allParamDetailInfo, currentEnvDetailInfo, backupEnvDetailInfo, - groupDetailInfo, setCurrentId, setCurrentGroupId, setHttpNoWarning, setAllParamDetailInfo, initEnvDetail, - initGroupDetail, initContentTabList, getContentTabList, setContentTabList, diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 0b6c3f1170..82495e5d13 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -338,15 +338,16 @@