Просмотр исходного кода

'修改直线不能绘制结束问题'

zhangyu 4 лет назад
Родитель
Сommit
2aed17d3f8
2 измененных файлов с 17 добавлено и 5 удалено
  1. 10 1
      src/components/edit/attr_select.vue
  2. 7 4
      src/components/mapClass/EditScence.ts

+ 10 - 1
src/components/edit/attr_select.vue

@@ -21,6 +21,7 @@
         <div class="row-tit">线型</div>
         <a-select
           style="width: 208px"
+          v-model="borderStyle"
           :default-value="borderLineOption[0].id"
           @change="changeBorder"
         >
@@ -293,7 +294,7 @@ import editDialog from "./edit-dialog";
 import Swatches from "vue-swatches";
 import bus from "@/bus";
 import "vue-swatches/dist/vue-swatches.css";
-import { ItemColor } from "@saga-web/big/lib";
+import { SLineStyle } from "@saga-web/graph/lib";
 import { uploadImg, queryGlsmsLocation,queryGlsmsAsset } from "@/api/editer.js";
 export default {
   name: "attr_select",
@@ -319,6 +320,7 @@ export default {
       fontColor: "#1CA085", //文字颜色
       borderColor: "", // 边框颜色 直线,折线,多边形等
       backColor: "", //背景色 用于text文字
+      borderStyle: "solid",
       borderLineOption: [
         {
           id: "solid",
@@ -493,6 +495,13 @@ export default {
         } else if (newval.itemType == "baseLine") {
           this.lineWidth = Item.lineWidth;
           this.borderColor = Item.strokeColor.value;
+          if (Item.lineStyle == SLineStyle.Soild) {
+            this.borderStyle = "solid";
+          } else if (Item.lineStyle == SLineStyle.Dashed) {
+            this.borderStyle = "dashed";
+          } else if (Item.lineStyle == SLineStyle.Dotted) {
+            this.borderStyle = "dotted";
+          }
         } else if (
           newval.itemType == "Zone" ||
           newval.itemType == "Line" ||

+ 7 - 4
src/components/mapClass/EditScence.ts

@@ -617,13 +617,13 @@ export class EditScence extends SGraphScene {
      */
     upadataBorder(val: string): void {
         if (this.focusItem) {
-            let borderStyle = null
+            let borderStyle = null;
             if (val == 'dashed') {
-                borderStyle = SLineStyle.Dashed
+                borderStyle = SLineStyle.Dashed;
             } else if (val == 'dotted') {
-                borderStyle = SLineStyle.Dotted
+                borderStyle = SLineStyle.Dotted;
             } else if (val == 'solid') {
-                borderStyle = SLineStyle.Soild
+                borderStyle = SLineStyle.Soild;
             }
             this.focusItem.lineStyle = borderStyle;
         }
@@ -1038,6 +1038,9 @@ export class EditScence extends SGraphScene {
                     } else if (this.grabItem.curIndex == 0) {
                         this.grabItem.startItem = null;
                     }
+                } else {
+                    this.grabItem.onMouseDown(event);
+                    return
                 }
             }