Merge branch 'master' of http://103.135.160.14:9034/r/NslWeb
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "type": "FeatureCollection", |
| | | "features": [ |
| | | { |
| | | "type": "Feature", |
| | | "geometry": { |
| | | "type": "LineString", |
| | | "coordinates": [ |
| | | [116.59760983462722, 40.55718061951575, 598.7727601629845], |
| | | [116.59760983462722, 40.55718061951575, 598.7727601629845], |
| | | [116.59644965700153, 40.559317401763465, 569.8277901304249], |
| | | [116.59740375239096, 40.560148143453276, 565.7157141156055], |
| | | [116.59870671532008, 40.56066772033189, 559.9818134466861], |
| | | [116.5989382913525, 40.561279499654816, 560.6004363337727], |
| | | [116.59861851530843, 40.56191986528282, 556.7244657770593], |
| | | [116.59863937279577, 40.562540361696044, 549.989046117256], |
| | | [116.59798186828961, 40.563844128117175, 542.9938582259548], |
| | | [116.59754420154454, 40.564258234641095, 540.1763729232823], |
| | | [116.5971651744301, 40.56431251805267, 542.1265936059641], |
| | | [116.59531329047178, 40.56704193949793, 523.9216605197581], |
| | | [116.59466519689155, 40.56774819682324, 520.854586137509], |
| | | [116.59371048844169, 40.568490515866735, 515.9891637325094], |
| | | [116.59357695557298, 40.56837940750097, 515.9897252144557], |
| | | [116.5936486797175, 40.56834910348064, 515.9898053186113] |
| | | ] |
| | | }, |
| | | "properties": {} |
| | | }, |
| | | { |
| | | "type": "Feature", |
| | | "geometry": { |
| | | "type": "LineString", |
| | | "coordinates": [ |
| | | [116.58968486232361, 40.57741443362995, 470.43196808102977], |
| | | [116.58979068033705, 40.5769004556742, 477.24145981798205], |
| | | [116.59043681293315, 40.576324193581456, 477.780635468482], |
| | | [116.59156016224689, 40.57434225036743, 486.1814940411667], |
| | | [116.59134241985157, 40.57310686967558, 485.9949599924823], |
| | | [116.5904829230302, 40.5725751143292, 488.97277966815074], |
| | | [116.59164316145382, 40.5706964031903, 497.0488991194549], |
| | | [116.59227985803987, 40.569716082751754, 504.36840726535365], |
| | | [116.59374203955004, 40.5684339509514, 515.9963172883579], |
| | | [116.59361619860711, 40.56835405566704, 515.9929502933207], |
| | | [116.59361619860711, 40.56835405566704, 515.9929502933207] |
| | | ] |
| | | }, |
| | | "properties": {} |
| | | } |
| | | ] |
| | | } |
| | |
| | | const startMNFZ = () => { |
| | | init() |
| | | leftShow.value = true |
| | | rightRiverShow.value = true |
| | | // rightRiverShow.value = true |
| | | } |
| | | |
| | | const startMNPG = () => { |
| | |
| | | <template> |
| | | <Left @start="startSimulate" @end="endSimulate" /> |
| | | <echartInfo :isDynamicMode="isDynamicMode" :isFinish="isFinish" v-if="loadingSim" /> |
| | | <TimeLine v-if="showWaterSimulate" @time-update="timeUpdate" @is-playing="isPlaying" |
| | | :waterSimulateParams="waterSimulateParams" @playbackFinished="playbackFinished" @end="endSimulate" /> |
| | | <DebuffDetail v-if="showDebuffDetail" @open="openDetail" @close="showDebuffDetail = false" /> |
| | | <echartInfo |
| | | :isDynamicMode="isDynamicMode" |
| | | :isFinish="isFinish" |
| | | v-if="rightRiverShow" |
| | | /> |
| | | <TimeLine |
| | | v-if="showWaterSimulate" |
| | | @time-update="timeUpdate" |
| | | @is-playing="isPlaying" |
| | | :waterSimulateParams="waterSimulateParams" |
| | | @playbackFinished="playbackFinished" |
| | | @end="endSimulate" |
| | | /> |
| | | <DebuffDetail |
| | | v-if="showDebuffDetail" |
| | | @open="openDetail" |
| | | @close="showDebuffDetail = false" |
| | | /> |
| | | <DebuffTable v-if="showDebuffTable" @close="closeDebuffTable" /> |
| | | </template> |
| | | |
| | |
| | | import { createPoint, geomToGeoJSON } from "@/utils/map.js"; |
| | | import { loadAreaPolygon, clearAreaPolygon } from "@/utils/area"; |
| | | |
| | | import colors from "@/assets/img/left/colors3.png"; |
| | | import danger from "@/assets/img/left/danger.png"; |
| | | import { checkedKeys } from "@/store/index"; |
| | | |
| | | |
| | | import { useSimStore } from "@/store/simulation"; |
| | | import { storeToRefs } from "pinia"; |
| | | const simStore = useSimStore(); |
| | | const { rightRiverShow } = storeToRefs(simStore); |
| | | |
| | | |
| | | const waterSimulateParams = ref({}); |
| | | const showWaterSimulate = ref(false); |
| | | const showDebuffDetail = ref(false); |
| | | const showDebuffTable = ref(false); |
| | | const isDynamicMode = ref(false); |
| | | const isFinish = ref(true); |
| | | const loadingSim = ref(false); |
| | | |
| | | const treeMap = new Map(); |
| | | |
| | | |
| | | |
| | | |
| | | // æä¾æ¹æ³ç»ææåç»ä»¶ |
| | | provide("simulateActions", { |
| | |
| | | function startSimulate(form) { |
| | | // console.log("form", form); |
| | | showWaterSimulate.value = true; |
| | | loadingSim.value = true |
| | | rightRiverShow.value = true; |
| | | waterSimulateParams.value = form; |
| | | } |
| | | function endSimulate() { |
| | | loadingSim.value = false |
| | | showDebuffDetail.value = false |
| | | rightRiverShow.value = false; |
| | | showDebuffDetail.value = false; |
| | | clearTrailLine(); |
| | | removeEmergencyPoints() |
| | | removeEmergencyPoints(); |
| | | removeDataSources(); |
| | | setTimeout(() => { |
| | | showWaterSimulate.value = false; |
| | |
| | | scale: 1.0, |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1500), |
| | | distanceDisplayCondition: new Cesium.DistanceDisplayCondition( |
| | | 0, |
| | | 1500 |
| | | ), |
| | | }, |
| | | }); |
| | | dataSource.entities.add(billboardEntity); |
| | |
| | | }); |
| | | await Promise.all(loadPromises); |
| | | setupRowClickListener(dataSources); |
| | | } catch (error) { |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | // æ¸
é¤éæ£ç¹ |
| | | function removeDataSources() { |
| | |
| | | ]; |
| | | // è¿éæ¯æ·»å é¿é©ç¹å¯ææ¬é«äº®æ¾ç¤º |
| | | list.forEach((item) => { |
| | | let point = earthCtrl.factory.createRichTextPoint("é¿é©ç¹", [item.longitude, item.latitude, item.altitude - 10], { |
| | | distanceDisplayCondition: new SmartEarth.Cesium.DistanceDisplayCondition(0, 2000), |
| | | fontColor: "#ffffff", |
| | | fontSize: 20 |
| | | }, "0"); |
| | | let point = earthCtrl.factory.createRichTextPoint( |
| | | "é¿é©ç¹", |
| | | [item.longitude, item.latitude, item.altitude - 10], |
| | | { |
| | | distanceDisplayCondition: |
| | | new SmartEarth.Cesium.DistanceDisplayCondition(0, 2000), |
| | | fontColor: "#ffffff", |
| | | fontSize: 20, |
| | | }, |
| | | "0" |
| | | ); |
| | | console.log("point", point); |
| | | emergencyAreaList.push(point); |
| | | }); |
| | |
| | | const emergencyAreaList = treeMap.get("é¿é©ç¹"); // è·ååå¨çé¿é©ç¹å®ä½å表 |
| | | if (emergencyAreaList && emergencyAreaList.length > 0) { |
| | | emergencyAreaList.forEach((entity) => { |
| | | if (entity && typeof entity.deleteObject === 'function') { |
| | | if (entity && typeof entity.deleteObject === "function") { |
| | | // 妿æ deleteObject æ¹æ³ï¼ä¼å
è°ç¨ |
| | | entity.deleteObject(); |
| | | } else if (entity && typeof entity.clear === 'function') { |
| | | } else if (entity && typeof entity.clear === "function") { |
| | | // 妿æ clear æ¹æ³ï¼è°ç¨ clear |
| | | entity.clear(); |
| | | } else if (entity && earthCtrl && earthCtrl.coreMap) { |
| | |
| | | } |
| | | } |
| | | |
| | | let TrailLine = []; |
| | | async function showLine() { |
| | | const position = [ |
| | | { |
| | | x: -2172540.8322597803, |
| | | y: 4339064.62665997, |
| | | z: 4126183.3895281963, |
| | | }, |
| | | { |
| | | x: -2172480.18394144, |
| | | y: 4339033.15167176, |
| | | z: 4126240.9529584926, |
| | | }, |
| | | { |
| | | x: -2172454.114348403, |
| | | y: 4339020.0398392705, |
| | | z: 4126261.946960697, |
| | | }, |
| | | { |
| | | x: -2172377.9670952093, |
| | | y: 4338976.609385458, |
| | | z: 4126333.862357211, |
| | | }, |
| | | { |
| | | x: -2172299.4142002705, |
| | | y: 4338951.971578909, |
| | | z: 4126397.5205803993, |
| | | }, |
| | | { |
| | | x: -2172245.1703274297, |
| | | y: 4338940.86037857, |
| | | z: 4126436.276389208, |
| | | }, |
| | | { |
| | | x: -2172176.7332184147, |
| | | y: 4338930.525741544, |
| | | z: 4126477.629952572, |
| | | }, |
| | | { |
| | | x: -2172173.8151051304, |
| | | y: 4338939.043883864, |
| | | z: 4126469.336927342, |
| | | }, |
| | | { |
| | | x: -2172173.7151194704, |
| | | y: 4338939.023235937, |
| | | z: 4126469.4107743693, |
| | | }, |
| | | ]; |
| | | let LineInterpolation = earthCtrl.core.LineInterpolation(earthCtrl.coreMap, { |
| | | positions: position, |
| | | num: 50, |
| | | getHeight: true, |
| | | // é¿é©è·¯çº¿ |
| | | let pathLayer = null; // åå¨å建çå¾å± |
| | | function showLine() { |
| | | // å建æ°å¾å± |
| | | pathLayer = earthCtrl.factory.createPathLayer({ |
| | | url: "/json/line.json", |
| | | color: "#0033FF", |
| | | width: 15.0, |
| | | pointColor: "#FFFFFF", |
| | | speed: 2, |
| | | far: 50000, |
| | | }); |
| | | // console.log(LineInterpolation.height, "A"); |
| | | |
| | | let min = LineInterpolation.height; |
| | | let max = min.map((item) => { |
| | | return item + 35; |
| | | }); |
| | | |
| | | console.log(min, max); |
| | | |
| | | let _TrailLine = earthCtrl.factory.createTrailLineWall( |
| | | LineInterpolation.positions, |
| | | { |
| | | maximumHeights: max, |
| | | minimumHeights: min, |
| | | color: "#ffffff", //线é¢è²ï¼å¯éï¼ |
| | | url: colors, |
| | | } |
| | | ); |
| | | TrailLine.push(_TrailLine); |
| | | } |
| | | // æ¸
é¤è½¨è¿¹çº¿å¯¹è±¡ |
| | | |
| | | // æ¸
é¤é¿é©è·¯çº¿ |
| | | function clearTrailLine() { |
| | | TrailLine.forEach((item, index) => { |
| | | if (item && typeof item.deleteObject === 'function') { |
| | | item.deleteObject(); |
| | | } else if (item && typeof item.clear === 'function') { |
| | | item.clear(); |
| | | } else if (item && earthCtrl && earthCtrl.coreMap) { |
| | | earthCtrl.coreMap.entities.remove(item); |
| | | } |
| | | }); |
| | | TrailLine = []; |
| | | if (pathLayer) { |
| | | pathLayer.clear(); |
| | | } |
| | | // if (item && typeof item.deleteObject === "function") { |
| | | // item.deleteObject(); |
| | | // } else if (item && typeof item.clear === "function") { |
| | | // item.clear(); |
| | | // } else if (item && earthCtrl && earthCtrl.coreMap) { |
| | | // earthCtrl.coreMap.entities.remove(item); |
| | | // } |
| | | // }); |
| | | // pathLayer = []; |
| | | } |
| | | function timeUpdate(percentage) { |
| | | if (percentage > 99) { |
| | |
| | | // 忢é¢è²ï¼ä¾å¦çº¢è²ååå§é¢è²äº¤æ¿ï¼ |
| | | const currentTime = Date.now(); |
| | | const flashColor = Cesium.Color.RED.withAlpha(1); // éªå¨é¢è² |
| | | return Math.floor(currentTime / 500) % 2 === 0 ? flashColor : originalColor; |
| | | return Math.floor(currentTime / 500) % 2 === 0 |
| | | ? flashColor |
| | | : originalColor; |
| | | }, false) |
| | | ); |
| | | // å°éªå¨ç¶æä¿åå°å®ä½ä¸ï¼ä¾¿äºåç»æ§å¶ |
| | |
| | | function stopFlashing(polygonEntity) { |
| | | // æ¢å¤åå§é¢è² |
| | | const originalColor = polygonEntity._originalColor || Cesium.Color.WHITE; // å¦ææ²¡æåå§é¢è²ï¼é»è®¤ä½¿ç¨ç½è² |
| | | polygonEntity.polygon.material = new Cesium.ColorMaterialProperty(originalColor); |
| | | polygonEntity.polygon.material = new Cesium.ColorMaterialProperty( |
| | | originalColor |
| | | ); |
| | | // æ¸
空éªå¨ç¶æ |
| | | polygonEntity._isFlashing = false; |
| | | polygonEntity._originalColor = null; // æ¸
é¤ä¿åçåå§é¢è² |
| | | } |
| | | onMounted(() => { |
| | | setupRowClickListener() |
| | | setupRowClickListener(); |
| | | getMaxInfluenceAreaData(); |
| | | }); |
| | | onUnmounted(() => { |
| | | endSimulate(); |
| | | }); |
| | | // // 转æ¢åæ ç³»ï¼ç¬å¡å°åæ 转为WGS48 |
| | | // const positions = [[-2171569.1995107993, 4338474.198855222, 4127198.938949332]]; |
| | | // const wgs84Positions = positions.map((xyz) => { |
| | | // const cartesian = Cesium.Cartesian3.fromArray(xyz); |
| | | // const cartographic = Cesium.Cartographic.fromCartesian(cartesian); |
| | | |
| | | // // 弧度转è§åº¦ |
| | | // const lon = Cesium.Math.toDegrees(cartographic.longitude); |
| | | // const lat = Cesium.Math.toDegrees(cartographic.latitude); |
| | | // const height = cartographic.height; // åä½ï¼ç±³ |
| | | |
| | | // return [lon, lat, height]; |
| | | // }); |
| | | </script> |
| | | <style lang="less" scoped> |
| | | @import url("../assets/css/home.css"); |