Przeglądaj źródła

项目详情的二维展示优化

zhangliang2 3 lat temu
rodzic
commit
08a0b51a67

+ 4 - 6
src/views/workManagement/components/canvasProjectInfo.vue

@@ -95,13 +95,11 @@ export default {
             this.imgBg.src = this.modelImgSrc;
             this.imgBg.onload = () => {
                 this.ctxBg.drawImage(this.imgBg, 0, 0, 1000, 500);
-            };
 
-            this.imgIcon = new Image();
-            this.imgIcon.src = this.aSrc;
+                this.imgIcon = new Image();
+                this.imgIcon.src = this.aSrc;
 
-            this.imgIcon.onload = () => {
-                setTimeout(() => {
+                this.imgIcon.onload = () => {
                     this.configList.camera.forEach((i) => {
                         this.draw(i);
                     });
@@ -114,7 +112,7 @@ export default {
                     this.configList.gps.forEach((i) => {
                         this.draw(i);
                     });
-                }, 1000);
+                };
             };
         });
     },