fix(移动端): 禁用移动端图表跳转

This commit is contained in:
dataeaseShu 2024-03-05 16:12:58 +08:00
parent 84475e2698
commit 5a217e8896
7 changed files with 39 additions and 40 deletions

View File

@ -364,11 +364,11 @@ em {
}
.color-panel {
background: var(--ed-color-primary);
background: #3370ff;
}
.color-dashboard {
background: var(--ed-color-primary);
background: #3370ff;
}
.color-screen {

View File

@ -17,7 +17,7 @@ import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/utils/ca
import { deepCopy } from '@/utils/utils'
const dvMainStore = dvMainStoreWithOut()
const { nowPanelTrackInfo, nowPanelJumpInfo } = storeToRefs(dvMainStore)
const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc } = storeToRefs(dvMainStore)
const props = defineProps({
view: {
@ -224,7 +224,7 @@ const trackClick = trackAction => {
dvMainStore.addViewTrackFilter(linkageParam)
break
case 'jump':
if (isDataEaseBi.value) return
if (isDataEaseBi.value || mobileInPc.value) return
emit('onJumpClick', jumpParam)
break
default:
@ -247,7 +247,11 @@ const trackMenu = computed(() => {
jumpCount++
}
})
jumpCount && view.value?.jumpActive && !isDataEaseBi.value && trackMenuInfo.push('jump')
jumpCount &&
view.value?.jumpActive &&
!isDataEaseBi.value &&
!mobileInPc.value &&
trackMenuInfo.push('jump')
linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage')
view.value.drillFields.length && trackMenuInfo.push('drill')
}

View File

@ -29,7 +29,7 @@ import { deepCopy } from '@/utils/utils'
import { useEmitt } from '@/hooks/web/useEmitt'
const dvMainStore = dvMainStoreWithOut()
const { nowPanelTrackInfo, nowPanelJumpInfo } = storeToRefs(dvMainStore)
const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc } = storeToRefs(dvMainStore)
const { emitter } = useEmitt()
const props = defineProps({
@ -268,7 +268,7 @@ const trackClick = trackAction => {
dvMainStore.addViewTrackFilter(linkageParam)
break
case 'jump':
if (isDataEaseBi.value) return
if (isDataEaseBi.value || mobileInPc.value) return
emit('onJumpClick', jumpParam)
break
default:
@ -292,7 +292,11 @@ const trackMenu = computed(() => {
jumpCount++
}
})
jumpCount && view.value?.jumpActive && !isDataEaseBi.value && trackMenuInfo.push('jump')
jumpCount &&
view.value?.jumpActive &&
!isDataEaseBi.value &&
!mobileInPc.value &&
trackMenuInfo.push('jump')
linkageCount && view.value?.linkageActive && trackMenuInfo.push('linkage')
view.value.drillFields.length && trackMenuInfo.push('drill')
return trackMenuInfo

View File

@ -46,7 +46,7 @@ const dvMainStore = dvMainStoreWithOut()
let innerRefreshTimer = null
const { nowPanelJumpInfo, publicLinkStatus, dvInfo, curComponent, canvasStyleData } =
const { nowPanelJumpInfo, publicLinkStatus, dvInfo, curComponent, canvasStyleData, mobileInPc } =
storeToRefs(dvMainStore)
const props = defineProps({
@ -157,7 +157,7 @@ const hasLinkIcon = computed(() => {
return trackMenu.value.indexOf('linkage') > -1
})
const hasJumpIcon = computed(() => {
return trackMenu.value.indexOf('jump') > -1
return trackMenu.value.indexOf('jump') > -1 && !mobileInPc.value
})
const hasDrillIcon = computed(() => {
return trackMenu.value.indexOf('drill') > -1

View File

@ -2,12 +2,11 @@
import { ref, onMounted, unref, onBeforeUnmount, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
import MobileBackgroundSelector from './MobileBackgroundSelector.vue'
import ComponentWrapper from '@/components/data-visualization/canvas/ComponentWrapper.vue'
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
import { canvasSave } from '@/utils/canvasUtils'
import { useEmitt } from '@/hooks/web/useEmitt'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { getStyle } from '@/utils/style'
import findComponent from '@/utils/components'
import { storeToRefs } from 'pinia'
const dvMainStore = dvMainStoreWithOut()
const { componentData, canvasStyleData, canvasViewInfo, dvInfo } = storeToRefs(dvMainStore)
@ -15,8 +14,13 @@ const mobileLoading = ref(true)
const emits = defineEmits(['pcMode'])
const snapshotStore = snapshotStoreWithOut()
const getComponentStyleDefault = style => {
return getStyle(style, ['top', 'left', 'width', 'height', 'rotate'])
const getComponentStyleDefault = () => {
return {
top: 0,
left: 0,
width: '190px',
height: '190px'
}
}
const mobileStatusChange = (type, value) => {
const iframe = document.querySelector('iframe')
@ -173,35 +177,26 @@ const save = () => {
<div
:style="{ height: '198px', width: '198px' }"
class="mobile-wrapper-inner-adaptor"
v-for="config in componentDataNotInMobile"
:key="config.id"
v-for="item in componentDataNotInMobile"
:key="item.id"
>
<div class="component-outer">
<component
:is="findComponent(config['component'])"
ref="component"
class="component"
:view="canvasViewInfo[config.id]"
<ComponentWrapper
v-show="item.isShow"
canvas-id="canvas-main"
:canvas-style-data="canvasStyleData"
:dv-info="dvInfo"
:dv-type="dvInfo.type"
:canvas-view-info="canvasViewInfo"
:prop-value="config?.propValue"
:element="config"
:request="config?.request"
:style="getComponentStyleDefault(config?.style)"
:linkage="config?.linkage"
:view-info="canvasViewInfo[item.id]"
:config="item"
:style="getComponentStyleDefault()"
show-position="preview"
:disabled="true"
:is-edit="false"
:search-count="0"
:scale="80"
/>
</div>
<div class="mobile-com-mask"></div>
<div
class="pc-select-to-mobile"
v-if="!mobileLoading"
@click="addToMobile(config)"
></div>
<div class="pc-select-to-mobile" v-if="!mobileLoading" @click="addToMobile(item)"></div>
</div>
</el-collapse-item>
</el-collapse>
@ -288,7 +283,7 @@ const save = () => {
.config-panel-content {
width: 100%;
height: calc(100% - 130px);
height: calc(100% - 127px);
border-bottom-left-radius: 45px;
border-bottom-right-radius: 45px;
overflow: hidden;

View File

@ -235,7 +235,7 @@ watch(
margin-right: 12px;
border-radius: 4px;
color: #fff;
background: var(--ed-color-primary);
background: #3370ff;
}
.name-star {
font-size: 15px;

View File

@ -416,10 +416,6 @@ const getEmptyDesc = (): string => {
.name-content {
display: flex;
align-items: center;
.color-panel {
background: #3370ff !important;
}
.custom-icon {
display: none;
}