From ecb6cadc3f016cf9968f48e0cc77479a1e56365b Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期日, 20 十二月 2020 17:32:06 +0800
Subject: [PATCH] 标定添加关联摄像机tab,绘制区域组件参数更新

---
 src/components/canvas/index.vue |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/components/canvas/index.vue b/src/components/canvas/index.vue
index c26ef7b..a7dae5a 100644
--- a/src/components/canvas/index.vue
+++ b/src/components/canvas/index.vue
@@ -1,10 +1,10 @@
 <template>
-  <div class="s-cavas">
+  <div class="s-cavas" :style="{width:canvasWidth+'px',height:canvasHeight+'px'}">
     <canvas
       ref="myCanvas"
       :width="canvasWidth"
       :height="canvasHeight"
-      :style="`background:url(${canvasBg}) center / 576px 324px no-repeat; background-size: contain;`"
+      :style="`background:url(${canvasBg}) center / ${canvasWidth}px ${canvasHeight}px no-repeat; background-size: contain;`"
     ></canvas>
 
     <el-tooltip content="鍒锋柊搴曞浘" placement="bottom" popper-class="atooltip" v-if="isShowRefresh">
@@ -93,6 +93,10 @@
     canvasHeight: {
       type: Number,
       default: 324
+    },
+    showProportion: {
+      type: Number,
+      default: 1.666
     }
   },
   computed: {
@@ -124,7 +128,7 @@
       ctx: null,
       visible: false,
       baseImg: undefined,
-      showProportion: 1.666
+      //showProportion: 1.666
     };
   },
   watch: {
@@ -193,10 +197,11 @@
       this.$nextTick(() => {
         // this.$refs.bigCanvas.delCursor = {}
       })
+      
     },
     cancelFunc() {
       this.visible = false;
-      this.$refs.bigCanvas.cancel()
+      this.$refs.bigCanvas.cancel();
       // console.log("鍏抽棴浜�");
     },
     handleOk() {
@@ -220,6 +225,7 @@
       // 椤轰究鐢╁埌鏇村灞傚幓
       this.$emit("fromCanvas", this.$refs.bigCanvas.canvasData);
       // console.log("浣犲ソ", this.canvasData);
+
       this.clickSelect(this.canvasData);
       this.visible = false;
     },
@@ -501,8 +507,8 @@
   left: 0;
 }
 .s-cavas {
-  width: 576px;
-  height: 324px;
+  // width: 576px;
+  // height: 324px;
   margin-top: 10px;
   position: relative;
   overflow: auto;

--
Gitblit v1.8.0