1
wangjuncheng
2025-06-06 7217e02e098b94e421b5a85ec13e0cd2ed35fbeb
src/views/left/KGSim.vue
@@ -39,7 +39,6 @@
    </div>
    <Ditching v-show="ditchingShow" class="ditchingPosition" @update-excavation-data="handleUpdateExcavationData"></Ditching>
    <Dam v-show="damShow" class="ditchingPosition"></Dam>
  </div>
</template>
@@ -53,7 +52,6 @@
import RealTimeSimulation from "./KGSimOption/RealTimeSimulation.vue";
import { getRegionData } from "@/api/trApi";
import { EventBus } from "@/eventBus"; // 引入事件总线
const selectedSimulation = ref("历史模拟");
const selectedArea = ref(); // 选中的区域
// 重点沟数据
@@ -111,23 +109,26 @@
  ditchingShow.value = ditchingActive.value;
  if (ditchingActive.value) {
    console.log("开启按钮被点击");
    damActive.value = false; // 关闭加坝状态
    damShow.value = false;   // 隐藏 Dam 组件
  } else {
    console.log("关闭按钮被点击");
    cloesDitch();
  }
};
// 切换加坝状态
const toggleDam = () => {
  damActive.value = !damActive.value;
  damShow.value = damActive.value;
  // damActive.value = !damActive.value;
  // damShow.value = damActive.value;
  if (damActive.value) {
    console.log("开启按钮被点击");
  } else {
    console.log("关闭按钮被点击");
    cloesDam();
  }
  // if (damActive.value) {
  //   ditchingActive.value = false; // 关闭开沟状态
  //   ditchingShow.value = false;   // 隐藏 Ditching 组件
  // } else {
  //   cloesDam();
  // }
  window.Viewer = earthCtrl.viewer;
  earthCtrl.factory.createModelLibrary()
};
const cloesDitch = () => {
  ditchingShow.value = false;