fix(接口测试): 修复tcp除groovy协议都展示了报文处理的缺陷

--bug=1023982 --user=王孝刚 [接口测试] github#22422 TCP 协议前置脚本-报文头添加长度脚本只使用于
groovy,其他类型脚本报错,建议修改脚本模板,或者隐藏其他脚本的生成入口
https://www.tapd.cn/55049933/s/1350726
This commit is contained in:
wxg0103 2023-03-15 17:33:02 +08:00 committed by wxg0103
parent dcafc2939c
commit 013265642e
1 changed files with 6 additions and 7 deletions

View File

@ -120,7 +120,6 @@ export default {
' report = reportlengthStr+report;\n' +
' ctx.getCurrentSampler().setRequestData(report);\n' +
'}',
disabled: this.isGroovy
},
{
title: this.$t('api_test.request.processor.code_hide_report_length'),
@ -158,6 +157,11 @@ export default {
},
created() {
this.jsr223ProcessorData = this.jsr223Processor;
if (this.jsr223ProcessorData.scriptLanguage !== 'groovy') {
this.codeTemplates[5].hideScript = true;
} else {
this.codeTemplates[5].hideScript = this.isHideScript();
}
},
props: {
isReadOnly: {
@ -181,11 +185,6 @@ export default {
this.reload();
}
},
computed: {
isGroovy() {
return this.jsr223ProcessorData.scriptLanguage !== 'groovy';
}
},
methods: {
addTemplate(template) {
if (!this.jsr223ProcessorData.script) {
@ -205,7 +204,7 @@ export default {
this.$nextTick(() => (this.isCodeEditAlive = true));
},
languageChange(language) {
if (language === 'groovy') {
if (language !== 'groovy') {
this.codeTemplates[5].hideScript = true;
} else {
this.codeTemplates[5].hideScript = this.isHideScript();