水印相关修改

This commit is contained in:
a0049873 2022-11-24 10:57:13 +08:00
parent cdfad96cb9
commit 8da205988f
2 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-05-06 11:12:00 * @Date: 2022-05-06 11:12:00
* @LastEditors: Light * @LastEditors: Light
* @LastEditTime: 2022-11-21 10:45:07 * @LastEditTime: 2022-11-24 10:53:41
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
--> -->
<template> <template>
@ -86,10 +86,10 @@
} }
onWholeWaterMark( onWholeWaterMark(
[realName, moment().format('YYYY-MM-DD')], [realName, moment().format('YYYY-MM-DD')],
600, 800,
300, 200,
30, 24,
50 40
) )
getCategoryTreePage({ getCategoryTreePage({
page: 1, page: 1,

View File

@ -2,7 +2,7 @@
* @Author: Light * @Author: Light
* @Date: 2022-11-14 15:01:54 * @Date: 2022-11-14 15:01:54
* @LastEditors: Light * @LastEditors: Light
* @LastEditTime: 2022-11-16 09:57:28 * @LastEditTime: 2022-11-24 10:53:20
* @Description: 水印 * @Description: 水印
*/ */
const watermark = { const watermark = {
@ -20,12 +20,12 @@ const setWatermark = (str, width, height, size, top, index) => {
can.height = height can.height = height
const cans = can.getContext('2d') const cans = can.getContext('2d')
cans.rotate((-20 * Math.PI) / 180) cans.rotate((-13 * Math.PI) / 180)
cans.font = size + 'px Microsoft YaHei' cans.font = size + 'px Microsoft YaHei'
cans.fillStyle = 'rgba(200, 200, 200, 0.4)' cans.fillStyle = 'rgba(200, 200, 200, 0.4)'
cans.textAlign = 'left' cans.textAlign = 'center'
cans.textBaseline = 'middle' cans.textBaseline = 'middle'
cans.fillText(str, can.width / 3, can.height / 2) cans.fillText(str, can.width / 2 - 30, can.height - 10)
const WATER_MARK = document.createElement('div') const WATER_MARK = document.createElement('div')
const ALL_WIDTH = document.documentElement.clientWidth + 'px' const ALL_WIDTH = document.documentElement.clientWidth + 'px'
@ -35,7 +35,7 @@ const setWatermark = (str, width, height, size, top, index) => {
WATER_MARK.style.cssText = ` WATER_MARK.style.cssText = `
position: fixed; position: fixed;
top: ${index * top}px; top: ${index * top}px;
left: 0; left: ${(index * top) / 4}px;
zIndex: 99999999; zIndex: 99999999;
pointer-events: none; pointer-events: none;
width: ${ALL_WIDTH}; width: ${ALL_WIDTH};