|
|
@ -5,6 +5,7 @@
|
|
|
|
:style="previewWrapStyle"
|
|
|
|
:style="previewWrapStyle"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="hasPermission"
|
|
|
|
class="bs-render-wrap render-theme-wrap"
|
|
|
|
class="bs-render-wrap render-theme-wrap"
|
|
|
|
:style="renderStyle"
|
|
|
|
:style="renderStyle"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -27,6 +28,7 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<NotPermission v-else />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
@ -36,10 +38,12 @@ import { mapActions, mapMutations, mapState } from 'vuex'
|
|
|
|
import { getThemeConfig } from 'packages/js/api/bigScreenApi'
|
|
|
|
import { getThemeConfig } from 'packages/js/api/bigScreenApi'
|
|
|
|
import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js'
|
|
|
|
import { compile } from 'tiny-sass-compiler/dist/tiny-sass-compiler.esm-browser.prod.js'
|
|
|
|
import { G2 } from '@antv/g2plot'
|
|
|
|
import { G2 } from '@antv/g2plot'
|
|
|
|
|
|
|
|
import NotPermission from 'packages/NotPermission'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'BigScreenRun',
|
|
|
|
name: 'BigScreenRun',
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
RenderCard
|
|
|
|
RenderCard,
|
|
|
|
|
|
|
|
NotPermission
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
config: {
|
|
|
|
config: {
|
|
|
@ -55,7 +59,8 @@ export default {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
innerHeight: window.innerHeight,
|
|
|
|
innerHeight: window.innerHeight,
|
|
|
|
innerWidth: window.innerWidth,
|
|
|
|
innerWidth: window.innerWidth,
|
|
|
|
timer: null
|
|
|
|
timer: null,
|
|
|
|
|
|
|
|
hasPermission: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
@ -128,35 +133,35 @@ export default {
|
|
|
|
this.init()
|
|
|
|
this.init()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'pageInfo.pageConfig.refreshConfig.length':{
|
|
|
|
'pageInfo.pageConfig.refreshConfig.length': {
|
|
|
|
handler(val){
|
|
|
|
handler (val) {
|
|
|
|
if (val){
|
|
|
|
if (val) {
|
|
|
|
this.startTimer()
|
|
|
|
this.startTimer()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
// beforeRouteEnter (to, from, next) {
|
|
|
|
// 判断进入预览页面前是否有访问权限
|
|
|
|
// // 判断进入预览页面前是否有访问权限
|
|
|
|
const code = to.query.code
|
|
|
|
// const code = to.query.code
|
|
|
|
get(`/bigScreen/permission/check/${code}`).then(res => {
|
|
|
|
// get(`/bigScreen/permission/check/${code}`).then(res => {
|
|
|
|
if (res) {
|
|
|
|
// if (res) {
|
|
|
|
next(vm => {
|
|
|
|
// next(vm => {
|
|
|
|
// 重置大屏的vuex store
|
|
|
|
// // 重置大屏的vuex store
|
|
|
|
vm.$store.commit('bigScreen/resetStoreData')
|
|
|
|
// vm.$store.commit('bigScreen/resetStoreData')
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
next('/notPermission')
|
|
|
|
// next('/notPermission')
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
|
beforeRouteLeave (to, from, next) {
|
|
|
|
// 离开的时候 重置大屏的vuex store
|
|
|
|
// 离开的时候 重置大屏的vuex store
|
|
|
|
this.$store.commit('bigScreen/resetStoreData')
|
|
|
|
this.$store.commit('bigScreen/resetStoreData')
|
|
|
|
next()
|
|
|
|
next()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
created () {
|
|
|
|
this.init()
|
|
|
|
this.permission()
|
|
|
|
this.getParentWH()
|
|
|
|
this.getParentWH()
|
|
|
|
this.windowSize()
|
|
|
|
this.windowSize()
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -178,6 +183,14 @@ export default {
|
|
|
|
'changePageConfig',
|
|
|
|
'changePageConfig',
|
|
|
|
'changeChartConfig'
|
|
|
|
'changeChartConfig'
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
|
|
|
|
permission () {
|
|
|
|
|
|
|
|
get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
|
|
|
|
|
|
|
|
this.hasPermission = res
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
|
|
this.init()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
init () {
|
|
|
|
init () {
|
|
|
|
if (!this.pageCode) { return }
|
|
|
|
if (!this.pageCode) { return }
|
|
|
|
this.changePageLoading(true)
|
|
|
|
this.changePageLoading(true)
|
|
|
@ -356,7 +369,7 @@ export default {
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.bs-preview-wrap {
|
|
|
|
.bs-preview-wrap {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
@ -366,5 +379,5 @@ export default {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
background-size: cover;
|
|
|
|
background-size: cover;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|