mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
Pr@dev v2@refactor map wheel event (#15503)
* fix(图表): 修复排序优先级保存不生效 * refactor(图表): 优化地图缩放,只有在选中状态下才响应滚轮事件 #14921
This commit is contained in:
@@ -442,6 +442,8 @@ public class ChartViewManege {
|
||||
dto.setFlowMapStartName(JsonUtil.parseList(record.getFlowMapStartName(), tokenType));
|
||||
dto.setFlowMapEndName(JsonUtil.parseList(record.getFlowMapEndName(), tokenType));
|
||||
dto.setExtColor(JsonUtil.parseList(record.getExtColor(), tokenType));
|
||||
dto.setSortPriority(JsonUtil.parseList(record.getSortPriority(), new TypeReference<List<SortAxis>>() {
|
||||
}));
|
||||
|
||||
return dto;
|
||||
|
||||
|
||||
@@ -76,6 +76,11 @@ const props = defineProps({
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'inherit'
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -779,6 +784,15 @@ onMounted(() => {
|
||||
useEmitt({ name: 'l7-prepare-picture', callback: preparePicture })
|
||||
useEmitt({ name: 'l7-unprepare-picture', callback: unPreparePicture })
|
||||
})
|
||||
const MAP_CHARTS = ['map', 'bubble-map', 'flow-map', 'heat-map', 'symbolic-map']
|
||||
const onWheel = (e: WheelEvent) => {
|
||||
if (!MAP_CHARTS.includes(view.value.type)) {
|
||||
return
|
||||
}
|
||||
if (!props.active) {
|
||||
e.stopPropagation()
|
||||
}
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
try {
|
||||
myChart?.destroy()
|
||||
@@ -801,7 +815,13 @@ onBeforeUnmount(() => {
|
||||
:style="state.trackBarStyle"
|
||||
@trackClick="trackClick"
|
||||
/>
|
||||
<div v-if="!isError" ref="chartContainer" class="canvas-content" :id="containerId"></div>
|
||||
<div
|
||||
@wheel.capture="onWheel"
|
||||
v-if="!isError"
|
||||
ref="chartContainer"
|
||||
class="canvas-content"
|
||||
:id="containerId"
|
||||
></div>
|
||||
<chart-error v-else :err-msg="errMsg" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1190,6 +1190,7 @@ const clearG2Tooltip = () => {
|
||||
:element="element"
|
||||
:suffixId="suffixId"
|
||||
:font-family="fontFamily"
|
||||
:active="active"
|
||||
v-else-if="
|
||||
showChartView(ChartLibraryType.G2_PLOT, ChartLibraryType.L7_PLOT, ChartLibraryType.L7)
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user