Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
Captain.B 2020-08-25 17:45:35 +08:00
commit a34cb53bbb
3 changed files with 14 additions and 8 deletions

View File

@ -7,7 +7,7 @@
<el-col :span="4" class="script-index"> <el-col :span="4" class="script-index">
<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 @click="addTemplate(template)">{{template.title}}</el-link> <el-link :disabled="template.disabled" @click="addTemplate(template)">{{template.title}}</el-link>
</div> </div>
<div class="document-url"> <div class="document-url">
<el-link href="https://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PostProcessor" type="primary">{{$t('commons.reference_documentation')}}</el-link> <el-link href="https://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PostProcessor" type="primary">{{$t('commons.reference_documentation')}}</el-link>
@ -29,23 +29,26 @@
codeTemplates: [ codeTemplates: [
{ {
title: this.$t('api_test.request.processor.code_template_get_variable'), title: this.$t('api_test.request.processor.code_template_get_variable'),
value: 'vars.get("variable_name");' value: 'vars.get("variable_name");',
}, },
{ {
title: this.$t('api_test.request.processor.code_template_set_variable'), title: this.$t('api_test.request.processor.code_template_set_variable'),
value: 'vars.put("variable_name", "variable_value");' value: 'vars.put("variable_name", "variable_value");',
}, },
{ {
title: this.$t('api_test.request.processor.code_template_get_response_header'), title: this.$t('api_test.request.processor.code_template_get_response_header'),
value: 'prev.getResponseHeaders();' value: 'prev.getResponseHeaders();',
disabled: this.isPreProcessor
}, },
{ {
title: this.$t('api_test.request.processor.code_template_get_response_code'), title: this.$t('api_test.request.processor.code_template_get_response_code'),
value: 'prev.getResponseCode();' value: 'prev.getResponseCode();',
disabled: this.isPreProcessor
}, },
{ {
title: this.$t('api_test.request.processor.code_template_get_response_result'), title: this.$t('api_test.request.processor.code_template_get_response_result'),
value: 'prev.getResponseDataAsString();' value: 'prev.getResponseDataAsString();',
disabled: this.isPreProcessor
} }
], ],
isCodeEditAlive: true isCodeEditAlive: true
@ -61,6 +64,10 @@
}, },
beanShellProcessor: { beanShellProcessor: {
type: Object, type: Object,
},
isPreProcessor: {
type: Boolean,
default: false
} }
}, },
methods: { methods: {

View File

@ -68,7 +68,7 @@
<ms-api-extract :is-read-only="isReadOnly" :extract="request.extract"/> <ms-api-extract :is-read-only="isReadOnly" :extract="request.extract"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.request.processor.pre_exec_script')" name="beanShellPreProcessor"> <el-tab-pane :label="$t('api_test.request.processor.pre_exec_script')" name="beanShellPreProcessor">
<ms-bean-shell-processor :is-read-only="isReadOnly" :bean-shell-processor="request.beanShellPreProcessor"/> <ms-bean-shell-processor :is-pre-processor="true" :is-read-only="isReadOnly" :bean-shell-processor="request.beanShellPreProcessor"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.request.processor.post_exec_script')" name="beanShellPostProcessor"> <el-tab-pane :label="$t('api_test.request.processor.post_exec_script')" name="beanShellPostProcessor">
<ms-bean-shell-processor :is-read-only="isReadOnly" :bean-shell-processor="request.beanShellPostProcessor"/> <ms-bean-shell-processor :is-read-only="isReadOnly" :bean-shell-processor="request.beanShellPostProcessor"/>

View File

@ -108,7 +108,6 @@ export default {
methods: { methods: {
handleDragEnd(draggingNode, dropNode, dropType, ev) { handleDragEnd(draggingNode, dropNode, dropType, ev) {
let param = this.buildParam(draggingNode, dropNode, dropType); let param = this.buildParam(draggingNode, dropNode, dropType);
console.log(this.treeNodes);
this.$post("/case/node/drag", param, () => { this.$post("/case/node/drag", param, () => {
draggingNode.data.level = param.level; draggingNode.data.level = param.level;
this.refreshTable(); this.refreshTable();