Browse Source

修改环境

shuhao 4 months ago
parent
commit
30d73519d9
1 changed files with 6 additions and 8 deletions
  1. 6 8
      src/views/authentic/Pdf.vue

+ 6 - 8
src/views/authentic/Pdf.vue

@@ -98,8 +98,7 @@ let printObj = {
   id:"printTest",
   popTitle: 'good print',
   beforeOpenCallback (vue) {
-    toImg(pdfMap.kmap.map)
-
+    toImg(true)
     console.log('打开之前')
   },
   openCallback (vue) {
@@ -127,10 +126,12 @@ const closeDialog = (key) => {
   }
   emit("closeDialog", "pdf");
 };
-function toImg() {
+function toImg(show) {
   let canvas = pdfMap.kmap.map.getViewport().querySelector('canvas')
   let dataURL = canvas.toDataURL('image/png');
-  imgUrl.value = dataURL;
+  if(show){
+    imgUrl.value = dataURL;
+  }
 }
 
 
@@ -140,10 +141,7 @@ onMounted(()=>{
     data.area = getAreaByWkt(data.geom)
     rowData.value = data
     pdfMap.initMap(data,mapRef.value)
-    ;
-    // setTimeout(()=>{
-    //   toImg(pdfMap.kmap.map)
-    // },500)
+    toImg(false)
   })
 })
 </script>