feat(接口测试): 请求支持跨场景拖拽

This commit is contained in:
q4speed 2020-09-07 16:11:06 +08:00
parent 7f296f453c
commit c9cf9b8e8f
3 changed files with 165 additions and 159 deletions

View File

@ -2,7 +2,7 @@
<el-container>
<el-aside class="scenario-aside">
<div class="scenario-list">
<ms-api-collapse v-model="activeName" @change="handleChange" accordion>
<ms-api-collapse v-model="activeName" @change="handleChange">
<draggable :list="scenarios" group="Scenario" class="scenario-draggable" ghost-class="scenario-ghost">
<ms-api-collapse-item v-for="(scenario, index) in scenarios" :key="index"
:title="scenario.name" :name="index" :class="{'disable-scenario': !scenario.enable}">

View File

@ -1,6 +1,7 @@
<template>
<div class="request-container">
<draggable :list="this.scenario.requests" group="Request" class="request-draggable" ghost-class="request-ghost">
<draggable :list="this.scenario.requests" group="Request" class="request-draggable" ghost-class="request-ghost"
:disabled="isReference">
<div class="request-item" v-for="(request, index) in this.scenario.requests" :key="index" @click="select(request)"
:class="{'selected': isSelected(request), 'disable-request': !request.enable || !scenario.enable}">
<el-row type="flex" align="middle">
@ -23,10 +24,12 @@
<el-dropdown-item :disabled="isReadOnly" :command="{type: 'delete', index: index}">
{{ $t('api_test.request.delete') }}
</el-dropdown-item>
<el-dropdown-item v-if="request.enable" :disabled="isReadOnly" :command="{type: 'disable', index: index}">
<el-dropdown-item v-if="request.enable" :disabled="isReadOnly"
:command="{type: 'disable', index: index}">
{{ $t('api_test.scenario.disable') }}
</el-dropdown-item>
<el-dropdown-item v-if="!request.enable" :disabled="isReadOnly" :command="{type: 'enable', index: index}">
<el-dropdown-item v-if="!request.enable" :disabled="isReadOnly"
:command="{type: 'enable', index: index}">
{{ $t('api_test.scenario.enable') }}
</el-dropdown-item>
</el-dropdown-menu>
@ -78,6 +81,9 @@
return function (request) {
return this.selected === request;
}
},
isReference() {
return this.scenario.isReference();
}
},

View File

@ -405,7 +405,7 @@ export class DubboRequest extends Request {
this.debugReport = undefined;
this.beanShellPreProcessor = new BeanShellProcessor(options.beanShellPreProcessor);
this.beanShellPostProcessor = new BeanShellProcessor(options.beanShellPostProcessor);
this.enable = options.enable == undefined ? true : options.enable;
this.enable = options.enable === undefined ? true : options.enable;
this.jsr223PreProcessor = new JSR223Processor(options.jsr223PreProcessor);
this.jsr223PostProcessor = new JSR223Processor(options.jsr223PostProcessor);