windMap2D.vue 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818
  1. <template>
  2. <div id="loading" class="dataLoading" v-if="loading">
  3. <span class="loadText">数据加载中...</span>
  4. </div>
  5. <div class="mapBox">
  6. <div id="cesiumContainer" style="width: 100%; height: 100vh"></div>
  7. <div :class="!menuComTStyB ? 'menuComTSty' : 'menuComT'" v-if="0">
  8. <menuCom
  9. :showbasemap="false"
  10. :showwindspeed="false"
  11. :showcloud="false"
  12. :showrainfall="false"
  13. :showtemperature="false"
  14. :showcity="false"
  15. :showwind="false"
  16. :showexit="true"
  17. :showwindModel="true"
  18. @handleWindModel="showwindmodel"
  19. @handleInit="handleInitView"
  20. @handleExit="switchLayer"
  21. />
  22. </div>
  23. <el-drawer
  24. v-model="windDrawer"
  25. direction="rtl"
  26. class="windModelDrawer"
  27. :before-close="handleClose"
  28. >
  29. <template #header>
  30. <h3 style="font-weight: bold">{{ windDrawerHeader }}</h3>
  31. </template>
  32. <template #default>
  33. <div class="windDrawerCla">
  34. <div class="line" v-if="!showModelMsg">
  35. <div class="leftContent">
  36. <span>{{ windDrawerTitle }}</span>
  37. </div>
  38. </div>
  39. <div class="jcxx" v-if="showBasicMsg">
  40. <windHome :modelValItem="modelVal" />
  41. </div>
  42. <div class="spjk" v-if="showVideoMsg">
  43. <!-- <iframe
  44. src="/public/static/windVideo.mp4"
  45. frameborder="0"
  46. style="width: 100%; height: 100%"
  47. ></iframe> -->
  48. <video ref="videoPlayer" controls width="95%" muted autoplay>
  49. <source src="/static/windVideo.mp4" type="video/mp4" />
  50. </video>
  51. </div>
  52. <div class="gzck" v-if="showProblemMsg">
  53. <windPro />
  54. </div>
  55. <div class="third" v-if="showModelMsg">
  56. <ModelUnpack
  57. :modelUnpackType="modelUnpackType"
  58. :showModelMsg="showModelMsg"
  59. />
  60. </div>
  61. </div>
  62. </template>
  63. </el-drawer>
  64. <comModelDialog
  65. :showcomModelDia="showcomModelDia"
  66. :modelVal="modelVal"
  67. @showDia="showComDia"
  68. />
  69. <!-- @backStations="backStations" -->
  70. <!-- <windView
  71. v-if="showWindDetail"
  72. @coverOnChange="coverOnChange"
  73. :currentHeight="currentHeight"
  74. :fjLonLatJsonArr="fjLonLatJsonArr.data"
  75. @showDetail="menuComTSty"
  76. @resetChangeWind="resetChangeWind"
  77. @initView="resetWindViewport"
  78. /> -->
  79. <windView2
  80. v-if="showWindDetail"
  81. :cesiumViewer="viewer"
  82. @coverOnChange="coverOnChange"
  83. :currentHeight="currentHeight"
  84. :fjLonLatJsonArr="fjLonLatJsonArr.data"
  85. @showDetail="menuComTSty"
  86. @resetChangeWind="resetChangeWind"
  87. />
  88. </div>
  89. </template>
  90. <script>
  91. import * as Cesium from "../../Cesium";
  92. import "../../Cesium/Widgets/widgets.css";
  93. import fjMYLonLatJson from "../fjLonLatJson/fj_MY.json"; //迈越风电场
  94. import fjWHZLonLatJson from "../fjLonLatJson/fj_WHZ.json"; //京能旺海庄
  95. import fjYPLLonLatJson from "../fjLonLatJson/fj_YPL.json"; //京能营盘梁
  96. import fjSMSLonLatJson from "../fjLonLatJson/fj_SMS.json"; //京能苏木山
  97. import wsRes from "../fjLonLatJson/wsRes.json"; // 模拟 ws 返回数据
  98. import allStationJson from "./allStationJson.json";
  99. import basicGeoJson from "../../assets/geoJson/basic.json";
  100. import comModelDialog from "@/components/comModelDialog.vue";
  101. import windView from "./windView.vue";
  102. import menuCom from "../menuCom.vue";
  103. import windView2 from "./windView2.vue";
  104. import cloudJson from "/public/static/exportData/cloud/layer.json";
  105. import rainJson from "/public/static/exportData/rain/layer.json";
  106. import tempJson from "/public/static/exportData/tmp/layer.json";
  107. // import bw from "@/assets/windimgs/fanSvg/bw.svg"
  108. //风场展示图标
  109. import fc from "@/assets/windimgs/fanSvg/fc.png";
  110. //火电展示图标
  111. import hd from "@/assets/windimgs/fanSvg/hd.png";
  112. //光伏电站展示图标
  113. import gf from "@/assets/windimgs/fanSvg/gf.png";
  114. //故障
  115. import gz from "@/assets/windimgs/fanSvg/gz.svg";
  116. //待机
  117. import dj from "@/assets/windimgs/fanSvg/dj.svg";
  118. //检修
  119. import jx from "@/assets/windimgs/fanSvg/jx.svg";
  120. //限电
  121. import xd from "@/assets/windimgs/fanSvg/xd.svg";
  122. //离线
  123. import lx from "@/assets/windimgs/fanSvg/lx.svg";
  124. //受累
  125. import sl from "@/assets/windimgs/fanSvg/sl.svg";
  126. //动图使用柱子和扇叶
  127. import bwzhu from "@/assets/windimgs/fanSvg/bwzhu.svg";
  128. import bwshan from "@/assets/windimgs/fanSvg/bwshan.png";
  129. import benchmark from "@/assets/cesiumImg/benchmark.png";
  130. import windHome from "@/components/windHome/index.vue";
  131. import windPro from "@/components/windProDetail/windProblem.vue";
  132. import ModelUnpack from "@/components/modelUnpack.vue";
  133. import { WindLayer } from "cesium-wind";
  134. import windGridData from "./windGridData.json";
  135. // import AdvancedBillboardGenerator from "@/tools/lightsign.js";
  136. // import { useWebSocket } from "@/tools/websocket.js";
  137. import webSocketService from "@/tools/ws.js";
  138. export default {
  139. name: "windMap2D",
  140. components: {
  141. comModelDialog,
  142. windView,
  143. menuCom,
  144. windHome,
  145. windPro,
  146. ModelUnpack,
  147. windView2
  148. },
  149. data() {
  150. return {
  151. loading: true,
  152. benchmark,
  153. showAllWindFromStation: [],
  154. restLatLon: [
  155. {
  156. longitude: 114.48789,
  157. latitude: 35.32916,
  158. name: "MYFDC",
  159. },
  160. {
  161. longitude: 112.88355172,
  162. latitude: 40.46617836,
  163. name: "JNWHZ",
  164. },
  165. {
  166. longitude: 112.5270545,
  167. latitude: 40.35920334,
  168. name: "JNYPL",
  169. },
  170. {
  171. longitude: 112.69922452,
  172. latitude: 40.31857399,
  173. name: "JNSMS",
  174. },
  175. ],
  176. fjLonLatJsonArr: [],
  177. viewer: null,
  178. windLayer: null, // 风场图
  179. windLayerTimmer: null, // 风场图计时器
  180. cloudImagesLayer: [], // 卫星云图
  181. cloudLayer: null, // 卫星云图
  182. cloudintervalId: null,
  183. rainImagesLayer: [], // 降雨图
  184. rainLayer: null, // 降雨图
  185. rainintervalId: null, // 降雨图
  186. tempImagesLayer: [], //温度图
  187. temperatureLayer: null, //温度图
  188. tempintervalId: null, //温度图
  189. showcomModelDia: false,
  190. currentHeight: 0,
  191. modelVal: null,
  192. menuComTStyB: false,
  193. modelUnpackType: "fengji",
  194. windDrawer: false,
  195. windDrawerTitle: "",
  196. windDrawerHeader: "",
  197. showBasicMsg: false,
  198. showVideoMsg: false,
  199. showProblemMsg: false,
  200. showModelMsg: false,
  201. showWindDetail: true,
  202. allStationentitys: [],
  203. allWindEntitys: [],
  204. urlTiles: "/public/static/tiles/{z}/{x}/{y}.jpg",
  205. zbLabelList: [],
  206. isFakeData: false,
  207. fakeDataTimmer: null,
  208. };
  209. },
  210. mounted() {
  211. this.initCesium();
  212. setTimeout(() => {
  213. this.loading = false;
  214. }, 1000);
  215. },
  216. unmounted() {
  217. clearInterval(this.fakeDataTimmer);
  218. this.fakeDataTimmer = null;
  219. },
  220. methods: {
  221. async initCesium() {
  222. const box = document.getElementById("cesiumContainer");
  223. const viewer = new Cesium.Viewer(box, {
  224. geocoder: false, // 地址搜索控件
  225. homeButton: false, // 返回地图初始位置控件
  226. infoBox: false, // 地图默认的信息控件
  227. sceneModePicker: false, // 场景模式切换控件
  228. baseLayerPicker: false, // 底图切换控件
  229. navigationHelpButton: false, // 帮助控件
  230. animation: false, // 动画控制控件
  231. timeline: false, // 时间线控件
  232. fullscreenButton: false, // 全屏按钮控件
  233. // imageryProvider: true, // 是否显示 Cesium 默认地图的底图
  234. vrButton: false,
  235. selectionIndicator: false,
  236. shouldAnimate: true,
  237. });
  238. const imageryProvider = new Cesium.UrlTemplateImageryProvider({
  239. // minimumLevel: 11,
  240. maximumLevel: 18,
  241. // url: this.urlTiles,
  242. url:
  243. import.meta.env.VITE_APP_ENV_NAME === "dev"
  244. ? "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"
  245. : "/static/ditu/{z}/{x}/{y}.png",
  246. credit: "影像地图",
  247. });
  248. imageryProvider.alpha = 0.55; // 透明度
  249. imageryProvider.brightness = 1; // 亮度
  250. imageryProvider.contrast = 1; // 对比度
  251. viewer.imageryLayers.addImageryProvider(imageryProvider);
  252. viewer._cesiumWidget._creditContainer.style.display = "none";
  253. // this.csceneElliposid(viewer)
  254. this.viewer = viewer;
  255. // 展示场站
  256. // this.showAllStation(viewer)
  257. // 展示风机
  258. this.showWindFromStation(viewer);
  259. this.initGeoJsonData();
  260. },
  261. // 初始化 geoJson 数据
  262. async initGeoJsonData() {
  263. // 创建GeoJSON数据源
  264. await new Cesium.GeoJsonDataSource.load(basicGeoJson, {
  265. stroke: Cesium.Color.GRAY, // 边界线颜色
  266. fill: Cesium.Color.BLACK.withAlpha(0), // 填充颜色
  267. strokeWidth: 1, // 边界线宽度
  268. markerSymbol: "?", // 点要素的符号
  269. clampToGround: true, // 贴地
  270. }).then((dataSource) => {
  271. // 添加到视图
  272. this.viewer.dataSources.add(dataSource);
  273. var entities = dataSource.entities.values;
  274. for (let i = 0; i < entities.length; i++) {
  275. let entity = entities[i];
  276. entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions;
  277. //单独设置线条样式
  278. var positions = entity.polygon.hierarchy._value.positions;
  279. entity.polyline = {
  280. positions: positions,
  281. width: 1,
  282. outline: false,
  283. };
  284. }
  285. // 添加中文标签图层
  286. const labelLayer = new Cesium.LabelCollection();
  287. this.viewer.scene.primitives.add(labelLayer);
  288. const cities = [];
  289. basicGeoJson?.features?.forEach((ele) => {
  290. if (Array.isArray(ele.properties.centroid)) {
  291. const name = ele.properties.name;
  292. const lon = ele.properties.centroid[0];
  293. const lat = ele.properties.centroid[1];
  294. cities.push({ name, lon, lat });
  295. }
  296. });
  297. cities.forEach((city, index) => {
  298. labelLayer.add({
  299. id: index,
  300. name: "cityLabel",
  301. position: Cesium.Cartesian3.fromDegrees(city.lon, city.lat, 10),
  302. text: city.name,
  303. font: 'bold 14px "Microsoft YaHei", sans-serif',
  304. fillColor: Cesium.Color.fromCssColorString("#000"),
  305. outlineColor: Cesium.Color.WHITE,
  306. outlineWidth: 2,
  307. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  308. pixelOffset: new Cesium.Cartesian2(0, 0), // 设置为0
  309. horizontalOrigin: Cesium.HorizontalOrigin.CENTER, // 水平居中
  310. verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直居中
  311. });
  312. });
  313. });
  314. },
  315. backStations() {
  316. this.showWindDetail = false;
  317. this.allWindEntitys.forEach(({ entity, handler }) => {
  318. this.viewer.entities.remove(entity); // 移除实体
  319. if (!handler.isDestroyed()) {
  320. handler.destroy(); // 销毁事件处理器(关键!)
  321. }
  322. });
  323. this.allWindEntitys = [];
  324. if (this.viewer && this.viewer.destroy) {
  325. this.viewer.destroy();
  326. this.viewer = null;
  327. }
  328. // this.initCesium();
  329. // this.showAllStation(this.viewer)
  330. },
  331. resetChangeWind(data) {
  332. let that = this;
  333. that.viewer.camera.flyTo({
  334. destination: Cesium.Cartesian3.fromDegrees(
  335. data.longitude,
  336. data.latitude,
  337. 1000
  338. ),
  339. orientation: {
  340. heading: Cesium.Math.toRadians(0),
  341. pitch: Cesium.Math.toRadians(-90),
  342. roll: 0.0,
  343. },
  344. duration: 3.0,
  345. });
  346. },
  347. // 展示所有风场
  348. showAllStation(viewer) {
  349. allStationJson.station.forEach((e, index) => {
  350. if (e.energytype === "Wind") {
  351. this.showStationFn(viewer, e, index, fc);
  352. } else if (e.energytype === "Fire") {
  353. this.showStationFn(viewer, e, index, hd);
  354. } else {
  355. this.showStationFn(viewer, e, index, gf);
  356. }
  357. });
  358. this.resetAllStationViewport();
  359. },
  360. // 根据状态展示不同颜色风机贴图
  361. showStationFn(viewer, e, index, images) {
  362. const position = Cesium.Cartesian3.fromDegrees(e.longitude, e.latitude);
  363. const entity = viewer.entities.add({
  364. id: index,
  365. position, // 模型位置
  366. billboard: {
  367. image: images, // 也可以是 SVG 路径,如 'icon.svg'
  368. scale: 0.5,
  369. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  370. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  371. // 模型贴地
  372. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  373. },
  374. label: {
  375. text: e.plantname,
  376. font: "14px sans-serif",
  377. fillColor: Cesium.Color.fromBytes(255, 255, 255),
  378. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  379. },
  380. });
  381. let that = this;
  382. const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
  383. handler.setInputAction(function (movement) {
  384. var position = movement.position;
  385. var pickedObject = viewer.scene.pick(position);
  386. if (pickedObject && pickedObject.id.id === index) {
  387. console.log("你点击了标签或模型!", entity);
  388. console.log("选中风场或新能源场", e.plantname);
  389. that.showWindDetail = true;
  390. that.allStationentitys.forEach(({ entity, handler }) => {
  391. viewer.entities.remove(entity); // 移除实体
  392. if (!handler.isDestroyed()) {
  393. handler.destroy(); // 销毁事件处理器(关键!)
  394. }
  395. });
  396. that.allStationentitys = [];
  397. that.showWindFromStation(viewer);
  398. }
  399. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  400. that.allStationentitys.push({ entity, handler });
  401. },
  402. // 展示所选风场的风机
  403. showWindFromStation(viewer) {
  404. let stationName = this.$route.query.nameEn;
  405. let fjLonLatJson = [];
  406. this.fjLonLatJsonArr = [];
  407. let url = "";
  408. // 旺海庄:DHWH 苏木山:DHSM 营盘梁:DHYP 迈越:HZMY
  409. // if (stationName === "MYFDC") {
  410. // fjLonLatJson = fjMYLonLatJson;
  411. // url = "ws://10.121.128.117:8431/ws/HZMY";
  412. // } else if (stationName === "JNWHZ") {
  413. // fjLonLatJson = fjWHZLonLatJson;
  414. // url = "ws://10.121.128.117:8431/ws/DHWH";
  415. // } else if (stationName === "JNYPL") {
  416. // fjLonLatJson = fjYPLLonLatJson;
  417. // url = "ws://10.121.128.117:8431/ws/DHYP";
  418. // } else if (stationName === "JNSMS") {
  419. // fjLonLatJson = fjSMSLonLatJson;
  420. // url = "ws://10.121.128.117:8431/ws/DHSM";
  421. // }
  422. webSocketService.connect({
  423. url: `ws/${this.getWsUrl(stationName)}`,
  424. autoReconnect: true,
  425. maxReconnectAttempts: 5,
  426. reconnectInterval: 3000,
  427. onOpen: (event) => {
  428. console.log("✅ WebSocket 连接成功", event);
  429. },
  430. onError: (error) => {
  431. console.log("❌ WebSocket 错误:", error);
  432. return
  433. if (stationName === "MYFDC") {
  434. fjLonLatJson = JSON.parse(JSON.stringify(fjMYLonLatJson));
  435. } else if (stationName === "JNWHZ") {
  436. fjLonLatJson = JSON.parse(JSON.stringify(fjWHZLonLatJson));
  437. } else if (stationName === "JNYPL") {
  438. fjLonLatJson = JSON.parse(JSON.stringify(fjYPLLonLatJson));
  439. } else if (stationName === "JNSMS") {
  440. fjLonLatJson = JSON.parse(JSON.stringify(fjSMSLonLatJson));
  441. }
  442. let wtArray = JSON.parse(JSON.stringify(wsRes.windMachineList));
  443. this.isFakeData = true;
  444. this.fakeDataTimmer = setInterval(() => {
  445. fjLonLatJson.data.forEach((e) => {
  446. let fjItem =
  447. wtArray.find((findEle) => {
  448. return findEle.fjbh === e.fjbh;
  449. }) || {};
  450. const fjMix = Object.assign({}, e, fjItem);
  451. fjMix.status = this.getStatus(fjMix.fjzt);
  452. e = fjMix;
  453. if (e.status) {
  454. if (e.status === 1) {
  455. this.showStatuswind(viewer, e, dj);
  456. } else if (e.status === 2) {
  457. this.showStatuswind(viewer, e, gz);
  458. } else if (e.status === 3) {
  459. this.showStatuswind(viewer, e, jx);
  460. } else if (e.status === 4) {
  461. this.showStatuswind(viewer, e, xd);
  462. } else if (e.status === 5) {
  463. this.showStatuswind(viewer, e, lx);
  464. } else if (e.status === 6) {
  465. this.showStatuswind(viewer, e, sl);
  466. } else {
  467. //并网风机
  468. this.showAnimatewind(viewer, e);
  469. }
  470. }
  471. this.changeZb(fjMix);
  472. });
  473. this.fjLonLatJsonArr = fjLonLatJson;
  474. }, 1000);
  475. },
  476. });
  477. webSocketService.on("message", (res) => {
  478. if (stationName === "MYFDC") {
  479. fjLonLatJson = JSON.parse(JSON.stringify(fjMYLonLatJson));
  480. } else if (stationName === "JNWHZ") {
  481. fjLonLatJson = JSON.parse(JSON.stringify(fjWHZLonLatJson));
  482. } else if (stationName === "JNYPL") {
  483. fjLonLatJson = JSON.parse(JSON.stringify(fjYPLLonLatJson));
  484. } else if (stationName === "JNSMS") {
  485. fjLonLatJson = JSON.parse(JSON.stringify(fjSMSLonLatJson));
  486. }
  487. let wtArray = JSON.parse(JSON.stringify(res.windMachineList));
  488. fjLonLatJson.data.forEach((e) => {
  489. let fjItem =
  490. wtArray.find((findEle) => {
  491. return findEle.fjbh === e.fjbh;
  492. }) || {};
  493. const fjMix = Object.assign({}, e, fjItem);
  494. fjMix.status = this.getStatus(fjMix.fjzt);
  495. e = fjMix;
  496. if (e.status) {
  497. if (e.status === 1) {
  498. this.showStatuswind(viewer, e, dj);
  499. } else if (e.status === 2) {
  500. this.showStatuswind(viewer, e, gz);
  501. } else if (e.status === 3) {
  502. this.showStatuswind(viewer, e, jx);
  503. } else if (e.status === 4) {
  504. this.showStatuswind(viewer, e, xd);
  505. } else if (e.status === 5) {
  506. this.showStatuswind(viewer, e, lx);
  507. } else if (e.status === 6) {
  508. this.showStatuswind(viewer, e, sl);
  509. } else {
  510. //并网风机
  511. this.showAnimatewind(viewer, e);
  512. }
  513. }
  514. this.changeZb(fjMix);
  515. });
  516. this.fjLonLatJsonArr = fjLonLatJson;
  517. });
  518. // const ws = useWebSocket(url);
  519. // let wtArray = ws.messages.windMachineList;
  520. // this.fjLonLatJsonArr = fjLonLatJson;
  521. this.resetWindViewport();
  522. },
  523. getWsUrl(stationName) {
  524. let wsurl = "";
  525. if (stationName === "MYFDC") {
  526. wsurl = "HZMY";
  527. } else if (stationName === "JNWHZ") {
  528. wsurl = "DHWH";
  529. } else if (stationName === "JNYPL") {
  530. wsurl = "DHYP";
  531. } else if (stationName === "JNSMS") {
  532. wsurl = "DHSM";
  533. }
  534. return wsurl;
  535. },
  536. getStatus(sName) {
  537. let status = 0;
  538. if (/待机/.test(sName)) {
  539. status = 1;
  540. } else if (/故障/.test(sName)) {
  541. status = 2;
  542. } else if (/检修/.test(sName)) {
  543. status = 3;
  544. } else if (/限电/.test(sName)) {
  545. status = 4;
  546. } else if (/离线/.test(sName)) {
  547. status = 5;
  548. } else if (/受累/.test(sName)) {
  549. status = 6;
  550. } else if (/并网/.test(sName)) {
  551. status = 7;
  552. }
  553. return status;
  554. },
  555. // 根据状态展示不同颜色风机贴图
  556. showStatuswind(viewer, e, type, index) {
  557. this.addSvg(
  558. viewer,
  559. type,
  560. e.longitude,
  561. e.latitude,
  562. e,
  563. Math.random().toFixed(4) * 10000
  564. );
  565. },
  566. // 风机柱与扇叶分开展示转动效果贴图
  567. showAnimatewind(viewer, e, index) {
  568. this.addSvgs(
  569. viewer,
  570. bwshan,
  571. e.longitude,
  572. e.latitude,
  573. e,
  574. Math.random().toFixed(3) * 1000
  575. );
  576. this.addSvg(
  577. viewer,
  578. bwzhu,
  579. e.longitude,
  580. e.latitude,
  581. e,
  582. Math.random().toFixed(3) * 2000
  583. );
  584. },
  585. //添加svg或png贴图
  586. addSvg(viewer, uri, lon, lat, val, index) {
  587. let that = this;
  588. const findRes =
  589. that.zbLabelList.find((findEle) => {
  590. return findEle.fjbh === val.fjbh;
  591. }) || null;
  592. if (!findRes) {
  593. let ids = that.generateUniqueId(val.id);
  594. const position = Cesium.Cartesian3.fromDegrees(lon, lat);
  595. // 使用高级灯牌生成器
  596. // const advancedGenerator = new AdvancedBillboardGenerator();
  597. // let statusItems = [
  598. // {
  599. // label: "功率",
  600. // value: `${
  601. // this.isFakeData
  602. // ? this.randomNum(100, 1000)
  603. // : val.actualPower.toFixed(2)
  604. // }MW`,
  605. // },
  606. // {
  607. // label: "风速",
  608. // value: `${
  609. // this.isFakeData
  610. // ? this.randomNum(100, 1000)
  611. // : val.windSpeed.toFixed(1)
  612. // }m/s`,
  613. // },
  614. // {
  615. // label: "转速",
  616. // value: `${
  617. // this.isFakeData
  618. // ? this.randomNum(100, 1000)
  619. // : val.rotateSpeed.toFixed(1)
  620. // }p`,
  621. // },
  622. // // { label: "其他参数A", value: "...." },
  623. // // { label: "其他参数B", value: "...." },
  624. // // { label: "其他参数C", value: "...." },
  625. // // { label: "其他参数D", value: "...." },
  626. // // { label: "其他参数E", value: "...." },
  627. // // { label: "其他参数F", value: "...." },
  628. // ];
  629. // const billboardImage = advancedGenerator.generateAdvancedBillboard({
  630. // title: val.fjbh,
  631. // statusItems,
  632. // // borderGradient: ["#00e5ff", "#2979ff"],
  633. // borderGradient: ["#ccc", "#ccc"],
  634. // backgroundColor: "transparent",
  635. // padding: 6,
  636. // titleHeight: 22,
  637. // itemHeight: 17,
  638. // titleColor: "#1890ff",
  639. // titleStrokeStyle: "#000",
  640. // titleStrokeWidth: 1,
  641. // labelStrokeStyle: "#000",
  642. // labelStrokeWidth: 1,
  643. // valueStrokeStyle: "#000",
  644. // valueStrokeWidth: 1,
  645. // });
  646. // const entityxy = viewer.entities.add({
  647. // name: val.name,
  648. // position,
  649. // billboard: {
  650. // image: billboardImage,
  651. // scale: 1,
  652. // verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 原来已经是CENTER,现在改为BOTTOM
  653. // pixelOffset: new Cesium.Cartesian2(80, -50), // 原来是-20,现在改为30,向上移动
  654. // eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
  655. // // heightReference: Cesium.HeightReference.NONE,
  656. // // 近大远小
  657. // scaleByDistance: new Cesium.NearFarScalar(
  658. // 6000, // 5010米内
  659. // 1.2, // 1倍大小
  660. // 9000, // 10000米外
  661. // 1 // 0.1倍大小
  662. // ),
  663. // // 透明度渐变
  664. // // translucencyByDistance: new Cesium.NearFarScalar(
  665. // // 6000, // 500米内
  666. // // 1.0, // 完全不透明
  667. // // 9000, // 3000米外
  668. // // 0.5 // 完全透明
  669. // // ),
  670. // },
  671. // });
  672. const btn = document.getElementById("windBtn");
  673. btn.addEventListener("click", function (event) {
  674. entityxy.show = !entityxy.show;
  675. });
  676. if (val.bgFj === "1") {
  677. const benchmark = viewer.entities.add({
  678. position,
  679. billboard: {
  680. image: that.benchmark,
  681. scale: 0.8,
  682. pixelOffset: new Cesium.Cartesian2(50, -25),
  683. }, // 偏移避免重叠
  684. });
  685. }
  686. const entity = viewer.entities.add({
  687. id: ids,
  688. position, // 模型位置
  689. billboard: {
  690. image: uri, // 也可以是 SVG 路径,如 'icon.svg'
  691. scale: 0.5,
  692. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  693. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  694. // 模型贴地
  695. // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  696. },
  697. label: {
  698. // text: val.name ? val.name : val.plantname,
  699. text: val.fjbh,
  700. font: "14px sans-serif",
  701. fillColor: Cesium.Color.fromBytes(255, 255, 255),
  702. },
  703. });
  704. // 创建事件处理器
  705. const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
  706. handler.setInputAction(function (movement) {
  707. var position = movement.position;
  708. var pickedObject = viewer.scene.pick(position);
  709. if (pickedObject && pickedObject.id.id === ids) {
  710. console.log("你点击了标签或模型!", entity);
  711. console.log("标签或模型数据!", val);
  712. that.modelVal = val;
  713. // 找到实体,显示包含实体信息的弹框
  714. that.showRightClickPopup(position, val);
  715. return;
  716. }
  717. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  718. this.allWindEntitys.push({ entity, handler });
  719. }
  720. },
  721. changeZb(model) {
  722. const glText = this.isFakeData
  723. ? this.randomNum(100, 1000)
  724. : model.actualPower.toFixed(2);
  725. const fsText = this.isFakeData
  726. ? this.randomNum(100, 1000)
  727. : model.rotateSpeed.toFixed(2);
  728. const zsText = this.isFakeData
  729. ? this.randomNum(100, 1000)
  730. : model.windSpeed.toFixed(2);
  731. const zbMap = {
  732. glText: `${glText} MW`,
  733. fsText: `${fsText} m/s`,
  734. zsText: `${zsText} p`,
  735. };
  736. const position = Cesium.Cartesian3.fromDegrees(
  737. model.longitude,
  738. model.latitude,
  739. 0
  740. );
  741. const zbhj =
  742. this.zbLabelList.find((ele) => {
  743. return ele.fjbh === model.fjbh;
  744. }) || null;
  745. if (zbhj?.fjbh) {
  746. zbhj.zb.forEach((ele) => {
  747. if (ele.zb) {
  748. const spText = ele.label.text._value.split(": ");
  749. ele.label.text._value = `${spText[0]}: ${zbMap[ele.zb]}`;
  750. }
  751. });
  752. } else {
  753. const wtName = this.viewer.entities.add({
  754. position,
  755. label: {
  756. text: model.fjbh,
  757. font: "14pt sans-serif",
  758. fillColor: new Cesium.Color.fromCssColorString("#4fc3f7"), // 填充颜色
  759. outlineColor: Cesium.Color.BLACK, // 轮廓颜色
  760. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  761. outlineWidth: 2,
  762. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  763. showBackground: false, // 显示背景
  764. backgroundColor: new Cesium.Color.fromCssColorString(
  765. "rgba(13, 38, 77, 0.5)"
  766. ), // 背景颜色
  767. backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
  768. verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
  769. horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
  770. pixelOffset: new Cesium.Cartesian2(80, -60), // 原来是-20,现在改为30,向上移动
  771. eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
  772. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  773. scaleByDistance: new Cesium.NearFarScalar(
  774. 6000, // 6000米内
  775. 1,
  776. 9000, // 9000米外
  777. 0.8
  778. ),
  779. },
  780. });
  781. const glZb = this.viewer.entities.add({
  782. position,
  783. label: {
  784. text: `功率: ${glText} MW`,
  785. font: "14pt sans-serif",
  786. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  787. outlineWidth: 2,
  788. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  789. showBackground: false, // 显示背景
  790. backgroundColor: new Cesium.Color.fromCssColorString(
  791. "rgba(13, 38, 77, 0.5)"
  792. ), // 背景颜色
  793. backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
  794. verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
  795. horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
  796. pixelOffset: new Cesium.Cartesian2(80, -40), // 原来是-20,现在改为30,向上移动
  797. eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
  798. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  799. scaleByDistance: new Cesium.NearFarScalar(
  800. 6000, // 6000米内
  801. 1,
  802. 9000, // 9000米外
  803. 0.8
  804. ),
  805. },
  806. });
  807. glZb.zb = "glText";
  808. const fsZb = this.viewer.entities.add({
  809. position,
  810. label: {
  811. text: `风速: ${fsText}`,
  812. font: "14pt sans-serif",
  813. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  814. outlineWidth: 2,
  815. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  816. showBackground: false, // 显示背景
  817. backgroundColor: new Cesium.Color.fromCssColorString(
  818. "rgba(13, 38, 77, 0.5)"
  819. ), // 背景颜色
  820. backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
  821. verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
  822. horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
  823. pixelOffset: new Cesium.Cartesian2(80, -20), // 原来是-20,现在改为30,向上移动
  824. eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
  825. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  826. scaleByDistance: new Cesium.NearFarScalar(
  827. 6000, // 6000米内
  828. 1,
  829. 9000, // 9000米外
  830. 0.8
  831. ),
  832. },
  833. });
  834. fsZb.zb = "fsText";
  835. const zsZb = this.viewer.entities.add({
  836. position,
  837. label: {
  838. text: `转速: ${zsText}`,
  839. font: "14pt sans-serif",
  840. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  841. outlineWidth: 2,
  842. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  843. showBackground: false, // 显示背景
  844. backgroundColor: new Cesium.Color.fromCssColorString(
  845. "rgba(13, 38, 77, 0.5)"
  846. ), // 背景颜色
  847. backgroundPadding: new Cesium.Cartesian2(10, 10), // 背景内边距
  848. verticalOrigin: Cesium.VerticalOrigin.CENTER, // 垂直对齐方式
  849. horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // 水平对齐方式
  850. pixelOffset: new Cesium.Cartesian2(80, 0), // 原来是-20,现在改为30,向上移动
  851. eyeOffset: new Cesium.Cartesian3(0, 0, 0), // 保持固定大小
  852. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  853. scaleByDistance: new Cesium.NearFarScalar(
  854. 6000, // 6000米内
  855. 1,
  856. 9000, // 9000米外
  857. 0.8
  858. ),
  859. },
  860. });
  861. zsZb.zb = "zsText";
  862. this.zbLabelList.push({
  863. fjbh: model.fjbh,
  864. zb: [wtName, glZb, fsZb, zsZb],
  865. });
  866. }
  867. },
  868. randomNum(minNum, maxNum) {
  869. switch (arguments.length) {
  870. case 1:
  871. return parseInt(Math.random() * minNum + 1, 10);
  872. case 2:
  873. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  874. default:
  875. return 0;
  876. }
  877. },
  878. //添加svg或png贴图
  879. addSvgs(viewer, uri, lon, lat, val, index) {
  880. let that = this;
  881. let ids = that.generateUniqueId(val.id);
  882. const position = Cesium.Cartesian3.fromDegrees(lon, lat);
  883. const entity = viewer.entities.add({
  884. id: ids,
  885. position, // 模型位置
  886. billboard: {
  887. image: uri, // 也可以是 SVG 路径,如 'icon.svg'
  888. scale: 0.5,
  889. pixelOffset: new Cesium.Cartesian2(0, -15),
  890. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  891. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  892. // 模型贴地
  893. // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  894. // 核心:使用 CallbackProperty 实现旋转动画
  895. rotation: new Cesium.CallbackProperty(function (time) {
  896. // 每 3 秒转一圈(可调速度)
  897. const seconds = time.secondsOfDay;
  898. const angle = Cesium.Math.toRadians(((seconds % 3) * -360) / 3); // 每3秒一圈
  899. return angle;
  900. }, false),
  901. // 确保绕中心旋转
  902. rotationAlignment: Cesium.HeightReference.CENTER,
  903. alignedAxis: Cesium.Cartesian3.UNIT_Z,
  904. },
  905. });
  906. // 创建事件处理器
  907. const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
  908. handler.setInputAction(function (movement) {
  909. var position = movement.position;
  910. var pickedObject = viewer.scene.pick(position);
  911. if (pickedObject && pickedObject.id.id === ids) {
  912. console.log("你点击了标签或模型!", entity);
  913. console.log("标签或模型数据!", val);
  914. that.modelVal = val;
  915. // 找到实体,显示包含实体信息的弹框
  916. that.showRightClickPopup(position, val);
  917. return;
  918. }
  919. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  920. this.allWindEntitys.push({ entity, handler });
  921. },
  922. // 右键展示元素
  923. showRightClickPopup(screenPosition, val) {
  924. // 创建或获取弹框元素
  925. var popup = document.getElementById("rightClickPopup");
  926. if (!popup) {
  927. popup = document.createElement("div");
  928. popup.id = "rightClickPopup";
  929. popup.style.position = "absolute";
  930. // popup.style.backgroundColor = 'white';
  931. popup.style.border = "1px solid rgba(255, 255, 255, 0.2)";
  932. popup.style.borderRadius = "4px";
  933. popup.style.padding = "10px";
  934. popup.style.boxShadow = "0 2px 10px rgba(0,0,0,0.2)";
  935. popup.style.backdropFilter = `blur(10px)`;
  936. popup.style.zIndex = "1000";
  937. popup.style.pointerEvents = "auto"; // 确保弹框可交互
  938. // 添加一个最小宽度,避免内容过短
  939. popup.style.minWidth = "100px";
  940. // 可选:添加箭头指向点击点
  941. // 这需要更复杂的 CSS 或额外的 DOM 元素
  942. document.body.appendChild(popup);
  943. }
  944. // <span class="popup-menu-item" data-message-type="model" style="cursor:pointer">模型解构</span>
  945. let content = `
  946. <div style="display: flex;gap: 10px;flex-direction: column;text-align: center;color: #fff">
  947. <span class="popup-menu-item" data-message-type="basic" style="cursor:pointer">基本信息</span>
  948. <span class="popup-menu-item" data-message-type="video" style="cursor:pointer">视频监控</span>
  949. <span class="popup-menu-item" data-message-type="problem" style="cursor:pointer">故障详情</span>
  950. </div>
  951. `;
  952. // 设置弹框内容
  953. popup.innerHTML = content;
  954. // --- 关键修正:准确计算弹框位置 ---
  955. // 1. 获取 Cesium 画布 (Canvas) 相对于视口 (viewport) 的位置
  956. var canvas = this.viewer.scene.canvas;
  957. var canvasRect = canvas.getBoundingClientRect();
  958. // console.log('Canvas Rect:', canvasRect); // 调试用
  959. // 2. 计算弹框左上角在页面中的绝对 X 坐标
  960. // screenPosition.x 是相对于画布左上角的 X 偏移
  961. // canvasRect.left 是画布左上角相对于浏览器视口左上角的 X 偏移
  962. // window.pageXOffset 是页面水平滚动的距离
  963. var popupLeft = canvasRect.left + screenPosition.x + window.pageXOffset;
  964. // 3. 计算弹框左上角在页面中的绝对 Y 坐标
  965. var popupTop = canvasRect.top + screenPosition.y + window.pageYOffset;
  966. // --- 可选:添加偏移量,避免完全覆盖鼠标指针 ---
  967. // 例如,向下和向右偏移 10px
  968. var offsetX = 10;
  969. var offsetY = 10;
  970. popupLeft += offsetX;
  971. popupTop += offsetY;
  972. // --- 可选:边界检查,防止弹框超出屏幕 ---
  973. var popupWidth = popup.offsetWidth || 150; // 确保有宽度
  974. var popupHeight = popup.offsetHeight || 50; // 确保有高度
  975. var windowWidth = window.innerWidth;
  976. var windowHeight = window.innerHeight;
  977. // 如果弹框右边会超出窗口,则左移
  978. if (popupLeft + popupWidth > windowWidth) {
  979. popupLeft = windowWidth - popupWidth - 10; // 靠右留 10px 边距
  980. }
  981. // 如果弹框底边会超出窗口,则上移
  982. if (popupTop + popupHeight > windowHeight) {
  983. popupTop = windowHeight - popupHeight - 10; // 靠下留 10px 边距
  984. }
  985. // 如果左边超出 (不太可能,但安全起见)
  986. if (popupLeft < 0) popupLeft = 10;
  987. // 如果顶边超出
  988. if (popupTop < 0) popupTop = 10;
  989. // --- 设置最终位置 ---
  990. popup.style.left = popupLeft + "px";
  991. popup.style.top = popupTop + "px";
  992. // console.log('Popup Position:', { left: popupLeft, top: popupTop }); // 调试用
  993. // 显示弹框
  994. popup.style.display = "block";
  995. // --- 隐藏弹框的逻辑 (保持不变) ---
  996. function hidePopup(event) {
  997. // 检查点击是否发生在弹框内部,如果是,则不隐藏
  998. if (event && popup.contains(event.target)) {
  999. return;
  1000. }
  1001. popup.style.display = "none";
  1002. document.removeEventListener("click", hidePopup);
  1003. document.removeEventListener("keydown", keyDownHandler);
  1004. }
  1005. function keyDownHandler(event) {
  1006. if (event.key === "Escape") {
  1007. hidePopup();
  1008. }
  1009. }
  1010. let that = this;
  1011. that.showBasicMsg = false;
  1012. that.showVideoMsg = false;
  1013. that.showProblemMsg = false;
  1014. that.showModelMsg = false;
  1015. function popupMenuItemClick(event) {
  1016. // 检查点击的是否是菜单项
  1017. if (event.target.classList.contains("popup-menu-item")) {
  1018. event.stopPropagation(); // 阻止冒泡,防止弹框立即关闭
  1019. var messageType = event.target.dataset.messageType; // 获取 data-message-type
  1020. console.log("点击了菜单项:", messageType);
  1021. // 调用您的 showMessage 函数
  1022. that.showMessage(messageType, val);
  1023. hidePopup();
  1024. // 可选:执行后关闭弹框
  1025. // hideRightClickPopup();
  1026. }
  1027. }
  1028. // 移除旧的监听器(避免重复绑定)
  1029. document.removeEventListener("click", hidePopup);
  1030. document.removeEventListener("click", popupMenuItemClick);
  1031. document.removeEventListener("keydown", keyDownHandler);
  1032. // 添加新的监听器
  1033. document.addEventListener("click", hidePopup);
  1034. document.addEventListener("click", popupMenuItemClick);
  1035. document.addEventListener("keydown", keyDownHandler);
  1036. },
  1037. showMessage(type, val) {
  1038. console.log("type===>>>", type);
  1039. this.windDrawer = true;
  1040. this.windDrawerHeader = val.fjbh + "数据详情";
  1041. if (type === "basic") {
  1042. this.windDrawerTitle = "基础信息";
  1043. this.showBasicMsg = true;
  1044. } else if (type === "video") {
  1045. this.windDrawerTitle = "视频监控";
  1046. this.showVideoMsg = true;
  1047. } else if (type === "problem") {
  1048. this.windDrawerTitle = "故障查看";
  1049. this.showProblemMsg = true;
  1050. }
  1051. // else {
  1052. // this.windDrawerTitle = '模型解构'
  1053. // this.showModelMsg = true
  1054. // }
  1055. },
  1056. showwindmodel() {
  1057. this.windDrawer = true;
  1058. this.showBasicMsg = false;
  1059. this.showVideoMsg = false;
  1060. this.showProblemMsg = false;
  1061. this.windDrawerHeader = "风机模型可视化解构说明";
  1062. this.showModelMsg = true;
  1063. },
  1064. handleClose() {
  1065. this.windDrawer = false;
  1066. this.showBasicMsg = false;
  1067. this.showVideoMsg = false;
  1068. this.showProblemMsg = false;
  1069. this.showModelMsg = false;
  1070. },
  1071. showComDia(val) {
  1072. this.showcomModelDia = val;
  1073. this.modelVal = null;
  1074. },
  1075. csceneElliposid(viewer) {
  1076. let that = this;
  1077. // 获取 scene 和 ellipsoid
  1078. var scene = viewer.scene;
  1079. var labels = viewer.scene.primitives.add(new Cesium.LabelCollection());
  1080. // 创建 ScreenSpaceEventHandler
  1081. var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  1082. // 监听左键点击事件
  1083. handler.setInputAction(async (click) => {
  1084. // 获取点击位置的笛卡尔坐标
  1085. var position = click.position;
  1086. if (!position) return;
  1087. // 使用 globe.pick 获取包含地形高度的坐标
  1088. var ray = viewer.camera.getPickRay(position);
  1089. var cartesian = viewer.scene.globe.pick(ray, viewer.scene);
  1090. if (cartesian) {
  1091. // 转换为地理坐标
  1092. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  1093. var longitude = Cesium.Math.toDegrees(cartographic.longitude);
  1094. var latitude = Cesium.Math.toDegrees(cartographic.latitude);
  1095. var height = cartographic.height;
  1096. // 格式化坐标
  1097. var text = `经度: ${longitude.toFixed(6)}°\n纬度: ${latitude.toFixed(
  1098. 6
  1099. )}°`;
  1100. // 创建一个标签
  1101. var label = labels.add({
  1102. position: cartesian,
  1103. text: text,
  1104. font: "14px monospace",
  1105. fillColor: Cesium.Color.fromCssColorString("#1d70df"),
  1106. // style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1107. // outlineColor: Cesium.Color.BLACK,
  1108. outlineWidth: 2,
  1109. verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 标签在点的上方
  1110. pixelOffset: new Cesium.Cartesian2(0, -20), // 向上偏移一点
  1111. disableDepthTest: true, // 让标签始终可见(即使在地球背面)
  1112. scale: 0.8,
  1113. });
  1114. // 5秒后移除标签
  1115. setTimeout(function () {
  1116. labels.remove(label);
  1117. }, 5000);
  1118. console.log(
  1119. `点击坐标: ${longitude.toFixed(6)}, ${latitude.toFixed(
  1120. 6
  1121. )}, ${height.toFixed(2)}m`
  1122. );
  1123. }
  1124. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  1125. },
  1126. generateUniqueId(prefix = "id") {
  1127. let idCounter = 0;
  1128. return `${prefix}-${Date.now()}-${Math.random()
  1129. .toString(36)
  1130. .substr(2, 9)}-${idCounter++}`;
  1131. },
  1132. handleInitView() {
  1133. if (this.showWindDetail) {
  1134. this.resetWindViewport();
  1135. } else {
  1136. this.resetAllStationViewport();
  1137. }
  1138. },
  1139. // 重置所有风场视角
  1140. resetAllStationViewport() {
  1141. this.viewer.camera.flyTo({
  1142. destination: Cesium.Cartesian3.fromDegrees(
  1143. 114.502778,
  1144. 35.326667,
  1145. 3000000
  1146. ),
  1147. orientation: {
  1148. heading: Cesium.Math.toRadians(0),
  1149. pitch: Cesium.Math.toRadians(-90),
  1150. roll: 0.0,
  1151. },
  1152. duration: 3.0,
  1153. });
  1154. },
  1155. // 重置风场中所有风机视角
  1156. resetWindViewport() {
  1157. let fromLon = this.$route.query.longitude * 1;
  1158. let fromLat = this.$route.query.latitude * 1;
  1159. let fromheight = this.$route.query.height * 1;
  1160. let fromname = this.$route.query.nameEn;
  1161. let targetLon = null;
  1162. let targetLat = null;
  1163. this.restLatLon.forEach((it) => {
  1164. if (it.name === fromname) {
  1165. targetLon = it.longitude;
  1166. targetLat = it.latitude;
  1167. }
  1168. });
  1169. // 设置镜头到指定的经纬度(度)、高度(米)
  1170. this.viewer.camera.setView({
  1171. destination: Cesium.Cartesian3.fromDegrees(
  1172. fromLon, // 经度 (degrees)
  1173. fromLat, // 纬度 (degrees)
  1174. fromheight // 高度 (meters)
  1175. ),
  1176. orientation: {
  1177. heading: Cesium.Math.toRadians(0.0), // 偏航角 (方向,0 指向北方)
  1178. pitch: Cesium.Math.toRadians(-90.0), // 俯仰角 (-90 是垂直向下)
  1179. roll: 0.0, // 翻滚角
  1180. },
  1181. });
  1182. // 目标位置:经度、纬度、高度
  1183. // const targetLon = 114.48789;
  1184. // const targetLat = 35.32916;
  1185. const targetHeight = 5000;
  1186. const draggableHeightTolerance = 5000; // 允许拖拽的高度范围:20,000 ~ 30,000
  1187. const minHeight = 5000; // 最低高度
  1188. const maxHeight = 10000; // 最高高度
  1189. const allowedOffsetDegrees = 0.2; // 允许拖拽的最大偏移(经纬度)
  1190. const minLon = targetLon - allowedOffsetDegrees;
  1191. const maxLon = targetLon + allowedOffsetDegrees;
  1192. const minLat = targetLat - allowedOffsetDegrees;
  1193. const maxLat = targetLat + allowedOffsetDegrees;
  1194. let that = this;
  1195. that.viewer.camera.flyTo({
  1196. destination: Cesium.Cartesian3.fromDegrees(
  1197. targetLon,
  1198. targetLat,
  1199. targetHeight
  1200. ),
  1201. orientation: {
  1202. heading: Cesium.Math.toRadians(0),
  1203. pitch: Cesium.Math.toRadians(-90),
  1204. roll: 0.0,
  1205. },
  1206. duration: 3.0,
  1207. complete: function () {
  1208. console.log("飞入完成,启用拖拽限制逻辑");
  1209. enableHeightBasedDragControl();
  1210. },
  1211. });
  1212. // ===== 控制逻辑:根据高度决定是否允许拖拽 =====
  1213. function enableHeightBasedDragControl() {
  1214. that.viewer.scene.preUpdate.addEventListener(function (scene, time) {
  1215. const camera = that.viewer.camera;
  1216. const posCartographic = camera.positionCartographic;
  1217. if (!posCartographic) return;
  1218. const currentHeight = posCartographic.height;
  1219. that.currentHeight = currentHeight;
  1220. const currentLon = Cesium.Math.toDegrees(posCartographic.longitude);
  1221. const currentLat = Cesium.Math.toDegrees(posCartographic.latitude);
  1222. // === 第一步:限制相机高度不能超出 [10000, 100000] ===
  1223. if (currentHeight < minHeight) {
  1224. // 强制拉高到 minHeight,但保持当前水平视角
  1225. const newPos = Cesium.Cartesian3.fromDegrees(
  1226. currentLon,
  1227. currentLat,
  1228. minHeight
  1229. );
  1230. camera.setView({
  1231. destination: newPos,
  1232. orientation: {
  1233. heading: camera.heading,
  1234. pitch: camera.pitch,
  1235. roll: camera.roll,
  1236. },
  1237. });
  1238. return; // 避免后续逻辑冲突
  1239. }
  1240. if (currentHeight > maxHeight) {
  1241. const newPos = Cesium.Cartesian3.fromDegrees(
  1242. currentLon,
  1243. currentLat,
  1244. maxHeight
  1245. );
  1246. camera.setView({
  1247. destination: newPos,
  1248. orientation: {
  1249. heading: camera.heading,
  1250. pitch: camera.pitch,
  1251. roll: camera.roll,
  1252. },
  1253. });
  1254. return;
  1255. }
  1256. // if (currentHeight < (maxHeight-700000)) {
  1257. // that.cancleAllLayer();
  1258. // }
  1259. // === 第二步:判断是否在“可拖拽高度区间” ===
  1260. const isInDraggableRange =
  1261. currentHeight >= targetHeight - draggableHeightTolerance &&
  1262. currentHeight <= targetHeight + draggableHeightTolerance;
  1263. if (isInDraggableRange) {
  1264. // ✅ 允许拖拽,但限制在指定范围内
  1265. const correctedLon = Cesium.Math.clamp(currentLon, minLon, maxLon);
  1266. const correctedLat = Cesium.Math.clamp(currentLat, minLat, maxLat);
  1267. if (
  1268. Math.abs(correctedLon - currentLon) > 1e-8 ||
  1269. Math.abs(correctedLat - currentLat) > 1e-8
  1270. ) {
  1271. // 越界了,纠正位置,保留当前高度和视角
  1272. camera.setView({
  1273. destination: Cesium.Cartesian3.fromDegrees(
  1274. correctedLon,
  1275. correctedLat,
  1276. currentHeight
  1277. ),
  1278. orientation: {
  1279. heading: camera.heading,
  1280. pitch: camera.pitch,
  1281. roll: camera.roll,
  1282. },
  1283. });
  1284. }
  1285. } else {
  1286. // ❌ 不在可拖拽高度:禁止平移,强制回正到目标点
  1287. const correctedPosition = Cesium.Cartesian3.fromDegrees(
  1288. targetLon,
  1289. targetLat,
  1290. currentHeight // 保留当前缩放高度
  1291. );
  1292. camera.setView({
  1293. destination: correctedPosition,
  1294. orientation: {
  1295. heading: camera.heading,
  1296. pitch: camera.pitch,
  1297. roll: camera.roll,
  1298. },
  1299. });
  1300. }
  1301. });
  1302. }
  1303. },
  1304. coverOnChange(val) {
  1305. if (val.value === "风场") {
  1306. this.switchWindLayer(val.check);
  1307. } else if (val.value === "云层") {
  1308. this.switchCloudLayer(val.check);
  1309. } else if (val.value === "降雨") {
  1310. this.switchRainLayer(val.check);
  1311. } else if (val.value === "温度") {
  1312. this.switchTemperatureLayerr(val.check);
  1313. }
  1314. },
  1315. // 提供控制函数以便在需要时停止循环
  1316. stopCycling(intervalId) {
  1317. if (intervalId) {
  1318. clearInterval(intervalId);
  1319. intervalId = null;
  1320. console.log("循环已停止");
  1321. }
  1322. },
  1323. // 切换风场图显隐
  1324. switchWindLayer() {
  1325. this.viewer.scene.screenSpaceCameraController.enableZoom = true;
  1326. if (this.rainLayer || this.rainImagesLayer.length > 0) {
  1327. this.removeRainLayer();
  1328. this.stopCycling(this.rainintervalId);
  1329. }
  1330. if (this.cloudLayer || this.cloudImagesLayer.length > 0) {
  1331. this.removeCloudLayer();
  1332. this.stopCycling(this.cloudintervalId);
  1333. }
  1334. if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
  1335. this.removeTemperatureLayer();
  1336. this.stopCycling(this.tempintervalId);
  1337. }
  1338. if (this.windLayer) {
  1339. this.removeWindLayer();
  1340. } else {
  1341. this.showWindLayer();
  1342. }
  1343. },
  1344. // 添加风场图
  1345. async showWindLayer() {
  1346. if (!this.windLayer) {
  1347. this.windLayer = new WindLayer(windGridData, {
  1348. particleSize: 2.0,
  1349. particleOpacity: 0.6,
  1350. particleSpeed: 0.01,
  1351. maxVelocity: 25, // 风速最大值(用于颜色映射和速度缩放)
  1352. minVelocity: 0, // 风速最小值阈值(低于此值不显示粒子)
  1353. colorScale: [
  1354. "rgb(36,104, 180)",
  1355. "rgb(60,157, 194)",
  1356. "rgb(128,205,193)",
  1357. "rgb(151,218,168)",
  1358. "rgb(198,231,181)",
  1359. "rgb(238,247,217)",
  1360. "rgb(255,238,159)",
  1361. "rgb(252,217,125)",
  1362. "rgb(255,182,100)",
  1363. "rgb(252,150,75)",
  1364. "rgb(250,112,52)",
  1365. "rgb(245,64,32)",
  1366. "rgb(237,45,28)",
  1367. "rgb(220,24,32)",
  1368. "rgb(180,0,35)",
  1369. ], // 颜色强度缩放
  1370. frameRate: 15,
  1371. fadeOpacity: 0.995,
  1372. particleAge: 150,
  1373. maxAge: 60,
  1374. globalAlpha: 0.8,
  1375. velocityScale: 1 / 30, // 粒子移动速度缩放因子(控制动画快慢)
  1376. paths: 500,
  1377. lineWidth: 2,
  1378. });
  1379. this.windLayer.addTo(this.viewer);
  1380. }
  1381. },
  1382. // 切换卫星云图显隐
  1383. switchCloudLayer(val) {
  1384. if (this.windLayer) {
  1385. this.removeWindLayer();
  1386. }
  1387. if (this.rainLayer || this.rainImagesLayer.length > 0) {
  1388. this.removeRainLayer();
  1389. this.stopCycling(this.rainintervalId);
  1390. }
  1391. if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
  1392. this.removeTemperatureLayer();
  1393. this.stopCycling(this.tempintervalId);
  1394. }
  1395. if (!val || this.cloudLayer || this.cloudImagesLayer.length > 0) {
  1396. this.removeCloudLayer();
  1397. this.stopCycling(this.cloudintervalId);
  1398. } else {
  1399. this.showCloudLayer();
  1400. }
  1401. },
  1402. // 切换降雨图显隐
  1403. switchRainLayer() {
  1404. this.viewer.scene.screenSpaceCameraController.enableZoom = true;
  1405. if (this.windLayer) {
  1406. this.removeWindLayer();
  1407. }
  1408. if (this.cloudLayer || this.cloudImagesLayer.length > 0) {
  1409. this.removeCloudLayer();
  1410. this.stopCycling(this.cloudintervalId);
  1411. }
  1412. if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
  1413. this.removeTemperatureLayer();
  1414. this.stopCycling(this.tempintervalId);
  1415. }
  1416. if (this.rainLayer || this.rainImagesLayer.length > 0) {
  1417. this.removeRainLayer();
  1418. this.stopCycling(this.rainintervalId);
  1419. } else {
  1420. this.showRainLayer();
  1421. }
  1422. },
  1423. // 切换温度图显隐
  1424. switchTemperatureLayerr() {
  1425. this.viewer.scene.screenSpaceCameraController.enableZoom = true;
  1426. if (this.windLayer) {
  1427. this.removeWindLayer();
  1428. }
  1429. if (this.cloudLayer || this.cloudImagesLayer.length > 0) {
  1430. this.removeCloudLayer();
  1431. this.stopCycling(this.cloudintervalId);
  1432. }
  1433. if (this.rainLayer || this.rainImagesLayer.length > 0) {
  1434. this.removeRainLayer();
  1435. this.stopCycling(this.rainintervalId);
  1436. }
  1437. if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
  1438. this.removeTemperatureLayer();
  1439. this.stopCycling(this.tempintervalId);
  1440. } else {
  1441. this.showTemperatureLayer();
  1442. }
  1443. },
  1444. // 显示云图
  1445. showCloudLayer() {
  1446. const imageUrls = [];
  1447. cloudJson.forEach((it) => {
  1448. imageUrls.push("/public/static" + it.path);
  1449. });
  1450. this.showeveryTypeImagesLayer(
  1451. imageUrls,
  1452. this.cloudintervalId,
  1453. this.cloudImagesLayer
  1454. );
  1455. },
  1456. //显示降雨图
  1457. showRainLayer() {
  1458. const imageUrls = [];
  1459. rainJson.forEach((it) => {
  1460. imageUrls.push("/public/static" + it.path);
  1461. });
  1462. this.showeveryTypeImagesLayer(
  1463. imageUrls,
  1464. this.rainintervalId,
  1465. this.rainImagesLayer
  1466. );
  1467. this.csceneElliposid(this.viewer, "rain");
  1468. },
  1469. //显示温度图
  1470. showTemperatureLayer() {
  1471. const imageUrls = [];
  1472. tempJson.forEach((it) => {
  1473. imageUrls.push("/public/static" + it.path);
  1474. });
  1475. this.showeveryTypeImagesLayer(
  1476. imageUrls,
  1477. this.tempintervalId,
  1478. this.tempImagesLayer
  1479. );
  1480. this.csceneElliposid(this.viewer, "temp");
  1481. },
  1482. async showeveryTypeImagesLayer(imageUrls, intervalId, ImagesLayers) {
  1483. // 存储所有图片图层的数组
  1484. let imageLayers = [];
  1485. // 当前显示的图片索引
  1486. let currentImageIndex = -1; // 初始为-1,表示没有图片显示
  1487. // 创建所有图片图层并添加到Viewer,初始时全部隐藏
  1488. await imageUrls.forEach((url) => {
  1489. const provider = new Cesium.SingleTileImageryProvider({
  1490. url: url,
  1491. // url: URL.createObjectURL(url),
  1492. rectangle: Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0), // 全球覆盖
  1493. tileWidth: 1440, // 根据你的图片实际宽度修改
  1494. tileHeight: 721,
  1495. // 如果你的图片只覆盖特定区域,请修改rectangle参数
  1496. });
  1497. const Layer = this.viewer.imageryLayers.addImageryProvider(provider);
  1498. Layer.alpha = 0.8; // 透明度
  1499. Layer.brightness = 1; // 亮度
  1500. Layer.contrast = 1; // 对比度
  1501. Layer.show = false; // 初始隐藏
  1502. imageLayers.push(Layer);
  1503. ImagesLayers.push(Layer);
  1504. });
  1505. function showNextImage() {
  1506. // 隐藏当前图片
  1507. if (currentImageIndex >= 0 && currentImageIndex < imageLayers.length) {
  1508. imageLayers[currentImageIndex].show = false;
  1509. }
  1510. // 计算下一张图片的索引
  1511. currentImageIndex = (currentImageIndex + 1) % imageLayers.length;
  1512. // 显示下一张图片
  1513. imageLayers[currentImageIndex].show = true;
  1514. // imageLayers[currentImageIndex + 1].show = true;
  1515. console.log("当前显示图片: " + imageUrls[currentImageIndex]);
  1516. }
  1517. // 设置切换间隔(毫秒),例如每5秒切换一次
  1518. const intervalMs = 5000;
  1519. intervalId = setInterval(showNextImage, intervalMs);
  1520. // 初始显示第一张图片
  1521. showNextImage();
  1522. },
  1523. // 移除风场图
  1524. removeWindLayer() {
  1525. if (this.windLayer) {
  1526. // this.windLayer.destroy();
  1527. this.windLayer.remove();
  1528. this.windLayer = null;
  1529. }
  1530. },
  1531. // 移除卫星云图
  1532. removeCloudLayer() {
  1533. if (this.cloudLayer) {
  1534. this.tagMsg = null;
  1535. this.viewer.imageryLayers.remove(this.cloudLayer);
  1536. this.cloudLayer = null;
  1537. }
  1538. if (this.cloudImagesLayer.length > 0) {
  1539. this.cloudImagesLayer.forEach((it) => {
  1540. this.viewer.imageryLayers.remove(it);
  1541. });
  1542. this.cloudImagesLayer = [];
  1543. }
  1544. if (this.imageryProviderV) {
  1545. this.viewer.imageryLayers.remove(this.imageryProviderV);
  1546. this.imageryProviderV = null;
  1547. }
  1548. },
  1549. // 移除降雨图
  1550. removeRainLayer() {
  1551. if (this.rainLayer) {
  1552. this.tagMsg = null;
  1553. this.viewer.imageryLayers.remove(this.rainLayer);
  1554. this.rainLayer = null;
  1555. this.setMapImageryProvider();
  1556. this.handlerAction.removeInputAction(
  1557. Cesium.ScreenSpaceEventType.LEFT_CLICK
  1558. );
  1559. }
  1560. if (this.rainImagesLayer.length > 0) {
  1561. this.rainImagesLayer.forEach((it) => {
  1562. this.viewer.imageryLayers.remove(it);
  1563. });
  1564. this.rainImagesLayer = [];
  1565. }
  1566. if (this.imageryProviderV) {
  1567. this.viewer.imageryLayers.remove(this.imageryProviderV);
  1568. this.imageryProviderV = null;
  1569. }
  1570. },
  1571. // 移除温度图
  1572. removeTemperatureLayer() {
  1573. if (this.temperatureLayer) {
  1574. this.tagMsg = null;
  1575. this.viewer.imageryLayers.remove(this.temperatureLayer);
  1576. this.temperatureLayer = null;
  1577. this.setMapImageryProvider();
  1578. this.handlerAction.removeInputAction(
  1579. Cesium.ScreenSpaceEventType.LEFT_CLICK
  1580. );
  1581. }
  1582. if (this.tempImagesLayer.length > 0) {
  1583. this.tempImagesLayer.forEach((it) => {
  1584. this.viewer.imageryLayers.remove(it);
  1585. });
  1586. this.tempImagesLayer = [];
  1587. }
  1588. if (this.imageryProviderV) {
  1589. this.viewer.imageryLayers.remove(this.imageryProviderV);
  1590. this.imageryProviderV = null;
  1591. }
  1592. },
  1593. //取消所有图层加载
  1594. cancleAllLayer() {
  1595. if (this.windLayer) {
  1596. this.removeWindLayer();
  1597. }
  1598. if (this.rainLayer || this.rainImagesLayer.length > 0) {
  1599. this.removeRainLayer();
  1600. this.stopCycling(this.rainintervalId);
  1601. }
  1602. if (this.cloudLayer || this.cloudImagesLayer.length > 0) {
  1603. this.removeCloudLayer();
  1604. this.stopCycling(this.cloudintervalId);
  1605. }
  1606. if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
  1607. this.removeTemperatureLayer();
  1608. this.stopCycling(this.tempintervalId);
  1609. }
  1610. },
  1611. switchLayer() {
  1612. this.$router.push({
  1613. path: "/",
  1614. });
  1615. },
  1616. menuComTSty(val) {
  1617. this.menuComTStyB = val;
  1618. },
  1619. },
  1620. };
  1621. </script>
  1622. <style lang="less" scoped>
  1623. .dataLoading {
  1624. width: 100vw;
  1625. height: 100vh;
  1626. background: rgba(0, 0, 0, 0.5);
  1627. z-index: 999;
  1628. position: fixed;
  1629. .loadText {
  1630. position: absolute;
  1631. top: 50%;
  1632. left: 50%;
  1633. transform: translate(-50%, -50%);
  1634. background: rgba(255, 255, 255, 0.7);
  1635. padding: 15px 20px;
  1636. border-radius: 6px;
  1637. color: black;
  1638. font-size: 14px;
  1639. font-weight: bold;
  1640. }
  1641. }
  1642. .mapBox {
  1643. width: 100%;
  1644. height: 100%;
  1645. position: relative;
  1646. box-sizing: content-box;
  1647. overflow: hidden;
  1648. .menuComT {
  1649. position: fixed;
  1650. bottom: 400px;
  1651. left: 20px;
  1652. }
  1653. .menuComTSty {
  1654. position: fixed;
  1655. bottom: 20px;
  1656. left: 20px;
  1657. }
  1658. }
  1659. </style>
  1660. <style lang="less">
  1661. .el-overlay {
  1662. background-color: transparent !important;
  1663. .windModelDrawer {
  1664. width: 80% !important;
  1665. backdrop-filter: blur(15px) !important;
  1666. background: rgba(255, 255, 255, 0.8) !important;
  1667. border-radius: 10px 0 0 10px !important;
  1668. .el-drawer__body {
  1669. overflow: hidden;
  1670. padding-top: 0;
  1671. }
  1672. }
  1673. }
  1674. .windDrawerCla {
  1675. .line {
  1676. display: flex;
  1677. flex-direction: row;
  1678. align-items: center;
  1679. justify-content: space-between;
  1680. width: 100%;
  1681. margin-bottom: 10px;
  1682. .leftContent {
  1683. width: 242px;
  1684. height: 41px;
  1685. display: flex;
  1686. align-items: center;
  1687. background: url("@/assets/cesiumImg/title_left_bg.png") no-repeat;
  1688. span {
  1689. font-size: 16px;
  1690. font-family: Microsoft YaHei;
  1691. font-weight: 400;
  1692. color: #ffffff;
  1693. margin-left: 25px;
  1694. }
  1695. }
  1696. }
  1697. .jcxx,
  1698. .gzck {
  1699. height: 100%;
  1700. }
  1701. .spjk,
  1702. .third {
  1703. height: 80vh;
  1704. }
  1705. }
  1706. </style>