From c99cad106ef5be9f818e45d385dfdcec29ce19e5 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期四, 03 十二月 2020 16:52:24 +0800
Subject: [PATCH] 修复绘制多边形撤销错误的bug

---
 src/pages/labelMark/components/RightSide.vue |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/pages/labelMark/components/RightSide.vue b/src/pages/labelMark/components/RightSide.vue
index 6b630d2..e1f2177 100644
--- a/src/pages/labelMark/components/RightSide.vue
+++ b/src/pages/labelMark/components/RightSide.vue
@@ -61,7 +61,7 @@
                   <el-form :model="curLabel" :rules="rules" ref="labelForm">
                     <div class="detail-item">
                       <div class="left">
-                        <el-form-item prop="X0">
+                        <el-form-item prop="x0">
                           <label for>骞抽潰鍧愭爣X:</label>
                           <span class="fix-width">{{curLabel.x0}}</span>
                           <i>px</i>
@@ -284,10 +284,11 @@
         if (valid) {
           _this.isShowPop = false;
           debugger
+          //缂栬緫纭畾
           if (_this.curLabel.id) {
             let editedIndex = _this.curCameraData.coords.findIndex(one => one.id == _this.curLabel.id);
             _this.curCameraData.coords[editedIndex] = JSON.parse(JSON.stringify(_this.curLabel));
-            //editedOne = JSON.parse(JSON.stringify(_this.curLabel));
+            
           }
           console.log(_this.curCameraData.coords)
           this.$refs['labelForm'].clearValidate();
@@ -365,7 +366,6 @@
       if (this.isShowPop) return;
       //鑾峰彇榧犳爣鐩稿浜庣敾鏉跨殑瀹氫綅
       console.log('鑾峰彇褰撳墠瀹氫綅淇℃伅');
-      //this.$refs['labelForm'].clearValidate();
       this.$refs['labelForm'].resetFields();
       let target = {
         id: '',
@@ -374,6 +374,7 @@
         x1: '',
         y1: ''
       };
+      target.id = 'n'+(this.curCameraData.coords.length-1);
       //this.labels.push(target);
       this.curCameraData.coords.push(target);
       this.curLabel = target;
@@ -381,6 +382,7 @@
       this.isNewLabel = true;
     },
     editLabel (label) {
+      debugger
       if (!this.isEdit) return;
       this.isShowPop = true;
       this.$refs['labelForm'].clearValidate();

--
Gitblit v1.8.0