瀏覽代碼

修复bug和样式

xushiting 2 年之前
父節點
當前提交
2a6aef3be5

+ 8 - 3
src/views/draw-file/board/editCAD/Load.js

@@ -88,9 +88,14 @@ export default class Load {
                 sign.angle = floor.signs[key].angle
                 sign.angle = floor.signs[key].angle
             }
             }
 
 
-            floorplanService.createTitle(floor.title.value, floor.title.vectorId, i)
-            floorplanService.createBgImage(floor.image.src, floor.image.vectorId, i)
-            floorplanService.createCompass(floor.compass.angle, floor.compass.vectorId, i)
+            const title = floorplanService.createTitle(floor.title.value, floor.title.vectorId, i)
+            floorplanService.addTitle(title)
+
+            const bgImage = floorplanService.createBgImage(floor.image.src, floor.image.vectorId, i)
+            floorplanService.addBgImage(bgImage)
+
+            const compass = floorplanService.createCompass(floor.compass.angle, floor.compass.vectorId, i)
+            floorplanService.addCompass(compass)
         }
         }
     }
     }
 
 

+ 32 - 48
src/views/draw-file/board/editCAD/Renderer/Draw.js

@@ -1091,8 +1091,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="#FF4D4F";
 
 
         if (selectItem && selectItem.type == VectorType.FirePoint) {
         if (selectItem && selectItem.type == VectorType.FirePoint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1128,10 +1130,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32, (geometry.getLen() * geometry.scale * coordinate.res) / 32)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32, (geometry.getLen() * geometry.scale * coordinate.res) / 32)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="#FF4D4F";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(6.15863,28.8837);
         this.context.moveTo(6.15863,28.8837);
         this.context.bezierCurveTo(4.84988,35.4972,11.9564,43.3721,15.8216,45);
         this.context.bezierCurveTo(4.84988,35.4972,11.9564,43.3721,15.8216,45);
@@ -1165,8 +1163,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="black";
 
 
         if (selectItem && selectItem.type == VectorType.LeftFootPrint) {
         if (selectItem && selectItem.type == VectorType.LeftFootPrint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1202,10 +1202,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="black";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(26.5,7);
         this.context.moveTo(26.5,7);
         this.context.bezierCurveTo(25.1193,7,24,5.88071,24,4.5);
         this.context.bezierCurveTo(25.1193,7,24,5.88071,24,4.5);
@@ -1278,8 +1274,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="black";
 
 
         if (selectItem && selectItem.type == VectorType.RightFootPrint) {
         if (selectItem && selectItem.type == VectorType.RightFootPrint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1315,10 +1313,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="black";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(18.5,7);
         this.context.moveTo(18.5,7);
         this.context.bezierCurveTo(19.8807,7,21,5.88071,21,4.5);
         this.context.bezierCurveTo(19.8807,7,21,5.88071,21,4.5);
@@ -1391,8 +1385,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.fillStyle="black";
+        this.context.font="   15px ''";
 
 
         if (selectItem && selectItem.type == VectorType.LeftShoePrint) {
         if (selectItem && selectItem.type == VectorType.LeftShoePrint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1428,10 +1424,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.fillStyle="black";
-        this.context.font="   15px ''";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(29.9064,30.2635);
         this.context.moveTo(29.9064,30.2635);
         this.context.lineTo(18.3897,31.999);
         this.context.lineTo(18.3897,31.999);
@@ -1464,8 +1456,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="black";
 
 
         if (selectItem && selectItem.type == VectorType.RightShoePrint) {
         if (selectItem && selectItem.type == VectorType.RightShoePrint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1501,10 +1495,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="black";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(16.0936,30.2635);
         this.context.moveTo(16.0936,30.2635);
         this.context.lineTo(27.6103,31.999);
         this.context.lineTo(27.6103,31.999);
@@ -1537,8 +1527,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="black";
 
 
         if (selectItem && selectItem.type == VectorType.FingerPrint) {
         if (selectItem && selectItem.type == VectorType.FingerPrint) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1574,10 +1566,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="black";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(43.4999,21.5);
         this.context.moveTo(43.4999,21.5);
         this.context.bezierCurveTo(43.4999,16.542,39.7109,10.8816,34.1276,7.63537);
         this.context.bezierCurveTo(43.4999,16.542,39.7109,10.8816,34.1276,7.63537);
@@ -1693,8 +1681,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="#040101";
 
 
         if (selectItem && selectItem.type == VectorType.DeadBody) {
         if (selectItem && selectItem.type == VectorType.DeadBody) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1730,10 +1720,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="#040101";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(5.91335,12.2268);
         this.context.moveTo(5.91335,12.2268);
         this.context.bezierCurveTo(4.35883,11.5123,3.17581,11.4098,2.00721,12.6867);
         this.context.bezierCurveTo(4.35883,11.5123,3.17581,11.4098,2.00721,12.6867);
@@ -1805,8 +1791,10 @@ export default class Draw {
         const focusItem = stateService.getFocusItem()
         const focusItem = stateService.getFocusItem()
 
 
         this.context.save()
         this.context.save()
-        this.context.strokeStyle = Style.Sign.strokeStyle
-        this.context.fillStyle = Style.Sign.fillStyle
+        this.context.strokeStyle="rgba(0,0,0,0)";
+        this.context.miterLimit=4;
+        this.context.font="15px ''";
+        this.context.fillStyle="#FF4D4F";
 
 
         if (selectItem && selectItem.type == VectorType.BloodStain) {
         if (selectItem && selectItem.type == VectorType.BloodStain) {
             if (geometry.vectorId == selectItem.vectorId) {
             if (geometry.vectorId == selectItem.vectorId) {
@@ -1842,10 +1830,6 @@ export default class Draw {
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.scale((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom, (geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
         this.context.lineWidth = 1 / ((geometry.getLen() * geometry.scale * coordinate.res) / 32 * coordinate.zoom/Constant.defaultZoom)
 
 
-        this.context.strokeStyle="rgba(0,0,0,0)";
-        this.context.miterLimit=4;
-        this.context.font="15px ''";
-        this.context.fillStyle="#FF4D4F";
         this.context.beginPath();
         this.context.beginPath();
         this.context.moveTo(11.7832,43.4124);
         this.context.moveTo(11.7832,43.4124);
         this.context.bezierCurveTo(13.9788,44.5378,19.4679,44.5355,19.468,38.91);
         this.context.bezierCurveTo(13.9788,44.5378,19.4679,44.5355,19.468,38.91);

+ 24 - 12
src/views/draw-file/board/editCAD/Style.js

@@ -78,12 +78,16 @@ const Style = {
             fillStyle: '#00C8AF',
             fillStyle: '#00C8AF',
         },
         },
         Table: {
         Table: {
-            strokeStyle: 'green',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'green',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
         Sign: {
         Sign: {
-            strokeStyle: 'rgba(243, 255, 0, 0.8)',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'rgba(243, 255, 0, 0.8)',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
         Point: {
         Point: {
             radius: 4,
             radius: 4,
@@ -96,8 +100,10 @@ const Style = {
             fillStyle: '#00C8AF',
             fillStyle: '#00C8AF',
         },
         },
         Compass: {
         Compass: {
-            strokeStyle: 'rgba(243, 255, 0, 0.8)',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'rgba(243, 255, 0, 0.8)',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
     },
     },
     Focus: {
     Focus: {
@@ -124,12 +130,16 @@ const Style = {
             fillStyle: '#00C8AF',
             fillStyle: '#00C8AF',
         },
         },
         Table: {
         Table: {
-            strokeStyle: 'green',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'green',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
         Sign: {
         Sign: {
-            strokeStyle: 'rgba(243, 255, 0, 0.8)',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'rgba(243, 255, 0, 0.8)',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
         Point: {
         Point: {
             radius: 4,
             radius: 4,
@@ -142,8 +152,10 @@ const Style = {
             fillStyle: '#00C8AF',
             fillStyle: '#00C8AF',
         },
         },
         Compass: {
         Compass: {
-            strokeStyle: 'rgba(243, 255, 0, 0.8)',
-            fillStyle: 'rgba(243, 255, 0, 0.5)',
+            //strokeStyle: 'rgba(243, 255, 0, 0.8)',
+            //fillStyle: 'rgba(243, 255, 0, 0.5)',
+            strokeStyle: '#00C8AF',
+            fillStyle: '#00C8AF',
         },
         },
     },
     },
     Element: {
     Element: {