|
@@ -45,8 +45,8 @@
|
|
|
</tr>
|
|
|
</table>
|
|
|
<div class="a4_sub_title">地块四至图</div>
|
|
|
- <img class="img-content img" style="z-index: 999" width="595" height="500" v-if="imgUrl" :src="imgUrl" />
|
|
|
- <div class="img-content" v-if="!imgUrl" ref="mapRef" id="mapRefId"></div>
|
|
|
+ <img :key="imgUrl" v-show="imgUrl" class="img-content img" style="z-index: 999" width="595" height="500" v-if="imgUrl" :src="imgUrl" />
|
|
|
+ <div :key="imgUrl" v-show="!imgUrl" class="img-content" v-if="!imgUrl" ref="mapRef" id="mapRefId"></div>
|
|
|
<div class="signature">签名:______________</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -99,6 +99,7 @@ let printObj = {
|
|
|
popTitle: 'good print',
|
|
|
beforeOpenCallback (vue) {
|
|
|
toImg(pdfMap.kmap.map)
|
|
|
+
|
|
|
console.log('打开之前')
|
|
|
},
|
|
|
openCallback (vue) {
|
|
@@ -126,9 +127,8 @@ const closeDialog = (key) => {
|
|
|
}
|
|
|
emit("closeDialog", "pdf");
|
|
|
};
|
|
|
-
|
|
|
-function toImg(map) {
|
|
|
- let canvas = map.getViewport().querySelector('canvas');
|
|
|
+function toImg() {
|
|
|
+ let canvas = pdfMap.kmap.map.getViewport().querySelector('canvas')
|
|
|
let dataURL = canvas.toDataURL('image/png');
|
|
|
imgUrl.value = dataURL;
|
|
|
}
|
|
@@ -140,6 +140,7 @@ onMounted(()=>{
|
|
|
data.area = getAreaByWkt(data.geom)
|
|
|
rowData.value = data
|
|
|
pdfMap.initMap(data,mapRef.value)
|
|
|
+ ;
|
|
|
// setTimeout(()=>{
|
|
|
// toImg(pdfMap.kmap.map)
|
|
|
// },500)
|