Merge pull request #13265 from dataease/pr@dev-v2_st
feat(数据大屏): 数据大屏放开移动端访问限制,允许移动端访问
This commit is contained in:
commit
e25ee10b2b
@ -23,7 +23,7 @@ const { start, done } = useNProgress()
|
||||
|
||||
const { loadStart, loadDone } = usePageLoading()
|
||||
|
||||
const whiteList = ['/login', '/de-link', '/chart-view', '/notSupport', '/admin-login', '/401'] // 不重定向白名单
|
||||
const whiteList = ['/login', '/de-link', '/chart-view', '/admin-login', '/401'] // 不重定向白名单
|
||||
const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard', '/preview', '/dataset-embedded-form']
|
||||
const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-embedded-form']
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
@ -35,7 +35,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
await appStore.setAppModel()
|
||||
isDesktop = appStore.getDesktop
|
||||
}
|
||||
if (isMobile() && !['/notSupport', '/chart-view'].includes(to.path)) {
|
||||
if (isMobile() && !['/chart-view'].includes(to.path)) {
|
||||
done()
|
||||
loadDone()
|
||||
if (to.name === 'link') {
|
||||
@ -49,8 +49,6 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
}
|
||||
window.location.href = window.origin + '/mobile.html#' + to.path + linkQuery
|
||||
} else if (to.path === '/dvCanvas') {
|
||||
next('/notSupport')
|
||||
} else if (
|
||||
wsCache.get('user.token') ||
|
||||
isDesktop ||
|
||||
|
||||
@ -17,7 +17,7 @@ const { start, done } = useNProgress()
|
||||
const interactiveStore = interactiveStoreWithOut()
|
||||
|
||||
const { loadStart, loadDone } = usePageLoading()
|
||||
const whiteList = ['/login', '/panel', '/dvCanvas', '/DashboardEmpty', '/preview'] // 不重定向白名单
|
||||
const whiteList = ['/login', '/panel', '/DashboardEmpty', '/preview'] // 不重定向白名单
|
||||
|
||||
router.beforeEach(async (to, _, next) => {
|
||||
start()
|
||||
|
||||
@ -36,13 +36,6 @@ export const routes: AppRouteRecordRaw[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/notSupport',
|
||||
name: 'notSupport',
|
||||
hidden: true,
|
||||
meta: {},
|
||||
component: () => import('@/views/mobile/panel/NotSupport.vue')
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
|
||||
@ -52,13 +52,6 @@ export const routes: AppRouteRecordRaw[] = [
|
||||
meta: {},
|
||||
component: () => import('@/views/mobile/panel/Mobile.vue')
|
||||
},
|
||||
{
|
||||
path: '/dvCanvas',
|
||||
name: 'dv',
|
||||
hidden: true,
|
||||
meta: {},
|
||||
component: () => import('@/views/mobile/panel/NotSupport.vue')
|
||||
},
|
||||
{
|
||||
path: '/DashboardEmpty',
|
||||
name: 'DashboardEmpty',
|
||||
|
||||
@ -3,7 +3,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
||||
import router from '@/router/mobile'
|
||||
import { initCanvasDataMobile } from '@/utils/canvasUtils'
|
||||
import { initCanvasDataMobile, initCanvasData } from '@/utils/canvasUtils'
|
||||
import { queryTargetVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
||||
import { Base64 } from 'js-base64'
|
||||
import { getOuterParamsInfo } from '@/api/visualization/outerParams'
|
||||
@ -91,7 +91,9 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
|
||||
return
|
||||
}
|
||||
}
|
||||
initCanvasDataMobile(
|
||||
|
||||
const req = dvType === 'dashboard' ? initCanvasDataMobile : initCanvasData
|
||||
req(
|
||||
dvId,
|
||||
dvType,
|
||||
function ({
|
||||
@ -101,7 +103,7 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
|
||||
canvasViewInfoPreview,
|
||||
curPreviewGap
|
||||
}) {
|
||||
if (!dvInfo.mobileLayout) {
|
||||
if (!dvInfo.mobileLayout && dvType === 'dashboard') {
|
||||
router.push('/DashboardEmpty')
|
||||
return
|
||||
}
|
||||
|
||||
@ -22,7 +22,6 @@ import PreviewCanvas from '@/views/data-visualization/PreviewCanvasMobile.vue'
|
||||
import TicketError from './TicketError.vue'
|
||||
import { ProxyInfo, shareProxy } from './ShareProxy'
|
||||
import Exp from './exp.vue'
|
||||
import router from '@/router/mobile'
|
||||
import LinkError from './error.vue'
|
||||
import PwdTips from './pwd.vue'
|
||||
const linkExist = ref(false)
|
||||
@ -53,16 +52,11 @@ onMounted(async () => {
|
||||
pwdValid.value = !!proxyInfo.pwdValid
|
||||
state.ticketValidVO = proxyInfo.ticketValidVO
|
||||
nextTick(() => {
|
||||
if (curType.value === 'dashboard') {
|
||||
const method = pcanvas?.value?.loadCanvasDataAsync
|
||||
if (method) {
|
||||
method(proxyInfo.resourceId, 'dashboard', null)
|
||||
}
|
||||
loading.value = false
|
||||
} else {
|
||||
loading.value = false
|
||||
router.push('/dvCanvas')
|
||||
const method = pcanvas?.value?.loadCanvasDataAsync
|
||||
if (method) {
|
||||
method(proxyInfo.resourceId, curType.value, null)
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user