Browse Source

锚点配置测试

haojianlong 3 years ago
parent
commit
36733e9fb5
2 changed files with 36 additions and 0 deletions
  1. 4 0
      src/components/editview/baseTopoEditer.vue
  2. 32 0
      src/components/editview/equipAnchor.js

+ 4 - 0
src/components/editview/baseTopoEditer.vue

@@ -41,6 +41,7 @@ import {
 } from "@/api/editer";
 import { publishGraph } from "@/api/home";
 import crypto from "crypto-js/";
+import { equipAnchor } from "./equipAnchor"
 //////////////////////////////////////
 // 常量
 // 图服务路径
@@ -506,6 +507,9 @@ export default {
             },
           },
         };
+        if (equipAnchor[item.classCode]) {
+          data.anchorList = equipAnchor[item.classCode]
+        }
         parse.addNode(data);
       });
       // 添加到 scence 中

+ 32 - 0
src/components/editview/equipAnchor.js

@@ -0,0 +1,32 @@
+export const equipAnchor = {
+  "WSSTSP": [
+    {
+      id: '',
+      pos: {
+        x: 50,
+        y: 0
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: -50,
+        y: 0
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: 0,
+        y: 50
+      }
+    },
+    {
+      id: '',
+      pos: {
+        x: 0,
+        y: -50
+      }
+    },
+  ]
+}