fix(接口测试): 修复脚本类型切换默认名称未跟随切换问题

--bug=1020842 --user=赵勇 【接口测试】接口中添加前后置脚本,beanshell语言,取消勾选jsr233选项后,脚本名称没有变 https://www.tapd.cn/55049933/s/1315588
This commit is contained in:
fit2-zhao 2022-12-14 14:43:16 +08:00 committed by fit2-zhao
parent f7db4dbadc
commit 400d5b9e98
1 changed files with 29 additions and 1 deletions

View File

@ -28,7 +28,8 @@
<el-checkbox
v-model="jsr223ProcessorData.jsrEnable"
style="padding-left: 10px"
:disabled="jsr223ProcessorData.scriptLanguage !== 'beanshell'">
:disabled="jsr223ProcessorData.scriptLanguage !== 'beanshell'"
@change="changeEnable">
JSR223
</el-checkbox>
<script-nav-menu
@ -220,6 +221,33 @@ export default {
}
this.$emit('languageChange');
},
changeEnable() {
if (this.jsr223ProcessorData.jsrEnable) {
if (this.jsr223ProcessorData.type === 'JSR223PostProcessor') {
this.jsr223ProcessorData.name =
this.jsr223ProcessorData.name !== 'BeanShellPostProcessor'
? this.jsr223ProcessorData.name
: 'JSR223PostProcessor';
} else {
this.jsr223ProcessorData.name =
this.jsr223ProcessorData.name !== 'BeanShellPreProcessor'
? this.jsr223ProcessorData.name
: 'JSR223PreProcessor';
}
} else {
if (this.jsr223ProcessorData.type === 'JSR223PostProcessor') {
this.jsr223ProcessorData.name =
this.jsr223ProcessorData.name !== 'JSR223PostProcessor'
? this.jsr223ProcessorData.name
: 'BeanShellPostProcessor';
} else {
this.jsr223ProcessorData.name =
this.jsr223ProcessorData.name !== 'JSR223PreProcessor'
? this.jsr223ProcessorData.name
: 'BeanShellPreProcessor';
}
}
},
addCustomFuncScript(script) {
this.jsr223ProcessorData.script = this.jsr223ProcessorData.script
? this.jsr223ProcessorData.script + '\n\n' + script