Merge pull request #9164 from dataease/pr@dev-v2@fix_trackbar

fix(仪表板): 修复联动跳转弹出框可能被遮挡问题
This commit is contained in:
王嘉豪 2024-04-17 14:54:58 +08:00 committed by GitHub
commit 0718bbe9f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 4 deletions

View File

@ -1,8 +1,8 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://39.98.78.97:13306/dataease?autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123456
password: Password123@mysql
messages:
basename: i18n/lic,i18n/core,i18n/permissions,i18n/xpack
flyway:

View File

@ -420,3 +420,20 @@ export async function decompressionPre(params, callBack) {
})
callBack(deTemplateData)
}
export function trackBarStyleCheck(element, trackbarStyle, scale) {
const { width, height } = element.value.style
const widthReal = width * scale
const heightReal = height * scale
if (trackbarStyle.left < 0) {
trackbarStyle.left = 0
} else if (widthReal - trackbarStyle.left < 60) {
trackbarStyle.left = trackbarStyle.left - 60
}
if (trackbarStyle.top < 0) {
trackbarStyle.top = 0
} else if (heightReal - trackbarStyle.top < 100) {
trackbarStyle.top = trackbarStyle.top - 100
}
}

View File

@ -26,6 +26,7 @@ import { BASE_VIEW_CONFIG } from '../../editor/util/chart'
import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/utils/canvasStyle'
import { deepCopy } from '@/utils/utils'
import { useEmitt } from '@/hooks/web/useEmitt'
import { trackBarStyleCheck } from '@/utils/canvasUtils'
const dvMainStore = dvMainStoreWithOut()
const { nowPanelTrackInfo, nowPanelJumpInfo, mobileInPc } = storeToRefs(dvMainStore)
@ -247,8 +248,13 @@ const action = param => {
trackClick(trackMenu.value[0])
} else {
//
state.trackBarStyle.left = param.x - 50 + 'px'
state.trackBarStyle.top = param.y + 10 + 'px'
const barStyleTemp = {
left: param.x - 50,
top: param.y + 10
}
trackBarStyleCheck(props.element, barStyleTemp, props.scale)
state.trackBarStyle.left = barStyleTemp.left + 'px'
state.trackBarStyle.top = barStyleTemp.top + 'px'
viewTrack.value.trackButtonClick()
}
}