zhulizhen1111 4 년 전
부모
커밋
44addb04e3
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      src/views/legendLibrary/addForm.vue

+ 5 - 4
src/views/legendLibrary/addForm.vue

@@ -17,10 +17,10 @@
                 </el-select>
             </div>
             <div class='input-right' ref='graph' v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
-                <div v-if=' ruleForm.Type=="Image" && ruleForm.Url' class='input-right'>
+                <div v-show=' ruleForm.Type=="Image" && ruleForm.Url' class='input-right'>
                     <img :src='`/serve/topology-wanda/Picture/query/${ruleForm.Url}`' alt />
                 </div>
-                <canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-else></canvas>
+                <canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-show='!(ruleForm.Type=="Image" && ruleForm.Url)'></canvas>
             </div>
         </div>
         <div v-if='ruleForm.Type=="Zone" || ruleForm.Type=="Line"' class='form3'>
@@ -251,8 +251,9 @@ export default {
             this.view.lineWidth = this.ruleForm.LineWidth
         },
         initGraph() {
-            if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line') {
-                this.clearGraphy(this.ruleForm.Type == 'Zone' ? 1 : 0)
+            if (this.ruleForm.Type == 'Zone' || this.ruleForm.Type == 'Line' || this.ruleForm.Type == 'Image') {
+                //1是区域 0是线条
+                this.clearGraphy(this.ruleForm.Type == 'Zone' ? 1 : this.ruleForm.Type == 'Line' ? 0 : 2)
             }
         },
         //rgba转成16进制