|
@@ -7,11 +7,11 @@
|
|
@close="closeDialog()"
|
|
@close="closeDialog()"
|
|
>
|
|
>
|
|
<div class="pdf-main">
|
|
<div class="pdf-main">
|
|
|
|
+ <div class="title" >
|
|
|
|
+ <div class="name" ></div>
|
|
|
|
+ <div class="pdf-close cursor-pointer" @click="closeDialog"></div>
|
|
|
|
+ </div>
|
|
<div id="printTest" class="pdf-dialog-box">
|
|
<div id="printTest" class="pdf-dialog-box">
|
|
- <div class="title" >
|
|
|
|
- <div class="name" ></div>
|
|
|
|
- <div class="pdf-close cursor-pointer" @click="closeDialog"></div>
|
|
|
|
- </div>
|
|
|
|
<div class="pdf-my-body" >
|
|
<div class="pdf-my-body" >
|
|
<div class="pdfBox" >
|
|
<div class="pdfBox" >
|
|
<div class="a4" >
|
|
<div class="a4" >
|
|
@@ -47,10 +47,10 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div style="text-align: left">
|
|
|
|
- <el-button size="large" color="#626aef" v-print="'#printTest'">打印</el-button>
|
|
|
|
-<!-- <el-button size="large" color="#626aef" @click="closeDialog">关闭</el-button>-->
|
|
|
|
- </div>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ <div style="text-align: left">
|
|
|
|
+ <el-button size="large" color="#626aef" v-print="printObj">打印</el-button>
|
|
|
|
+ <!-- <el-button size="large" color="#626aef" @click="closeDialog">关闭</el-button>-->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -61,7 +61,6 @@
|
|
import {reactive, ref, toRefs, computed, nextTick, onMounted} from "vue";
|
|
import {reactive, ref, toRefs, computed, nextTick, onMounted} from "vue";
|
|
import {useStore} from "vuex";
|
|
import {useStore} from "vuex";
|
|
import {WKT} from "ol/format";
|
|
import {WKT} from "ol/format";
|
|
-import html2canvas from "html2canvas"
|
|
|
|
import PdfMap from "./pdfMap";
|
|
import PdfMap from "./pdfMap";
|
|
import { dateFormat } from "@/utils/date_util";
|
|
import { dateFormat } from "@/utils/date_util";
|
|
import {getAreaByWkt} from "../../utils/map";
|
|
import {getAreaByWkt} from "../../utils/map";
|
|
@@ -89,6 +88,21 @@ const props = defineProps({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+let printObj = {
|
|
|
|
+ id:"printTest",
|
|
|
|
+ popTitle: 'good print',
|
|
|
|
+ beforeOpenCallback (vue) {
|
|
|
|
+ toImg(pdfMap.kmap.map)
|
|
|
|
+ console.log('打开之前')
|
|
|
|
+ },
|
|
|
|
+ openCallback (vue) {
|
|
|
|
+ console.log('执行了打印')
|
|
|
|
+ },
|
|
|
|
+ closeCallback (vue) {
|
|
|
|
+ console.log('关闭了打印工具')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
let imgUrl = ref(null)
|
|
let imgUrl = ref(null)
|
|
const executor = ref([])
|
|
const executor = ref([])
|
|
const executorList = ref([])
|
|
const executorList = ref([])
|
|
@@ -111,15 +125,6 @@ function toImg(map) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/**表单验证规则
|
|
|
|
- * @description:
|
|
|
|
- * @param {*} computed
|
|
|
|
- * @return {*}
|
|
|
|
- */
|
|
|
|
-const rules = computed(() => ({
|
|
|
|
-}));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
let pdfMap = new PdfMap()
|
|
let pdfMap = new PdfMap()
|
|
let rowData = ref({})
|
|
let rowData = ref({})
|
|
|
|
|
|
@@ -130,12 +135,8 @@ onMounted(()=>{
|
|
data.area = getAreaByWkt(data.geom)
|
|
data.area = getAreaByWkt(data.geom)
|
|
rowData.value = data
|
|
rowData.value = data
|
|
pdfMap.initMap(data,mapRef.value)
|
|
pdfMap.initMap(data,mapRef.value)
|
|
- setTimeout(function(){
|
|
|
|
- toImg(pdfMap.kmap.map)
|
|
|
|
- },2000)
|
|
|
|
})
|
|
})
|
|
})
|
|
})
|
|
-
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -152,11 +153,6 @@ $body-height:calc(100% - $title-height);
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
border: 2px solid rgba(81,233,240,0.6);
|
|
border: 2px solid rgba(81,233,240,0.6);
|
|
position: absolute;
|
|
position: absolute;
|
|
-}
|
|
|
|
-.pdf-dialog-box{
|
|
|
|
- font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
.title{
|
|
.title{
|
|
width: 100%;
|
|
width: 100%;
|
|
height: $title-height;
|
|
height: $title-height;
|
|
@@ -181,6 +177,11 @@ $body-height:calc(100% - $title-height);
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
+.pdf-dialog-box{
|
|
|
|
+ font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
.pdf-my-body{
|
|
.pdf-my-body{
|
|
width: 100%;
|
|
width: 100%;
|
|
height: $body-height;
|
|
height: $body-height;
|