-
+
();
+ const appStore = useAppStore();
const { copy, isSupported } = useClipboard({ legacy: true });
const { t } = useI18n();
const { openModal } = useModal();
@@ -221,11 +222,6 @@
const protocols = inject[>('protocols');
- const currentEnvConfigByInject = inject][>('currentEnvConfig');
- const environmentId = computed(() =>
- props.isDrawer ? environmentIdByDrawer.value : currentEnvConfigByInject?.value?.id
- );
-
const executeHistoryRef = ref>();
function changeActiveKey(val: string | number) {
if (val === 'executeHistory') {
@@ -275,7 +271,7 @@
let res;
const params = {
id: caseDetail.value.id as string,
- environmentId: environmentId.value,
+ environmentId: appStore.currentEnvConfig?.id || '',
frontendDebug: executeType === 'localExec',
reportId: reportId.value,
apiDefinitionId: caseDetail.value.apiDefinitionId,
diff --git a/frontend/src/views/api-test/management/components/management/case/caseTable.vue b/frontend/src/views/api-test/management/components/management/case/caseTable.vue
index 6724af56bd..5e54bef45e 100644
--- a/frontend/src/views/api-test/management/components/management/case/caseTable.vue
+++ b/frontend/src/views/api-test/management/components/management/case/caseTable.vue
@@ -585,7 +585,7 @@
slotName: 'operation',
dataIndex: 'operation',
fixed: 'right',
- width: hasOperationPermission.value ? 220 : 50,
+ width: hasOperationPermission.value ? 200 : 50,
},
];
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(getCasePage, {
diff --git a/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue b/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue
index d056f2848d..2baccef473 100644
--- a/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue
+++ b/frontend/src/views/api-test/management/components/management/case/createAndEditCaseDrawer.vue
@@ -34,7 +34,7 @@
:max-length="255"
show-word-limit
/>
-
+
@@ -100,9 +99,9 @@
import MsTagsInput from '@/components/pure/ms-tags-input/index.vue';
import caseLevel from '@/components/business/ms-case-associate/caseLevel.vue';
import type { CaseLevel } from '@/components/business/ms-case-associate/types';
+ import MsEnvironmentSelect from '@/components/business/ms-environment-select/index.vue';
import apiMethodName from '@/views/api-test/components/apiMethodName.vue';
import apiStatus from '@/views/api-test/components/apiStatus.vue';
- import environmentSelect from '@/views/api-test/components/environmentSelect.vue';
import executeButton from '@/views/api-test/components/executeButton.vue';
import requestComposition, { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
@@ -166,8 +165,7 @@
},
]);
- const currentEnvConfig = inject][>('currentEnvConfig');
- const environmentId = ref(currentEnvConfig?.value?.id);
+ const environmentId = ref(appStore.currentEnvConfig?.id);
const formRef = ref();
const requestCompositionRef = ref>();
@@ -214,7 +212,7 @@
detailForm.value.name = detailForm.value.name.slice(0, 255);
}
}
- environmentId.value = currentEnvConfig?.value?.id;
+ environmentId.value = appStore.currentEnvConfig?.id;
// 编辑
if (!isCopy && record?.id) {
isEdit.value = true;
@@ -361,10 +359,6 @@
detailForm.value.executeLoading = false;
}
- const environmentSelectRef = ref>();
- const currentEnvConfigByDrawer = computed(() => environmentSelectRef.value?.currentEnvConfig);
- provide('currentEnvConfig', readonly(currentEnvConfigByDrawer));
-
defineExpose({
open,
});
diff --git a/frontend/src/views/api-test/management/components/management/index.vue b/frontend/src/views/api-test/management/components/management/index.vue
index ccaf0f132a..662b84032e 100644
--- a/frontend/src/views/api-test/management/components/management/index.vue
+++ b/frontend/src/views/api-test/management/components/management/index.vue
@@ -28,11 +28,10 @@
-
]
>();
- const currentEnvConfig = computed(() => environmentSelectRef.value?.currentEnvConfig);
-
onBeforeMount(() => {
initMemberOptions();
initProtocolList();
@@ -322,7 +317,6 @@
]);
/** 向孙组件提供属性 */
- provide('currentEnvConfig', readonly(currentEnvConfig));
provide('defaultCaseParams', readonly(defaultCaseParams));
provide('protocols', readonly(protocols));
diff --git a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue
index 611a35bd23..d107a75c2a 100644
--- a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue
+++ b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue
@@ -53,9 +53,9 @@
v-if="!props.step || props.step?.stepType === ScenarioStepType.CUSTOM_REQUEST"
class="customApiDrawer-title-right flex items-center gap-[16px]"
>
-
+
- {{ t('apiScenario.env', { name: currentEnvConfig?.name }) }}
+ {{ t('apiScenario.env', { name: appStore.currentEnvConfig?.name }) }}
- {{ currentEnvConfig?.httpConfig.find((e) => e.type === 'NONE')?.url }}
+ {{ appStore.currentEnvConfig?.httpConfig.find((e) => e.type === 'NONE')?.url }}
@@ -397,7 +397,6 @@
RequestTaskResult,
} from '@/models/apiTest/common';
import { ScenarioStepFileParams, ScenarioStepItem } from '@/models/apiTest/scenario';
- import { EnvConfig } from '@/models/projectManagement/environmental';
import {
RequestAuthType,
RequestBodyFormat,
@@ -483,7 +482,6 @@
// 注入祖先组件提供的属性
const scenarioId = inject('scenarioId');
- const currentEnvConfig = inject[>('currentEnvConfig');
const hasLocalExec = inject][>('hasLocalExec');
const isPriorityLocalExec = inject][>('isPriorityLocalExec');
@@ -578,7 +576,7 @@
const showEnvPrefix = computed(
() =>
requestVModel.value.customizeRequestEnvEnable &&
- currentEnvConfig?.value.httpConfig.find((e) => e.type === 'NONE')?.url
+ appStore.currentEnvConfig?.httpConfig.find((e) => e.type === 'NONE')?.url
);
const currentLoop = ref(1);
const currentResponse = computed(() => {
diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue
index a504ff39a5..05a533188d 100644
--- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue
+++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue
@@ -876,7 +876,7 @@
slotName: 'operation',
dataIndex: 'operation',
fixed: 'right',
- width: 220,
+ width: 200,
},
];
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
diff --git a/frontend/src/views/api-test/scenario/components/step/stepTree.vue b/frontend/src/views/api-test/scenario/components/step/stepTree.vue
index 3be96ca697..2c84101ba3 100644
--- a/frontend/src/views/api-test/scenario/components/step/stepTree.vue
+++ b/frontend/src/views/api-test/scenario/components/step/stepTree.vue
@@ -615,7 +615,6 @@
}); // 没啥用,目前用来展示选中样式
const isPriorityLocalExec = inject][>('isPriorityLocalExec');
const localExecuteUrl = inject][>('localExecuteUrl');
- const currentEnvConfig = inject][>('currentEnvConfig');
const permissionMap = {
execute: 'PROJECT_API_SCENARIO:READ+EXECUTE',
@@ -947,7 +946,7 @@
const params: AddApiCaseParams = {
name: saveModalForm.value.name,
projectId: appStore.currentProjectId,
- environmentId: currentEnvConfig?.value.id || '',
+ environmentId: appStore.currentEnvConfig?.id || '',
apiDefinitionId: id,
request: {
...detail,
@@ -992,7 +991,7 @@
status: RequestDefinitionStatus.PROCESSING,
customFields: [],
versionId: '',
- environmentId: currentEnvConfig?.value.id || '',
+ environmentId: appStore.currentEnvConfig?.id || '',
request: {
...detail,
url: path,
@@ -1085,7 +1084,7 @@
const fileParams = scenario.value.stepFileParam[activeStep.value.id];
const params: AddApiCaseParams = {
projectId: appStore.currentProjectId,
- environmentId: currentEnvConfig?.value.id || '',
+ environmentId: appStore.currentEnvConfig?.id || '',
apiDefinitionId: activeStep.value.resourceId || '',
request: detail,
...saveCaseModalForm.value,
@@ -1432,7 +1431,7 @@
const res = await debugScenario({
id: scenario.value.id || '',
grouped: false,
- environmentId: currentEnvConfig?.value?.id || '',
+ environmentId: appStore.currentEnvConfig?.id || '',
projectId: appStore.currentProjectId,
scenarioConfig: scenario.value.scenarioConfig,
frontendDebug: scenario.value.executeType === 'localExec',
diff --git a/frontend/src/views/api-test/scenario/index.vue b/frontend/src/views/api-test/scenario/index.vue
index 4b6f2fd3b8..22c77c17a3 100644
--- a/frontend/src/views/api-test/scenario/index.vue
+++ b/frontend/src/views/api-test/scenario/index.vue
@@ -17,10 +17,7 @@
]
-
+
(scenarioTabs.value[0] as ScenarioParams);
- const currentEnvConfig = ref();
const executeButtonRef = ref>();
const websocketMap: Record = {};
@@ -441,7 +437,7 @@
scenarioTabs.value.push({
...cloneDeep(defaultScenario),
id: getGenerateId(),
- environmentId: currentEnvConfig.value?.id || '',
+ environmentId: appStore.currentEnvConfig?.id || '',
label: `${t('apiScenario.createScenario')}${scenarioTabs.value.length}`,
moduleId: activeModule.value === 'all' ? 'root' : activeModule.value,
projectId: appStore.currentProjectId,
@@ -616,7 +612,6 @@
provide('isPriorityLocalExec', readonly(isPriorityLocalExec));
provide('hasLocalExec', readonly(hasLocalExec));
provide('localExecuteUrl', readonly(localExecuteUrl));
- provide('currentEnvConfig', readonly(currentEnvConfig));
provide('scenarioId', scenarioId);
provide('scenarioExecuteLoading', scenarioExecuteLoading);
provide('moduleTree', readonly(moduleTree));
diff --git a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue
index 0f2a4ff183..97624d9e31 100644
--- a/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue
+++ b/frontend/src/views/case-management/caseManagementFeature/components/caseTable.vue
@@ -699,7 +699,7 @@
fixed: 'right',
showInTable: true,
showDrag: false,
- width: hasOperationPermission.value ? 200 : 50,
+ width: hasOperationPermission.value ? 130 : 50,
},
];
const platformInfo = ref>({});
diff --git a/frontend/src/views/project-management/environmental/components/envParams/preAndPost.vue b/frontend/src/views/project-management/environmental/components/envParams/preAndPost.vue
index 6ed768e42b..a062ed7d9e 100644
--- a/frontend/src/views/project-management/environmental/components/envParams/preAndPost.vue
+++ b/frontend/src/views/project-management/environmental/components/envParams/preAndPost.vue
@@ -65,12 +65,9 @@
import PreTab from './PreTab.vue';
import { useI18n } from '@/hooks/useI18n';
- import useProjectEnvStore from '@/store/modules/setting/useProjectEnvStore';
import { EnvTabTypeEnum } from '@/enums/envEnum';
- const store = useProjectEnvStore();
-
const { t } = useI18n();
const props = defineProps<{
@@ -109,14 +106,6 @@
};
}
});
-
- const currentEnvConfig = ref({});
- /** 向孙组件提供属性 */
- provide('currentEnvConfig', readonly(currentEnvConfig));
-
- onBeforeMount(() => {
- currentEnvConfig.value = store.currentEnvDetailInfo;
- });