fix(接口测试): 修复场景批量执行不能选环境组的问题
--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001020163
This commit is contained in:
parent
3f3763c726
commit
94bd647ace
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="(pe, pIndex) in eventData" :key="pe.id">
|
<el-radio-group v-model="radio" style="width: 100%" @change="radioChange" class="radio-change">
|
||||||
|
<el-radio :label="ENV_TYPE.JSON">{{ $t('workspace.env_group.env_list') }}</el-radio>
|
||||||
|
<el-radio :label="ENV_TYPE.GROUP" v-if="isScenario">{{ $t('workspace.env_group.name') }}<i class="el-icon-tickets mode-span" @click="viewGroup"></i></el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<div v-for="(pe, pIndex) in eventData" :key="pe.id" v-show="!radio || radio === ENV_TYPE.JSON">
|
||||||
<el-card shadow="never" style="margin-top: 8px; background: #f5f6f7; border-radius: 4px">
|
<el-card shadow="never" style="margin-top: 8px; background: #f5f6f7; border-radius: 4px">
|
||||||
<i
|
<i
|
||||||
@click="expandCard(pIndex)"
|
@click="expandCard(pIndex)"
|
||||||
|
@ -46,6 +50,26 @@
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-show="radio === ENV_TYPE.GROUP">
|
||||||
|
<div>
|
||||||
|
<el-select v-model="envGroupId" :placeholder="$t('workspace.env_group.select')" @change="chooseEnvGroup"
|
||||||
|
style="margin-top: 8px;width: 100%;" size="small">
|
||||||
|
<el-option v-for="(group, index) in groups" :key="index"
|
||||||
|
:label="group.name"
|
||||||
|
:value="group.id"/>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-dialog :visible="visible" append-to-body :title="$t('workspace.env_group.name')" @close="visible = false"
|
||||||
|
style="height: 800px;">
|
||||||
|
<template>
|
||||||
|
<environment-group style="overflow-y: auto;"
|
||||||
|
:screen-height="'350px'"
|
||||||
|
:read-only="true"
|
||||||
|
></environment-group>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -55,10 +79,11 @@ import { environmentGetALL } from 'metersphere-frontend/src/api/environment';
|
||||||
import MsTag from 'metersphere-frontend/src/components/MsTag';
|
import MsTag from 'metersphere-frontend/src/components/MsTag';
|
||||||
import { parseEnvironment } from 'metersphere-frontend/src/model/EnvironmentModel';
|
import { parseEnvironment } from 'metersphere-frontend/src/model/EnvironmentModel';
|
||||||
import { getEnvironmentByProjectId } from '@/api/api-environment';
|
import { getEnvironmentByProjectId } from '@/api/api-environment';
|
||||||
|
import EnvironmentGroup from '@/business/commons/EnvironmentGroupList';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EnvSelectPopover',
|
name: 'EnvSelectPopover',
|
||||||
components: { MsTag },
|
components: { EnvironmentGroup,MsTag },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
radio: ENV_TYPE.JSON,
|
radio: ENV_TYPE.JSON,
|
||||||
|
@ -69,6 +94,7 @@ export default {
|
||||||
eventData: [],
|
eventData: [],
|
||||||
evnList: [],
|
evnList: [],
|
||||||
selectEnvMap: new Map(),
|
selectEnvMap: new Map(),
|
||||||
|
envGroupId: this.groupId,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -92,12 +118,33 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
hasOptionGroup: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
btnStyle: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return { width: '360px' };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
groupId(val) {
|
||||||
|
this.envGroupId = val;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
this.envGroupId = this.groupId;
|
||||||
this.initDefaultEnv();
|
this.initDefaultEnv();
|
||||||
this.getgroups();
|
this.getgroups();
|
||||||
},
|
},
|
||||||
|
chooseEnvGroup(envGroupId){
|
||||||
|
this.$emit("setEnvGroup", envGroupId);
|
||||||
|
},
|
||||||
radioChange(val) {
|
radioChange(val) {
|
||||||
this.radio = val;
|
this.radio = val;
|
||||||
},
|
},
|
||||||
|
@ -155,7 +202,7 @@ export default {
|
||||||
if (this.isScenario) {
|
if (this.isScenario) {
|
||||||
if (this.projectEnvMap) {
|
if (this.projectEnvMap) {
|
||||||
let projectEnvMapElement = this.projectEnvMap[d];
|
let projectEnvMapElement = this.projectEnvMap[d];
|
||||||
if (projectEnvMapElement.length > 0) {
|
if (projectEnvMapElement && projectEnvMapElement.length > 0) {
|
||||||
projectEnvMapElement.forEach((envId) => {
|
projectEnvMapElement.forEach((envId) => {
|
||||||
let filter = envs.filter((e) => e.id === envId);
|
let filter = envs.filter((e) => e.id === envId);
|
||||||
if (!this.selectedEnvName.has(d)) {
|
if (!this.selectedEnvName.has(d)) {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
:project-list="projectList"
|
:project-list="projectList"
|
||||||
:case-id-env-name-map="caseIdEnvNameMap"
|
:case-id-env-name-map="caseIdEnvNameMap"
|
||||||
:is-scenario="isScenario"
|
:is-scenario="isScenario"
|
||||||
|
:has-option-group="true"
|
||||||
:project-env-map="projectEnvListMap"
|
:project-env-map="projectEnvListMap"
|
||||||
:group-id="runConfig.environmentGroupId"
|
:group-id="runConfig.environmentGroupId"
|
||||||
@setProjectEnvMap="setProjectEnvMap"
|
@setProjectEnvMap="setProjectEnvMap"
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-show="radio === ENV_TYPE.GROUP">
|
<div v-show="radio === ENV_TYPE.GROUP">
|
||||||
<div>
|
<div>
|
||||||
<el-select v-model="groupId" :placeholder="$t('workspace.env_group.select')" @change="chooseEnvGroup"
|
<el-select v-model="envGroupId" :placeholder="$t('workspace.env_group.select')" @change="chooseEnvGroup"
|
||||||
style="margin-top: 8px;width: 100%;" size="small">
|
style="margin-top: 8px;width: 100%;" size="small">
|
||||||
<el-option v-for="(group, index) in groups" :key="index"
|
<el-option v-for="(group, index) in groups" :key="index"
|
||||||
:label="group.name"
|
:label="group.name"
|
||||||
|
@ -75,8 +75,14 @@ export default {
|
||||||
eventData:[],
|
eventData:[],
|
||||||
evnList:[],
|
evnList:[],
|
||||||
selectEnvMap:new Map(),
|
selectEnvMap:new Map(),
|
||||||
|
envGroupId: this.groupId,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
groupId(val) {
|
||||||
|
this.envGroupId = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
ENV_TYPE() {
|
ENV_TYPE() {
|
||||||
return ENV_TYPE;
|
return ENV_TYPE;
|
||||||
|
@ -96,6 +102,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open(){
|
open(){
|
||||||
|
this.envGroupId = this.groupId;
|
||||||
this.initDefaultEnv();
|
this.initDefaultEnv();
|
||||||
this.getgroups();
|
this.getgroups();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue