From 07cf91cb327feb638a8a952b013258d8c845114a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 17 Apr 2024 14:51:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=81=94=E5=8A=A8=E8=B7=B3=E8=BD=AC=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=A1=86=E5=8F=AF=E8=83=BD=E8=A2=AB=E9=81=AE=E6=8C=A1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/application-standalone.yml | 4 ++-- core/core-frontend/src/utils/canvasUtils.ts | 17 +++++++++++++++++ .../views/components/ChartComponentS2.vue | 10 ++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/core/core-backend/src/main/resources/application-standalone.yml b/core/core-backend/src/main/resources/application-standalone.yml index b521aa59d0..868f07365c 100644 --- a/core/core-backend/src/main/resources/application-standalone.yml +++ b/core/core-backend/src/main/resources/application-standalone.yml @@ -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: diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index ad2aca03cf..f6e15fecd1 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -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 + } +} diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index af30e0ab22..9dd1364517 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -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() } }