fix(接口测试): 场景折叠

This commit is contained in:
chenjianxing 2020-09-17 16:43:34 +08:00
parent 5fd8a424d6
commit f9e288550d
2 changed files with 6 additions and 7 deletions

View File

@ -75,7 +75,7 @@ import MsApiScenarioForm from "./ApiScenarioForm";
import {Request, Scenario} from "../model/ScenarioModel";
import draggable from 'vuedraggable';
import MsApiScenarioSelect from "@/business/components/api/test/components/ApiScenarioSelect";
import {compatibleWithEnvironment, Config, parseEnvironment} from "../model/EnvironmentModel";
import {parseEnvironment} from "../model/EnvironmentModel";
export default {
name: "MsApiScenarioConfig",

View File

@ -38,17 +38,16 @@
},
methods: {
setActiveNames(activeNames) {
setActiveNames(activeNames, item) {
activeNames = [].concat(activeNames);
let value = this.accordion ? activeNames[0] : activeNames;
this.activeNames = activeNames;
this.$emit('input', value);
this.$emit('change', value);
this.$emit('input', item.name);
this.$emit('change', item.name);
},
handleItemClick(item) {
if (this.accordion) {
this.setActiveNames(
(this.activeNames[0] || this.activeNames[0] === 0) && item.name);
(this.activeNames[0] || this.activeNames[0] === 0) && item.name, item);
} else {
let activeNames = this.activeNames.slice(0);
let index = activeNames.indexOf(item.name);
@ -58,7 +57,7 @@
} else {
activeNames.push(item.name);
}
this.setActiveNames(activeNames);
this.setActiveNames(activeNames, item);
}
}
},