fix(项目管理): 修复环境bug
This commit is contained in:
parent
3029d1e078
commit
b88bd04cec
|
@ -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('');
|
||||||
// Item点击的key
|
// Item点击的key
|
||||||
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;
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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) {
|
||||||
// 删除id为newEnvParam的环境
|
// 删除id为newEnvParam的环境
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue