123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
-
- <html>
- <link href="js/css/scene.css" rel="stylesheet" type="text/css" />
- <link href="js/themes/default/easyui.css" rel="stylesheet" type="text/css" />
- <link href="js/themes/icon.css" rel="stylesheet" type="text/css" />
- <script src="js/suwell_ofdReader.js" type="text/javascript" charset="UTF-8"></script>
- <script src="js/jquery.min.js" type="text/javascript"></script>
- <script src="js/jquery.easyui.min.js" type="text/javascript"></script>
- <script src="apiurljs.js"></script>
- <script src="js/sm4.js"></script>
- <script language="JavaScript">
- var s4 = new SM4Util();
- var params = "?" + s4.decryptData_CBC(decodeURIComponent(location.search.match(new RegExp("[\?\&]data=([^\&]+)", "i"))[1])).replace(/\u0000|\u0001|\u0002|\u0003|\u0004|\u0005|\u0006|\u0007|\u0008|\u0009|\u000a|\u000b|\u000c|\u000d|\u000e|\u000f|\u0010|\u0011|\u0012|\u0013|\u0014|\u0015|\u0016|\u0017|\u0018|\u0019|\u001a|\u001b|\u001c|\u001d|\u001e|\u001f|\u007F/g, "")
- if (params.match(new RegExp("[\?\&]type=([^\&]+)", "i")) != null) {
- var type = params.match(new RegExp("[\?\&]type=([^\&]+)", "i"))[1];
- var file = params.match(new RegExp("[\?\&]file=([^\&]+)", "i"))[1];
- }
- var tablename = params.match(new RegExp("[\?\&]tablename=([^\&]+)", "i"))[1];
- var routeinfoid = params.match(new RegExp("[\?\&]routeinfoid=([^\&]+)", "i"))[1];
- var ocx;
- function initObject() {
- ocx = suwell.ofdReaderInit("OFDActiveXDIV", "1100px", "950px");
- if (ocx) {
- if (type == 0) {
- //有ofd文件根据数据库所存字段获取文件
- //if (file.slice(file.lastIndexOf(".")) == ".ofd") {
- ocx.downloadHttpFile(apiurljs.ofdUrl + "g2work/files/" + file, "/tmp/" + tablename + routeinfoid + file.slice(file.lastIndexOf(".")), "md5");
- //} else {
- // ocx.openFile(apiurljs.ofdUrl + "g2work/files/" + file, false);
- //}
- //ocx.openFile(apiurljs.ofdUrl+"g2workweb/UploadAttach/" + file + ".ofd", false);
- //setTimeout(function () {
- // ocx.saveFile("/tmp/" + tablename + routeinfoid + ".ofd");
- // ocx.openFile("/tmp/" + tablename + routeinfoid + ".ofd");
- //},2000)
- } else {//没有ofd文件根据routeinfoid获取文件
- ocx.downloadHttpFile(apiurljs.ofdUrl+"g2workweb/UploadAttach/ofd/" + tablename + routeinfoid, "/tmp/" + tablename + routeinfoid + ".ofd", "md5");
- //ocx.openFile(apiurljs.ofdUrl+"g2workweb/UploadAttach/ofd/" + tablename + routeinfoid + ".ofd", false);
- //setTimeout(function () {
- // ocx.saveFile("/tmp/" + tablename + routeinfoid + ".ofd");
- // ocx.openFile("/tmp/" + tablename + routeinfoid + ".ofd", false);
- //}, 2000)
- }
- ocx.registListener("downloadfile", "dlPerformed", true);//监听方法
- }
- }
- function saveFile() {
- ocx.performClick("f_save");//点击保存事件
- //提交函数
- var saveresult = ocx.saveFile(apiurljs.ofdUrl + "g2app/abase/saveOfdFileName?tablename=" + tablename + "&column=OFDLIST&ofdstatus=0&routeinfoid=" + routeinfoid);
- if (saveresult == true) {
- alert("保存成功!")
- } else {
- alert("保存失败!")
- }
- }
- function signFile() {
- ocx.performClick("t_tablet");//点击手签笔事件
- }
- function sealFile() {
- ocx.performClick("t_sealsign");//点击印章事件
- }
- function dlPerformed() {
- ocx.openFile("/tmp/" + tablename + routeinfoid + file.slice(file.lastIndexOf(".")), false)
- }
- //base64加密
- function base64(str) {
- // 对字符串进行编码
- var encode = encodeURI(str);
- // 对编码的字符串转化base64
- var base64 = btoa(encode);
- return base64;
- }
- //base64解密
- function decode(base64) {
- // 对base64转编码
- var decode = atob(base64);
- // 编码转字符串
- var str = decodeURI(decode);
- return str;
- }
- </script>
- <body onload="initObject();" style="overflow-y:hidden">
- <!--<div style="width:100%;text-align:right">
- <span style=" outline: none; border: 0; padding: 5px 15px; background: #bdc7d4; color: #000; margin: 1px 3px; cursor: pointer;" onclick="saveFile()">保存</span>
- <span style=" outline: none; border: 0; padding: 5px 15px; background: #bdc7d4; color: #000; margin: 1px 3px; cursor: pointer;" onclick="signFile()">签字</span>
- <span style=" outline: none; border: 0; padding: 5px 15px; background: #bdc7d4; color: #000; margin: 1px 3px; cursor: pointer;" onclick="sealFile()">印章</span>
- </div>-->
- <div style="width: 100%;text-align:center">
- <div id="OFDActiveXDIV"></div>
- </div>
- <script>
- function closeQian() {
- window.parent.closeQian()
- }
- </script>
- </body>
- </html>
|