guonan
2025-05-28 86f2633b4c70675bd90e79c9bdaf8a1eb8f95938
src/views/left/KGSim.vue
@@ -16,7 +16,7 @@
          v-for="item in filteredOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"
          :value="item"
        />
      </el-select>
    </div>
@@ -36,7 +36,8 @@
        <el-radio label="预测模拟">预测模拟</el-radio>
      </el-radio-group>
      <div v-if="selectedSimulation === '历史模拟'">
        <HistorySimulation :selectedArea="selectedArea" />
        <!-- <HistorySimulation :selectedArea="selectedArea" /> -->
        <CitySim :selectedArea="selectedArea" />
      </div>
      <div v-if="selectedSimulation === '实时模拟'">
        <RealTimeSimulation :selectedArea="selectedArea" />
@@ -51,9 +52,11 @@
<script setup>
import { ref, computed, onMounted, reactive } from "vue";
import HistorySimulation from "./KGSimOption/HistorySimulation.vue";
import CitySim from './CitySim.vue'
import PredictiveSimulation from "./KGSimOption/PredictiveSimulation.vue";
import RealTimeSimulation from "./KGSimOption/RealTimeSimulation.vue";
import { getRegionData } from "@/api/trApi";
import { EventBus } from "@/eventBus"; // 引入事件总线
const selectedSimulation = ref("历史模拟");
const selectedArea = ref(); // 选中的区域
@@ -67,9 +70,9 @@
      0,
      importGOptions.length,
      ...res.data.map((item) => ({
        id:item.id,
        id: item.id,
        value: item.geom,
        label: item.name
        label: item.name,
      }))
    );
  });
@@ -90,8 +93,12 @@
// 处理选项选择事件
const handleSelectChange = (value) => {
  EventBus.emit("select-geom", { geom: value.value, flyHeight: 8000 });
  console.log("选中的值:", value); // 打印选中的值
  console.log("当前选中的完整数据:", importGOptions.find((item) => item.value === value)); // 打印完整的选中数据
  console.log(
    "当前选中的完整数据:",
    importGOptions.find((item) => item.value === value)
  ); // 打印完整的选中数据
};
const handleStart = () => {
@@ -144,4 +151,4 @@
:deep(.el-input__inner) {
  color: #fff; /* 让文字颜色跟随父级 */
}
</style>
</style>