fix (接口自动化): 修复步骤拖拽问题

--bug=1006430 --user=赵勇 【github#5962】场景中... https://www.tapd.cn/55049933/s/1045716
This commit is contained in:
fit2-zhao 2021-09-13 11:24:33 +08:00 committed by fit2-zhao
parent c30963dcb5
commit 88836f6c80
1 changed files with 17 additions and 6 deletions

View File

@ -338,6 +338,7 @@ import "@/common/css/material-icons.css"
import OutsideClick from "@/common/js/outside-click";
import {saveScenario} from "@/business/components/api/automation/api-automation";
import MsComponentConfig from "./component/ComponentConfig";
import {ELEMENTS} from "@/business/components/api/automation/scenario/Setting";
let jsonPath = require('jsonpath');
export default {
@ -1176,13 +1177,23 @@ export default {
this.getEnvironments();
},
allowDrop(draggingNode, dropNode, dropType) {
//
if (dropType != "inner") {
if (dropType != "inner" && !draggingNode.data.disabled) {
if (draggingNode.data.referenced) {
if (draggingNode.data.referenced !== 'REF' && draggingNode.data.referenced !== 'Deleted' && !draggingNode.data.disabled) {
return true;
} else if (dropType === "inner" && dropNode.data.referenced !== 'REF' && dropNode.data.referenced !== 'Deleted'
&& (this.stepFilter.get(dropNode.data.type) && this.stepFilter.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1)
&& !draggingNode.data.disabled) {
}
return false;
}
return true;
} else if (dropType === "inner" && ELEMENTS.get(dropNode.data.type).indexOf(draggingNode.data.type) != -1 && !dropNode.data.disabled) {
if (dropNode.data.referenced) {
if (dropNode.data.referenced !== 'REF' && dropNode.data.referenced !== 'Deleted') {
return true;
}
return false;
} else {
return true;
}
}
return false;
},