refactor: 接口定义页面优化
This commit is contained in:
parent
8783af8006
commit
61fcf80cd5
|
@ -1 +1 @@
|
|||
Subproject commit 905ca8af61ce966d26109e9c5c8c0aee3ca1324e
|
||||
Subproject commit bb494fc68a2367359c9048fa7250c7618de4afb6
|
|
@ -15,6 +15,7 @@
|
|||
<el-dropdown-item command="closeAll">{{$t('api_test.definition.request.close_all_label')}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<!-- 主框架列表 -->
|
||||
<el-tabs v-model="apiDefaultTab" @edit="handleTabsEdit">
|
||||
<el-tab-pane
|
||||
|
@ -61,6 +62,7 @@
|
|||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</ms-main-container>
|
||||
|
||||
|
||||
|
@ -273,4 +275,11 @@
|
|||
/deep/ .el-main {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/deep/ .el-card {
|
||||
/*border: 1px solid #EBEEF5;*/
|
||||
/*border-style: none;*/
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-container style="padding-bottom: 200px">
|
||||
<div v-if="visible" v-loading="result.loading">
|
||||
<ms-drawer :size="40" direction="bottom">
|
||||
|
||||
<template v-slot:header>
|
||||
<el-header style="width: 100% ;padding: 0px">
|
||||
<el-card>
|
||||
<el-row>
|
||||
|
@ -76,6 +78,10 @@
|
|||
<api-environment-config ref="environmentConfig" @close="environmentConfigClose"/>
|
||||
|
||||
</el-header>
|
||||
</template>
|
||||
|
||||
<el-container style="padding-bottom: 200px">
|
||||
|
||||
|
||||
<!-- 用例部分 -->
|
||||
<el-main v-loading="loading" style="overflow: auto">
|
||||
|
@ -151,6 +157,7 @@
|
|||
</el-main>
|
||||
|
||||
</el-container>
|
||||
</ms-drawer>
|
||||
|
||||
<!-- 执行组件 -->
|
||||
<ms-run :debug="false" :environment="environment" :reportId="reportId" :run-data="runData"
|
||||
|
@ -172,10 +179,12 @@
|
|||
import MsSqlBasisParameters from "./request/database/BasisParameters";
|
||||
import MsTcpBasisParameters from "./request/tcp/BasisParameters";
|
||||
import MsDubboBasisParameters from "./request/dubbo/BasisParameters";
|
||||
import MsDrawer from "../../../common/components/MsDrawer";
|
||||
|
||||
export default {
|
||||
name: 'ApiCaseList',
|
||||
components: {
|
||||
MsDrawer,
|
||||
MsTag,
|
||||
MsTipButton,
|
||||
MsApiRequestForm,
|
||||
|
@ -191,10 +200,6 @@
|
|||
type: Object
|
||||
},
|
||||
createCase: String,
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
loaded: Boolean,
|
||||
currentProject: {},
|
||||
refreshSign: String,
|
||||
|
@ -202,6 +207,7 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
grades: [],
|
||||
environments: [],
|
||||
environment: {},
|
||||
|
@ -215,6 +221,7 @@
|
|||
runData: [],
|
||||
reportId: "",
|
||||
checkedCases: new Set(),
|
||||
visible: false
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -251,6 +258,10 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// this.apiCaseList = [];
|
||||
this.visible = true;
|
||||
},
|
||||
sysAddition() {
|
||||
let condition = {};
|
||||
condition.projectId = this.api.projectId;
|
||||
|
@ -285,7 +296,7 @@
|
|||
},
|
||||
apiCaseClose() {
|
||||
this.apiCaseList = [];
|
||||
this.$emit('apiCaseClose');
|
||||
this.visible = false;
|
||||
},
|
||||
batchRun() {
|
||||
if (!this.environment) {
|
||||
|
@ -396,7 +407,7 @@
|
|||
condition.apiDefinitionId = this.api.id;
|
||||
condition.priority = this.priorityValue;
|
||||
condition.name = this.name;
|
||||
this.$post("/api/testcase/list", condition, response => {
|
||||
this.result = this.$post("/api/testcase/list", condition, response => {
|
||||
for (let index in response.data) {
|
||||
let test = response.data[index];
|
||||
test.request = JSON.parse(test.request);
|
||||
|
@ -494,6 +505,9 @@
|
|||
}
|
||||
let arr = Array.from(this.checkedCases);
|
||||
this.currentRow.cases = arr;
|
||||
},
|
||||
handleClose() {
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<template>
|
||||
<div id="svgBox" style="overflow: auto">
|
||||
<div id="svgTop" style="background-color: white">
|
||||
<div>
|
||||
<el-card class="card-content">
|
||||
<el-input placeholder="搜索" @blur="search" style="float: right ;width: 300px;margin-bottom: 20px;margin-right: 20px" size="small" v-model="condition.name"/>
|
||||
<el-input placeholder="搜索" @blur="search" class="search-input" size="small" v-model="condition.name"/>
|
||||
|
||||
<el-table border :data="tableData" row-key="id" class="test-content adjust-table"
|
||||
@select-all="handleSelectAll"
|
||||
|
@ -82,13 +81,8 @@
|
|||
<ms-table-pagination :change="initApiTable" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
</el-card>
|
||||
</div>
|
||||
<div id="svgResize"/>
|
||||
<div id="svgDown">
|
||||
<ms-bottom-container v-bind:enableAsideHidden="isHide">
|
||||
<ms-api-case-list @apiCaseClose="apiCaseClose" @refresh="initApiTable" :visible="visible" :currentRow="currentRow" :api="selectApi" :current-project="currentProject"/>
|
||||
</ms-bottom-container>
|
||||
</div>
|
||||
<ms-api-case-list @refresh="initApiTable" :currentRow="currentRow"
|
||||
:api="selectApi" :current-project="currentProject" ref="caseList"/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
@ -125,7 +119,6 @@
|
|||
data() {
|
||||
return {
|
||||
condition: {},
|
||||
isHide: true,
|
||||
selectApi: {},
|
||||
moduleId: "",
|
||||
deletePath: "/test/case/delete",
|
||||
|
@ -154,21 +147,15 @@
|
|||
created: function () {
|
||||
this.initApiTable();
|
||||
},
|
||||
mounted() {
|
||||
this.dragControllerDiv();
|
||||
},
|
||||
watch: {
|
||||
currentProject() {
|
||||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
},
|
||||
currentModule() {
|
||||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
},
|
||||
currentProtocol() {
|
||||
this.initApiTable();
|
||||
this.apiCaseClose();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -283,17 +270,10 @@
|
|||
}
|
||||
},
|
||||
handleTestCase(testCase) {
|
||||
let h = window.screen.height;
|
||||
let svgTop = document.getElementById("svgTop");
|
||||
svgTop.style.height = h / 2 - 200 + "px";
|
||||
|
||||
let svgDown = document.getElementById("svgDown");
|
||||
svgDown.style.height = h / 2 + "px";
|
||||
|
||||
this.selectApi = testCase;
|
||||
let request = JSON.parse(testCase.request);
|
||||
this.selectApi.url = request.path;
|
||||
this.isHide = false;
|
||||
this.$refs.caseList.open();
|
||||
},
|
||||
handleDelete(api) {
|
||||
if (this.currentModule != undefined && this.currentModule.id == "gc") {
|
||||
|
@ -316,48 +296,11 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
apiCaseClose() {
|
||||
let h = window.screen.height;
|
||||
|
||||
let svgTop = document.getElementById("svgTop");
|
||||
svgTop.style.height = h - 200 + "px";
|
||||
|
||||
let svgDown = document.getElementById("svgDown");
|
||||
svgDown.style.height = 0 + "px";
|
||||
this.isHide = true;
|
||||
},
|
||||
getColor(enable, method) {
|
||||
if (enable) {
|
||||
return this.methodColorMap.get(method);
|
||||
}
|
||||
},
|
||||
dragControllerDiv: function () {
|
||||
let svgResize = document.getElementById("svgResize");
|
||||
let svgTop = document.getElementById("svgTop");
|
||||
let svgDown = document.getElementById("svgDown");
|
||||
let svgBox = document.getElementById("svgBox");
|
||||
svgResize.onmousedown = function (e) {
|
||||
let startY = e.clientY;
|
||||
svgResize.top = svgResize.offsetTop;
|
||||
document.onmousemove = function (e) {
|
||||
let endY = e.clientY;
|
||||
let moveLen = svgResize.top + (endY - startY);
|
||||
let maxT = svgBox.clientHeight - svgResize.offsetHeight;
|
||||
if (moveLen < 30) moveLen = 30;
|
||||
if (moveLen > maxT - 30) moveLen = maxT - 30;
|
||||
svgResize.style.top = moveLen;
|
||||
svgTop.style.height = moveLen + "px";
|
||||
svgDown.style.height = (svgBox.clientHeight - moveLen - 5) + "px";
|
||||
}
|
||||
document.onmouseup = function (evt) {
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
svgResize.releaseCapture && svgResize.releaseCapture();
|
||||
}
|
||||
svgResize.setCapture && svgResize.setCapture();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -377,32 +320,11 @@
|
|||
color: white;
|
||||
}
|
||||
|
||||
#svgBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.search-input {
|
||||
float: right;
|
||||
width: 300px;
|
||||
/*margin-bottom: 20px;*/
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#svgTop {
|
||||
height: calc(30% - 5px);
|
||||
width: 100%;
|
||||
float: left;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#svgResize {
|
||||
position: relative;
|
||||
height: 5px;
|
||||
width: 100%;
|
||||
cursor: s-resize;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#svgDown {
|
||||
height: 70%;
|
||||
width: 100%;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
<template>
|
||||
<div direction="vertical" :class="direction" @mousedown="mouseDown"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "MsDragMoveBar",
|
||||
data() {
|
||||
return {
|
||||
lastX: '',
|
||||
lastY: '',
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
direction: {
|
||||
type: String,
|
||||
default() {
|
||||
return 'vertical';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
document.addEventListener("mouseup", this.mouseUp);
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
document.removeEventListener("mouseup", this.mouseUp);
|
||||
},
|
||||
|
||||
methods: {
|
||||
mouseDown(event) {
|
||||
document.addEventListener("mousemove", this.mouseMove);
|
||||
this.lastX = event.screenX;
|
||||
this.lastY = event.screenY;
|
||||
},
|
||||
mouseMove(event) {
|
||||
this.$emit("widthChange", this.lastX - event.screenX);
|
||||
this.$emit("heightChange", this.lastY - event.screenY);
|
||||
this.lastX = event.screenX;
|
||||
this.lastY = event.screenY;
|
||||
},
|
||||
mouseUp() {
|
||||
this.lastX = "";
|
||||
this.lastY = "";
|
||||
document.removeEventListener("mousemove", this.mouseMove);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style >
|
||||
.drag-bar {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
cursor: row-resize;
|
||||
z-index: 10;
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
.horizontal {
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
cursor: col-resize;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.vertical {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
cursor: row-resize;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.vertical:hover {
|
||||
height: 3px;
|
||||
background-color: #ccc;
|
||||
/*-webkit-box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);*/
|
||||
/*box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);*/
|
||||
}
|
||||
|
||||
.horizontal:hover {
|
||||
width: 3px;
|
||||
/*background-color: #7C3985;*/
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
<template>
|
||||
<div id="ms-drawer" class="ms-drawer" :class="directionStyle" :style="{width: w + 'px', height: h + 'px'}" ref="msDrawer">
|
||||
<ms-drag-move-bar :direction="dragBarDirection" @widthChange="widthChange" @heightChange="heightChange"/>
|
||||
<div class="ms-drawer-header" >
|
||||
<slot name="header"></slot>
|
||||
</div>
|
||||
<div class="ms-drawer-body">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsDragMoveBar from "./MsDragMoveBar";
|
||||
export default {
|
||||
name: "MsDrawer",
|
||||
components: {MsDragMoveBar},
|
||||
data() {
|
||||
return {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 100,
|
||||
h: 100,
|
||||
directionStyle: 'left-style',
|
||||
dragBarDirection: 'vertical',
|
||||
}
|
||||
},
|
||||
props: {
|
||||
direction: {
|
||||
type: String,
|
||||
default() {
|
||||
return "left";
|
||||
}
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// todo 其他方向待优化
|
||||
switch (this.direction) {
|
||||
case 'left':
|
||||
this.w = this.getWidthPercentage(this.size);
|
||||
this.h = this.getHeightPercentage(100);
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.directionStyle = 'left-style';
|
||||
this.dragBarDirection = 'horizontal';
|
||||
break;
|
||||
case 'right':
|
||||
this.w = this.getWidthPercentage(this.size);
|
||||
this.h = this.getHeightPercentage(100);
|
||||
this.x = document.body.clientWidth - this.w;
|
||||
this.y = 0;
|
||||
this.directionStyle = 'right-style';
|
||||
this.dragBarDirection = 'horizontal';
|
||||
break;
|
||||
case 'top':
|
||||
this.w = this.getWidthPercentage(100);
|
||||
this.h = this.getHeightPercentage(this.size);
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.directionStyle = 'top-style';
|
||||
this.dragBarDirection = 'vertical';
|
||||
break;
|
||||
case 'bottom':
|
||||
this.w = this.getWidthPercentage(100);
|
||||
this.h = this.getHeightPercentage(this.size);
|
||||
this.x = 0;
|
||||
this.y = document.body.clientHeight - this.h;
|
||||
this.directionStyle = 'bottom-style';
|
||||
this.dragBarDirection = 'vertical';
|
||||
break;
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
},
|
||||
getWidthPercentage(per) {
|
||||
return document.body.clientWidth * per / 100.0;
|
||||
},
|
||||
getHeightPercentage(per) {
|
||||
return document.body.clientHeight * per / 100.0;
|
||||
},
|
||||
widthChange(movement) {
|
||||
if (this.direction != 'left' && this.direction != 'right') {
|
||||
return;
|
||||
}
|
||||
switch (this.direction) {
|
||||
case 'top':
|
||||
this.w -= movement;
|
||||
break;
|
||||
case 'bottom':
|
||||
this.w += movement;
|
||||
break;
|
||||
}
|
||||
this._widthChange();
|
||||
},
|
||||
heightChange(movement) {
|
||||
if (this.direction != 'top' && this.direction != 'bottom') {
|
||||
return;
|
||||
}
|
||||
switch (this.direction) {
|
||||
case 'top':
|
||||
this.h -= movement;
|
||||
break;
|
||||
case 'bottom':
|
||||
this.h += movement;
|
||||
break;
|
||||
}
|
||||
this._heightChange();
|
||||
},
|
||||
_heightChange() {
|
||||
if (this.h < 0) {
|
||||
this.h = 0;
|
||||
}
|
||||
if (this.h > document.body.clientHeight) {
|
||||
this.h = document.body.clientHeight;
|
||||
}
|
||||
},
|
||||
_widthChange() {
|
||||
if (this.w < 0) {
|
||||
this.w = 0;
|
||||
}
|
||||
if (this.w > document.body.clientWidth) {
|
||||
this.w = document.body.clientWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.ms-drawer {
|
||||
background-color: white;
|
||||
border: 1px #DCDFE6 solid;
|
||||
-webkit-box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
|
||||
box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
|
||||
z-index: 999 !important;
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.left-style {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.right-style {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.top-style {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.bottom-style {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 5px;
|
||||
}
|
||||
|
||||
.ms-drawer-body {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.ms-drawer-header {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
</style>
|
|
@ -15,7 +15,7 @@
|
|||
#body {
|
||||
width: 100%;
|
||||
height: calc(100vh - 40px);
|
||||
background-color: #F5F5F5;
|
||||
/*background-color: #F5F5F5;*/
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<template>
|
||||
|
||||
<test-case-relevance-base ref="baseRelevance">
|
||||
<test-case-relevance-base
|
||||
@setProject="setProject"
|
||||
@save="saveCaseRelevance"
|
||||
:plan-id="planId"
|
||||
ref="baseRelevance">
|
||||
|
||||
<template v-slot:aside>
|
||||
<node-tree class="node-tree"
|
||||
|
@ -11,7 +15,9 @@
|
|||
</template>
|
||||
|
||||
<ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>
|
||||
|
||||
<el-table
|
||||
v-loading="result.loading"
|
||||
:data="testCases"
|
||||
@filter-change="filter"
|
||||
row-key="id"
|
||||
|
@ -58,104 +64,19 @@
|
|||
<div v-if="!lineStatus" style="text-align: center">{{$t('test_track.review_view.last_page')}}</div>
|
||||
<div style="text-align: center">共 {{total}} 条</div>
|
||||
|
||||
|
||||
</test-case-relevance-base>
|
||||
|
||||
<!--<div>-->
|
||||
<!--<el-dialog :title="$t('test_track.plan_view.relevance_test_case')"-->
|
||||
<!--:visible.sync="dialogFormVisible"-->
|
||||
<!--@close="close"-->
|
||||
<!--width="60%" v-loading="result.loading"-->
|
||||
<!--:close-on-click-modal="false"-->
|
||||
<!--top="50px">-->
|
||||
|
||||
<!--<el-container class="main-content">-->
|
||||
<!--<el-aside class="tree-aside" width="250px">-->
|
||||
<!--<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName :-->
|
||||
<!--$t('test_track.switch_project') }}-->
|
||||
<!--</el-link>-->
|
||||
<!--<node-tree class="node-tree"-->
|
||||
<!--@nodeSelectEvent="nodeChange"-->
|
||||
<!--@refresh="refresh"-->
|
||||
<!--:tree-nodes="treeNodes"-->
|
||||
<!--ref="nodeTree"/>-->
|
||||
<!--</el-aside>-->
|
||||
|
||||
<!--<el-container>-->
|
||||
<!--<el-main class="case-content">-->
|
||||
<!--<ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>-->
|
||||
<!--<el-table-->
|
||||
<!--:data="testCases"-->
|
||||
<!--@filter-change="filter"-->
|
||||
<!--row-key="id"-->
|
||||
<!--@mouseleave.passive="leave"-->
|
||||
<!--v-el-table-infinite-scroll="scrollLoading"-->
|
||||
<!--@select-all="handleSelectAll"-->
|
||||
<!--@select="handleSelectionChange"-->
|
||||
<!--height="50vh"-->
|
||||
<!--ref="table">-->
|
||||
|
||||
<!--<el-table-column-->
|
||||
<!--type="selection"></el-table-column>-->
|
||||
|
||||
<!--<el-table-column-->
|
||||
<!--prop="name"-->
|
||||
<!--:label="$t('test_track.case.name')"-->
|
||||
<!--style="width: 100%">-->
|
||||
<!--<template v-slot:default="scope">-->
|
||||
<!--{{scope.row.name}}-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column-->
|
||||
<!--prop="priority"-->
|
||||
<!--:filters="priorityFilters"-->
|
||||
<!--column-key="priority"-->
|
||||
<!--:label="$t('test_track.case.priority')"-->
|
||||
<!--show-overflow-tooltip>-->
|
||||
<!--<template v-slot:default="scope">-->
|
||||
<!--<priority-table-item :value="scope.row.priority"/>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--<el-table-column-->
|
||||
<!--prop="type"-->
|
||||
<!--:filters="typeFilters"-->
|
||||
<!--column-key="type"-->
|
||||
<!--:label="$t('test_track.case.type')"-->
|
||||
<!--show-overflow-tooltip>-->
|
||||
<!--<template v-slot:default="scope">-->
|
||||
<!--<type-table-item :value="scope.row.type"/>-->
|
||||
<!--</template>-->
|
||||
<!--</el-table-column>-->
|
||||
<!--</el-table>-->
|
||||
|
||||
<!--<div v-if="!lineStatus" style="text-align: center">{{$t('test_track.review_view.last_page')}}</div>-->
|
||||
<!--<div style="text-align: center">共 {{total}} 条</div>-->
|
||||
<!--</el-main>-->
|
||||
<!--</el-container>-->
|
||||
<!--</el-container>-->
|
||||
|
||||
<!--<template v-slot:footer>-->
|
||||
<!--<ms-dialog-footer @cancel="dialogFormVisible = false" @confirm="saveCaseRelevance"/>-->
|
||||
<!--</template>-->
|
||||
|
||||
<!--</el-dialog>-->
|
||||
|
||||
<!--<switch-project ref="switchProject" @getProjectNode="getProjectNode"/>-->
|
||||
<!--</div>-->
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import NodeTree from '../../../../common/NodeTree';
|
||||
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||
import MsTableSearchBar from "../../../../../common/components/MsTableSearchBar";
|
||||
import MsTableAdvSearchBar from "../../../../../common/components/search/MsTableAdvSearchBar";
|
||||
import MsTableHeader from "../../../../../common/components/MsTableHeader";
|
||||
import {TEST_CASE_CONFIGS} from "../../../../../common/components/search/search-components";
|
||||
import SwitchProject from "../../../../case/components/SwitchProject";
|
||||
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
||||
import {_filter} from "../../../../../../../common/js/utils";
|
||||
|
@ -165,13 +86,11 @@
|
|||
components: {
|
||||
TestCaseRelevanceBase,
|
||||
NodeTree,
|
||||
MsDialogFooter,
|
||||
PriorityTableItem,
|
||||
TypeTableItem,
|
||||
MsTableSearchBar,
|
||||
MsTableAdvSearchBar,
|
||||
MsTableHeader,
|
||||
SwitchProject
|
||||
},
|
||||
directives: {
|
||||
'el-table-infinite-scroll': elTableInfiniteScroll
|
||||
|
@ -179,7 +98,6 @@
|
|||
data() {
|
||||
return {
|
||||
result: {},
|
||||
dialogFormVisible: false,
|
||||
isCheckAll: false,
|
||||
testCases: [],
|
||||
selectIds: new Set(),
|
||||
|
@ -219,13 +137,12 @@
|
|||
this.condition.planId = this.planId;
|
||||
},
|
||||
selectNodeIds() {
|
||||
if (this.dialogFormVisible) {
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
projectId() {
|
||||
this.condition.projectId = this.projectId;
|
||||
this.getProjectNode();
|
||||
this.search();
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
|
@ -235,8 +152,10 @@
|
|||
|
||||
open() {
|
||||
this.$refs.baseRelevance.open();
|
||||
},
|
||||
|
||||
//
|
||||
setProject(projectId) {
|
||||
this.projectId = projectId;
|
||||
},
|
||||
|
||||
saveCaseRelevance() {
|
||||
|
@ -251,7 +170,9 @@
|
|||
this.result = this.$post('/test/plan/relevance', param, () => {
|
||||
this.selectIds.clear();
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.dialogFormVisible = false;
|
||||
|
||||
this.$refs.baseRelevance.close();
|
||||
|
||||
this.$emit('refresh');
|
||||
});
|
||||
},
|
||||
|
@ -274,7 +195,27 @@
|
|||
}
|
||||
if (this.projectId) {
|
||||
this.condition.projectId = this.projectId;
|
||||
this.result = this.$post(this.buildPagePath('/test/case/name'), this.condition, response => {
|
||||
// this.result = this.$post(this.buildPagePath('/test/case/name'), this.condition, response => {
|
||||
// let data = response.data;
|
||||
// this.total = data.itemCount;
|
||||
// let tableData = data.listObject;
|
||||
// tableData.forEach(item => {
|
||||
// item.checked = false;
|
||||
// });
|
||||
// flag ? this.testCases = tableData : this.testCases = this.testCases.concat(tableData);
|
||||
// // 去重处理
|
||||
// let hash = {}
|
||||
// this.testCases = this.testCases.reduce((item, next) => {
|
||||
// if (!hash[next.id]) {
|
||||
// hash[next.id] = true
|
||||
// item.push(next)
|
||||
// }
|
||||
// return item
|
||||
// }, [])
|
||||
//
|
||||
// this.lineStatus = tableData.length === 50 && this.testCases.length < this.total;
|
||||
// });
|
||||
this.result = this.$post('/api/definition/list/1/10', this.condition, response => {
|
||||
let data = response.data;
|
||||
this.total = data.itemCount;
|
||||
let tableData = data.listObject;
|
||||
|
@ -295,7 +236,6 @@
|
|||
this.lineStatus = tableData.length === 50 && this.testCases.length < this.total;
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
handleSelectAll(selection) {
|
||||
if (selection.length > 0) {
|
||||
|
@ -325,7 +265,7 @@
|
|||
this.close();
|
||||
},
|
||||
scrollLoading() {
|
||||
if (this.dialogFormVisible && this.lineStatus) {
|
||||
if (this.lineStatus) {
|
||||
this.currentPage += 1;
|
||||
this.getTestCases();
|
||||
}
|
||||
|
@ -336,7 +276,7 @@
|
|||
testPlanId: this.planId,
|
||||
projectId: this.projectId
|
||||
};
|
||||
this.result = this.$post("/case/node/list/all/plan", param, response => {
|
||||
this.result = this.$get('/api/module/list/' + this.project + '/HTTP', response => {
|
||||
this.treeNodes = response.data;
|
||||
});
|
||||
}
|
||||
|
@ -361,24 +301,6 @@
|
|||
})
|
||||
})
|
||||
},
|
||||
getProject() {
|
||||
if (this.planId) {
|
||||
this.result = this.$post("/test/plan/project/", {planId: this.planId}, res => {
|
||||
let data = res.data;
|
||||
if (data) {
|
||||
this.projects = data;
|
||||
this.projectId = data[0].id;
|
||||
this.projectName = data[0].name;
|
||||
this.search();
|
||||
// 获取项目时刷新该项目模块
|
||||
this.getProjectNode(this.projectId)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
switchProject() {
|
||||
this.$refs.switchProject.open({id: this.planId, url: '/test/plan/project/', type: 'plan'});
|
||||
},
|
||||
getProjectNode(projectId) {
|
||||
const index = this.projects.findIndex(project => project.id === projectId);
|
||||
if (index !== -1) {
|
||||
|
@ -387,11 +309,13 @@
|
|||
if (projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
this.result = this.$post("/case/node/list/all/plan",
|
||||
{testPlanId: this.planId, projectId: this.projectId}, response => {
|
||||
this.$refs.nodeTree.result = this.$get('/api/module/list/' + this.projectId + '/HTTP', response => {
|
||||
this.treeNodes = response.data;
|
||||
});
|
||||
|
||||
// this.$refs.nodeTree.result = this.$post('/api/module/list/' + this.project + '/HTTP',
|
||||
// {testPlanId: this.planId, projectId: this.projectId}, response => {
|
||||
// this.treeNodes = response.data;
|
||||
// });
|
||||
this.selectNodeIds = [];
|
||||
}
|
||||
}
|
||||
|
@ -399,53 +323,4 @@
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.tb-edit .el-input {
|
||||
display: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tb-edit .current-row .el-input {
|
||||
display: block;
|
||||
|
||||
}
|
||||
|
||||
.tb-edit .current-row .el-input + span {
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
.node-tree {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.el-header {
|
||||
background-color: darkgrey;
|
||||
color: #333;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.case-content {
|
||||
padding: 0px 20px;
|
||||
height: 100%;
|
||||
/*border: 1px solid #EBEEF5;*/
|
||||
}
|
||||
|
||||
.tree-aside {
|
||||
min-height: 300px;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
min-height: 300px;
|
||||
height: 100%;
|
||||
/*border: 1px solid #EBEEF5;*/
|
||||
}
|
||||
|
||||
.project-link {
|
||||
float: right;
|
||||
margin-right: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 29a8fc09602fde5708af06582ac972d98eb69836
|
||||
Subproject commit a22a3005d9bd254793fcf634d72539cbdf31be3a
|
|
@ -16,6 +16,11 @@ body {
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
/* 解决 document.body.clientHeight 为0 */
|
||||
html,body {
|
||||
height:100%
|
||||
}
|
||||
|
||||
.main-content span.title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
|
|
Loading…
Reference in New Issue