修改水印细节
This commit is contained in:
@@ -75,6 +75,13 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
$route:function(val) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (document.getElementsByClassName('ant-card-body').length > 0){
|
||||||
|
this.$watermark.set('fanqiangqiang 范强强')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,34 +1,18 @@
|
|||||||
let watermark = {}
|
let watermark = {}
|
||||||
let setWatermark = (str) => {
|
let setWatermark = (str) => {
|
||||||
let id = '1.23452384164.123412415'
|
let id = '1.23452384164.123412415'
|
||||||
|
|
||||||
if (document.getElementById(id) !== null) {
|
if (document.getElementById(id) !== null) {
|
||||||
document.body.removeChild(document.getElementById(id))
|
document.body.removeChild(document.getElementById(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
let can = document.createElement('canvas')
|
let can = document.createElement('canvas')
|
||||||
can.width = 190
|
|
||||||
can.height = 120
|
|
||||||
|
|
||||||
let cans = can.getContext('2d')
|
let cans = can.getContext('2d')
|
||||||
cans.rotate(-30 * Math.PI / 180)
|
cans.rotate(-30 * Math.PI / 180)
|
||||||
cans.font = '15px Vedana'
|
cans.font = '13px Vedana'
|
||||||
cans.fillStyle = '#f4f4f4'
|
cans.fillStyle = '#f4f4f4'
|
||||||
cans.textAlign = 'left'
|
cans.textAlign = 'left'
|
||||||
cans.textBaseline = 'Middle'
|
cans.textBaseline = 'Middle'
|
||||||
cans.fillText(str, can.width / 20, can.height)
|
cans.fillText(str, 10,120)
|
||||||
|
document.getElementsByClassName('ant-card-body')[0].style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'
|
||||||
let div = document.createElement('div')
|
|
||||||
div.id = id
|
|
||||||
div.style.pointerEvents = 'none'
|
|
||||||
div.style.top = '-30px'
|
|
||||||
div.style.left = '0px'
|
|
||||||
div.style.position = 'absolute'
|
|
||||||
div.style.zIndex = '1'
|
|
||||||
div.style.width = '100%'
|
|
||||||
div.style.height = '100%'
|
|
||||||
div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'
|
|
||||||
document.getElementsByClassName('main')[0].appendChild(div)
|
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
|
import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RouteView",
|
name: 'RouteView',
|
||||||
computed: {
|
computed: {
|
||||||
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||||
includedComponents() {
|
includedComponents() {
|
||||||
@@ -24,16 +24,16 @@
|
|||||||
cacheRouterArray.push(this.$route.meta.componentName)
|
cacheRouterArray.push(this.$route.meta.componentName)
|
||||||
// cacheRouterArray.push("OnlCgformHeadList")
|
// cacheRouterArray.push("OnlCgformHeadList")
|
||||||
Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
|
Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray)
|
||||||
return cacheRouterArray;
|
return cacheRouterArray
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return includedRouters;
|
return includedRouters
|
||||||
},
|
},
|
||||||
//update-end--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
//update-end--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||||
keepAlive() {
|
keepAlive() {
|
||||||
return this.$route.meta.keepAlive
|
return this.$route.meta.keepAlive
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -100,9 +100,7 @@
|
|||||||
this.activePage = currentRoute.fullPath
|
this.activePage = currentRoute.fullPath
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$watermark.set('测试水印')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route': function(newRoute) {
|
'$route': function(newRoute) {
|
||||||
@@ -131,7 +129,6 @@
|
|||||||
let oldPositionRoute = this.pageList[oldIndex]
|
let oldPositionRoute = this.pageList[oldIndex]
|
||||||
this.pageList.splice(oldIndex, 1, Object.assign({}, newRoute, { meta: oldPositionRoute.meta }))
|
this.pageList.splice(oldIndex, 1, Object.assign({}, newRoute, { meta: oldPositionRoute.meta }))
|
||||||
}
|
}
|
||||||
this.$watermark.set('测试水印')
|
|
||||||
},
|
},
|
||||||
'activePage': function(key) {
|
'activePage': function(key) {
|
||||||
let index = this.linkList.lastIndexOf(key)
|
let index = this.linkList.lastIndexOf(key)
|
||||||
@@ -435,12 +432,11 @@
|
|||||||
|
|
||||||
.main {
|
.main {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-card {
|
.ant-card {
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
background: transparent !important;
|
background: #fff;
|
||||||
}
|
}
|
||||||
.ant-input{
|
.ant-input{
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user