Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
8783af8006
|
@ -263,13 +263,20 @@
|
||||||
<artifactId>spring-boot-starter-data-ldap</artifactId>
|
<artifactId>spring-boot-starter-data-ldap</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- swagger 解析 -->
|
<!-- swagger2 解析 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-parser</artifactId>
|
<artifactId>swagger-parser</artifactId>
|
||||||
<version>1.0.51</version>
|
<version>1.0.51</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- swagger3 解析 -->
|
||||||
|
<!--<dependency>-->
|
||||||
|
<!--<groupId>io.swagger.parser.v3</groupId>-->
|
||||||
|
<!--<artifactId>swagger-parser</artifactId>-->
|
||||||
|
<!--<version>2.0.24</version>-->
|
||||||
|
<!--</dependency>-->
|
||||||
|
|
||||||
<!-- 执行 js 代码依赖 -->
|
<!-- 执行 js 代码依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.graalvm.sdk</groupId>
|
<groupId>org.graalvm.sdk</groupId>
|
||||||
|
|
|
@ -358,7 +358,7 @@
|
||||||
let bodyUploadFiles = [];
|
let bodyUploadFiles = [];
|
||||||
row.bodyUploadIds = [];
|
row.bodyUploadIds = [];
|
||||||
let request = row.request;
|
let request = row.request;
|
||||||
if (request.body) {
|
if (request.body && request.body.kvs) {
|
||||||
request.body.kvs.forEach(param => {
|
request.body.kvs.forEach(param => {
|
||||||
if (param.files) {
|
if (param.files) {
|
||||||
param.files.forEach(item => {
|
param.files.forEach(item => {
|
||||||
|
@ -372,6 +372,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (request.body.binary) {
|
||||||
request.body.binary.forEach(param => {
|
request.body.binary.forEach(param => {
|
||||||
if (param.files) {
|
if (param.files) {
|
||||||
param.files.forEach(item => {
|
param.files.forEach(item => {
|
||||||
|
@ -386,6 +387,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return bodyUploadFiles;
|
return bodyUploadFiles;
|
||||||
},
|
},
|
||||||
getApiTest() {
|
getApiTest() {
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
getBodyUploadFiles(obj) {
|
getBodyUploadFiles(obj) {
|
||||||
let bodyUploadFiles = [];
|
let bodyUploadFiles = [];
|
||||||
obj.bodyUploadIds = [];
|
obj.bodyUploadIds = [];
|
||||||
|
if (this.runData) {
|
||||||
this.runData.forEach(request => {
|
this.runData.forEach(request => {
|
||||||
if (request.body) {
|
if (request.body) {
|
||||||
request.body.kvs.forEach(param => {
|
request.body.kvs.forEach(param => {
|
||||||
|
@ -94,6 +95,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return bodyUploadFiles;
|
return bodyUploadFiles;
|
||||||
},
|
},
|
||||||
run() {
|
run() {
|
||||||
|
|
|
@ -58,7 +58,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NodeEdit from "./NodeEdit";
|
import NodeEdit from "./NodeEdit";
|
||||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER} from "../../../../common/js/constants";
|
|
||||||
import {checkoutTestManagerOrTestUser, hasRoles} from "../../../../common/js/utils";
|
import {checkoutTestManagerOrTestUser, hasRoles} from "../../../../common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<span class="menu-title">{{'[' + title + ']'}}</span>
|
<span class="menu-title">{{'[' + title + ']'}}</span>
|
||||||
<el-select filterable slot="prepend" v-model="value" @change="changeData" class="project_menu"
|
<el-select filterable slot="prepend" v-model="value" @change="changeData" :style="{width: width}"
|
||||||
size="small">
|
size="small">
|
||||||
<el-option v-for="(item,index) in data" :key="index" :label="item.name" :value="index"/>
|
<el-option v-for="(item,index) in data" :key="index" :label="item.name" :value="index"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -20,6 +20,12 @@
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
width: {
|
||||||
|
type: String,
|
||||||
|
default() {
|
||||||
|
return "214px";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -43,9 +49,6 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.project_menu {
|
|
||||||
width: 214px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-title {
|
.menu-title {
|
||||||
color: darkgrey;
|
color: darkgrey;
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import NodeTree from "../../common/NodeTree";
|
import NodeTree from "../../common/NodeTree";
|
||||||
import TestPlanTestCaseList from "./comonents/TestPlanTestCaseList";
|
import TestPlanTestCaseList from "./comonents/functional/FunctionalTestCaseList";
|
||||||
import TestCaseRelevance from "./comonents/TestCaseRelevance";
|
import TestCaseRelevance from "./comonents/functional/TestCaseFunctionalRelevance";
|
||||||
import SelectMenu from "../../common/SelectMenu";
|
import SelectMenu from "../../common/SelectMenu";
|
||||||
import MsContainer from "../../../common/components/MsContainer";
|
import MsContainer from "../../../common/components/MsContainer";
|
||||||
import MsAsideContainer from "../../../common/components/MsAsideContainer";
|
import MsAsideContainer from "../../../common/components/MsAsideContainer";
|
||||||
|
|
|
@ -1,26 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<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">
|
<test-case-relevance-base ref="baseRelevance">
|
||||||
<el-aside class="tree-aside" width="250px">
|
|
||||||
<el-link type="primary" class="project-link" @click="switchProject">{{projectName ? projectName :
|
<template v-slot:aside>
|
||||||
$t('test_track.switch_project') }}
|
|
||||||
</el-link>
|
|
||||||
<node-tree class="node-tree"
|
<node-tree class="node-tree"
|
||||||
@nodeSelectEvent="nodeChange"
|
@nodeSelectEvent="nodeChange"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
:tree-nodes="treeNodes"
|
:tree-nodes="treeNodes"
|
||||||
ref="nodeTree"/>
|
ref="nodeTree"/>
|
||||||
</el-aside>
|
</template>
|
||||||
|
|
||||||
<el-container>
|
|
||||||
<el-main class="case-content">
|
|
||||||
<ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>
|
<ms-table-header :condition.sync="condition" @search="search" title="" :show-create="false"/>
|
||||||
<el-table
|
<el-table
|
||||||
:data="testCases"
|
:data="testCases"
|
||||||
|
@ -68,38 +57,113 @@
|
||||||
|
|
||||||
<div v-if="!lineStatus" style="text-align: center">{{$t('test_track.review_view.last_page')}}</div>
|
<div v-if="!lineStatus" style="text-align: center">{{$t('test_track.review_view.last_page')}}</div>
|
||||||
<div style="text-align: center">共 {{total}} 条</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>
|
</test-case-relevance-base>
|
||||||
|
|
||||||
<switch-project ref="switchProject" @getProjectNode="getProjectNode"/>
|
<!--<div>-->
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import NodeTree from '../../../common/NodeTree';
|
import NodeTree from '../../../../common/NodeTree';
|
||||||
import MsDialogFooter from '../../../../common/components/MsDialogFooter'
|
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||||
import PriorityTableItem from "../../../common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||||
import TypeTableItem from "../../../common/tableItems/planview/TypeTableItem";
|
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||||
import {_filter} from "../../../../../../common/js/utils";
|
import MsTableSearchBar from "../../../../../common/components/MsTableSearchBar";
|
||||||
import MsTableSearchBar from "../../../../common/components/MsTableSearchBar";
|
import MsTableAdvSearchBar from "../../../../../common/components/search/MsTableAdvSearchBar";
|
||||||
import MsTableAdvSearchBar from "../../../../common/components/search/MsTableAdvSearchBar";
|
import MsTableHeader from "../../../../../common/components/MsTableHeader";
|
||||||
import MsTableHeader from "../../../../common/components/MsTableHeader";
|
import {TEST_CASE_CONFIGS} from "../../../../../common/components/search/search-components";
|
||||||
import {TEST_CASE_CONFIGS} from "../../../../common/components/search/search-components";
|
import SwitchProject from "../../../../case/components/SwitchProject";
|
||||||
import SwitchProject from "../../../case/components/SwitchProject";
|
|
||||||
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||||
|
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
||||||
|
import {_filter} from "../../../../../../../common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseRelevance",
|
name: "TestCaseApiRelevance",
|
||||||
components: {
|
components: {
|
||||||
|
TestCaseRelevanceBase,
|
||||||
NodeTree,
|
NodeTree,
|
||||||
MsDialogFooter,
|
MsDialogFooter,
|
||||||
PriorityTableItem,
|
PriorityTableItem,
|
||||||
|
@ -168,10 +232,13 @@
|
||||||
this.toggleSelection(this.testCases);
|
this.toggleSelection(this.testCases);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openTestCaseRelevanceDialog() {
|
|
||||||
this.getProject();
|
open() {
|
||||||
this.dialogFormVisible = true;
|
this.$refs.baseRelevance.open();
|
||||||
|
|
||||||
|
//
|
||||||
},
|
},
|
||||||
|
|
||||||
saveCaseRelevance() {
|
saveCaseRelevance() {
|
||||||
let param = {};
|
let param = {};
|
||||||
param.planId = this.planId;
|
param.planId = this.planId;
|
|
@ -10,8 +10,9 @@
|
||||||
:draggable="false"
|
:draggable="false"
|
||||||
ref="nodeTree"/>
|
ref="nodeTree"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:main>
|
<template v-slot:main>
|
||||||
<test-plan-test-case-list
|
<test-plan-api-case-list
|
||||||
class="table-list"
|
class="table-list"
|
||||||
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
|
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
|
@ -21,23 +22,28 @@
|
||||||
ref="testPlanTestCaseList"/>
|
ref="testPlanTestCaseList"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<test-case-relevance
|
<test-case-api-relevance
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
:plan-id="planId"
|
:plan-id="planId"
|
||||||
ref="testCaseRelevance"/>
|
ref="testCaseRelevance"/>
|
||||||
|
|
||||||
</ms-test-plan-common-component>
|
</ms-test-plan-common-component>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NodeTree from "../../../../common/NodeTree";
|
import NodeTree from "../../../../common/NodeTree";
|
||||||
import TestPlanTestCaseList from "../TestPlanTestCaseList";
|
import TestPlanTestCaseList from "../functional/FunctionalTestCaseList";
|
||||||
import TestCaseRelevance from "../TestCaseRelevance";
|
import TestCaseRelevance from "../functional/TestCaseFunctionalRelevance";
|
||||||
import MsTestPlanCommonComponent from "../TestPlanCommonComponent";
|
import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
|
||||||
|
import TestPlanApiCaseList from "./TestPlanApiCaseList";
|
||||||
|
import TestCaseApiRelevance from "./TestCaseApiRelevance";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanApi",
|
name: "TestPlanApi",
|
||||||
components: {
|
components: {
|
||||||
|
TestCaseApiRelevance,
|
||||||
|
TestPlanApiCaseList,
|
||||||
MsTestPlanCommonComponent,
|
MsTestPlanCommonComponent,
|
||||||
TestCaseRelevance,
|
TestCaseRelevance,
|
||||||
TestPlanTestCaseList,
|
TestPlanTestCaseList,
|
||||||
|
@ -77,7 +83,7 @@
|
||||||
this.getNodeTreeByPlanId();
|
this.getNodeTreeByPlanId();
|
||||||
},
|
},
|
||||||
openTestCaseRelevanceDialog() {
|
openTestCaseRelevanceDialog() {
|
||||||
this.$refs.testCaseRelevance.openTestCaseRelevanceDialog();
|
this.$refs.testCaseRelevance.open();
|
||||||
},
|
},
|
||||||
nodeChange(nodeIds, pNodes) {
|
nodeChange(nodeIds, pNodes) {
|
||||||
this.selectNodeIds = nodeIds;
|
this.selectNodeIds = nodeIds;
|
||||||
|
|
|
@ -213,33 +213,33 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ExecutorEdit from './ExecutorEdit';
|
import ExecutorEdit from '../ExecutorEdit';
|
||||||
import StatusEdit from './StatusEdit';
|
import StatusEdit from '../StatusEdit';
|
||||||
import TestPlanTestCaseEdit from "./TestPlanTestCaseEdit";
|
import TestPlanTestCaseEdit from "../functional/FunctionalTestCaseEdit";
|
||||||
import MsTipButton from '../../../../common/components/MsTipButton';
|
import MsTipButton from '../../../../../common/components/MsTipButton';
|
||||||
import MsTablePagination from '../../../../common/pagination/TablePagination';
|
import MsTablePagination from '../../../../../common/pagination/TablePagination';
|
||||||
import MsTableHeader from '../../../../common/components/MsTableHeader';
|
import MsTableHeader from '../../../../../common/components/MsTableHeader';
|
||||||
import MsTableButton from '../../../../common/components/MsTableButton';
|
import MsTableButton from '../../../../../common/components/MsTableButton';
|
||||||
import NodeBreadcrumb from '../../../common/NodeBreadcrumb';
|
import NodeBreadcrumb from '../../../../common/NodeBreadcrumb';
|
||||||
|
|
||||||
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, TokenKey, WORKSPACE_ID} from "@/common/js/constants";
|
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, TokenKey, WORKSPACE_ID} from "@/common/js/constants";
|
||||||
import {_filter, _sort, checkoutTestManagerOrTestUser, hasRoles} from "@/common/js/utils";
|
import {_filter, _sort, checkoutTestManagerOrTestUser, hasRoles} from "@/common/js/utils";
|
||||||
import PriorityTableItem from "../../../common/tableItems/planview/PriorityTableItem";
|
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||||
import StatusTableItem from "../../../common/tableItems/planview/StatusTableItem";
|
import StatusTableItem from "../../../../common/tableItems/planview/StatusTableItem";
|
||||||
import TypeTableItem from "../../../common/tableItems/planview/TypeTableItem";
|
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||||
import MethodTableItem from "../../../common/tableItems/planview/MethodTableItem";
|
import MethodTableItem from "../../../../common/tableItems/planview/MethodTableItem";
|
||||||
import MsTableOperator from "../../../../common/components/MsTableOperator";
|
import MsTableOperator from "../../../../../common/components/MsTableOperator";
|
||||||
import MsTableOperatorButton from "../../../../common/components/MsTableOperatorButton";
|
import MsTableOperatorButton from "../../../../../common/components/MsTableOperatorButton";
|
||||||
import TestReportTemplateList from "./TestReportTemplateList";
|
import TestReportTemplateList from "../TestReportTemplateList";
|
||||||
import TestCaseReportView from "./report/TestCaseReportView";
|
import TestCaseReportView from "../report/TestCaseReportView";
|
||||||
import {TEST_CASE_CONFIGS} from "../../../../common/components/search/search-components";
|
import {TEST_CASE_CONFIGS} from "../../../../../common/components/search/search-components";
|
||||||
import ShowMoreBtn from "../../../case/components/ShowMoreBtn";
|
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
|
||||||
import BatchEdit from "../../../case/components/BatchEdit";
|
import BatchEdit from "../../../../case/components/BatchEdit";
|
||||||
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
||||||
import {hub} from "@/business/components/track/plan/event-bus";
|
import {hub} from "@/business/components/track/plan/event-bus";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanTestCaseList",
|
name: "TestPlanApiCaseList",
|
||||||
components: {
|
components: {
|
||||||
TestCaseReportView,
|
TestCaseReportView,
|
||||||
TestReportTemplateList,
|
TestReportTemplateList,
|
|
@ -0,0 +1,165 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog :title="$t('test_track.plan_view.relevance_test_case')"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@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">
|
||||||
|
<select-menu
|
||||||
|
:data="projects"
|
||||||
|
width="185px"
|
||||||
|
:current-data="currentProject"
|
||||||
|
:title="$t('test_track.plan_view.plan')"
|
||||||
|
@dataChange="changeProject"/>
|
||||||
|
<slot name="aside"></slot>
|
||||||
|
</el-aside>
|
||||||
|
|
||||||
|
<el-container>
|
||||||
|
<el-main class="case-content">
|
||||||
|
<slot></slot>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
<template v-slot:footer>
|
||||||
|
<ms-dialog-footer @cancel="dialogVisible = false" @confirm="save"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import MsDialogFooter from '../../../../../common/components/MsDialogFooter'
|
||||||
|
import SelectMenu from "../../../../common/SelectMenu";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TestCaseRelevanceBase",
|
||||||
|
components: {
|
||||||
|
SelectMenu,
|
||||||
|
MsDialogFooter,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: {},
|
||||||
|
dialogVisible: false,
|
||||||
|
currentProject: {},
|
||||||
|
projectId: '',
|
||||||
|
projectName: '',
|
||||||
|
projects: [],
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
planId: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.getProject();
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
refreshNode() {
|
||||||
|
this.$emit('refresh');
|
||||||
|
},
|
||||||
|
|
||||||
|
save() {
|
||||||
|
this.$emit('save');
|
||||||
|
},
|
||||||
|
|
||||||
|
refresh() {
|
||||||
|
// this.close();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
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.changeProject(data[0]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
changeProject(project) {
|
||||||
|
this.currentProject = project;
|
||||||
|
this.$emit('setProject', project.id);
|
||||||
|
// 获取项目时刷新该项目模块
|
||||||
|
this.$emit('refreshNode');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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>
|
|
@ -15,9 +15,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsMainContainer from "../../../../common/components/MsMainContainer";
|
import MsMainContainer from "../../../../../common/components/MsMainContainer";
|
||||||
import MsAsideContainer from "../../../../common/components/MsAsideContainer";
|
import MsAsideContainer from "../../../../../common/components/MsAsideContainer";
|
||||||
import MsContainer from "../../../../common/components/MsContainer";
|
import MsContainer from "../../../../../common/components/MsContainer";
|
||||||
export default {
|
export default {
|
||||||
name: "MsTestPlanCommonComponent",
|
name: "MsTestPlanCommonComponent",
|
||||||
components: {MsContainer, MsAsideContainer, MsMainContainer}
|
components: {MsContainer, MsAsideContainer, MsMainContainer}
|
|
@ -351,17 +351,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TestPlanTestCaseStatusButton from '../../common/TestPlanTestCaseStatusButton';
|
import TestPlanTestCaseStatusButton from '../../../common/TestPlanTestCaseStatusButton';
|
||||||
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
|
||||||
import ApiTestDetail from "./test/ApiTestDetail";
|
import ApiTestDetail from "../test/ApiTestDetail";
|
||||||
import ApiTestResult from "./test/ApiTestResult";
|
import ApiTestResult from "../test/ApiTestResult";
|
||||||
import PerformanceTestDetail from "./test/PerformanceTestDetail";
|
import PerformanceTestDetail from "../test/PerformanceTestDetail";
|
||||||
import PerformanceTestResult from "./test/PerformanceTestResult";
|
import PerformanceTestResult from "../test/PerformanceTestResult";
|
||||||
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
|
||||||
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanTestCaseEdit",
|
name: "FunctionalTestCaseEdit",
|
||||||
components: {
|
components: {
|
||||||
PerformanceTestResult,
|
PerformanceTestResult,
|
||||||
PerformanceTestDetail,
|
PerformanceTestDetail,
|
|
@ -0,0 +1,608 @@
|
||||||
|
<template>
|
||||||
|
<div class="card-container">
|
||||||
|
<el-card class="card-content" v-loading="result.loading">
|
||||||
|
<template v-slot:header>
|
||||||
|
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
|
||||||
|
:show-create="false" :tip="$t('commons.search_by_name_or_id')">
|
||||||
|
<template v-slot:title>
|
||||||
|
<node-breadcrumb class="table-title" :nodes="selectParentNodes" @refresh="breadcrumbRefresh"/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:button>
|
||||||
|
<ms-table-button :is-tester-permission="true" v-if="!showMyTestCase" icon="el-icon-s-custom"
|
||||||
|
:content="$t('test_track.plan_view.my_case')" @click="searchMyTestCase"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" v-if="showMyTestCase" icon="el-icon-files"
|
||||||
|
:content="$t('test_track.plan_view.all_case')" @click="searchMyTestCase"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"
|
||||||
|
:content="$t('test_track.plan_view.relevance_test_case')"
|
||||||
|
@click="$emit('openTestCaseRelevanceDialog')"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" v-if="!testPlan.reportId" icon="el-icon-document"
|
||||||
|
:content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document"
|
||||||
|
:content="$t('test_track.plan_view.view_report')" @click="openReport"/>
|
||||||
|
<ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"
|
||||||
|
:content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>
|
||||||
|
</template>
|
||||||
|
</ms-table-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<executor-edit ref="executorEdit" :select-ids="new Set(Array.from(this.selectRows).map(row => row.id))"
|
||||||
|
@refresh="initTableData"/>
|
||||||
|
<status-edit ref="statusEdit" :plan-id="planId"
|
||||||
|
:select-ids="new Set(Array.from(this.selectRows).map(row => row.id))" @refresh="initTableData"/>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
class="adjust-table"
|
||||||
|
border
|
||||||
|
@select-all="handleSelectAll"
|
||||||
|
@filter-change="filter"
|
||||||
|
@sort-change="sort"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
row-key="id"
|
||||||
|
@row-click="showDetail"
|
||||||
|
:data="tableData">
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
type="selection"/>
|
||||||
|
<el-table-column width="40" :resizable="false" align="center">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<show-more-btn :is-show="scope.row.showMore" :buttons="buttons" :size="selectRows.size"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="num"
|
||||||
|
sortable="custom"
|
||||||
|
:label="$t('commons.id')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="name"
|
||||||
|
:label="$t('commons.name')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="priority"
|
||||||
|
:filters="priorityFilters"
|
||||||
|
column-key="priority"
|
||||||
|
:label="$t('test_track.case.priority')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<priority-table-item :value="scope.row.priority" ref="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-column
|
||||||
|
prop="method"
|
||||||
|
:filters="methodFilters"
|
||||||
|
column-key="method"
|
||||||
|
:label="$t('test_track.case.method')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<method-table-item :value="scope.row.method"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="nodePath"
|
||||||
|
:label="$t('test_track.case.module')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="projectName"
|
||||||
|
:label="$t('test_track.plan.plan_project')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('test_track.issue.issue')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<el-popover
|
||||||
|
placement="right"
|
||||||
|
width="400"
|
||||||
|
trigger="hover">
|
||||||
|
<el-table border class="adjust-table" :data="scope.row.issuesContent" style="width: 100%">
|
||||||
|
<el-table-column prop="title" :label="$t('test_track.issue.title')" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="description" :label="$t('test_track.issue.description')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<el-popover
|
||||||
|
placement="left"
|
||||||
|
width="400"
|
||||||
|
trigger="hover"
|
||||||
|
>
|
||||||
|
<ckeditor :editor="editor" disabled :config="editorConfig"
|
||||||
|
v-model="scope.row.description"/>
|
||||||
|
<el-button slot="reference" type="text">{{ $t('test_track.issue.preview') }}</el-button>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="platform" :label="$t('test_track.issue.platform')"/>
|
||||||
|
</el-table>
|
||||||
|
<el-button slot="reference" type="text">{{ scope.row.issuesSize }}</el-button>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="executorName"
|
||||||
|
:filters="executorFilters"
|
||||||
|
column-key="executor"
|
||||||
|
:label="$t('test_track.plan_view.executor')">
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="status"
|
||||||
|
:filters="statusFilters"
|
||||||
|
column-key="status"
|
||||||
|
:label="$t('test_track.plan_view.execute_result')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span @click.stop="clickt = 'stop'">
|
||||||
|
<el-dropdown class="test-case-status" @command="statusChange">
|
||||||
|
<span class="el-dropdown-link">
|
||||||
|
<status-table-item :value="scope.row.status"/>
|
||||||
|
</span>
|
||||||
|
<el-dropdown-menu slot="dropdown" chang>
|
||||||
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Pass'}">
|
||||||
|
{{ $t('test_track.plan_view.pass') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
||||||
|
:command="{id: scope.row.id, status: 'Failure'}">
|
||||||
|
{{ $t('test_track.plan_view.failure') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser"
|
||||||
|
:command="{id: scope.row.id, status: 'Blocking'}">
|
||||||
|
{{ $t('test_track.plan_view.blocking') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item :disabled="!isTestManagerOrTestUser" :command="{id: scope.row.id, status: 'Skip'}">
|
||||||
|
{{ $t('test_track.plan_view.skip') }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
sortable
|
||||||
|
prop="updateTime"
|
||||||
|
:label="$t('commons.update_time')"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
min-width="100"
|
||||||
|
:label="$t('commons.operating')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<ms-table-operator-button :is-tester-permission="true" :tip="$t('commons.edit')" icon="el-icon-edit"
|
||||||
|
@exec="handleEdit(scope.row)"/>
|
||||||
|
<ms-table-operator-button :is-tester-permission="true" :tip="$t('test_track.plan_view.cancel_relevance')"
|
||||||
|
icon="el-icon-unlock" type="danger" @exec="handleDelete(scope.row)"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<ms-table-pagination :change="search" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
|
:total="total"/>
|
||||||
|
|
||||||
|
<functional-test-case-edit
|
||||||
|
ref="testPlanTestCaseEdit"
|
||||||
|
:search-param.sync="condition"
|
||||||
|
@refresh="initTableData"
|
||||||
|
:is-read-only="isReadOnly"
|
||||||
|
@refreshTable="search"/>
|
||||||
|
|
||||||
|
<test-report-template-list @openReport="openReport" ref="testReportTemplateList"/>
|
||||||
|
<test-case-report-view @refresh="initTableData" ref="testCaseReportView"/>
|
||||||
|
</el-card>
|
||||||
|
<batch-edit ref="batchEdit" @batchEdit="batchEdit"
|
||||||
|
:type-arr="typeArr" :value-arr="valueArr" :dialog-title="$t('test_track.case.batch_edit_case')"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ExecutorEdit from '../ExecutorEdit';
|
||||||
|
import StatusEdit from '../StatusEdit';
|
||||||
|
import FunctionalTestCaseEdit from "./FunctionalTestCaseEdit";
|
||||||
|
import MsTipButton from '../../../../../common/components/MsTipButton';
|
||||||
|
import MsTablePagination from '../../../../../common/pagination/TablePagination';
|
||||||
|
import MsTableHeader from '../../../../../common/components/MsTableHeader';
|
||||||
|
import MsTableButton from '../../../../../common/components/MsTableButton';
|
||||||
|
import NodeBreadcrumb from '../../../../common/NodeBreadcrumb';
|
||||||
|
|
||||||
|
import {ROLE_TEST_MANAGER, ROLE_TEST_USER, TokenKey, WORKSPACE_ID} from "@/common/js/constants";
|
||||||
|
import {_filter, _sort, checkoutTestManagerOrTestUser, hasRoles} from "@/common/js/utils";
|
||||||
|
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
|
||||||
|
import StatusTableItem from "../../../../common/tableItems/planview/StatusTableItem";
|
||||||
|
import TypeTableItem from "../../../../common/tableItems/planview/TypeTableItem";
|
||||||
|
import MethodTableItem from "../../../../common/tableItems/planview/MethodTableItem";
|
||||||
|
import MsTableOperator from "../../../../../common/components/MsTableOperator";
|
||||||
|
import MsTableOperatorButton from "../../../../../common/components/MsTableOperatorButton";
|
||||||
|
import TestReportTemplateList from "../TestReportTemplateList";
|
||||||
|
import TestCaseReportView from "../report/TestCaseReportView";
|
||||||
|
import {TEST_CASE_CONFIGS} from "../../../../../common/components/search/search-components";
|
||||||
|
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
|
||||||
|
import BatchEdit from "../../../../case/components/BatchEdit";
|
||||||
|
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
|
||||||
|
import {hub} from "@/business/components/track/plan/event-bus";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "FunctionalTestCaseList",
|
||||||
|
components: {
|
||||||
|
FunctionalTestCaseEdit,
|
||||||
|
TestCaseReportView,
|
||||||
|
TestReportTemplateList,
|
||||||
|
MsTableOperatorButton,
|
||||||
|
MsTableOperator,
|
||||||
|
MethodTableItem,
|
||||||
|
TypeTableItem,
|
||||||
|
StatusTableItem,
|
||||||
|
PriorityTableItem, StatusEdit, ExecutorEdit, MsTipButton, MsTablePagination,
|
||||||
|
MsTableHeader, NodeBreadcrumb, MsTableButton, ShowMoreBtn,
|
||||||
|
BatchEdit
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: {},
|
||||||
|
deletePath: "/test/case/delete",
|
||||||
|
condition: {
|
||||||
|
components: TEST_CASE_CONFIGS
|
||||||
|
},
|
||||||
|
showMyTestCase: false,
|
||||||
|
tableData: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
selectRows: new Set(),
|
||||||
|
testPlan: {},
|
||||||
|
isReadOnly: false,
|
||||||
|
isTestManagerOrTestUser: false,
|
||||||
|
priorityFilters: [
|
||||||
|
{text: 'P0', value: 'P0'},
|
||||||
|
{text: 'P1', value: 'P1'},
|
||||||
|
{text: 'P2', value: 'P2'},
|
||||||
|
{text: 'P3', value: 'P3'}
|
||||||
|
],
|
||||||
|
methodFilters: [
|
||||||
|
{text: this.$t('test_track.case.manual'), value: 'manual'},
|
||||||
|
{text: this.$t('test_track.case.auto'), value: 'auto'}
|
||||||
|
],
|
||||||
|
typeFilters: [
|
||||||
|
{text: this.$t('commons.functional'), value: 'functional'},
|
||||||
|
{text: this.$t('commons.performance'), value: 'performance'},
|
||||||
|
{text: this.$t('commons.api'), value: 'api'}
|
||||||
|
],
|
||||||
|
statusFilters: [
|
||||||
|
{text: this.$t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
|
||||||
|
{text: this.$t('test_track.plan_view.pass'), value: 'Pass'},
|
||||||
|
{text: this.$t('test_track.plan_view.failure'), value: 'Failure'},
|
||||||
|
{text: this.$t('test_track.plan_view.blocking'), value: 'Blocking'},
|
||||||
|
{text: this.$t('test_track.plan_view.skip'), value: 'Skip'},
|
||||||
|
{text: this.$t('test_track.plan.plan_status_running'), value: 'Underway'},
|
||||||
|
],
|
||||||
|
executorFilters: [],
|
||||||
|
showMore: false,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: this.$t('test_track.case.batch_edit_case'), handleClick: this.handleBatchEdit
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch
|
||||||
|
}
|
||||||
|
],
|
||||||
|
typeArr: [
|
||||||
|
{id: 'status', name: this.$t('test_track.plan_view.execute_result')},
|
||||||
|
{id: 'executor', name: this.$t('test_track.plan_view.executor')},
|
||||||
|
],
|
||||||
|
valueArr: {
|
||||||
|
executor: [],
|
||||||
|
status: [
|
||||||
|
{name: this.$t('test_track.plan_view.pass'), id: 'Pass'},
|
||||||
|
{name: this.$t('test_track.plan_view.failure'), id: 'Failure'},
|
||||||
|
{name: this.$t('test_track.plan_view.blocking'), id: 'Blocking'},
|
||||||
|
{name: this.$t('test_track.plan_view.skip'), id: 'Skip'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
editor: ClassicEditor,
|
||||||
|
editorConfig: {
|
||||||
|
// 'increaseIndent','decreaseIndent'
|
||||||
|
toolbar: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
planId: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
selectNodeIds: {
|
||||||
|
type: Array
|
||||||
|
},
|
||||||
|
selectParentNodes: {
|
||||||
|
type: Array
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
planId() {
|
||||||
|
this.refreshTableAndPlan();
|
||||||
|
},
|
||||||
|
selectNodeIds() {
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
hub.$on("openFailureTestCase", row => {
|
||||||
|
this.isReadOnly = true;
|
||||||
|
this.condition.status = 'Failure';
|
||||||
|
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row);
|
||||||
|
});
|
||||||
|
this.refreshTableAndPlan();
|
||||||
|
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
|
||||||
|
this.getMaintainerOptions();
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
hub.$off("openFailureTestCase");
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initTableData() {
|
||||||
|
if (this.planId) {
|
||||||
|
// param.planId = this.planId;
|
||||||
|
this.condition.planId = this.planId;
|
||||||
|
}
|
||||||
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
|
// param.nodeIds = this.selectNodeIds;
|
||||||
|
this.condition.nodeIds = this.selectNodeIds;
|
||||||
|
}
|
||||||
|
if (this.planId) {
|
||||||
|
this.result = this.$post(this.buildPagePath('/test/plan/case/list'), this.condition, response => {
|
||||||
|
let data = response.data;
|
||||||
|
this.total = data.itemCount;
|
||||||
|
this.tableData = data.listObject;
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if (this.tableData[i]) {
|
||||||
|
this.$set(this.tableData[i], "issuesSize", 0);
|
||||||
|
this.$get("/issues/get/" + this.tableData[i].caseId, response => {
|
||||||
|
let issues = response.data;
|
||||||
|
if (this.tableData[i]) {
|
||||||
|
this.$set(this.tableData[i], "issuesSize", issues.length);
|
||||||
|
this.$set(this.tableData[i], "issuesContent", issues);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.selectRows.clear();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showDetail(row, event, column) {
|
||||||
|
this.isReadOnly = true;
|
||||||
|
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row);
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.condition = {components: TEST_CASE_CONFIGS};
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.$emit('refresh');
|
||||||
|
},
|
||||||
|
breadcrumbRefresh() {
|
||||||
|
this.showMyTestCase = false;
|
||||||
|
this.refresh();
|
||||||
|
},
|
||||||
|
refreshTableAndPlan() {
|
||||||
|
this.getTestPlanById();
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
refreshTestPlanRecent() {
|
||||||
|
if (hasRoles(ROLE_TEST_USER, ROLE_TEST_MANAGER)) {
|
||||||
|
let param = {};
|
||||||
|
param.id = this.planId;
|
||||||
|
param.updateTime = Date.now();
|
||||||
|
this.$post('/test/plan/edit', param);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
buildPagePath(path) {
|
||||||
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
|
},
|
||||||
|
handleEdit(testCase, index) {
|
||||||
|
this.isReadOnly = false;
|
||||||
|
if (!checkoutTestManagerOrTestUser()) {
|
||||||
|
this.isReadOnly = true;
|
||||||
|
}
|
||||||
|
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(testCase);
|
||||||
|
},
|
||||||
|
handleDelete(testCase) {
|
||||||
|
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + ' ' + testCase.name + " ?", '', {
|
||||||
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
|
callback: (action) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
this._handleDelete(testCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDeleteBatch() {
|
||||||
|
if (this.tableData.length < 1) {
|
||||||
|
this.$warning(this.$t('test_track.plan_view.no_case_relevance'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + " ?", '', {
|
||||||
|
confirmButtonText: this.$t('commons.confirm'),
|
||||||
|
callback: (action) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
if (this.selectRows.size > 0) {
|
||||||
|
let ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
|
this._handleBatchDelete(ids);
|
||||||
|
} else {
|
||||||
|
if (this.planId) {
|
||||||
|
this.condition.planId = this.planId;
|
||||||
|
}
|
||||||
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
|
this.condition.nodeIds = this.selectNodeIds;
|
||||||
|
}
|
||||||
|
// 根据条件查询计划下所有的关联用例
|
||||||
|
this.$post('/test/plan/case/list/all', this.condition, res => {
|
||||||
|
let data = res.data;
|
||||||
|
let ids = data.map(d => d.id);
|
||||||
|
this._handleBatchDelete(ids);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
_handleBatchDelete(ids) {
|
||||||
|
this.result = this.$post('/test/plan/case/batch/delete', {ids: ids}, () => {
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.$emit("refresh");
|
||||||
|
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
_handleDelete(testCase) {
|
||||||
|
let testCaseId = testCase.id;
|
||||||
|
this.result = this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
|
||||||
|
this.$emit("refresh");
|
||||||
|
this.$success(this.$t('test_track.cancel_relevance_success'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSelectAll(selection) {
|
||||||
|
if (selection.length > 0) {
|
||||||
|
this.tableData.forEach(item => {
|
||||||
|
this.$set(item, "showMore", true);
|
||||||
|
this.selectRows.add(item);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.tableData.forEach(row => {
|
||||||
|
this.$set(row, "showMore", false);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSelectionChange(selection, row) {
|
||||||
|
if (this.selectRows.has(row)) {
|
||||||
|
this.$set(row, "showMore", false);
|
||||||
|
this.selectRows.delete(row);
|
||||||
|
} else {
|
||||||
|
this.$set(row, "showMore", true);
|
||||||
|
this.selectRows.add(row);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleBatch(type) {
|
||||||
|
if (this.selectRows.size < 1) {
|
||||||
|
this.$warning(this.$t('test_track.plan_view.select_manipulate'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (type === 'executor') {
|
||||||
|
this.$refs.executorEdit.openExecutorEdit();
|
||||||
|
} else if (type === 'status') {
|
||||||
|
this.$refs.statusEdit.openStatusEdit();
|
||||||
|
} else if (type === 'delete') {
|
||||||
|
this.handleDeleteBatch();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchMyTestCase() {
|
||||||
|
this.showMyTestCase = !this.showMyTestCase;
|
||||||
|
if (this.showMyTestCase) {
|
||||||
|
let user = JSON.parse(localStorage.getItem(TokenKey));
|
||||||
|
this.condition.executor = user.id;
|
||||||
|
} else {
|
||||||
|
this.condition.executor = null;
|
||||||
|
}
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
openTestReport() {
|
||||||
|
this.$refs.testReportTemplateList.open(this.planId);
|
||||||
|
},
|
||||||
|
statusChange(param) {
|
||||||
|
this.$post('/test/plan/case/edit', param, () => {
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if (this.tableData[i].id == param.id) {
|
||||||
|
this.tableData[i].status = param.status;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getTestPlanById() {
|
||||||
|
if (this.planId) {
|
||||||
|
this.$post('/test/plan/get/' + this.planId, {}, response => {
|
||||||
|
this.testPlan = response.data;
|
||||||
|
this.refreshTestPlanRecent();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openReport(planId, id) {
|
||||||
|
this.getTestPlanById();
|
||||||
|
if (!id) {
|
||||||
|
id = this.testPlan.reportId;
|
||||||
|
}
|
||||||
|
if (!planId) {
|
||||||
|
planId = this.planId;
|
||||||
|
}
|
||||||
|
this.$refs.testCaseReportView.open(planId, id);
|
||||||
|
},
|
||||||
|
filter(filters) {
|
||||||
|
_filter(filters, this.condition);
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
sort(column) {
|
||||||
|
// 每次只对一个字段排序
|
||||||
|
if (this.condition.orders) {
|
||||||
|
this.condition.orders = [];
|
||||||
|
}
|
||||||
|
_sort(column, this.condition);
|
||||||
|
this.initTableData();
|
||||||
|
},
|
||||||
|
batchEdit(form) {
|
||||||
|
let param = {};
|
||||||
|
param[form.type] = form.value;
|
||||||
|
param.ids = Array.from(this.selectRows).map(row => row.id);
|
||||||
|
this.$post('/test/plan/case/batch/edit', param, () => {
|
||||||
|
this.selectRows.clear();
|
||||||
|
this.status = '';
|
||||||
|
this.$post('/test/plan/edit/status/' + this.planId);
|
||||||
|
this.$success(this.$t('commons.save_success'));
|
||||||
|
this.$emit('refresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleBatchEdit() {
|
||||||
|
this.getMaintainerOptions();
|
||||||
|
this.$refs.batchEdit.open();
|
||||||
|
},
|
||||||
|
getMaintainerOptions() {
|
||||||
|
let workspaceId = localStorage.getItem(WORKSPACE_ID);
|
||||||
|
this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => {
|
||||||
|
this.valueArr.executor = response.data;
|
||||||
|
this.executorFilters = response.data.map(u => {
|
||||||
|
return {text: u.name, value: u.id}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
.search {
|
||||||
|
margin-left: 10px;
|
||||||
|
width: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.test-case-status, .el-table {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,303 @@
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<test-case-relevance-base
|
||||||
|
@setProject="setProject"
|
||||||
|
@save="saveCaseRelevance"
|
||||||
|
:plan-id="planId"
|
||||||
|
ref="baseRelevance">
|
||||||
|
|
||||||
|
<template v-slot:aside>
|
||||||
|
<node-tree class="node-tree"
|
||||||
|
@nodeSelectEvent="nodeChange"
|
||||||
|
@refresh="refresh"
|
||||||
|
:tree-nodes="treeNodes"
|
||||||
|
ref="nodeTree"/>
|
||||||
|
</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"
|
||||||
|
@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>
|
||||||
|
|
||||||
|
</test-case-relevance-base>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import NodeTree from '../../../../common/NodeTree';
|
||||||
|
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 elTableInfiniteScroll from 'el-table-infinite-scroll';
|
||||||
|
import TestCaseRelevanceBase from "../base/TestCaseRelevanceBase";
|
||||||
|
import {_filter} from "../../../../../../../common/js/utils";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TestCaseFunctionalRelevance",
|
||||||
|
components: {
|
||||||
|
TestCaseRelevanceBase,
|
||||||
|
NodeTree,
|
||||||
|
PriorityTableItem,
|
||||||
|
TypeTableItem,
|
||||||
|
MsTableSearchBar,
|
||||||
|
MsTableAdvSearchBar,
|
||||||
|
MsTableHeader,
|
||||||
|
},
|
||||||
|
directives: {
|
||||||
|
'el-table-infinite-scroll': elTableInfiniteScroll
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: {},
|
||||||
|
isCheckAll: false,
|
||||||
|
testCases: [],
|
||||||
|
selectIds: new Set(),
|
||||||
|
treeNodes: [],
|
||||||
|
selectNodeIds: [],
|
||||||
|
selectNodeNames: [],
|
||||||
|
projectId: '',
|
||||||
|
projectName: '',
|
||||||
|
projects: [],
|
||||||
|
pageSize: 50,
|
||||||
|
currentPage: 1,
|
||||||
|
total: 0,
|
||||||
|
lineStatus: true,
|
||||||
|
condition: {
|
||||||
|
components: TEST_CASE_CONFIGS
|
||||||
|
},
|
||||||
|
priorityFilters: [
|
||||||
|
{text: 'P0', value: 'P0'},
|
||||||
|
{text: 'P1', value: 'P1'},
|
||||||
|
{text: 'P2', value: 'P2'},
|
||||||
|
{text: 'P3', value: 'P3'}
|
||||||
|
],
|
||||||
|
typeFilters: [
|
||||||
|
{text: this.$t('commons.functional'), value: 'functional'},
|
||||||
|
{text: this.$t('commons.performance'), value: 'performance'},
|
||||||
|
{text: this.$t('commons.api'), value: 'api'}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
planId: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
planId() {
|
||||||
|
this.condition.planId = this.planId;
|
||||||
|
},
|
||||||
|
selectNodeIds() {
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
projectId() {
|
||||||
|
this.condition.projectId = this.projectId;
|
||||||
|
this.getProjectNode();
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
|
this.toggleSelection(this.testCases);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
open() {
|
||||||
|
this.$refs.baseRelevance.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
setProject(projectId) {
|
||||||
|
this.projectId = projectId;
|
||||||
|
},
|
||||||
|
|
||||||
|
saveCaseRelevance() {
|
||||||
|
let param = {};
|
||||||
|
param.planId = this.planId;
|
||||||
|
param.testCaseIds = [...this.selectIds];
|
||||||
|
param.request = this.condition;
|
||||||
|
// 选择全选则全部加入到评审,无论是否加载完全部
|
||||||
|
if (this.testCases.length === param.testCaseIds.length) {
|
||||||
|
param.testCaseIds = ['all'];
|
||||||
|
}
|
||||||
|
this.result = this.$post('/test/plan/relevance', param, () => {
|
||||||
|
this.selectIds.clear();
|
||||||
|
this.$success(this.$t('commons.save_success'));
|
||||||
|
|
||||||
|
this.$refs.baseRelevance.close();
|
||||||
|
|
||||||
|
this.$emit('refresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buildPagePath(path) {
|
||||||
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.testCases = [];
|
||||||
|
this.getTestCases(true);
|
||||||
|
},
|
||||||
|
getTestCases(flag) {
|
||||||
|
if (this.planId) {
|
||||||
|
this.condition.planId = this.planId;
|
||||||
|
}
|
||||||
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
|
this.condition.nodeIds = this.selectNodeIds;
|
||||||
|
} else {
|
||||||
|
this.condition.nodeIds = [];
|
||||||
|
}
|
||||||
|
if (this.projectId) {
|
||||||
|
this.condition.projectId = this.projectId;
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSelectAll(selection) {
|
||||||
|
if (selection.length > 0) {
|
||||||
|
this.testCases.forEach(item => {
|
||||||
|
this.selectIds.add(item.id);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.testCases.forEach(item => {
|
||||||
|
if (this.selectIds.has(item.id)) {
|
||||||
|
this.selectIds.delete(item.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleSelectionChange(selection, row) {
|
||||||
|
if (this.selectIds.has(row.id)) {
|
||||||
|
this.selectIds.delete(row.id);
|
||||||
|
} else {
|
||||||
|
this.selectIds.add(row.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nodeChange(nodeIds, nodeNames) {
|
||||||
|
this.selectNodeIds = nodeIds;
|
||||||
|
this.selectNodeNames = nodeNames;
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
scrollLoading() {
|
||||||
|
if (this.lineStatus) {
|
||||||
|
this.currentPage += 1;
|
||||||
|
this.getTestCases();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getAllNodeTreeByPlanId() {
|
||||||
|
if (this.planId) {
|
||||||
|
let param = {
|
||||||
|
testPlanId: this.planId,
|
||||||
|
projectId: this.projectId
|
||||||
|
};
|
||||||
|
this.result = this.$post("/case/node/list/all/plan", param, response => {
|
||||||
|
this.treeNodes = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.lineStatus = false;
|
||||||
|
this.selectIds.clear();
|
||||||
|
this.selectNodeIds = [];
|
||||||
|
this.selectNodeNames = [];
|
||||||
|
},
|
||||||
|
filter(filters) {
|
||||||
|
_filter(filters, this.condition);
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
toggleSelection(rows) {
|
||||||
|
rows.forEach(row => {
|
||||||
|
this.selectIds.forEach(id => {
|
||||||
|
if (row.id === id) {
|
||||||
|
// true 是为选中
|
||||||
|
this.$refs.table.toggleRowSelection(row, true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getProjectNode(projectId) {
|
||||||
|
const index = this.projects.findIndex(project => project.id === projectId);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.projectName = this.projects[index].name;
|
||||||
|
}
|
||||||
|
if (projectId) {
|
||||||
|
this.projectId = projectId;
|
||||||
|
}
|
||||||
|
this.$refs.nodeTree.result = this.$post("/case/node/list/all/plan",
|
||||||
|
{testPlanId: this.planId, projectId: this.projectId}, response => {
|
||||||
|
this.treeNodes = response.data;
|
||||||
|
});
|
||||||
|
this.selectNodeIds = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
|
@ -11,7 +11,7 @@
|
||||||
ref="nodeTree"/>
|
ref="nodeTree"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:main>
|
<template v-slot:main>
|
||||||
<test-plan-test-case-list
|
<functional-test-case-list
|
||||||
class="table-list"
|
class="table-list"
|
||||||
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
|
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
ref="testPlanTestCaseList"/>
|
ref="testPlanTestCaseList"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<test-case-relevance
|
<test-case-functional-relevance
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
:plan-id="planId"
|
:plan-id="planId"
|
||||||
ref="testCaseRelevance"/>
|
ref="testCaseRelevance"/>
|
||||||
|
@ -31,16 +31,18 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import NodeTree from "../../../../common/NodeTree";
|
import NodeTree from "../../../../common/NodeTree";
|
||||||
import TestPlanTestCaseList from "../TestPlanTestCaseList";
|
import TestCaseRelevance from "./TestCaseFunctionalRelevance";
|
||||||
import TestCaseRelevance from "../TestCaseRelevance";
|
import MsTestPlanCommonComponent from "../base/TestPlanCommonComponent";
|
||||||
import MsTestPlanCommonComponent from "../TestPlanCommonComponent";
|
import TestCaseFunctionalRelevance from "./TestCaseFunctionalRelevance";
|
||||||
|
import FunctionalTestCaseList from "./FunctionalTestCaseList";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanFunctional",
|
name: "TestPlanFunctional",
|
||||||
components: {
|
components: {
|
||||||
|
FunctionalTestCaseList,
|
||||||
|
TestCaseFunctionalRelevance,
|
||||||
MsTestPlanCommonComponent,
|
MsTestPlanCommonComponent,
|
||||||
TestCaseRelevance,
|
TestCaseRelevance,
|
||||||
TestPlanTestCaseList,
|
|
||||||
NodeTree,
|
NodeTree,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -77,7 +79,7 @@
|
||||||
this.getNodeTreeByPlanId();
|
this.getNodeTreeByPlanId();
|
||||||
},
|
},
|
||||||
openTestCaseRelevanceDialog() {
|
openTestCaseRelevanceDialog() {
|
||||||
this.$refs.testCaseRelevance.openTestCaseRelevanceDialog();
|
this.$refs.testCaseRelevance.open();
|
||||||
},
|
},
|
||||||
nodeChange(nodeIds, pNodes) {
|
nodeChange(nodeIds, pNodes) {
|
||||||
this.selectNodeIds = nodeIds;
|
this.selectNodeIds = nodeIds;
|
||||||
|
|
Loading…
Reference in New Issue