{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/eslint-loader/index.js??ref--13-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/assets/js/watermark.js","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/assets/js/watermark.js","mtime":1739760944276},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":["var watermark = {};\nvar setWatermark = function setWatermark(str, currentId) {\n //let id = '1.23452384164.123412416';\n var id = currentId + '_0'; //Date.parse(new Date());\n\n if (document.getElementById(id) !== null) {\n var box = document.getElementById(id);\n box.remove();\n // document.body.removeChild(document.getElementById(id));\n }\n\n //创建一个画布\n var can = document.createElement('canvas');\n //设置画布的长宽\n can.width = 200;\n can.height = 120;\n\n // can.width = 225;\n // can.height = 225;\n\n var cans = can.getContext('2d');\n //旋转角度\n cans.rotate(-15 * Math.PI / 180);\n cans.font = '16px Vedana';\n //设置填充绘画的颜色、渐变或者模式\n cans.fillStyle = 'rgba(200, 200, 200, 0.40)';\n //设置文本内容的当前对齐方式\n cans.textAlign = 'left';\n //设置在绘制文本时使用的当前文本基线\n cans.textBaseline = 'Middle';\n //在画布上绘制填色的文本(输出的文本,开始绘制文本的X坐标位置,开始绘制文本的Y坐标位置)\n cans.fillText(str, can.width / 8, can.height / 2);\n var div = document.createElement('div');\n div.id = id;\n div.style.pointerEvents = 'none';\n\n // div.style.bottom = '0px'; //2021/1/7,不能铺满有滚动条的范围\n div.style.top = '0px';\n div.style.right = '30px';\n //div.style.position = 'fixed';\n div.style.position = 'absolute';\n div.style.zIndex = '10';\n\n // this.formScrollHeight = document.getElementById(id).scrollHeight\n div.style.width = document.getElementById(currentId).clientWidth + 'px';\n div.style.height = document.getElementById(currentId).scrollHeight + 'px'; //document.getElementById(currentId).clientHeight + 'px';\n div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat';\n document.getElementById(currentId).appendChild(div);\n //document.body.appendChild(div);\n return id;\n};\n\n// 该方法只允许调用一次\nwatermark.set = function (str, currentId) {\n var id = setWatermark(str, currentId);\n // setInterval(() => {\n // if (document.getElementById(id) === null) {\n // id = setWatermark(str,currentId);\n // }\n // }, 500);\n window.onresize = function () {\n setWatermark(str, currentId);\n };\n};\nexport default watermark;",null]}