fix(接口测试): 修复场景批量复制modulePath缺失的缺陷 (#15383)

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-07-01 10:01:46 +08:00 committed by GitHub
parent d14dff855f
commit aed22e3c4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 6 deletions

View File

@ -333,6 +333,7 @@ import MsTableAdvSearchBar from "@/business/components/common/components/search/
import ListItemDeleteConfirm from "@/business/components/common/components/ListItemDeleteConfirm"; import ListItemDeleteConfirm from "@/business/components/common/components/ListItemDeleteConfirm";
import {Message} from "element-ui"; import {Message} from "element-ui";
import MsSearch from "@/business/components/common/components/search/MsSearch"; import MsSearch from "@/business/components/common/components/search/MsSearch";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {}; const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {};
@ -667,7 +668,14 @@ export default {
}, },
editApiScenarioCaseOrder() { editApiScenarioCaseOrder() {
return editApiScenarioCaseOrder; return editApiScenarioCaseOrder;
} },
moduleOptionsNew() {
let moduleOptions = [];
this.moduleOptions.forEach(node => {
buildNodePath(node, {path: ''}, moduleOptions);
});
return moduleOptions;
},
}, },
methods: { methods: {
generateGraph() { generateGraph() {
@ -788,11 +796,11 @@ export default {
}, },
handleBatchMove() { handleBatchMove() {
this.isMoveBatch = true; this.isMoveBatch = true;
this.$refs.testBatchMove.open(this.moduleTree, [], this.moduleOptions); this.$refs.testBatchMove.open(this.moduleTree, [], this.moduleOptionsNew);
}, },
handleBatchCopy() { handleBatchCopy() {
this.isMoveBatch = false; this.isMoveBatch = false;
this.$refs.testBatchMove.open(this.moduleTree, this.$refs.scenarioTable.selectIds, this.moduleOptions); this.$refs.testBatchMove.open(this.moduleTree, this.$refs.scenarioTable.selectIds, this.moduleOptionsNew);
}, },
moveSave(param) { moveSave(param) {
this.buildBatchParam(param); this.buildBatchParam(param);

View File

@ -255,6 +255,7 @@ import {getProtocolFilter} from "@/business/components/api/definition/api-defini
import {getGraphByCondition} from "@/network/graph"; import {getGraphByCondition} from "@/network/graph";
import ListItemDeleteConfirm from "@/business/components/common/components/ListItemDeleteConfirm"; import ListItemDeleteConfirm from "@/business/components/common/components/ListItemDeleteConfirm";
import MsSearch from "@/business/components/common/components/search/MsSearch"; import MsSearch from "@/business/components/common/components/search/MsSearch";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {}; const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {};
@ -492,7 +493,14 @@ export default {
}, },
editApiDefinitionOrder() { editApiDefinitionOrder() {
return editApiDefinitionOrder; return editApiDefinitionOrder;
} },
moduleOptionsNew() {
let moduleOptions = [];
this.moduleOptions.forEach(node => {
buildNodePath(node, {path: ''}, moduleOptions);
});
return moduleOptions;
},
}, },
created: function () { created: function () {
if (!this.projectName || this.projectName === "") { if (!this.projectName || this.projectName === "") {
@ -575,11 +583,11 @@ export default {
}, },
handleBatchMove() { handleBatchMove() {
this.isMoveBatch = true; this.isMoveBatch = true;
this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptions); this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptionsNew);
}, },
handleBatchCopy() { handleBatchCopy() {
this.isMoveBatch = false; this.isMoveBatch = false;
this.$refs.testCaseBatchMove.open(this.moduleTree, this.$refs.table.selectIds, this.moduleOptions); this.$refs.testCaseBatchMove.open(this.moduleTree, this.$refs.table.selectIds, this.moduleOptionsNew);
}, },
closeCaseModel() { closeCaseModel() {
// //
@ -814,6 +822,7 @@ export default {
param.projectId = this.projectId; param.projectId = this.projectId;
param.condition = this.condition; param.condition = this.condition;
param.moduleId = param.nodeId; param.moduleId = param.nodeId;
param.modulePath = param.nodePath;
let url = '/api/definition/batch/editByParams'; let url = '/api/definition/batch/editByParams';
if (!this.isMoveBatch) if (!this.isMoveBatch)
url = '/api/definition/batch/copy'; url = '/api/definition/batch/copy';