# Conflicts:
#	backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
This commit is contained in:
fit2-zhao 2021-02-05 10:40:48 +08:00
commit 1102ad81ab
5 changed files with 199 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package io.metersphere.base.mapper.ext;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.io.InputStream;
public interface ExtFileContentMapper {
@Select(value = {
"SELECT file ",
"FROM file_content ",
"WHERE file_id = #{id, jdbcType=VARCHAR}"
})
InputStream selectZipBytes(@Param("id") String id);
}

View File

@ -0,0 +1,3 @@
ALTER TABLE api_scenario MODIFY COLUMN id VARCHAR (255);
ALTER TABLE test_plan_api_scenario MODIFY COLUMN api_scenario_id VARCHAR (255);
ALTER TABLE api_scenario_report MODIFY COLUMN scenario_id VARCHAR (255);

View File

@ -0,0 +1,53 @@
<template>
<div>
<div v-if="request.protocol === 'HTTP'">
<el-input :placeholder="$t('api_test.definition.request.path_all_info')" v-if="request.url" v-model="request.url" style="width: 85%;margin-top: 10px" size="small">
<el-select v-model="request.method" slot="prepend" style="width: 100px" size="small">
<el-option v-for="item in reqOptions" :key="item.id" :label="item.label" :value="item.id"/>
</el-select>
</el-input>
<el-input :placeholder="$t('api_test.definition.request.path_all_info')" v-else v-model="request.path" style="width: 85%;margin-top: 10px" size="small">
<el-select v-model="request.method" slot="prepend" style="width: 100px" size="small">
<el-option v-for="item in reqOptions" :key="item.id" :label="item.label" :value="item.id"/>
</el-select>
</el-input>
</div>
<div v-if="request.protocol === 'TCP' && isCustomizeReq">
<el-form>
<el-row>
<el-col :span="8">
<el-form-item :label="$t('api_test.request.tcp.server')" prop="server">
<el-input class="server-input" v-model="request.server" maxlength="300" show-word-limit size="small"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('api_test.request.tcp.port')" prop="port" label-width="60px">
<el-input-number v-model="request.port" controls-position="right" :min="0" :max="65535" size="small"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import {REQ_METHOD} from "@/business/components/api/definition/model/JsonData";
export default {
name: "CustomizeReqInfo",
props: ['request', 'isCustomizeReq'],
data() {
return {
reqOptions: REQ_METHOD,
}
}
}
</script>
<style scoped>
.server-input {
width: 50%;
}
</style>

View File

@ -0,0 +1,127 @@
<template>
<div v-if="dialogVisible" class="batch-move" v-loading="result.loading">
<el-dialog :title="this.$t('test_track.case.select_catalog')"
:visible.sync="dialogVisible"
:before-close="close"
:destroy-on-close="true"
width="20%"
>
<div>
<el-input :placeholder="$t('test_track.module.search')" v-model="filterText" size="small"/>
<el-tree
class="filter-tree node-tree"
:data="treeNodes"
node-key="id"
:filter-node-method="filterNode"
:expand-on-click-node="false"
highlight-current
style="overflow: auto"
@node-click="nodeClick"
ref="tree"
>
<template v-slot:default="{node}">
<span>
<span class="node-icon">
<i class="el-icon-folder"/>
</span>
<span class="node-title">{{node.label}}</span>
</span>
</template>
</el-tree>
</div>
<template v-slot:footer>
<ms-dialog-footer
@cancel="close"
@confirm="save"/>
</template>
</el-dialog>
</div>
</template>
<script>
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
export default {
name: "CaseBatchMove",
components: {
MsDialogFooter
},
data() {
return {
treeNodes: [],
selectIds: [],
selectNode: {},
dialogVisible: false,
currentKey: "",
moduleOptions: [],
filterText: "",
result: {},
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
console.log( this.treeNodes)
}
},
methods: {
open(treeNodes, selectIds, moduleOptions) {
this.dialogVisible = true;
this.treeNodes = treeNodes;
this.selectIds = selectIds;
this.moduleOptions = moduleOptions;
},
save() {
if (!this.currentKey) {
this.$warning(this.$t('test_track.case.input_module'));
return;
}
let param = {};
param.nodeId = this.currentKey;
if (this.moduleOptions) {
this.moduleOptions.forEach(item => {
if (item.id === this.currentKey) {
param.nodePath = item.path;
}
});
}
param.ids = this.selectIds;
this.$emit('moveSave', param);
},
refresh() {
this.$emit("refresh");
},
close() {
this.filterText = "";
this.dialogVisible = false;
this.selectNode = {};
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
nodeClick() {
this.currentKey = this.$refs.tree.getCurrentKey();
}
}
}
</script>
<style scoped>
.node-title {
width: 0;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1 1 auto;
padding: 0 5px;
overflow: hidden;
}
.batch-move {
height: 500px;
}
</style>

@ -1 +1 @@
Subproject commit 53bd821bee65be3374f1ccc9a299cef9ac44b985
Subproject commit a3d469fd18f663d11e5c1c49f71ced6e3e4b292f