fix: python脚本无法使用

This commit is contained in:
chenjianxing 2021-01-04 19:15:16 +08:00
parent 45d0a6515e
commit e7d489a469
5 changed files with 9 additions and 10 deletions

View File

@ -35,7 +35,7 @@
ref="codeEdit"/> ref="codeEdit"/>
</el-col> </el-col>
<el-col :span="4" class="script-index"> <el-col :span="4" class="script-index">
<ms-dropdown :default-command="jsr223ProcessorData.language" :commands="languages" @command="languageChange"/> <ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" @command="languageChange"/>
<div class="template-title">{{$t('api_test.request.processor.code_template')}}</div> <div class="template-title">{{$t('api_test.request.processor.code_template')}}</div>
<div v-for="(template, index) in codeTemplates" :key="index" class="code-template"> <div v-for="(template, index) in codeTemplates" :key="index" class="code-template">
<el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link> <el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link>
@ -135,7 +135,7 @@
this.jsr223ProcessorData.script = ""; this.jsr223ProcessorData.script = "";
} }
this.jsr223ProcessorData.script += template.value; this.jsr223ProcessorData.script += template.value;
if (this.jsr223ProcessorData.language === 'beanshell') { if (this.jsr223ProcessorData.scriptLanguage === 'beanshell') {
this.jsr223ProcessorData.script += ';'; this.jsr223ProcessorData.script += ';';
} }
this.reload(); this.reload();
@ -151,7 +151,7 @@
this.$nextTick(() => (this.isCodeEditAlive = true)); this.$nextTick(() => (this.isCodeEditAlive = true));
}, },
languageChange(language) { languageChange(language) {
this.jsr223ProcessorData.language = language; this.jsr223ProcessorData.scriptLanguage = language;
}, },
changeActive() { changeActive() {
this.jsr223ProcessorData.active = !this.jsr223ProcessorData.active; this.jsr223ProcessorData.active = !this.jsr223ProcessorData.active;

View File

@ -15,7 +15,7 @@ export default class JSR223PostProcessor extends PostProcessor {
constructor(options = DEFAULT_OPTIONS) { constructor(options = DEFAULT_OPTIONS) {
super(options); super(options);
this.type = "JSR223PostProcessor"; this.type = "JSR223PostProcessor";
this.scriptLanguage = "java"; this.scriptLanguage = "beanshell";
this.parameters = []; this.parameters = [];
this.filename = undefined; this.filename = undefined;
this.cacheKey = true; this.cacheKey = true;

View File

@ -15,7 +15,7 @@ export default class JSR223PreProcessor extends PostProcessor {
constructor(options = DEFAULT_OPTIONS) { constructor(options = DEFAULT_OPTIONS) {
super(options); super(options);
this.type = "JSR223PreProcessor"; this.type = "JSR223PreProcessor";
this.scriptLanguage = "java"; this.scriptLanguage = "beanshell";
this.parameters = []; this.parameters = [];
this.filename = undefined; this.filename = undefined;
this.cacheKey = undefined; this.cacheKey = undefined;

View File

@ -34,7 +34,7 @@
ref="codeEdit"/> ref="codeEdit"/>
</el-col> </el-col>
<el-col :span="4" class="script-index"> <el-col :span="4" class="script-index">
<ms-dropdown :default-command="jsr223ProcessorData.language" :commands="languages" @command="languageChange"/> <ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" @command="languageChange"/>
<div class="template-title">{{$t('api_test.request.processor.code_template')}}</div> <div class="template-title">{{$t('api_test.request.processor.code_template')}}</div>
<div v-for="(template, index) in codeTemplates" :key="index" class="code-template"> <div v-for="(template, index) in codeTemplates" :key="index" class="code-template">
<el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link> <el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link>
@ -140,7 +140,7 @@
this.jsr223ProcessorData.script = ""; this.jsr223ProcessorData.script = "";
} }
this.jsr223ProcessorData.script += template.value; this.jsr223ProcessorData.script += template.value;
if (this.jsr223ProcessorData.language === 'beanshell') { if (this.jsr223ProcessorData.scriptLanguage === 'beanshell') {
this.jsr223ProcessorData.script += ';'; this.jsr223ProcessorData.script += ';';
} }
this.reload(); this.reload();
@ -156,7 +156,7 @@
this.$nextTick(() => (this.isCodeEditAlive = true)); this.$nextTick(() => (this.isCodeEditAlive = true));
}, },
languageChange(language) { languageChange(language) {
this.jsr223ProcessorData.language = language; this.jsr223ProcessorData.scriptLanguage = language;
}, },
changeActive() { changeActive() {
this.active = !this.active; this.active = !this.active;

View File

@ -842,8 +842,7 @@ export class JSR223Processor extends BaseConfig {
this.active = false; this.active = false;
this.type = "JSR223Processor"; this.type = "JSR223Processor";
this.script = undefined; this.script = undefined;
this.language = "beanshell"; this.scriptLanguage = "beanshell";
this.scriptLanguage = "java";
this.enable = true; this.enable = true;
this.hashTree = []; this.hashTree = [];
this.set(options); this.set(options);