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 focusKey = ref<string>('');
// //
const assertions = defineModel<any[]>('params', { default: [] }); const assertions = defineModel<any[]>('params', { default: [] });
const activeIds = ref('');
// Itemkey // Itemkey
const activeKey = ref<string>(assertions.value[0].id); const activeKey = ref<string>('');
// value // value
const valueKey = computed(() => { const valueKey = computed(() => {
return activeKey.value && assertions.value.find((item) => item.id === activeKey.value)?.assertionType; return activeKey.value && assertions.value.find((item) => item.id === activeKey.value)?.assertionType;

View File

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

View File

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