资源池为空时跳转到压力配置Tab

This commit is contained in:
shiziyuan9527 2020-06-02 16:48:02 +08:00
parent 25ee74760f
commit ffdd3ebd40
2 changed files with 11 additions and 4 deletions

View File

@ -32,7 +32,7 @@
<performance-basic-config :test-plan="testPlan" ref="basicConfig"/> <performance-basic-config :test-plan="testPlan" ref="basicConfig"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('load_test.pressure_config')"> <el-tab-pane :label="$t('load_test.pressure_config')">
<performance-pressure-config :test-plan="testPlan" :test-id="testId" ref="pressureConfig"/> <performance-pressure-config :test-plan="testPlan" :test-id="testId" ref="pressureConfig" @changeActive="changeTabActive"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('load_test.advanced_config')" class="advanced-config"> <el-tab-pane :label="$t('load_test.advanced_config')" class="advanced-config">
<performance-advanced-config :test-id="testId" ref="advancedConfig"/> <performance-advanced-config :test-id="testId" ref="advancedConfig"/>
@ -156,9 +156,9 @@
}); });
}, },
saveAndRun() { saveAndRun() {
// if (!this.validTestPlan()) { if (!this.validTestPlan()) {
// return; return;
// } }
let options = this.getSaveOption(); let options = this.getSaveOption();
@ -239,6 +239,11 @@
/// todo: /// todo:
return true; return true;
},
changeTabActive(activeName) {
this.$nextTick(()=> {
this.active = activeName;
});
} }
} }
} }

View File

@ -299,6 +299,8 @@
validConfig() { validConfig() {
if (!this.resourcePool) { if (!this.resourcePool) {
this.$warning(this.$t('load_test.resource_pool_is_null')); this.$warning(this.$t('load_test.resource_pool_is_null'));
// Tabname
this.$emit('changeActive', '1');
return false; return false;
} }