Sfoglia il codice sorgente

修复隔离点渲染重复问题

pm 11 mesi fa
parent
commit
406d6d9226

+ 5 - 6
src/components/separationPoint/index.vue

@@ -29,26 +29,25 @@ export default {
       texts: [], //白色text合集
       bgrects:[],//白色底部
       redrects: [], //红色rect合集
-      redtexts: [] //白色text合集
-
+      redtexts: [], //白色text合集
+      isInit: false,//判断是否初始化变量
     }
   },
   watch: {
     'getMapData': {
       handler(newval) {
-        if (newval) {
-
+        if (newval&& !this.isInit) {
           this.$nextTick(()=>{
             this.initKonva()
+            this.isInit = true
           })
-
         }
       }
     },
 
   },
   mounted() {
-    this.initKonva()
+    // this.initKonva() 暂时先注释掉这里 为了避免多次重复渲染
     console.log(this.points, 'points')
 
     console.log(

+ 5 - 4
src/views/mes/job/jobm/lookWork.vue

@@ -19,7 +19,7 @@
     </div>
     <!-- 作业区域  -->
     <div class="lefttree">
-      <el-card class="lefttree-card" v-show="this.showWorkEare == true">
+      <el-card class="lefttree-card" v-if="this.showWorkEare == true">
         <b class="title">作业区域</b>
         <div class="head-container">
           <el-input
@@ -57,7 +57,7 @@
           type="primary"
           icon="el-icon-s-fold"
           class="btnwork"
-          v-show="this.showWorkEare == true"
+          v-if="this.showWorkEare == true"
           @click="openWorkEare"
         ></el-button>
       </el-tooltip>
@@ -73,7 +73,7 @@
           type="primary"
           icon="el-icon-s-unfold"
           class="btnwork"
-          v-show="this.showWorkEare == false"
+          v-if="this.showWorkEare == false"
           @click="closeWorkEare"
         ></el-button>
       </el-tooltip>
@@ -677,7 +677,7 @@ export default {
     // // 5秒后隐藏盒子
     setTimeout(() => {
       this.isVisible = false;
-    }, 2000);
+    }, 1000);
 
     this.getTreeselect(); //获取工作区域下拉
     this.getSopList();
@@ -737,6 +737,7 @@ export default {
       const ticketId = this.$route.query.ticketId;
       getJobTicketInfo(ticketId).then((response) => {
         console.log(response, "编辑拿到路由参数");
+          this.workareaName=response.data.workareaName
 
         this.form = {
           ...this.form,