Merge remote-tracking branch 'origin/master'

This commit is contained in:
song.tianyang 2021-01-27 14:34:37 +08:00
commit 99ec66a255
9 changed files with 57 additions and 13 deletions

View File

@ -2,6 +2,7 @@ package io.metersphere.config;
import com.github.pagehelper.PageInterceptor; import com.github.pagehelper.PageInterceptor;
import io.metersphere.base.domain.ApiTestReportDetail; import io.metersphere.base.domain.ApiTestReportDetail;
import io.metersphere.base.domain.AuthSource;
import io.metersphere.base.domain.FileContent; import io.metersphere.base.domain.FileContent;
import io.metersphere.base.domain.TestResource; import io.metersphere.base.domain.TestResource;
import io.metersphere.commons.utils.CompressUtils; import io.metersphere.commons.utils.CompressUtils;
@ -45,6 +46,7 @@ public class MybatisConfig {
configList.add(new MybatisInterceptorConfig(FileContent.class, "file", CompressUtils.class, "zip", "unzip")); configList.add(new MybatisInterceptorConfig(FileContent.class, "file", CompressUtils.class, "zip", "unzip"));
configList.add(new MybatisInterceptorConfig(ApiTestReportDetail.class, "content", CompressUtils.class, "compress", "decompress")); configList.add(new MybatisInterceptorConfig(ApiTestReportDetail.class, "content", CompressUtils.class, "compress", "decompress"));
configList.add(new MybatisInterceptorConfig(TestResource.class, "configuration")); configList.add(new MybatisInterceptorConfig(TestResource.class, "configuration"));
configList.add(new MybatisInterceptorConfig(AuthSource.class, "configuration"));
interceptor.setInterceptorConfigList(configList); interceptor.setInterceptorConfigList(configList);
return interceptor; return interceptor;
} }

@ -1 +1 @@
Subproject commit bb9c0309161c91bf7d0a9f85cc44bc0eb0fc11ac Subproject commit 387ca56312b62ae5edb3d7f34afa08946d86d621

View File

@ -143,7 +143,7 @@
highlight-current highlight-current
@node-expand="nodeExpand" @node-expand="nodeExpand"
@node-collapse="nodeCollapse" @node-collapse="nodeCollapse"
:allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable class="ms-is-leaf"> :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable>
<span class="custom-tree-node father" slot-scope="{ node, data}" style="width: 96%"> <span class="custom-tree-node father" slot-scope="{ node, data}" style="width: 96%">
<!-- 步骤组件--> <!-- 步骤组件-->
<ms-component-config :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario" <ms-component-config :type="data.type" :scenario="data" :response="response" :currentScenario="currentScenario"
@ -1037,11 +1037,11 @@
z-index: 1; z-index: 1;
} }
/deep/ .el-tree-node__expand-icon.expanded { .ms-expanded >>> .el-tree-node__expand-icon.expanded {
color: #7C3985; color: #7C3985;
} }
/deep/ .el-icon-caret-right { .ms-el-icon-caret-right .el-icon-caret-right {
color: #7C3985; color: #7C3985;
} }

View File

@ -21,7 +21,7 @@
v-if="!readOnly" v-if="!readOnly"
class="tag-input el-input" class="tag-input el-input"
v-model="newTag" v-model="newTag"
placeholder="$t('commons.tag_tip)" :placeholder="$t('commons.tag_tip')"
@keydown.delete.stop="removeLastTag" @keydown.delete.stop="removeLastTag"
@keydown="addNew" @keydown="addNew"
@blur="addNew"/> @blur="addNew"/>

View File

@ -24,7 +24,7 @@
<ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/> <ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/>
</el-card> </el-card>
<div v-if="scenario"> <div v-if="scenario">
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as')"> {{$t('commons.save')}}</el-button> <el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
</div> </div>
<!-- 加载用例 --> <!-- 加载用例 -->
<ms-api-case-list :loaded="false" ref="caseList"/> <ms-api-case-list :loaded="false" ref="caseList"/>
@ -103,7 +103,10 @@
handleCommand(e) { handleCommand(e) {
if (e === "save_as") { if (e === "save_as") {
this.saveAs(); this.saveAs();
} else { } else if (e === 'save_as_api') {
this.saveAsApi();
}
else {
this.runDebug(); this.runDebug();
} }
}, },
@ -121,6 +124,11 @@
this.loading = false; this.loading = false;
this.$refs.debugResult.reload(); this.$refs.debugResult.reload();
}, },
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();
this.$emit('saveAs', obj);
},
saveAs() { saveAs() {
let obj = {request: this.request}; let obj = {request: this.request};
obj.request.id = getUUID(); obj.request.id = getUUID();

View File

@ -39,7 +39,7 @@
</el-card> </el-card>
<div v-if="scenario"> <div v-if="scenario">
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as')"> {{$t('commons.save')}}</el-button> <el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
</div> </div>
<!-- 加载用例 --> <!-- 加载用例 -->
<ms-api-case-list :loaded="false" ref="caseList"/> <ms-api-case-list :loaded="false" ref="caseList"/>
@ -131,7 +131,10 @@
handleCommand(e) { handleCommand(e) {
if (e === "save_as") { if (e === "save_as") {
this.saveAs(); this.saveAs();
} else { } else if (e === 'save_as_api') {
this.saveAsApi();
}
else {
this.runDebug(); this.runDebug();
} }
}, },
@ -157,6 +160,22 @@
this.loading = false; this.loading = false;
this.$refs.debugResult.reload(); this.$refs.debugResult.reload();
}, },
saveAsApi() {
this.$refs['debugForm'].validate((valid) => {
if (valid) {
this.debugForm.id = null;
this.request.id = getUUID();
this.debugForm.request = this.request;
this.debugForm.userId = getCurrentUser().id;
this.debugForm.status = "Underway";
this.debugForm.protocol = this.currentProtocol;
this.$emit('saveAs', this.debugForm);
}
else {
return false;
}
})
},
saveAs() { saveAs() {
this.$refs['debugForm'].validate((valid) => { this.$refs['debugForm'].validate((valid) => {
if (valid) { if (valid) {

View File

@ -25,7 +25,7 @@
<ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/> <ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/>
</el-card> </el-card>
<div v-if="scenario"> <div v-if="scenario">
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as')"> {{$t('commons.save')}}</el-button> <el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
</div> </div>
<!-- 加载用例 --> <!-- 加载用例 -->
<ms-api-case-list :loaded="false" ref="caseList"/> <ms-api-case-list :loaded="false" ref="caseList"/>
@ -105,7 +105,10 @@
handleCommand(e) { handleCommand(e) {
if (e === "save_as") { if (e === "save_as") {
this.saveAs(); this.saveAs();
} else { } else if (e === 'save_as_api') {
this.saveAsApi();
}
else {
this.$refs['requestForm'].validate(); this.$refs['requestForm'].validate();
} }
}, },
@ -123,6 +126,11 @@
this.loading = false; this.loading = false;
this.$refs.debugResult.reload(); this.$refs.debugResult.reload();
}, },
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();
this.$emit('saveAs', obj);
},
saveAs() { saveAs() {
let obj = {request: this.request}; let obj = {request: this.request};
obj.request.id = getUUID(); obj.request.id = getUUID();

View File

@ -35,7 +35,7 @@
<ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/> <ms-run :debug="true" :reportId="reportId" :run-data="runData" @runRefresh="runRefresh" ref="runTest"/>
</el-card> </el-card>
<div v-if="scenario"> <div v-if="scenario">
<el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as')"> {{$t('commons.save')}}</el-button> <el-button style="float: right;margin: 20px" type="primary" @click="handleCommand('save_as_api')"> {{$t('commons.save')}}</el-button>
</div> </div>
<!-- 加载用例 --> <!-- 加载用例 -->
<ms-api-case-list :loaded="false" ref="caseList"/> <ms-api-case-list :loaded="false" ref="caseList"/>
@ -120,6 +120,8 @@
handleCommand(e) { handleCommand(e) {
if (e === "save_as") { if (e === "save_as") {
this.saveAs(); this.saveAs();
} else if (e === 'save_as_api') {
this.saveAsApi();
} else { } else {
this.$refs['requestForm'].validate(); this.$refs['requestForm'].validate();
} }
@ -138,6 +140,11 @@
this.loading = false; this.loading = false;
this.$refs.debugResult.reload(); this.$refs.debugResult.reload();
}, },
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();
this.$emit('saveAs', obj);
},
saveAs() { saveAs() {
let obj = {request: this.request}; let obj = {request: this.request};
obj.request.server = this.debugForm.server; obj.request.server = this.debugForm.server;

@ -1 +1 @@
Subproject commit 3a3363c7d651f340cc37fca74c1edb92af484915 Subproject commit 2b0af7c05f8148046fd17e4f2c06129367d69ac9