1 line
6.4 KiB
JSON
1 line
6.4 KiB
JSON
{"remainingRequest":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\components\\Watermark\\Watermark.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\src\\components\\Watermark\\Watermark.vue","mtime":1718864675711},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\babel-loader\\lib\\index.js","mtime":1718764959024},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1718764957200},{"path":"D:\\phpstudy_pro\\WWW\\travel\\admin\\node_modules\\vue-loader\\lib\\index.js","mtime":1718764959862}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:Ly8KLy8KLy8KLy8KLy8KLy8KLy8KLy8KCmV4cG9ydCBkZWZhdWx0IHsKICBwcm9wczogewogICAgd2F0ZXJtYXJrVGV4dDogewogICAgICB0eXBlOiBTdHJpbmcsCiAgICAgIGRlZmF1bHQ6ICfph5HmvrMnCiAgICB9LAogICAgd2F0ZXJtYXJrQ29sb3I6IHsKICAgICAgdHlwZTogU3RyaW5nLAogICAgICBkZWZhdWx0OiAncmdiYSgxOTIsIDE5MiwgMTkyLCAwLjMpJwogICAgfSwKICAgIHdhdGVybWFya0ZvbnRTaXplOiB7CiAgICAgIHR5cGU6IFN0cmluZywKICAgICAgZGVmYXVsdDogJzI0cHgnCiAgICB9LAogICAgd2F0ZXJtYXJrRm9udEZhbWlseTogewogICAgICB0eXBlOiBTdHJpbmcsCiAgICAgIGRlZmF1bHQ6ICdBcmlhbCcKICAgIH0sCiAgICB3YXRlcm1hcmtSb3RhdGlvbjogewogICAgICB0eXBlOiBOdW1iZXIsCiAgICAgIGRlZmF1bHQ6IC00NQogICAgfSwKICAgIHdhdGVybWFya1NwYWNpbmc6IHsKICAgICAgdHlwZTogTnVtYmVyLAogICAgICBkZWZhdWx0OiAyMDAKICAgIH0sCiAgICB3YXRlcm1hcmtXaWR0aDogewogICAgICB0eXBlOiBOdW1iZXIsCiAgICAgIGRlZmF1bHQ6IDIwMAogICAgfSwKICAgIHdhdGVybWFya0hlaWdodDogewogICAgICB0eXBlOiBOdW1iZXIsCiAgICAgIGRlZmF1bHQ6IDEwMAogICAgfQogIH0sCiAgY29tcHV0ZWQ6IHsKICAgIHdhdGVybWFya1RleHRzKCkgewogICAgICAvLyDmoLnmja7pobXpnaLlpKflsI/liqjmgIHnlJ/miJDlpJrkuKrmsLTljbDmlofmnKwKICAgICAgY29uc3QgdGV4dHMgPSBbXTsKICAgICAgY29uc3Qgd2lkdGggPSB3aW5kb3cuaW5uZXJXaWR0aDsKICAgICAgY29uc3QgaGVpZ2h0ID0gd2luZG93LmlubmVySGVpZ2h0OwogICAgICBjb25zdCBjb3VudCA9IE1hdGguY2VpbCh3aWR0aCAqIGhlaWdodCAvICh0aGlzLndhdGVybWFya1dpZHRoICogdGhpcy53YXRlcm1hcmtIZWlnaHQpKTsKICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CiAgICAgICAgdGV4dHMucHVzaCh0aGlzLndhdGVybWFya1RleHQpOwogICAgICB9CiAgICAgIHJldHVybiB0ZXh0czsKICAgIH0sCiAgICB3YXRlcm1hcmtTdHlsZSgpIHsKICAgICAgcmV0dXJuIHsKICAgICAgICBwb3NpdGlvbjogJ2ZpeGVkJywKICAgICAgICBwb2ludGVyRXZlbnRzOiAnbm9uZScsCiAgICAgICAgdG9wOiBgJHtNYXRoLnJhbmRvbSgpICogd2luZG93LmlubmVySGVpZ2h0fXB4YCwKICAgICAgICBsZWZ0OiBgJHtNYXRoLnJhbmRvbSgpICogd2luZG93LmlubmVyV2lkdGh9cHhgLAogICAgICAgIHRyYW5zZm9ybTogYHJvdGF0ZSgke3RoaXMud2F0ZXJtYXJrUm90YXRpb259ZGVnKWAsCiAgICAgICAgZm9udFNpemU6IHRoaXMud2F0ZXJtYXJrRm9udFNpemUsCiAgICAgICAgY29sb3I6IHRoaXMud2F0ZXJtYXJrQ29sb3IsCiAgICAgICAgZm9udEZhbWlseTogdGhpcy53YXRlcm1hcmtGb250RmFtaWx5LAogICAgICAgIC8vIOWPr+S7peagueaNrumcgOimgea3u+WKoOabtOWkmuagt+W8jwogICAgICB9OwogICAgfQogIH0sCiAgbW91bnRlZCgpIHsKICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCB0aGlzLmhhbmRsZVJlc2l6ZSk7CiAgfSwKICBiZWZvcmVEZXN0cm95KCkgewogICAgd2luZG93LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ3Jlc2l6ZScsIHRoaXMuaGFuZGxlUmVzaXplKTsKICB9LAogIG1ldGhvZHM6IHsKICAgIGhhbmRsZVJlc2l6ZSgpIHsKICAgICAgLy8g5Zyo56qX5Y+j5aSn5bCP5pS55Y+Y5pe26YeN5paw6K6h566X5rC05Y2w5paH5pys5ZKM5qC35byPCiAgICAgIC8vIOi/memHjOWPr+S7peagueaNrumcgOimgea3u+WKoOmAu+i+ke+8jOavlOWmguS9v+eUqG5leHRUaWNr5p2l56Gu5L+dRE9N5pu05paw5ZCO5YaN6K6h566XCiAgICB9CiAgfQp9Owo="},{"version":3,"sources":["Watermark.vue"],"names":[],"mappings":";;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"Watermark.vue","sourceRoot":"src/components/Watermark","sourcesContent":["<template>\n <div v-if=\"watermarkText\" class=\"watermark-container\">\n <div class=\"watermark\" v-for=\"(text, index) in watermarkTexts\" :key=\"index\" :style=\"watermarkStyle\">\n {{ text }}\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n watermarkText: {\n type: String,\n default: '金澳'\n },\n watermarkColor: {\n type: String,\n default: 'rgba(192, 192, 192, 0.3)'\n },\n watermarkFontSize: {\n type: String,\n default: '24px'\n },\n watermarkFontFamily: {\n type: String,\n default: 'Arial'\n },\n watermarkRotation: {\n type: Number,\n default: -45\n },\n watermarkSpacing: {\n type: Number,\n default: 200\n },\n watermarkWidth: {\n type: Number,\n default: 200\n },\n watermarkHeight: {\n type: Number,\n default: 100\n }\n },\n computed: {\n watermarkTexts() {\n // 根据页面大小动态生成多个水印文本\n const texts = [];\n const width = window.innerWidth;\n const height = window.innerHeight;\n const count = Math.ceil(width * height / (this.watermarkWidth * this.watermarkHeight));\n for (let i = 0; i < count; i++) {\n texts.push(this.watermarkText);\n }\n return texts;\n },\n watermarkStyle() {\n return {\n position: 'fixed',\n pointerEvents: 'none',\n top: `${Math.random() * window.innerHeight}px`,\n left: `${Math.random() * window.innerWidth}px`,\n transform: `rotate(${this.watermarkRotation}deg)`,\n fontSize: this.watermarkFontSize,\n color: this.watermarkColor,\n fontFamily: this.watermarkFontFamily,\n // 可以根据需要添加更多样式\n };\n }\n },\n mounted() {\n window.addEventListener('resize', this.handleResize);\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.handleResize);\n },\n methods: {\n handleResize() {\n // 在窗口大小改变时重新计算水印文本和样式\n // 这里可以根据需要添加逻辑,比如使用nextTick来确保DOM更新后再计算\n }\n }\n};\n</script>\n\n<style scoped>\n.watermark-container {\n pointer-events: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999; /* 确保水印在内容之上 */\n overflow: hidden;\n pointer-events: none; /* 防止水印影响页面交互 */\n}\n\n.watermark {\n user-select: none; /* 防止水印文本被复制 */\n pointer-events: none; /* 防止水印影响页面交互 */\n}\n</style>\n"]}]} |