fix(接口测试): 接口自动化编辑全屏后无法添加插件

This commit is contained in:
RubyLiu 2023-07-12 17:46:11 +08:00 committed by 刘瑞斌
parent 0a916886be
commit 4296992fbd
2 changed files with 34 additions and 31 deletions

View File

@ -496,6 +496,8 @@
:message="message"
:enable-cookie="enableCookieShare"
:on-sample-error="onSampleError"
:environment-type.sync="environmentType"
:pluginList="plugins"
@setEnvType="setEnvType"
@envGroupId="setEnvGroup"
@closePage="close"

View File

@ -358,6 +358,7 @@ export default {
projectList: Array,
enableCookie: Boolean,
onSampleError: Boolean,
pluginList: Array,
},
components: {
MsAsideContainer,
@ -517,9 +518,6 @@ export default {
this.cookieShare = this.enableCookie;
this.sampleError = this.onSampleError;
},
mounted() {
this.$refs.refFab.openMenu();
},
watch: {
reloadDebug() {
@ -549,34 +547,28 @@ export default {
e.stopPropagation();
},
initPlugins() {
getPluginList().then((response) => {
let data = response.data;
if (data) {
data.forEach((item) => {
let plugin = {
title: item.name,
show: this.showButton(item.jmeterClazz),
titleColor: '#555855',
titleBgColor: '#F4F4FF',
icon: 'colorize',
click: () => {
this.addComponent(item.name, item);
},
};
if (item.license) {
if (hasLicense()) {
if (this.operatingElements && this.operatingElements.includes(item.jmeterClazz)) {
this.buttonData.push(plugin);
}
}
} else {
if (this.operatingElements && this.operatingElements.includes(item.jmeterClazz)) {
this.buttonData.push(plugin);
}
if(this.pluginList && this.pluginList.length > 0){
this.pluginList.forEach((item) => {
let plugin = {
title: item.name,
show: this.showButton(item.jmeterClazz),
titleColor: '#555855',
titleBgColor: '#F4F4FF',
icon: 'colorize',
click: () => {
this.addComponent(item.name, item);
},
};
if (this.operatingElements && this.operatingElements.includes(item.jmeterClazz)) {
this.buttonData.push(plugin);
}
this.$nextTick(() => {
if (!this.currentScenario.name && this.$refs.refFab) {
this.$refs.refFab.openMenu();
}
});
}
});
});
}
},
//
openScenario(data) {
@ -624,8 +616,17 @@ export default {
}
return false;
},
addComponent(type) {
setComponent(type, this);
addComponent(type, plugin) {
if (
this.selectedNode &&
this.selectedNode.parent &&
this.selectedNode.parent.data &&
this.selectedNode.parent.data.disabled
) {
this.$warning(this.$t('api_test.scenario.scenario_warning'));
return;
}
setComponent(type, this, plugin);
},
setAsideHidden(data) {
this.asideHidden = data;