Merge pull request #13149 from dataease/pr@dev-v2@fix_tab-shadow-move

fix(仪表板): 仪表板超出一屏时tab内部组件移出定位阴影出现向上偏转问题
This commit is contained in:
王嘉豪 2024-11-05 22:15:43 +08:00 committed by GitHub
commit ca30461c7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 6 deletions

View File

@ -78,6 +78,11 @@ const props = defineProps({
isSelector: { isSelector: {
type: Boolean, type: Boolean,
default: false default: false
},
//
showPopBar: {
type: Boolean,
default: false
} }
}) })
@ -91,7 +96,8 @@ const {
previewActive, previewActive,
downloadStatus, downloadStatus,
outerScale, outerScale,
outerSearchCount outerSearchCount,
showPopBar
} = toRefs(props) } = toRefs(props)
const domId = 'preview-' + canvasId.value const domId = 'preview-' + canvasId.value
const scaleWidthPoint = ref(100) const scaleWidthPoint = ref(100)
@ -398,7 +404,10 @@ const dataVPreview = computed(
const linkOptBarShow = computed(() => { const linkOptBarShow = computed(() => {
return Boolean( return Boolean(
canvasStyleData.value.suspensionButtonAvailable && !inMobile.value && !mobileInPc.value canvasStyleData.value.suspensionButtonAvailable &&
!inMobile.value &&
!mobileInPc.value &&
showPopBar.value
) )
}) })

View File

@ -156,7 +156,8 @@ const {
tabCollisionActiveId, tabCollisionActiveId,
tabMoveInActiveId, tabMoveInActiveId,
tabMoveOutComponentId, tabMoveOutComponentId,
mobileInPc mobileInPc,
mainScrollTop
} = storeToRefs(dvMainStore) } = storeToRefs(dvMainStore)
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore) const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
const emit = defineEmits([ const emit = defineEmits([
@ -558,7 +559,7 @@ const handleMouseDownOnShape = e => {
mouseY: mouseY:
!isDashboard() && outerTabDom !isDashboard() && outerTabDom
? outerTabDom.offsetTop + curDom.offsetTop + offsetY + 100 ? outerTabDom.offsetTop + curDom.offsetTop + offsetY + 100
: curY, : curY + mainScrollTop.value,
width: componentWidth, width: componentWidth,
height: componentHeight height: componentHeight
}) })

View File

@ -189,7 +189,8 @@ export const dvMainStore = defineStore('dataVisualization', {
// 基础网格信息 // 基础网格信息
baseCellInfo: {}, baseCellInfo: {},
dataPrepareState: false, //数据准备状态 dataPrepareState: false, //数据准备状态
multiplexingStyleAdapt: true //复用样式跟随主题 multiplexingStyleAdapt: true, //复用样式跟随主题
mainScrollTop: 0 //主画布运动量
} }
}, },
actions: { actions: {
@ -1330,6 +1331,7 @@ export const dvMainStore = defineStore('dataVisualization', {
type: null, type: null,
mobileLayout: false mobileLayout: false
} }
this.mainScrollTop = 0
}, },
setViewDataDetails(viewId, chartDataInfo) { setViewDataDetails(viewId, chartDataInfo) {
this.canvasViewDataInfo[viewId] = chartDataInfo.data this.canvasViewDataInfo[viewId] = chartDataInfo.data

View File

@ -58,7 +58,8 @@ const scaleMin = ref(100)
const state = reactive({ const state = reactive({
screenWidth: 1920, screenWidth: 1920,
screenHeight: 1080 screenHeight: 1080,
curScrollTop: 0
}) })
// //
@ -266,6 +267,12 @@ const scrollTo = y => {
}) })
} }
const scrollCanvas = () => {
if (isMainCanvas(canvasId.value)) {
dvMainStore.mainScrollTop = canvasInner.value.scrollTop
}
}
watch( watch(
() => canvasActive.value, () => canvasActive.value,
() => { () => {
@ -299,6 +306,7 @@ defineExpose({
@drop="handleDrop" @drop="handleDrop"
@dragover="handleDragOver" @dragover="handleDragOver"
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
@scroll="scrollCanvas"
> >
<canvas-core <canvas-core
ref="cyGridster" ref="cyGridster"

View File

@ -194,6 +194,7 @@ defineExpose({
:cur-gap="state.curPreviewGap" :cur-gap="state.curPreviewGap"
:is-selector="props.isSelector" :is-selector="props.isSelector"
:download-status="downloadStatus" :download-status="downloadStatus"
:show-pop-bar="true"
></de-preview> ></de-preview>
<empty-background v-if="!state.initState" description="参数不能为空" img-type="noneWhite" /> <empty-background v-if="!state.initState" description="参数不能为空" img-type="noneWhite" />
</div> </div>