From a8e5c275a8724feff972502c1b2db348dba4482b Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期五, 16 五月 2025 09:57:50 +0800 Subject: [PATCH] 对接中科软接口 --- src/api/hpApi.js | 36 src/components/menu/Device.vue | 200 +----- src/store/simulation.js | 4 src/constant/dict.js | 4 src/views/Home.vue | 55 src/components/menu/Location.vue | 1331 +++++++++++++++++++++--------------------- src/views/left/KGSimOption/RealTimeSimulation.vue | 222 +++--- 7 files changed, 874 insertions(+), 978 deletions(-) diff --git a/src/api/hpApi.js b/src/api/hpApi.js index 1d1a0cc..42f5fa6 100644 --- a/src/api/hpApi.js +++ b/src/api/hpApi.js @@ -29,16 +29,6 @@ }, intervalTime); } -// 鑾峰彇闅愭偅鐐规竻鍗� -export async function getDangerPoint(data) { - const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { - filterObject: { - year: 2024, // 鍔ㄦ�佷紶鍏ョ殑骞翠唤鍙傛暟 - }, - }); - console.log("getDangerPoint:", response); - return response.data; -} // 鑾峰彇閬块櫓浣嶇疆 export async function getSafeLocation(data) { const response = await axios.post("/hp/safeHavenLocation/getData", { @@ -70,7 +60,7 @@ return response.data; } // 鑾峰彇闆ㄩ噺鏁版嵁 -export async function getRainfallData(data) { +export async function getRainfallData() { const response = await axios.post("/hp/rainfallCountyCity/getData", { filterObject: {}, "pageSize": 1000 @@ -78,3 +68,27 @@ console.log("getRainfallData:", response); return response.data; } + +// 鑾峰彇鐩戞祴璁惧淇℃伅 +export async function getDeviceInfo(data) { + const response = await axios.post("/hp/deviceInfo/getData", { + filterObject: { + "dictDeviceType": data, + "townCode": "110116110000" + }, + "pageSize": 10000 + }); + return response.data; +} + +// 鑾峰彇闅愭偅鐐逛俊鎭� +export async function getDangerPoint(data) { + const response = await axios.post("/hp/sinoDzHiddenDangerPoint/getData", { + filterObject: { + "divisionCounty": "110116000000", + "divisionTown": "110116110000" + }, + "pageSize": 10000 + }); + return response.data; +} \ No newline at end of file diff --git a/src/components/menu/Device.vue b/src/components/menu/Device.vue index 2c19385..e914dbf 100644 --- a/src/components/menu/Device.vue +++ b/src/components/menu/Device.vue @@ -7,6 +7,7 @@ <div style="margin-left: 5px"> <span style="color: white">閲嶇偣娌燂細</span> <el-select + @change="handleChange" v-model="selectValue" placeholder="Select" size="large" @@ -45,7 +46,38 @@ import { ref, computed, onMounted } from "vue"; import { createPoint, removeEntities } from "@/utils/map"; import { deviceDictList, getDictName } from "@/constant/dict.js"; -import { getDeviceData } from "@/api/index"; +import { getDeviceInfo } from "@/api/hpApi"; + +// 瀹氫箟涓�涓搷搴斿紡寮曠敤瀛樺偍璁惧鍒楄〃 +const deviceListAll = ref([]); + +// 缁勪欢鎸傝浇鏃惰幏鍙栬澶囦俊鎭紝榛樿杩囨护鈥滃瓩鑳℃矡鈥� +onMounted(() => { + loadDeviceList("瀛欒儭娌�"); +}); + +// 鏍规嵁鍖哄煙鍚嶇О鍔犺浇璁惧鍒楄〃 +const loadDeviceList = async (areaName) => { + try { + const res = await getDeviceInfo(); // 璋冩暣getDeviceInfo浠ユ帴鍙楀姩鎬佸弬鏁帮紝濡傛灉闇�瑕佺殑璇� + deviceListAll.value = res.data.pageData.filter((item) => + item.deviceName?.includes(areaName) + ); + } catch (error) { + console.error("鍔犺浇璁惧淇℃伅澶辫触", error); + } +}; + +// 澶勭悊鍖哄煙鍙樺寲浜嬩欢 +const handleChange = (item) => { + if (!item) { + ElMessage("璇烽�夋嫨涓�涓尯鍩�"); + return; + } + // 鏍规嵁鏂板尯鍩熷悕閲嶆柊鍔犺浇璁惧鍒楄〃 + loadDeviceList(item); + console.log(deviceListAll.value); +}; const selectValue = ref("瀛欒儭娌�"); @@ -72,181 +104,17 @@ }, ]); -const devicetList = ref([ - { - deviceCode: "01303A9016", - deviceId: "1821067850122498049", - deviceName: "瀛欒儭娌�(澧掓儏)", - dictDeviceType: "14372958380", - latitude: 40.56476666, - longitude: 116.5955361, - }, - { - deviceCode: "303A9016", - deviceId: "1821067878870257666", - deviceName: "瀛欒儭娌�(澧掓儏)", - dictDeviceType: "1437295822", - latitude: 40.56476666, - longitude: 116.5955361, - }, - { - deviceCode: "1101161102180100010063", - deviceId: "1554360510040182786", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熷肮瀹惰タ娌熼洦閲忚0063", - dictDeviceType: "1437295810", - latitude: 40.556589, - longitude: 116.579459, - }, - { - deviceCode: "1101161102180100194030", - deviceId: "1554361328692826114", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熺紪鐮佸櫒4030", - dictDeviceType: "1437295815", - latitude: 40.554272, - longitude: 116.592583, - }, - { - deviceCode: "1101161102180100031041", - deviceId: "1554360448702681089", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熸澹颁华1041", - dictDeviceType: "1437295832", - latitude: 40.553236, - longitude: 116.592304, - }, - { - deviceCode: "1101161102180100022007", - deviceId: "1554360273959587842", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熷惈姘寸巼2007", - dictDeviceType: "1437295822", - latitude: 40.545821, - longitude: 116.586354, - }, - { - deviceCode: "1101161102180100225406", - deviceId: "1554360478494822402", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熸祦閫熶华5406", - dictDeviceType: "1437295821", - latitude: 40.554368, - longitude: 116.592989, - }, - { - deviceCode: "1101161102180100055006", - deviceId: "1554360276627165185", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熸偿浣嶈5006", - dictDeviceType: "1437295811", - latitude: 40.554398, - longitude: 116.592929, - }, - { - deviceCode: "1101161102180100010064", - deviceId: "1554360452670492674", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熼洦閲忚0064", - dictDeviceType: "1437295810", - latitude: 40.545741, - longitude: 116.586304, - }, - { - deviceCode: "1101161102180100183030", - deviceId: "1554360533087883265", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌熸憚鍍忓ご3030", - dictDeviceType: "1437295825", - latitude: 40.554272, - longitude: 116.592583, - }, - { - deviceCode: "1101161102180100194031", - deviceId: "1554361328877375489", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熺紪鐮佸櫒4031", - dictDeviceType: "1437295815", - latitude: 40.554035, - longitude: 116.59786, - }, - { - deviceCode: "1101161102180100055007", - deviceId: "1554360509775941634", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熸偿浣嶈5007", - dictDeviceType: "1437295811", - latitude: 40.554729, - longitude: 116.598165, - }, - { - deviceCode: "1101161102180100031042", - deviceId: "1554360448916590593", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熸澹颁华1042", - dictDeviceType: "1437295832", - latitude: 40.549398, - longitude: 116.600387, - }, - { - deviceCode: "1101161102180100225407", - deviceId: "1554360478658400257", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熸祦閫熶华5407", - dictDeviceType: "1437295821", - latitude: 40.55481, - longitude: 116.598025, - }, - { - deviceCode: "1101161102180100022008", - deviceId: "1554360274165108737", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熷惈姘寸巼2008", - dictDeviceType: "1437295822", - latitude: 40.544645, - longitude: 116.596511, - }, - { - deviceCode: "1101161102180100183031", - deviceId: "1554360533255655426", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熸憚鍍忓ご3031", - dictDeviceType: "1437295825", - latitude: 40.554035, - longitude: 116.59786, - }, - { - deviceCode: "1101161102180100010065", - deviceId: "1554360452888596482", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸ご鏍戝簳涓嬩笢娌熼洦閲忚0065", - dictDeviceType: "1437295810", - latitude: 40.543104, - longitude: 116.59585, - }, - { - deviceCode: "1101161102180100031040", - deviceId: "1554360448383913986", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙浜庡瑗挎矡娆″0浠�1040", - dictDeviceType: "1437295832", - latitude: 40.563822, - longitude: 116.592648, - }, - { - deviceCode: "1101161102180100010062", - deviceId: "1554360452519497730", - deviceName: "鎬�鏌斿尯鐞夌拑搴欓晣瀛欒儭娌熸潙浜庡瑗挎矡闆ㄩ噺璁�0062", - dictDeviceType: "1437295810", - latitude: 40.558778, - longitude: 116.586892, - }, - { - deviceCode: "1101160042160100010005", - deviceId: "1554360582698110977", - deviceName: "鎬�鏌斿尯闆佹爾闀囧寳婀炬潙鍖楁灄澶х煶闂ㄦ矡闆ㄩ噺璁�0005", - dictDeviceType: "1437295810", - latitude: 40.533623, - longitude: 116.602406, - }, -]); - const treeProps = { label: "deviceName", children: "children", }; // 璁$畻灞炴�э細灏嗚澶囧垪琛ㄨ浆鎹负鏍戝舰缁撴瀯 -// 璁$畻灞炴�э細灏嗚澶囧垪琛ㄨ浆鎹负鏍戝舰缁撴瀯 const deviceTree = computed(() => { const typeMap = {}; // 鍏堟寜璁惧绫诲瀷鍒嗙粍 - devicetList.value.forEach((device) => { + deviceListAll.value.forEach((device) => { const typeName = getDictName(deviceDictList, device.dictDeviceType); if (!typeName) { diff --git a/src/components/menu/Location.vue b/src/components/menu/Location.vue index 7536307..f8b899f 100644 --- a/src/components/menu/Location.vue +++ b/src/components/menu/Location.vue @@ -8,6 +8,7 @@ <div style="margin-left: 5px"> <span style="color: white">閲嶇偣娌燂細</span> <el-select + @change="handleChange" v-model="selectValue" placeholder="Select" size="large" @@ -21,14 +22,17 @@ /> </el-select> </div> - <div - v-for="(item, key) in districtList" - :key="key" - class="district-item" - @click="handleClick(item)" - > - <div class="district-item-icon"></div> - <div class="district-item-text">{{ item.name }}</div> + + <div style="overflow-y: auto; height: 95%"> + <div + v-for="(item, key) in districtList" + :key="key" + class="district-item" + @click="handleClick(item)" + > + <div class="district-item-icon"></div> + <div class="district-item-text">{{ item.hdName }}</div> + </div> </div> </div> </div> @@ -36,8 +40,10 @@ <script setup> import { ref, onMounted, onBeforeUnmount, reactive } from "vue"; -import { getDistrictData } from "@/api/index"; import { createPoint, removeEntities } from "@/utils/map"; +import { useSimStore } from "@/store/simulation"; + +const simStore = useSimStore(); const selectValue = ref("瀛欒儭娌�"); @@ -64,641 +70,639 @@ }, ]); -const districtList = ref([ - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116020058", - latitude: 40.56652778, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙灏瑰瑗挎矡灏瑰缓鐕曞灞嬪悗", - longitude: 116.5803889, - monitor: "", - monitorAdvice: "", - name: "灏瑰瑗挎矡灏瑰缓鐕曞灞嬪悗宕╁闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 2, - threatenMoney: 0, - threatenPopulation: "3", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "宕╁", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116020078", - latitude: 40.56497222, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙娌宠タ浜庡嚖鑻卞灞嬪悗", - longitude: 116.5955278, - monitor: "", - monitorAdvice: "", - name: "娌宠タ浜庡嚖鑻卞灞嬪悗宕╁闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 4, - threatenMoney: 0, - threatenPopulation: "6", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "宕╁", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030041", - latitude: 40.55369444, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熷叕璺�", - longitude: 116.6002778, - monitor: "", - monitorAdvice: "", - name: "鍗楁灏忎笢娌熸偿鐭虫祦闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡,绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 0, - threatenMoney: 0, - threatenPopulation: "", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030015", - latitude: 40.55277778, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鍗楁鏉戝ぇ绐戞矡", - longitude: 116.5994722, - monitor: "", - monitorAdvice: "", - name: "澶х獞娌熸偿鐭虫祦闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "宸茬洃娴嬨�佸凡娌荤悊", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 5, - threatenMoney: 0, - threatenPopulation: "11", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030076", - latitude: 40.55972222, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓滃潕澶т笢娌�", - longitude: 116.5916667, - monitor: "", - monitorAdvice: "", - name: "澶т笢娌熸偿鐭虫祦闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "宸叉不鐞�", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 1, - threatenMoney: 0, - threatenPopulation: "2", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030074", - latitude: 40.56580556, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙灏瑰瑗挎矡", - longitude: 116.59, - monitor: "", - monitorAdvice: "", - name: "灏瑰瑗挎矡娉ョ煶娴侀殣鎮g偣", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: - "宸茬洃娴嬶紱鐏惧浣撳彉鍖栵細4澶勫潯绉墿鍨锛屽爢绉嚦鍧¤剼锛屾柟閲忕害20m鲁銆�", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 7, - threatenMoney: 0, - threatenPopulation: "12", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030053", - latitude: 40.57361111, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鍖楀ぇ鍦拌タ娲煎瓙娌�", - longitude: 116.5897222, - monitor: "", - monitorAdvice: "", - name: "鍖楀ぇ鍦拌タ娲煎瓙娌熸偿鐭虫祦闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "娌熷彛姝e鎴垮眿锛岄檷闆ㄦ椂鍑烘按閲忓ぇ锛屽缓璁不鐞嗭紝姹涙湡鍔犲己宸℃煡", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 6, - threatenMoney: 0, - threatenPopulation: "10", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116020102", - latitude: 40.55972222, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鑼冨搴勭帇绉�鑾插灞嬪悗", - longitude: 116.5922222, - monitor: "", - monitorAdvice: "", - name: "鑼冨搴勭帇绉�鑾插灞嬪悗宕╁闅愭偅鐐�", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "杈瑰潯杈冮櫋锛岄『鍚戝博灞傦紝鎴垮眿闈犺繎鍧¤剼锛屽缓璁敖蹇不鐞�", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 1, - threatenMoney: 0, - threatenPopulation: "3", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "宕╁", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116020742", - latitude: 40.57680556, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓変憨鍦拌寖蹇犵敯瀹跺眿鍚�", - longitude: 116.5887222, - monitor: "", - monitorAdvice: "", - name: "涓変憨鍦拌寖蹇犵敯瀹跺眿鍚庡穿濉岄殣鎮g偣", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝鏇存崲璀︾ず鐗�", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 8, - threatenMoney: 0, - threatenPopulation: "23", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "宕╁", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030040", - latitude: 40.56344444, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙娌宠タ浜庡瑗挎矡", - longitude: 116.5953889, - monitor: "", - monitorAdvice: "", - name: "浜庡瑗挎矡娉ョ煶娴侀殣鎮g偣", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: - "宸茬洃娴嬶紝2018鏉戝凡娌荤悊锛涙矡鍙e爢绉墖鏄庢樉锛屾瀵规埧灞嬶紝寤鸿姹涙湡鍔犲己宸℃煡", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 18, - threatenMoney: 0, - threatenPopulation: "59", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030055", - latitude: 40.55283333, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙妞存爲搴曚笅涓滄矡", - longitude: 116.5999444, - monitor: "", - monitorAdvice: "", - name: "妞存爲搴曚笅涓滄矡娉ョ煶娴侀殣鎮g偣", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "宸叉不鐞嗭細濞佽儊瀵硅薄閲嶅锛氫笌110116030015閲嶅5鎴�11浜�", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "涓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 5, - threatenMoney: 0, - threatenPopulation: "11", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, - { - activeStatus: "", - areaCode: "", - areaName: "", - brookLength: 0, - checkId: "", - city: "鍖椾含甯�", - codeProvince: "110116", - county: "鎬�鏌�", - dangerLevel: "", - disasterStatus: "", - drainageArea: "", - elevation: 0, - featureDes: "", - groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", - hasPlan: "", - id: "110116030054", - latitude: 40.56166667, - length: 0, - district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌�", - longitude: 116.5997222, - monitor: "", - monitorAdvice: "", - name: "娌充笢鍗楁矡娉ョ煶娴侀殣鎮g偣", - number: - "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", - preventionDes: "宸茬洃娴�", - preventionLevel: "", - preventionPlan: "瀹氭湡宸℃煡,绔嬭绀虹墝", - preventionUnit: "涔¢晣", - principal: "", - province: "鍖椾含甯�", - qp: "", - reason: "", - responsibleUnit: "", - riskLevel: "", - scale: "灏忓瀷", - stableLevel: "", - status: "", - thickness: 0, - threatenFamily: 0, - threatenMoney: 0, - threatenPopulation: "", - threatenType: "", - town: "鐞夌拑搴欓晣", - trigger: "", - type: "娉ョ煶娴�", - village: "瀛欒儭娌熸潙", - volume: "", - volumePotential: "", - width: 0, - }, -]); -function getData() { - getDistrictData().then((res) => { - districtList.value = res.data; - }); -} +const districtList = ref([]); + +// const districtList = ref([ +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116020058", +// latitude: 40.56652778, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙灏瑰瑗挎矡灏瑰缓鐕曞灞嬪悗", +// longitude: 116.5803889, +// monitor: "", +// monitorAdvice: "", +// name: "灏瑰瑗挎矡灏瑰缓鐕曞灞嬪悗宕╁闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 2, +// threatenMoney: 0, +// threatenPopulation: "3", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "宕╁", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116020078", +// latitude: 40.56497222, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙娌宠タ浜庡嚖鑻卞灞嬪悗", +// longitude: 116.5955278, +// monitor: "", +// monitorAdvice: "", +// name: "娌宠タ浜庡嚖鑻卞灞嬪悗宕╁闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 4, +// threatenMoney: 0, +// threatenPopulation: "6", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "宕╁", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030041", +// latitude: 40.55369444, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熷叕璺�", +// longitude: 116.6002778, +// monitor: "", +// monitorAdvice: "", +// name: "鍗楁灏忎笢娌熸偿鐭虫祦闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡,绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 0, +// threatenMoney: 0, +// threatenPopulation: "", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030015", +// latitude: 40.55277778, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鍗楁鏉戝ぇ绐戞矡", +// longitude: 116.5994722, +// monitor: "", +// monitorAdvice: "", +// name: "澶х獞娌熸偿鐭虫祦闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "宸茬洃娴嬨�佸凡娌荤悊", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 5, +// threatenMoney: 0, +// threatenPopulation: "11", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030076", +// latitude: 40.55972222, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓滃潕澶т笢娌�", +// longitude: 116.5916667, +// monitor: "", +// monitorAdvice: "", +// name: "澶т笢娌熸偿鐭虫祦闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "宸叉不鐞�", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 1, +// threatenMoney: 0, +// threatenPopulation: "2", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030074", +// latitude: 40.56580556, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙灏瑰瑗挎矡", +// longitude: 116.59, +// monitor: "", +// monitorAdvice: "", +// name: "灏瑰瑗挎矡娉ョ煶娴侀殣鎮g偣", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: +// "宸茬洃娴嬶紱鐏惧浣撳彉鍖栵細4澶勫潯绉墿鍨锛屽爢绉嚦鍧¤剼锛屾柟閲忕害20m鲁銆�", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 7, +// threatenMoney: 0, +// threatenPopulation: "12", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030053", +// latitude: 40.57361111, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鍖楀ぇ鍦拌タ娲煎瓙娌�", +// longitude: 116.5897222, +// monitor: "", +// monitorAdvice: "", +// name: "鍖楀ぇ鍦拌タ娲煎瓙娌熸偿鐭虫祦闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "娌熷彛姝e鎴垮眿锛岄檷闆ㄦ椂鍑烘按閲忓ぇ锛屽缓璁不鐞嗭紝姹涙湡鍔犲己宸℃煡", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 6, +// threatenMoney: 0, +// threatenPopulation: "10", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116020102", +// latitude: 40.55972222, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙鑼冨搴勭帇绉�鑾插灞嬪悗", +// longitude: 116.5922222, +// monitor: "", +// monitorAdvice: "", +// name: "鑼冨搴勭帇绉�鑾插灞嬪悗宕╁闅愭偅鐐�", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "杈瑰潯杈冮櫋锛岄『鍚戝博灞傦紝鎴垮眿闈犺繎鍧¤剼锛屽缓璁敖蹇不鐞�", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 1, +// threatenMoney: 0, +// threatenPopulation: "3", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "宕╁", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116020742", +// latitude: 40.57680556, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓変憨鍦拌寖蹇犵敯瀹跺眿鍚�", +// longitude: 116.5887222, +// monitor: "", +// monitorAdvice: "", +// name: "涓変憨鍦拌寖蹇犵敯瀹跺眿鍚庡穿濉岄殣鎮g偣", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝鏇存崲璀︾ず鐗�", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 8, +// threatenMoney: 0, +// threatenPopulation: "23", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "宕╁", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030040", +// latitude: 40.56344444, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙娌宠タ浜庡瑗挎矡", +// longitude: 116.5953889, +// monitor: "", +// monitorAdvice: "", +// name: "浜庡瑗挎矡娉ョ煶娴侀殣鎮g偣", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: +// "宸茬洃娴嬶紝2018鏉戝凡娌荤悊锛涙矡鍙e爢绉墖鏄庢樉锛屾瀵规埧灞嬶紝寤鸿姹涙湡鍔犲己宸℃煡", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉�", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 18, +// threatenMoney: 0, +// threatenPopulation: "59", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030055", +// latitude: 40.55283333, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙妞存爲搴曚笅涓滄矡", +// longitude: 116.5999444, +// monitor: "", +// monitorAdvice: "", +// name: "妞存爲搴曚笅涓滄矡娉ョ煶娴侀殣鎮g偣", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "宸叉不鐞嗭細濞佽儊瀵硅薄閲嶅锛氫笌110116030015閲嶅5鎴�11浜�", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡锛岄璀﹁浆绉伙紝绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "涓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 5, +// threatenMoney: 0, +// threatenPopulation: "11", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// { +// activeStatus: "", +// areaCode: "", +// areaName: "", +// brookLength: 0, +// checkId: "", +// city: "鍖椾含甯�", +// codeProvince: "110116", +// county: "鎬�鏌�", +// dangerLevel: "", +// disasterStatus: "", +// drainageArea: "", +// elevation: 0, +// featureDes: "", +// groupMonitor: "鏉庢姊�,瀛欐鍜�,鑼冩弧鐢�,绉﹀缓鏉�,瀛欐姹�,瀛欐浼�", +// hasPlan: "", +// id: "110116030054", +// latitude: 40.56166667, +// length: 0, +// district: "鐞夌拑搴欓晣瀛欒儭娌熸潙涓婂彴瀛愭渤涓滃崡娌�", +// longitude: 116.5997222, +// monitor: "", +// monitorAdvice: "", +// name: "娌充笢鍗楁矡娉ョ煶娴侀殣鎮g偣", +// number: +// "13716108909,13716029391,13716291714,13716191943,13716427398,13124792612", +// preventionDes: "宸茬洃娴�", +// preventionLevel: "", +// preventionPlan: "瀹氭湡宸℃煡,绔嬭绀虹墝", +// preventionUnit: "涔¢晣", +// principal: "", +// province: "鍖椾含甯�", +// qp: "", +// reason: "", +// responsibleUnit: "", +// riskLevel: "", +// scale: "灏忓瀷", +// stableLevel: "", +// status: "", +// thickness: 0, +// threatenFamily: 0, +// threatenMoney: 0, +// threatenPopulation: "", +// threatenType: "", +// town: "鐞夌拑搴欓晣", +// trigger: "", +// type: "娉ョ煶娴�", +// village: "瀛欒儭娌熸潙", +// volume: "", +// volumePotential: "", +// width: 0, +// }, +// ]); + function handleClick(district) { - const entity = viewer.entities.getById(district.id); + const entity = viewer.entities.getById(district.unifiedCode); if (entity) { viewer.flyTo(entity, { offset: { @@ -713,18 +717,36 @@ // } } -function initDistrictPoint() { - districtList.value.forEach((item) => { - item.showBillboard = false; - item.className = "district"; +// 闅愭偅鐐瑰垪琛� +const originalData = simStore.DangerPoint; // 瀛樺偍鍘熷鏁版嵁锛堜粎鍔犺浇涓�娆★級 - createPoint(item); - }); -} +// 鏍规嵁鍖哄煙鍚嶇О杩囨护鏁版嵁 +const filterDataByArea = (areaName) => { + if (!areaName) { + districtList.value = []; + return; + } -onMounted(() => { - getData(); - // initDistrictPoint() + districtList.value = originalData.filter((item) => + item.position?.includes(areaName) + ); +}; + +// 澶勭悊鍖哄煙鍙樺寲浜嬩欢 +const handleChange = (item) => { + const areaName = item; + if (!areaName) { + ElMessage.warning("璇烽�夋嫨涓�涓尯鍩�"); + return; + } + + filterDataByArea(areaName); +}; + +// 缁勪欢鎸傝浇鏃跺姞杞藉師濮嬫暟鎹紝骞堕粯璁よ繃婊や负 "瀛欒儭娌�" +onMounted(async () => { + // await loadAllData(); + filterDataByArea("瀛欒儭娌�"); // 榛樿鏄剧ず瀛欒儭娌熺殑鏁版嵁 }); onBeforeUnmount(() => { // removeEntities() @@ -760,6 +782,9 @@ .district-item-text { color: white; line-height: 30px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } /deep/ .el-select__placeholder { color: white; diff --git a/src/constant/dict.js b/src/constant/dict.js index 1e7b1a8..4aa2674 100644 --- a/src/constant/dict.js +++ b/src/constant/dict.js @@ -1,11 +1,11 @@ export const deviceDictList = [ { - label: "娆$敓浠�", + label: "娆″0浠�", value: "1437295832", }, { label: "闆ㄩ噺璁�", - value: "1437295810", + value: "1874719366287368194", }, { label: "鎽勫儚澶�", diff --git a/src/store/simulation.js b/src/store/simulation.js index 75c6ac6..4139e71 100644 --- a/src/store/simulation.js +++ b/src/store/simulation.js @@ -4,7 +4,8 @@ import { createSimData } from '@/api/trApi' export const useSimStore = defineStore('simulation', () => { - // 鎵�鏈塙I鐘舵��... + // 闅愭偅鐐瑰垪琛� + const DangerPoint = ref([]) const navigationShow = ref(true) const leftShow = ref(false) const rightShow = ref(false) @@ -145,6 +146,7 @@ schemCard, backToHome, rainFalls, + DangerPoint, // 鏂规鐩稿叧鏂规硶 setSchemCard, diff --git a/src/views/Home.vue b/src/views/Home.vue index b50c1c7..0c755e4 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -8,10 +8,14 @@ <!-- <Left v-if="leftShow" /> <Right v-if="rightShow" /> --> - <Tools :style="rightRiverShow || showDangerAssess - ? { right: '400px' } - : { right: '12px' } - " class="tools" /> + <Tools + :style=" + rightRiverShow || showDangerAssess + ? { right: '400px' } + : { right: '12px' } + " + class="tools" + /> <!-- <Message v-if="messageShow" class="messageTool" /> --> <Announcement v-show="$route.fullPath != '/'" class="announcementTool" /> <!-- <Location v-if="locationShow" class="locationTool" /> --> @@ -51,13 +55,12 @@ import GisView from "./GisView.vue"; // import Device from "@/components/menu/Device.vue"; import Detail from "@/components/tools/Detail.vue"; -// 涓嶅彲浠ュ垹闄わ紝鍚﹀垯鍏ㄥ眬鏍峰紡浼氫涪鎺夛紝涓嶇煡閬撳師鍥� // import ResultAssess from "@/components/monifangzhen/ResultAssess.vue"; // import DangerAssess from "@/components/monifangzhen/DangerAssess.vue"; import { showDeviceDetail } from "@/store"; -import { setupTokenRefresh } from "@/api/hpApi.js" -import { getSimData ,fetchWaterSimulationData} from "@/api/trApi.js" -import { convertToWKT } from '@/utils/wktUtils'; +import { setupTokenRefresh, getDangerPoint } from "@/api/hpApi.js"; +import { getSimData, fetchWaterSimulationData } from "@/api/trApi.js"; +import { convertToWKT } from "@/utils/wktUtils"; const route = useRoute(); const simStore = useSimStore(); @@ -81,34 +84,36 @@ const { init, startYHGL, startZHJC, startMNFZ, startMNPG } = simStore; // 妯℃嫙鐨勭粡绾害鏁扮粍 const multiPolygonCoordinates = [ - [ - [120.123456, 30.654321], - [120.234567, 30.765432], - [120.345678, 30.876543], - [120.123456, 30.654321] // 闂悎鐐� - ], - [ - [121.111111, 31.222222], - [121.333333, 31.444444], - [121.555555, 31.666666], - [121.111111, 31.222222] // 闂悎鐐� - ] + [ + [120.123456, 30.654321], + [120.234567, 30.765432], + [120.345678, 30.876543], + [120.123456, 30.654321], // 闂悎鐐� + ], + [ + [121.111111, 31.222222], + [121.333333, 31.444444], + [121.555555, 31.666666], + [121.111111, 31.222222], // 闂悎鐐� + ], ]; - // 璁$畻灞炴�� const showDetail = computed(() => showDeviceDetail.value); + onMounted(async () => { - - setupTokenRefresh()// 鑾峰彇瀹忓浘token - getSimData() //娴嬭瘯tr鍚庣 + setupTokenRefresh(); // 鑾峰彇瀹忓浘token + getSimData(); //娴嬭瘯tr鍚庣 + // 鑾峰彇闅愭偅鐐瑰垪琛紙鍥犱负涓杞悗绔帴鍙h幏鍙栧姞杞芥椂闂磋緝闀匡級 + getDangerPoint().then((res) => { + simStore.DangerPoint = res.data.pageData; + }); try { const wktResult = convertToWKT(multiPolygonCoordinates); // console.log(wktResult,'a'); // 杈撳嚭: MULTIPOLYGON(((120.123456 30.654321,120.234567 30.765432,120.345678 30.876543,120.123456 30.654321))) } catch (error) { console.error(error.message); - } }); // 鍒濆鍖� diff --git a/src/views/left/KGSimOption/RealTimeSimulation.vue b/src/views/left/KGSimOption/RealTimeSimulation.vue index b998506..217790c 100644 --- a/src/views/left/KGSimOption/RealTimeSimulation.vue +++ b/src/views/left/KGSimOption/RealTimeSimulation.vue @@ -23,15 +23,16 @@ </el-form-item> <el-form-item label="闆ㄩ噺鏁版嵁:"> <el-select + @change="handleChange" v-model="formData.selectedRainfall" placeholder="璇烽�夋嫨" popper-class="mySelectStyle" > <el-option - v-for="item in rainfallData" + v-for="item in options" :key="item.id" :label="item.name" - :value="item.id" + :value="item.name" ></el-option> </el-select> </el-form-item> @@ -39,11 +40,11 @@ <div class="table-container"> <div class="table-row" - v-for="(item, index) in filteredTableData" + v-for="(item, index) in shgList" :key="index" > <input type="checkbox" v-model="item.selected" /> - <span>{{ item.name }}</span> + <span>{{ item.deviceName }}</span> </div> </div> </el-form-item> @@ -56,7 +57,7 @@ <div style="width: 100%; height: 60px; background-color: #fff;"></div> </div> --> <div class="buttons"> - <el-button type="primary" @click="openSaveDialog">淇濆瓨鏂规</el-button> + <el-button type="primary" @click="saveSim">淇濆瓨鏂规</el-button> <el-button type="success" @click="startPlay">寮�濮嬫ā鎷�</el-button> <el-button type="success" @click="futurePredictions">鏈潵棰勬祴</el-button> </div> @@ -64,11 +65,20 @@ </template> <script setup> -import { ref, watch, defineProps, computed, inject, reactive } from "vue"; +import { + ref, + watch, + defineProps, + computed, + inject, + reactive, + onMounted, +} from "vue"; import { ElMessage } from "element-plus"; import { initeWaterPrimitiveView } from "@/utils/water"; import { SimAPIStore } from "@/store/simAPI"; import { EventBus } from "@/eventBus"; // 寮曞叆浜嬩欢鎬荤嚎 +import { getDeviceInfo } from "@/api/hpApi"; // 鑾峰彇 Store 瀹炰緥 const simStore = SimAPIStore(); @@ -78,32 +88,8 @@ name: "鏂规鍚嶇О", selectedRainfall: "", type: 2, - gauges: [ - { - id: "xxxxxxxxxxxxxx", - name: "闆ㄩ噺璁�1", - x: 119.0, - y: 28.0, - r: 10000, - }, - { - id: "xxxxxxxxxxxxxx", - name: "闆ㄩ噺璁�2", - x: 119.0, - y: 28.0, - r: 10000, - }, - ], + gauges: [], }); - -// 宸ュ叿鍑芥暟锛氭繁鎷疯礉骞惰缃粯璁ら�変腑鐘舵�� -function deepCloneAndSetSelected(data) { - const newData = {}; - for (const key in data) { - newData[key] = data[key].map((item) => ({ ...item, selected: true })); - } - return newData; -} // 鎺ユ敹鐖剁粍浠朵紶閫掔殑 props const props = defineProps({ @@ -112,111 +98,107 @@ required: true, }, }); -const rainfallData = ref([]); + const tableData = ref({}); // 琛ㄦ牸鏁版嵁锛堟寜闆ㄩ噺鏁版嵁鍒嗙粍锛� const isCollapsed = ref(false); // 鎺у埗灞曞紑/鏀惰捣鐘舵�� -// 妯℃嫙涓嶅悓鍖哄煙鐨勬暟鎹� -const areaDataMap = { - 瀛欒儭娌�: { - rainfallData: [ - { id: "1", name: "姘旇薄瀹炴椂鏁版嵁 - 瀛欒儭娌�" }, - { id: "2", name: "闆ㄩ噺璁″疄鏃舵暟鎹� - 瀛欒儭娌�" }, - ], - tableData: { - 1: [ - { id: "001", name: "瀛欒儭娌熸皵璞$珯001" }, - { id: "002", name: "瀛欒儭娌熸皵璞$珯002" }, - ], - 2: [ - { id: "003", name: "瀛欒儭娌熼洦閲忚003" }, - { id: "004", name: "瀛欒儭娌熼洦閲忚004" }, - ], - }, - }, - 楸兼按娲炲悗娌�: { - rainfallData: [ - { id: "1", name: "姘旇薄瀹炴椂鏁版嵁 - 楸兼按娲炲悗娌�" }, - { id: "2", name: "闆ㄩ噺璁″疄鏃舵暟鎹� - 楸兼按娲炲悗娌�" }, - ], - tableData: { - 1: [ - { id: "005", name: "楸兼按娲炲悗娌熸皵璞$珯005" }, - { id: "006", name: "楸兼按娲炲悗娌熸皵璞$珯006" }, - ], - 2: [ - { id: "007", name: "楸兼按娲炲悗娌熼洦閲忚007" }, - { id: "008", name: "楸兼按娲炲悗娌熼洦閲忚008" }, - ], - }, - }, - 浜庡瑗挎矡: { - rainfallData: [ - { id: "1", name: "姘旇薄瀹炴椂鏁版嵁 - 浜庡瑗挎矡" }, - { id: "2", name: "闆ㄩ噺璁″疄鏃舵暟鎹� - 浜庡瑗挎矡" }, - ], - tableData: { - 1: [ - { id: "009", name: "浜庡瑗挎矡姘旇薄绔�009" }, - { id: "010", name: "浜庡瑗挎矡姘旇薄绔�010" }, - ], - 2: [ - { id: "011", name: "浜庡瑗挎矡闆ㄩ噺璁�011" }, - { id: "012", name: "浜庡瑗挎矡闆ㄩ噺璁�012" }, - ], - }, - }, +// 闆ㄩ噺璁′笅鎷夋 +const options = ref([ + { id: "1", name: "姘旇薄瀹炴椂鏁版嵁" }, + { id: "2", name: "闆ㄩ噺璁″疄鏃舵暟鎹�" }, +]); + +// 闆ㄩ噺璁″垪琛� +const shgList = ref([]); +// 鎵�鏈夌殑闆ㄩ噺璁″垪琛� +const rainListNoFilter = ref([]); + +// 鑾峰彇鎵�鏈夐洦閲忚鏁版嵁锛堟潵鑷帴鍙o級 +const getRainListAll = () => { + // 闆ㄩ噺璁$被鍨媔d + const ids = "1874719366287368194"; + getDeviceInfo(ids).then((res) => { + rainListNoFilter.value = res.data.pageData; + // 鏍规嵁褰撳墠閫夋嫨鐨勫尯鍩熻嚜鍔ㄨ繃婊� + updateShgListByArea(); + }); }; -// 鏍规嵁 selectedArea 鏇存柊鏁版嵁 +// 鏍规嵁 props.selectedArea.label 杩囨护闆ㄩ噺璁″垪琛紝骞惰缃� selected: true +const updateShgListByArea = () => { + const currentArea = props.selectedArea?.label; + + if (!currentArea) { + shgList.value = []; + return; + } + + shgList.value = rainListNoFilter.value + .filter((item) => item.deviceName?.includes(currentArea)) + .map((device) => ({ + ...device, + selected: true, // 榛樿閫変腑 + })); +}; + +// 涓嬫媺妗嗛�変腑鍊肩殑琛ㄦ牸鏁版嵁鍙樺寲 +const handleChange = async (item) => { + formData.selectedRainfall = item; + + if (item === "闆ㄩ噺璁″疄鏃舵暟鎹�") { + if (!props.selectedArea) { + ElMessage.warning("璇峰厛閫夋嫨鍖哄煙"); + shgList.value = []; + return; + } + // 濡傛灉杩樻病鏈夊姞杞借繃鏁版嵁锛屽垯鍏堣姹傛帴鍙e姞杞� + if (rainListNoFilter.value.length === 0) { + getRainListAll(); // 鍔犺浇鍏ㄩ儴鏁版嵁鍚庝細鑷姩杩囨护 + } else { + updateShgListByArea(); // 宸叉湁鏁版嵁灏辩洿鎺ヨ繃婊� + } + } else { + shgList.value = []; + } +}; + +// 鐩戝惉鍖哄煙鍙樺寲锛岄噸鏂拌繃婊ゆ暟鎹� watch( () => props.selectedArea, (newArea) => { - console.log(newArea.label, "new"); - if (areaDataMap[newArea.label]) { - rainfallData.value = areaDataMap[newArea.label].rainfallData; - // 浣跨敤娣辨嫹璐濊缃粯璁ら�変腑鐘舵�� - tableData.value = deepCloneAndSetSelected( - areaDataMap[newArea.label].tableData - ); - formData.selectedRainfall = ""; // 娓呯┖閫変腑鐨勯洦閲忔暟鎹� - } else { - rainfallData.value = []; - tableData.value = {}; - formData.selectedRainfall = ""; + if (!newArea) { + ElMessage.warning("璇烽�夋嫨涓�涓尯鍩�"); + shgList.value = []; + } else if (formData.selectedRainfall === "闆ㄩ噺璁″疄鏃舵暟鎹�") { + handleChange(formData.selectedRainfall); } - } - // { immediate: true } // 绔嬪嵆鎵ц涓�娆★紝纭繚鍒濆鏁版嵁姝g‘ + }, + { immediate: true } ); -// 鍔ㄦ�佽绠楄〃鏍兼暟鎹� -const filteredTableData = computed(() => { - return formData.selectedRainfall && tableData.value[formData.selectedRainfall] - ? tableData.value[formData.selectedRainfall] - : []; -}); - -// 鑾峰彇褰撳墠閫変腑鐨勯洦閲忔暟鎹悕绉� -const selectedRainfallName = computed(() => { - const selected = rainfallData.value.find( - (item) => item.id === formData.selectedRainfall - ); - return selected ? selected.name : ""; -}); - -// 鑾峰彇褰撳墠閫変腑鐨勮澶囦俊鎭� -const selectedDevices = computed(() => { - return filteredTableData.value.filter((item) => item.selected); -}); - +// 閲嶇疆琛ㄥ崟 const resetForm = () => { formData.name = ""; formData.selectedRainfall = ""; + shgList.value = []; }; -// 鎵撳紑淇濆瓨鏂规瀵硅瘽妗� -const openSaveDialog = async () => { +const updateSelectedGauges = () => { + formData.gauges = shgList.value + .filter((item) => item.selected) + .map((item) => ({ + id: item.deviceCode, + deviceName: item.deviceName, + x: item.longitude, + y: item.latitude, + r: 10000, + })); +}; + +// 淇濆瓨鏂规 +const saveSim = async () => { try { + updateSelectedGauges(); formData.geom = props.selectedArea; await simStore.addSimCheme(formData); resetForm(); @@ -309,7 +291,7 @@ .table-container { font-size: 12px; height: 120px; - width: 90%; + width: 96%; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; -- Gitblit v1.9.3