Commit 9b1a2ee6 authored by zhangderong's avatar zhangderong

PDF展示原件测试

parent 09add4c6
...@@ -131,4 +131,18 @@ export function forwardResume(params) { ...@@ -131,4 +131,18 @@ export function forwardResume(params) {
'Content-Type':'application/json' 'Content-Type':'application/json'
}}) }})
} }
export function getPdf(parmars) {
return axios.get(`${sapi}/api/resume/getResumePdfByResumeId/${parmars.uid}`,{
responseType: 'arraybuffer',
headers: {
'Content-Type':'application/json'
}
})
}
// 是否展示原件的PDF
export function isShowPDF(parmars) {
return axios.get(`${sapi}/api/resume//isShowOriPdf/${parmars.uid}`, {headers: {
'Content-Type':'application/json'
}})
}
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
<span style="margin-left:10px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer" @click="Seedetail(item.id, item.uid,item.flowStatus)">{{item.ownerName}} |</span> <span style="margin-left:10px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer" @click="Seedetail(item.id, item.uid,item.flowStatus)">{{item.ownerName}} |</span>
<span @click="Seedetail(item.id, item.uid ,item.flowStatus)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer">{{item.ownerMobile}} |</span> <span @click="Seedetail(item.id, item.uid ,item.flowStatus)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;cursor:pointer">{{item.ownerMobile}} |</span>
<span @click="Seedetail(item.id, item.uid,item.flowStatus)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;width:20%;cursor:pointer">{{item.ownerExpectTitles}}</span> <span @click="Seedetail(item.id, item.uid,item.flowStatus)" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;display:inline-block;width:20%;cursor:pointer">{{item.ownerExpectTitles}}</span>
<span style="color:#2d8cf0;float:right;margin-right:35px;cursor:pointer" @click="updateInterview(item.id,item.interviewerName,item.seeTime,item.inviterName)">更改约面信息</span> <span style="color:#2d8cf0;float:right;margin-right:5%;cursor:pointer" @click="updateInterview(item.id,item.interviewerName,item.seeTime,item.inviterName)">更改约面信息</span>
</p> </p>
<p style="margin-top:8px;color:Grey"> <p style="margin-top:8px;color:Grey">
<span style="margin-left:10px;display:inline-block;width:22%;">邀约人: {{item.inviterName}} </span> <span style="margin-left:10px;display:inline-block;width:22%;">邀约人: {{item.inviterName}} </span>
<span style="margin-left:7%;display:inline-block;width:22%;">面试官: {{item.interviewerName}}</span> <span style="margin-left:7%;display:inline-block;width:22%;">面试官: {{item.interviewerName}}</span>
<span style="float:right;margin-right:35px">面试时间:{{ item.seeTime}}</span> <span style="float:right;margin-right:5%">面试时间:{{ item.seeTime}}</span>
</p> </p>
</div> </div>
<div class="contentState"> <div class="contentState">
...@@ -768,6 +768,7 @@ font-size: 14px; ...@@ -768,6 +768,7 @@ font-size: 14px;
width:100%; width:100%;
background:#EDEDED; background:#EDEDED;
overflow: hidden; overflow: hidden;
min-width: 1200px;
} }
.interview-left{ .interview-left{
height:100%; height:100%;
......
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
<Button type='primary' @click='emailModalPush'>取消</Button> <Button type='primary' @click='emailModalPush'>取消</Button>
<Button type='primary' @click='submit' v-show="this.isShowAll==false">发送</Button> <Button type='primary' @click='submit' v-show="this.isShowAll==false">发送</Button>
<Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button> <Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button>
<Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> <!-- <Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> -->
</div> </div>
</Modal> </Modal>
<Modal <Modal
......
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
<Button type='primary' @click='emailModalPush'>取消</Button> <Button type='primary' @click='emailModalPush'>取消</Button>
<Button type='primary' @click='submit' v-show="this.isShowAll==false">发送</Button> <Button type='primary' @click='submit' v-show="this.isShowAll==false">发送</Button>
<Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button> <Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button>
<Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> <!-- <Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> -->
</div> </div>
</Modal> </Modal>
<Modal <Modal
......
<template> <template>
<div class="resumeDetail"> <div class="resumeDetail">
<div class="resumeDetail-left"> <div class="pdfShow" v-if="isShowPdf==true">
<div id="container" style="width:100%;height:100%" v-if="isShowPdf==true"></div>
</div>
<div class="resumeDetail-left" v-if="isShowPdf==false">
<div class="personalInformation" v-show="JSON.stringify(resume)!=='{}'"> <div class="personalInformation" v-show="JSON.stringify(resume)!=='{}'">
<p class="detailTitel"> <p class="detailTitel">
<span> <span>
...@@ -137,6 +140,8 @@ ...@@ -137,6 +140,8 @@
</div> </div>
<div class="resumeDetail-right" v-show="this.showBtn!=1"> <div class="resumeDetail-right" v-show="this.showBtn!=1">
<div class="testResume"> <div class="testResume">
<Button type="primary" size='small' style="width:150px;height:34px;margin:20px 0 0 15px;font-size:14px" :disabled="showOriginalDisabled" @click="showOriginal" v-if="resumeBTn==true" >原始简历</Button><br>
<Button type="primary" size='small' style="width:150px;height:34px;margin:20px 0 20px 15px;font-size:14px" :disabled="showStandardDisabled" @click="showStandard" >标准简历</Button><br>
<Button type="primary" size='small' style="width:150px;height:34px;margin:0 0 0 15px;font-size:14px" @click="downloadONE(detialID)" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</Button><br> <Button type="primary" size='small' style="width:150px;height:34px;margin:0 0 0 15px;font-size:14px" @click="downloadONE(detialID)" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</Button><br>
<Button type="primary" size='small' style="width:150px;height:34px;margin:20px 0 0 15px;font-size:14px" @click="transpond" >转发给面试官</Button><br> <Button type="primary" size='small' style="width:150px;height:34px;margin:20px 0 0 15px;font-size:14px" @click="transpond" >转发给面试官</Button><br>
<p style="margin-top:40px;font-size:16px">当前简历状态:<span style="color:#0092FF" >{{detailStatus[detailSta]}}</span></p> <p style="margin-top:40px;font-size:16px">当前简历状态:<span style="color:#0092FF" >{{detailStatus[detailSta]}}</span></p>
...@@ -225,7 +230,7 @@ ...@@ -225,7 +230,7 @@
<Button type='primary' @click='emailModalPush'>取消</Button> <Button type='primary' @click='emailModalPush'>取消</Button>
<Button type='primary' @click='submit'>发送</Button> <Button type='primary' @click='submit'>发送</Button>
<!-- <Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button> --> <!-- <Button type='primary' @click='submit' v-show="this.isShowAll==true">添加并发送</Button> -->
<Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> <!-- <Checkbox v-model="formInline.sendWeixin" class='wechat'><span>微信通知面试官</span></Checkbox> -->
</div> </div>
</Modal> </Modal>
<Modal <Modal
...@@ -315,7 +320,9 @@ ...@@ -315,7 +320,9 @@
</template> </template>
<script> <script>
import moment from 'moment' import moment from 'moment'
import {seedetail,updatastatus,TODORes,sendEmail,getEmailMoo,getEmailContent,uploadimage, findCompanyEmailByKey,forwardResume} from '../../api/resume.server' // import moment from '../../../static/1.pdf'
require('../../../static/pdf/pdf.js')
import {seedetail,updatastatus,TODORes,sendEmail,getEmailMoo,getEmailContent,uploadimage, findCompanyEmailByKey,forwardResume,getPdf,isShowPDF} from '../../api/resume.server'
import localStorage from '../../service/localstorage.service.js' import localStorage from '../../service/localstorage.service.js'
import { import {
sapi sapi
...@@ -341,6 +348,10 @@ export default { ...@@ -341,6 +348,10 @@ export default {
modal12:false, modal12:false,
modal13:false, modal13:false,
boxIsShow:false, boxIsShow:false,
resumeBTn:false,
isShowPdf:true,
showOriginalDisabled:true,
showStandardDisabled:false,
errorMassage:'', errorMassage:'',
interviewee: [], interviewee: [],
contentName:'', contentName:'',
...@@ -439,6 +450,70 @@ export default { ...@@ -439,6 +450,70 @@ export default {
this.reList=res.data.body.reList this.reList=res.data.body.reList
this.name=res.data.body.resume.ownerName this.name=res.data.body.resume.ownerName
}) })
},
clearPDF: function () {
document.getElementById("container").innerHTML = "";
},
// 渲染合同
renderPDF: function (pdf, pageNumber) {
pdf.getPage(pageNumber).then(function (page) {
var scale = 1.5; //随意设置的
var viewport = page.getViewport(scale);
// Prepare canvas using PDF page dimensions
// var canvas = document.getElementById('the-canvas');
var canvas = document.createElement('canvas');
canvas.setAttribute("id", "the-canvas-" + pageNumber);
var element = document.getElementById("container");
element.appendChild(canvas);
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
// Render PDF page into canvas context
var renderContext = {
canvasContext: context,
viewport: viewport
};
var renderTask = page.render(renderContext);
renderTask.then(function () {
console.log('Page rendered');
});
});
},
// 展示合同
showPDF : function (data) {
let vm = this
if (data) {
var obj = {
// url: '../../static/test.pdf', // 得到的是数据时使用data属性
data:data,
cMapUrl: 'https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/cmaps/',
cMapPacked: true
};
PDFJS.workerSrc = '../../static/pdf/pdf.worker.js'
var loadingTask = PDFJS.getDocument(obj);
loadingTask.promise.then(function(pdf) {
var total = pdf.numPages;
for (var i = 0; i < total; i++) {
var pageNumber = i + 1;
// 如果你有node(vue ag...)环境,那么请用async/await替换掉
setTimeout(vm.renderPDF(pdf, pageNumber), 10);
}
}, function (reason) {
// PDF loading error
console.error(reason);
});
}
},
getData(){
let params = {
uid:this.$route.query.id
}
getPdf(params).then(data => { // 调接口获取数据(二进制流数据)
this.clearPDF();
let vm =this
var array = new Uint8Array(data.data);// 将二进制流数据转换成 Uint8Array (pdf支持的数据格式)
vm.showPDF(array)
})
}, },
// 下载简历 // 下载简历
downloadONE(doid){ downloadONE(doid){
...@@ -671,6 +746,35 @@ export default { ...@@ -671,6 +746,35 @@ export default {
}, },
delInterviewee(name){ delInterviewee(name){
this.contentName='' this.contentName=''
},
showOriginal(){
this.getData()
this.showPDF()
this.isShowPdf=true
this.showOriginalDisabled=true
this.showStandardDisabled=false
},
showStandard(){
this.isShowPdf=false
// this.showOriginalDisabled=false
console.log(84377847)
this.clearPDF()
this.showStandardDisabled=true
this.showOriginalDisabled=false
},
judeShowPdf(){
let parmars={
uid:this.$route.query.id
}
isShowPDF(parmars).then(res=>{
if(res.data.body==true){
this.isShowPdf=true
this.resumeBTn=true
}else{
this.isShowPdf=false
this.resumeBTn=false
}
})
}, },
// 确认发送邮件 // 确认发送邮件
// _debounce(confireSendEmail,500), // _debounce(confireSendEmail,500),
...@@ -869,14 +973,16 @@ export default { ...@@ -869,14 +973,16 @@ export default {
}, },
remove(){ remove(){
document.querySelector('#app').style.removeProperty('overflow-x') document.querySelector('#app').style.removeProperty('overflow-x')
} }
}, },
mounted(){ async mounted(){
this.getDETAIL() this.getDETAIL()
this.boxIsShow=true this.boxIsShow=true
this.judeBtn() this.judeBtn()
this.addCss() this.addCss()
this.getData()
this.clearPDF()
await this.judeShowPdf()
}, },
beforeDestroy(){ beforeDestroy(){
this.remove() this.remove()
...@@ -896,6 +1002,12 @@ export default { ...@@ -896,6 +1002,12 @@ export default {
min-height: 200px min-height: 200px
/* border: 1px solid #999 */ /* border: 1px solid #999 */
} }
.pdfShow{
float: left;
width:860px;
min-height: 200px;
/* border: 1px solid black */
}
.pic img{ .pic img{
width: 60px; width: 60px;
height: 60px height: 60px
...@@ -913,7 +1025,7 @@ export default { ...@@ -913,7 +1025,7 @@ export default {
/* margin-left: 200px */ /* margin-left: 200px */
} }
.resumeDetail-right{ .resumeDetail-right{
float: left; float: right;
width: 230px; width: 230px;
} }
.wechat{ .wechat{
...@@ -942,24 +1054,26 @@ export default { ...@@ -942,24 +1054,26 @@ export default {
} }
.bassMassage{ .bassMassage{
display: inline-block; display: inline-block;
width: 322px; width: 360px;
float: left; float: left;
margin-left:30px; margin-left:30px;
font-size: 14px; font-size: 14px;
margin-top:20px margin-top:20px;
/* border:1px solid black; */
} }
.bassMassageRight{ .bassMassageRight{
display: inline-block; display: inline-block;
width: 322px; width: 360px;
float: left; float: left;
font-size: 14px; font-size: 14px;
margin-top:20px; margin-top:20px;
margin-left:20px; margin-left:20px;
/* border:1px solid black; */
} }
.testResume{ .testResume{
position: fixed; position: fixed;
/* float: left; */ /* float: left; */
top: 280px; top: 20%;
width: 200px; width: 200px;
/* border: 1px solid black; */ /* border: 1px solid black; */
margin-left: 20px margin-left: 20px
......
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
<img :src="url" style="width:100%;height:100%"> <img :src="url" style="width:100%;height:100%">
</div> </div>
<p class="xiazai" @click="downPic">下载</p> <p class="xiazai" @click="downPic">下载</p>
<!-- <p style="margin-top:40px"><span>请点击&nbsp;</span>
<a href="http://192.168.28.10:7086/acceptInterview?isResufe=false"
style="text-decoration:none;width:100px;height:30px;background:#0092ff;color:white;display:inline-block; text-align: center;line-height:30px;border-radius:5px!important">接受面试安排</a>&nbsp;
<a href="http://192.168.28.10:7086/acceptInterview?isResufe=true"
style="text-decoration:none;width:100px;height:30px;display:inline-block; text-align: center;line-height:30px;border-radius:5px!important;border:1px solid #0092ff;">拒绝面试安排</a>&nbsp;
<span>将您的反馈告知我们。</span>
</p> -->
</div> </div>
</template> </template>
<script> <script>
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
:class="['prefixCls' + '-input']" :class="['prefixCls' + '-input']"
@change="handleChange" @change="handleChange"
:multiple="true" :multiple="true"
:format="['html','doc','pdf','txt','docx']" :format="['word','pdf']"
:accept="accept" :accept="accept"
> >
<Button @click='selFiles' style='width:20%;margin-top:40px;margin-left:-4px;color:black'>选择文件</Button> <Button @click='selFiles' style='width:20%;margin-top:40px;margin-left:-4px;color:black'>选择文件</Button>
<div class='contentTips'> <div class='contentTips'>
<p style="font-size:12px;margin-left:5%;text-align:left;height:40px;line-height:40px;width:90%;display:inline-block;margin-top:30px">单个文件不能大于2MB,支持html,doc,docx,txt,pdf等格式,暂时不支持压缩格式</p> <p style="font-size:12px;margin-left:5%;text-align:center;height:40px;line-height:40px;width:90%;display:inline-block;margin-top:30px">单个文件不能大于2MB,仅支持word,pdf格式,暂时不支持压缩格式</p>
<p style="font-size:12px;margin-left:2%;text-align:center;height:40px;line-height:40px;width:90%">支持最多二十份简历批量上传</p> <p style="font-size:12px;margin-left:2%;text-align:center;height:40px;line-height:40px;width:90%">支持最多二十份简历批量上传</p>
</div> </div>
<Button @click='uploadBtn' style='width:20%;margin-left:38%;margin-top:30px' type='primary'>上传</Button> <Button @click='uploadBtn' style='width:20%;margin-left:38%;margin-top:30px' type='primary'>上传</Button>
...@@ -227,7 +227,7 @@ import {uploadFile} from '../../service/ajax' ...@@ -227,7 +227,7 @@ import {uploadFile} from '../../service/ajax'
filetile:'上传中请稍后...', filetile:'上传中请稍后...',
totalSize:null, totalSize:null,
uploadModal: false, uploadModal: false,
accept: '.html,.doc,.docx,.txt,.pdf', accept: '.word,.pdf',
fileSize:2048, fileSize:2048,
progressStatus: { progressStatus: {
'0': 'active', '0': 'active',
...@@ -399,8 +399,8 @@ import {uploadFile} from '../../service/ajax' ...@@ -399,8 +399,8 @@ import {uploadFile} from '../../service/ajax'
}, },
// 获取上传批次号 // 获取上传批次号
getnumber(){ getnumber(){
getuploadNumber().then(res=>{ return getuploadNumber().then(res=>{
this.batchNum=res.data.body this.batchNum= res.data.body
}) })
}, },
//改变页码 //改变页码
...@@ -417,6 +417,7 @@ import {uploadFile} from '../../service/ajax' ...@@ -417,6 +417,7 @@ import {uploadFile} from '../../service/ajax'
page = typeof(page)=='number'?page:1 page = typeof(page)=='number'?page:1
this.searchInfo.pageIndex = page this.searchInfo.pageIndex = page
this.pageIndex = page this.pageIndex = page
console.log(this.batchNum,899898989)
let parmars={ let parmars={
pageSize:this.searchInfo.pageSize, pageSize:this.searchInfo.pageSize,
pageIndex:this.searchInfo.pageIndex, pageIndex:this.searchInfo.pageIndex,
...@@ -479,9 +480,9 @@ import {uploadFile} from '../../service/ajax' ...@@ -479,9 +480,9 @@ import {uploadFile} from '../../service/ajax'
}) })
}, },
}, },
mounted(){ async mounted(){
this.getnumber() await this.getnumber()
this. serchlist() this.serchlist()
} }
} }
</script> </script>
......
...@@ -17,7 +17,6 @@ const upload = r => require.ensure([], () => r(require('@/page/upload/upload.vue ...@@ -17,7 +17,6 @@ const upload = r => require.ensure([], () => r(require('@/page/upload/upload.vue
const sweepCode = r => require.ensure([], () => r(require('@/page/sweepCode/sweepCode.vue')), 'sweepCode'); const sweepCode = r => require.ensure([], () => r(require('@/page/sweepCode/sweepCode.vue')), 'sweepCode');
const editor = r => require.ensure([], () => r(require('@/components/editor.vue')), 'editor'); const editor = r => require.ensure([], () => r(require('@/components/editor.vue')), 'editor');
const getimage = r => require.ensure([], () => r(require('@/components/getimage.vue')), 'getimage'); const getimage = r => require.ensure([], () => r(require('@/components/getimage.vue')), 'getimage');
//z注释 //z注释
Vue.use(Router); Vue.use(Router);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment