diff --git a/core/core-frontend/src/assets/img/mobile-header.png b/core/core-frontend/src/assets/img/mobile-header.png
new file mode 100644
index 0000000000..02669a53f1
Binary files /dev/null and b/core/core-frontend/src/assets/img/mobile-header.png differ
diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue
index e061d993a0..5033410eeb 100644
--- a/core/core-frontend/src/components/dashboard/DbToolbar.vue
+++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue
@@ -457,9 +457,9 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
/>
-
+
diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
index c33fbfbf21..d2022455c5 100644
--- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
+++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue
@@ -9,10 +9,13 @@ import { canvasSave } from '@/utils/canvasUtils'
import { useEmitt } from '@/hooks/web/useEmitt'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { storeToRefs } from 'pinia'
+import { debounce } from 'lodash-es'
+import mobileHeader from '@/assets/img/mobile-header.png'
const dvMainStore = dvMainStoreWithOut()
const { componentData, canvasStyleData, canvasViewInfo, dvInfo } = storeToRefs(dvMainStore)
const mobileLoading = ref(true)
+const mobileStyle = ref({})
const emits = defineEmits(['pcMode'])
const snapshotStore = snapshotStoreWithOut()
@@ -59,6 +62,7 @@ const handleLoad = () => {
const componentDataNotInMobile = computed(() => {
return componentData.value.filter(ele => !ele.inMobile)
})
+const openMobile = ref(false)
const hanedleMessage = event => {
if (event.data.type === 'panelInit') {
@@ -124,8 +128,23 @@ const loadCanvasData = () => {
mobileLoading.value = false
})
}
+
+const setMobileStyle = debounce(() => {
+ const height = window.innerHeight
+ if (height > 1032) {
+ mobileStyle.value = {}
+ return
+ }
+ const scale = height / 1032
+ mobileStyle.value = {
+ top: `${60 + scale * 40}px`,
+ transform: `scale(${scale})`,
+ transformOrigin: '0 0'
+ }
+}, 500)
onMounted(() => {
window.addEventListener('message', hanedleMessage)
+ window.addEventListener('resize', setMobileStyle)
dvMainStore.setMobileInPc(true)
useEmitt({
name: 'onMobileStatusChange',
@@ -133,11 +152,13 @@ onMounted(() => {
mobileStatusChange(type, value)
}
})
+ setMobileStyle()
})
onBeforeUnmount(() => {
dvMainStore.setMobileInPc(false)
window.removeEventListener('message', hanedleMessage)
+ window.removeEventListener('resize', setMobileStyle)
})
const addToMobile = com => {
@@ -179,13 +200,21 @@ const save = () => {
{{ dvInfo.name }}
-
-
-
+ 开启移动端
+
+
+
+
+
+
+
保存
-
+
+
@@ -199,16 +228,16 @@ const save = () => {
@@ -262,6 +291,21 @@ const save = () => {
.mobile-save {
display: flex;
align-items: center;
+
+ .open-mobile-line {
+ background: #ffffff4d;
+ width: 1px;
+ height: 18px;
+ margin: 0 20px;
+ }
+
+ .open-mobile {
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 22px;
+ color: #ffffff99;
+ margin-right: 8px;
+ }
.ed-icon {
font-size: 20px;
cursor: pointer;
@@ -289,24 +333,34 @@ const save = () => {
.mobile-canvas {
border-radius: 30px;
width: 419px;
- height: 854px;
+ height: 852px;
overflow: hidden;
background-size: 100% 100% !important;
- height: calc(100vh - 120px);
position: absolute;
- top: 104px;
+ top: 80px;
left: calc(50% - 419px);
background-image: url(../../assets/img/mobile-bg-pc.png);
padding: 0 22px;
+ .mobile-header {
+ margin-top: 20px;
+ height: 44px;
+ display: flex;
+ img {
+ height: 100%;
+ width: 100%;
+ }
+ }
+
.config-panel-title {
- margin-top: 64px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
position: relative;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
.ed-icon {
font-size: 20px;
@@ -341,12 +395,38 @@ const save = () => {
--ed-collapse-content-font-size: 12px;
}
+ :deep(.ed-tabs) {
+ --ed-tabs-header-height: 36px;
+ border-top: 1px solid #1f232926;
+ .ed-tabs__header {
+ padding-left: 8px;
+ &::before {
+ content: '';
+ width: 8px;
+ height: 1px;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ background: #1f232926;
+ }
+ }
+ }
+
+ :deep(.ed-tabs__item) {
+ font-size: 12px;
+ color: #646a73;
+ }
+
.config-mobile-sidebar {
font-size: 14px;
font-weight: 500;
line-height: 22px;
padding: 8px;
}
+
+ .config-mobile-tab {
+ padding: 16px 8px;
+ }
.mobile-wrapper-inner-adaptor {
position: relative;
margin-right: 8px;
@@ -367,7 +447,7 @@ const save = () => {
}
&:hover {
- border-color: var(--ed-color-primary);
+ border-color: var(--ed-color-primary-99, #3370ff99);
}
}
@@ -378,6 +458,7 @@ const save = () => {
top: 0;
left: 0;
z-index: 10;
+ cursor: pointer;
}
.pc-select-to-mobile {
@@ -390,6 +471,9 @@ const save = () => {
border-radius: 4px;
z-index: 20;
cursor: pointer;
+ &:hover {
+ border-color: var(--ed-color-primary-99, #3370ff99);
+ }
}
}
}