<template>
|
<div>
|
<el-button
|
@click="handleChange"
|
type="primary"
|
class="el-button-custom p-events-auto"
|
>污染溯源:{{ disable ? '关' : '开' }}</el-button
|
>
|
</div>
|
</template>
|
<script setup>
|
import { ref, onMounted } from 'vue';
|
import { useGridStore } from '@/stores/grid-info';
|
import { useSceneStore } from '@/stores/scene';
|
|
const gridStore = useGridStore();
|
const sceneStore = useSceneStore();
|
|
const disable = ref(true);
|
|
function handleChange() {
|
disable.value = !disable.value;
|
if (disable.value) {
|
gridStore.selectedSatelliteProxy.goBackGridEvent('click');
|
} else {
|
gridStore.selectedSatelliteProxy.setGridEvent('click', (e) => {
|
const polygon = e.target;
|
const { centerPoint } = polygon.getExtData();
|
const [lng, lat] = centerPoint;
|
sceneStore.radius = 0.5;
|
sceneStore.searchScene(lng, lat);
|
});
|
}
|
}
|
</script>
|