|
@@ -1,73 +1,84 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div class="main-content">
|
|
|
- <div class="img-box">
|
|
|
- <img src="../../../assets/logo/logo2.png" alt="广东省教师继续教育学会">
|
|
|
+ <div>
|
|
|
+ <div class="main-content">
|
|
|
+ <div class="img-box">
|
|
|
+ <img src="../../../assets/logo/logo2.png" alt="广东省教师继续教育学会" style="">
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;line-height: 50px;">
|
|
|
+ <span class="main-title" style="margin: 0 10px;font-weight: bold;">专业能力证书查询</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="label-box">
|
|
|
+ <div class="label-title">
|
|
|
+ <p class="label-title-p">持证人姓名</p>
|
|
|
+ <p class="label-title-p">(或持证单位全称)</p>
|
|
|
</div>
|
|
|
- <div style="text-align: center;line-height: 50px;">
|
|
|
- <span class="main-title" style="margin: 0 10px;font-weight: bold;" >专业能力证书查询</span>
|
|
|
+ <input v-model="userName" type="text" class="label-input">
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <div class="label-box">
|
|
|
- <div class="label-title">
|
|
|
- <p>持证人姓名</p>
|
|
|
- <p>(或持证单位全称)</p>
|
|
|
- </div>
|
|
|
- <input type="text" v-model="userName" class="label-input" />
|
|
|
- </div>
|
|
|
- <div class="label-box">
|
|
|
- <div class="label-title">
|
|
|
- <p>证书编码</p>
|
|
|
- </div>
|
|
|
- <input type="text" v-model="certNumber" class="label-input" />
|
|
|
+ <div class="label-box">
|
|
|
+ <div class="label-title">
|
|
|
+ <p>证书编码</p>
|
|
|
</div>
|
|
|
- <div class="label-box">
|
|
|
- <div class="label-title">
|
|
|
- <p>验证码<span class="label-must">*</span></p>
|
|
|
- </div>
|
|
|
- <input type="text" v-model="code" class="label-input" style="border-color:#acb1b5"/>
|
|
|
- <div class="captcha-img">
|
|
|
- <img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
|
|
- </div>
|
|
|
+ <input v-model="certNumber" type="text" class="label-input">
|
|
|
+ </div>
|
|
|
+ <div class="label-box">
|
|
|
+ <div class="label-title">
|
|
|
+ <p>验证码<span class="label-must">*</span></p>
|
|
|
</div>
|
|
|
- <div class="btn-box">
|
|
|
- <button class="btn-reset">重置</button>
|
|
|
- <button class="btn-search" @click="handleSearch" v-bind:disabled="iconShow">
|
|
|
- 查询<i class="el-icon-loading" v-show="iconShow"></i>
|
|
|
- </button>
|
|
|
+ <input v-model="code" type="text" class="label-input" style="border-color:#acb1b5">
|
|
|
+ <div class="captcha-img">
|
|
|
+ <img :src="codeUrl" class="login-code-img" @click="getCode">
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="btn-box">
|
|
|
+ <button class="btn-reset">重置</button>
|
|
|
+ <button class="btn-search" :disabled="iconShow" @click="handleSearch">
|
|
|
+ 查询<i v-show="iconShow" class="el-icon-loading" />
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-box back" style="margin: 5px 10px;align-items: center;font-size: 14px;" @click="toIndex">
|
|
|
+ 返回首页<i class="el-icon-arrow-right"></i>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div style="position:fixed;top:-1200px;left:-1800px">
|
|
|
- <div id="pdfDomm" ref="posterWrap">
|
|
|
- <div class="proBox" >
|
|
|
- <img class="proBox-img z01" :src="data.backurl" />
|
|
|
- <div class="con z10" style="width: 64px; height: 83px;overflow: hidden;text-indent: 0;padding-right: 0;top: 133px;left: 182px;">
|
|
|
- <img id="pdfhead" :src="data.headurl" style="height:100%;position: absolute;left: 50%;transform: translate(-50%, -50%);top: 50%;" />
|
|
|
- </div>
|
|
|
- <div class="foot-pp z10">
|
|
|
- <p class="foot-p-name " >{{data.uesrName}}</p>
|
|
|
- <p class="foot-p-ID ">{{data.userId}}</p>
|
|
|
- <p class="foot-p-cert ">{{data.certId}}</p>
|
|
|
- <p class="foot-p-date ">{{data.issueDate}}</p>
|
|
|
- </div>
|
|
|
- <div class="content z10" style="position: absolute;left: 450px;width: 230px;top: 85px;font-size: 19px;line-height: 30px;text-indent: 2em;">
|
|
|
- <p style="margin:0">
|
|
|
- 持证人参加了<span class="heiti" style="margin: 0 15px;font-size: 19px;">{{data.certName}}</span>,已修完教学计划规定的全部课程,合计<span class="heiti" style="margin: 0 15px;font-size: 20px;">{{data.courseHours}}</span>学时。
|
|
|
- </p>
|
|
|
- <p style="margin:0">考核合格,准予结业,特发此证。</p>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div style="position:fixed;">
|
|
|
+ <!-- top:-1200px;left:-1800px -->
|
|
|
+ <div id="pdfDomm" ref="posterWrap">
|
|
|
+ <!-- <div class="proBox">
|
|
|
+ <img class="proBox-img z01" :src="data.backurl">
|
|
|
+ <div class="con z10" style="width: 64px; height: 83px;overflow: hidden;text-indent: 0;padding-right: 0;top: 144px;left: 183px;">
|
|
|
+ <img id="pdfhead" :src="data.headurl" style="height:100%;position: absolute;left: 50%;transform: translate(-50%, -50%);top: 50%;">
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <div class="foot-pp z10">
|
|
|
+ <p class="foot-p-name ">{{ data.uesrName }}</p>
|
|
|
+ <p class="foot-p-ID ">{{ data.userId }}</p>
|
|
|
+ <p class="foot-p-cert ">{{ data.certId }}</p>
|
|
|
+ <p class="foot-p-date ">{{ data.issueDate }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="content z10" style="position: absolute;left: 405px;width: 270px;top: 125px;font-size: 17px;line-height: 30px;text-indent: 2em;text-align: justify;text-align-last: left;">
|
|
|
+ <p style="margin:0">
|
|
|
+ 持证人参加了<span class="heiti" style="margin: 0 15px;font-size: 17px;">{{ data.certName }}</span>,已修完教学计划规定的全部课程,合计<span class="heiti" style="margin: 0 15px;font-size: 18px;">{{ data.courseHours }}</span>学时。
|
|
|
+ </p>
|
|
|
+ <p style="margin:0">考核合格,准予结业,特发此证。</p>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
+ </div>
|
|
|
+ <my-dialog
|
|
|
+ :imgShow="imgShow"
|
|
|
+ :certNumber="certNumber"
|
|
|
+ :imgUrl="imgUrl"
|
|
|
+ @mydialogshow="mydialogshow"
|
|
|
+ :htmlTitle = "htmlTitle"
|
|
|
+ ></my-dialog>
|
|
|
+ <el-dialog
|
|
|
:title="`您以证书编号:${certNumber}为关键字查询验证证书结果如下:`"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="fit-content"
|
|
|
- :before-close="handleClose"
|
|
|
- class="dialog-box"
|
|
|
- >
|
|
|
- <!-- <div id="pdfDom" ref="posterWrap">
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="fit-content"
|
|
|
+ :before-close="handleClose"
|
|
|
+ class="dialog-box"
|
|
|
+ >
|
|
|
+ <!-- <div id="pdfDom" ref="posterWrap">
|
|
|
<div class="proBox" >
|
|
|
<img class="proBox-img z01" :src="data.backurl" />
|
|
|
<div class="con z10" style="width: 64px; height: 83px;overflow: hidden;text-indent: 0;padding-right: 0;top: 133px;left: 182px;">
|
|
@@ -87,184 +98,210 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div> -->
|
|
|
- <p >经证书系统验证查询,证书信息正确,该证书预览如下,如需下载使用,请点击“下载”按钮。</p>
|
|
|
- <img :src="imgUrl" width="750px" height="525px" ref="certimg"/>
|
|
|
- <p style="font-weight:bold;color: red;font-size: 20px;text-indent: 0;">提示:伪造证书系违法行为,请勿尝试。</p>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="handleClose">取 消</el-button>
|
|
|
- <el-button type="primary" @click="downloadImg">下载</el-button>
|
|
|
- <!-- getPdf('#pdfDom') -->
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog
|
|
|
- :title="`您以证书编号:${certNumber}为关键字查询验证证书结果如下:`"
|
|
|
- :visible.sync="errorDialog"
|
|
|
- width="50%"
|
|
|
- class="errordialog-box"
|
|
|
- :before-close="handleErrorClose"
|
|
|
- >
|
|
|
- <!-- :before-close="handleClose" -->
|
|
|
- <p>未能查询到该证书,原因可能是证书编号或姓名(单位名称)输入错误, 也可能该证书为伪造证书。请重新输入准确的 证书编号 与 姓名(单位名称)信息后,再查询。谢谢您的关注。</p>
|
|
|
- <p>如有疑问,请通知持证人与我会联系。</p>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handleErrorClose" style="width:100px">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
+ <p>经证书系统验证查询,证书信息正确,该证书预览如下,如需下载使用,请点击“下载”按钮。</p>
|
|
|
+ <img ref="certimg" :src="imgUrl" width="750px" height="525px">
|
|
|
+ <p style="font-weight:bold;color: red;font-size: 20px;text-indent: 0;">提示:伪造证书系违法行为,请勿尝试。</p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="handleClose">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="downloadImg">下载</el-button>
|
|
|
+ <!-- getPdf('#pdfDom') -->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="`您以证书编号:${certNumber}为关键字查询验证证书结果如下:`"
|
|
|
+ :visible.sync="errorDialog"
|
|
|
+ width="50%"
|
|
|
+ class="errordialog-box"
|
|
|
+ :before-close="handleErrorClose"
|
|
|
+ >
|
|
|
+ <!-- :before-close="handleClose" -->
|
|
|
+ <p>未能查询到该证书,原因可能是证书编号或姓名(单位名称)输入错误, 也可能该证书为伪造证书。请重新输入准确的 证书编号 与 姓名(单位名称)信息后,再查询。谢谢您的关注。</p>
|
|
|
+ <p>如有疑问,请通知持证人与我会联系。</p>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" style="width:100px" @click="handleErrorClose">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getCodeImg,checkCode} from "@/api/login"
|
|
|
-import { getACert } from "@/api/system/grad"
|
|
|
+import { getCodeImg, checkCode } from '@/api/login'
|
|
|
+import { getACert } from '@/api/system/grad'
|
|
|
import html2Canvas from 'html2canvas'
|
|
|
+import MyDialog from "../../../components/MyDialog";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- userName: "",
|
|
|
- certNumber: "",
|
|
|
- code: "",
|
|
|
- codeUrl:"",
|
|
|
- captchaEnabled:true,
|
|
|
- uuid:"",
|
|
|
+ userName: '',
|
|
|
+ certNumber: '',
|
|
|
+ code: '',
|
|
|
+ codeUrl: '',
|
|
|
+ captchaEnabled: true,
|
|
|
+ uuid: '',
|
|
|
dialogVisible: false,
|
|
|
- iconShow:false,
|
|
|
- dist:"cert_b_type",
|
|
|
- pageData: null, //接收html格式代码
|
|
|
- htmlTitle: "结业证书",
|
|
|
+ iconShow: false,
|
|
|
+ dist: 'cert_b_type',
|
|
|
+ pageData: null, // 接收html格式代码
|
|
|
+ htmlTitle: '结业证书',
|
|
|
isShow: true,
|
|
|
isCanvas: false,
|
|
|
downType: false, // false为 pdf , true为图片
|
|
|
- data:{
|
|
|
- certId: "11111111",
|
|
|
- certName: "222",
|
|
|
+ data: {
|
|
|
+ certId: '11111111',
|
|
|
+ certName: '222',
|
|
|
certType: 0,
|
|
|
- courseHours: "222",
|
|
|
- courseName: "222",
|
|
|
+ courseHours: '222',
|
|
|
+ courseName: '222',
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
|
id: 3,
|
|
|
- issueDate: "2022-11-29",
|
|
|
- level: "22",
|
|
|
- picture: "/profile/2022/222_A00.jpg",
|
|
|
+ issueDate: '2022-11-29',
|
|
|
+ level: '22',
|
|
|
+ picture: '/profile/2022/222_A00.jpg',
|
|
|
remark: null,
|
|
|
- trainPeriod: "222",
|
|
|
+ trainPeriod: '222',
|
|
|
uesrName: null,
|
|
|
updateBy: null,
|
|
|
- updateDate: "2022-12-13T15:29:56.000+08:00",
|
|
|
+ updateDate: '2022-12-13T15:29:56.000+08:00',
|
|
|
updateTime: null,
|
|
|
- url: "/profile/upload/2022/12/13/pro1_page-0001_20221213151348A006.jpg",
|
|
|
- userEmail:"222222",
|
|
|
- userId: "2222",
|
|
|
- userPhone: "222"
|
|
|
+ url: '/profile/upload/2022/12/13/pro1_page-0001_20221213151348A006.jpg',
|
|
|
+ userEmail: '222222',
|
|
|
+ userId: '2222',
|
|
|
+ userPhone: '222'
|
|
|
},
|
|
|
- imgUrl:'',
|
|
|
- errorDialog:false,
|
|
|
- word:''
|
|
|
- };
|
|
|
+ imgUrl: '',
|
|
|
+ errorDialog: false,
|
|
|
+ word: '',
|
|
|
+ screenWidth:window.screen.availWidth,
|
|
|
+ imgShow:0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ MyDialog
|
|
|
},
|
|
|
- methods:{
|
|
|
+ mounted() {
|
|
|
+ this.getCode()
|
|
|
+ window.addEventListener('resize', this.debounce(this.getWindowInfo, 500))
|
|
|
+ },
|
|
|
+ destroyed(){
|
|
|
+ window.removeEventListener('resize', this.debounce(this.getWindowInfo, 500))
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
getCode() {
|
|
|
getCodeImg().then(res => {
|
|
|
// console.log(res)
|
|
|
- this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
|
|
+ this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
|
|
|
if (this.captchaEnabled) {
|
|
|
- this.codeUrl = "data:image/gif;base64," + res.img;
|
|
|
- this.uuid = res.uuid;
|
|
|
+ this.codeUrl = 'data:image/gif;base64,' + res.img
|
|
|
+ this.uuid = res.uuid
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- async handleSearch(){
|
|
|
- this.iconShow = true
|
|
|
- if( this.isBlock(this.userName)){
|
|
|
- this.iconShow = false
|
|
|
- this.$message.error("请输入持证人姓名或单位名称!")
|
|
|
- return;
|
|
|
- }
|
|
|
- if( this.isBlock(this.certNumber)){
|
|
|
- this.iconShow = false
|
|
|
- this.$message.error("请输入证书编码!")
|
|
|
- return;
|
|
|
- }
|
|
|
- if( this.isBlock(this.code)){
|
|
|
- this.iconShow = false
|
|
|
- this.$message.error("请输入验证码!")
|
|
|
- return;
|
|
|
- }
|
|
|
- const form = {
|
|
|
- userName: this.userName,
|
|
|
- certNumber: this.certNumber,
|
|
|
- certType:0
|
|
|
- }
|
|
|
- const codeForm = {
|
|
|
- code: this.code,
|
|
|
- uuid: this.uuid
|
|
|
- }
|
|
|
- try{
|
|
|
- let codeRes = await checkCode(codeForm)
|
|
|
- // console.log(codeRes)
|
|
|
- if(codeRes.code===200){
|
|
|
- try{
|
|
|
- getACert(form).then(res=>{
|
|
|
- if(res.data){
|
|
|
- this.iconShow = false
|
|
|
- this.data = res.data
|
|
|
- // console.log(this.data)
|
|
|
- let backimg = this.realUrl(this.data.url)
|
|
|
- let headimg = this.realUrl(this.data.picture)
|
|
|
- this.htmlTitle = this.data.uesrName
|
|
|
- this.data.backurl = backimg
|
|
|
- this.data.headurl = headimg
|
|
|
- // 创建html代码
|
|
|
- // this.makeHtml()
|
|
|
- this.$nextTick(()=>{
|
|
|
- // 将html代码=>canvas=>img
|
|
|
- this.toImg()
|
|
|
+ async handleSearch() {
|
|
|
+ this.iconShow = true
|
|
|
+ if (this.isBlock(this.userName)) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.$message.error('请输入持证人姓名或单位名称!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.isBlock(this.certNumber)) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.$message.error('请输入证书编码!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.isBlock(this.code)) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.$message.error('请输入验证码!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const form = {
|
|
|
+ userName: this.userName,
|
|
|
+ certNumber: this.certNumber,
|
|
|
+ certType: 0
|
|
|
+ }
|
|
|
+ const codeForm = {
|
|
|
+ code: this.code,
|
|
|
+ uuid: this.uuid
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ const codeRes = await checkCode(codeForm)
|
|
|
+ // console.log(codeRes)
|
|
|
+ if (codeRes.code === 200) {
|
|
|
+ try {
|
|
|
+ getACert(form).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.data = res.data
|
|
|
+ // console.log(this.data)
|
|
|
+ const backimg = this.realUrl(this.data.url)
|
|
|
+ const headimg = this.realUrl(this.data.picture)
|
|
|
+ this.htmlTitle = this.data.uesrName
|
|
|
+ this.data.backurl = backimg
|
|
|
+ this.data.headurl = headimg
|
|
|
+ // 创建html代码
|
|
|
+ this.makeHtml()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 将html代码=>canvas=>img
|
|
|
+ this.toImg()
|
|
|
+ if(this.screenWidth>800){
|
|
|
this.dialogVisible = true
|
|
|
- // 然后删除掉用完的html代码
|
|
|
- let e = document.getElementById('pdfDomm')
|
|
|
-
|
|
|
- e.innerHTML = ""
|
|
|
- })
|
|
|
- }else{
|
|
|
+ }else{
|
|
|
+ this.imgShow = 1
|
|
|
+ }
|
|
|
+ // 然后删除掉用完的html代码
|
|
|
+ const e = document.getElementById('pdfDomm')
|
|
|
+ e.innerHTML = ''
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if(this.screenWidth>800){
|
|
|
this.errorDialog = true
|
|
|
+ }else{
|
|
|
+ this.imgShow = 2
|
|
|
}
|
|
|
- })
|
|
|
- setTimeout(()=>{
|
|
|
- if(this.iconShow){
|
|
|
- this.iconShow = false
|
|
|
- }
|
|
|
- },10000)
|
|
|
- }catch(error){
|
|
|
- this.iconShow = false
|
|
|
- this.getCode()
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.iconShow) {
|
|
|
+ this.iconShow = false
|
|
|
+ }
|
|
|
+ }, 10000)
|
|
|
+ } catch (error) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.getCode()
|
|
|
}
|
|
|
- }catch(err){
|
|
|
- this.iconShow = false
|
|
|
- this.getCode()
|
|
|
}
|
|
|
+ } catch (err) {
|
|
|
+ this.iconShow = false
|
|
|
+ this.getCode()
|
|
|
+ }
|
|
|
},
|
|
|
- isBlock(str){
|
|
|
- if(str===""){
|
|
|
+ isBlock(str) {
|
|
|
+ if (str === '') {
|
|
|
return true
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return false
|
|
|
}
|
|
|
},
|
|
|
- handleClose(){
|
|
|
+ handleClose() {
|
|
|
this.iconShow = false
|
|
|
this.getCode()
|
|
|
this.dialogVisible = false
|
|
|
+ this.userName= ''
|
|
|
+ this.certNumber=''
|
|
|
+ this.code= ''
|
|
|
},
|
|
|
- handleErrorClose(){
|
|
|
+ handleErrorClose() {
|
|
|
this.iconShow = false
|
|
|
this.getCode()
|
|
|
this.errorDialog = false
|
|
|
+ this.userName= ''
|
|
|
+ this.certNumber=''
|
|
|
+ this.code= ''
|
|
|
},
|
|
|
- realUrl(val){
|
|
|
+ realUrl(val) {
|
|
|
return process.env.VUE_APP_BASE_API + val
|
|
|
},
|
|
|
- toImg(){
|
|
|
+ toImg() {
|
|
|
// 将html代码=>canvas=>img
|
|
|
var htmlID = document.getElementById('pdfDomm')
|
|
|
const that = this
|
|
@@ -272,29 +309,29 @@ export default {
|
|
|
allowTaint: true,
|
|
|
// 下面两个用来提高清晰度
|
|
|
// dpi: window.devicePixelRatio*4, //将分辨率提高到特定的DPI 提高四倍
|
|
|
- dpi: 300, //将分辨率提高到特定的DPI 提高四倍
|
|
|
- scale:4, //按比例增加分辨率
|
|
|
+ dpi: 300, // 将分辨率提高到特定的DPI 提高四倍
|
|
|
+ scale: 4, // 按比例增加分辨率
|
|
|
useCORS: true // 【重要】开启跨域配置
|
|
|
- }).then(function (canvas) {
|
|
|
- var pageData = canvas.toDataURL('image/png', 1.0);
|
|
|
+ }).then(function(canvas) {
|
|
|
+ var pageData = canvas.toDataURL('image/png', 1.0)
|
|
|
that.imgUrl = pageData
|
|
|
})
|
|
|
},
|
|
|
- downloadImg(){
|
|
|
- const el = document.createElement("a");
|
|
|
+ downloadImg() {
|
|
|
+ const el = document.createElement('a')
|
|
|
// 设置 href 为图片经过 base64 编码后的字符串,默认为 png 格式
|
|
|
- el.href = this.$refs.certimg.src;
|
|
|
- el.download = this.htmlTitle;
|
|
|
+ el.href = this.$refs.certimg.src
|
|
|
+ el.download = this.htmlTitle
|
|
|
// 创建一个点击事件并对 a 标签进行触发
|
|
|
- const event = new MouseEvent("click");
|
|
|
+ const event = new MouseEvent('click')
|
|
|
el.dispatchEvent(event)
|
|
|
},
|
|
|
- makeHtml(){
|
|
|
+ makeHtml() {
|
|
|
// js写html代码
|
|
|
- let e = document.getElementById('pdfDomm')
|
|
|
+ const e = document.getElementById('pdfDomm')
|
|
|
this.word = `<div class="proBox" >
|
|
|
<img class="proBox-img z01" src="${window.location.origin}${this.data.backurl}" />
|
|
|
- <div class="con z10" style="width: 64px; height: 83px;overflow: hidden;text-indent: 0;padding-right: 0;top: 133px;left: 182px;">
|
|
|
+ <div class="con z10" style="width: 64px; height: 83px;overflow: hidden;text-indent: 0;padding-right: 0;top: 144px;left: 183px;">
|
|
|
<img src="${window.location.origin}${this.data.headurl}" style="height:100%;position: absolute;left: 50%;transform: translate(-50%, -50%);top: 50%;" />
|
|
|
</div>
|
|
|
<div class="foot-pp z10">
|
|
@@ -303,7 +340,7 @@ export default {
|
|
|
<p class="foot-p-cert ">${this.data.certId}</p>
|
|
|
<p class="foot-p-date ">${this.data.issueDate}</p>
|
|
|
</div>
|
|
|
- <div class="content z10" style="position: absolute;left: 450px;width: 230px;top: 85px;font-size: 19px;line-height: 30px;text-indent: 2em;">
|
|
|
+ <div class="content z10" style="position: absolute;left: 525px;width: 355px;top: 185px;font-size: 19px;line-height: 30px;text-indent: 2em;">
|
|
|
<p style="margin:0">
|
|
|
持证人参加了<span class="heiti" style="margin: 0 15px;font-size: 19px;">${this.data.certName}</span>,已修完教学计划规定的全部课程,合计<span class="heiti" style="margin: 0 15px;font-size: 20px;">${this.data.courseHours}</span>学时。
|
|
|
</p>
|
|
@@ -311,14 +348,325 @@ export default {
|
|
|
</div>
|
|
|
</div>`
|
|
|
e.innerHTML = this.word
|
|
|
+ },
|
|
|
+ toIndex(){
|
|
|
+ this.$router.push('/certInquire')
|
|
|
+ },
|
|
|
+ getWindowInfo(){
|
|
|
+ const windowInfo = {
|
|
|
+ width: window.innerWidth
|
|
|
+ }
|
|
|
+ this.screenWidth = windowInfo.width
|
|
|
+ console.log(this.screenWidth)
|
|
|
+ },
|
|
|
+ debounce(fn, delay){
|
|
|
+ let timer;
|
|
|
+ return function() {
|
|
|
+ if (timer) {
|
|
|
+ clearTimeout(timer);
|
|
|
+ }
|
|
|
+ timer = setTimeout(() => {
|
|
|
+ fn();
|
|
|
+ }, delay);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mydialogshow(val){
|
|
|
+ this.imgShow = val,
|
|
|
+ this.iconShow = false
|
|
|
+ this.getCode()
|
|
|
+ this.userName= ''
|
|
|
+ this.certNumber=''
|
|
|
+ this.code= ''
|
|
|
}
|
|
|
- },
|
|
|
- mounted(){
|
|
|
- this.getCode()
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
+<style lang="scss">
|
|
|
+.height100{
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ text-align: left;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ // margin: 100px auto;
|
|
|
+ // width: 500px;
|
|
|
+ // position: absolute;
|
|
|
+ // left: 50%;
|
|
|
+ // top: 50%;
|
|
|
+ // transform: translate(-50%, -50%);
|
|
|
+}
|
|
|
+.main-content{
|
|
|
+ width: 500px;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+}
|
|
|
+.img-box {
|
|
|
+ width: 360px;
|
|
|
+ height: 80px;
|
|
|
+// background-color: brown;
|
|
|
+ text-align: center;
|
|
|
+ img{
|
|
|
+ height: 100%;
|
|
|
+ transform: scale(1.5);
|
|
|
+ }
|
|
|
+}
|
|
|
+.main-title {
|
|
|
+ width: 360px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.label-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+.label-title {
|
|
|
+ width: 150px;
|
|
|
+ line-height: 22px;
|
|
|
+ flex: 0 0 auto;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.label-input {
|
|
|
+ line-height: 30px;
|
|
|
+ width: 210px;
|
|
|
+ border: 1px solid #50ac55;
|
|
|
+ padding-left: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+}
|
|
|
+.label-must {
|
|
|
+ color: red;
|
|
|
+}
|
|
|
+.btn-box {
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+.btn-box button {
|
|
|
+ width: 140px;
|
|
|
+ height: 40px;
|
|
|
+ margin: 10px;
|
|
|
+}
|
|
|
+.btn-reset {
|
|
|
+ background-color: #f1f2f3;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+.btn-search {
|
|
|
+ background-color: rgb(176,11,17);
|
|
|
+ color: white;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+.captcha-img {
|
|
|
+ width: 120px;
|
|
|
+ // background: antiquewhite;
|
|
|
+ margin: auto;
|
|
|
+ height: 45px;
|
|
|
+}
|
|
|
+.login-code-img{
|
|
|
+ height:45px;
|
|
|
+}
|
|
|
+.activeSpan{
|
|
|
+ color: #50ac55;
|
|
|
+}
|
|
|
+
|
|
|
+.zs-title-img{
|
|
|
+ display: block;
|
|
|
+ margin: auto;
|
|
|
+ height: 75px;
|
|
|
+ transform: scale(1.7);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 0px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+#pdfDomm {
|
|
|
+ /* 要想pdf周边留白,要在这里设置 */
|
|
|
+ /* padding: 20px; */
|
|
|
+ width: 750px;
|
|
|
+ margin: auto;
|
|
|
+}
|
|
|
+.proBox {
|
|
|
+ background-size: cover;
|
|
|
+ width: 750px;
|
|
|
+ height: 525px;
|
|
|
+ padding: 40px 60px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin: 0 auto;
|
|
|
+ position: relative;
|
|
|
+ color: #000;
|
|
|
+ font-family: 楷体;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.proBox-img{
|
|
|
+ width: 750px;
|
|
|
+ height: 525px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+.tit {
|
|
|
+ color: #000;
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: 700;
|
|
|
+ position: relative;
|
|
|
+ top: -6px;
|
|
|
+ left: 8px;
|
|
|
+ letter-spacing: 2px;
|
|
|
+ font-family: STHeiti;
|
|
|
+ margin: 10px 0;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.proid {
|
|
|
+ text-align: right;
|
|
|
+ margin: 0;
|
|
|
+ font-weight: 500;
|
|
|
+ /* margin-right: 5px; */
|
|
|
+}
|
|
|
+.con {
|
|
|
+ font-size: 18px;
|
|
|
+ text-align: left;
|
|
|
+ margin: 10px 0;
|
|
|
+ line-height: 32px;
|
|
|
+ text-indent: 2em;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 265px;
|
|
|
+ margin-top: 30px;
|
|
|
+ padding-right: 80px;
|
|
|
+ left: 88px;
|
|
|
+}
|
|
|
+.con-name {
|
|
|
+ margin-right: 10px;
|
|
|
+ margin-left: 10px;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+.heiti{
|
|
|
+ font-family:黑体 ;
|
|
|
+}
|
|
|
+.con-unit {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 700;
|
|
|
+ position: absolute;
|
|
|
+ right: 45px;
|
|
|
+ bottom: 100px;
|
|
|
+ z-index: 10;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.con-unit p {
|
|
|
+ margin: 5px 0;
|
|
|
+}
|
|
|
+.con-footer {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ right: 45px;
|
|
|
+ bottom: 65px;
|
|
|
+ font-size: 10px;
|
|
|
+ z-index: 10;
|
|
|
+}
|
|
|
+.con-footer p{
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+.chapter {
|
|
|
+ border-radius: 50%;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 45px;
|
|
|
+ right: 40px;
|
|
|
+}
|
|
|
+.cert-msg{
|
|
|
+ font-size: 20px;
|
|
|
+ font-size: 15px;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 50px;
|
|
|
+ left: 90px;
|
|
|
+}
|
|
|
+.foot-term{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 160px;
|
|
|
+ left: 200px;
|
|
|
+}
|
|
|
+.foot-cert{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 130px;
|
|
|
+ left: 200px;
|
|
|
+}
|
|
|
+.foot-date{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 104px;
|
|
|
+ left: 200px;
|
|
|
+}
|
|
|
+.z10{
|
|
|
+ z-index: 10;
|
|
|
+}
|
|
|
+.z01{
|
|
|
+ z-index: 1;
|
|
|
+}
|
|
|
+.foot-pp{
|
|
|
+ position: absolute;
|
|
|
+ top: 273px;
|
|
|
+ left: 161px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 42px;
|
|
|
+ p{
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.back{
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+@media screen and (max-width: 600px) {
|
|
|
+ .main-content{
|
|
|
+ width: 100%;
|
|
|
+ padding: 10px;
|
|
|
+ position: initial;
|
|
|
+ top: initial;
|
|
|
+ left: initial;
|
|
|
+ transform: initial;
|
|
|
+ -webkit-transform: initial;
|
|
|
+ .img-box{
|
|
|
+ width: 98%;
|
|
|
+ img{
|
|
|
+ height: 85%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .label-box{
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ .label-title{
|
|
|
+ text-align: left;
|
|
|
+ width: 100%;
|
|
|
+ .label-title-p{
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .label-input{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .captcha-img{
|
|
|
+ margin:20px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-box{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ }
|
|
|
+ .dialog-box{
|
|
|
+ width: 100%;
|
|
|
+ img{
|
|
|
+ width: 100%;
|
|
|
+ aspect-ratio: auto 750 / 525;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .back{
|
|
|
+ justify-content: flex-start;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|