HomeView.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. <template>
  2. <div class="home">
  3. <Header></Header>
  4. <Map />
  5. <div :class="{ 'yjdp-btn': true, isActive: yjdpShow }" @click="addyjdp">沿街店铺</div>
  6. <div :class="{ 'kzdp-btn': true, isActive: kzdpShow }" @click="addkzdp">空置店铺</div>
  7. <div class="yhfk-btn" @click="openYHFK">用户反馈</div>
  8. <!-- 智小青 -->
  9. <div class="zxq-btn" @click="openZXQ"></div>
  10. <div class="zxqIframeContainer" v-if="isShowZXQ">
  11. <div class="close" @click="closeZXQ">×</div>
  12. <iframe :src="zxqUrl" frameborder="0"></iframe>
  13. </div>
  14. <!-- <div class="control3D">
  15. <div class="label">三维模型</div>
  16. <el-switch v-model="isShow3D" size="large" active-text @change="changeModel" />
  17. </div> -->
  18. <div class="changeBaseMap">
  19. <div class="container">
  20. <div v-for="(item, index) in baseMapArr" :key="index" @click="changeMap(item)">
  21. <div :class="{ 'content': true, 'active': item.isActive }">
  22. <div class="label">{{ item.label }}</div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="heatmapContorl">
  28. <div :class="{ 'ckzb-btn': true, isActive: heatmapPanelShow }" @click="handleOpenHeatmapPanelShow">热力图</div>
  29. <div class="heatmapPanel" v-show="heatmapPanelShow">
  30. <el-scrollbar>
  31. <ul>
  32. <li v-for="(item, index) in heatmapList" :key="index">
  33. <el-checkbox v-model="item.isAdd" :label="item.name" size="large"
  34. @change="judgeLayerType($event, item)" />
  35. </li>
  36. </ul>
  37. </el-scrollbar>
  38. </div>
  39. </div>
  40. <div class="heatmapLegend" v-show="heatmapPanelShow">
  41. </div>
  42. <div :class="{ 'zxq-ckzb-btn': true, isActive: isActiveZXQ }" @click="isActiveZXQ">智小青</div>
  43. <div class="layerContorl">
  44. <div :class="{ 'ckzb-btn': true, isActive: layerPanelShow }" @click="handleOpenLayerPanelShow">查看周边</div>
  45. <div class="layerPanel" v-show="layerPanelShow">
  46. <el-scrollbar>
  47. <ul>
  48. <li v-for="(item, index) in layerList" :key="index">
  49. <el-checkbox v-model="item.isAdd" :label="item.name" size="large"
  50. @change="judgeLayerType($event, item)" />
  51. </li>
  52. </ul>
  53. </el-scrollbar>
  54. </div>
  55. </div>
  56. <KDYJS ref="kdyjs"></KDYJS>
  57. <div class="tips">试运行阶段服务范围:夏阳街道</div>
  58. <div class="yjdpInfoDialog" v-show="yjdpInfoDialogShow">
  59. <div class="close" @click="closeYJDP">×</div>
  60. <div class="content" v-if="nowPoint != null">
  61. <el-scrollbar>
  62. <div class="item">店铺名称: {{ nowPoint.properties["店铺名称"] }}</div>
  63. <div class="item">店铺类型: {{ nowPoint.properties["店铺类型"] }}</div>
  64. <div class="item">街镇: {{ nowPoint.properties["街镇"] }}</div>
  65. <div class="item">道路名称: {{ nowPoint.properties["道路名称"] }}</div>
  66. </el-scrollbar>
  67. </div>
  68. </div>
  69. <div class="kzdpInfoDialog" v-show="kzdpInfoDialogShow">
  70. <div class="close" @click="closeKZDP">×</div>
  71. <div class="content" v-if="nowPoint != null">
  72. <el-scrollbar>
  73. <div class="item">店铺名称: {{ nowPoint.properties["店铺名称"] }}</div>
  74. <div class="item">店铺类型: {{ nowPoint.properties["店铺类型"] }}</div>
  75. <div class="item">街镇: {{ nowPoint.properties["街镇"] }}</div>
  76. <div class="item">道路名称: {{ nowPoint.properties["道路名称"] }}</div>
  77. </el-scrollbar>
  78. </div>
  79. </div>
  80. <!-- 此处弹框样式写在App.vue中 -->
  81. <el-dialog class="yhfkInfoDialog" title="用户反馈" header-class="yhfkInfoDialogHeader"
  82. footer-class="yhfkInfoDialogfooter" v-model="yhfkInfoDialogShow" :close="closeKZDP" :close-on-click-modal="false"
  83. :append-to-body="true" width="600">
  84. <el-form ref="yhfkInfoDialogRef" :model="yhfkForm" label-width="auto" :rules="rules" style="max-width: 600px">
  85. <el-form-item label="姓名" prop="name">
  86. <el-input v-model="yhfkForm.name" />
  87. </el-form-item>
  88. <el-form-item label="联系方式" prop="tele">
  89. <el-input v-model="yhfkForm.tele" />
  90. </el-form-item>
  91. <el-form-item label="问题描述" prop="desc">
  92. <el-input v-model="yhfkForm.desc" type="textarea" />
  93. </el-form-item>
  94. </el-form>
  95. <template #footer>
  96. <div class="dialog-footer">
  97. <el-button @click="closeYHFK">取消</el-button>
  98. <el-button type="primary" @click="yhfkSubmit">提交</el-button>
  99. </div>
  100. </template>
  101. </el-dialog>
  102. </div>
  103. </template>
  104. <script>
  105. import { toRaw } from "vue";
  106. import { ElMessage } from 'element-plus'
  107. import Map from "@/components/Map.vue";
  108. import Header from "@/components/Header.vue";
  109. import KDYJS from "@/views/KDYJS.vue";
  110. export default {
  111. name: "HomeView",
  112. components: {
  113. Map,
  114. Header,
  115. KDYJS
  116. },
  117. data() {
  118. let arr = webConfig.layerList;
  119. arr = arr.map(function (item, index) {
  120. item.id = index;
  121. item.isAdd = false
  122. return item
  123. })
  124. let arrHeatmap = webConfig.heatmapList;
  125. arrHeatmap = arrHeatmap.map(function (item, index) {
  126. item.id = index;
  127. item.isAdd = false
  128. return item
  129. })
  130. return {
  131. isShow3D: false,
  132. baseMapArr: [
  133. {
  134. type: "yxt",
  135. label: "影像图",
  136. isActive: false
  137. },
  138. {
  139. type: "xht",
  140. label: "线划图",
  141. isActive: true
  142. }
  143. ],
  144. yjdpShow: false,
  145. kzdpShow: false,
  146. mapHandle: null,
  147. yjdpInfoDialogShow: false,
  148. kzdpInfoDialogShow: false,
  149. yhfkInfoDialogShow: false,
  150. nowPoint: null,
  151. layerPanelShow: false,
  152. layerRoot: webConfig.GEOSERVER_URL_WMS,
  153. layerList: arr,
  154. wmslayer: {},
  155. heatmapPanelShow: false,
  156. heatmapList: arrHeatmap,
  157. heatmapLayer: {},
  158. yhfkForm: {
  159. name: "",
  160. tele: "",
  161. desc: ""
  162. },
  163. rules: {
  164. name: [
  165. { required: true, message: '请填写姓名', trigger: 'blur' },
  166. ],
  167. tele: [
  168. { required: true, message: '请填写联系方式', trigger: 'blur' },
  169. ],
  170. desc: [
  171. { required: true, message: '请填写问题描述', trigger: 'blur' },
  172. ],
  173. },
  174. isShowZXQ: false,
  175. zxqUrl: webConfig.zxqUrl
  176. };
  177. },
  178. mounted() {
  179. this.$refs.kdyjs.open();
  180. // 监听message事件
  181. window.addEventListener('message', this.handleMessage);
  182. },
  183. beforeDestroy() {
  184. // 在组件销毁前移除事件监听器
  185. window.removeEventListener('message', this.handleMessage);
  186. },
  187. methods: {
  188. handleMessage(event) {
  189. // // 确保消息来自预期的源
  190. // // 如果需要更严格的安全性,请验证event.origin
  191. // if (event.source !== window.parent) {
  192. // return;
  193. // }
  194. // 处理接收到的消息数据
  195. const data = event.data;
  196. // const imgUrl = data.imgUrl;
  197. // const otherParam = data.otherParam;
  198. // 在Vue父组件中处理数据
  199. // ...
  200. },
  201. changeModel(status) {
  202. mapTriggerEvent("changeModel", {
  203. status: status
  204. });
  205. },
  206. changeMap(item) {
  207. this.baseMapArr = this.baseMapArr.map(function (item) {
  208. item.isActive = false;
  209. return item;
  210. });
  211. item.isActive = true;
  212. switch (item.type) {
  213. case "yxt":
  214. mapTriggerEvent("changeBaseMap", { type: "yxt" });
  215. break;
  216. case "xht":
  217. mapTriggerEvent("changeBaseMap", { type: "xht" });
  218. break;
  219. }
  220. },
  221. // 打开用户反馈
  222. openYHFK() {
  223. this.yhfkInfoDialogShow = true
  224. },
  225. // 关闭用户反馈
  226. closeYHFK() {
  227. this.yhfkInfoDialogShow = false;
  228. this.yhfkForm = {
  229. name: "",
  230. tele: "",
  231. desc: ""
  232. }
  233. },
  234. // 提交用户反馈
  235. yhfkSubmit() {
  236. let that = this;
  237. this.$refs.yhfkInfoDialogRef.validate((valid, fields) => {
  238. if (valid) {
  239. let formData = new FormData();
  240. let obj = {
  241. "title": that.yhfkForm.tele,
  242. "content": that.yhfkForm.name,
  243. // "c_name": that.yhfkForm.name,
  244. // "c_tele": that.yhfkForm.tele,
  245. // "c_describe": that.yhfkForm.desc
  246. }
  247. obj[webConfig.userFeedback.name] = that.yhfkForm.name
  248. obj[webConfig.userFeedback.tele] = that.yhfkForm.tele
  249. obj[webConfig.userFeedback.desc] = that.yhfkForm.desc
  250. formData.append("content", JSON.stringify(obj))
  251. formData.append("columnId", webConfig.userFeedback.columnId)
  252. formData.append("modelId", webConfig.userFeedback.modelId)
  253. // 使用 fetch API 提交数据
  254. fetch(webConfig.DMS_URL + "/content/addContent", {
  255. method: 'POST', // 或者 'PUT', 'DELETE', 等等
  256. body: formData, // 直接传递 FormData 对象
  257. headers: {
  258. // 如果需要设置 Content-Type,通常不需要,因为 fetch 会自动设置,但如果需要可以手动设置
  259. // 'Content-Type': 'application/x-www-form-urlencoded'
  260. token: localStorage.getItem(webConfig.AUTH_USER_TOKEN_KEY)
  261. }
  262. })
  263. .then(response => response.json()) // 假设服务器返回 JSON 数据
  264. .then(data => {
  265. // 处理返回的数据,例如更新页面等
  266. if (data.code == 200) {
  267. ElMessage({
  268. message: '您的反馈已提交,后续我们将与您联系确认问题,感谢您的反馈!',
  269. type: 'success',
  270. plain: true,
  271. })
  272. setTimeout(() => {
  273. that.yhfkInfoDialogShow = false
  274. }, 500);
  275. }
  276. })
  277. .catch((error) => {
  278. // console.error('Error:', error);
  279. });
  280. } else {
  281. ElMessage({
  282. message: '请您完善反馈的问题后再尝试提交!',
  283. type: 'warning',
  284. plain: true,
  285. })
  286. }
  287. })
  288. },
  289. // 打开智小青
  290. openZXQ() {
  291. this.isShowZXQ = true
  292. },
  293. // 关闭智小青
  294. closeZXQ() {
  295. this.isShowZXQ = false
  296. },
  297. // 沿街店铺
  298. addyjdp() {
  299. let that = this;
  300. this.yjdpShow = !this.yjdpShow
  301. if (this.yjdpShow) {
  302. // 添加
  303. fetch("./static/data/沿街店铺.geojson")
  304. .then(response => response.json())
  305. .then(function (result) {
  306. that.pointYJDPArr = result.features.map(function (pointInfo) {
  307. return viewer.entities.add(new SkyScenery.Entity({
  308. position: SkyScenery.Cartesian3.fromDegrees(pointInfo.geometry.coordinates[0], pointInfo.geometry.coordinates[1]),
  309. type: "yjdp",
  310. info: {
  311. coor: [pointInfo.geometry.coordinates[0], pointInfo.geometry.coordinates[1]],
  312. properties: pointInfo.properties
  313. },
  314. billboard: {
  315. width: 48,
  316. height: 48,
  317. image: "./static/image/point-dp.png",
  318. scale: 1,
  319. horizontalOrigin: SkyScenery.HorizontalOrigin.CENTER,
  320. verticalOrigin: SkyScenery.VerticalOrigin.BOTTOM,
  321. }
  322. }));
  323. })
  324. })
  325. } else {
  326. // 删除
  327. this.pointYJDPArr.map(function (point) {
  328. viewer.entities.remove(point)
  329. })
  330. this.pointYJDPArr = []
  331. this.yjdpInfoDialogShow = false;
  332. this.nowPoint = null
  333. }
  334. this.pointTCHandle();
  335. },
  336. closeYJDP() {
  337. this.yjdpInfoDialogShow = false;
  338. this.nowPoint = null
  339. },
  340. // 空置店铺
  341. addkzdp() {
  342. let that = this;
  343. this.kzdpShow = !this.kzdpShow
  344. if (this.kzdpShow) {
  345. // 添加
  346. fetch("./static/data/沿街店铺-空置.geojson")
  347. .then(response => response.json())
  348. .then(function (result) {
  349. that.pointKZDPArr = result.features.map(function (pointInfo) {
  350. return viewer.entities.add(new SkyScenery.Entity({
  351. position: SkyScenery.Cartesian3.fromDegrees(pointInfo.geometry.coordinates[0], pointInfo.geometry.coordinates[1], 0.5),
  352. type: "kzdp",
  353. info: {
  354. coor: [pointInfo.geometry.coordinates[0], pointInfo.geometry.coordinates[1]],
  355. properties: pointInfo.properties
  356. },
  357. billboard: {
  358. width: 48,
  359. height: 48,
  360. image: "./static/image/kzdp.png",
  361. scale: 1,
  362. horizontalOrigin: SkyScenery.HorizontalOrigin.CENTER,
  363. verticalOrigin: SkyScenery.VerticalOrigin.BOTTOM,
  364. }
  365. }));
  366. })
  367. })
  368. } else {
  369. // 删除
  370. this.pointKZDPArr.map(function (point) {
  371. viewer.entities.remove(point)
  372. })
  373. this.pointKZDPArr = []
  374. this.kzdpInfoDialogShow = false;
  375. this.nowPoint = null
  376. }
  377. this.pointTCHandle();
  378. },
  379. closeKZDP() {
  380. this.kzdpInfoDialogShow = false;
  381. this.nowPoint = null
  382. },
  383. // 点击事件绑定
  384. pointTCHandle() {
  385. let that = this;
  386. if (!this.mapHandle) {
  387. this.mapHandle = new SkyScenery.ScreenSpaceEventHandler(viewer.canvas, this);
  388. this.mapHandle.setInputAction(function (movement) {
  389. // 获取鼠标位置
  390. const pickedObject = viewer.scene.pick(movement.position);
  391. if (SkyScenery.defined(pickedObject) && SkyScenery.defined(pickedObject.id)) {
  392. const entity = pickedObject.id;
  393. if (entity.type == "yjdp") {
  394. /**
  395. * 根据拾取到的点位的经纬度 转成 屏幕坐标
  396. * 添加文字描述
  397. */
  398. // let xy = viewer.scene.cartesianToCanvasCoordinates(entity.position.getValue())
  399. // "街镇": "夏阳街道",
  400. // "网格编码": "31011800101",
  401. // "居委": "祥龙居委会",
  402. // "地理编码": "310118001005",
  403. // "地址": "浦仓路437号",
  404. // "城市": "上海市",
  405. // "区县": "青浦区",
  406. // "网格名称": "第一责任网格",
  407. // "简称": "31011800101"
  408. that.yjdpInfoDialogShow = true
  409. that.nowPoint = entity.info;
  410. that.nowPoint["type"] = "yjdp";
  411. let xy = that.lonlatConvertToScreenXY(entity.info.coor)
  412. document.querySelector(".yjdpInfoDialog").style.top = (xy.y - 250) + "px";
  413. document.querySelector(".yjdpInfoDialog").style.left = (xy.x - 150) + "px";
  414. // document.querySelector("#yjdpInfoDialog")
  415. // that.removePanel();
  416. // that.addPointDivLabel(xy, entity.info.name)
  417. } else if (entity.type == "kzdp") {
  418. that.kzdpInfoDialogShow = true
  419. that.nowPoint = entity.info;
  420. that.nowPoint["type"] = "kzdp";
  421. let xy = that.lonlatConvertToScreenXY(entity.info.coor)
  422. document.querySelector(".kzdpInfoDialog").style.top = (xy.y - 250) + "px";
  423. document.querySelector(".kzdpInfoDialog").style.left = (xy.x - 150) + "px";
  424. }
  425. that.$refs.kdyjs.clickPointJGTL({
  426. lon: entity.info.coor[0],
  427. lat: entity.info.coor[1]
  428. })
  429. } else {
  430. // console.log('未拾取到实体');
  431. /**
  432. * 删除文字描述
  433. */
  434. // that.removePanel();
  435. }
  436. }, SkyScenery.ScreenSpaceEventType.LEFT_CLICK);
  437. viewer.scene.postRender.addEventListener(this.updatePosition, this);
  438. } else {
  439. if (this.yjdpShow == false && this.kzdpShow == false) {
  440. toRaw(this.mapHandle).destroy();
  441. this.mapHandle = null
  442. viewer.scene.postRender.removeEventListener(this.updatePosition, this);
  443. }
  444. }
  445. },
  446. // 位置更新
  447. updatePosition() {
  448. try {
  449. if (this.nowPoint != null) {
  450. const obj = toRaw(this.nowPoint);
  451. let xy = this.lonlatConvertToScreenXY(obj.coor)
  452. if (!xy) {
  453. if (obj.type == "yjdp") {
  454. document.querySelector(".yjdpInfoDialog").style.top = "-9999px";
  455. document.querySelector(".yjdpInfoDialog").style.left = "-9999px";
  456. } else if (obj.type == "kzdp") {
  457. document.querySelector(".kzdpInfoDialog").style.top = "-9999px";
  458. document.querySelector(".kzdpInfoDialog").style.left = "-9999px";
  459. }
  460. } else {
  461. if (obj.type == "yjdp") {
  462. document.querySelector(".yjdpInfoDialog").style.top = (xy.y - 250) + "px";
  463. document.querySelector(".yjdpInfoDialog").style.left = (xy.x - 150) + "px";
  464. } else if (obj.type == "kzdp") {
  465. document.querySelector(".kzdpInfoDialog").style.top = (xy.y - 250) + "px";
  466. document.querySelector(".kzdpInfoDialog").style.left = (xy.x - 150) + "px";
  467. }
  468. }
  469. }
  470. } catch (error) {
  471. // debugger
  472. }
  473. },
  474. // 经纬度转屏幕坐标
  475. lonlatConvertToScreenXY(lonlat) {
  476. // 定义经纬度
  477. var longitude = SkyScenery.Math.toRadians(lonlat[0]); // 例如:东经116.391度
  478. var latitude = SkyScenery.Math.toRadians(lonlat[1]); // 例如:北纬39.907度
  479. var height = 0; // 高度,通常在地表为0
  480. // 将经纬度转换为笛卡尔坐标
  481. // var cartographic = SkyScenery.Cartographic.fromDegrees(longitude, latitude, height);
  482. var cartesian = SkyScenery.Cartesian3.fromRadians(longitude, latitude, height, viewer.scene.globe.ellipsoid);
  483. // 将笛卡尔坐标转换为窗口坐标
  484. var canvasCoordinates = viewer.scene.cartesianToCanvasCoordinates(cartesian);
  485. return canvasCoordinates
  486. },
  487. // 热力图列表展示
  488. handleOpenHeatmapPanelShow() {
  489. this.heatmapPanelShow = !toRaw(this.heatmapPanelShow)
  490. this.layerPanelShow = false
  491. },
  492. // 图层列表展示
  493. handleOpenLayerPanelShow() {
  494. this.layerPanelShow = !toRaw(this.layerPanelShow)
  495. this.heatmapPanelShow = false
  496. },
  497. // 区分图层类型后按照不同类型加载
  498. judgeLayerType(judge, params) {
  499. if (params.type == "heatmap") {
  500. this.addHeatMapLayer(judge, params);
  501. } else {
  502. this.addWMSLayer(judge, params);
  503. }
  504. },
  505. // 加载wms服务
  506. addWMSLayer(judge, params) {
  507. if (judge) {
  508. let layer = viewer.imageryLayers.addImageryProvider(
  509. new SkyScenery.WebMapServiceImageryProvider({
  510. url: this.layerRoot,
  511. layers: params.layers,
  512. parameters: {
  513. TRANSPARENT: true,
  514. format: "image/png"
  515. }
  516. })
  517. )
  518. this.wmslayer[params.name] = layer;
  519. } else {
  520. viewer.imageryLayers.remove(toRaw(this.wmslayer[params.name]))
  521. delete this.wmslayer[params.name];
  522. }
  523. },
  524. // 加载热力图
  525. addHeatMapLayer(judge, params) {
  526. let that = this;
  527. if (judge) {
  528. fetch(params.url)
  529. .then(response => response.json())
  530. .then(function (result) {
  531. let arr = result.features.map(function (item) {
  532. let coor = item.geometry.coordinates
  533. return {
  534. x: coor[0],
  535. y: coor[1],
  536. value: 1
  537. }
  538. })
  539. that.heatmapLayer[params.name] = new SkySceneryHeatmap(viewer, {
  540. data: arr,
  541. flyTo: false,
  542. height: 0,
  543. heatStyle: {
  544. // blur: 0.7,
  545. // gradient: { 0.3: 'blue', 0.6: 'green', 0.8: 'yellow', 0.9: 'red' },
  546. // maxOpacity: 0.9,
  547. // minOpacity: 0.3,
  548. radius: 1,
  549. maxOpacity: 0.6,
  550. minOpacity: 0,
  551. blur: 0.85,
  552. gradient: {
  553. 0.4: 'blue',
  554. 0.5: 'cyan',
  555. 0.6: 'green',
  556. 0.7: 'yellow',
  557. 0.8: 'orange',
  558. 0.9: 'red'
  559. }
  560. },
  561. }, SkyScenery)
  562. })
  563. } else {
  564. if (Object.keys(toRaw(this.heatmapLayer)).length > 0) {
  565. this.heatmapLayer[params.name].destroy();
  566. delete this.heatmapLayer[params.name]
  567. }
  568. }
  569. }
  570. }
  571. };
  572. </script>
  573. <style lang="less" scoped>
  574. .home {
  575. width: 100%;
  576. height: 100%;
  577. position: relative;
  578. user-select: none;
  579. /* Chrome, Opera, Safari */
  580. -moz-user-select: none;
  581. /* Firefox */
  582. -ms-user-select: none;
  583. /* Internet Explorer/Edge */
  584. -khtml-user-select: none;
  585. /* Konqueror/Safari */
  586. .control3D {
  587. height: 40px;
  588. position: absolute;
  589. bottom: 155px;
  590. right: 20px;
  591. background: #01346f99;
  592. border: 1px solid #ffffff;
  593. padding: 0px 10px;
  594. border-radius: 10px;
  595. color: #ffffff;
  596. .label {
  597. display: inline-block;
  598. height: 40px;
  599. line-height: 40px;
  600. margin-right: 5px;
  601. }
  602. .el-switch {
  603. vertical-align: top;
  604. }
  605. }
  606. .changeBaseMap {
  607. position: absolute;
  608. bottom: 50px;
  609. right: 20px;
  610. background: #01346f99;
  611. padding: 0px 10px;
  612. color: #ffffff;
  613. padding: 10px 10px;
  614. cursor: pointer;
  615. border-radius: 10px;
  616. z-index: 9;
  617. .container {
  618. position: relative;
  619. height: 80px;
  620. width: 122px;
  621. animation: animation-wdith-back 0.5s ease-in-out 1;
  622. div .content {
  623. height: 80px;
  624. width: 100px;
  625. border-radius: 10px;
  626. border: 1px solid #ffffff;
  627. }
  628. div .content.active {
  629. border-color: #00bbff;
  630. .label {
  631. color: #00bbff;
  632. }
  633. }
  634. div .content:hover {
  635. border-color: #00bbff;
  636. .label {
  637. color: #00bbff;
  638. }
  639. }
  640. >div {
  641. width: 100px;
  642. height: 80px;
  643. position: absolute;
  644. // border: 1px solid #ffffff;
  645. border-radius: 10px;
  646. .label {
  647. width: 100%;
  648. height: 24px;
  649. position: absolute;
  650. bottom: 0px;
  651. text-align: center;
  652. font-size: 16px;
  653. background: #00000080;
  654. border-bottom-right-radius: 10px;
  655. border-bottom-left-radius: 10px;
  656. }
  657. }
  658. >div:nth-child(1) {
  659. z-index: 1;
  660. right: 20px;
  661. background: url(~@/assets/images/base2.png) no-repeat center center/100% 100%;
  662. animation: animation-right-back 0.5s ease-in-out 1;
  663. }
  664. >div:nth-child(2) {
  665. z-index: 2;
  666. right: 0px;
  667. background: url(~@/assets/images/base1.png) no-repeat center center/100% 100%;
  668. }
  669. }
  670. &:hover {
  671. .container {
  672. width: 220px;
  673. animation: animation-wdith 0.5s ease-in-out 1;
  674. >div:nth-child(1) {
  675. right: 120px;
  676. animation: animation-right 0.5s ease-in-out 1;
  677. }
  678. }
  679. }
  680. }
  681. @keyframes animation-right {
  682. from {
  683. right: 20px;
  684. }
  685. to {
  686. right: 120px;
  687. }
  688. }
  689. @keyframes animation-right-back {
  690. from {
  691. right: 120px;
  692. }
  693. to {
  694. right: 20px;
  695. }
  696. }
  697. @keyframes animation-wdith {
  698. from {
  699. width: 124px;
  700. }
  701. to {
  702. width: 224px;
  703. }
  704. }
  705. @keyframes animation-wdith-back {
  706. from {
  707. width: 224px;
  708. }
  709. to {
  710. width: 122px;
  711. }
  712. }
  713. .layerContorl {
  714. position: absolute;
  715. right: 20px;
  716. bottom: 160px;
  717. .ckzb-btn {
  718. width: 70px;
  719. height: 40px;
  720. border-radius: 10px;
  721. color: #ffffff;
  722. cursor: pointer;
  723. background: #01346f99;
  724. line-height: 38px;
  725. padding: 0 15px;
  726. text-align: center;
  727. border: 1px solid #eeeeee;
  728. &.isActive {
  729. background: #005cc6cc
  730. }
  731. &:hover {
  732. background: #005cc6cc;
  733. }
  734. }
  735. .layerPanel {
  736. position: absolute;
  737. right: 110px;
  738. bottom: 0px;
  739. background: #01346f99;
  740. border-radius: 5px;
  741. // padding: 0 10px;
  742. padding-left: 10px;
  743. height: fit-content;
  744. overflow: hidden;
  745. overflow-y: auto;
  746. height: 240px;
  747. ul {
  748. margin: 0 0;
  749. padding: 0 0;
  750. }
  751. li {
  752. list-style: none;
  753. padding-right: 10px;
  754. .el-checkbox {
  755. color: #ffffff;
  756. &.is-checked {
  757. :deep(.el-checkbox__label) {
  758. color: #ffffff;
  759. }
  760. }
  761. }
  762. }
  763. }
  764. }
  765. .heatmapContorl {
  766. position: absolute;
  767. right: 20px;
  768. bottom: 220px;
  769. .ckzb-btn {
  770. width: 70px;
  771. height: 40px;
  772. border-radius: 10px;
  773. color: #ffffff;
  774. cursor: pointer;
  775. background: #01346f99;
  776. line-height: 38px;
  777. padding: 0 15px;
  778. text-align: center;
  779. border: 1px solid #eeeeee;
  780. &.isActive {
  781. background: #005cc6cc
  782. }
  783. &:hover {
  784. background: #005cc6cc;
  785. }
  786. }
  787. .heatmapPanel {
  788. position: absolute;
  789. right: 0;
  790. bottom: 50px;
  791. background: #01346f99;
  792. border-radius: 5px;
  793. padding-left: 10px;
  794. height: fit-content;
  795. overflow: hidden;
  796. overflow-y: auto;
  797. height: 280px;
  798. ul {
  799. margin: 0 0;
  800. padding: 0 0;
  801. }
  802. li {
  803. list-style: none;
  804. padding-right: 10px;
  805. .el-checkbox {
  806. color: #ffffff;
  807. &.is-checked {
  808. :deep(.el-checkbox__label) {
  809. color: #ffffff;
  810. }
  811. }
  812. }
  813. }
  814. }
  815. }
  816. .heatmapLegend {
  817. position: absolute;
  818. left: 400px;
  819. bottom: 50px;
  820. width: 50px;
  821. height: 200px;
  822. background: url(~@/assets/images/heatmapLegend.png) no-repeat center center/100% 100%;
  823. }
  824. .tips {
  825. position: absolute;
  826. left: 0px;
  827. bottom: 0px;
  828. color: #ffffff;
  829. padding: 10px 10px;
  830. background: #01346f99;
  831. width: 100%;
  832. text-align: center;
  833. }
  834. .yjdp-btn {
  835. position: absolute;
  836. top: 80px;
  837. right: 20px;
  838. width: 70px;
  839. height: 40px;
  840. border-radius: 10px;
  841. color: #ffffff;
  842. cursor: pointer;
  843. background: #01346f99;
  844. line-height: 38px;
  845. padding: 0 15px;
  846. text-align: center;
  847. border: 1px solid #eeeeee;
  848. &.isActive {
  849. background: #005cc6cc;
  850. }
  851. &:hover {
  852. background: #005cc6cc;
  853. }
  854. }
  855. .kzdp-btn {
  856. position: absolute;
  857. top: 130px;
  858. right: 20px;
  859. width: 70px;
  860. height: 40px;
  861. border-radius: 10px;
  862. color: #ffffff;
  863. cursor: pointer;
  864. background: #01346f99;
  865. line-height: 38px;
  866. padding: 0 15px;
  867. text-align: center;
  868. border: 1px solid #eeeeee;
  869. &.isActive {
  870. background: #005cc6cc;
  871. }
  872. &:hover {
  873. background: #005cc6cc;
  874. }
  875. }
  876. .yhfk-btn {
  877. position: absolute;
  878. top: 180px;
  879. right: 20px;
  880. width: 70px;
  881. height: 40px;
  882. border-radius: 10px;
  883. color: #ffffff;
  884. cursor: pointer;
  885. background: #01346f99;
  886. line-height: 38px;
  887. padding: 0 15px;
  888. text-align: center;
  889. border: 1px solid #eeeeee;
  890. &:hover {
  891. background: #005cc6cc;
  892. }
  893. }
  894. .zxq-btn {
  895. position: absolute;
  896. top: 230px;
  897. right: 20px;
  898. width: 80px;
  899. height: 80px;
  900. border-radius: 10px;
  901. color: #ffffff;
  902. cursor: pointer;
  903. background: #01346f99 url(~@/assets/images/zxq.png) no-repeat center center /90% 90%;
  904. padding: 10px 10px;
  905. text-align: center;
  906. line-height: 90px;
  907. border: 1px solid #eeeeee;
  908. &.isActive {
  909. background: #005cc6cc url(~@/assets/images/zxq.png) no-repeat center center /90% 90%;
  910. }
  911. &:hover {
  912. background: #005cc6cc url(~@/assets/images/zxq.png) no-repeat center center /90% 90%;
  913. }
  914. }
  915. .yjdpInfoDialog {
  916. position: absolute;
  917. top: 0px;
  918. left: 0px;
  919. width: 300px;
  920. height: 200px;
  921. background: #01346f99;
  922. border-radius: 10px;
  923. .close {
  924. font-size: 24px;
  925. position: absolute;
  926. top: 6px;
  927. right: 8px;
  928. line-height: 24px;
  929. width: 24px;
  930. height: 24px;
  931. cursor: pointer;
  932. color: #ffffff;
  933. }
  934. .content {
  935. height: 160px;
  936. color: #ffffff;
  937. margin: 30px 0px 10px 20px;
  938. .item {
  939. line-height: 30px;
  940. margin-right: 20px;
  941. }
  942. }
  943. }
  944. .kzdpInfoDialog {
  945. position: absolute;
  946. top: 0px;
  947. left: 0px;
  948. width: 300px;
  949. height: 200px;
  950. background: #01346f99;
  951. border-radius: 10px;
  952. .close {
  953. font-size: 24px;
  954. position: absolute;
  955. top: 6px;
  956. right: 8px;
  957. line-height: 24px;
  958. width: 24px;
  959. height: 24px;
  960. cursor: pointer;
  961. color: #ffffff;
  962. }
  963. .content {
  964. height: 160px;
  965. color: #ffffff;
  966. margin: 30px 0px 10px 20px;
  967. .item {
  968. line-height: 30px;
  969. margin-right: 20px;
  970. }
  971. }
  972. }
  973. .zxqIframeContainer {
  974. position: absolute;
  975. top: 100px;
  976. bottom: 100px;
  977. width: 600px;
  978. right: 200px;
  979. padding: 10px 10px;
  980. border-radius: 10px;
  981. overflow: hidden;
  982. background: #01346f99;
  983. .close {
  984. font-size: 24px;
  985. font-weight: bold;
  986. position: absolute;
  987. top: 15px;
  988. right: 15px;
  989. z-index: 1;
  990. cursor: pointer;
  991. width: 30px;
  992. height: 30px;
  993. text-align: center;
  994. line-height: 30px;
  995. }
  996. iframe {
  997. width: 100%;
  998. height: 100%;
  999. }
  1000. }
  1001. }
  1002. </style>