diff --git a/lib/sign-canvas.common.js b/lib/sign-canvas.common.js index 787532c..0ffb3eb 100644 --- a/lib/sign-canvas.common.js +++ b/lib/sign-canvas.common.js @@ -1642,12 +1642,12 @@ function _defineProperty(obj, key, value) { // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7f7f"); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4a763dc7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/SignCanvas/src/main.vue?vue&type=template&id=ef2dced2& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4a763dc7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/SignCanvas/src/main.vue?vue&type=template&id=1f66a6e6& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('canvas',{staticClass:"app-sign-canvas",attrs:{"id":_vm.domId}},[_vm._v("\n 您的浏览器不支持canvas技术,请升级浏览器!\n")])} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/SignCanvas/src/main.vue?vue&type=template&id=ef2dced2& +// CONCATENATED MODULE: ./packages/SignCanvas/src/main.vue?vue&type=template&id=1f66a6e6& // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.to-string.js var es6_regexp_to_string = __webpack_require__("6b54"); @@ -1919,8 +1919,12 @@ var es6_regexp_to_string = __webpack_require__("6b54"); e && e.preventDefault() && e.stopPropagation(); var touch = e.targetTouches[0]; // const getBCR = touch.target.getBoundingClientRect(); - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; @@ -1933,10 +1937,16 @@ var es6_regexp_to_string = __webpack_require__("6b54"); this.canvas.addEventListener('touchmove', function (e) { e && e.preventDefault() && e.stopPropagation(); var touch = e.targetTouches[0]; - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; + console.log(touch); _this.config.isWrite && _this.writing({ x: x, y: y @@ -1948,8 +1958,13 @@ var es6_regexp_to_string = __webpack_require__("6b54"); var tcs = e.targetTouches; var ccs = e.changedTouches; var touch = tcs && tcs.length && tcs[0] || ccs && ccs.length && ccs[0]; - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; @@ -1980,6 +1995,23 @@ var es6_regexp_to_string = __webpack_require__("6b54"); var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); saveLink.dispatchEvent(event); + }, + + /** + * 获取dom对象的偏移量 可以获取解决position定位的问题 + */ + offset: function offset(obj, direction) { + //将top,left首字母大写,并拼接成offsetTop,offsetLeft + var offsetDir = 'offset' + direction[0].toUpperCase() + direction.substring(1); + var realNum = obj[offsetDir]; + var positionParent = obj.offsetParent; //获取上一级定位元素对象 + + while (positionParent != null) { + realNum += positionParent[offsetDir]; + positionParent = positionParent.offsetParent; + } + + return realNum; } } }); diff --git a/lib/sign-canvas.umd.js b/lib/sign-canvas.umd.js index 5e49b16..dab2100 100644 --- a/lib/sign-canvas.umd.js +++ b/lib/sign-canvas.umd.js @@ -1651,12 +1651,12 @@ function _defineProperty(obj, key, value) { // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.function.name.js var es6_function_name = __webpack_require__("7f7f"); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4a763dc7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/SignCanvas/src/main.vue?vue&type=template&id=ef2dced2& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4a763dc7-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/SignCanvas/src/main.vue?vue&type=template&id=1f66a6e6& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('canvas',{staticClass:"app-sign-canvas",attrs:{"id":_vm.domId}},[_vm._v("\n 您的浏览器不支持canvas技术,请升级浏览器!\n")])} var staticRenderFns = [] -// CONCATENATED MODULE: ./packages/SignCanvas/src/main.vue?vue&type=template&id=ef2dced2& +// CONCATENATED MODULE: ./packages/SignCanvas/src/main.vue?vue&type=template&id=1f66a6e6& // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.to-string.js var es6_regexp_to_string = __webpack_require__("6b54"); @@ -1928,8 +1928,12 @@ var es6_regexp_to_string = __webpack_require__("6b54"); e && e.preventDefault() && e.stopPropagation(); var touch = e.targetTouches[0]; // const getBCR = touch.target.getBoundingClientRect(); - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; @@ -1942,10 +1946,16 @@ var es6_regexp_to_string = __webpack_require__("6b54"); this.canvas.addEventListener('touchmove', function (e) { e && e.preventDefault() && e.stopPropagation(); var touch = e.targetTouches[0]; - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; + console.log(touch); _this.config.isWrite && _this.writing({ x: x, y: y @@ -1957,8 +1967,13 @@ var es6_regexp_to_string = __webpack_require__("6b54"); var tcs = e.targetTouches; var ccs = e.changedTouches; var touch = tcs && tcs.length && tcs[0] || ccs && ccs.length && ccs[0]; - var offsetLeft = touch.target.offsetLeft; - var offsetTop = touch.target.offsetTop; + + var offsetLeft = _this.offset(touch.target, 'left'); + + var offsetTop = _this.offset(touch.target, 'top'); // const offsetLeft = touch.target.offsetLeft; + // const offsetTop = touch.target.offsetTop; + + var x = touch.pageX ? touch.pageX - offsetLeft : touch.clientX; var y = touch.pageY ? touch.pageY - offsetTop : touch.clientY; @@ -1989,6 +2004,23 @@ var es6_regexp_to_string = __webpack_require__("6b54"); var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); saveLink.dispatchEvent(event); + }, + + /** + * 获取dom对象的偏移量 可以获取解决position定位的问题 + */ + offset: function offset(obj, direction) { + //将top,left首字母大写,并拼接成offsetTop,offsetLeft + var offsetDir = 'offset' + direction[0].toUpperCase() + direction.substring(1); + var realNum = obj[offsetDir]; + var positionParent = obj.offsetParent; //获取上一级定位元素对象 + + while (positionParent != null) { + realNum += positionParent[offsetDir]; + positionParent = positionParent.offsetParent; + } + + return realNum; } } }); diff --git a/lib/sign-canvas.umd.min.js b/lib/sign-canvas.umd.min.js index b36aa1c..d24417b 100644 --- a/lib/sign-canvas.umd.min.js +++ b/lib/sign-canvas.umd.min.js @@ -1,2 +1,2 @@ -(function(t,n){"object"===typeof exports&&"object"===typeof module?module.exports=n():"function"===typeof define&&define.amd?define([],n):"object"===typeof exports?exports["sign-canvas"]=n():t["sign-canvas"]=n()})("undefined"!==typeof self?self:this,(function(){return function(t){var n={};function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},e.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(i,r,function(n){return t[n]}.bind(null,r));return i},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s="fb15")}({"01f9":function(t,n,e){"use strict";var i=e("2d00"),r=e("5ca1"),o=e("2aba"),c=e("32e9"),a=e("84f2"),f=e("41a0"),s=e("7f20"),u=e("38fd"),l=e("2b4c")("iterator"),p=!([].keys&&"next"in[].keys()),h="@@iterator",d="keys",v="values",g=function(){return this};t.exports=function(t,n,e,y,b,x,m){f(e,n,y);var w,S,O,P=function(t){if(!p&&t in W)return W[t];switch(t){case d:return function(){return new e(this,t)};case v:return function(){return new e(this,t)}}return function(){return new e(this,t)}},T=n+" Iterator",j=b==v,_=!1,W=t.prototype,E=W[l]||W[h]||b&&W[b],L=E||P(b),C=b?j?P("entries"):L:void 0,M="Array"==n&&W.entries||E;if(M&&(O=u(M.call(new t)),O!==Object.prototype&&O.next&&(s(O,T,!0),i||"function"==typeof O[l]||c(O,l,g))),j&&E&&E.name!==v&&(_=!0,L=function(){return E.call(this)}),i&&!m||!p&&!_&&W[l]||c(W,l,L),a[n]=L,a[T]=g,b)if(w={values:j?L:P(v),keys:x?L:P(d),entries:C},m)for(S in w)S in W||o(W,S,w[S]);else r(r.P+r.F*(p||_),n,w);return w}},"07e3":function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},"0bfb":function(t,n,e){"use strict";var i=e("cb7c");t.exports=function(){var t=i(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},"0d58":function(t,n,e){var i=e("ce10"),r=e("e11e");t.exports=Object.keys||function(t){return i(t,r)}},"11e9":function(t,n,e){var i=e("52a7"),r=e("4630"),o=e("6821"),c=e("6a99"),a=e("69a8"),f=e("c69a"),s=Object.getOwnPropertyDescriptor;n.f=e("9e1e")?s:function(t,n){if(t=o(t),n=c(n,!0),f)try{return s(t,n)}catch(e){}if(a(t,n))return r(!i.f.call(t,n),t[n])}},1495:function(t,n,e){var i=e("86cc"),r=e("cb7c"),o=e("0d58");t.exports=e("9e1e")?Object.defineProperties:function(t,n){r(t);var e,c=o(n),a=c.length,f=0;while(a>f)i.f(t,e=c[f++],n[e]);return t}},"1bc3":function(t,n,e){var i=e("f772");t.exports=function(t,n){if(!i(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!i(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(t,n,e){var i=e("f772"),r=e("e53d").document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},"230e":function(t,n,e){var i=e("d3f4"),r=e("7726").document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},2621:function(t,n){n.f=Object.getOwnPropertySymbols},"294c":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"2aba":function(t,n,e){var i=e("7726"),r=e("32e9"),o=e("69a8"),c=e("ca5a")("src"),a=e("fa5b"),f="toString",s=(""+a).split(f);e("8378").inspectSource=function(t){return a.call(t)},(t.exports=function(t,n,e,a){var f="function"==typeof e;f&&(o(e,"name")||r(e,"name",n)),t[n]!==e&&(f&&(o(e,c)||r(e,c,t[n]?""+t[n]:s.join(String(n)))),t===i?t[n]=e:a?t[n]?t[n]=e:r(t,n,e):(delete t[n],r(t,n,e)))})(Function.prototype,f,(function(){return"function"==typeof this&&this[c]||a.call(this)}))},"2aeb":function(t,n,e){var i=e("cb7c"),r=e("1495"),o=e("e11e"),c=e("613b")("IE_PROTO"),a=function(){},f="prototype",s=function(){var t,n=e("230e")("iframe"),i=o.length,r="<",c=">";n.style.display="none",e("fab2").appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(r+"script"+c+"document.F=Object"+r+"/script"+c),t.close(),s=t.F;while(i--)delete s[f][o[i]];return s()};t.exports=Object.create||function(t,n){var e;return null!==t?(a[f]=i(t),e=new a,a[f]=null,e[c]=t):e=s(),void 0===n?e:r(e,n)}},"2b4c":function(t,n,e){var i=e("5537")("wks"),r=e("ca5a"),o=e("7726").Symbol,c="function"==typeof o,a=t.exports=function(t){return i[t]||(i[t]=c&&o[t]||(c?o:r)("Symbol."+t))};a.store=i},"2d00":function(t,n){t.exports=!1},"2d95":function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},"32e9":function(t,n,e){var i=e("86cc"),r=e("4630");t.exports=e("9e1e")?function(t,n,e){return i.f(t,n,r(1,e))}:function(t,n,e){return t[n]=e,t}},"35e8":function(t,n,e){var i=e("d9f6"),r=e("aebd");t.exports=e("8e60")?function(t,n,e){return i.f(t,n,r(1,e))}:function(t,n,e){return t[n]=e,t}},3846:function(t,n,e){e("9e1e")&&"g"!=/./g.flags&&e("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:e("0bfb")})},"38fd":function(t,n,e){var i=e("69a8"),r=e("4bf8"),o=e("613b")("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},"41a0":function(t,n,e){"use strict";var i=e("2aeb"),r=e("4630"),o=e("7f20"),c={};e("32e9")(c,e("2b4c")("iterator"),(function(){return this})),t.exports=function(t,n,e){t.prototype=i(c,{next:r(1,e)}),o(t,n+" Iterator")}},"454f":function(t,n,e){e("46a7");var i=e("584a").Object;t.exports=function(t,n,e){return i.defineProperty(t,n,e)}},"456d":function(t,n,e){var i=e("4bf8"),r=e("0d58");e("5eda")("keys",(function(){return function(t){return r(i(t))}}))},4588:function(t,n){var e=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},4630:function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"46a7":function(t,n,e){var i=e("63b6");i(i.S+i.F*!e("8e60"),"Object",{defineProperty:e("d9f6").f})},"4bf8":function(t,n,e){var i=e("be13");t.exports=function(t){return Object(i(t))}},"52a7":function(t,n){n.f={}.propertyIsEnumerable},5537:function(t,n,e){var i=e("8378"),r=e("7726"),o="__core-js_shared__",c=r[o]||(r[o]={});(t.exports=function(t,n){return c[t]||(c[t]=void 0!==n?n:{})})("versions",[]).push({version:i.version,mode:e("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"584a":function(t,n){var e=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=e)},"5ca1":function(t,n,e){var i=e("7726"),r=e("8378"),o=e("32e9"),c=e("2aba"),a=e("9b43"),f="prototype",s=function(t,n,e){var u,l,p,h,d=t&s.F,v=t&s.G,g=t&s.S,y=t&s.P,b=t&s.B,x=v?i:g?i[n]||(i[n]={}):(i[n]||{})[f],m=v?r:r[n]||(r[n]={}),w=m[f]||(m[f]={});for(u in v&&(e=n),e)l=!d&&x&&void 0!==x[u],p=(l?x:e)[u],h=b&&l?a(p,i):y&&"function"==typeof p?a(Function.call,p):p,x&&c(x,u,p,t&s.U),m[u]!=p&&o(m,u,h),y&&w[u]!=p&&(w[u]=p)};i.core=r,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},"5eda":function(t,n,e){var i=e("5ca1"),r=e("8378"),o=e("79e5");t.exports=function(t,n){var e=(r.Object||{})[t]||Object[t],c={};c[t]=n(e),i(i.S+i.F*o((function(){e(1)})),"Object",c)}},"613b":function(t,n,e){var i=e("5537")("keys"),r=e("ca5a");t.exports=function(t){return i[t]||(i[t]=r(t))}},"626a":function(t,n,e){var i=e("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},"63b6":function(t,n,e){var i=e("e53d"),r=e("584a"),o=e("d864"),c=e("35e8"),a=e("07e3"),f="prototype",s=function(t,n,e){var u,l,p,h=t&s.F,d=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,b=t&s.W,x=d?r:r[n]||(r[n]={}),m=x[f],w=d?i:v?i[n]:(i[n]||{})[f];for(u in d&&(e=n),e)l=!h&&w&&void 0!==w[u],l&&a(x,u)||(p=l?w[u]:e[u],x[u]=d&&"function"!=typeof w[u]?e[u]:y&&l?o(p,i):b&&w[u]==p?function(t){var n=function(n,e,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,i)}return t.apply(this,arguments)};return n[f]=t[f],n}(p):g&&"function"==typeof p?o(Function.call,p):p,g&&((x.virtual||(x.virtual={}))[u]=p,t&s.R&&m&&!m[u]&&c(m,u,p)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},6821:function(t,n,e){var i=e("626a"),r=e("be13");t.exports=function(t){return i(r(t))}},"69a8":function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},"6a99":function(t,n,e){var i=e("d3f4");t.exports=function(t,n){if(!i(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!i(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},"6b54":function(t,n,e){"use strict";e("3846");var i=e("cb7c"),r=e("0bfb"),o=e("9e1e"),c="toString",a=/./[c],f=function(t){e("2aba")(RegExp.prototype,c,t,!0)};e("79e5")((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?f((function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?r.call(t):void 0)})):a.name!=c&&f((function(){return a.call(this)}))},7726:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},"77f1":function(t,n,e){var i=e("4588"),r=Math.max,o=Math.min;t.exports=function(t,n){return t=i(t),t<0?r(t+n,0):o(t,n)}},"794b":function(t,n,e){t.exports=!e("8e60")&&!e("294c")((function(){return 7!=Object.defineProperty(e("1ec9")("div"),"a",{get:function(){return 7}}).a}))},"79aa":function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"7f20":function(t,n,e){var i=e("86cc").f,r=e("69a8"),o=e("2b4c")("toStringTag");t.exports=function(t,n,e){t&&!r(t=e?t:t.prototype,o)&&i(t,o,{configurable:!0,value:n})}},"7f7f":function(t,n,e){var i=e("86cc").f,r=Function.prototype,o=/^\s*function ([^ (]*)/,c="name";c in r||e("9e1e")&&i(r,c,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},8378:function(t,n){var e=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=e)},"84f2":function(t,n){t.exports={}},"85f2":function(t,n,e){t.exports=e("454f")},"86cc":function(t,n,e){var i=e("cb7c"),r=e("c69a"),o=e("6a99"),c=Object.defineProperty;n.f=e("9e1e")?Object.defineProperty:function(t,n,e){if(i(t),n=o(n,!0),i(e),r)try{return c(t,n,e)}catch(a){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},"8e60":function(t,n,e){t.exports=!e("294c")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"8e6e":function(t,n,e){var i=e("5ca1"),r=e("990b"),o=e("6821"),c=e("11e9"),a=e("f1ae");i(i.S,"Object",{getOwnPropertyDescriptors:function(t){var n,e,i=o(t),f=c.f,s=r(i),u={},l=0;while(s.length>l)e=f(i,n=s[l++]),void 0!==e&&a(u,n,e);return u}})},9093:function(t,n,e){var i=e("ce10"),r=e("e11e").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},"990b":function(t,n,e){var i=e("9093"),r=e("2621"),o=e("cb7c"),c=e("7726").Reflect;t.exports=c&&c.ownKeys||function(t){var n=i.f(o(t)),e=r.f;return e?n.concat(e(t)):n}},"9b43":function(t,n,e){var i=e("d8e8");t.exports=function(t,n,e){if(i(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,i){return t.call(n,e,i)};case 3:return function(e,i,r){return t.call(n,e,i,r)}}return function(){return t.apply(n,arguments)}}},"9c6c":function(t,n,e){var i=e("2b4c")("unscopables"),r=Array.prototype;void 0==r[i]&&e("32e9")(r,i,{}),t.exports=function(t){r[i][t]=!0}},"9def":function(t,n,e){var i=e("4588"),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},"9e1e":function(t,n,e){t.exports=!e("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},ac6a:function(t,n,e){for(var i=e("cadf"),r=e("0d58"),o=e("2aba"),c=e("7726"),a=e("32e9"),f=e("84f2"),s=e("2b4c"),u=s("iterator"),l=s("toStringTag"),p=f.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=r(h),v=0;vu)if(a=f[u++],a!=a)return!0}else for(;s>u;u++)if((t||u in f)&&f[u]===e)return t||u||0;return!t&&-1}}},c69a:function(t,n,e){t.exports=!e("9e1e")&&!e("79e5")((function(){return 7!=Object.defineProperty(e("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(t,n){var e=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},cadf:function(t,n,e){"use strict";var i=e("9c6c"),r=e("d53b"),o=e("84f2"),c=e("6821");t.exports=e("01f9")(Array,"Array",(function(t,n){this._t=c(t),this._i=0,this._k=n}),(function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,r(1)):r(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},cb7c:function(t,n,e){var i=e("d3f4");t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,n,e){var i=e("69a8"),r=e("6821"),o=e("c366")(!1),c=e("613b")("IE_PROTO");t.exports=function(t,n){var e,a=r(t),f=0,s=[];for(e in a)e!=c&&i(a,e)&&s.push(e);while(n.length>f)i(a,e=n[f++])&&(~o(s,e)||s.push(e));return s}},d3f4:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},d864:function(t,n,e){var i=e("79aa");t.exports=function(t,n,e){if(i(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,i){return t.call(n,e,i)};case 3:return function(e,i,r){return t.call(n,e,i,r)}}return function(){return t.apply(n,arguments)}}},d8e8:function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d9f6:function(t,n,e){var i=e("e4ae"),r=e("794b"),o=e("1bc3"),c=Object.defineProperty;n.f=e("8e60")?Object.defineProperty:function(t,n,e){if(i(t),n=o(n,!0),i(e),r)try{return c(t,n,e)}catch(a){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},e11e:function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e4ae:function(t,n,e){var i=e("f772");t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},e53d:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},f1ae:function(t,n,e){"use strict";var i=e("86cc"),r=e("4630");t.exports=function(t,n,e){n in t?i.f(t,n,r(0,e)):t[n]=e}},f6fd:function(t,n){(function(t){var n="currentScript",e=t.getElementsByTagName("script");n in t||Object.defineProperty(t,n,{get:function(){try{throw new Error}catch(i){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in e)if(e[t].src==n||"interactive"==e[t].readyState)return e[t];return null}}})})(document)},f772:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},fa5b:function(t,n,e){t.exports=e("5537")("native-function-to-string",Function.toString)},fab2:function(t,n,e){var i=e("7726").document;t.exports=i&&i.documentElement},fb15:function(t,n,e){"use strict";var i;(e.r(n),"undefined"!==typeof window)&&(e("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=i[1]));e("8e6e"),e("ac6a"),e("456d");var r=e("85f2"),o=e.n(r);function c(t,n,e){return n in t?o()(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}e("7f7f");var a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("canvas",{staticClass:"app-sign-canvas",attrs:{id:t.domId}},[t._v("\n 您的浏览器不支持canvas技术,请升级浏览器!\n")])},f=[],s=(e("6b54"),{name:"SignCanvas",model:{value:"image",event:"confirm"},props:{image:{required:!1,type:[String],default:null},options:{required:!1,type:[Object],default:function(){return null}}},data:function(){return{value:null,domId:"sign-canvas-".concat(Math.random().toString(36).substr(2)),canvas:null,context:null,config:{lastWriteSpeed:1,lastWriteWidth:2,lineCap:"round",lineJoin:"round",canvasWidth:600,canvasHeight:600,isShowBorder:!0,bgColor:"#fcc",borderWidth:1,borderColor:"#ff787f",writeWidth:5,maxWriteWidth:30,minWriteWidth:5,writeColor:"#101010",isSign:!1,imgType:"png"}}},mounted:function(){this.init()},methods:{init:function(){this.canvas=document.getElementById(this.domId),this.context=this.canvas.getContext("2d");var t=this.options;if(t)for(var n in t)this.config[n]=t[n];this.canvasInit(),this.canvasClear()},setLineWidth:function(){var t=(new Date).getTime(),n=t-this.config.lastWriteTime;this.config.lastWriteTime=t;var e=this.config.minWriteWidth+(this.config.maxWriteWidth-this.config.minWriteWidth)*n/30;ethis.config.maxWriteWidth&&(e=this.config.maxWriteWidth),e=e.toFixed(2),this.config.isSign?this.context.lineWidth=this.config.writeWidth:this.context.lineWidth=this.config.lastWriteWidth=this.config.lastWriteWidth/4*3+e/4},writing:function(t){this.context.beginPath(),this.context.moveTo(this.config.lastPoint.x,this.config.lastPoint.y),this.context.lineTo(t.x,t.y),this.setLineWidth(),this.context.stroke(),this.config.lastPoint=t,this.context.closePath()},writeContextStyle:function(){this.context.beginPath(),this.context.strokeStyle=this.config.writeColor,this.context.lineCap=this.config.lineCap,this.context.lineJoin=this.config.lineJoin},writeBegin:function(t){this.config.isWrite=!0,this.config.lastWriteTime=(new Date).getTime(),this.config.lastPoint=t,this.writeContextStyle()},writeEnd:function(t){this.config.isWrite=!1,this.config.lastPoint=t,this.saveAsImg()},canvasClear:function(){this.context.save(),this.context.strokeStyle=this.config.writeColor,this.context.clearRect(0,0,this.config.canvasWidth,this.config.canvasHeight),this.context.beginPath();var t=this.config.borderWidth/2;this.config.isShowBorder&&(this.context.moveTo(t,t),this.context.lineTo(this.config.canvasWidth-t,t),this.context.lineTo(this.config.canvasWidth-t,this.config.canvasHeight-t),this.context.lineTo(t,this.config.canvasHeight-t),this.context.closePath(),this.context.lineWidth=this.config.borderWidth,this.context.strokeStyle=this.config.borderColor,this.context.stroke()),this.config.isShowBorder&&!this.config.isSign&&(this.context.moveTo(0,0),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight/2),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight/2),this.context.lineTo(0,this.config.canvasHeight/2),this.context.lineTo(0,this.config.canvasHeight),this.context.lineTo(this.config.canvasWidth,0),this.context.lineTo(this.config.canvasWidth/2,0),this.context.lineTo(this.config.canvasWidth/2,this.config.canvasHeight),this.context.stroke()),this.$emit("confirm",null),this.context.restore()},saveAsImg:function(){var t=new Image;return t.src=this.canvas.toDataURL("image/png"),this.$emit("confirm",t.src),t.src},canvasInit:function(){this.canvas.width=this.config.canvasWidth,this.canvas.height=this.config.canvasHeight,this.config.emptyCanvas=this.canvas.toDataURL("image/png"),this.bindEvent()},bindEvent:function(){var t=this;this.canvas.addEventListener("mousedown",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeBegin({x:n.offsetX||n.clientX,y:n.offsetY||n.clientY})})),this.canvas.addEventListener("mousemove",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.config.isWrite&&t.writing({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("mouseup",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeEnd({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("mouseleave",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeEnd({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("touchstart",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches[0],i=e.target.offsetLeft,r=e.target.offsetTop,o=e.pageX?e.pageX-i:e.clientX,c=e.pageY?e.pageY-r:e.clientY;t.writeBegin({x:o,y:c})})),this.canvas.addEventListener("touchmove",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches[0],i=e.target.offsetLeft,r=e.target.offsetTop,o=e.pageX?e.pageX-i:e.clientX,c=e.pageY?e.pageY-r:e.clientY;t.config.isWrite&&t.writing({x:o,y:c})})),this.canvas.addEventListener("touchend",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches,i=n.changedTouches,r=e&&e.length&&e[0]||i&&i.length&&i[0],o=r.target.offsetLeft,c=r.target.offsetTop,a=r.pageX?r.pageX-o:r.clientX,f=r.pageY?r.pageY-c:r.clientY;t.writeEnd({x:a,y:f})}))},downloadSignImg:function(t){var n=document.getElementById(this.domId),e=n.toDataURL("image/png");this.saveFile(e,t?"".concat(t,".").concat(this.config.imgType):"".concat(Date.parse(new Date),".").concat(this.config.imgType))},saveFile:function(t,n){var e=document.createElementNS("http://www.w3.org/1999/xhtml","a");e.href=t,e.download=n;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(i)}}}),u=s;function l(t,n,e,i,r,o,c,a){var f,s="function"===typeof t?t.options:t;if(n&&(s.render=n,s.staticRenderFns=e,s._compiled=!0),i&&(s.functional=!0),o&&(s._scopeId="data-v-"+o),c?(f=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},s._ssrRegister=f):r&&(f=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),f)if(s.functional){s._injectStyles=f;var u=s.render;s.render=function(t,n){return f.call(n),u(t,n)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,f):[f]}return{exports:t,options:s}}var p=l(u,a,f,!1,null,null,null),h=p.exports;h.install=function(t){t.component(h.name,h)};var d=h;function v(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function g(t){for(var n=1;nf)i.f(t,e=c[f++],n[e]);return t}},"1bc3":function(t,n,e){var i=e("f772");t.exports=function(t,n){if(!i(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!i(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(t,n,e){var i=e("f772"),r=e("e53d").document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},"230e":function(t,n,e){var i=e("d3f4"),r=e("7726").document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},2621:function(t,n){n.f=Object.getOwnPropertySymbols},"294c":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"2aba":function(t,n,e){var i=e("7726"),r=e("32e9"),o=e("69a8"),c=e("ca5a")("src"),a=e("fa5b"),f="toString",s=(""+a).split(f);e("8378").inspectSource=function(t){return a.call(t)},(t.exports=function(t,n,e,a){var f="function"==typeof e;f&&(o(e,"name")||r(e,"name",n)),t[n]!==e&&(f&&(o(e,c)||r(e,c,t[n]?""+t[n]:s.join(String(n)))),t===i?t[n]=e:a?t[n]?t[n]=e:r(t,n,e):(delete t[n],r(t,n,e)))})(Function.prototype,f,(function(){return"function"==typeof this&&this[c]||a.call(this)}))},"2aeb":function(t,n,e){var i=e("cb7c"),r=e("1495"),o=e("e11e"),c=e("613b")("IE_PROTO"),a=function(){},f="prototype",s=function(){var t,n=e("230e")("iframe"),i=o.length,r="<",c=">";n.style.display="none",e("fab2").appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(r+"script"+c+"document.F=Object"+r+"/script"+c),t.close(),s=t.F;while(i--)delete s[f][o[i]];return s()};t.exports=Object.create||function(t,n){var e;return null!==t?(a[f]=i(t),e=new a,a[f]=null,e[c]=t):e=s(),void 0===n?e:r(e,n)}},"2b4c":function(t,n,e){var i=e("5537")("wks"),r=e("ca5a"),o=e("7726").Symbol,c="function"==typeof o,a=t.exports=function(t){return i[t]||(i[t]=c&&o[t]||(c?o:r)("Symbol."+t))};a.store=i},"2d00":function(t,n){t.exports=!1},"2d95":function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},"32e9":function(t,n,e){var i=e("86cc"),r=e("4630");t.exports=e("9e1e")?function(t,n,e){return i.f(t,n,r(1,e))}:function(t,n,e){return t[n]=e,t}},"35e8":function(t,n,e){var i=e("d9f6"),r=e("aebd");t.exports=e("8e60")?function(t,n,e){return i.f(t,n,r(1,e))}:function(t,n,e){return t[n]=e,t}},3846:function(t,n,e){e("9e1e")&&"g"!=/./g.flags&&e("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:e("0bfb")})},"38fd":function(t,n,e){var i=e("69a8"),r=e("4bf8"),o=e("613b")("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},"41a0":function(t,n,e){"use strict";var i=e("2aeb"),r=e("4630"),o=e("7f20"),c={};e("32e9")(c,e("2b4c")("iterator"),(function(){return this})),t.exports=function(t,n,e){t.prototype=i(c,{next:r(1,e)}),o(t,n+" Iterator")}},"454f":function(t,n,e){e("46a7");var i=e("584a").Object;t.exports=function(t,n,e){return i.defineProperty(t,n,e)}},"456d":function(t,n,e){var i=e("4bf8"),r=e("0d58");e("5eda")("keys",(function(){return function(t){return r(i(t))}}))},4588:function(t,n){var e=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},4630:function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"46a7":function(t,n,e){var i=e("63b6");i(i.S+i.F*!e("8e60"),"Object",{defineProperty:e("d9f6").f})},"4bf8":function(t,n,e){var i=e("be13");t.exports=function(t){return Object(i(t))}},"52a7":function(t,n){n.f={}.propertyIsEnumerable},5537:function(t,n,e){var i=e("8378"),r=e("7726"),o="__core-js_shared__",c=r[o]||(r[o]={});(t.exports=function(t,n){return c[t]||(c[t]=void 0!==n?n:{})})("versions",[]).push({version:i.version,mode:e("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"584a":function(t,n){var e=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=e)},"5ca1":function(t,n,e){var i=e("7726"),r=e("8378"),o=e("32e9"),c=e("2aba"),a=e("9b43"),f="prototype",s=function(t,n,e){var u,l,p,h,d=t&s.F,v=t&s.G,g=t&s.S,y=t&s.P,b=t&s.B,x=v?i:g?i[n]||(i[n]={}):(i[n]||{})[f],m=v?r:r[n]||(r[n]={}),w=m[f]||(m[f]={});for(u in v&&(e=n),e)l=!d&&x&&void 0!==x[u],p=(l?x:e)[u],h=b&&l?a(p,i):y&&"function"==typeof p?a(Function.call,p):p,x&&c(x,u,p,t&s.U),m[u]!=p&&o(m,u,h),y&&w[u]!=p&&(w[u]=p)};i.core=r,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},"5eda":function(t,n,e){var i=e("5ca1"),r=e("8378"),o=e("79e5");t.exports=function(t,n){var e=(r.Object||{})[t]||Object[t],c={};c[t]=n(e),i(i.S+i.F*o((function(){e(1)})),"Object",c)}},"613b":function(t,n,e){var i=e("5537")("keys"),r=e("ca5a");t.exports=function(t){return i[t]||(i[t]=r(t))}},"626a":function(t,n,e){var i=e("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},"63b6":function(t,n,e){var i=e("e53d"),r=e("584a"),o=e("d864"),c=e("35e8"),a=e("07e3"),f="prototype",s=function(t,n,e){var u,l,p,h=t&s.F,d=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,b=t&s.W,x=d?r:r[n]||(r[n]={}),m=x[f],w=d?i:v?i[n]:(i[n]||{})[f];for(u in d&&(e=n),e)l=!h&&w&&void 0!==w[u],l&&a(x,u)||(p=l?w[u]:e[u],x[u]=d&&"function"!=typeof w[u]?e[u]:y&&l?o(p,i):b&&w[u]==p?function(t){var n=function(n,e,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,e)}return new t(n,e,i)}return t.apply(this,arguments)};return n[f]=t[f],n}(p):g&&"function"==typeof p?o(Function.call,p):p,g&&((x.virtual||(x.virtual={}))[u]=p,t&s.R&&m&&!m[u]&&c(m,u,p)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},6821:function(t,n,e){var i=e("626a"),r=e("be13");t.exports=function(t){return i(r(t))}},"69a8":function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},"6a99":function(t,n,e){var i=e("d3f4");t.exports=function(t,n){if(!i(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!i(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!i(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},"6b54":function(t,n,e){"use strict";e("3846");var i=e("cb7c"),r=e("0bfb"),o=e("9e1e"),c="toString",a=/./[c],f=function(t){e("2aba")(RegExp.prototype,c,t,!0)};e("79e5")((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?f((function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?r.call(t):void 0)})):a.name!=c&&f((function(){return a.call(this)}))},7726:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},"77f1":function(t,n,e){var i=e("4588"),r=Math.max,o=Math.min;t.exports=function(t,n){return t=i(t),t<0?r(t+n,0):o(t,n)}},"794b":function(t,n,e){t.exports=!e("8e60")&&!e("294c")((function(){return 7!=Object.defineProperty(e("1ec9")("div"),"a",{get:function(){return 7}}).a}))},"79aa":function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"7f20":function(t,n,e){var i=e("86cc").f,r=e("69a8"),o=e("2b4c")("toStringTag");t.exports=function(t,n,e){t&&!r(t=e?t:t.prototype,o)&&i(t,o,{configurable:!0,value:n})}},"7f7f":function(t,n,e){var i=e("86cc").f,r=Function.prototype,o=/^\s*function ([^ (]*)/,c="name";c in r||e("9e1e")&&i(r,c,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},8378:function(t,n){var e=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=e)},"84f2":function(t,n){t.exports={}},"85f2":function(t,n,e){t.exports=e("454f")},"86cc":function(t,n,e){var i=e("cb7c"),r=e("c69a"),o=e("6a99"),c=Object.defineProperty;n.f=e("9e1e")?Object.defineProperty:function(t,n,e){if(i(t),n=o(n,!0),i(e),r)try{return c(t,n,e)}catch(a){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},"8e60":function(t,n,e){t.exports=!e("294c")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"8e6e":function(t,n,e){var i=e("5ca1"),r=e("990b"),o=e("6821"),c=e("11e9"),a=e("f1ae");i(i.S,"Object",{getOwnPropertyDescriptors:function(t){var n,e,i=o(t),f=c.f,s=r(i),u={},l=0;while(s.length>l)e=f(i,n=s[l++]),void 0!==e&&a(u,n,e);return u}})},9093:function(t,n,e){var i=e("ce10"),r=e("e11e").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},"990b":function(t,n,e){var i=e("9093"),r=e("2621"),o=e("cb7c"),c=e("7726").Reflect;t.exports=c&&c.ownKeys||function(t){var n=i.f(o(t)),e=r.f;return e?n.concat(e(t)):n}},"9b43":function(t,n,e){var i=e("d8e8");t.exports=function(t,n,e){if(i(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,i){return t.call(n,e,i)};case 3:return function(e,i,r){return t.call(n,e,i,r)}}return function(){return t.apply(n,arguments)}}},"9c6c":function(t,n,e){var i=e("2b4c")("unscopables"),r=Array.prototype;void 0==r[i]&&e("32e9")(r,i,{}),t.exports=function(t){r[i][t]=!0}},"9def":function(t,n,e){var i=e("4588"),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},"9e1e":function(t,n,e){t.exports=!e("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},ac6a:function(t,n,e){for(var i=e("cadf"),r=e("0d58"),o=e("2aba"),c=e("7726"),a=e("32e9"),f=e("84f2"),s=e("2b4c"),u=s("iterator"),l=s("toStringTag"),p=f.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=r(h),v=0;vu)if(a=f[u++],a!=a)return!0}else for(;s>u;u++)if((t||u in f)&&f[u]===e)return t||u||0;return!t&&-1}}},c69a:function(t,n,e){t.exports=!e("9e1e")&&!e("79e5")((function(){return 7!=Object.defineProperty(e("230e")("div"),"a",{get:function(){return 7}}).a}))},ca5a:function(t,n){var e=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},cadf:function(t,n,e){"use strict";var i=e("9c6c"),r=e("d53b"),o=e("84f2"),c=e("6821");t.exports=e("01f9")(Array,"Array",(function(t,n){this._t=c(t),this._i=0,this._k=n}),(function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,r(1)):r(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},cb7c:function(t,n,e){var i=e("d3f4");t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,n,e){var i=e("69a8"),r=e("6821"),o=e("c366")(!1),c=e("613b")("IE_PROTO");t.exports=function(t,n){var e,a=r(t),f=0,s=[];for(e in a)e!=c&&i(a,e)&&s.push(e);while(n.length>f)i(a,e=n[f++])&&(~o(s,e)||s.push(e));return s}},d3f4:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d53b:function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},d864:function(t,n,e){var i=e("79aa");t.exports=function(t,n,e){if(i(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,i){return t.call(n,e,i)};case 3:return function(e,i,r){return t.call(n,e,i,r)}}return function(){return t.apply(n,arguments)}}},d8e8:function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d9f6:function(t,n,e){var i=e("e4ae"),r=e("794b"),o=e("1bc3"),c=Object.defineProperty;n.f=e("8e60")?Object.defineProperty:function(t,n,e){if(i(t),n=o(n,!0),i(e),r)try{return c(t,n,e)}catch(a){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},e11e:function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e4ae:function(t,n,e){var i=e("f772");t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},e53d:function(t,n){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},f1ae:function(t,n,e){"use strict";var i=e("86cc"),r=e("4630");t.exports=function(t,n,e){n in t?i.f(t,n,r(0,e)):t[n]=e}},f6fd:function(t,n){(function(t){var n="currentScript",e=t.getElementsByTagName("script");n in t||Object.defineProperty(t,n,{get:function(){try{throw new Error}catch(i){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in e)if(e[t].src==n||"interactive"==e[t].readyState)return e[t];return null}}})})(document)},f772:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},fa5b:function(t,n,e){t.exports=e("5537")("native-function-to-string",Function.toString)},fab2:function(t,n,e){var i=e("7726").document;t.exports=i&&i.documentElement},fb15:function(t,n,e){"use strict";var i;(e.r(n),"undefined"!==typeof window)&&(e("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=i[1]));e("8e6e"),e("ac6a"),e("456d");var r=e("85f2"),o=e.n(r);function c(t,n,e){return n in t?o()(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}e("7f7f");var a=function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("canvas",{staticClass:"app-sign-canvas",attrs:{id:t.domId}},[t._v("\n 您的浏览器不支持canvas技术,请升级浏览器!\n")])},f=[],s=(e("6b54"),{name:"SignCanvas",model:{value:"image",event:"confirm"},props:{image:{required:!1,type:[String],default:null},options:{required:!1,type:[Object],default:function(){return null}}},data:function(){return{value:null,domId:"sign-canvas-".concat(Math.random().toString(36).substr(2)),canvas:null,context:null,config:{lastWriteSpeed:1,lastWriteWidth:2,lineCap:"round",lineJoin:"round",canvasWidth:600,canvasHeight:600,isShowBorder:!0,bgColor:"#fcc",borderWidth:1,borderColor:"#ff787f",writeWidth:5,maxWriteWidth:30,minWriteWidth:5,writeColor:"#101010",isSign:!1,imgType:"png"}}},mounted:function(){this.init()},methods:{init:function(){this.canvas=document.getElementById(this.domId),this.context=this.canvas.getContext("2d");var t=this.options;if(t)for(var n in t)this.config[n]=t[n];this.canvasInit(),this.canvasClear()},setLineWidth:function(){var t=(new Date).getTime(),n=t-this.config.lastWriteTime;this.config.lastWriteTime=t;var e=this.config.minWriteWidth+(this.config.maxWriteWidth-this.config.minWriteWidth)*n/30;ethis.config.maxWriteWidth&&(e=this.config.maxWriteWidth),e=e.toFixed(2),this.config.isSign?this.context.lineWidth=this.config.writeWidth:this.context.lineWidth=this.config.lastWriteWidth=this.config.lastWriteWidth/4*3+e/4},writing:function(t){this.context.beginPath(),this.context.moveTo(this.config.lastPoint.x,this.config.lastPoint.y),this.context.lineTo(t.x,t.y),this.setLineWidth(),this.context.stroke(),this.config.lastPoint=t,this.context.closePath()},writeContextStyle:function(){this.context.beginPath(),this.context.strokeStyle=this.config.writeColor,this.context.lineCap=this.config.lineCap,this.context.lineJoin=this.config.lineJoin},writeBegin:function(t){this.config.isWrite=!0,this.config.lastWriteTime=(new Date).getTime(),this.config.lastPoint=t,this.writeContextStyle()},writeEnd:function(t){this.config.isWrite=!1,this.config.lastPoint=t,this.saveAsImg()},canvasClear:function(){this.context.save(),this.context.strokeStyle=this.config.writeColor,this.context.clearRect(0,0,this.config.canvasWidth,this.config.canvasHeight),this.context.beginPath();var t=this.config.borderWidth/2;this.config.isShowBorder&&(this.context.moveTo(t,t),this.context.lineTo(this.config.canvasWidth-t,t),this.context.lineTo(this.config.canvasWidth-t,this.config.canvasHeight-t),this.context.lineTo(t,this.config.canvasHeight-t),this.context.closePath(),this.context.lineWidth=this.config.borderWidth,this.context.strokeStyle=this.config.borderColor,this.context.stroke()),this.config.isShowBorder&&!this.config.isSign&&(this.context.moveTo(0,0),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight/2),this.context.lineTo(this.config.canvasWidth,this.config.canvasHeight/2),this.context.lineTo(0,this.config.canvasHeight/2),this.context.lineTo(0,this.config.canvasHeight),this.context.lineTo(this.config.canvasWidth,0),this.context.lineTo(this.config.canvasWidth/2,0),this.context.lineTo(this.config.canvasWidth/2,this.config.canvasHeight),this.context.stroke()),this.$emit("confirm",null),this.context.restore()},saveAsImg:function(){var t=new Image;return t.src=this.canvas.toDataURL("image/png"),this.$emit("confirm",t.src),t.src},canvasInit:function(){this.canvas.width=this.config.canvasWidth,this.canvas.height=this.config.canvasHeight,this.config.emptyCanvas=this.canvas.toDataURL("image/png"),this.bindEvent()},bindEvent:function(){var t=this;this.canvas.addEventListener("mousedown",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeBegin({x:n.offsetX||n.clientX,y:n.offsetY||n.clientY})})),this.canvas.addEventListener("mousemove",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.config.isWrite&&t.writing({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("mouseup",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeEnd({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("mouseleave",(function(n){n&&n.preventDefault()&&n.stopPropagation(),t.writeEnd({x:n.offsetX,y:n.offsetY})})),this.canvas.addEventListener("touchstart",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches[0],i=t.offset(e.target,"left"),r=t.offset(e.target,"top"),o=e.pageX?e.pageX-i:e.clientX,c=e.pageY?e.pageY-r:e.clientY;t.writeBegin({x:o,y:c})})),this.canvas.addEventListener("touchmove",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches[0],i=t.offset(e.target,"left"),r=t.offset(e.target,"top"),o=e.pageX?e.pageX-i:e.clientX,c=e.pageY?e.pageY-r:e.clientY;console.log(e),t.config.isWrite&&t.writing({x:o,y:c})})),this.canvas.addEventListener("touchend",(function(n){n&&n.preventDefault()&&n.stopPropagation();var e=n.targetTouches,i=n.changedTouches,r=e&&e.length&&e[0]||i&&i.length&&i[0],o=t.offset(r.target,"left"),c=t.offset(r.target,"top"),a=r.pageX?r.pageX-o:r.clientX,f=r.pageY?r.pageY-c:r.clientY;t.writeEnd({x:a,y:f})}))},downloadSignImg:function(t){var n=document.getElementById(this.domId),e=n.toDataURL("image/png");this.saveFile(e,t?"".concat(t,".").concat(this.config.imgType):"".concat(Date.parse(new Date),".").concat(this.config.imgType))},saveFile:function(t,n){var e=document.createElementNS("http://www.w3.org/1999/xhtml","a");e.href=t,e.download=n;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(i)},offset:function(t,n){var e="offset"+n[0].toUpperCase()+n.substring(1),i=t[e],r=t.offsetParent;while(null!=r)i+=r[e],r=r.offsetParent;return i}}}),u=s;function l(t,n,e,i,r,o,c,a){var f,s="function"===typeof t?t.options:t;if(n&&(s.render=n,s.staticRenderFns=e,s._compiled=!0),i&&(s.functional=!0),o&&(s._scopeId="data-v-"+o),c?(f=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},s._ssrRegister=f):r&&(f=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),f)if(s.functional){s._injectStyles=f;var u=s.render;s.render=function(t,n){return f.call(n),u(t,n)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,f):[f]}return{exports:t,options:s}}var p=l(u,a,f,!1,null,null,null),h=p.exports;h.install=function(t){t.component(h.name,h)};var d=h;function v(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function g(t){for(var n=1;n