Browse Source

fix:右键锁定联动

YaolongHan 4 years ago
parent
commit
782de5908b

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

@@ -6,6 +6,7 @@
       ref="topoTooltip"
       @closeTooltip="showTooltip = false"
       :havItem="havItem"
+      :isLock="isLock"
     ></topoTooltip>
     <canvas
       style="border: none; outline: medium"
@@ -58,6 +59,7 @@ export default {
       showTooltip: false, //是否显示tooltip
       topoContent: {}, // 读图后存储图所有数据
       autoSave: null, // 自动保存定时器
+      isLock:false //右键item是否锁定
     };
   },
   computed: {
@@ -119,6 +121,11 @@ export default {
     onContextMenu(item, [event]) {
       this.showTooltip = true;
       if (item) {
+        if(item.moveable){
+          this.isLock = false
+        }else{
+          this.isLock = true
+        }
         this.havItem = true;
       } else {
         this.havItem = false;

+ 36 - 35
src/components/editview/leftToolBar/data.js

@@ -23,12 +23,12 @@ export const baseEditItems = [{
             icon: require("./../../../assets/images/leftImgs/" + "EditBaseImage.png"),
             activeIcon: require("./../../../assets/images/leftImgs/" + "EditBaseImage" + "Active" + ".png")
         },
-        // {
-        //     name: '批注',
-        //     id: "BaseExplain",
-        //     icon: require("./../../../assets/images/leftImgs/" + "EditBasePostil.png"),
-        //     activeIcon: require("./../../../assets/images/leftImgs/" + "EditBasePostil" + "Active" + ".png")
-        // }
+            // {
+            //     name: '批注',
+            //     id: "BaseExplain",
+            //     icon: require("./../../../assets/images/leftImgs/" + "EditBasePostil.png"),
+            //     activeIcon: require("./../../../assets/images/leftImgs/" + "EditBasePostil" + "Active" + ".png")
+            // }
         ]
     },
     {
@@ -61,6 +61,35 @@ export const baseEditItems = [{
         ]
     },
     {
+        title: '动态取值',
+        isClip: true,// 是否展开
+        itemList: [{
+            name: '公式',
+            id: "equation",
+            icon: require("./../../../assets/images/leftImgs/" + "equation.png"),
+            activeIcon: require("./../../../assets/images/leftImgs/" + "equation" + "Active" + ".png")
+        },
+        {
+            name: '信息点',
+            id: "infoPoint",
+            icon: require("./../../../assets/images/leftImgs/" + "infoPoint.png"),
+            activeIcon: require("./../../../assets/images/leftImgs/" + "infoPoint" + "Active" + ".png")
+        },
+            // {
+            //     name: '设备组',
+            //     id: "equipList",
+            //     icon: require("./../../../assets/images/leftImgs/" + "equipList.png"),
+            //     activeIcon: require("./../../../assets/images/leftImgs/" + "equipList" + "Active" + ".png")
+            // },
+            // {
+            //     name: '通用实例',
+            //     id: "publicItem",
+            //     icon: require("./../../../assets/images/leftImgs/" + "publicItem.png"),
+            //     activeIcon: require("./../../../assets/images/leftImgs/" + "publicItem" + "Active" + ".png")
+            // }
+        ]
+    },
+    {
         title: '联通方式',
         isClip: true,// 是否展开
         itemList: [{
@@ -83,34 +112,6 @@ export const baseEditItems = [{
         }
         ]
     },
-    {
-        title: '动态取值',
-        isClip: true,// 是否展开
-        itemList: [{
-            name: '公式',
-            id: "equation",
-            icon: require("./../../../assets/images/leftImgs/" + "equation.png"),
-            activeIcon: require("./../../../assets/images/leftImgs/" + "equation" + "Active" + ".png")
-        },
-        {
-            name: '信息点',
-            id: "infoPoint",
-            icon: require("./../../../assets/images/leftImgs/" + "infoPoint.png"),
-            activeIcon: require("./../../../assets/images/leftImgs/" + "infoPoint" + "Active" + ".png")
-        },
-        {
-            name: '设备组',
-            id: "equipList",
-            icon: require("./../../../assets/images/leftImgs/" + "equipList.png"),
-            activeIcon: require("./../../../assets/images/leftImgs/" + "equipList" + "Active" + ".png")
-        },
-        {
-            name: '通用实例',
-            id: "publicItem",
-            icon: require("./../../../assets/images/leftImgs/" + "publicItem.png"),
-            activeIcon: require("./../../../assets/images/leftImgs/" + "publicItem" + "Active" + ".png")
-        }
-        ]
-    },
+
     ]
 }]

+ 2 - 2
src/components/editview/topoTooltip.vue

@@ -4,7 +4,7 @@
     <div v-if="havItem" class="tooltip-card">
       <ul>
         <li @click="editItem">编辑</li>
-        <li @click="setLock">锁定</li>
+        <li @click="setLock">{{isLock?'解锁':"锁定"}}</li>
         <li @click="toTop">置顶</li>
         <li @click="toBottom">置底</li>
         <li @click="deleteItem">删除</li>
@@ -23,7 +23,7 @@
 import { SItemStatus } from "@persagy-web/big";
 import bus from "@/bus/bus";
 export default {
-  props: ["havItem"],
+  props: ["havItem","isLock"],
   name: "topoTooltip",
   data() {
     return {};

+ 1 - 1
src/components/homeView/createGraphDialog.vue

@@ -49,7 +49,7 @@ export default {
       rules: {
         name: [
           { required: true, message: "请输入名称", trigger: "blur" },
-          { max: 20, message: "最长为10个文字", trigger: "blur" },
+          { max: 20, message: "最长为20个文字", trigger: "blur" },
         ],
         type: [
           { required: true, message: "请选择所属类别", trigger: "change" },