@toolspack/ttd-common 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/lib/ttd-common.common.js +602 -860
- package/lib/ttd-common.umd.js +602 -860
- package/lib/ttd-common.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/packages/ukey/Ukey.vue +1 -3
- package/src/packages/ukey/WZHforChrome.js +20 -65
- package/src/packages/ukey/WzhMixin.js +212 -0
- package/src/packages/ukey/WzhSign.vue +5 -192
- package/src/packages/ukey/WzhSignChrome.vue +11 -176
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["ttd-common"]=t():e["ttd-common"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({"0013":function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-9ea7ef4a]{height:0;width:0;position:absolute;left:-5000px}",""]),e.exports=t},1502:function(e,t,r){var n=r("871a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("4f93632b",n,!0,{sourceMap:!1,shadowMode:!1})},"24fb":function(e,t,r){"use strict";function n(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"===typeof btoa){var i=o(n),a=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[r].concat(a).concat([i]).join("\n")}return[r].join("\n")}function o(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(r," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=n(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"===typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(r&&(c[2]?c[2]="".concat(r," and ").concat(c[2]):c[2]=r),t.push(c))}},t}},"28cf":function(e,t,r){var n=r("98d1");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("001d3cc6",n,!0,{sourceMap:!1,shadowMode:!1})},"3a50":function(e,t,r){var n=r("6780");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("271332fa",n,!0,{sourceMap:!1,shadowMode:!1})},"457a":function(e,t,r){"use strict";r("1502")},"499e":function(e,t,r){"use strict";function n(e,t){for(var r=[],n={},o=0;o<t.length;o++){var i=t[o],a=i[0],s=i[1],c=i[2],l=i[3],u={id:e+":"+o,css:s,media:c,sourceMap:l};n[a]?n[a].parts.push(u):r.push(n[a]={id:a,parts:[u]})}return r}r.r(t),r.d(t,"default",(function(){return d}));var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},a=o&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,l=!1,u=function(){},f=null,p="data-vue-ssr-id",h="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function d(e,t,r,o){l=r,f=o||{};var a=n(e,t);return g(a),function(t){for(var r=[],o=0;o<a.length;o++){var s=a[o],c=i[s.id];c.refs--,r.push(c)}t?(a=n(e,t),g(a)):a=[];for(o=0;o<r.length;o++){c=r[o];if(0===c.refs){for(var l=0;l<c.parts.length;l++)c.parts[l]();delete i[c.id]}}}}function g(e){for(var t=0;t<e.length;t++){var r=e[t],n=i[r.id];if(n){n.refs++;for(var o=0;o<n.parts.length;o++)n.parts[o](r.parts[o]);for(;o<r.parts.length;o++)n.parts.push(v(r.parts[o]));n.parts.length>r.parts.length&&(n.parts.length=r.parts.length)}else{var a=[];for(o=0;o<r.parts.length;o++)a.push(v(r.parts[o]));i[r.id]={id:r.id,refs:1,parts:a}}}}function m(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function v(e){var t,r,n=document.querySelector("style["+p+'~="'+e.id+'"]');if(n){if(l)return u;n.parentNode.removeChild(n)}if(h){var o=c++;n=s||(s=m()),t=y.bind(null,n,o,!1),r=y.bind(null,n,o,!0)}else n=m(),t=b.bind(null,n),r=function(){n.parentNode.removeChild(n)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else r()}}var C=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}();function y(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=C(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function b(e,t){var r=t.css,n=t.media,o=t.sourceMap;if(n&&e.setAttribute("media",n),f.ssrId&&e.setAttribute(p,t.id),o&&(r+="\n/*# sourceURL="+o.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=r;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}},6780:function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".cfca-pdf{width:100%;min-height:100%;position:relative;margin-top:-1px}.cfca-pdf .fontSize1{font-size:65%}.cfca-pdf .fontSize1,.cfca-pdf .fontSize2{font-family:Verdana,Geneva,Arial,Helvetica,sans-serif}.cfca-pdf .fontSize2{font-size:70%}.cfca-pdf .fontSize3{font-size:75%;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif}.cfca-pdf .fakehlink{cursor:pointer;text-decoration:underline;font-weight:400;line-height:26px;color:#06c}.cfca-pdf .plaintext{line-height:28px}.cfca-pdf .blankline{height:5px}.cfca-pdf .remaining{width:100%;position:absolute;z-index:1;top:72px;bottom:0}.cfca-pdf .cfca-page .page-num{display:inline-block;width:auto}.cfca-pdf .cfca-page .page-num input{display:inline-block;width:48px;height:32px;border:1px solid #ccc;border-radius:2px;margin:0 5px}.cfca-pdf .cfca-pdf-wrapper{position:relative;width:560px;margin:0 auto;box-shadow:0 5px 10px 0 rgba(0,0,0,.05)}.cfca-pdf .cfca-pdf-wrapper .cfca-left,.cfca-pdf .cfca-pdf-wrapper .cfca-right{color:#dcdcdc;position:absolute;width:73px;height:130px;text-align:center;font-size:33px;cursor:pointer;border-radius:4px;top:50%;left:-72px}.cfca-pdf .cfca-pdf-wrapper .disabled{cursor:not-allowed}.cfca-pdf .cfca-pdf-wrapper .cfca-right{left:auto;right:-72px}.cfca-pdf .cfca-pdf-wrapper .cfca-content{display:flex;flex-direction:column;justify-content:space-between;position:relative;background:#fff;border:1px solid #d4d4d4;border-radius:0;padding:0;box-sizing:border-box;overflow:hidden}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-object{box-sizing:border-box;position:relative}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-object .obj-wrapper{height:758px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page{position:relative;height:48px;line-height:48px;box-sizing:border-box;overflow:hidden;padding:0 20px;text-align:left;font-size:14px;background:#fff;color:#666;border-bottom:1px solid #d4d4d4}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .cfca-title h2{max-width:340px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:18px;color:#222;line-height:48px;font-weight:400;margin:0;padding:0}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .cfca-title .sub-title{font-size:12px;color:#999;line-height:17px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .fr{position:absolute;right:20px;top:0;max-width:180px;white-space:nowrap;text-overflow:ellipsis}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .di{margin-left:10px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-control{line-height:64px;box-sizing:border-box;overflow:hidden;padding:0 20px;text-align:right;font-size:14px;background:#f5f5f5;color:#666}",""]),e.exports=t},"871a":function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-f6abd0ea]{height:0;width:0;position:absoute;left:-5000px}",""]),e.exports=t},8875:function(e,t,r){var n,o,i;(function(r,a){o=[],n=a,i="function"===typeof n?n.apply(t,o):n,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(h){var r,n,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,s=i.exec(h.stack)||a.exec(h.stack),c=s&&s[1]||!1,l=s&&s[2]||!1,u=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");c===u&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=r.replace(n,"$1").trim());for(var p=0;p<f.length;p++){if("interactive"===f[p].readyState)return f[p];if(f[p].src===c)return f[p];if(c===u&&f[p].innerHTML&&f[p].innerHTML.trim()===o)return f[p]}return null}}return e}))},"98d1":function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-436bf2f1]{height:0;width:0;position:absolute;left:-5000px}",""]),e.exports=t},b587:function(e,t,r){"use strict";r("c84b")},c84b:function(e,t,r){var n=r("0013");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("05135184",n,!0,{sourceMap:!1,shadowMode:!1})},e5af:function(e,t,r){"use strict";r("28cf")},fb15:function(e,t,r){"use strict";if(r.r(t),"undefined"!==typeof window){var n=window.document.currentScript,o=r("8875");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"cfca-pdf"},[e.isIE?[r("div",{staticClass:"cfca-pdf-wrapper",style:{visibility:e.visible}},[r("div",{class:{"cfca-left":!0,active:"left"===e.active,disabled:e.pageNo<=1},on:{click:function(t){return e.GoToPrevPage()}}},[r("span",{staticClass:"el-icon-arrow-left"})]),r("div",{staticClass:"cfca-content"},[r("div",{staticClass:"cfca-page"},[r("div",{staticClass:"fl cfca-title"},[r("h2",[e._v(e._s(e.title))])]),r("div",{staticClass:"fr"},[e._v(" "+e._s(e.pageNo)+"/"+e._s(e.pageCount)+" "),r("span",{staticClass:"di"},[e._v("第")]),r("el-input",{staticClass:"page-num",attrs:{size:"mini"},on:{change:e.GoToPage},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.GoToPage(t)}},model:{value:e.inputPage,callback:function(t){e.inputPage=t},expression:"inputPage"}}),e._v("页 ")],1)]),r("div",{ref:"PDFCtrlPlaceHolder",staticClass:"cfca-object"},[r("div",{staticClass:"obj-wrapper",on:{dragenter:e.onDragEnter,dragover:e.onDragOver,drop:e.onDrop}},[this.idstr?[r("object",{ref:"pdfCtrl",staticClass:"PDFCtrlObject",staticStyle:{position:"relative","z-Index":"1"},attrs:{id:"PDFCtrl"+this.idstr,tabindex:0,codebase:e.publicPath+e.codebase,classid:"clsid:6F60FE31-F827-4295-8AC4-775EF7478A6A",width:"100%",height:"100%"}},[r("param",{attrs:{name:"wmode",value:"transparent"}}),r("param",{attrs:{name:"showToolbar",value:"false"}})])]:[r("object",{ref:"pdfCtrl",staticClass:"PDFCtrlObject",staticStyle:{position:"relative","z-Index":"1"},attrs:{tabindex:0,codebase:e.publicPath+e.codebase,classid:"clsid:6F60FE31-F827-4295-8AC4-775EF7478A6A",width:"100%",height:"100%"}},[r("param",{attrs:{name:"wmode",value:"transparent"}}),r("param",{attrs:{name:"showToolbar",value:"false"}})])]],2)]),r("div",{staticClass:"cfca-control"},[e._t("default")],2)]),r("div",{class:{"cfca-right":!0,active:"right"===e.active,disabled:e.pageNo>=e.pageCount},on:{click:function(t){return e.GoToNextPage()}}},[r("span",{staticClass:"el-icon-arrow-right"})])])]:[r("div",{staticClass:"red",staticStyle:{height:"350px",padding:"20px",position:"relative","margin-bottom":"20px"}},[e._v(" 提示:当前浏览器不支持控件预览,请切换IE浏览器进行查看 "),r("div",{staticClass:"tc",staticStyle:{position:"absolute",bottom:"0",left:"0",right:"0"}},[e._t("default")],2)])]],2)},s=[];function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["ttd-common"]=t():e["ttd-common"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({1281:function(e,t,r){var n=r("be38");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("7f579158",n,!0,{sourceMap:!1,shadowMode:!1})},1864:function(e,t,r){"use strict";r("6471")},"24fb":function(e,t,r){"use strict";function n(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"===typeof btoa){var i=o(n),a=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[r].concat(a).concat([i]).join("\n")}return[r].join("\n")}function o(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(r," */")}e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=n(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"===typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);n&&o[s[0]]||(r&&(s[2]?s[2]="".concat(r," and ").concat(s[2]):s[2]=r),t.push(s))}},t}},"251c":function(e,t,r){"use strict";r("1281")},"3a50":function(e,t,r){var n=r("6780");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("271332fa",n,!0,{sourceMap:!1,shadowMode:!1})},"499e":function(e,t,r){"use strict";function n(e,t){for(var r=[],n={},o=0;o<t.length;o++){var i=t[o],a=i[0],c=i[1],s=i[2],u=i[3],l={id:e+":"+o,css:c,media:s,sourceMap:u};n[a]?n[a].parts.push(l):r.push(n[a]={id:a,parts:[l]})}return r}r.r(t),r.d(t,"default",(function(){return d}));var o="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i={},a=o&&(document.head||document.getElementsByTagName("head")[0]),c=null,s=0,u=!1,l=function(){},f=null,p="data-vue-ssr-id",h="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function d(e,t,r,o){u=r,f=o||{};var a=n(e,t);return g(a),function(t){for(var r=[],o=0;o<a.length;o++){var c=a[o],s=i[c.id];s.refs--,r.push(s)}t?(a=n(e,t),g(a)):a=[];for(o=0;o<r.length;o++){s=r[o];if(0===s.refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete i[s.id]}}}}function g(e){for(var t=0;t<e.length;t++){var r=e[t],n=i[r.id];if(n){n.refs++;for(var o=0;o<n.parts.length;o++)n.parts[o](r.parts[o]);for(;o<r.parts.length;o++)n.parts.push(m(r.parts[o]));n.parts.length>r.parts.length&&(n.parts.length=r.parts.length)}else{var a=[];for(o=0;o<r.parts.length;o++)a.push(m(r.parts[o]));i[r.id]={id:r.id,refs:1,parts:a}}}}function v(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function m(e){var t,r,n=document.querySelector("style["+p+'~="'+e.id+'"]');if(n){if(u)return l;n.parentNode.removeChild(n)}if(h){var o=s++;n=c||(c=v()),t=C.bind(null,n,o,!1),r=C.bind(null,n,o,!0)}else n=v(),t=b.bind(null,n),r=function(){n.parentNode.removeChild(n)};return t(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;t(e=n)}else r()}}var y=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}();function C(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=y(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function b(e,t){var r=t.css,n=t.media,o=t.sourceMap;if(n&&e.setAttribute("media",n),f.ssrId&&e.setAttribute(p,t.id),o&&(r+="\n/*# sourceURL="+o.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=r;else{while(e.firstChild)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}},6471:function(e,t,r){var n=r("e614");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("8a5301e2",n,!0,{sourceMap:!1,shadowMode:!1})},6780:function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".cfca-pdf{width:100%;min-height:100%;position:relative;margin-top:-1px}.cfca-pdf .fontSize1{font-size:65%}.cfca-pdf .fontSize1,.cfca-pdf .fontSize2{font-family:Verdana,Geneva,Arial,Helvetica,sans-serif}.cfca-pdf .fontSize2{font-size:70%}.cfca-pdf .fontSize3{font-size:75%;font-family:Verdana,Geneva,Arial,Helvetica,sans-serif}.cfca-pdf .fakehlink{cursor:pointer;text-decoration:underline;font-weight:400;line-height:26px;color:#06c}.cfca-pdf .plaintext{line-height:28px}.cfca-pdf .blankline{height:5px}.cfca-pdf .remaining{width:100%;position:absolute;z-index:1;top:72px;bottom:0}.cfca-pdf .cfca-page .page-num{display:inline-block;width:auto}.cfca-pdf .cfca-page .page-num input{display:inline-block;width:48px;height:32px;border:1px solid #ccc;border-radius:2px;margin:0 5px}.cfca-pdf .cfca-pdf-wrapper{position:relative;width:560px;margin:0 auto;box-shadow:0 5px 10px 0 rgba(0,0,0,.05)}.cfca-pdf .cfca-pdf-wrapper .cfca-left,.cfca-pdf .cfca-pdf-wrapper .cfca-right{color:#dcdcdc;position:absolute;width:73px;height:130px;text-align:center;font-size:33px;cursor:pointer;border-radius:4px;top:50%;left:-72px}.cfca-pdf .cfca-pdf-wrapper .disabled{cursor:not-allowed}.cfca-pdf .cfca-pdf-wrapper .cfca-right{left:auto;right:-72px}.cfca-pdf .cfca-pdf-wrapper .cfca-content{display:flex;flex-direction:column;justify-content:space-between;position:relative;background:#fff;border:1px solid #d4d4d4;border-radius:0;padding:0;box-sizing:border-box;overflow:hidden}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-object{box-sizing:border-box;position:relative}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-object .obj-wrapper{height:758px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page{position:relative;height:48px;line-height:48px;box-sizing:border-box;overflow:hidden;padding:0 20px;text-align:left;font-size:14px;background:#fff;color:#666;border-bottom:1px solid #d4d4d4}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .cfca-title h2{max-width:340px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:18px;color:#222;line-height:48px;font-weight:400;margin:0;padding:0}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .cfca-title .sub-title{font-size:12px;color:#999;line-height:17px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .fr{position:absolute;right:20px;top:0;max-width:180px;white-space:nowrap;text-overflow:ellipsis}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-page .di{margin-left:10px}.cfca-pdf .cfca-pdf-wrapper .cfca-content .cfca-control{line-height:64px;box-sizing:border-box;overflow:hidden;padding:0 20px;text-align:right;font-size:14px;background:#f5f5f5;color:#666}",""]),e.exports=t},8875:function(e,t,r){var n,o,i;(function(r,a){o=[],n=a,i="function"===typeof n?n.apply(t,o):n,void 0===i||(e.exports=i)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(h){var r,n,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,c=i.exec(h.stack)||a.exec(h.stack),s=c&&c[1]||!1,u=c&&c[2]||!1,l=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");s===l&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(u-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=r.replace(n,"$1").trim());for(var p=0;p<f.length;p++){if("interactive"===f[p].readyState)return f[p];if(f[p].src===s)return f[p];if(s===l&&f[p].innerHTML&&f[p].innerHTML.trim()===o)return f[p]}return null}}return e}))},"8b46":function(e,t,r){var n=r("a918");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=r("499e").default;o("66b290aa",n,!0,{sourceMap:!1,shadowMode:!1})},a918:function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-b921f74e]{height:0;width:0;position:absoute;left:-5000px}",""]),e.exports=t},be38:function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-1cf5641b]{height:0;width:0;position:absolute;left:-5000px}",""]),e.exports=t},e544:function(e,t,r){"use strict";r("8b46")},e614:function(e,t,r){var n=r("24fb");t=n(!1),t.push([e.i,".CryptoAgent-wrapper[data-v-6bc92346]{height:0;width:0;position:absolute;left:-5000px}",""]),e.exports=t},fb15:function(e,t,r){"use strict";if(r.r(t),"undefined"!==typeof window){var n=window.document.currentScript,o=r("8875");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"cfca-pdf"},[e.isIE?[r("div",{staticClass:"cfca-pdf-wrapper",style:{visibility:e.visible}},[r("div",{class:{"cfca-left":!0,active:"left"===e.active,disabled:e.pageNo<=1},on:{click:function(t){return e.GoToPrevPage()}}},[r("span",{staticClass:"el-icon-arrow-left"})]),r("div",{staticClass:"cfca-content"},[r("div",{staticClass:"cfca-page"},[r("div",{staticClass:"fl cfca-title"},[r("h2",[e._v(e._s(e.title))])]),r("div",{staticClass:"fr"},[e._v(" "+e._s(e.pageNo)+"/"+e._s(e.pageCount)+" "),r("span",{staticClass:"di"},[e._v("第")]),r("el-input",{staticClass:"page-num",attrs:{size:"mini"},on:{change:e.GoToPage},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.GoToPage(t)}},model:{value:e.inputPage,callback:function(t){e.inputPage=t},expression:"inputPage"}}),e._v("页 ")],1)]),r("div",{ref:"PDFCtrlPlaceHolder",staticClass:"cfca-object"},[r("div",{staticClass:"obj-wrapper",on:{dragenter:e.onDragEnter,dragover:e.onDragOver,drop:e.onDrop}},[this.idstr?[r("object",{ref:"pdfCtrl",staticClass:"PDFCtrlObject",staticStyle:{position:"relative","z-Index":"1"},attrs:{id:"PDFCtrl"+this.idstr,tabindex:0,codebase:e.publicPath+e.codebase,classid:"clsid:6F60FE31-F827-4295-8AC4-775EF7478A6A",width:"100%",height:"100%"}},[r("param",{attrs:{name:"wmode",value:"transparent"}}),r("param",{attrs:{name:"showToolbar",value:"false"}})])]:[r("object",{ref:"pdfCtrl",staticClass:"PDFCtrlObject",staticStyle:{position:"relative","z-Index":"1"},attrs:{tabindex:0,codebase:e.publicPath+e.codebase,classid:"clsid:6F60FE31-F827-4295-8AC4-775EF7478A6A",width:"100%",height:"100%"}},[r("param",{attrs:{name:"wmode",value:"transparent"}}),r("param",{attrs:{name:"showToolbar",value:"false"}})])]],2)]),r("div",{staticClass:"cfca-control"},[e._t("default")],2)]),r("div",{class:{"cfca-right":!0,active:"right"===e.active,disabled:e.pageNo>=e.pageCount},on:{click:function(t){return e.GoToNextPage()}}},[r("span",{staticClass:"el-icon-arrow-right"})])])]:[r("div",{staticClass:"red",staticStyle:{height:"350px",padding:"20px",position:"relative","margin-bottom":"20px"}},[e._v(" 提示:当前浏览器不支持控件预览,请切换IE浏览器进行查看 "),r("div",{staticClass:"tc",staticStyle:{position:"absolute",bottom:"0",left:"0",right:"0"}},[e._t("default")],2)])]],2)},c=[];function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
l=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(k){u=function(e,t,r){return e[t]=r}}function f(e,t,r,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new F(o||[]);return n(a,"_invoke",{value:x(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(k){return{type:"throw",arg:k}}}e.wrap=f;var h={};function d(){}function g(){}function m(){}var v={};u(v,i,(function(){return this}));var C=Object.getPrototypeOf,y=C&&C(C(I([])));y&&y!==t&&r.call(y,i)&&(v=y);var b=m.prototype=d.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function o(n,i,a,s){var l=p(e[n],e,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==c(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function x(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=P(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function P(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator["return"]&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return g.prototype=m,n(b,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,s,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(S.prototype),u(S.prototype,a,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),u(b,s,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=I,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function u(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void r(l)}s.done?t(c):Promise.resolve(c).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){u(i,n,o,a,s,"next",e)}function s(e){u(i,n,o,a,s,"throw",e)}a(void 0)}))}}var p=function(e){var t={};return e&&(t="string"===typeof e&&/^{/.test(e)?JSON.parse(e):e),t.url&&(t.url=decodeURI(t.url)),t},h={name:"cfca-pdf",props:{action:{type:String,default:""},pdfurl:{type:String,default:""},visible:{type:[String,Boolean],default:"visible"},title:{type:String,default:""},image:{type:String,default:""},idstr:{type:[String,Number]}},data:function(){var e="";return e="x86"===window.navigator.cpuClass?"TrustSignPDFPlugin.ttd.x86.cab#version=3,2,1,4":"TrustSignPDFPlugin.ttd.x64.cab#version=3,2,1,4",{publicPath:"https://wsp.totodi.com/cfca_plug/",PDFCtrl:"",codebase:e,active:"",inputPage:"",isIE:navigator.appName.indexOf("Internet")>=0||navigator.appVersion.indexOf("Trident")>=0,pageNo:1,pageCount:1}},beforeDestroy:function(){console.log("--cfca-pdf-beforeDestroy")},beforeRouteLeave:function(e,t,r){var n=this;return f(l().mark((function e(){return l().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return console.log("-cfca--beforeRouteLeave---"),e.next=3,n.CloseFile();case 3:r();case 4:case"end":return e.stop()}}),e)})))()},mounted:function(){this.isIE&&(this.OnLoad(),console.log("cfca mounted =".concat(this.pdfurl)),this.pdfurl&&setTimeout(this.OpenFile,100))},methods:{OnLoad:function(){return!this.PDFCtrl&&(!!this.isIE&&(this.PDFCtrl=this.$refs.pdfCtrl,this.PDFCtrl||(console.log("使用id 加载this.PDFCtrl "),this.PDFCtrl=window["PDFCtrl".concat(this.idstr)]),void(window.OnClickPoint=this.OnClickPoint)))},OpenFile:function(e){var t=this;if(e=e||this.pdfurl,!e)return alert("未发现pdf资源路径!"),!1;try{console.log("OpenFile--src--".concat(e)),this.PDFCtrl.OpenWebFile(encodeURI(e)),this.PDFCtrl=this.$refs.pdfCtrl,setTimeout((function(){t.PDFCtrl.ZoomTo(-1),t.GetPageNo()}),100)}catch(n){if(this.PDFCtrl.GetLastErrorDesc){var r=this.PDFCtrl.GetLastErrorDesc();alert(r+n)}}},sleep:function(e){return new Promise((function(t){return setTimeout(t,e)}))},CloseFile:function(){try{this.pdfurl&&this.PDFCtrl&&(console.log("CloseFile---"),this.PDFCtrl.CloseFile())}catch(t){if(console.log("CloseFile error--",t),this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},onDragEnter:function(e){this.$emit("cfcaDragEnter",e)},onDragOver:function(e){e.preventDefault(),this.$emit("cfcaDragOver",e)},onDrop:function(e){this.$emit("cfcaDrop",e)},GoToFirstPage:function(){try{this.PDFCtrl.GoToFirstPage()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToLastPage:function(){try{this.PDFCtrl.GoToLastPage()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToPrevPage:function(){this.active="left";var e=this;try{this.PDFCtrl.GoToPrevPage(),this.inputPage="",setTimeout((function(){e.GetPageNo()}),100)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},GoToNextPage:function(){this.active="right";var e=this;try{this.PDFCtrl.GoToNextPage(),this.inputPage="",setTimeout((function(){e.GetPageNo()}),100)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},GetPageNo:function(){try{this.pageNo=this.PDFCtrl.GetCurrentPageNo(),this.pageCount=this.PDFCtrl.GetPageCount()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToPage:function(){var e=this;try{var t=this.inputPage.replace(/\D/,"");if(""===t)return void alert("请输入页码!");this.PDFCtrl.GoToPage(t),setTimeout((function(){e.GetPageNo()}),100)}catch(n){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var r=this.PDFCtrl.GetLastErrorDesc();alert(r+n)}}},ZoomTo:function(e){try{this.PDFCtrl.ZoomTo(e)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},ZoomOut:function(){try{this.PDFCtrl.ZoomOut()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},ZoomIn:function(){try{this.PDFCtrl.ZoomIn()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},OnClickPoint:function(e,t,r){console.log("OnClickPoint--","nPageNo=".concat(e,", x=").concat(t,", y=").concat(r));try{console.log("image2=",this.image),this.image?this.PDFCtrl.SignFile_Image(e,t,r,this.image):this.PDFCtrl.SignFile_KeyImage(e,t,r),this.$emit("cfca-point",e,t,r)}catch(o){var n=this.PDFCtrl.GetLastErrorDesc();alert(n+o)}},openDialog:function(e){var t=this;this.isIE&&(console.log(" openDialog---"),setTimeout((function(){t.OpenFile(e)}),350))},getUkeyImage:function(){var e=this.PDFCtrl.GetVersion();if(console.log(e),this.PDFCtrl.SetPKCS11Module("UyeePKCS11.Enterprise.dll|UlanPKCS11.Enterprise.dll|UlanPKCS11.dll|CFCA_UKEY_P11.dll"),"3.2.1.7"===e)return this.PDFCtrl.ReadKeyImage();alert("客户端签章控件[v=".concat(e,"],需要升级!"))},GetCertInfo:function(e){e=e||"SubjectDN";try{var t=this.PDFCtrl.GetSignCertInfo(e);if(!t){var r=this.PDFCtrl.GetLastErrorDesc();return void alert(r)}return t}catch(o){console.log("GetCertInfo :",o);var n=this.PDFCtrl.GetLastErrorDesc();alert(n+o)}},selectSignCert:function(e){try{var t="",r="CFCA ACS ",n=e||"";return console.log("证书序列号,精确匹配",n),this.PDFCtrl.SelectSignCert(t,r,"".concat(n),""),this.PDFCtrl.SetTimestampServer("http://210.74.41.195/timestamp"),!0}catch(o){return console.log("PDFCtrl.SelectSignCert ",o),alert("选择证书失败!".concat(o)),!1}},UploadFile:function(){try{var e=this.PDFCtrl.UploadCurrentFile(this.action);return e=JSON.parse(e),0===e.code?e.data.list[0]:""}catch(r){var t=this.PDFCtrl.GetLastErrorDesc();console.log("PDFCtrl 文件上传:",t),alert("PDFCtrl 文件上传:".concat(t).concat(r))}return!1},signFileKeyImage:function(e,t){var r=this.PDFCtrl.GetSignCertInfo("SerialNumber");console.log("-signFileKeyImage--certSN-".concat(r),e);try{var n="",o="";return e.height?(n=Number(e.X)+47,o=Number(e.height)-Number(e.Y)-47):(n=Number(e.X)+47,o=Number(e.Y)-47),console.log(" 参数 pageIndex = ".concat(e.pageIndex," x = ").concat(n," Y = ").concat(o)),console.log("signFileKeyImage: image=".concat(t)),t?this.PDFCtrl.SignFile_Image(e.pageIndex,n,o,t):this.PDFCtrl.SignFile_KeyImage(e.pageIndex,n,o),console.log("SignFile_KeyImage 成功"),!0}catch(a){var i=this.PDFCtrl.GetLastErrorDesc();return console.log("signFileKeyImage",a),alert("".concat(i," ").concat(a)),!1}},multipleSign7:function(e,t,r,n,o){for(var i=0;i<e.length;i++){var a=e[i];"number"===typeof o&&(a.Y-=o);try{var s="",c="";return a.height?(s=Number(a.X)+47,c=Number(a.height)-Number(a.Y)-47):(s=Number(a.X)+47,c=Number(a.Y)-47),this.PDFCtrl.AddSignaturePosition(a.pageIndex,s,c),!0}catch(u){var l=this.PDFCtrl.GetLastErrorDesc();console.log(" multipleSign7",u),alert(l+u)}}n?this.PDFCtrl.SignFile_Image(n):this.PDFCtrl.SignFile_KeyImage()},multipleSign5:function(e,t,r,n,o){console.log("multipleSign 循环签的begin ",r);var i=this.PDFCtrl.GetSignCertInfo("SerialNumber");console.log("serialNoBegin ",i);for(var a="",s=0;s<e.length;s++){var c=e[s];if(console.log("item=",c),"number"===typeof o&&(c.Y-=o),s>0){var l=this.PDFCtrl.GetSignCertInfo("SerialNumber");if(console.log("本次获得的序列号serialNoAgain:",l),i!==l)return alert("签署过程中,请不要更换ukey!"),!1;console.log("serialNo=",r),a=a&&this.signFileKeyImage(c,n),console.log("iterateSign 签章结果".concat(s,"-------"),a)}else console.log("第一个章,不用验签",s),a=this.signFileKeyImage(c,n),console.log("iterateSign 签章结果",a);if(!a)return!1}return console.log("multipleSign 签章的结果",a),a},multipleSign:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return n||this.PDFCtrl.SetPKCS11Module("UyeePKCS11.Enterprise.dll|UlanPKCS11.Enterprise.dll|UlanPKCS11.dll|CFCA_UKEY_P11.dll"),this.PDFCtrl.AddSignaturePosition?(console.log("新版插件"),this.multipleSign7(e,t,r,n,o)):this.multipleSign5(e,t,r,n,o)},GetSignatureInfo:function(){for(var e=this.PDFCtrl.GetSignatureCount(),t=[],r=0;r<e;r++){var n=this.PDFCtrl.VerifySignature(r),o=n.GetSignCertInfo("SerialNumber");t.push({SerialNumber:o})}return t}},watch:{pdfurl:function(e,t){this.inputPage=1,this.isIE&&e&&(this.PDFCtrl?(console.log("cfca watch pdfurl=="),t?t!==e&&(console.log("cfca watch oldval==",t),this.CloseFile(),setTimeout(this.OpenFile,100)):setTimeout(this.OpenFile,100)):console.log("cfca watch PDFCtrl 未加载 "))}}},d=h;r("ff64");function g(e,t,r,n,o,i,a,s){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=r,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}var m=g(d,a,s,!1,null,null,null),v=m.exports,C=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"},[e.isIE?[r("object",{ref:"CryptoAgent",attrs:{codebase:e.publicPath+e.codebase,classid:e.classid}})]:[r("embed",{ref:"CryptoAgent",staticStyle:{height:"0px",width:"0px"},attrs:{type:"application/npCryptoKit.Ultimate.x86"}})]],2)},y=[];function b(){var e="";this.sourceData="".concat((new Date).getTime());try{var t=this.sourceData,r="",n="Attach",o="SHA-1";return r="Attach"===n?this.CryptoAgent.SignMsgPKCS7(t,o,!0):"Detach"===n?this.CryptoAgent.SignMsgPKCS7(t,o,!1):this.CryptoAgent.SignMsgPKCS1(t,o),r?(console.log("SignOnClick 签名结果:",r),r):(e=this.CryptoAgent.GetLastErrorDesc(),alert(e),"")}catch(i){console.log("SignOnClick error=",i),e=this.CryptoAgent.GetLastErrorDesc(),alert(e)}return""}var w={name:"ukey",data:function(){var e="",t="";return"x86"===window.navigator.cpuClass?(e="ukey/Cryptokit/x86/CryptoKit.ToToDi.x86.cab",t="clsid:5635B01D-C661-4ACE-B997-EECFA63BD388"):(e="ukey/Cryptokit/x64/CryptoKit.ToToDi.x64.cab",t="clsid:63F9892E-D854-476E-A839-C8BA79254EC1"),{isIE:navigator.appName.indexOf("Internet")>=0||navigator.appVersion.indexOf("Trident")>=0,publicPath:"https://wsp.totodi.com/jz/",codebase:e,classid:t,sourceData:"",certType:"RSA",hashAlg:"SHA-1",singType:"Detach",CryptoAgent:"",random:"ttd"}},mounted:function(){this.onLoad()},methods:{onLoad:function(){return!this.CryptoAgent&&(!!this.isIE&&(this.CryptoAgent=this.$refs.CryptoAgent,void(this.CryptoAgent||alert("验签插件加载失败!"))))},SignOnClick:b,SelectCertificateOnClick:function(e){this.isIE||alert("请使用IE浏览器!");try{var t="",r="CFCA ACS ",n=e;n||console.log(" Ukye, 无序列号筛选证书, serialNo 非必传 ");var o="",i="",a="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0";return o=this.CryptoAgent.SelectCertificate(t,r,n,a),o||(i=this.CryptoAgent.GetLastErrorDesc(),alert(i)),o}catch(c){var s=this.CryptoAgent.GetLastErrorDesc();return alert("".concat(s,"/error")),!1}},GetSignCertInfoUkey:function(e){e=e||"SubjectDN";try{var t=this.CryptoAgent.GetSignCertInfo(e);if(!t){var r=this.CryptoAgent.GetLastErrorDesc();return void alert(r)}return t}catch(o){var n=this.CryptoAgent.GetLastErrorDesc();alert(n)}}}},S=w,x=(r("457a"),g(S,C,y,!1,null,"f6abd0ea",null)),P=x.exports,D=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"},[e.isIE?r("object",{ref:"CryptoAgent",attrs:{codebase:e.publicPath+e.codebase,classid:e.classid}}):r("embed",{ref:"CryptoAgent",staticStyle:{height:"0px",width:"0px"},attrs:{type:"application/npCryptoKit.ToToDi.x86"}})])},E=[];function F(e,t){if("object"!==c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function I(e){var t=F(e,"string");return"symbol"===c(t)?t:String(t)}function A(e,t,r){return t=I(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){A(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j={name:"wzh-sing",data:function(){var e="",t="";"x86"===window.navigator.cpuClass?(e="wzh/CryptoKit.Paperless.x86.cab",t="clsid:B64B695B-348D-400D-8D58-9AAB1DA5851A"):(e="wzh/CryptoKit.Paperless.x64.cab",t="clsid:8BF7E683-630E-4B59-9E61-C996B671EBDF");var r=navigator,n=r.userAgent,o=n.indexOf("Trident")>=0;return{isIE:o,publicPath:"https://wsp.totodi.com/jz/",codebase:e,classid:t,sourceData:"",certType:"RSA",CryptoAgent:null}},props:{api:{type:Object,required:!0}},mounted:function(){this.onLoad()},methods:{onLoad:function(){if(this.CryptoAgent)return!1;this.CryptoAgent=this.$refs.CryptoAgent,this.CryptoAgent||alert("验签插件加载失败!")},getUkeyImage:function(){var e="";try{e=this.CryptoAgent.GetSealImage("CFCA_UKEY_P11.dll")}catch(t){console.log("CFCA_UKEY_P11 error",t)}if(!e)try{e=this.CryptoAgent.GetSealImage("UyeePKCS11.Enterprise.dll")}catch(t){console.log("UyeePKCS11 error",t)}if(!e)try{e=this.CryptoAgent.GetSealImage("UlanPKCS11.Enterprise.dll")}catch(t){console.log("UlanPKCS11.Enterprise error",t)}if(!e)try{e=this.CryptoAgent.GetSealImage("UlanPKCS11.dll")}catch(t){console.log("error",t)}return e||alert("读取Ukey印章图片失败!"),e},SignOnClick:function(){this.sourceData="".concat((new Date).getTime());try{var e=this.sourceData,t="",r="Attach",n="SHA-1";return t="Attach"===r?this.CryptoAgent.SignMsgPKCS7(e,n,!0):"Detach"===r?this.CryptoAgent.SignMsgPKCS7(e,n,!1):this.CryptoAgent.SignMsgPKCS1(e,n),t?(console.log("SignOnClick 签名结果:",t),t):(this.ShowErrorInfo(),"")}catch(o){return console.log("SignOnClick error=",o),this.ShowErrorInfo(),""}},GetCertInfoOnClick:function(e){e=e||"SubjectDN";try{var t=this.CryptoAgent.GetSignCertInfo(e);return t||(this.ShowErrorInfo(),!1)}catch(r){return this.ShowErrorInfo(r),!1}},SelectCertificateOnClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{var t="",r="CFCA ACS",n=e,o="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0",i="";return console.log("无纸化 选证书 selectSignCert, serialNo(非传)=",e),i=this.CryptoAgent.SelectCertificate(t,r,n,o),i?(console.log("wzh SelectCertResult",i),!0):(console.log("wzh SelectCertResult 不存在"),this.ShowErrorInfo(),!1)}catch(a){return console.log("wzh SelectCertResult error: ",a),this.ShowErrorInfo(a),!1}},getHashValue:function(e,t,r){var n=this.CryptoAgent.GetSignCertInfo("CertContent");return this.$emit("getImg",r),n?t.bucketName&&t.objectKey?this.api.getSignHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{attachfile:"oss:".concat(t.bucketName,":").concat(t.objectKey),reason:"",location:"",signImgfileName:"",signImgfile:r.image,signImgMd5:r.md5,sealId:r.sealId,serialNo:r.serialNo,ukeyType:r.ukeyType,userId:r.userId,pageNo:e.pageIndex,pageX:Number(e.X),pageY:Number(e.Y),certBase64:n}}}):(alert("文件对象不合规!"),Promise.reject()):(alert("获取证书公钥失败!"),Promise.reject())},getSignHashValue:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c,u,f,p,h;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return i="",o.next=3,n.getHashValue(e,t,r);case 3:if(a=o.sent,s=a.code,c=a.data,u=a.msg,0===s&&"200"==="".concat(c.bean.code)&&(i=c.bean.pdfHash),i){o.next=12;break}return p=(null===c||void 0===c||null===(f=c.bean)||void 0===f?void 0:f.msg)||(null===c||void 0===c?void 0:c.msg)||u||"CFCA计算HASH值失败!",alert(p),o.abrupt("return",!1);case 12:h="";try{h=n.CryptoAgent.SignHashMsgPKCS7Detached(i,"SHA-1")}catch(l){n.ShowErrorInfo()}if(!h){o.next=16;break}return o.abrupt("return",{signature:h,id:c.bean.id});case 16:return alert("获取PKCS#7分离式签名失败!"),o.abrupt("return",!1);case 18:case"end":return o.stop()}}),o)})))()},signFileKeyImage:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c,u,f;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,n.getSignHashValue(e,t,r);case 2:if(i=o.sent,a="计算Hash 失败!",!i){o.next=18;break}return o.next=7,n.api.mergeHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{sigString:i.signature,id:i.id}}});case 7:if(s=o.sent,c=s.data,u=s.code,f=s.msg,0!==u){o.next=17;break}if(!c.bean.url){o.next=14;break}return o.abrupt("return",c.bean);case 14:a=c.bean.msg,o.next=18;break;case 17:a=c.msg||f;case 18:return n.$message.error(a||"error计算Hash失败!"),o.abrupt("return",!1);case 20:case"end":return o.stop()}}),o)})))()},multipleSign:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c,u,f,h;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(i="",a=O({},r),s=a.isOffset,c=void 0===s?18:s,a.image){o.next=6;break}return alert("印章图片缺失!"),o.abrupt("return",!1);case 6:u=0;case 7:if(!(u<e.length)){o.next=30;break}if(f=p(e[u]),"number"===typeof c&&(f.Y-=c),!(u>0)){o.next=23;break}if(h=n.CryptoAgent.GetSignCertInfo("SerialNumber"),a.serialNo===h){o.next=16;break}return console.log("params.serialNo:".concat(a.serialNo),"serialNoAgain".concat(h)),alert("签署过程中,请不要更换ukey!"),o.abrupt("return",!1);case 16:if(!i){o.next=20;break}return o.next=19,n.signFileKeyImage(f,i,O({},a));case 19:i=o.sent;case 20:console.log("iterateSign 签章结果".concat(u,"---result----"),i),o.next=27;break;case 23:return o.next=25,n.signFileKeyImage(f,t,O({},a));case 25:i=o.sent,console.log("第一个章 签章结果",i);case 27:u++,o.next=7;break;case 30:return console.log("multipleSign 签章的结果",i),o.abrupt("return",i);case 32:case"end":return o.stop()}}),o)})))()},ShowErrorInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this.CryptoAgent)if(this.CryptoAgent.GetLastErrorDesc){var t=this.CryptoAgent.GetLastErrorDesc();e&&(t="".concat(t,"[").concat(e,"]")),alert(t)}else alert("签署异常!");else alert("不支持该功能!")}}},G=j,N=(r("b587"),g(G,D,E,!1,null,"9ea7ef4a",null)),L=N.exports,T=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.isIE?r("WzhSign",{ref:"signIe",attrs:{api:e.api}}):r("WzhSignChrome",{ref:"signChrome",attrs:{api:e.api}})],1)},_=[],K=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"})},M=[];function U(e){this.browser=e}function H(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890",t=e.length,r="",n=0;n<10;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}U.chromeExtension="ldpdnooafijfamkammjmhjnnfblekpno",U.edgeExtension="odpbakhphoggmefmfppocigpfppblick",U.productID="com.cfca.cryptokit.totodi",U.extensionName=U.productID+".extension",U.reqEventName=U.productID+".request",U.respEventName=U.productID+".response",U.Browser={IE:"Internet Explorer",Edge:"Edge",Edg:"Edge(Chromium)",Chrome:"Chrome",Safari:"Safari",Firefox:"Firefox"},window.nmCryptokit=U,U.SendMessageforChrome=function(e){return new Promise((function(t,r){var n;null!==(n=chrome.runtime)&&void 0!==n&&n.sendMessage?chrome.runtime.sendMessage(U.chromeExtension,e,(function(e){if(e)0==e.errorcode?t(e):r(e);else{var n=new Object;n.errorcode=1,n.result=chrome.runtime.lastError.message,r(n)}})):r({errorcode:1,result:"缺失必要签署组件!"})}))},U.SendMessageforEdge=function(e){return new Promise((function(t,r){var n;null!==(n=chrome.runtime)&&void 0!==n&&n.sendMessage?chrome.runtime.sendMessage(U.edgeExtension,e,(function(e){if(e)0==e.errorcode?t(e):r(e);else{var n=new Object;n.errorcode=1,n.result=chrome.runtime.lastError.message,r(n)}})):r({errorcode:1,result:"缺失必要签署组件!"})}))},U.SendMessagebyEvent=function(e){var t=new CustomEvent(U.reqEventName,{detail:e});return document.dispatchEvent(t),new Promise((function(t,r){var n=U.respEventName;void 0!=e.funcInfo&&void 0!=e.funcInfo.randomId&&(n+="."+e.funcInfo.randomId),document.addEventListener(n,(function e(n){document.removeEventListener(n.type,e);var o=JSON.parse(n.detail);null!=o&&0==o.errorcode?t(o):r(o)}),!1)}))},U.SendMessage=function(e,t){return U.Browser.Chrome==e?U.SendMessageforChrome(t):U.Browser.Edg==e?U.SendMessageforEdge(t):U.SendMessagebyEvent(t)},U.checkExtension=function(e){return new Promise((function(t,r){var n=new Object;U.Browser.Chrome==e||U.Browser.Edg==e?chrome.runtime?t(e):(n.errorcode=2,n.result="Extension does not exist!",r(n)):U.Browser.Edge==e||U.Browser.Firefox==e?document.getElementById(U.extensionName)?t(e):(n.errorcode=2,n.result="Extension does not exist!",r(n)):(n.errorcode=3,n.result="Only support Chrome/Edge/Firefox",r(n))}))},U.prototype.init=function(){var e=this.browser;return U.checkExtension(e).then((function(e){var t=new Object;return t.action="connect",t.host=U.productID,U.SendMessage(e,t)})).then((function(){var t=new Object,r=new Object,n=H();return r["function"]="GetLastErrorDesc",r.params=null,r.randomId=n,t.action="invoke",t.funcInfo=r,U.SendMessage(e,t)}))},U.prototype.uninit=function(){var e=new Object;return e.action="disconnect",e.host=U.productID,U.SendMessage(this.browser,e)},U.prototype.getExtensionVersion=function(){var e=new Object,t=new Object;return t["function"]="getExtensionVersion",t.params=null,e.action="getExtensionVersion",e.funcInfo=t,U.SendMessage(this.browser,e)},U.prototype.GetSealImage=function(e){var t=new Object,r=new Object,n=new Array,o=H();return n.push(e),r["function"]="GetSealImage",r.params=n,r.randomId=o,t.action="invoke",t.funcInfo=r,U.SendMessage(this.browser,t)},U.prototype.getHostVersion=function(){var e=new Object,t=new Object,r=H();return t["function"]="GetVersion",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,U.SendMessage(this.browser,e)},U.prototype.SelectCertificate=function(e,t,r,n){var o=new Object,i=new Object,a=new Array,s=H();return a.push(e),a.push(t),a.push(r),a.push(n),i["function"]="SelectCertificate",i.params=a,i.randomId=s,o.action="invoke",o.funcInfo=i,U.SendMessage(this.browser,o)},U.prototype.GetSignCertInfo=function(e){var t=new Object,r=new Object,n=new Array,o=H();return n.push(e),r["function"]="getSignCertInfo",r.params=n,r.randomId=o,t.action="invoke",t.funcInfo=r,U.SendMessage(this.browser,t)},U.prototype.SignMsgPKCS7=function(e,t,r){var n=new Object,o=new Object,i=new Array,a=H();return i.push(e),i.push(t),i.push(r),o["function"]="SignMsgPKCS7",o.params=i,o.randomId=a,n.action="invoke",n.funcInfo=o,U.SendMessage(this.browser,n)},U.prototype.SignHashMsgPKCS7Detached=function(e,t){var r=new Object,n=new Object,o=new Array,i=H();return o.push(e),o.push(t),n["function"]="SignHashMsgPKCS7Detached",n.params=o,n.randomId=i,r.action="invoke",r.funcInfo=n,U.SendMessage(this.browser,r)},U.prototype.GetVersion=function(){var e=new Object,t=new Object,r=H();return t["function"]="GetVersion",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,U.SendMessage(this.browser,e)},U.prototype.GetLastErrorDesc=function(){var e=new Object,t=new Object,r=H();return t["function"]="GetLastErrorDesc",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,U.SendMessage(this.browser,e)};var B={methods:{BrowserInfo:function(){var e,t={name:"",version:""},r=self.navigator.userAgent;return(e=/edge\/([\d\.]+)/i.exec(r))?(t.name="Edge",t.version=e[1]):(e=/edg\/([\d\.]+)/i.exec(r))?(t.name="Edge(Chromium)",t.version=e[1]):/msie/i.test(r)?(t.name="Internet Explorer",t.version=/msie ([\d\.]+)/i.exec(r)[1]):/Trident/i.test(r)?(t.name="Internet Explorer",t.version=/rv:([\d\.]+)/i.exec(r)[1]):/chrome/i.test(r)?(t.name="Chrome",t.version=/chrome\/([\d\.]+)/i.exec(r)[1]):/safari/i.test(r)?(t.name="Safari",t.version=/version\/([\d\.]+)/i.exec(r)[1]):/firefox/i.test(r)&&(t.name="Firefox",t.version=/firefox\/([\d\.]+)/i.exec(r)[1]),t},LoadObj:function(){var e=this;try{var t,r,n=this.BrowserInfo();console.log("browser=",n),"Edge"==n.name||"Edge(Chromium)"==n.name||"Chrome"==n.name&&parseInt(n.version)>41||"Firefox"==n.name&&parseInt(n.version)>52?(this.CryptoAgent=new U(n.name),this.CryptoAgent.init().then((function(){return e.CryptoAgent.getExtensionVersion()})).then((function(r){return t=r.result,e.CryptoAgent.getHostVersion()})).then((function(n){r=n.result;var o=e.compareExtensionVersion(t),i=e.compareVersion(r,"3.4.0.1");i<0&&o<0?console.log("Please install host"):i<0?installHost():console.log("LoadObj success!")}))["catch"]((function(e){console.log("init error=",e)}))):console.log("Unsupported browser!")}catch(o){console.log("LoadObj error=",o)}},compareVersion:function(e,t){for(var r=e.split("."),n=t.split("."),o=Math.min(r.length,n.length),i=0;i<o;i++){if(parseInt(r[i],10)>parseInt(n[i],10))return 1;if(parseInt(r[i],10)<parseInt(n[i],10))return-1}if(o<r.length)for(var a=o;a<r.length;a++)if(0!=parseInt(r[a],10))return 1;if(o<n.length)for(a=o;a<n.length;a++)if(0!=parseInt(n[a],10))return-1;return 0},compareExtensionVersion:function(e){var t=this.BrowserInfo();return"Edge"==t.name||"Chrome"==t.name||"Firefox"==t.name?this.compareVersion(e,"3.4.0.1"):void 0},intallExtensionCallback:function(e,t){0==t?window.setTimeout("installHost()",1e3):alert("Install extension failed!")},OnUnLoad:function(){try{this.CryptoAgent.uninit().then((function(){}))}catch(e){alert(e)}},ShowErrorInfo:function(e){null!=e&&this.CryptoAgent&&this.CryptoAgent.GetLastErrorDesc?1==e.errorcode?alert(e.result):this.CryptoAgent.GetLastErrorDesc().then((function(e){alert(e.result)})):alert("不支持该功能!")}}},z={mixins:[B],data:function(){return{sourceData:"",certType:"RSA",CryptoAgent:null}},props:{api:{type:Object,required:!0}},mounted:function(){this.onLoad()},methods:{onLoad:function(){if(this.CryptoAgent)return!1;this.LoadObj()},getUkeyImage:function(e){var t=this;return f(l().mark((function r(){var n;return l().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(e){r.next=14;break}return n="",r.next=4,t.SelectCertificateOnClick();case 4:return r.prev=4,r.next=7,t.GetCertInfoOnClick("CSPName");case 7:n=r.sent,r.next=13;break;case 10:r.prev=10,r.t0=r["catch"](4),console.log(r.t0);case 13:e=n.indexOf("CFCA FOR UKEY CSP")>-1?"CFCA_UKEY_P11.dll":"UyeePKCS11.Enterprise.dll";case 14:return r.abrupt("return",new Promise((function(r,n){t.CryptoAgent.GetSealImage(e).then((function(e){r(e.result)}))["catch"]((function(e){t.ShowErrorInfo(e),n(e)}))})));case 15:case"end":return r.stop()}}),r,null,[[4,10]])})))()},GetCertInfoOnClick:function(e){var t=this;return e=e||"SubjectDN",this.CryptoAgent.GetSignCertInfo(e).then((function(e){return e.result}))["catch"]((function(e){t.ShowErrorInfo(e)}))},SignOnClick:function(){var e=this;return f(l().mark((function t(){var r,n,o,i;return l().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.sourceData="".concat((new Date).getTime()),r=e.sourceData,n="",o="Attach",i="SHA-1","Attach"!==o){t.next=11;break}return t.next=8,e.CryptoAgent.SignMsgPKCS7(r,i,!0);case 8:n=t.sent,t.next=20;break;case 11:if("Detach"!==o){t.next=17;break}return t.next=14,e.CryptoAgent.SignMsgPKCS7(r,i,!1);case 14:n=t.sent,t.next=20;break;case 17:return t.next=19,e.CryptoAgent.SignMsgPKCS1(r,i);case 19:n=t.sent;case 20:return console.log("SignOnClick 签名结果:",n),t.abrupt("return",n.result);case 22:case"end":return t.stop()}}),t)})))()},SelectCertificateOnClick:function(){var e=arguments,t=this;return f(l().mark((function r(){var n,o,i,a,s;return l().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=e.length>0&&void 0!==e[0]?e[0]:"",o="",i="CFCA ACS ",a="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0",n){r.next=17;break}return r.prev=5,r.next=8,t.CryptoAgent.GetVersion();case 8:s=r.sent,console.log("CryptoAgent version ",s),r.next=17;break;case 12:return r.prev=12,r.t0=r["catch"](5),alert("扩展初始化失败,请联系管理员!"),t.ShowErrorInfo(r.t0),r.abrupt("return",Promise.reject());case 17:return r.abrupt("return",new Promise((function(e,r){t.CryptoAgent.SelectCertificate(o,i,n,a).then((function(t){e(t.result)}))["catch"]((function(e){t.ShowErrorInfo(e),r()}))})));case 18:case"end":return r.stop()}}),r,null,[[5,12]])})))()},getHashValue:function(e,t,r){var n=this;return f(l().mark((function o(){var i;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,n.GetCertInfoOnClick("CertContent");case 2:if(i=o.sent,n.$emit("getImg",r),i){o.next=7;break}return alert("获取证书公钥失败!"),o.abrupt("return",Promise.reject());case 7:if(!t.bucketName||!t.objectKey){o.next=9;break}return o.abrupt("return",n.api.getSignHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{attachfile:"oss:".concat(t.bucketName,":").concat(t.objectKey),reason:"",location:"",signImgfileName:"",signImgfile:r.image,signImgMd5:r.md5,sealId:r.sealId,serialNo:r.serialNo,ukeyType:r.ukeyType,userId:r.userId,pageNo:e.pageIndex,pageX:Number(e.X),pageY:Number(e.Y),certBase64:i}}}));case 9:return alert("文件对象不合规!"),o.abrupt("return",Promise.reject());case 11:case"end":return o.stop()}}),o)})))()},getSignHashValue:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return i="",o.next=3,n.getHashValue(e,t,r);case 3:if(a=o.sent,s=a.code,c=a.data,0===s&&"200"==="".concat(c.bean.code)&&(i=c.bean.pdfHash),i){o.next=10;break}return alert("CFCA计算HASH值失败!( ".concat(c.bean.msg||"",")")),o.abrupt("return",!1);case 10:return o.abrupt("return",n.CryptoAgent.SignHashMsgPKCS7Detached(i,"SHA-1").then((function(e){return{signature:e.result,id:c.bean.id}}))["catch"]((function(e){n.ShowErrorInfo(e)})));case 11:case"end":return o.stop()}}),o)})))()},signFileKeyImage:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c,u;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,n.getSignHashValue(e,t,r);case 2:if(i=o.sent,a="计算Hash 失败!",!i){o.next=17;break}return o.next=7,n.api.mergeHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{sigString:i.signature,id:i.id}}});case 7:if(s=o.sent,c=s.data,u=s.code,0!==u){o.next=16;break}if(!c.bean.url){o.next=13;break}return o.abrupt("return",c.bean);case 13:a=c.bean.msg,o.next=17;break;case 16:a=c.msg;case 17:return n.$message.error(a||"error计算Hash失败!"),o.abrupt("return",!1);case 19:case"end":return o.stop()}}),o)})))()},multipleSign:function(e,t,r){var n=this;return f(l().mark((function o(){var i,a,s,c,u,f,h;return l().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(i="",a=O({},r),s=a.isOffset,c=void 0===s?18:s,a.image){o.next=6;break}return alert("印章图片缺失!"),o.abrupt("return",!1);case 6:console.log("multipleSign-params= ",a),u=0;case 8:if(!(u<e.length)){o.next=33;break}if(f=p(e[u]),"number"===typeof c&&(f.Y-=c),!(u>0)){o.next=26;break}return o.next=14,n.GetCertInfoOnClick("SerialNumber");case 14:if(h=o.sent,a.serialNo===h){o.next=19;break}return console.log("params.serialNo:".concat(a.serialNo),"serialNoAgain".concat(h)),alert("签署过程中,请不要更换ukey!"),o.abrupt("return",!1);case 19:if(!i){o.next=23;break}return o.next=22,n.signFileKeyImage(f,i,O({},a));case 22:i=o.sent;case 23:console.log("iterateSign 签章结果".concat(u,"---result----"),i),o.next=30;break;case 26:return o.next=28,n.signFileKeyImage(f,t,O({},a));case 28:i=o.sent,console.log("第一个章 签章结果",i);case 30:u++,o.next=8;break;case 33:return console.log("multipleSign 签章的结果",i),o.abrupt("return",i);case 35:case"end":return o.stop()}}),o)})))()}}},V=z,R=(r("e5af"),g(V,K,M,!1,null,"436bf2f1",null)),$=R.exports,Y={components:{WzhSign:L,WzhSignChrome:$},data:function(){return{child:null,isIE:!0}},props:{api:{type:Object,required:!0}},created:function(){this.getBrowserInfo()},mounted:function(){this.isIE?this.child=this.$refs.signIe:this.child=this.$refs.signChrome},methods:{getBrowserInfo:function(){var e=navigator,t=e.userAgent;e.plugins,e.mimeTypes;if(t.indexOf("Trident")>=0)return this.isIE=!0,!0;this.isIE=!1}}},X=Y,W=g(X,T,_,!1,null,null,null),q=W.exports,Z={CfcaPdf:v,Ukey:P,WzhSign:L,WzhSignChrome:$,SignNew:q};t["default"]=Z},ff64:function(e,t,r){"use strict";r("3a50")}})}));
|
|
3
|
+
u=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(A){l=function(e,t,r){return e[t]=r}}function f(e,t,r,o){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),c=new F(o||[]);return n(a,"_invoke",{value:S(e,r,c)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(A){return{type:"throw",arg:A}}}e.wrap=f;var h={};function d(){}function g(){}function v(){}var m={};l(m,i,(function(){return this}));var y=Object.getPrototypeOf,C=y&&y(y(I([])));C&&C!==t&&r.call(C,i)&&(m=C);var b=v.prototype=d.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function o(n,i,a,c){var u=p(e[n],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==s(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,a,c)}),(function(e){o("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return o("throw",e,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return i=i?i.then(n,n):n()}})}function S(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function P(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator["return"]&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function I(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return g.prototype=v,n(b,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(x.prototype),l(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),l(b,c,"Generator"),l(b,i,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=I,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function l(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(u){return void r(u)}c.done?t(s):Promise.resolve(s).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){l(i,n,o,a,c,"next",e)}function c(e){l(i,n,o,a,c,"throw",e)}a(void 0)}))}}var p=function(e){var t={};return e&&(t="string"===typeof e&&/^{/.test(e)?JSON.parse(e):e),t.url&&(t.url=decodeURI(t.url)),t},h={name:"cfca-pdf",props:{action:{type:String,default:""},pdfurl:{type:String,default:""},visible:{type:[String,Boolean],default:"visible"},title:{type:String,default:""},image:{type:String,default:""},idstr:{type:[String,Number]}},data:function(){var e="";return e="x86"===window.navigator.cpuClass?"TrustSignPDFPlugin.ttd.x86.cab#version=3,2,1,4":"TrustSignPDFPlugin.ttd.x64.cab#version=3,2,1,4",{publicPath:"https://wsp.totodi.com/cfca_plug/",PDFCtrl:"",codebase:e,active:"",inputPage:"",isIE:navigator.appName.indexOf("Internet")>=0||navigator.appVersion.indexOf("Trident")>=0,pageNo:1,pageCount:1}},beforeDestroy:function(){console.log("--cfca-pdf-beforeDestroy")},beforeRouteLeave:function(e,t,r){var n=this;return f(u().mark((function e(){return u().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return console.log("-cfca--beforeRouteLeave---"),e.next=3,n.CloseFile();case 3:r();case 4:case"end":return e.stop()}}),e)})))()},mounted:function(){this.isIE&&(this.OnLoad(),console.log("cfca mounted =".concat(this.pdfurl)),this.pdfurl&&setTimeout(this.OpenFile,100))},methods:{OnLoad:function(){return!this.PDFCtrl&&(!!this.isIE&&(this.PDFCtrl=this.$refs.pdfCtrl,this.PDFCtrl||(console.log("使用id 加载this.PDFCtrl "),this.PDFCtrl=window["PDFCtrl".concat(this.idstr)]),void(window.OnClickPoint=this.OnClickPoint)))},OpenFile:function(e){var t=this;if(e=e||this.pdfurl,!e)return alert("未发现pdf资源路径!"),!1;try{console.log("OpenFile--src--".concat(e)),this.PDFCtrl.OpenWebFile(encodeURI(e)),this.PDFCtrl=this.$refs.pdfCtrl,setTimeout((function(){t.PDFCtrl.ZoomTo(-1),t.GetPageNo()}),100)}catch(n){if(this.PDFCtrl.GetLastErrorDesc){var r=this.PDFCtrl.GetLastErrorDesc();alert(r+n)}}},sleep:function(e){return new Promise((function(t){return setTimeout(t,e)}))},CloseFile:function(){try{this.pdfurl&&this.PDFCtrl&&(console.log("CloseFile---"),this.PDFCtrl.CloseFile())}catch(t){if(console.log("CloseFile error--",t),this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},onDragEnter:function(e){this.$emit("cfcaDragEnter",e)},onDragOver:function(e){e.preventDefault(),this.$emit("cfcaDragOver",e)},onDrop:function(e){this.$emit("cfcaDrop",e)},GoToFirstPage:function(){try{this.PDFCtrl.GoToFirstPage()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToLastPage:function(){try{this.PDFCtrl.GoToLastPage()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToPrevPage:function(){this.active="left";var e=this;try{this.PDFCtrl.GoToPrevPage(),this.inputPage="",setTimeout((function(){e.GetPageNo()}),100)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},GoToNextPage:function(){this.active="right";var e=this;try{this.PDFCtrl.GoToNextPage(),this.inputPage="",setTimeout((function(){e.GetPageNo()}),100)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},GetPageNo:function(){try{this.pageNo=this.PDFCtrl.GetCurrentPageNo(),this.pageCount=this.PDFCtrl.GetPageCount()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},GoToPage:function(){var e=this;try{var t=this.inputPage.replace(/\D/,"");if(""===t)return void alert("请输入页码!");this.PDFCtrl.GoToPage(t),setTimeout((function(){e.GetPageNo()}),100)}catch(n){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var r=this.PDFCtrl.GetLastErrorDesc();alert(r+n)}}},ZoomTo:function(e){try{this.PDFCtrl.ZoomTo(e)}catch(r){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var t=this.PDFCtrl.GetLastErrorDesc();alert(t+r)}}},ZoomOut:function(){try{this.PDFCtrl.ZoomOut()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},ZoomIn:function(){try{this.PDFCtrl.ZoomIn()}catch(t){if(this.PDFCtrl&&this.PDFCtrl.GetLastErrorDesc){var e=this.PDFCtrl.GetLastErrorDesc();alert(e+t)}}},OnClickPoint:function(e,t,r){console.log("OnClickPoint--","nPageNo=".concat(e,", x=").concat(t,", y=").concat(r));try{console.log("image2=",this.image),this.image?this.PDFCtrl.SignFile_Image(e,t,r,this.image):this.PDFCtrl.SignFile_KeyImage(e,t,r),this.$emit("cfca-point",e,t,r)}catch(o){var n=this.PDFCtrl.GetLastErrorDesc();alert(n+o)}},openDialog:function(e){var t=this;this.isIE&&(console.log(" openDialog---"),setTimeout((function(){t.OpenFile(e)}),350))},getUkeyImage:function(){var e=this.PDFCtrl.GetVersion();if(console.log(e),this.PDFCtrl.SetPKCS11Module("UyeePKCS11.Enterprise.dll|UlanPKCS11.Enterprise.dll|UlanPKCS11.dll|CFCA_UKEY_P11.dll"),"3.2.1.7"===e)return this.PDFCtrl.ReadKeyImage();alert("客户端签章控件[v=".concat(e,"],需要升级!"))},GetCertInfo:function(e){e=e||"SubjectDN";try{var t=this.PDFCtrl.GetSignCertInfo(e);if(!t){var r=this.PDFCtrl.GetLastErrorDesc();return void alert(r)}return t}catch(o){console.log("GetCertInfo :",o);var n=this.PDFCtrl.GetLastErrorDesc();alert(n+o)}},selectSignCert:function(e){try{var t="",r="CFCA ACS ",n=e||"";return console.log("证书序列号,精确匹配",n),this.PDFCtrl.SelectSignCert(t,r,"".concat(n),""),this.PDFCtrl.SetTimestampServer("http://210.74.41.195/timestamp"),!0}catch(o){return console.log("PDFCtrl.SelectSignCert ",o),alert("选择证书失败!".concat(o)),!1}},UploadFile:function(){try{var e=this.PDFCtrl.UploadCurrentFile(this.action);return e=JSON.parse(e),0===e.code?e.data.list[0]:""}catch(r){var t=this.PDFCtrl.GetLastErrorDesc();console.log("PDFCtrl 文件上传:",t),alert("PDFCtrl 文件上传:".concat(t).concat(r))}return!1},signFileKeyImage:function(e,t){var r=this.PDFCtrl.GetSignCertInfo("SerialNumber");console.log("-signFileKeyImage--certSN-".concat(r),e);try{var n="",o="";return e.height?(n=Number(e.X)+47,o=Number(e.height)-Number(e.Y)-47):(n=Number(e.X)+47,o=Number(e.Y)-47),console.log(" 参数 pageIndex = ".concat(e.pageIndex," x = ").concat(n," Y = ").concat(o)),console.log("signFileKeyImage: image=".concat(t)),t?this.PDFCtrl.SignFile_Image(e.pageIndex,n,o,t):this.PDFCtrl.SignFile_KeyImage(e.pageIndex,n,o),console.log("SignFile_KeyImage 成功"),!0}catch(a){var i=this.PDFCtrl.GetLastErrorDesc();return console.log("signFileKeyImage",a),alert("".concat(i," ").concat(a)),!1}},multipleSign7:function(e,t,r,n,o){for(var i=0;i<e.length;i++){var a=e[i];"number"===typeof o&&(a.Y-=o);try{var c="",s="";return a.height?(c=Number(a.X)+47,s=Number(a.height)-Number(a.Y)-47):(c=Number(a.X)+47,s=Number(a.Y)-47),this.PDFCtrl.AddSignaturePosition(a.pageIndex,c,s),!0}catch(l){var u=this.PDFCtrl.GetLastErrorDesc();console.log(" multipleSign7",l),alert(u+l)}}n?this.PDFCtrl.SignFile_Image(n):this.PDFCtrl.SignFile_KeyImage()},multipleSign5:function(e,t,r,n,o){console.log("multipleSign 循环签的begin ",r);var i=this.PDFCtrl.GetSignCertInfo("SerialNumber");console.log("serialNoBegin ",i);for(var a="",c=0;c<e.length;c++){var s=e[c];if(console.log("item=",s),"number"===typeof o&&(s.Y-=o),c>0){var u=this.PDFCtrl.GetSignCertInfo("SerialNumber");if(console.log("本次获得的序列号serialNoAgain:",u),i!==u)return alert("签署过程中,请不要更换ukey!"),!1;console.log("serialNo=",r),a=a&&this.signFileKeyImage(s,n),console.log("iterateSign 签章结果".concat(c,"-------"),a)}else console.log("第一个章,不用验签",c),a=this.signFileKeyImage(s,n),console.log("iterateSign 签章结果",a);if(!a)return!1}return console.log("multipleSign 签章的结果",a),a},multipleSign:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return n||this.PDFCtrl.SetPKCS11Module("UyeePKCS11.Enterprise.dll|UlanPKCS11.Enterprise.dll|UlanPKCS11.dll|CFCA_UKEY_P11.dll"),this.PDFCtrl.AddSignaturePosition?(console.log("新版插件"),this.multipleSign7(e,t,r,n,o)):this.multipleSign5(e,t,r,n,o)},GetSignatureInfo:function(){for(var e=this.PDFCtrl.GetSignatureCount(),t=[],r=0;r<e;r++){var n=this.PDFCtrl.VerifySignature(r),o=n.GetSignCertInfo("SerialNumber");t.push({SerialNumber:o})}return t}},watch:{pdfurl:function(e,t){this.inputPage=1,this.isIE&&e&&(this.PDFCtrl?(console.log("cfca watch pdfurl=="),t?t!==e&&(console.log("cfca watch oldval==",t),this.CloseFile(),setTimeout(this.OpenFile,100)):setTimeout(this.OpenFile,100)):console.log("cfca watch PDFCtrl 未加载 "))}}},d=h;r("ff64");function g(e,t,r,n,o,i,a,c){var s,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=s):o&&(s=c?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),s)if(u.functional){u._injectStyles=s;var l=u.render;u.render=function(e,t){return s.call(t),l(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,s):[s]}return{exports:e,options:u}}var v=g(d,a,c,!1,null,null,null),m=v.exports,y=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"},[e.isIE?[r("object",{ref:"CryptoAgent",attrs:{codebase:e.publicPath+e.codebase,classid:e.classid}})]:[r("embed",{ref:"CryptoAgent",staticStyle:{height:"0px",width:"0px"},attrs:{type:"application/npCryptoKit.Ultimate.x86"}})]],2)},C=[];function b(){var e="";this.sourceData="".concat((new Date).getTime());try{var t=this.sourceData,r="",n="Attach",o="SHA-1";return r="Attach"===n?this.CryptoAgent.SignMsgPKCS7(t,o,!0):"Detach"===n?this.CryptoAgent.SignMsgPKCS7(t,o,!1):this.CryptoAgent.SignMsgPKCS1(t,o),r||(e=this.CryptoAgent.GetLastErrorDesc(),alert(e),"")}catch(i){e=this.CryptoAgent.GetLastErrorDesc(),alert(e)}return""}var w={name:"ukey",data:function(){var e="",t="";return"x86"===window.navigator.cpuClass?(e="ukey/Cryptokit/x86/CryptoKit.ToToDi.x86.cab",t="clsid:5635B01D-C661-4ACE-B997-EECFA63BD388"):(e="ukey/Cryptokit/x64/CryptoKit.ToToDi.x64.cab",t="clsid:63F9892E-D854-476E-A839-C8BA79254EC1"),{isIE:navigator.appName.indexOf("Internet")>=0||navigator.appVersion.indexOf("Trident")>=0,publicPath:"https://wsp.totodi.com/jz/",codebase:e,classid:t,sourceData:"",certType:"RSA",hashAlg:"SHA-1",singType:"Detach",CryptoAgent:"",random:"ttd"}},mounted:function(){this.onLoad()},methods:{onLoad:function(){return!this.CryptoAgent&&(!!this.isIE&&(this.CryptoAgent=this.$refs.CryptoAgent,void(this.CryptoAgent||alert("验签插件加载失败!"))))},SignOnClick:b,SelectCertificateOnClick:function(e){this.isIE||alert("请使用IE浏览器!");try{var t="",r="CFCA ACS ",n=e,o="",i="",a="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0";return o=this.CryptoAgent.SelectCertificate(t,r,n,a),o||(i=this.CryptoAgent.GetLastErrorDesc(),alert(i)),o}catch(s){var c=this.CryptoAgent.GetLastErrorDesc();return alert("".concat(c,"/error")),!1}},GetSignCertInfoUkey:function(e){e=e||"SubjectDN";try{var t=this.CryptoAgent.GetSignCertInfo(e);if(!t){var r=this.CryptoAgent.GetLastErrorDesc();return void alert(r)}return t}catch(o){var n=this.CryptoAgent.GetLastErrorDesc();alert(n)}}}},x=w,S=(r("e544"),g(x,y,C,!1,null,"b921f74e",null)),P=S.exports,D=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"},[e.isIE?r("object",{ref:"CryptoAgent",attrs:{codebase:e.publicPath+e.codebase,classid:e.classid}}):r("embed",{ref:"CryptoAgent",staticStyle:{height:"0px",width:"0px"},attrs:{type:"application/npCryptoKit.ToToDi.x86"}})])},E=[];function F(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function I(e){var t=F(e,"string");return"symbol"===s(t)?t:String(t)}function O(e,t,r){return t=I(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j={name:"WzhMixin",data:function(){return{sourceData:"",certType:"RSA",CryptoAgent:null}},props:{api:{type:Object,required:!0}},mounted:function(){this.onLoad()},methods:{getUkeyImage:function(e){var t=this;return f(u().mark((function r(){var n;return u().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(e){r.next=14;break}return n="",r.next=4,t.SelectCertificateOnClick();case 4:return r.prev=4,r.next=7,t.GetCertInfoOnClick("CSPName");case 7:n=r.sent,r.next=13;break;case 10:r.prev=10,r.t0=r["catch"](4),console.log(r.t0);case 13:e=n.indexOf("CFCA FOR UKEY CSP")>-1?"CFCA_UKEY_P11.dll":"UyeePKCS11.Enterprise.dll";case 14:return r.abrupt("return",new Promise((function(r,n){t.CryptoAgent.GetSealImage(e).then((function(e){r(e.result)}))["catch"]((function(e){t.ShowErrorInfo(e),n(e)}))})));case 15:case"end":return r.stop()}}),r,null,[[4,10]])})))()},SignOnClick:function(){var e=this;return f(u().mark((function t(){var r,n,o,i;return u().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.sourceData="".concat((new Date).getTime()),r=e.sourceData,n="",o="Attach",i="SHA-1","Attach"!==o){t.next=11;break}return t.next=8,e.CryptoAgent.SignMsgPKCS7(r,i,!0);case 8:n=t.sent,t.next=20;break;case 11:if("Detach"!==o){t.next=17;break}return t.next=14,e.CryptoAgent.SignMsgPKCS7(r,i,!1);case 14:n=t.sent,t.next=20;break;case 17:return t.next=19,e.CryptoAgent.SignMsgPKCS1(r,i);case 19:n=t.sent;case 20:return t.abrupt("return",n.result);case 21:case"end":return t.stop()}}),t)})))()},getHashValue:function(e,t,r){var n=this;return f(u().mark((function o(){var i;return u().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,n.GetCertInfoOnClick("CertContent");case 2:if(i=o.sent,n.$emit("getImg",r),i){o.next=7;break}return alert("获取证书公钥失败!"),o.abrupt("return",Promise.reject());case 7:if(!t.bucketName||!t.objectKey){o.next=9;break}return o.abrupt("return",n.api.getSignHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{attachfile:"oss:".concat(t.bucketName,":").concat(t.objectKey),reason:"",location:"",signImgfileName:"",signImgfile:r.image,signImgMd5:r.md5,sealId:r.sealId,serialNo:r.serialNo,ukeyType:r.ukeyType,userId:r.userId,pageNo:e.pageIndex,pageX:Number(e.X),pageY:Number(e.Y),certBase64:i,sealImageSize:r.sealImageSize}}}));case 9:return alert("文件对象不合规!"),o.abrupt("return",Promise.reject());case 11:case"end":return o.stop()}}),o)})))()},signFileKeyImage:function(e,t,r){var n=this;return f(u().mark((function o(){var i,a,c,s,l;return u().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,n.getSignHashValue(e,t,r);case 2:if(i=o.sent,a="计算Hash失败!",!i){o.next=18;break}return o.next=7,n.api.mergeHash({jsonData:{source:"TTDFUND",timestamp:(new Date).getTime(),msgBody:{sigString:i.signature,id:i.id}}});case 7:if(c=o.sent,s=c.data,l=c.code,0!==l){o.next=16;break}if(!s.bean.url){o.next=13;break}return o.abrupt("return",s.bean);case 13:a=s.bean.msg,o.next=17;break;case 16:a=s.msg;case 17:console.error(a);case 18:return n.$message.error(a||"error计算Hash失败!"),o.abrupt("return",!1);case 20:case"end":return o.stop()}}),o)})))()},checkLabels:function(e,t){var r=t.isOffset,n=void 0===r?17:r,o=t.ukeyType,i=t.sealId,a=[],c=e.map((function(e){var t=p(e);return(t.Y<0||t.X<0)&&a.push(e),"number"===typeof n&&t.Y>n&&(t.Y-=n),t}));return a.length?(alert("标签超出PDF,ERROR:page[".concat(a.map((function(e){return e.pageIndex})).join(","),"]type[").concat(o,"]sealId[").concat(i,"]")),!1):c},multipleSign:function(e,t,r){var n=this;return f(u().mark((function o(){var i,a,c,s,l,f;return u().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(console.log("multipleSign 批量签章开始",e,t,r),i="",a=k({},r),a.image){o.next=6;break}return alert("印章图片缺失!"),o.abrupt("return",!1);case 6:if(c=n.checkLabels(e,a),c){o.next=9;break}return o.abrupt("return",!1);case 9:s=0;case 10:if(!(s<c.length)){o.next=31;break}if(l=e[s],!(s>0)){o.next=24;break}if(f=n.CryptoAgent.GetSignCertInfo("SerialNumber"),a.serialNo===f){o.next=17;break}return alert("签署过程中,请不要更换ukey!"),o.abrupt("return",!1);case 17:if(!i){o.next=21;break}return o.next=20,n.signFileKeyImage(l,i,a);case 20:i=o.sent;case 21:console.log("iterateSign 签章结果".concat(s,"---result----"),i),o.next=28;break;case 24:return o.next=26,n.signFileKeyImage(l,t,a);case 26:i=o.sent,console.log("第一个章 签章结果",i);case 28:s++,o.next=10;break;case 31:return o.abrupt("return",i);case 32:case"end":return o.stop()}}),o)})))()},ShowErrorInfo:function(e){null!=e&&this.CryptoAgent&&this.CryptoAgent.GetLastErrorDesc?1===Number(e.errorcode)?alert(e.result):this.CryptoAgent.GetLastErrorDesc().then((function(e){alert(e.result)})):alert("不支持该功能!")}}},G={mixins:[j],name:"wzh-sing",data:function(){var e="",t="";"x86"===window.navigator.cpuClass?(e="wzh/CryptoKit.Paperless.x86.cab",t="clsid:B64B695B-348D-400D-8D58-9AAB1DA5851A"):(e="wzh/CryptoKit.Paperless.x64.cab",t="clsid:8BF7E683-630E-4B59-9E61-C996B671EBDF");var r=navigator,n=r.userAgent,o=n.indexOf("Trident")>=0;return{isIE:o,publicPath:"https://wsp.totodi.com/jz/",codebase:e,classid:t}},methods:{onLoad:function(){if(this.CryptoAgent)return!1;this.CryptoAgent=this.$refs.CryptoAgent,this.CryptoAgent||alert("验签插件加载失败!")},GetCertInfoOnClick:function(e){e=e||"SubjectDN";try{var t=this.CryptoAgent.GetSignCertInfo(e);return t||(this.ShowErrorInfo(),!1)}catch(r){return this.ShowErrorInfo(r),!1}},SelectCertificateOnClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{var t="",r="CFCA ACS",n=e,o="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0",i="";return i=this.CryptoAgent.SelectCertificate(t,r,n,o),!!i||(this.ShowErrorInfo(),!1)}catch(a){return this.ShowErrorInfo(a),!1}},getSignHashValue:function(e,t,r){var n=this;return f(u().mark((function o(){var i,a,c,s,l,f,p,h;return u().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return i="",o.next=3,n.getHashValue(e,t,r);case 3:if(a=o.sent,c=a.code,s=a.data,l=a.msg,0===c&&"200"==="".concat(s.bean.code)&&(i=s.bean.pdfHash),i){o.next=12;break}return p=(null===s||void 0===s||null===(f=s.bean)||void 0===f?void 0:f.msg)||(null===s||void 0===s?void 0:s.msg)||l||"CFCA计算HASH值失败!",alert(p),o.abrupt("return",!1);case 12:h="";try{h=n.CryptoAgent.SignHashMsgPKCS7Detached(i,"SHA-1")}catch(u){n.ShowErrorInfo()}if(!h){o.next=16;break}return o.abrupt("return",{signature:h,id:s.bean.id});case 16:return alert("获取PKCS#7分离式签名失败!"),o.abrupt("return",!1);case 18:case"end":return o.stop()}}),o)})))()},ShowErrorInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this.CryptoAgent)if(this.CryptoAgent.GetLastErrorDesc){var t=this.CryptoAgent.GetLastErrorDesc();e&&(t="".concat(t,"[").concat(e,"]")),alert(t)}else alert("签署异常!");else alert("不支持该功能!")}}},L=G,N=(r("1864"),g(L,D,E,!1,null,"6bc92346",null)),T=N.exports,_=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.isIE?r("WzhSign",{ref:"signIe",attrs:{api:e.api}}):r("WzhSignChrome",{ref:"signChrome",attrs:{api:e.api}})],1)},M=[],K=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"CryptoAgent-wrapper"})},U=[];function B(e){this.browser=e}function z(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890",t=e.length,r="",n=0;n<10;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}B.chromeExtension="ldpdnooafijfamkammjmhjnnfblekpno",B.edgeExtension="odpbakhphoggmefmfppocigpfppblick",B.productID="com.cfca.cryptokit.totodi",B.extensionName=B.productID+".extension",B.reqEventName=B.productID+".request",B.respEventName=B.productID+".response",B.Browser={IE:"Internet Explorer",Edge:"Edge",Edg:"Edge(Chromium)",Chrome:"Chrome",Safari:"Safari",Firefox:"Firefox"},window.nmCryptokit=B,B.SendMessageforChrome=function(e){return new Promise((function(t,r){var n;null!==(n=chrome.runtime)&&void 0!==n&&n.sendMessage?chrome.runtime.sendMessage(B.chromeExtension,e,(function(e){if(e)0==e.errorcode?t(e):r(e);else{var n=new Object;n.errorcode=1,n.result=chrome.runtime.lastError.message,r(n)}})):r({errorcode:1,result:"缺失必要签署组件!"})}))},B.SendMessageforEdge=function(e){return new Promise((function(t,r){var n;null!==(n=chrome.runtime)&&void 0!==n&&n.sendMessage?chrome.runtime.sendMessage(B.edgeExtension,e,(function(e){if(e)0==e.errorcode?t(e):r(e);else{var n=new Object;n.errorcode=1,n.result=chrome.runtime.lastError.message,r(n)}})):r({errorcode:1,result:"缺失必要签署组件!"})}))},B.SendMessagebyEvent=function(e){var t=new CustomEvent(B.reqEventName,{detail:e});return document.dispatchEvent(t),new Promise((function(t,r){var n=B.respEventName;void 0!=e.funcInfo&&void 0!=e.funcInfo.randomId&&(n+="."+e.funcInfo.randomId),document.addEventListener(n,(function e(n){document.removeEventListener(n.type,e);var o=JSON.parse(n.detail);null!=o&&0==o.errorcode?t(o):r(o)}),!1)}))},B.SendMessage=function(e,t){return B.Browser.Chrome==e?B.SendMessageforChrome(t):B.Browser.Edg==e?B.SendMessageforEdge(t):B.SendMessagebyEvent(t)},B.checkExtension=function(e){return new Promise((function(t,r){var n=new Object;B.Browser.Chrome==e||B.Browser.Edg==e?chrome.runtime?t(e):(n.errorcode=2,n.result="Extension does not exist!",r(n)):B.Browser.Edge==e||B.Browser.Firefox==e?document.getElementById(B.extensionName)?t(e):(n.errorcode=2,n.result="Extension does not exist!",r(n)):(n.errorcode=3,n.result="Only support Chrome/Edge/Firefox",r(n))}))},B.prototype.init=function(){var e=this.browser;return B.checkExtension(e).then((function(e){var t=new Object;return t.action="connect",t.host=B.productID,B.SendMessage(e,t)})).then((function(){var t=new Object,r=new Object,n=z();return r["function"]="GetLastErrorDesc",r.params=null,r.randomId=n,t.action="invoke",t.funcInfo=r,B.SendMessage(e,t)}))},B.prototype.uninit=function(){var e=new Object;return e.action="disconnect",e.host=B.productID,B.SendMessage(this.browser,e)},B.prototype.getExtensionVersion=function(){var e=new Object,t=new Object;return t["function"]="getExtensionVersion",t.params=null,e.action="getExtensionVersion",e.funcInfo=t,B.SendMessage(this.browser,e)},B.prototype.GetSealImage=function(e){var t=new Object,r=new Object,n=new Array,o=z();return n.push(e),r["function"]="GetSealImage",r.params=n,r.randomId=o,t.action="invoke",t.funcInfo=r,B.SendMessage(this.browser,t)},B.prototype.getHostVersion=function(){var e=new Object,t=new Object,r=z();return t["function"]="GetVersion",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,B.SendMessage(this.browser,e)},B.prototype.SelectCertificate=function(e,t,r,n){var o=new Object,i=new Object,a=new Array,c=z();return a.push(e),a.push(t),a.push(r),a.push(n),i["function"]="SelectCertificate",i.params=a,i.randomId=c,o.action="invoke",o.funcInfo=i,B.SendMessage(this.browser,o)},B.prototype.GetSignCertInfo=function(e){var t=new Object,r=new Object,n=new Array,o=z();return n.push(e),r["function"]="getSignCertInfo",r.params=n,r.randomId=o,t.action="invoke",t.funcInfo=r,B.SendMessage(this.browser,t)},B.prototype.SignMsgPKCS7=function(e,t,r){var n=new Object,o=new Object,i=new Array,a=z();return i.push(e),i.push(t),i.push(r),o["function"]="SignMsgPKCS7",o.params=i,o.randomId=a,n.action="invoke",n.funcInfo=o,B.SendMessage(this.browser,n)},B.prototype.SignHashMsgPKCS7Detached=function(e,t){var r=new Object,n=new Object,o=new Array,i=z();return o.push(e),o.push(t),n["function"]="SignHashMsgPKCS7Detached",n.params=o,n.randomId=i,r.action="invoke",r.funcInfo=n,B.SendMessage(this.browser,r)},B.prototype.GetVersion=function(){var e=new Object,t=new Object,r=z();return t["function"]="GetVersion",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,B.SendMessage(this.browser,e)},B.prototype.GetLastErrorDesc=function(){var e=new Object,t=new Object,r=z();return t["function"]="GetLastErrorDesc",t.params=null,t.randomId=r,e.action="invoke",e.funcInfo=t,B.SendMessage(this.browser,e)};var H={methods:{BrowserInfo:function(){var e,t={name:"",version:""},r=self.navigator.userAgent;return(e=/edge\/([\d\.]+)/i.exec(r))?(t.name="Edge",t.version=e[1]):(e=/edg\/([\d\.]+)/i.exec(r))?(t.name="Edge(Chromium)",t.version=e[1]):/msie/i.test(r)?(t.name="Internet Explorer",t.version=/msie ([\d\.]+)/i.exec(r)[1]):/Trident/i.test(r)?(t.name="Internet Explorer",t.version=/rv:([\d\.]+)/i.exec(r)[1]):/chrome/i.test(r)?(t.name="Chrome",t.version=/chrome\/([\d\.]+)/i.exec(r)[1]):/safari/i.test(r)?(t.name="Safari",t.version=/version\/([\d\.]+)/i.exec(r)[1]):/firefox/i.test(r)&&(t.name="Firefox",t.version=/firefox\/([\d\.]+)/i.exec(r)[1]),t},LoadObj:function(){var e=this;try{var t,r,n=this.BrowserInfo();("Edge"==n.name||"Edge(Chromium)"==n.name||"Chrome"==n.name&&parseInt(n.version)>41||"Firefox"==n.name&&parseInt(n.version)>52)&&(this.CryptoAgent=new B(n.name),this.CryptoAgent.init().then((function(){return e.CryptoAgent.getExtensionVersion()})).then((function(r){return t=r.result,e.CryptoAgent.getHostVersion()})).then((function(n){r=n.result;var o=e.compareExtensionVersion(t),i=e.compareVersion(r,"3.4.0.1");i<0&&o<0?console.log("Please install host"):i<0&&console.log("Please installHost()")}))["catch"]((function(e){console.log("init error=",e)})))}catch(o){console.log("LoadObj error=",o)}},compareVersion:function(e,t){for(var r=e.split("."),n=t.split("."),o=Math.min(r.length,n.length),i=0;i<o;i++){if(parseInt(r[i],10)>parseInt(n[i],10))return 1;if(parseInt(r[i],10)<parseInt(n[i],10))return-1}if(o<r.length)for(var a=o;a<r.length;a++)if(0!=parseInt(r[a],10))return 1;if(o<n.length)for(a=o;a<n.length;a++)if(0!=parseInt(n[a],10))return-1;return 0},compareExtensionVersion:function(e){var t=this.BrowserInfo();return"Edge"==t.name||"Chrome"==t.name||"Firefox"==t.name?this.compareVersion(e,"3.4.0.1"):void 0}}},V={mixins:[j,H],methods:{onLoad:function(){if(this.CryptoAgent)return!1;this.LoadObj()},GetCertInfoOnClick:function(e){var t=this;return e=e||"SubjectDN",this.CryptoAgent.GetSignCertInfo(e).then((function(e){return e.result}))["catch"]((function(e){t.ShowErrorInfo(e)}))},SelectCertificateOnClick:function(){var e=arguments,t=this;return f(u().mark((function r(){var n,o,i,a;return u().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=e.length>0&&void 0!==e[0]?e[0]:"",o="",i="CFCA ACS ",a="Uyee CSP v6.0 (Enterprise)||CFCA FOR UKEY CSP v1.1.0",n){r.next=16;break}return r.prev=5,r.next=8,t.CryptoAgent.GetVersion();case 8:r.sent,r.next=16;break;case 11:return r.prev=11,r.t0=r["catch"](5),alert("扩展初始化失败,请联系管理员!"),t.ShowErrorInfo(r.t0),r.abrupt("return",Promise.reject());case 16:return r.abrupt("return",new Promise((function(e,r){t.CryptoAgent.SelectCertificate(o,i,n,a).then((function(t){e(t.result)}))["catch"]((function(e){t.ShowErrorInfo(e),r()}))})));case 17:case"end":return r.stop()}}),r,null,[[5,11]])})))()},getSignHashValue:function(e,t,r){var n=this;return f(u().mark((function o(){var i,a,c,s;return u().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return i="",o.next=3,n.getHashValue(e,t,r);case 3:if(a=o.sent,c=a.code,s=a.data,0===c&&"200"==="".concat(s.bean.code)&&(i=s.bean.pdfHash),i){o.next=10;break}return alert("CFCA计算HASH值失败!( ".concat(s.bean.msg||"",")")),o.abrupt("return",!1);case 10:return o.abrupt("return",n.CryptoAgent.SignHashMsgPKCS7Detached(i,"SHA-1").then((function(e){return{signature:e.result,id:s.bean.id}}))["catch"]((function(e){n.ShowErrorInfo(e)})));case 11:case"end":return o.stop()}}),o)})))()}},beforeDestroy:function(){try{this.CryptoAgent.uninit().then((function(){}))}catch(e){alert(e)}}},R=V,$=(r("251c"),g(R,K,U,!1,null,"1cf5641b",null)),Y=$.exports,W={components:{WzhSign:T,WzhSignChrome:Y},data:function(){return{child:null,isIE:!0}},props:{api:{type:Object,required:!0}},created:function(){this.getBrowserInfo()},mounted:function(){this.isIE?this.child=this.$refs.signIe:this.child=this.$refs.signChrome},methods:{getBrowserInfo:function(){var e=navigator,t=e.userAgent;e.plugins,e.mimeTypes;if(t.indexOf("Trident")>=0)return this.isIE=!0,!0;this.isIE=!1}}},X=W,Z=g(X,_,M,!1,null,null,null),q=Z.exports,J={CfcaPdf:m,Ukey:P,WzhSign:T,WzhSignChrome:Y,SignNew:q};t["default"]=J},ff64:function(e,t,r){"use strict";r("3a50")}})}));
|
package/package.json
CHANGED
|
@@ -46,10 +46,8 @@ function SignOnClick() {
|
|
|
46
46
|
alert(errorDesc)
|
|
47
47
|
return ''
|
|
48
48
|
}
|
|
49
|
-
console.log('SignOnClick 签名结果:', signature)
|
|
50
49
|
return signature
|
|
51
50
|
} catch (e) {
|
|
52
|
-
console.log('SignOnClick error=', e)
|
|
53
51
|
errorDesc = this.CryptoAgent.GetLastErrorDesc()
|
|
54
52
|
alert(errorDesc)
|
|
55
53
|
}
|
|
@@ -117,7 +115,7 @@ export default {
|
|
|
117
115
|
const serialNumFilter = serialNo;// this.GetSignCertInfoUkey('SerialNumber');
|
|
118
116
|
|
|
119
117
|
if (!serialNumFilter) {
|
|
120
|
-
console.log(' Ukye, 无序列号筛选证书, serialNo 非必传 ')
|
|
118
|
+
// console.log(' Ukye, 无序列号筛选证书, serialNo 非必传 ')
|
|
121
119
|
}
|
|
122
120
|
let bSelectCertResult = ''
|
|
123
121
|
let errorDesc = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import {nmCryptokit} from
|
|
2
|
+
import { nmCryptokit } from './nmCryptokit.ToToDi.js'
|
|
3
3
|
export default {
|
|
4
4
|
methods: {
|
|
5
5
|
BrowserInfo() {
|
|
@@ -39,50 +39,34 @@ export default {
|
|
|
39
39
|
let extensionVer;
|
|
40
40
|
let hostVer;
|
|
41
41
|
const browser = this.BrowserInfo();
|
|
42
|
-
console.log('browser=' ,browser)
|
|
43
42
|
if ((browser.name == 'Edge')
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
|| (browser.name == 'Edge(Chromium)')
|
|
44
|
+
|| (browser.name == 'Chrome' && parseInt(browser.version) > 41)
|
|
45
|
+
|| (browser.name == 'Firefox' && parseInt(browser.version) > 52)) {
|
|
47
46
|
this.CryptoAgent = new nmCryptokit(browser.name);
|
|
48
47
|
|
|
49
48
|
this.CryptoAgent.init().then(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
console.log('Please install host');
|
|
67
|
-
} else if (hostLevel < 0) {
|
|
68
|
-
installHost();
|
|
69
|
-
} else {
|
|
70
|
-
console.log('LoadObj success!')
|
|
71
|
-
}
|
|
72
|
-
}).catch((response) => {
|
|
73
|
-
console.log('init error=', response)
|
|
74
|
-
});
|
|
75
|
-
} else {
|
|
76
|
-
console.log('Unsupported browser!');
|
|
49
|
+
return this.CryptoAgent.getExtensionVersion()
|
|
50
|
+
}).then((response) => {
|
|
51
|
+
extensionVer = response.result;
|
|
52
|
+
return this.CryptoAgent.getHostVersion();
|
|
53
|
+
}).then((response) => {
|
|
54
|
+
hostVer = response.result;
|
|
55
|
+
const extensionLevel = this.compareExtensionVersion(extensionVer);
|
|
56
|
+
const hostLevel = this.compareVersion(hostVer, '3.4.0.1')
|
|
57
|
+
if (hostLevel < 0 && extensionLevel < 0) {
|
|
58
|
+
console.log('Please install host');
|
|
59
|
+
} else if (hostLevel < 0) {
|
|
60
|
+
console.log('Please installHost()');
|
|
61
|
+
}
|
|
62
|
+
}).catch((response) => {
|
|
63
|
+
console.log('init error=', response)
|
|
64
|
+
});
|
|
77
65
|
}
|
|
78
66
|
} catch (e) {
|
|
79
67
|
console.log('LoadObj error=', e)
|
|
80
68
|
}
|
|
81
69
|
},
|
|
82
|
-
|
|
83
|
-
// version1 == version2 0
|
|
84
|
-
// version1 < version2 -1
|
|
85
|
-
// version1 > version2 1
|
|
86
70
|
compareVersion(version1, version2) {
|
|
87
71
|
const v1Arr = version1.split('.');
|
|
88
72
|
const v2Arr = version2.split('.');
|
|
@@ -124,34 +108,5 @@ export default {
|
|
|
124
108
|
return this.compareVersion(version, '3.4.0.1');
|
|
125
109
|
}
|
|
126
110
|
},
|
|
127
|
-
|
|
128
|
-
intallExtensionCallback(url, status) {
|
|
129
|
-
if (status == 0) {
|
|
130
|
-
window.setTimeout('installHost()', 1000);
|
|
131
|
-
} else {
|
|
132
|
-
alert('Install extension failed!');
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
OnUnLoad() {
|
|
137
|
-
try {
|
|
138
|
-
this.CryptoAgent.uninit().then(() => { });
|
|
139
|
-
} catch (e) {
|
|
140
|
-
alert(e);
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
ShowErrorInfo(response) {
|
|
146
|
-
if (response == null || !this.CryptoAgent || !this.CryptoAgent.GetLastErrorDesc) {
|
|
147
|
-
alert('不支持该功能!');
|
|
148
|
-
} else if (response.errorcode == 1) {
|
|
149
|
-
alert(response.result);
|
|
150
|
-
} else {
|
|
151
|
-
this.CryptoAgent.GetLastErrorDesc().then((responseE) => {
|
|
152
|
-
alert(responseE.result);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
111
|
},
|
|
157
112
|
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// 无纸化签署,IE 和 chrome2种模式的通用方法
|
|
2
|
+
import { getUrl } from '../utils'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'WzhMixin',
|
|
6
|
+
data() {
|
|
7
|
+
return {
|
|
8
|
+
sourceData: '', // 签名原文, 动态随机字符串
|
|
9
|
+
certType: 'RSA', // 签名算法
|
|
10
|
+
CryptoAgent: null,
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
api: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
mounted() {
|
|
20
|
+
this.onLoad()
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
async getUkeyImage(bstrP11Name) {
|
|
24
|
+
// 为了兼容 (新老ukey),获取证书的CSPName
|
|
25
|
+
// 老版本ukey CSPName: CFCA FOR UKEY CSP v1.1.0
|
|
26
|
+
// 新版本ukey CSPName: Uyee CSP v6.0 (Enterprise)
|
|
27
|
+
if (!bstrP11Name) {
|
|
28
|
+
let InfoContent = ''
|
|
29
|
+
await this.SelectCertificateOnClick()
|
|
30
|
+
try {
|
|
31
|
+
InfoContent = await this.GetCertInfoOnClick('CSPName');
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.log(e)
|
|
34
|
+
}
|
|
35
|
+
if (InfoContent.indexOf('CFCA FOR UKEY CSP') > -1) {
|
|
36
|
+
bstrP11Name = 'CFCA_UKEY_P11.dll'
|
|
37
|
+
} else {
|
|
38
|
+
bstrP11Name = 'UyeePKCS11.Enterprise.dll'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
// 老ukey 获取图片 'CFCA_UKEY_P11.dll'
|
|
43
|
+
// 新ukey 获取图片 'UyeePKCS11.Enterprise.dll'
|
|
44
|
+
this.CryptoAgent.GetSealImage(bstrP11Name).then((response) => {
|
|
45
|
+
resolve(response.result)
|
|
46
|
+
}).catch((response1) => {
|
|
47
|
+
this.ShowErrorInfo(response1);
|
|
48
|
+
reject(response1)
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
},
|
|
52
|
+
// 消息签名, 生成Base64 编码的 PKCS#7 签名结果
|
|
53
|
+
async SignOnClick() {
|
|
54
|
+
this.sourceData = `${new Date().getTime()}`
|
|
55
|
+
const source = this.sourceData
|
|
56
|
+
let signature = ''
|
|
57
|
+
const signType = 'Attach' // 签名类型
|
|
58
|
+
const selectedAlg = 'SHA-1' // 哈希算法(仅对RSA算法有效,SM2默认使用SM3哈希算法):
|
|
59
|
+
|
|
60
|
+
if (signType === 'Attach') {
|
|
61
|
+
// PKCS#7 Attach
|
|
62
|
+
signature = await this.CryptoAgent.SignMsgPKCS7(source, selectedAlg, true)
|
|
63
|
+
} else if (signType === 'Detach') {
|
|
64
|
+
// PKCS#7 Detach
|
|
65
|
+
signature = await this.CryptoAgent.SignMsgPKCS7(source, selectedAlg, false)
|
|
66
|
+
} else {
|
|
67
|
+
// PKCS#1
|
|
68
|
+
signature = await this.CryptoAgent.SignMsgPKCS1(source, selectedAlg)
|
|
69
|
+
}
|
|
70
|
+
// console.log('SignOnClick 签名结果:', signature)
|
|
71
|
+
return signature.result
|
|
72
|
+
},
|
|
73
|
+
async getHashValue(label, fileOss, params) {
|
|
74
|
+
const CertContent = await this.GetCertInfoOnClick('CertContent');
|
|
75
|
+
this.$emit('getImg', params)
|
|
76
|
+
if (!CertContent) {
|
|
77
|
+
alert('获取证书公钥失败!')
|
|
78
|
+
return Promise.reject()
|
|
79
|
+
}
|
|
80
|
+
if (fileOss.bucketName && fileOss.objectKey) {
|
|
81
|
+
return this.api.getSignHash({
|
|
82
|
+
jsonData: {
|
|
83
|
+
source: 'TTDFUND',
|
|
84
|
+
timestamp: new Date().getTime(),
|
|
85
|
+
msgBody: {
|
|
86
|
+
// 合同地址, 相对路径--合同文件全路径。网络地址:http://xxxxxx.pdf;阿里云地址:oss:bucketxx:key
|
|
87
|
+
attachfile: `oss:${fileOss.bucketName}:${fileOss.objectKey}`,
|
|
88
|
+
reason: '', // 签署原因
|
|
89
|
+
location: '', // 签署地点
|
|
90
|
+
signImgfileName: '', // 图片名称
|
|
91
|
+
signImgfile: params.image, // 图片路径,格式同文件字段类似
|
|
92
|
+
signImgMd5: params.md5, // 印章图片的md5
|
|
93
|
+
sealId: params.sealId, // 印章图片的id
|
|
94
|
+
serialNo: params.serialNo, // 证书序列号
|
|
95
|
+
ukeyType: params.ukeyType, // 证书类型(ttd配置)
|
|
96
|
+
userId: params.userId, // 用户id
|
|
97
|
+
pageNo: label.pageIndex, // 签章页
|
|
98
|
+
pageX: Number(label.X), // 签章页签章位置X坐标
|
|
99
|
+
pageY: Number(label.Y), // 签章页签章位置Y坐标
|
|
100
|
+
certBase64: CertContent, // 证书公钥
|
|
101
|
+
sealImageSize: params.sealImageSize, // 签章图片大小
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
alert('文件对象不合规!')
|
|
107
|
+
return Promise.reject()
|
|
108
|
+
},
|
|
109
|
+
async signFileKeyImage(item, fileItem, params) {
|
|
110
|
+
const res = await this.getSignHashValue(item, fileItem, params)
|
|
111
|
+
let errorMsg = '计算Hash失败!'
|
|
112
|
+
if (res) {
|
|
113
|
+
const { data, code } = await this.api.mergeHash({
|
|
114
|
+
jsonData: {
|
|
115
|
+
source: 'TTDFUND',
|
|
116
|
+
timestamp: new Date().getTime(),
|
|
117
|
+
msgBody: {
|
|
118
|
+
sigString: res.signature, // 签名后的hash值
|
|
119
|
+
id: res.id, // 计算接口返回的ID
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
// 此方法 code 不能完全说明正确,调用失败code 也是0
|
|
124
|
+
if (code === 0) {
|
|
125
|
+
if (data.bean.url) {
|
|
126
|
+
return data.bean
|
|
127
|
+
}
|
|
128
|
+
errorMsg = data.bean.msg
|
|
129
|
+
} else {
|
|
130
|
+
errorMsg = data.msg
|
|
131
|
+
}
|
|
132
|
+
console.error(errorMsg)
|
|
133
|
+
}
|
|
134
|
+
this.$message.error(errorMsg || 'error计算Hash失败!')
|
|
135
|
+
return false
|
|
136
|
+
},
|
|
137
|
+
checkLabels(labels, localParams) {
|
|
138
|
+
const { isOffset = 17, ukeyType, sealId } = localParams
|
|
139
|
+
const errorPage = []
|
|
140
|
+
const newLabels = labels.map((item) => {
|
|
141
|
+
const label = getUrl(item)
|
|
142
|
+
// 坐标不能是负数
|
|
143
|
+
if (label.Y < 0 || label.X < 0) {
|
|
144
|
+
errorPage.push(item)
|
|
145
|
+
}
|
|
146
|
+
if (typeof isOffset === 'number') {
|
|
147
|
+
// 印章统一向下偏移
|
|
148
|
+
if (label.Y > isOffset) {
|
|
149
|
+
label.Y -= isOffset
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return label
|
|
153
|
+
})
|
|
154
|
+
if (errorPage.length) {
|
|
155
|
+
alert(`标签超出PDF,ERROR:page[${errorPage.map((item) => item.pageIndex).join(',')}]type[${ukeyType}]sealId[${sealId}]`)
|
|
156
|
+
return false
|
|
157
|
+
}
|
|
158
|
+
return newLabels
|
|
159
|
+
},
|
|
160
|
+
/*
|
|
161
|
+
labels: 标签数据 {X:"137",Y:"295",height:"841",pageIndex:"66",width:"595"}
|
|
162
|
+
fileOss: 为文件对象 {obje}
|
|
163
|
+
parama: 其他参数:ukeyType, image, md5, isOffset:修正印章的位置,印章加时间后需要向下修正
|
|
164
|
+
*/
|
|
165
|
+
async multipleSign(labels, fileOss, params) {
|
|
166
|
+
console.log('multipleSign 批量签章开始', labels, fileOss, params)
|
|
167
|
+
let result = ''
|
|
168
|
+
const localParams = { ...params }
|
|
169
|
+
if (!localParams.image) {
|
|
170
|
+
alert('印章图片缺失!')
|
|
171
|
+
return false
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const newLabels = this.checkLabels(labels, localParams)
|
|
175
|
+
if (!newLabels) {
|
|
176
|
+
return false
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
for (let index = 0; index < newLabels.length; index++) {
|
|
180
|
+
const item = (labels[index])
|
|
181
|
+
// 此处for循环多个文件时候以前签署,所以提示无意义
|
|
182
|
+
if (index > 0) {
|
|
183
|
+
const serialNoAgain = this.CryptoAgent.GetSignCertInfo('SerialNumber');
|
|
184
|
+
if (localParams.serialNo !== serialNoAgain) {
|
|
185
|
+
alert('签署过程中,请不要更换ukey!')
|
|
186
|
+
return false
|
|
187
|
+
}
|
|
188
|
+
// 这里签署第二个章,需要在第一个签好的文件上签署 所以用result中的文件
|
|
189
|
+
if (result) {
|
|
190
|
+
result = await this.signFileKeyImage((item), result, localParams)
|
|
191
|
+
}
|
|
192
|
+
console.log(`iterateSign 签章结果${index}---result----`, result)
|
|
193
|
+
} else {
|
|
194
|
+
result = await this.signFileKeyImage((item), fileOss, localParams)
|
|
195
|
+
console.log('第一个章 签章结果', result)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return result
|
|
199
|
+
},
|
|
200
|
+
ShowErrorInfo(response) {
|
|
201
|
+
if (response == null || !this.CryptoAgent || !this.CryptoAgent.GetLastErrorDesc) {
|
|
202
|
+
alert('不支持该功能!');
|
|
203
|
+
} else if (Number(response.errorcode) === 1) {
|
|
204
|
+
alert(response.result);
|
|
205
|
+
} else {
|
|
206
|
+
this.CryptoAgent.GetLastErrorDesc().then((responseE) => {
|
|
207
|
+
alert(responseE.result);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
}
|