Merge remote-tracking branch 'origin/master'

main
hong.yang 2 years ago
commit ba7464d0fd

@ -1,6 +1,6 @@
<template> <template>
<div <div
v-if="!pageLoading" v-if="(!pageLoading) && hasPermission"
class="bs-page-design-wrap" class="bs-page-design-wrap"
> >
<PageTopSetting <PageTopSetting
@ -103,6 +103,7 @@
/> />
</div> </div>
</div> </div>
<NotPermission v-else-if="!hasPermission" />
</template> </template>
<script> <script>
import SourceDialog from './SourceDialog/index.vue' import SourceDialog from './SourceDialog/index.vue'
@ -128,6 +129,7 @@ import { randomString } from '../js/utils'
import { isFirefox } from 'packages/js/utils/userAgent' import { isFirefox } from 'packages/js/utils/userAgent'
import { handleResData } from 'packages/js/store/actions.js' import { handleResData } from 'packages/js/store/actions.js'
import { EventBus } from 'packages/js/utils/eventBus' import { EventBus } from 'packages/js/utils/eventBus'
import NotPermission from 'packages/NotPermission'
export default { export default {
name: 'BigScreenDesign', name: 'BigScreenDesign',
components: { components: {
@ -139,7 +141,8 @@ export default {
SettingPanel, SettingPanel,
SourceDialog, SourceDialog,
ComponentDialog, ComponentDialog,
iframeDialog iframeDialog,
NotPermission
}, },
mixins: [multipleSelectMixin], mixins: [multipleSelectMixin],
props: { props: {
@ -158,6 +161,7 @@ export default {
}, },
data () { data () {
return { return {
hasPermission: true,
rightVisiable: false, rightVisiable: false,
pageInfoVisiable: false, pageInfoVisiable: false,
ruleStartX: 100, ruleStartX: 100,
@ -215,22 +219,22 @@ export default {
} }
} }
}, },
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')
} // }
}) // })
}, // },
created () { created () {
this.init() this.permission()
/** /**
* 以下是为了解决在火狐浏览器上推拽时弹出tab页到搜索问题 * 以下是为了解决在火狐浏览器上推拽时弹出tab页到搜索问题
* @param event * @param event
@ -265,6 +269,15 @@ export default {
'saveTimeLine', 'saveTimeLine',
'changeIframeDialog' 'changeIframeDialog'
]), ]),
//
permission () {
get(`/bigScreen/permission/check/${this.$route.query.code}`).then(res => {
this.hasPermission = !res
if (res) {
this.init()
}
})
},
// //
initDialog () { initDialog () {
this.$refs.SourceDialog.init() this.$refs.SourceDialog.init()
@ -482,13 +495,13 @@ export default {
margin-right: 16px; margin-right: 16px;
} }
::v-deep .el-select { /deep/ .el-select {
width: 150px !important; width: 150px !important;
} }
} }
} }
::v-deep .el-loading-mask { /deep/ .el-loading-mask {
background-color: transparent !important; background-color: transparent !important;
} }
} }

@ -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: {
@ -136,27 +141,27 @@ export default {
} }
} }
}, },
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)

Loading…
Cancel
Save