forked from github/dataease
refactor(图表): 增加图表联动、跳转快速删除配置功能
This commit is contained in:
parent
c25e9dc0c8
commit
c2b6e3a60a
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -47,3 +47,11 @@ export function updateJumpSetActive(requestInfo) {
|
||||
loading: true
|
||||
})
|
||||
}
|
||||
|
||||
export function removeJumpSet(requestInfo) {
|
||||
return request.post({
|
||||
url: '/linkJump/removeJumpSet',
|
||||
data: requestInfo,
|
||||
loading: true
|
||||
})
|
||||
}
|
||||
|
@ -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 })
|
||||
|
@ -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)
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -304,6 +330,21 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
<span class="set-text-info" :class="{ 'set-text-info-dark': themes === 'dark' }">
|
||||
已设置
|
||||
</span>
|
||||
<el-button
|
||||
class="circle-button font14"
|
||||
:title="t('chart.delete')"
|
||||
:class="'label-' + props.themes"
|
||||
text
|
||||
size="small"
|
||||
:style="{ width: '14px', margin: '0 8px' }"
|
||||
@click="removeLinkageSenior"
|
||||
>
|
||||
<template #icon>
|
||||
<el-icon size="14px">
|
||||
<Icon name="icon_delete-trash_outlined" />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button
|
||||
class="circle-button font14"
|
||||
@ -339,21 +380,21 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
<span class="set-text-info" :class="{ 'set-text-info-dark': themes === 'dark' }">
|
||||
已设置
|
||||
</span>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
class="circle-button font14"
|
||||
:title="t('chart.delete')"
|
||||
:class="'label-' + props.themes"
|
||||
text
|
||||
size="small"
|
||||
:style="{ width: '24px', marginLeft: '6px' }"
|
||||
@click="linkJumpSetOpen"
|
||||
:style="{ width: '14px', margin: '0 8px' }"
|
||||
@click="removeJumpSenior"
|
||||
>
|
||||
<template #icon>
|
||||
<el-icon size="14px">
|
||||
<Icon name="icon_delete-trash_outlined" />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-button>-->
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button
|
||||
class="circle-button font14"
|
||||
@ -361,7 +402,7 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
:class="'label-' + props.themes"
|
||||
text
|
||||
size="small"
|
||||
:style="{ width: '24px', marginLeft: '6px' }"
|
||||
:style="{ width: '14px', margin: 0 }"
|
||||
@click="linkJumpSetOpen"
|
||||
:disabled="!chart.jumpActive"
|
||||
>
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
@ -43,4 +43,10 @@ public interface VisualizationLinkageApi {
|
||||
@Operation(summary = "修改联动信息可用状态")
|
||||
Map updateLinkageActive(@RequestBody VisualizationLinkageRequest request);
|
||||
|
||||
|
||||
@PostMapping("/removeLinkage")
|
||||
@Operation(summary = "删除图表联动信息")
|
||||
void removeLinkage(@RequestBody VisualizationLinkageRequest request);
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user