From bd893d3ec42082dd9469376a63e91e48130ac79f Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 7 Mar 2023 16:11:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=AC=E9=A1=B5=E9=9D=A2=E9=99=A4?= =?UTF-8?q?groovy=E8=AF=AD=E8=A8=80=E5=88=AB=E7=9A=84=E4=B9=9F=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9C=8B=E8=A7=81=E6=8A=A5=E6=96=87=E5=A4=84=E7=90=86?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023982 --user=王孝刚 [接口测试] github#22422 TCP 协议前置脚本-报文头添加长度脚本只使用于 groovy,其他类型脚本报错,建议修改脚本模板,或者隐藏其他脚本的生成入口 https://www.tapd.cn/55049933/s/1346218 --- .../scenario/common/Jsr233ProcessorContent.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/business/components/api/automation/scenario/common/Jsr233ProcessorContent.vue b/frontend/src/business/components/api/automation/scenario/common/Jsr233ProcessorContent.vue index a7be0fe635..77af05f304 100644 --- a/frontend/src/business/components/api/automation/scenario/common/Jsr233ProcessorContent.vue +++ b/frontend/src/business/components/api/automation/scenario/common/Jsr233ProcessorContent.vue @@ -120,6 +120,7 @@ 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'), @@ -180,6 +181,11 @@ export default { this.reload(); } }, + computed: { + isGroovy() { + return this.jsr223ProcessorData.scriptLanguage !== 'groovy'; + } + }, methods: { addTemplate(template) { if (!this.jsr223ProcessorData.script) { @@ -199,6 +205,11 @@ export default { this.$nextTick(() => (this.isCodeEditAlive = true)); }, languageChange(language) { + if (language === 'groovy') { + this.codeTemplates[5].hideScript = true; + } else { + this.codeTemplates[5].hideScript = this.isHideScript(); + } this.jsr223ProcessorData.scriptLanguage = language; this.$emit("languageChange"); },