mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
refactor(仪表板): 仪表板拖拽定位到第二屏时可以直接拖入第二屏 #11849
This commit is contained in:
@@ -54,10 +54,10 @@ const dvMainStore = dvMainStoreWithOut()
|
||||
const composeStore = composeStoreWithOut()
|
||||
const contextmenuStore = contextmenuStoreWithOut()
|
||||
|
||||
const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState } =
|
||||
const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState, mainScrollTop } =
|
||||
storeToRefs(dvMainStore)
|
||||
const { editorMap, areaData, isCtrlOrCmdDown } = storeToRefs(composeStore)
|
||||
const emits = defineEmits(['scrollCanvasToTop'])
|
||||
const emits = defineEmits(['scrollCanvasAdjust'])
|
||||
const props = defineProps({
|
||||
themes: {
|
||||
type: String,
|
||||
@@ -1377,7 +1377,8 @@ const handleDragStartMoveIn = componentInfo => {
|
||||
adaptCurThemeCommonStyle(moveInItemInfo)
|
||||
}
|
||||
addItemBox(moveInItemInfo)
|
||||
emits('scrollCanvasToTop')
|
||||
// 直接定位到当前画布位置
|
||||
// emits('scrollCanvasAdjust', 1)
|
||||
if (!infoBox.value) {
|
||||
infoBox.value = {}
|
||||
}
|
||||
@@ -1400,7 +1401,7 @@ const handleDragOver = e => {
|
||||
return
|
||||
}
|
||||
infoBox.value.moveItem.style.left = e.pageX
|
||||
infoBox.value.moveItem.style.top = e.pageY
|
||||
infoBox.value.moveItem.style.top = e.pageY + mainScrollTop.value
|
||||
onDragging(e, infoBox.value.moveItem, 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ const getBaseMatrixSize = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const scrollTo = y => {
|
||||
const scrollTo = (y = 1) => {
|
||||
setTimeout(() => {
|
||||
canvasInner.value.scrollTo({
|
||||
top: (y - 1) * baseHeight.value,
|
||||
@@ -334,7 +334,7 @@ defineExpose({
|
||||
:base-width="baseWidth"
|
||||
:base-height="baseHeight"
|
||||
:font-family="fontFamily"
|
||||
@scrollCanvasToTop="scrollTo(1)"
|
||||
@scrollCanvasAdjust="scrollTo"
|
||||
></canvas-core>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user