Commit b85c6796 authored by 罗超's avatar 罗超

修改水印监听

parent b2f3d938
...@@ -41,7 +41,7 @@ export default (MapDOM: Ref<HTMLElement | undefined>, loadingStatus: Ref<boolean ...@@ -41,7 +41,7 @@ export default (MapDOM: Ref<HTMLElement | undefined>, loadingStatus: Ref<boolean
}) })
map.zoomControl = new am4maps.ZoomControl(); map.zoomControl = new am4maps.ZoomControl();
map.zoomControl.slider.height = 100; map.zoomControl.slider.height = 100;
map.maxZoomLevel = 64 map.maxZoomLevel = 128
worldSeries = map.series.push(new am4maps.MapPolygonSeries()); worldSeries = map.series.push(new am4maps.MapPolygonSeries());
worldSeries.exclude = ["AQ"]; worldSeries.exclude = ["AQ"];
...@@ -77,6 +77,7 @@ export default (MapDOM: Ref<HTMLElement | undefined>, loadingStatus: Ref<boolean ...@@ -77,6 +77,7 @@ export default (MapDOM: Ref<HTMLElement | undefined>, loadingStatus: Ref<boolean
const initCountry = () => { const initCountry = () => {
countrySeries = map.series.push(new am4maps.MapPolygonSeries()); countrySeries = map.series.push(new am4maps.MapPolygonSeries());
countrySeries.useGeodata = true; countrySeries.useGeodata = true;
countrySeries.hide(); countrySeries.hide();
countrySeries.geodataSource.events.on("done", () => { countrySeries.geodataSource.events.on("done", () => {
......
...@@ -22,6 +22,8 @@ import { ref, watch } from "vue" ...@@ -22,6 +22,8 @@ import { ref, watch } from "vue"
import { useRouter } from "vue-router" import { useRouter } from "vue-router"
const { token,userInfo } = storeToRefs(useUserStore()) const { token,userInfo } = storeToRefs(useUserStore())
const currentId = ref('')
const water = ref<any>() const water = ref<any>()
const gaps = [[100,100],[150,150],[200,200]] const gaps = [[100,100],[150,150],[200,200]]
const exportRule = ['/editor/'] const exportRule = ['/editor/']
...@@ -47,6 +49,7 @@ const waterVisibleHandler = ()=>{ ...@@ -47,6 +49,7 @@ const waterVisibleHandler = ()=>{
showWater.value = ruleRouter.value.findIndex(x=>url.includes(x))!=-1 showWater.value = ruleRouter.value.findIndex(x=>url.includes(x))!=-1
} }
const freeUserWatermake = ()=>{ const freeUserWatermake = ()=>{
ruleRouter.value=[]
ruleRouter.value.push(...previewRule) ruleRouter.value.push(...previewRule)
ruleRouter.value.push(...exportRule) ruleRouter.value.push(...exportRule)
water.value={ water.value={
...@@ -65,6 +68,17 @@ watch(() => router.currentRoute.value.path, (toPath) => { ...@@ -65,6 +68,17 @@ watch(() => router.currentRoute.value.path, (toPath) => {
waterVisibleHandler() waterVisibleHandler()
},{immediate: true,deep: true}) },{immediate: true,deep: true})
watch(()=>userInfo.value, (newUser)=>{
let tempId = userInfo.value && userInfo.value.id ? userInfo.value.id : ''
console.log(tempId!=currentId.value)
if(tempId!=currentId.value){
if(userInfo.value.iv || userInfo.value.it) loadWater()
else freeUserWatermake()
currentId.value = tempId
}
})
if(userInfo.value && userInfo.value.id) currentId.value=userInfo.value.id
if(userInfo.value.iv || userInfo.value.it) loadWater() if(userInfo.value.iv || userInfo.value.it) loadWater()
else freeUserWatermake() else freeUserWatermake()
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment