diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 9d958e7..5d80565 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -22,7 +22,9 @@ 15 15 - --enable-preview + + --enable-preview + false @@ -70,13 +72,6 @@ nutzboot-maven-plugin ${nutzboot.version} - - maven-compiler-plugin - - 15 - 15 - - diff --git a/pom.xml b/pom.xml index 1bebe40..35af87c 100644 --- a/pom.xml +++ b/pom.xml @@ -546,7 +546,10 @@ 15 15 - --enable-preview + + + --enable-preview + false @@ -598,14 +601,6 @@ nutzboot-maven-plugin ${nutzboot.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 15 - 15 - - diff --git a/src/main/resources/static/assets/platform/js/signature-20261112-4.js b/src/main/resources/static/assets/platform/js/signature-20261112-4.js new file mode 100644 index 0000000..c8c9d98 --- /dev/null +++ b/src/main/resources/static/assets/platform/js/signature-20261112-4.js @@ -0,0 +1,150 @@ +"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self,t.Signature=e)}(void 0,function(t){function e(){o.step++,o.step { + i.lineWidth = options.lineWidth; + i.strokeStyle = options.lineColor; + if (options.overflow === true) document.body.style.overflow = 'hidden'; + n.style.touchAction = 'none'; + try { + o.firstStatus = o.getContentBase64(); + } catch (error) { + // 空白快照失败时,清空仍可直接擦除画布,不依赖图片解码。 + o.reset = () => { + i.clearRect(0, 0, n.width, n.height); + o.step = -1; + o.status = []; + }; + } + let point = null; + let activeId = null; + // client 坐标按画布实际显示尺寸换算,避免边框、缩放造成笔迹偏移。 + const position = (event) => { + const rect = n.getBoundingClientRect(); + return { + x: (event.clientX - rect.left - n.clientLeft) * n.width / n.clientWidth, + y: (event.clientY - rect.top - n.clientTop) * n.height / n.clientHeight + }; + }; + const begin = (event) => { + point = position(event); + try { + const snapshot = o.getContentBase64(); + o.step++; + o.status.length = o.step; + o.status.push(snapshot); + } catch (error) { + // 历史记录仅用于撤销;快照失败不能阻断当前笔画。 + } + }; + const move = (event) => { + if (!point) return; + const next = position(event); + i.beginPath(); + i.moveTo(point.x, point.y); + i.lineTo(next.x, next.y); + i.stroke(); + point = next; + }; + let source = ''; + let pointerType = ''; + let captured = false; + let ignoreMouseUntil = 0; + // 仅阻止画布内可取消的手势,避免被动监听异常和浏览器滚动抢占笔画。 + const prevent = (event) => { + if (event.cancelable) event.preventDefault(); + }; + const end = () => { + point = null; + activeId = null; + source = ''; + pointerType = ''; + captured = false; + }; + const suppressMouse = () => { ignoreMouseUntil = Date.now() + 800; }; + // changedTouches 是 TouchList,不要求内核实现迭代器;只处理当前落笔手指。 + const findTouch = (list) => { + for (let index = 0; list && index < list.length; index++) { + if (list[index].identifier === activeId) return list[index]; + } + return null; + }; + n.addEventListener('pointerdown', (event) => { + const type = event.pointerType || ''; + if (source || (type === 'mouse' && (event.button !== 0 || Date.now() < ignoreMouseUntil))) return; + source = 'pointer'; + pointerType = type; + activeId = event.pointerId; + begin(event); + if (type !== 'mouse') suppressMouse(); + // 部分内核提供 PointerEvent 却不支持捕获;捕获失败仍允许在画布内绘制。 + try { + if (typeof n.setPointerCapture === 'function') { + n.setPointerCapture(event.pointerId); + captured = true; + } + } catch (error) { + captured = false; + } + prevent(event); + }); + n.addEventListener('pointermove', (event) => { + if (source !== 'pointer' || event.pointerId !== activeId) return; + move(event); + prevent(event); + }); + ['pointerup', 'pointercancel', 'lostpointercapture'].forEach((name) => { + n.addEventListener(name, (event) => { + if (source !== 'pointer' || event.pointerId !== activeId) return; + if (pointerType !== 'mouse') suppressMouse(); + end(); + }); + }); + n.addEventListener('pointerleave', () => { + if (source === 'pointer' && !captured) end(); + }); + // 始终绑定触摸兜底。若只收到 pointerdown 而没有 pointermove,touchstart 可接管该笔画。 + n.addEventListener('touchstart', (event) => { + suppressMouse(); + prevent(event); + const touch = event.changedTouches && event.changedTouches[0]; + if (!touch || source === 'touch' || source === 'mouse') return; + if (source === 'pointer') { + if (pointerType === 'mouse' || pointerType === 'pen') return; + // 接管不再保存第二份历史,也不重复画线;后续指针事件由来源锁忽略。 + point = position(touch); + } else { + begin(touch); + } + source = 'touch'; + activeId = touch.identifier; + }, {passive: false}); + n.addEventListener('touchmove', (event) => { + suppressMouse(); + prevent(event); + if (source !== 'touch') return; + const touch = findTouch(event.changedTouches); + if (touch) move(touch); + }, {passive: false}); + ['touchend', 'touchcancel'].forEach((name) => { + n.addEventListener(name, (event) => { + suppressMouse(); + prevent(event); + if (source === 'touch' && findTouch(event.changedTouches)) end(); + }, {passive: false}); + }); + // 兼容旧内核鼠标输入,并过滤触摸结束后生成的合成鼠标事件。 + n.addEventListener('mousedown', (event) => { + if (source || event.button !== 0 || Date.now() < ignoreMouseUntil) return; + source = 'mouse'; + begin(event); + prevent(event); + }); + n.addEventListener('mousemove', (event) => { + if (source === 'mouse') move(event); + }); + ['mouseup', 'mouseleave'].forEach((name) => { + n.addEventListener(name, () => { + if (source === 'mouse') end(); + }); + }); +},this.getContentBase64=function(t,e){if(t){var i=!0,s=!1,a=void 0;try{for(var r,f=document.querySelectorAll('canvas[data-none="1"]')[Symbol.iterator]();!(i=(r=f.next()).done);i=!0){var d=r.value;d.parentNode.removeChild(d)}}catch(t){s=!0,a=t}finally{try{!i&&f.return&&f.return()}finally{if(s)throw a}}var l=document.createElement("canvas");l.dataset.none="1",l.width=n.offsetHeight,l.height=n.offsetWidth,document.body.appendChild(l);var c=document.querySelector('canvas[data-none="1"]').getContext("2d"),u=new Image;u.src=o.getContentBase64(),u.onload=function(){var t=Math.round(n.offsetHeight/2),o=Math.round(n.offsetWidth/2);c.save(),c.translate(t,o),c.rotate(-90*Math.PI/180),c.drawImage(u,-u.width/2,-u.height/2),c.restore(),e&&e(document.querySelector('canvas[data-none="1"]').toDataURL("image/png"))}}else{if(!e)return n.toDataURL("image/png");e(n.toDataURL("image/png"))}},this.getBlob=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getContentBase64(),e=t.split(","),o=e[0].match(/:(.*?);/)[1],n=atob(e[1]),i=n.length,s=new Uint8Array(i);i--;)s[i]=n.charCodeAt(i);return new Blob([s],{type:o})},this.getFile=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getContentBase64(),o=t||"file",n=e.split(","),i=n[0].match(/:(.*?);/)[1],s=i.split("/")[1],a=atob(n[1]),r=a.length,f=new Uint8Array(r);r--;)f[r]=a.charCodeAt(r);return new File([f],o+"."+s,{type:i})},this.reset=function(){if(!o.firstStatus)return!1;i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var t=new Image;try{t.src=o.firstStatus,t.addEventListener("load",function(){i.drawImage(t,0,0)}),o.step=-1,o.status=[]}catch(t){}},this.undo=function(t){if(o.step>=0){i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var e=new Image;try{e.src=o.status[o.step],e.addEventListener("load",function(){i.drawImage(e,0,0)})}catch(t){}o.step--}else console.warn("no more undo"),t&&t()},this.redo=function(t){if(o.step0&&void 0!==arguments[0]?arguments[0]:o.option;i.lineWidth=t.lineWidth,i.strokeStyle=t.lineColor,!0===t.overflow&&(document.querySelector("body").style.overflow="hidden");var s="",a=navigator.userAgent.toLocaleLowerCase();o.firstStatus=o.getContentBase64(),-1!==a.indexOf("iphone")||-1!==a.indexOf("android")?(n.addEventListener("touchstart",function(t){s={x:t.touches[0].clientX-this.offsetLeft,y:t.touches[0].clientY-this.offsetTop}}),n.addEventListener("touchmove",function(t){i.beginPath(),i.moveTo(s.x,s.y),s={x:t.touches[0].clientX-this.offsetLeft,y:t.touches[0].clientY-this.offsetTop},i.lineTo(s.x,s.y),i.fill(),i.closePath(),i.stroke()}),n.addEventListener("touchend",function(){s=""})):(n.addEventListener("mousedown",function(t){e(),s={x:t.clientX-this.offsetLeft,y:t.clientY-this.offsetTop}}),n.addEventListener("mousemove",function(t){s.x&&s.y&&(i.beginPath(),i.moveTo(s.x,s.y),s={x:t.clientX-this.offsetLeft,y:t.clientY-this.offsetTop},i.lineTo(s.x,s.y),i.fill(),i.closePath(),i.stroke())}),n.addEventListener("mouseup",function(){s=""}),n.addEventListener("mouseout",function(){s=""}))},this.getContentBase64=function(t,e){if(t){var i=!0,s=!1,a=void 0;try{for(var r,f=document.querySelectorAll('canvas[data-none="1"]')[Symbol.iterator]();!(i=(r=f.next()).done);i=!0){var d=r.value;d.parentNode.removeChild(d)}}catch(t){s=!0,a=t}finally{try{!i&&f.return&&f.return()}finally{if(s)throw a}}var l=document.createElement("canvas");l.dataset.none="1",l.width=n.offsetHeight,l.height=n.offsetWidth,document.body.appendChild(l);var c=document.querySelector('canvas[data-none="1"]').getContext("2d"),u=new Image;u.src=o.getContentBase64(),u.onload=function(){var t=Math.round(n.offsetHeight/2),o=Math.round(n.offsetWidth/2);c.save(),c.translate(t,o),c.rotate(-90*Math.PI/180),c.drawImage(u,-u.width/2,-u.height/2),c.restore(),e&&e(document.querySelector('canvas[data-none="1"]').toDataURL("image/png"))}}else{if(!e)return n.toDataURL("image/png");e(n.toDataURL("image/png"))}},this.getBlob=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getContentBase64(),e=t.split(","),o=e[0].match(/:(.*?);/)[1],n=atob(e[1]),i=n.length,s=new Uint8Array(i);i--;)s[i]=n.charCodeAt(i);return new Blob([s],{type:o})},this.getFile=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getContentBase64(),o=t||"file",n=e.split(","),i=n[0].match(/:(.*?);/)[1],s=i.split("/")[1],a=atob(n[1]),r=a.length,f=new Uint8Array(r);r--;)f[r]=a.charCodeAt(r);return new File([f],o+"."+s,{type:i})},this.reset=function(){if(!o.firstStatus)return!1;i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var t=new Image;try{t.src=o.firstStatus,t.addEventListener("load",function(){i.drawImage(t,0,0)}),o.step=-1,o.status=[]}catch(t){}},this.undo=function(t){if(o.step>=0){i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var e=new Image;try{e.src=o.status[o.step],e.addEventListener("load",function(){i.drawImage(e,0,0)})}catch(t){}o.step--}else console.warn("no more undo"),t&&t()},this.redo=function(t){if(o.step { + i.lineWidth = options.lineWidth; + i.strokeStyle = options.lineColor; + if (options.overflow === true) document.body.style.overflow = 'hidden'; + n.style.touchAction = 'none'; + try { + o.firstStatus = o.getContentBase64(); + } catch (error) { + // 空白快照失败时,清空仍可直接擦除画布,不依赖图片解码。 + o.reset = () => { + i.clearRect(0, 0, n.width, n.height); + o.step = -1; + o.status = []; + }; + } + let point = null; + let activeId = null; + // client 坐标按画布实际显示尺寸换算,避免边框、缩放造成笔迹偏移。 + const position = (event) => { + const rect = n.getBoundingClientRect(); + return { + x: (event.clientX - rect.left - n.clientLeft) * n.width / n.clientWidth, + y: (event.clientY - rect.top - n.clientTop) * n.height / n.clientHeight + }; + }; + const begin = (event) => { + point = position(event); + try { + const snapshot = o.getContentBase64(); + o.step++; + o.status.length = o.step; + o.status.push(snapshot); + } catch (error) { + // 历史记录仅用于撤销;快照失败不能阻断当前笔画。 + } + }; + const move = (event) => { + if (!point) return; + const next = position(event); + i.beginPath(); + i.moveTo(point.x, point.y); + i.lineTo(next.x, next.y); + i.stroke(); + point = next; + }; + let source = ''; + let pointerType = ''; + let captured = false; + let ignoreMouseUntil = 0; + // 仅阻止画布内可取消的手势,避免被动监听异常和浏览器滚动抢占笔画。 + const prevent = (event) => { + if (event.cancelable) event.preventDefault(); + }; + const end = () => { + point = null; + activeId = null; + source = ''; + pointerType = ''; + captured = false; + }; + const suppressMouse = () => { ignoreMouseUntil = Date.now() + 800; }; + // changedTouches 是 TouchList,不要求内核实现迭代器;只处理当前落笔手指。 + const findTouch = (list) => { + for (let index = 0; list && index < list.length; index++) { + if (list[index].identifier === activeId) return list[index]; + } + return null; + }; + n.addEventListener('pointerdown', (event) => { + const type = event.pointerType || ''; + if (source || (type === 'mouse' && (event.button !== 0 || Date.now() < ignoreMouseUntil))) return; + source = 'pointer'; + pointerType = type; + activeId = event.pointerId; + begin(event); + if (type !== 'mouse') suppressMouse(); + // 部分内核提供 PointerEvent 却不支持捕获;捕获失败仍允许在画布内绘制。 + try { + if (typeof n.setPointerCapture === 'function') { + n.setPointerCapture(event.pointerId); + captured = true; + } + } catch (error) { + captured = false; + } + prevent(event); + }); + n.addEventListener('pointermove', (event) => { + if (source !== 'pointer' || event.pointerId !== activeId) return; + move(event); + prevent(event); + }); + ['pointerup', 'pointercancel', 'lostpointercapture'].forEach((name) => { + n.addEventListener(name, (event) => { + if (source !== 'pointer' || event.pointerId !== activeId) return; + if (pointerType !== 'mouse') suppressMouse(); + end(); + }); + }); + n.addEventListener('pointerleave', () => { + if (source === 'pointer' && !captured) end(); + }); + // 始终绑定触摸兜底。若只收到 pointerdown 而没有 pointermove,touchstart 可接管该笔画。 + n.addEventListener('touchstart', (event) => { + suppressMouse(); + prevent(event); + const touch = event.changedTouches && event.changedTouches[0]; + if (!touch || source === 'touch' || source === 'mouse') return; + if (source === 'pointer') { + if (pointerType === 'mouse' || pointerType === 'pen') return; + // 接管不再保存第二份历史,也不重复画线;后续指针事件由来源锁忽略。 + point = position(touch); + } else { + begin(touch); + } + source = 'touch'; + activeId = touch.identifier; + }, {passive: false}); + n.addEventListener('touchmove', (event) => { + suppressMouse(); + prevent(event); + if (source !== 'touch') return; + const touch = findTouch(event.changedTouches); + if (touch) move(touch); + }, {passive: false}); + ['touchend', 'touchcancel'].forEach((name) => { + n.addEventListener(name, (event) => { + suppressMouse(); + prevent(event); + if (source === 'touch' && findTouch(event.changedTouches)) end(); + }, {passive: false}); + }); + // 兼容旧内核鼠标输入,并过滤触摸结束后生成的合成鼠标事件。 + n.addEventListener('mousedown', (event) => { + if (source || event.button !== 0 || Date.now() < ignoreMouseUntil) return; + source = 'mouse'; + begin(event); + prevent(event); + }); + n.addEventListener('mousemove', (event) => { + if (source === 'mouse') move(event); + }); + ['mouseup', 'mouseleave'].forEach((name) => { + n.addEventListener(name, () => { + if (source === 'mouse') end(); + }); + }); +},this.getContentBase64=function(t,e){if(t){var i=!0,s=!1,a=void 0;try{for(var r,f=document.querySelectorAll('canvas[data-none="1"]')[Symbol.iterator]();!(i=(r=f.next()).done);i=!0){var d=r.value;d.parentNode.removeChild(d)}}catch(t){s=!0,a=t}finally{try{!i&&f.return&&f.return()}finally{if(s)throw a}}var l=document.createElement("canvas");l.dataset.none="1",l.width=n.offsetHeight,l.height=n.offsetWidth,document.body.appendChild(l);var c=document.querySelector('canvas[data-none="1"]').getContext("2d"),u=new Image;u.src=o.getContentBase64(),u.onload=function(){var t=Math.round(n.offsetHeight/2),o=Math.round(n.offsetWidth/2);c.save(),c.translate(t,o),c.rotate(-90*Math.PI/180),c.drawImage(u,-u.width/2,-u.height/2),c.restore(),e&&e(document.querySelector('canvas[data-none="1"]').toDataURL("image/png"))}}else{if(!e)return n.toDataURL("image/png");e(n.toDataURL("image/png"))}},this.getBlob=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getContentBase64(),e=t.split(","),o=e[0].match(/:(.*?);/)[1],n=atob(e[1]),i=n.length,s=new Uint8Array(i);i--;)s[i]=n.charCodeAt(i);return new Blob([s],{type:o})},this.getFile=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getContentBase64(),o=t||"file",n=e.split(","),i=n[0].match(/:(.*?);/)[1],s=i.split("/")[1],a=atob(n[1]),r=a.length,f=new Uint8Array(r);r--;)f[r]=a.charCodeAt(r);return new File([f],o+"."+s,{type:i})},this.reset=function(){if(!o.firstStatus)return!1;i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var t=new Image;try{t.src=o.firstStatus,t.addEventListener("load",function(){i.drawImage(t,0,0)}),o.step=-1,o.status=[]}catch(t){}},this.undo=function(t){if(o.step>=0){i.clearRect(0,0,n.offsetWidth,n.offsetHeight);var e=new Image;try{e.src=o.status[o.step],e.addEventListener("load",function(){i.drawImage(e,0,0)})}catch(t){}o.step--}else console.warn("no more undo"),t&&t()},this.redo=function(t){if(o.step 签字 - - + + - - + + - - + + -
+

签字页面正在加载;若长时间未显示,请刷新页面重试。

+

提示:请在下方区域签字!

@@ -38,7 +41,7 @@ 清 空 - 提 交 + 提 交 @@ -46,110 +49,75 @@
\ No newline at end of file