diff --git a/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue b/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue index fe285fc558..b24f67f5bb 100644 --- a/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue +++ b/frontend/src/business/components/api/automation/scenario/component/Jsr233Processor.vue @@ -12,8 +12,72 @@ :background-color="backgroundColor" :if-from-variable-advance="ifFromVariableAdvance" :title="title" v-loading="loading"> + + +

{{ $t('api_test.definition.request.req_param') }}

+ + + + + + + + + {{ $t('api_test.definition.request.pre_operation') }} +
+
{{ request.preSize }}
+
+
+ +
+ + + {{ $t('api_test.definition.request.post_operation') }} +
+
{{ request.postSize }}
+
+
+ +
+ + + {{ $t('api_test.definition.request.assertions_rule') }} +
+
{{ request.ruleSize }}
+
+
+ +
+
+
- + + import( "@/business/components/api/definition/components/step/JmxStep") + }, props: { request: {}, message: String, @@ -84,7 +157,7 @@ export default { type: Boolean, default: true, }, - protocol:String, + protocol: String, isReadOnly: { type: Boolean, default: @@ -107,19 +180,59 @@ export default { default: false, }, }, + created() { + if (this.request && this.request.type === 'JSR223Processor' && this.request.hashTree) { + this.initStepSize(this.request.hashTree); + this.historicalDataProcessing(this.request.hashTree); + } + }, watch: { message() { this.forStatus(); this.reload(); }, + 'request.hashTree': { + handler(v) { + this.initStepSize(this.request.hashTree); + }, + deep: true + } }, data() { return { loading: false, - reqSuccess: true + reqSuccess: true, + response: {}, + activeName: "baseScript" } }, methods: { + historicalDataProcessing(array) { + hisDataProcessing(array, this.request); + }, + initStepSize(array) { + stepCompute(array, this.request); + this.reload(); + }, + + tabClick() { + this.$nextTick(() => { + setTimeout(() => { + this.filter(this.activeName); + }); + }); + }, + filter(activeName) { + if (activeName === 'preOperate' && this.$refs.preStep) { + this.$refs.preStep.filter(); + } + if (activeName === 'postOperate' && this.$refs.postStep) { + this.$refs.postStep.filter(); + } + if (activeName === 'assertionsRule' && this.$refs.assertionsRule) { + this.$refs.assertionsRule.filter(); + } + }, forStatus() { if (this.jsr223Processor && this.jsr223Processor.result && this.jsr223Processor.result.length > 0) { this.jsr223Processor.result.forEach(item => { @@ -139,6 +252,9 @@ export default { } }) } + if (this.jsr223Processor.requestResult && this.jsr223Processor.requestResult.length > 0) { + this.response = this.jsr223Processor.requestResult[0] + } }, remove() { this.$emit('remove', this.jsr223Processor, this.node); @@ -177,4 +293,25 @@ export default { color: #67C23A; } +.ms-header { + background: #783887; + color: white; + height: 18px; + font-size: xx-small; + border-radius: 50%; +} + +.request-tabs { + margin: 0px 5px 0px; + min-height: 200px; + width: 100%; +} + +.ms-tip { + padding: 3px 5px; + font-size: 16px; + border-radius: 0; + border-left: 4px solid #783887; + margin: 5px 5px 0px 5px; +}