From c2b6e3a60aecf1cda1c379e325a1a540c0fa1b8b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 4 Sep 2024 09:50:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=BE=E8=A1=A8=E8=81=94=E5=8A=A8=E3=80=81=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=BF=AB=E9=80=9F=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/VisualizationLinkJumpService.java | 8 +++ .../server/VisualizationLinkageService.java | 7 +++ .../src/api/visualization/linkJump.ts | 8 +++ .../src/api/visualization/linkage.ts | 2 + .../editor/editor-senior/Senior.vue | 55 ++++++++++++++++--- .../VisualizationLinkJumpApi.java | 5 ++ .../VisualizationLinkageApi.java | 6 ++ 7 files changed, 84 insertions(+), 7 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkJumpService.java b/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkJumpService.java index 9ab5b0cf13..b01bb82a5b 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkJumpService.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkJumpService.java @@ -166,4 +166,12 @@ public class VisualizationLinkJumpService implements VisualizationLinkJumpApi { return queryVisualizationJumpInfo(request.getSourceDvId()); } + @Override + public void removeJumpSet(VisualizationLinkJumpDTO jumpDTO) { + //清理原有数据 + extVisualizationLinkJumpMapper.deleteJumpTargetViewInfo(jumpDTO.getSourceDvId(), jumpDTO.getSourceViewId()); + extVisualizationLinkJumpMapper.deleteJumpInfo(jumpDTO.getSourceDvId(), jumpDTO.getSourceViewId()); + extVisualizationLinkJumpMapper.deleteJump(jumpDTO.getSourceDvId(), jumpDTO.getSourceViewId()); + } + } diff --git a/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkageService.java b/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkageService.java index 7a53b2b105..e7af4e5562 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkageService.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/server/VisualizationLinkageService.java @@ -122,4 +122,11 @@ public class VisualizationLinkageService implements VisualizationLinkageApi { coreChartViewMapper.updateById(coreChartView); return getVisualizationAllLinkageInfo(request.getDvId()); } + + @Override + public void removeLinkage(VisualizationLinkageRequest request) { + // 清理原有关系 + extVisualizationLinkageMapper.deleteViewLinkageField(request.getDvId(), request.getSourceViewId()); + extVisualizationLinkageMapper.deleteViewLinkage(request.getDvId(), request.getSourceViewId()); + } } diff --git a/core/core-frontend/src/api/visualization/linkJump.ts b/core/core-frontend/src/api/visualization/linkJump.ts index 3e342f77e3..393acb9141 100644 --- a/core/core-frontend/src/api/visualization/linkJump.ts +++ b/core/core-frontend/src/api/visualization/linkJump.ts @@ -47,3 +47,11 @@ export function updateJumpSetActive(requestInfo) { loading: true }) } + +export function removeJumpSet(requestInfo) { + return request.post({ + url: '/linkJump/removeJumpSet', + data: requestInfo, + loading: true + }) +} diff --git a/core/core-frontend/src/api/visualization/linkage.ts b/core/core-frontend/src/api/visualization/linkage.ts index f5c9f1f867..9239c96db6 100644 --- a/core/core-frontend/src/api/visualization/linkage.ts +++ b/core/core-frontend/src/api/visualization/linkage.ts @@ -13,3 +13,5 @@ export const getPanelAllLinkageInfo = dvId => export const updateLinkageActive = data => request.post({ url: '/linkage/updateLinkageActive', data }) + +export const removeLinkage = data => request.post({ url: '/linkage/removeLinkage', data }) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue index 6a6ece966f..5ae2394e26 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue @@ -11,9 +11,17 @@ import { computed, PropType, ref, toRefs, watch } from 'vue' import LinkJumpSet from '@/components/visualization/LinkJumpSet.vue' import LinkageSet from '@/components/visualization/LinkageSet.vue' import { canvasSave } from '@/utils/canvasUtils' -import { updateJumpSetActive } from '@/api/visualization/linkJump' +import { + queryVisualizationJumpInfo, + removeJumpSet, + updateJumpSetActive +} from '@/api/visualization/linkJump' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' -import { updateLinkageActive } from '@/api/visualization/linkage' +import { + getPanelAllLinkageInfo, + removeLinkage, + updateLinkageActive +} from '@/api/visualization/linkage' import { includesAny } from '../util/StringUtils' import { ElIcon, ElMessage } from 'element-plus-secondary' import { storeToRefs } from 'pinia' @@ -192,6 +200,24 @@ const linkageActiveChange = () => { } const appStore = useAppStoreWithOut() const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) + +const removeLinkageSenior = () => { + removeLinkage({ dvId: dvInfo.value.id, sourceViewId: chart.value.id }).then(rsp => { + // 刷新联动信息 + getPanelAllLinkageInfo(dvInfo.value.id).then(rsp => { + dvMainStore.setNowPanelTrackInfo(rsp.data) + }) + }) +} + +const removeJumpSenior = () => { + removeJumpSet({ sourceDvId: dvInfo.value.id, sourceViewId: chart.value.id }).then(rspCur => { + // 刷新跳转信息 + queryVisualizationJumpInfo(dvInfo.value.id).then(rsp => { + dvMainStore.setNowPanelJumpInfo(rsp.data) + }) + }) +} appStore.getIsDataEaseBi) 已设置 - + appStore.getIsDataEaseBi) :class="'label-' + props.themes" text size="small" - :style="{ width: '24px', marginLeft: '6px' }" + :style="{ width: '14px', margin: 0 }" @click="linkJumpSetOpen" :disabled="!chart.jumpActive" > diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java index 4d031bb23c..0cdb0d5b91 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkJumpApi.java @@ -51,4 +51,9 @@ public interface VisualizationLinkJumpApi { @PostMapping("/updateJumpSetActive") @Operation(summary = "更新跳转信息可用状态") VisualizationLinkJumpBaseResponse updateJumpSetActive(@RequestBody VisualizationLinkJumpBaseRequest request); + + @PostMapping("/removeJumpSet") + @Operation(summary = "删除跳转信息") + void removeJumpSet(@RequestBody VisualizationLinkJumpDTO jumpDTO); + } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java index 9d88f567e9..e3c23195cf 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/VisualizationLinkageApi.java @@ -43,4 +43,10 @@ public interface VisualizationLinkageApi { @Operation(summary = "修改联动信息可用状态") Map updateLinkageActive(@RequestBody VisualizationLinkageRequest request); + + @PostMapping("/removeLinkage") + @Operation(summary = "删除图表联动信息") + void removeLinkage(@RequestBody VisualizationLinkageRequest request); + + }