fix(项目管理): 修复环境bug

This commit is contained in:
xinxin.wu 2024-03-11 11:15:28 +08:00 committed by 刘瑞斌
parent 3029d1e078
commit b88bd04cec
3 changed files with 15 additions and 9 deletions

View File

@ -142,8 +142,9 @@
const focusKey = ref<string>('');
//
const assertions = defineModel<any[]>('params', { default: [] });
const activeIds = ref('');
// Itemkey
const activeKey = ref<string>(assertions.value[0].id);
const activeKey = ref<string>('');
// value
const valueKey = computed(() => {
return activeKey.value && assertions.value.find((item) => item.id === activeKey.value)?.assertionType;

View File

@ -259,7 +259,7 @@
if (index > -1 && !props.isCopy) {
const httpItem = {
...form.value,
hostname: `${protocol}:${url}`,
hostname: `${protocol}://${url}`,
pathMatchRule: {
path,
condition,
@ -273,7 +273,7 @@
const insertItem = {
...form.value,
id: getGenerateId(),
hostname: `${protocol}:${url}`,
hostname: `${protocol}://${url}`,
order: store.currentEnvDetailInfo.config.httpConfig.length + 1,
moduleMatchRule: { modules },
};
@ -325,7 +325,7 @@
moduleId: currentItem.moduleMatchRule.modules.map((item) => item.moduleId) || [],
path,
condition,
url: urlPath && urlPath?.length > 1 ? `//${urlPath[1]}` : '',
url: urlPath && urlPath?.length > 1 ? `${urlPath[1]}` : '',
};
}
} else {

View File

@ -202,6 +202,7 @@
</template>
<script lang="ts" setup>
import { Message } from '@arco-design/web-vue';
import { VueDraggable } from 'vue-draggable-plus';
import MsButton from '@/components/pure/ms-button/index.vue';
@ -464,12 +465,16 @@
if (store.currentId === NEW_ENV_PARAM) {
// idnewEnvParam
envList.value = envList.value.filter((item) => item.id !== id);
} else {
await deleteEnv(id);
store.setCurrentId(envList.value[0].id);
}
if (store.currentId === id) {
store.setCurrentId('');
if (id === NEW_ENV_PARAM) {
envList.value = envList.value.filter((item) => item.id !== id);
store.setCurrentId(envList.value[0].id);
return;
}
await deleteEnv(id);
Message.success(t('common.deleteSuccess'));
store.setCurrentId(envList.value[0].id);
searchData();
} catch (error) {
// eslint-disable-next-line no-console
@ -575,7 +580,7 @@
padding: 7px 8px;
height: 38px;
box-sizing: border-box;
border-radius: var(--border-radius-base);
border-radius: 4px;
cursor: pointer;
.node-extra {
opacity: 0;