Преглед изворни кода

'宽高属性框是否禁用判断'

zhangyu пре 4 година
родитељ
комит
5904425d7b
1 измењених фајлова са 14 додато и 14 уклоњено
  1. 14 14
      src/components/edit/right_toolbar.vue

+ 14 - 14
src/components/edit/right_toolbar.vue

@@ -39,6 +39,8 @@
 <script>
 import attrSelect from "@/components/edit/attr_select";
 import bus from "@/bus";
+import { SImageMarkerItem } from '../../lib/items/SImageMarkerItem';
+import { SImageLegendItem } from '../../lib/items/SImageLegendItem';
 
 const msgList = [
   {
@@ -61,13 +63,13 @@ const msgList = [
   },
   {
     msg: "",
-    disable: false,
+    disable: true,
     name: "Width",
     unit: "w"
   },
   {
     msg: "",
-    disable: false,
+    disable: true,
     name: "Height",
     unit: "h"
   }
@@ -177,22 +179,20 @@ export default {
           if (item.name == "Width") {
             item.msg = Item.boundingRect().width;
             // 针对icon 以及图片
-            if (
-              Item.data &&
-              Item.data.GraphElementType &&
-              Item.data.GraphElementType == "Image"
-            ) {
-              item.msg = Item.width;
+            if (Item instanceof SImageMarkerItem || Item instanceof SImageLegendItem) {
+              item.disable = false;
+              // item.msg = Item.width;
+            } else {
+              item.disable = true;
             }
           }
           if (item.name == "Height") {
             item.msg = Item.boundingRect().height;
-            if (
-              Item.data &&
-              Item.data.GraphElementType &&
-              Item.data.GraphElementType == "Image"
-            ) {
-              item.msg = Item.height;
+            if (Item instanceof SImageMarkerItem || Item instanceof SImageLegendItem) {
+              item.disable = false;
+              // item.msg = Item.height;
+            } else {
+              item.disable = true;
             }
           }
         });