From 7b2da02c8024f4abf0abb4cb23130a82a88f68a1 Mon Sep 17 00:00:00 2001 From: zengwh <81383286@qq.com> Date: Tue, 23 Jun 2020 13:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E5=8D=B0=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=B9=B6=E4=BF=AE=E6=AD=A3=E7=9B=91=E6=8E=A7=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E4=B8=8B=E8=BD=BD=E9=87=8F=E6=95=B0=E9=87=8F=E6=94=B9?= =?UTF-8?q?=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/emr/controller/DelPrintPicQuartz.java | 29 + .../commomSearch/CommomSearchController.java | 19 +- .../monitoringCenterController.java | 5 +- .../TemplateSearchController.java | 2 +- .../EmrPrintDownloadInfoMapper.java | 2 +- .../java/com/emr/service/CommomService.java | 18 +- .../PrintOrDownLoadInfoService.java | 6 + .../mapper/commomSearch/ScanPathMapper.xml | 24 +- .../EmrPrintDownloadInfoMapper.xml | 5 +- .../commomSearch/showRecordIframeBlood.jsp | 26 +- .../static/js/font/showRecordIframeBlood.js | 1 - .../js/font/showRecordIframeBloodCommom.js | 7 - .../commomSearch/showRecordIframeBlood.js | 122 ++- src/main/webapp/static/pdfjs/Print.js | 207 ++-- .../webapp/static/pdfjs/web/printLoading.css | 80 ++ src/main/webapp/static/pdfjs/web/viewer1.html | 911 ++++++++++-------- src/main/webapp/static/pdfjs/web/viewer1.js | 24 +- 17 files changed, 851 insertions(+), 637 deletions(-) create mode 100644 src/main/java/com/emr/controller/DelPrintPicQuartz.java create mode 100644 src/main/webapp/static/pdfjs/web/printLoading.css diff --git a/src/main/java/com/emr/controller/DelPrintPicQuartz.java b/src/main/java/com/emr/controller/DelPrintPicQuartz.java new file mode 100644 index 0000000..23cf384 --- /dev/null +++ b/src/main/java/com/emr/controller/DelPrintPicQuartz.java @@ -0,0 +1,29 @@ +package com.emr.controller; + +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.io.File; + +/** + * 每天清除打印预览缓存图片 + * @author Mr Du + * + */ + +@Component +public class DelPrintPicQuartz { + @Value("${waterPicPath}") + private String WATERPICPATH; + /** + * cron表达式:* * * * * *(共6位,使用空格隔开,具体如下) + * cron表达式:*(秒0-59) *(分 钟0-59) *(小时0-23) *(日期1-31) *(月份1-12或是JAN-DEC) *(星期1-7或是SUN-SAT) + */ + @Scheduled(cron="0 0 0 * * ?") + public void clearPrintPic() throws Exception{ + FileUtils.deleteDirectory(new File(WATERPICPATH)); + } + +} diff --git a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java index c6679aa..0c7503a 100644 --- a/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java +++ b/src/main/java/com/emr/controller/commomSearch/CommomSearchController.java @@ -463,7 +463,7 @@ public class CommomSearchController { * @return */ @RequestMapping("showRecordIframeBlood") - public String showRecordIframeBlood(String patientId,Model model, HttpServletRequest request) { + public String showRecordIframeBlood(String patientId,String flag,Model model, HttpServletRequest request) { model.addAttribute("patientId", patientId); Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER"); //打印分类集合 @@ -487,6 +487,7 @@ public class CommomSearchController { } } model.addAttribute("printFlag", printFlag); + model.addAttribute("flag", flag); return "recordManage/commomSearch/showRecordIframeBlood"; } @@ -765,11 +766,23 @@ public class CommomSearchController { */ @RequestMapping(value="selectPrintPic",method = RequestMethod.POST) @ResponseBody - public ResultUtil selectPrintPic(String patientId,String rootPaths,String names,String sources) throws Exception{ - List outs = commomService.selectPrintPic(patientId,rootPaths,names,sources); + public ResultUtil selectPrintPic(String patientId,String rootPaths,String names,String sources,HttpServletRequest request) throws Exception{ + //生成加载进度mapKey + Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + String mapKey = user.getUserName() + "_" + patientId; + List outs = commomService.selectPrintPic(patientId,rootPaths,names,sources,mapKey); return ResultUtil.ok(outs); } + @RequestMapping("getPrintPicLoading") + @ResponseBody + public ResultUtil getPrintPicLoading(String patientId,HttpServletRequest request) throws Exception{ + Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + String mapKey = user.getUserName() + "_" + patientId; + Integer loadingInteger = commomService.getPrintPicLoading(mapKey); + return ResultUtil.ok(loadingInteger); + } + /** * 英德分段计算页数 * @param patientId diff --git a/src/main/java/com/emr/controller/otherManage/monitoringCenterController.java b/src/main/java/com/emr/controller/otherManage/monitoringCenterController.java index ef7c6e4..70dc12c 100644 --- a/src/main/java/com/emr/controller/otherManage/monitoringCenterController.java +++ b/src/main/java/com/emr/controller/otherManage/monitoringCenterController.java @@ -6,6 +6,7 @@ import com.emr.dao.approve.Emr_Apply_ApproveMapper; import com.emr.dao.emrPrintAndDownLoad.EmrPrintDownloadInfoMapper; import com.emr.dao.recordLock.Emr_LockMapper; import com.emr.entity.approve.Emr_Apply_Approve; +import com.emr.vo.EmrPrintOrDownLoadInfo.EmrPrintOrDownLoadInfoVo; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -44,7 +45,7 @@ public class monitoringCenterController { public String monitoringCenter(Model model){ int applyApproveNum = 0; int applyApproveNullNum = 0; - int emrDownloadInfoNum = emrPrintDownloadInfoMapper.selectAllCount(); + List emrPrintOrDownLoadInfoVos = emrPrintDownloadInfoMapper.selectAllCount(); int commomNum = commomMapper.selectCommomCount(); int lockNum = emrLockMapper.selectCountLocking(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -70,7 +71,7 @@ public class monitoringCenterController { } model.addAttribute("applyApproveNum", applyApproveNum); model.addAttribute("applyApproveNullNum", applyApproveNullNum); - model.addAttribute("emrDownloadInfoNum", emrDownloadInfoNum); + model.addAttribute("emrDownloadInfoNum", emrPrintOrDownLoadInfoVos.size()); model.addAttribute("commomNum", commomNum); model.addAttribute("lockNum", lockNum); return "otherManage/monitoringCenter"; diff --git a/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java b/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java index 57cd6f7..7a06537 100644 --- a/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java +++ b/src/main/java/com/emr/controller/templateSearch/TemplateSearchController.java @@ -1368,7 +1368,7 @@ public class TemplateSearchController { } } List scanPathVos = scanPathMapper.selectScanFileByBloodPatientIds(patientIds,assortIds,flag); - //批量添加下载记录 + //批量添加打印记录 printOrDownLoadInfoService.SimpleInsert(scanPathVos,typeId,Short.valueOf("1")); }catch (Exception e){ e.printStackTrace(); diff --git a/src/main/java/com/emr/dao/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.java b/src/main/java/com/emr/dao/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.java index fa40458..e523e9d 100644 --- a/src/main/java/com/emr/dao/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.java +++ b/src/main/java/com/emr/dao/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.java @@ -24,6 +24,6 @@ public interface EmrPrintDownloadInfoMapper { * 获取下载记录数 * @return */ - int selectAllCount(); + List selectAllCount(); } \ No newline at end of file diff --git a/src/main/java/com/emr/service/CommomService.java b/src/main/java/com/emr/service/CommomService.java index c6daa4a..96b04b1 100644 --- a/src/main/java/com/emr/service/CommomService.java +++ b/src/main/java/com/emr/service/CommomService.java @@ -54,6 +54,8 @@ import java.util.*; */ @Component public class CommomService { + //定义打印预览加载进度map + private static Map printLoadingMap = new HashMap<>(); @Value("${POWER_URLHEAD}") private String POWER_URLHEAD; @Value("${waterPicPath}") @@ -377,7 +379,7 @@ public class CommomService { * @param sources * @return */ - public List selectPrintPic(String patientId, String rootPaths, String names, String sources) { + public List selectPrintPic(String patientId, String rootPaths, String names, String sources,String mapKey) { List outs = new LinkedList<>(); if(StringUtils.isNotBlank(names)){ String[] rootPathList = rootPaths.split(","); @@ -431,6 +433,8 @@ public class CommomService { outSrc = EMRRECORDJSP + "\\" + root + picPath; } outs.add(outSrc); + Integer value = Math.round((i+1)*100/nameList.length); + printLoadingMap.put(mapKey,value); } } return outs; @@ -466,4 +470,16 @@ public class CommomService { } return null; } + + public Integer getPrintPicLoading(String mapKey) { + Integer loadingPerson = printLoadingMap.get(mapKey); + if(loadingPerson == null){ + //为空返回0 + return 0; + }else if(loadingPerson == 100){ + //完成后移除内存 + printLoadingMap.remove(mapKey); + } + return loadingPerson; + } } diff --git a/src/main/java/com/emr/service/emrPrintOrDownLoadInfo/PrintOrDownLoadInfoService.java b/src/main/java/com/emr/service/emrPrintOrDownLoadInfo/PrintOrDownLoadInfoService.java index a95f1b9..a4f1068 100644 --- a/src/main/java/com/emr/service/emrPrintOrDownLoadInfo/PrintOrDownLoadInfoService.java +++ b/src/main/java/com/emr/service/emrPrintOrDownLoadInfo/PrintOrDownLoadInfoService.java @@ -97,11 +97,15 @@ public class PrintOrDownLoadInfoService { *按条件查询 * */ public List selectAll(EmrPrintOrDownLoadInfoVo emrPrintOrDownLoadInfoVo,String flag){ + long start = System.currentTimeMillis(); List list = printDownloadInfoMapper.selectAll(emrPrintOrDownLoadInfoVo,flag); + long end = System.currentTimeMillis(); + System.out.println("查询用时:"+(end-start)/1000.0+"s"); return getReturnList(list); } //组织数据 private List getReturnList(List list){ + long start = System.currentTimeMillis(); List returnList = new ArrayList<>(); if(null != list && !list.isEmpty()){ Map map = new LinkedHashMap<>(); @@ -138,6 +142,8 @@ public class PrintOrDownLoadInfoService { returnList.add(emrPrintOrDownLoadInfoVo); } } + long end = System.currentTimeMillis(); + System.out.println("组织用时:"+(end-start)/1000.0+"s"); return returnList; } /** diff --git a/src/main/resources/mapper/commomSearch/ScanPathMapper.xml b/src/main/resources/mapper/commomSearch/ScanPathMapper.xml index f8c4132..92f24d9 100644 --- a/src/main/resources/mapper/commomSearch/ScanPathMapper.xml +++ b/src/main/resources/mapper/commomSearch/ScanPathMapper.xml @@ -9,7 +9,7 @@ - + - + - - \ No newline at end of file diff --git a/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml b/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml index a2d2b2f..bb786ce 100644 --- a/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml +++ b/src/main/resources/mapper/emrPrintAndDownLoad/EmrPrintDownloadInfoMapper.xml @@ -199,9 +199,9 @@ emr_print_download_info.create_time DESC - SELECT - COUNT(*) + COUNT(emr_print_download_info.patient_id) printCount FROM emr_print_download_info INNER JOIN commomtable ON emr_print_download_info.patient_id = commomtable.patient_id @@ -209,5 +209,6 @@ INNER JOIN zd_assort ON emr_print_download_info.assort_id = zd_assort.assort_id WHERE emr_print_download_info.oper_type = 2 + GROUP BY emr_print_download_info.create_time,emr_print_download_info.creater \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/recordManage/commomSearch/showRecordIframeBlood.jsp b/src/main/webapp/WEB-INF/views/recordManage/commomSearch/showRecordIframeBlood.jsp index 479bb18..a355fc6 100644 --- a/src/main/webapp/WEB-INF/views/recordManage/commomSearch/showRecordIframeBlood.jsp +++ b/src/main/webapp/WEB-INF/views/recordManage/commomSearch/showRecordIframeBlood.jsp @@ -44,18 +44,26 @@ - - - - + + + + + + + + + + - + - + - + - + + +
@@ -68,7 +76,7 @@
- +
diff --git a/src/main/webapp/static/js/font/showRecordIframeBlood.js b/src/main/webapp/static/js/font/showRecordIframeBlood.js index 97d5b32..78d2f03 100644 --- a/src/main/webapp/static/js/font/showRecordIframeBlood.js +++ b/src/main/webapp/static/js/font/showRecordIframeBlood.js @@ -132,7 +132,6 @@ function onloadJpgForPdf(){ } //记录打印记录 function printInfoBlood(){ - alert(2) var patientId = "'"+$("#patientId").val()+"'"; var assortIds = $("#assortIds").val(); var typeId = $("#typeId").val(); diff --git a/src/main/webapp/static/js/font/showRecordIframeBloodCommom.js b/src/main/webapp/static/js/font/showRecordIframeBloodCommom.js index d6c3793..a85058e 100644 --- a/src/main/webapp/static/js/font/showRecordIframeBloodCommom.js +++ b/src/main/webapp/static/js/font/showRecordIframeBloodCommom.js @@ -119,13 +119,6 @@ function onCheck(e, treeId, treeNode) { $("#typeId").change(function(){ menu.loadMenuTree(); }) -//记录打印记录 -function printInfoBlood(){ - var patientId = "'"+$("#patientId").val()+"'"; - var assortIds = $("#assortIds").val(); - var typeId = $("#typeId").val(); - post(path+'/template/printInfoBlood',{"patientIds":patientId,"assortIds":assortIds,"typeId":typeId}); -} //确定按钮功能 function sure(){ Common.confirm({ diff --git a/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js b/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js index b89c26b..0d33312 100644 --- a/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js +++ b/src/main/webapp/static/js/recordManage/commomSearch/showRecordIframeBlood.js @@ -32,19 +32,19 @@ var menu = { $("#assortIds").val(""); if(data != null){ //图片相对路径集合 - var assortIds = ''; + var scanPages = ''; //图片来源集合 var sources = ''; for (var i = 0; i < data.length; i++) { if(data[i].parentId != null && data[i].parentId != 1 && data[i].checked == 'true'){ - assortIds += data[i].assortName+","; + scanPages += data[i].assortName+","; sources += data[i].source + ","; } } //去掉后面逗号 - if(assortIds != ''){ - assortIds = assortIds.substring(0,assortIds.length-1); - $("#assortIds").val(assortIds); + if(scanPages != ''){ + scanPages = scanPages.substring(0,scanPages.length-1); + $("#assortIds").val(scanPages); sources = sources.substring(0,sources.length-1); $("#sources").val(sources); } @@ -55,7 +55,7 @@ var menu = { zTree.expandNode(nodes[i], true, false, true); } //加载pdf - onloadPdf(); + onloadPdf(scanPages,sources); } } }) @@ -92,41 +92,42 @@ function onClick(e, treeId, treeNode) { var treeLevel = treeNode.level; //选中图片节点时 if(treeLevel == 2){ - //加载pdf - var patientId = $("#patientId").val(); //图片集合 var scanPages = treeNode.assortName; //来源集合 var sources = treeNode.source; - //根目录字段识别名称 - var flag = parent.$("#flag").val(); - var str= path+"/commom/showRecordContentBlood?patientId="+patientId+"&scanPages="+scanPages+"&sources="+sources+"&flag="+flag; - $("#iframe1").attr("src",path+"/static/pdfjs/web/viewer1.html?file="+encodeURIComponent(str)); + $("#assortIdByClick").val(scanPages); + $("#sourceByClick").val(sources); + onloadPdf(scanPages,sources); } }; //打印分类变更事件 $("#typeId").change(function(){ menu.loadMenuTree(); }) + +//树复选框选中后加载pdf按钮 +function onloadPdfMethod(){ + var scanPages = $("#assortIds").val(); + //来源集合 + var sources = $("#sources").val(); + $("#assortIdByClick").val(""); + $("#sourceByClick").val(""); + onloadPdf(scanPages,sources); +} //加载pdf按钮功能 -function onloadPdf(){ +function onloadPdf(scanPages,sources){ $("#iframeLoad").val(""); $("#printPicLoaded").val(""); - if($("#iframeLoad").val() == 1) { - window.frames['iframe1'].contentDocument.getElementById("printContainer1").innerHTML = ''; - } var patientId = $("#patientId").val(); - //图片集合 - var scanPages = $("#assortIds").val(); - //来源集合 - var sources = $("#sources").val(); //根目录字段识别名称 var flag = parent.$("#flag").val(); var str= path+"/commom/showRecordContentBlood?patientId="+patientId+"&scanPages="+scanPages+"&sources="+sources+"&flag="+flag; $("#iframe1").attr("src",path+"/static/pdfjs/web/viewer1.html?file="+encodeURIComponent(str)); var rootPaths = parent.$("#rootPaths").val(); - //获取加水印后的图片 - if(scanPages != ''){ + //加载的图片 + var print = $("#print").val(); + if(scanPages != '' && print == 1){ selectPrintPic(patientId,rootPaths,scanPages,sources); } } @@ -134,6 +135,7 @@ function onloadPdf(){ /** * 加载打印预览所需图片 */ +//定义打印预览加载图片进度 function selectPrintPic(patientId,rootPaths,scanPages,sources){ $.ajax({ type:'post', @@ -153,17 +155,42 @@ function selectPrintPic(patientId,rootPaths,scanPages,sources){ for (var i = 0; i < resultList.length; i++) { img += ""; } - setInterval(function () { - if($("#iframeLoad").val() == 1 && $("#printPicLoaded").val() != 1) { + var interval = setInterval(function () { + if($("#iframeLoad").val() == 1) { window.frames['iframe1'].contentDocument.getElementById("printContainer1").innerHTML = img; $("#printPicLoaded").val(1); + window.frames['iframe1'].contentDocument.getElementById("printLoading").style.display = 'none'; + window.frames['iframe1'].contentDocument.getElementById("print").style.display = 'block'; + clearInterval(interval); } - },1*1000); - + },200); } + }else{ + toastr.error(data.msg); } } }) + //查询进度定时器 + var interval1 = setInterval(function () { + $.ajax({ + type:'get', + url:path+"/commom/getPrintPicLoading", + data:{patientId:$("#patientId").val()}, + dataType:'json', + success:function(data){ + if(data.code == 0){ + var value = data.data; + $("#loading").val(value+"%"); + if(value == 100){ + //杀死进度定时器 + clearInterval(interval1); + } + }else{ + toastr.error(data.msg); + } + } + }) + },100); } var iframe = window.frames['iframe1']; if(iframe.attachEvent){ @@ -190,23 +217,23 @@ function onloadJpgForPdf(){ if(typeId == undefined){ typeId = ''; } - Common.confirm({ - title: "提示", - message: "确认将左侧树选中的图片下载pdf?", - operate: function (reselt) { - if (reselt) { - var patientId = "'" + $("#patientId").val() + "'"; - var assortIds = $("#assortIds").val(); - var flag = parent.$("#flag").val(); - post(path + '/template/downloadPdfBlood', { - "patientIds": patientId, - "assortIds": assortIds, - "typeId": typeId, - "flag": flag - }); - } - } - }) + Common.confirm({ + title: "提示", + message: "确认将左侧树选中的图片下载pdf?", + operate: function (reselt) { + if (reselt) { + var patientId = "'" + $("#patientId").val() + "'"; + var assortIds = $("#assortIds").val(); + var flag = parent.$("#flag").val(); + post(path + '/template/downloadPdfBlood', { + "patientIds": patientId, + "assortIds": assortIds, + "typeId": typeId, + "flag": flag + }); + } + } + }) } //重新归页确定按钮功能 function sure(){ @@ -276,11 +303,18 @@ function delPic(){ //记录打印记录 function printInfoBlood(){ var patientId = "'"+$("#patientId").val()+"'"; - var assortIds = $("#assortIds").val(); var typeId = $("#typeId").val(); if(typeId == undefined){ typeId = ''; } + var assortIds = ''; + //判断树点击选中赋值的框是否有值,有则属于取点击选中的值,否则去加载pdf的值 + var assortIdByClick = $("#assortIdByClick").val(); + if(assortIdByClick != ''){ + assortIds = $("#assortIdByClick").val(); + }else{ + assortIds = $("#assortIds").val(); + } var flag = $("#flag").val(); $.ajax({ type:'post', diff --git a/src/main/webapp/static/pdfjs/Print.js b/src/main/webapp/static/pdfjs/Print.js index a0a9baf..31f8a14 100644 --- a/src/main/webapp/static/pdfjs/Print.js +++ b/src/main/webapp/static/pdfjs/Print.js @@ -3,122 +3,125 @@ * 2017-7-14 */ (function (window, document) { - var Print = function (dom, options) { - if (!(this instanceof Print)) return new Print(dom, options); + var Print = function (dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); - this.options = this.extend({ - noPrint: '.no-print', - onStart: function () { }, - onEnd: function () { } - }, options); + this.options = this.extend({ + noPrint: '.no-print', + onStart: function () { + }, + onEnd: function () { + } + }, options); - if ((typeof dom) === "string") { - this.dom = document.querySelector(dom); - } else { - this.dom = dom; - } + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.dom = dom; + } - this.init(); - }; - Print.prototype = { - init: function () { - var content = this.getStyle() + this.getHtml(); - this.writeIframe(content); - }, - extend: function (obj, obj2) { - for (var k in obj2) { - obj[k] = obj2[k]; - } - return obj; - }, + this.init(); + }; + Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, - getStyle: function () { - var str = "", - styles = document.querySelectorAll('style,link'); - for (var i = 0; i < styles.length; i++) { - str += styles[i].outerHTML; - } - str += ""; + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; - return str; - }, + return str; + }, - getHtml: function () { - var inputs = document.querySelectorAll('input'); - var textareas = document.querySelectorAll('textarea'); - var selects = document.querySelectorAll('select'); + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); - for (var k in inputs) { - if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { - if (inputs[k].checked == true) { - inputs[k].setAttribute('checked', "checked") - } else { - inputs[k].removeAttribute('checked') - } - } else if (inputs[k].type == "text") { - inputs[k].setAttribute('value', inputs[k].value) - } - } + for (var k in inputs) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } + } - for (var k2 in textareas) { - if (textareas[k2].type == 'textarea') { - textareas[k2].innerHTML = textareas[k2].value - } - } + for (var k2 in textareas) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } - for (var k3 in selects) { - if (selects[k3].type == 'select-one') { - var child = selects[k3].children; - for (var i in child) { - if (child[i].tagName == 'OPTION') { - if (child[i].selected == true) { - child[i].setAttribute('selected', "selected") - } else { - child[i].removeAttribute('selected') - } + for (var k3 in selects) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } } - } - } - } - return this.dom.outerHTML; - }, + return this.dom.outerHTML; + }, - writeIframe: function (content) { - var w, doc, iframe = document.createElement('iframe'), - f = document.body.appendChild(iframe); - iframe.id = "myIframe"; - iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; - w = f.contentWindow || f.contentDocument; - doc = f.contentDocument || f.contentWindow.document; - doc.open(); - doc.write(content); - doc.close(); - this.toPrint(w, function () { - document.body.removeChild(iframe) - }); - }, + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + this.toPrint(w, function () { + document.body.removeChild(iframe); + }); + }, - toPrint: function (w, cb) { - var _this = this; - w.onload = function () { - try { - setTimeout(function () { - w.focus(); - typeof _this.options.onStart === 'function' && _this.options.onStart(); - if (!w.document.execCommand('print', false, null)) { - w.print(); + toPrint: function (w, cb) { + var _this = this; + w.onload = function () { + try { + setTimeout(function () { + w.focus(); + typeof _this.options.onStart === 'function' && _this.options.onStart(); + if (!w.document.execCommand('print', false, null)) { + w.print(); + } + typeof _this.options.onEnd === 'function' && _this.options.onEnd(); + w.close(); + parent.printInfoBlood(); + cb && cb() + }); + } catch (err) { + console.log('err', err); + } } - typeof _this.options.onEnd === 'function' && _this.options.onEnd(); - w.close(); - cb && cb() - }); - } catch (err) { - console.log('err', err); } - } - } - }; - window.Print = Print; + }; + window.Print = Print; }(window, document)); \ No newline at end of file diff --git a/src/main/webapp/static/pdfjs/web/printLoading.css b/src/main/webapp/static/pdfjs/web/printLoading.css new file mode 100644 index 0000000..6d30bcb --- /dev/null +++ b/src/main/webapp/static/pdfjs/web/printLoading.css @@ -0,0 +1,80 @@ +/**进度条*/ +.progress { + width: 30px; + height: 5px; + margin-top: 13px; + _overflow: hidden; + background-color: #f5f5f5; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + font-size: 12px; + color: white; + text-align: center; + transform: scale(0.8); +} + +.progress-bar { + float: left; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: grey; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} + +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.55) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.55) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0.55) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} + +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +.sr-only{ + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0 +} \ No newline at end of file diff --git a/src/main/webapp/static/pdfjs/web/viewer1.html b/src/main/webapp/static/pdfjs/web/viewer1.html index 6954b78..fa0d191 100644 --- a/src/main/webapp/static/pdfjs/web/viewer1.html +++ b/src/main/webapp/static/pdfjs/web/viewer1.html @@ -19,254 +19,288 @@ http://sourceforge.net/adobe/cmap/wiki/License/ --> - - - - PDF.js viewer - - - - - - - - - - - - - - - - - - - - - - - - - + + + + PDF.js viewer + + + + + + + + + + + + + + + + + + + + + +
-
-
-
- - - -
-
-
-
-
- - -
-
- -
- - - - -
-
-
-
- -
- -
- -
- +
+
+
+ + + +
+
+
+
+
+ - - - -
-
- - - - - - - - - Current View - - -
- - -
-
-
-
-
+
+ +
+ + + +
+ +
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+
+ + + +
+
+

0%

+
+ + + + + Current View + + +
+ + +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- - - - - - - - -
-
-
- -
- -