|
@@ -224,6 +224,11 @@ export default {
|
|
|
type: "error"
|
|
|
})
|
|
|
}
|
|
|
+ }).catch(res=>{
|
|
|
+ ElMessage({
|
|
|
+ message: "操作失败:服务器发生异常",
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
})
|
|
|
} else {
|
|
|
cid.saveMap(
|
|
@@ -298,7 +303,6 @@ export default {
|
|
|
numCase.value = props.svOrGoose//判断sv或者goose类型
|
|
|
copyColor.value = props.lineMenuColor//颜色
|
|
|
setTimeout(() => {
|
|
|
- console.log('定时器执行');
|
|
|
cid.getModelInfo({ id: copyObj.value.id ? copyObj.value.id : route.query.modelid - 0, pageno: 1, pagesize: 20 }).then(res => {
|
|
|
emit("drawCor", res.data)
|
|
|
const filteredArray = res.data[0].ied_type.filter(param => param !== null)
|
|
@@ -311,6 +315,8 @@ export default {
|
|
|
children: [],
|
|
|
width: 5,
|
|
|
height: 5,
|
|
|
+ x:0,
|
|
|
+ y:0,
|
|
|
isShowAnchor: true,//锚点
|
|
|
}
|
|
|
needMap.value = filteredArray.map(item => {
|
|
@@ -327,7 +333,20 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
needMap.value.push(groups)
|
|
|
-
|
|
|
+ // lf.value.register(logicFlows)
|
|
|
+ lf.value.extension.dndPanel.setPatternItems(needMap.value);
|
|
|
+
|
|
|
+ console.log('执行了渲染.....',route.query);
|
|
|
+ if (route.query.modelid != '' && route.query.modelid != null && route.query.modelid != undefined) {
|
|
|
+ lastRender()
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ onMounted(() => {
|
|
|
lf.value = new LogicFlow({
|
|
|
// 通过选项指定了渲染的容器和需要显示网格
|
|
|
container: container.value,//需要显示画布的容器ref
|
|
@@ -369,25 +388,30 @@ export default {
|
|
|
class MyGroup extends GroupNode.view {
|
|
|
}
|
|
|
class MyGroupModel extends GroupNode.model {
|
|
|
+
|
|
|
initNodeData(data) {
|
|
|
data.text= ""//{"value":"未命名组","x":10,"y":5,"editable":true}
|
|
|
- data.id=new Date().getTime();
|
|
|
+ //data.id=(new Date().getTime())+"";
|
|
|
super.initNodeData(data);
|
|
|
- //this.isRestrict = true;
|
|
|
- this.resizable = true;
|
|
|
- this.foldable = true;
|
|
|
this.width = 200;
|
|
|
this.height = 150;
|
|
|
this.foldedWidth = 100;
|
|
|
- this.foldedHeight = 100;
|
|
|
- this.isShowAnchor = true;
|
|
|
-
|
|
|
+ this.foldedHeight = 100;
|
|
|
}
|
|
|
+
|
|
|
+ setAttributes(){
|
|
|
+ this.resizable = true;
|
|
|
+ this.foldable = false; //不允许收起来
|
|
|
+ this.isShowAnchor = false;
|
|
|
+ }
|
|
|
+
|
|
|
getNodeStyle() {
|
|
|
const stl = super.getNodeStyle()
|
|
|
stl.strokeDasharray= '4 4'
|
|
|
+ //stl.stroke="rgb(255,255,255)"
|
|
|
return stl
|
|
|
}
|
|
|
+
|
|
|
getAnchorStyle(anchorInfo) {
|
|
|
const style = super.getAnchorStyle(anchorInfo);
|
|
|
style.stroke = "rgb(24, 125, 255)";
|
|
@@ -396,13 +420,14 @@ export default {
|
|
|
style.hover.fill = "rgb(24, 125, 255)";
|
|
|
style.hover.stroke = "rgb(24, 125, 255)";
|
|
|
return style;
|
|
|
- }
|
|
|
+ }
|
|
|
getTextStyle() {
|
|
|
const style = super.getTextStyle();
|
|
|
style.fontSize = 12;
|
|
|
style.color="#666"
|
|
|
+ style.textAlign="left"
|
|
|
return style;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
lf.value.register({
|
|
|
type: "svEdge",
|
|
@@ -553,27 +578,18 @@ export default {
|
|
|
if(nodedata.data.type=='my-group'){
|
|
|
let nodeid=nodedata.data.id
|
|
|
// 添加的是分组节点,需要打开一个窗口让用户设置该节点的ied_type并保存到properties中
|
|
|
- let ied_type="user set iedtype"
|
|
|
- lf.value.getNodeModelById(nodeid).setProperties({
|
|
|
+ let ied_type="TMP"
|
|
|
+ const g=lf.value.getNodeModelById(nodeid);
|
|
|
+ g.setProperties({
|
|
|
ied_type: ied_type,
|
|
|
- id:0 //分组的装置类型id固定为0
|
|
|
+ id:'0' //分组的装置类型id固定为0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
- // lf.value.register(logicFlows)
|
|
|
- lf.value.extension.dndPanel.setPatternItems(needMap.value);
|
|
|
+ lf.value.on("node:resize",function(data){
|
|
|
+ //if(data.oldNodeSize.type!="my-group") return;
|
|
|
+ })
|
|
|
lf.value.render();
|
|
|
- console.log('执行了渲染');
|
|
|
- if (route.query.modelid != '' && route.query.modelid != null && route.query.modelid != undefined) {
|
|
|
- lastRender()
|
|
|
- }
|
|
|
- setTimeout(() => {
|
|
|
- loading.value = false
|
|
|
- }, 1000)
|
|
|
- })
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- onMounted(() => {
|
|
|
listMap()
|
|
|
})
|
|
|
function abilityBack(data) {
|