| | |
| | | </div> |
| | | |
| | | <div class="left-content district-content"> |
| | | <div style="margin-left: 5px; margin-bottom: 5px"> |
| | | <span style="color: white">北京市:</span> |
| | | <el-select |
| | | @change="handleChange1" |
| | | v-model="selectValue1" |
| | | placeholder="Select" |
| | | size="mini" |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="item in BJoptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | <div style="margin-left: 5px"> |
| | | <span style="color: white">重点沟:</span> |
| | | <el-select |
| | | @change="handleChange" |
| | | v-model="selectValue" |
| | | placeholder="Select" |
| | | size="large" |
| | | size="mini" |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | |
| | | </div> |
| | | |
| | | <!-- 滚动区域 --> |
| | | <div style="overflow-y: auto; height: 95%"> |
| | | <div style="overflow-y: auto; height: 91%; position: relative"> |
| | | <!-- 加载遮罩层 --> |
| | | <div v-if="loading" class="loading-overlay"> |
| | | <div class="spinner"></div> |
| | | <div class="loading-content"> |
| | | <el-icon class="loading-icon"><Loading /></el-icon> |
| | | <span class="loading-text">数据加载中...</span> |
| | | </div> |
| | | </div> |
| | | <div |
| | | v-else |
| | |
| | | import { useSimStore } from "@/store/simulation"; |
| | | import { initeWaterPrimitiveView } from "@/utils/water"; //相机flyTo函数,后续options列表中有对应经纬度后弃用 |
| | | import { useRoute, onBeforeRouteUpdate } from "vue-router"; |
| | | import { Loading } from "@element-plus/icons-vue"; |
| | | import { fetchAndLoadDangerPoints } from "@/api/hpApi.js"; |
| | | |
| | | const districtList = ref([]); |
| | | |
| | | const displayData = ref([]); |
| | | |
| | | const loadCallback = async (newData) => { |
| | | districtList.value = [...newData]; |
| | | console.log(districtList.value, "aaaaaaaaaaaaaaaaaaaaaaaaa"); |
| | | |
| | | await initializeDevicePoints(); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | fetchAndLoadDangerPoints(loadCallback); |
| | | }); |
| | | |
| | | const simStore = useSimStore(); |
| | | // onBeforeRouteUpdate((to, from, next) => { |
| | | // if (to.path !== "/yhgl") { |
| | |
| | | } |
| | | }); |
| | | const selectValue = ref("孙胡沟"); |
| | | |
| | | const selectValue1 = ref("北京市"); |
| | | |
| | | const BJoptions = ref([]); |
| | | |
| | | const options = ref([ |
| | | { |
| | |
| | | }, |
| | | ]); |
| | | |
| | | const districtList = ref([]); |
| | | const loading = ref(true); // 控制加载状态 |
| | | |
| | | function handleClick(district) { |
| | |
| | | }) |
| | | ); |
| | | }; |
| | | // 根据区域名称过滤数据 |
| | | |
| | | const filterDataByArea = async (areaName) => { |
| | | handleCleanup(); |
| | | if (!areaName || !simStore.DangerPoint || simStore.DangerPoint.length === 0) { |
| | |
| | | ); |
| | | |
| | | if (JSON.stringify(districtList.value) !== JSON.stringify(filteredData)) { |
| | | districtList.value = filteredData; |
| | | // districtList.value = filteredData; |
| | | |
| | | await initializeDevicePoints(); |
| | | } |
| | | }; |
| | |
| | | |
| | | onMounted(() => { |
| | | handleCleanup(); |
| | | initeWaterPrimitiveView(); |
| | | // initeWaterPrimitiveView(); |
| | | // 默认先检查一遍数据 |
| | | if (simStore.DangerPoint && simStore.DangerPoint.length > 0) { |
| | | filterDataByArea("孙胡沟"); |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .loading-overlay { |
| | | position: absolute; |
| | | top: 120px; |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 10px; |
| | | background-color: rgba(47, 44, 44, 0.5); |
| | | /* 半透明遮罩 */ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | z-index: 999; |
| | | } |
| | | |
| | | .spinner { |
| | | width: 40px; |
| | | height: 40px; |
| | | border: 4px solid #fff; |
| | | border-top: 4px solid transparent; |
| | | border-radius: 50%; |
| | | animation: spin 1s linear infinite; |
| | | } |
| | | |
| | | @keyframes spin { |
| | | to { |
| | | transform: rotate(360deg); |
| | | } |
| | | } |
| | | |
| | | .district { |
| | | position: absolute; |
| | | width: 345px; |
| | |
| | | .district-content { |
| | | padding: 10px; |
| | | box-sizing: border-box; |
| | | height: calc(100% - 70px); |
| | | position: relative; |
| | | } |
| | | |
| | | .district-item-icon { |
| | |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .loading-overlay { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | // background-color: rgba(0, 0, 0, 0.7); |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | z-index: 100; |
| | | // border-radius: 4px; |
| | | } |
| | | |
| | | .loading-content { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | color: #fff; |
| | | } |
| | | |
| | | .loading-icon { |
| | | font-size: 24px; |
| | | margin-bottom: 8px; |
| | | animation: rotating 2s linear infinite; |
| | | } |
| | | |
| | | .loading-text { |
| | | color: white; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | @keyframes rotating { |
| | | 0% { |
| | | transform: rotate(0deg); |
| | | } |
| | | 100% { |
| | | transform: rotate(360deg); |
| | | } |
| | | } |
| | | |
| | | /deep/ .el-select__placeholder { |