forest.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. <!--可视化公共模板 林业-->
  2. <template>
  3. <div class="visual-con">
  4. <!--头部-->
  5. <vheader></vheader>
  6. <!--主体-->
  7. <div class="visual-body">
  8. <!-- 左侧 -->
  9. <div class="leftbar" ref="left">
  10. <!-- 3 组织机构 -->
  11. <div class="forthis">
  12. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  13. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  14. <div class="i-list-con h-80" style="padding-left: 1rem;">
  15. <el-collapse accordion>
  16. <el-collapse-item v-for="(item,index) in villageTypeXlList" :key="index">
  17. <template slot="title">
  18. <div class="d-l-con sj-collapse" :class="{on:listCurrentIndex1==item.id}"
  19. v-on:click="getEventList(calendarDay,item.parentId,item.id,10,1);getSupermap(calendarDay);">
  20. <div class="d-l-l-text">
  21. <h4 class="collapse-title">{{ item.name }}</h4>
  22. </div>
  23. <div class="d-l-l-count">{{ item.value }}</div>
  24. </div>
  25. </template>
  26. </el-collapse-item>
  27. </el-collapse>
  28. <div class="i-list-con small-bottom-margin h-30">
  29. </div>
  30. </div>
  31. </dv-border-box-13>
  32. </div>
  33. </div>
  34. <!-- 地图 -->
  35. <supermap ref="supermap" style="width: 100%;height: 100vh;" class="indexSupermapClass" :mapDiv="'forestMap'"
  36. :dynamicPlotting="false"
  37. :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"
  38. @showEventDialog="showEventDialog"/>
  39. <!-- 右侧 -->
  40. <div class="rightbar rightbar-index" ref="right">
  41. <div class="right-item1">
  42. </div>
  43. <div class="right-item2">
  44. <!-- 日历 -->
  45. <div class="forthis">
  46. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  47. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  48. <div class="i-list-con small-bottom-margin h-30">
  49. <dateChoose @selectDay="selectDay"></dateChoose>
  50. </div>
  51. </dv-border-box-13>
  52. </div>
  53. <!-- 事件列表 -->
  54. <div class="forthis">
  55. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  56. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  57. <div class="this-title">
  58. <span>事件列表</span>
  59. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  60. </div>
  61. <div class="i-list-con small-bottom-margin h-43">
  62. <div class="event-list-search">
  63. <el-input
  64. placeholder="请输入内容"
  65. prefix-icon="el-icon-search"
  66. v-model="eventSearch"
  67. @change="getEventList(calendarDay,10,1,eventSearch)">
  68. </el-input>
  69. </div>
  70. <div class="d-l-con padding-box nowrap" v-for="(item,index) in eventList"
  71. @click="dropLocation(item.latitude,item.longitude)" data-html2canvas-ignore>
  72. <div class="bgt-img">
  73. <img v-if="item.picturePath!=null&&item.picturePath!='' && item.pictureType=='image'"
  74. :src="item.picturePath"
  75. style="width: 93px;height: 64px" loading="lazy"/>
  76. <img v-else src="../assets/images/integrated/event-img-sub.png" style="width: 93px;height: 64px"/>
  77. </div>
  78. <div class="bgt-info">
  79. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount==0"
  80. class="event-state-sb">
  81. <i class="el-icon-caret-left"></i>
  82. <div class="event-list-state-sb">
  83. 新上报
  84. </div>
  85. </div>
  86. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount>0" class="event-state-cb">
  87. <i class="el-icon-caret-left"></i>
  88. <div class="event-list-state-cb">
  89. 催办
  90. </div>
  91. </div>
  92. <div v-if="item.eventStatusValue=='forest_event_status_2'" class="event-state-qs">
  93. <i class="el-icon-caret-left"></i>
  94. <div class="event-list-state-qs">
  95. 签收
  96. </div>
  97. </div>
  98. <div v-if="item.eventStatusValue=='forest_event_status_3'" class="event-state-wb">
  99. <i class="el-icon-caret-left"></i>
  100. <div class="event-list-state-wb">
  101. 误报
  102. </div>
  103. </div>
  104. <div v-if="item.eventStatusValue=='forest_event_status_4'" class="event-state-cf">
  105. <i class="el-icon-caret-left"></i>
  106. <div class="event-list-state-cf">
  107. 重复
  108. </div>
  109. </div>
  110. <div v-if="item.eventStatusValue=='forest_event_status_5'" class="event-state-bj">
  111. <i class="el-icon-caret-left"></i>
  112. <div class="event-list-state-bj">
  113. 办结
  114. </div>
  115. </div>
  116. <div v-if="item.eventStatusValue=='forest_event_status_6'" class="event-state-gd">
  117. <i class="el-icon-caret-left"></i>
  118. <div class="event-list-state-gd">
  119. 归档
  120. </div>
  121. </div>
  122. <div v-if="item.eventStatusValue=='forest_event_status_7'" class="event-state-qr">
  123. <i class="el-icon-caret-left"></i>
  124. <div class="event-list-state-qr">
  125. 归档
  126. </div>
  127. </div>
  128. <div class="bgt-info-name">{{ item.reportor }} {{ item.eventName }}</div>
  129. <div class="bgt-info-place">
  130. <ul>
  131. <li>{{ item.createTime }}</li>
  132. </ul>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <!--分页-->
  138. <div class="paging">
  139. <el-button type="button" @click="getEventList(calendarDay,bigEventTypeId,smallEventTypeId,pageSize,pageNum-1)">上一页
  140. </el-button>
  141. <!-- <span>第0页</span> -->
  142. <el-button type="button" @click="getEventList(calendarDay,bigEventTypeId,smallEventTypeId,pageSize,pageNum+1)">下一页
  143. </el-button>
  144. </div>
  145. </dv-border-box-13>
  146. </div>
  147. </div>
  148. </div>
  149. <vBottomMenu ref="bottomMenu" @stopAudio="stopAudio" ></vBottomMenu>
  150. </div>
  151. <audio id="resource" ref="up" :src="audioSrc" controls style="display: none;"></audio>
  152. <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="calendarDay"
  153. :bigEventTypeId="bigEventTypeId" :smallEventTypeId="smallEventTypeId"
  154. @getEventList="getEventList"></eventdetailsdialog>
  155. <firespread ref="firespread" :calendarDay="calendarDay" @getEventList="getEventList" @showEventDialog="showEventDialog"></firespread>
  156. <eventLocation ref="eventLocation"></eventLocation>
  157. <TVWall ref="TVWall"></TVWall>
  158. </div>
  159. </template>
  160. <script>
  161. import dateChoose from '@/views/date.vue'//日历
  162. /** ----------------------------------weosocket开始------------------------------------- */
  163. import Cookies from 'js-cookie'
  164. /** ----------------------------------weosocket结束------------------------------------- */
  165. import {
  166. getEventList
  167. } from '@/api/forest'
  168. import {
  169. getNearEventByEventId
  170. } from '@/api/event'
  171. import {
  172. getEventByEventType
  173. } from '@/api/village'
  174. import supermap from '@/components/supermap' //超图
  175. import supermapNotProcessed from '@/components/supermap' //超图
  176. import supermapProcessed from '@/components/supermap' //超图
  177. import vheader from '@/components/v-header.vue' //一体化共用头部
  178. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  179. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  180. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  181. import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
  182. import firespread from '@/views/firespread.vue' //事件详情弹窗
  183. let echarts = require('echarts')
  184. export default {
  185. components: {
  186. supermap,
  187. supermapNotProcessed,
  188. supermapProcessed,
  189. vheader,
  190. vBottomMenu,
  191. eventLocation,
  192. TVWall,
  193. dateChoose,
  194. eventdetailsdialog,
  195. firespread
  196. },
  197. created() {
  198. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  199. window.showDialog = this.showDialog
  200. window.choseLayerSwitching = this.choseLayerSwitching
  201. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  202. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  203. },
  204. mounted() {
  205. this.getEventByEventType(this.getCurrentDataStr())
  206. this.getEventList(this.getCurrentDataStr(),this.bigEventTypeId,this.smallEventTypeId,this.pageSize,this.pageNum,'')
  207. this.getSupermap(this.getCurrentDataStr());
  208. /** ----------------------------------weosocket开始------------------------------------- */
  209. // this.initWebSocket()
  210. /** ----------------------------------weosocket结束------------------------------------- */
  211. setInterval(() => {
  212. if(this.calendarDay == this.getCurrentDataStr()){
  213. this.getEventList(this.getCurrentDataStr(),this.bigEventTypeId,this.smallEventTypeId,this.pageSize,this.pageNum,this.eventSearch,true);//day, bigEventTypeId,smallEventTypeId, pageSize, pageNum, eventSearch, loading
  214. this.getEventByEventType(this.getCurrentDataStr(),true);
  215. }
  216. }, 10000)
  217. this.bottomMenuList() //获取底部公共组件消息和任务
  218. },
  219. data() {
  220. return {
  221. //警报MP3文件
  222. audioSrc:require('@/assets/jingbao.mp3'),
  223. calendarDay: this.getCurrentDataStr(),
  224. //左侧部门事件数量
  225. villageTypeXlList: [],
  226. pageSize: 10,
  227. pageNum: 1,
  228. //右侧事件列表
  229. eventList: [],
  230. eventListnew: [],
  231. eventListAll: [],
  232. eventSearch: '',//事件列表搜索
  233. listCurrentIndex1: 0,
  234. bigEventTypeId: 0,
  235. smallEventTypeId: 0,
  236. /** ----------------------------------weosocket开始------------------------------------- */
  237. weosocket: false,
  238. websock: '',
  239. setIntervalWesocketPush: null,
  240. /** ----------------------------------weosocket结束------------------------------------- */
  241. /** ----------------------------------摄像头预览开始------------------------------------- */
  242. activePanel: 'key1',
  243. isLogin: false,
  244. cameraParams: [],
  245. ws: null,
  246. /** ----------------------------------摄像头预览结束------------------------------------- */
  247. markersList: [], //点位列表
  248. cameraList: [] //摄像头列表
  249. }
  250. },
  251. /** ----------------------------------weosocket开始------------------------------------- */
  252. destroyed() { //离开页面关闭Socket连接
  253. if (this.websock) {
  254. clearInterval(this.setIntervalWesocketPush)
  255. this.websock.close()
  256. this.websock = null
  257. }
  258. },
  259. /** ----------------------------------weosocket结束------------------------------------- */
  260. methods: {
  261. // searchEvent(eventSearch) {
  262. // let that = this
  263. // //事件列表搜索
  264. // this.eventListnew = []
  265. // if (eventSearch != null && eventSearch != '') {
  266. // for (var i = 0; i < this.eventListAll.length; i++) {
  267. // if (this.eventListAll[i].reportor.indexOf(eventSearch) > -1) {
  268. // this.eventListnew.push(this.eventListAll[i])
  269. // }
  270. // }
  271. // this.eventList = this.eventListnew
  272. // } else {
  273. // this.eventList = this.eventListAll
  274. // }
  275. // if (this.eventList != null && this.eventList.length > 0) {
  276. // for (let i = 0; i < this.eventList.length; i++) {
  277. // let markersMap = {
  278. // lng: 124.59,
  279. // lat: 43.02,
  280. // icon: 'marker',
  281. // bindPopupHtml: '',
  282. // click: '',
  283. // parameter: '',
  284. // keepBindPopup: false,
  285. // isAggregation: false
  286. // }
  287. // if (this.eventList.length > 200) {
  288. // markersMap.isAggregation = true
  289. // }
  290. // if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
  291. // markersMap.click = 'showEventDialog'
  292. // markersMap.icon = 'sj-icon-map-xinshangbao'
  293. // }
  294. // if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  295. // markersMap.click = 'showEventDialog'
  296. // markersMap.icon = 'sj-icon-map-cuiban'
  297. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  298. // markersMap.click = 'showEventDialog'
  299. // markersMap.icon = 'sj-icon-map-qianshou'
  300. // markersMap.isAggregation = false
  301. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  302. // markersMap.click = 'showEventDialog'
  303. // markersMap.icon = 'sj-icon-map-banjie'
  304. // markersMap.isAggregation = false
  305. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  306. // markersMap.click = 'showEventDialog'
  307. // markersMap.icon = 'sj-icon-map-guidang'
  308. // }
  309. // markersMap.parameter = this.eventList[i].eventCode
  310. // markersMap.lng = this.eventList[i].longitude
  311. // markersMap.lat = this.eventList[i].latitude
  312. // markersMap.bindPopupHtml = '<div class="map-tip">' +
  313. // '<span>' +
  314. // ' <div class="d-l-con">' +
  315. // ' <div class="d-l-l-text">' +
  316. // ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  317. // ' </div>' +
  318. // ' </div>' +
  319. // ' </span>' +
  320. // '<span>' +
  321. // ' <div class="d-l-con">' +
  322. // ' <div class="d-l-l-text">' +
  323. // ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  324. // ' </div>' +
  325. // ' </div>' +
  326. // ' </span>' +
  327. // '<span>' +
  328. // ' <div class="d-l-con">' +
  329. // ' <div class="d-l-l-text">' +
  330. // ' <h4>事件时间:' + this.eventList[i].createTime + '</h4>' +
  331. // ' </div>' +
  332. // ' </div>' +
  333. // ' </span>'
  334. // if (this.eventList[i].picturePath != null && this.eventList[i].picturePath != '' && this.eventList[i].pictureType=='image') {
  335. // markersMap.bindPopupHtml += '<span>' +
  336. // ' <div class="d-l-con">' +
  337. // ' <div class="d-l-l-text">' +
  338. // '<img src="' + this.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  339. // ' </div>' +
  340. // ' </div>' +
  341. // ' </span>'
  342. // }
  343. // markersMap.bindPopupHtml += '</div>'
  344. // that.markersList.push(markersMap)
  345. // }
  346. // setTimeout(() => {
  347. // that.$refs.supermap.clearM(false)
  348. // that.$refs.supermap.clearM(true)
  349. // that.$refs.supermap.setMarkers(that.markersList)
  350. // }, 2000)
  351. // } else {
  352. // setTimeout(() => {
  353. // that.$refs.supermap.clearM(false)
  354. // that.$refs.supermap.clearM(true)
  355. // }, 2000)
  356. // }
  357. // },
  358. dropLocation(lat, lng) {
  359. this.$refs.supermap.dropLocation(lat, lng)
  360. },
  361. showEventDialog(eventCode) {
  362. //事件信息弹出
  363. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  364. },
  365. getFirespread(eventCode){
  366. this.$refs.firespread.showEventDialog(eventCode);
  367. },
  368. getCurrentDataStr() {
  369. let date = new Date()
  370. let y = date.getFullYear()
  371. let m = date.getMonth() + 1
  372. m = m < 10 ? '0' + m : m
  373. let d = date.getDate()
  374. d = d < 10 ? '0' + d : d
  375. return y + '-' + m + '-' + d
  376. },
  377. selectDay(day) {//日历点击
  378. this.getEventByEventType(day)
  379. this.getEventList(day,0,0,10,1,'')
  380. this.getSupermap(day);
  381. this.calendarDay = day
  382. },
  383. getEventByEventType(day,loading) {
  384. let that = this
  385. //左侧获取事件部门数量
  386. getEventByEventType({ day: day },loading).then(res => {
  387. this.villageTypeXlList = res.data
  388. })
  389. },
  390. getSupermap(day, loading) {
  391. let that = this
  392. getNearEventByEventId(this.bigEventTypeId, this.smallEventTypeId, day, loading).then(res => {
  393. that.markersList = [];
  394. if (res.data != null && res.data.length > 0) {
  395. for (let i = 0; i < res.data.length; i++) {
  396. let markersMap = {
  397. lng: 124.59,
  398. lat: 43.02,
  399. icon: 'marker',
  400. bindPopupHtml: '',
  401. click: '',
  402. parameter: '',
  403. keepBindPopup: false,
  404. isAggregation: false
  405. }
  406. if (res.data.length > 200) {
  407. markersMap.isAggregation = true
  408. }
  409. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount == 0) {
  410. markersMap.click = 'showEventDialog'
  411. markersMap.icon = 'sj-icon-map-xinshangbao'
  412. }
  413. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount > 0) {
  414. markersMap.click = 'showEventDialog'
  415. markersMap.icon = 'sj-icon-map-cuiban'
  416. } else if (res.data[i].eventStatusValue == 'forest_event_status_2') {
  417. markersMap.click = 'showEventDialog'
  418. markersMap.icon = 'sj-icon-map-qianshou'
  419. markersMap.isAggregation = false
  420. } else if (res.data[i].eventStatusValue == 'forest_event_status_5') {
  421. markersMap.click = 'showEventDialog'
  422. markersMap.icon = 'sj-icon-map-banjie'
  423. markersMap.isAggregation = false
  424. } else if (res.data[i].eventStatusValue == 'forest_event_status_6') {
  425. markersMap.click = 'showEventDialog'
  426. markersMap.icon = 'sj-icon-map-guidang'
  427. } else if (res.data[i].eventStatusValue == 'forest_event_status_7') {
  428. markersMap.click = 'showEventDialog'
  429. markersMap.icon = 'sj-icon-map-queren'
  430. }
  431. markersMap.parameter = res.data[i].eventCode
  432. markersMap.lng = res.data[i].longitude
  433. markersMap.lat = res.data[i].latitude
  434. markersMap.bindPopupHtml = '<div class="map-tip">' +
  435. '<span>' +
  436. ' <div class="d-l-con">' +
  437. ' <div class="d-l-l-text">' +
  438. ' <h4>经纬度:' + res.data[i].longitude + ',' + res.data[i].latitude + '</h4>' +
  439. ' </div>' +
  440. ' </div>' +
  441. ' </span>' +
  442. '<span>' +
  443. ' <div class="d-l-con">' +
  444. ' <div class="d-l-l-text">' +
  445. ' <h4>事件名称:' + res.data[i].eventName + '</h4>' +
  446. ' </div>' +
  447. ' </div>' +
  448. ' </span>' +
  449. '<span>' +
  450. ' <div class="d-l-con">' +
  451. ' <div class="d-l-l-text">' +
  452. ' <h4>事件时间:' + res.data[i].createTime + '</h4>' +
  453. ' </div>' +
  454. ' </div>' +
  455. ' </span>';
  456. if (res.data[i].pictureType == 'image' && res.data[i].picturePath != null && res.data[i].picturePath != '') {
  457. markersMap.bindPopupHtml += '<span>' +
  458. ' <div class="d-l-con">' +
  459. ' <div class="d-l-l-text">' +
  460. '<img src="' + res.data[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  461. ' </div>' +
  462. ' </div>' +
  463. ' </span>'
  464. }
  465. markersMap.bindPopupHtml += '</div>'
  466. that.markersList.push(markersMap)
  467. }
  468. setTimeout(() => {
  469. that.$refs.supermap.clearM(false)
  470. that.$refs.supermap.clearM(true)
  471. that.$refs.supermap.setMarkers(that.markersList)
  472. }, 2000)
  473. } else {
  474. setTimeout(() => {
  475. that.$refs.supermap.clearM(false)
  476. that.$refs.supermap.clearM(true)
  477. }, 2000)
  478. }
  479. })
  480. },
  481. // getEventList(day,bigEventTypeId,smallEventTypeId,loading) {
  482. // this.listCurrentIndex1=smallEventTypeId
  483. // this.bigEventTypeId=bigEventTypeId
  484. // this.smallEventTypeId=smallEventTypeId
  485. // let that = this
  486. // this.eventList = []
  487. // this.eventListAll = []
  488. // //右侧获取事件列表
  489. // getEventList({
  490. // day: day,
  491. // eventTypeIdDl: [bigEventTypeId],
  492. // eventTypeId: [smallEventTypeId]
  493. // },loading).then(res => {
  494. // this.eventList = res.data
  495. // this.eventListAll = res.data
  496. // that.markersList = []
  497. // if (this.eventList != null && this.eventList.length > 0) {
  498. // if(this.eventList[0].eventStatusValue == 'forest_event_status_1'){
  499. // that.$refs.bottomMenu.updateAlert();
  500. // that.$refs.up.play();
  501. // }
  502. // for (let i = 0; i < this.eventList.length; i++) {
  503. // let markersMap = {
  504. // lng: 124.59,
  505. // lat: 43.02,
  506. // icon: 'marker',
  507. // bindPopupHtml: '',
  508. // click: '',
  509. // parameter: '',
  510. // keepBindPopup: false,
  511. // isAggregation: false
  512. // }
  513. // if (this.eventList.length > 200) {
  514. // markersMap.isAggregation = true
  515. // }
  516. // if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
  517. // markersMap.click = 'showEventDialog'
  518. // markersMap.icon = 'sj-icon-map-xinshangbao'
  519. // }
  520. // if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  521. // markersMap.click = 'showEventDialog'
  522. // markersMap.icon = 'sj-icon-map-cuiban'
  523. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  524. // markersMap.click = 'showEventDialog'
  525. // markersMap.icon = 'sj-icon-map-qianshou'
  526. // markersMap.isAggregation = false
  527. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  528. // markersMap.click = 'showEventDialog'
  529. // markersMap.icon = 'sj-icon-map-banjie'
  530. // markersMap.isAggregation = false
  531. // } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  532. // markersMap.click = 'showEventDialog'
  533. // markersMap.icon = 'sj-icon-map-guidang'
  534. // }
  535. // markersMap.parameter = this.eventList[i].eventCode
  536. // markersMap.lng = this.eventList[i].longitude
  537. // markersMap.lat = this.eventList[i].latitude
  538. // markersMap.bindPopupHtml = '<div class="map-tip">' +
  539. // '<span>' +
  540. // ' <div class="d-l-con">' +
  541. // ' <div class="d-l-l-text">' +
  542. // ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  543. // ' </div>' +
  544. // ' </div>' +
  545. // ' </span>' +
  546. // '<span>' +
  547. // ' <div class="d-l-con">' +
  548. // ' <div class="d-l-l-text">' +
  549. // ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  550. // ' </div>' +
  551. // ' </div>' +
  552. // ' </span>' +
  553. // '<span>' +
  554. // ' <div class="d-l-con">' +
  555. // ' <div class="d-l-l-text">' +
  556. // ' <h4>事件时间:' + this.eventList[i].createTime + '</h4>' +
  557. // ' </div>' +
  558. // ' </div>' +
  559. // ' </span>'
  560. // if (this.eventList[i].picturePath != null && this.eventList[i].picturePath != '' && this.eventList[i].pictureType=='image') {
  561. // markersMap.bindPopupHtml += '<span>' +
  562. // ' <div class="d-l-con">' +
  563. // ' <div class="d-l-l-text">' +
  564. // '<img src="' + this.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  565. // ' </div>' +
  566. // ' </div>' +
  567. // ' </span>'
  568. // }
  569. // markersMap.bindPopupHtml += '</div>'
  570. // that.markersList.push(markersMap)
  571. // }
  572. // setTimeout(() => {
  573. // that.$refs.supermap.clearM(false)
  574. // that.$refs.supermap.clearM(true)
  575. // that.$refs.supermap.setMarkers(that.markersList)
  576. // }, 2000)
  577. // } else {
  578. // setTimeout(() => {
  579. // that.$refs.supermap.clearM(false)
  580. // that.$refs.supermap.clearM(true)
  581. // }, 2000)
  582. // }
  583. // })
  584. // },
  585. getEventList(day, bigEventTypeId,smallEventTypeId, pageSize, pageNum, eventSearch, loading) {
  586. this.listCurrentIndex1=smallEventTypeId
  587. this.bigEventTypeId=bigEventTypeId
  588. this.smallEventTypeId=smallEventTypeId
  589. if (pageNum < 1) {
  590. this.$modal.msg('当前已是第一页')
  591. return;
  592. }
  593. this.pageSize = pageSize;
  594. this.pageNum = pageNum;
  595. let that = this
  596. this.eventList = []
  597. //右侧获取事件列表
  598. getEventList({day: day,
  599. eventTypeIdDl: [bigEventTypeId],
  600. eventTypeId: [smallEventTypeId],
  601. pageSize: pageSize, pageNum: pageNum, eventName: eventSearch}, loading).then(res => {
  602. this.eventList = res.data
  603. if (this.eventList != null && this.eventList.length > 0) {
  604. if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
  605. that.$refs.bottomMenu.updateAlert();
  606. that.$refs.up.play();
  607. } else {
  608. that.$refs.bottomMenu.updateAlertFalse();
  609. }
  610. }
  611. })
  612. },
  613. stopAudio(){
  614. this.$refs.up.pause();//停止播放音乐
  615. this.$refs.up.currentTime = 0;
  616. },
  617. /** ----------------------------------weosocket开始------------------------------------- */
  618. initWebSocket() { //初始化weosocket
  619. const wsuri = 'wss://www.hmzzxc.com:10012/websocket/forest-' + Cookies.get('username')
  620. this.websock = new WebSocket(wsuri)
  621. console.log('建立websocket连接')
  622. this.websock.onopen = this.websocketonopen
  623. this.websock.onmessage = this.websocketonmessage
  624. this.websock.onerror = this.websocketonerror
  625. this.websock.onclose = this.websocketclose
  626. this.websock.onclose = this.websocketclose
  627. },
  628. websocketonopen() { //连接建立之后执行send方法发送数据
  629. console.log('websocket连接成功')
  630. this.weosocket = true
  631. this.sendPing()
  632. },
  633. websocketonerror() { //连接建立失败重连
  634. this.initWebSocket()
  635. },
  636. websocketonmessage(e) { //数据接收
  637. console.log('接收数据', e.data)
  638. },
  639. websocketsend(Data) { //数据发送
  640. this.websock.send(Data)
  641. },
  642. websocketclose(e) { //关闭
  643. console.log('断开连接', e)
  644. // clearInterval(this.setIntervalWesocketPush)
  645. this.weosocket = false
  646. },
  647. /**发送心跳
  648. * @param {number} time 心跳间隔毫秒 默认5000
  649. * @param {string} ping 心跳名称 默认字符串ping
  650. */
  651. sendPing(time = 5000, ping = {
  652. 'fromId': 'forest',
  653. 'fromUserId': Cookies.get('username'),
  654. 'toUserId': Cookies.get('username')
  655. }) {
  656. clearInterval(this.setIntervalWesocketPush)
  657. this.websock.send(JSON.stringify(ping))
  658. this.setIntervalWesocketPush = setInterval(() => {
  659. if (this.weosocket) {
  660. this.websock.send(JSON.stringify(ping))
  661. } else {
  662. this.initWebSocket()
  663. }
  664. }, time)
  665. },
  666. /** ----------------------------------weosocket结束------------------------------------- */
  667. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  668. bottomMenuList() {
  669. this.$refs.bottomMenu.selectTaskList()//获取任务列表
  670. this.$refs.bottomMenu.selectMessageList()//获取消息列表
  671. },
  672. showDialog(click) {
  673. if (click == 'eventLocation') {
  674. this.$refs.eventLocation.showEventLocation()
  675. this.$refs.supermap.isEditableLayers = false
  676. this.$refs.bottomMenu.showChild = false
  677. this.$refs.bottomMenu.showBanChild = false
  678. this.$refs.bottomMenu.showChangChild = false
  679. } else if (click == 'editableLayers') {
  680. this.$refs.bottomMenu.showChild = false
  681. this.$refs.bottomMenu.showBanChild = false
  682. this.$refs.bottomMenu.showChangChild = false
  683. if (!this.$refs.supermap.isEditableLayers) {
  684. this.$refs.supermap.isEditableLayers = true
  685. } else {
  686. this.$refs.supermap.isEditableLayers = false
  687. }
  688. } else if (click == 'layerSwitching') {
  689. this.$refs.supermap.isEditableLayers = false
  690. this.$refs.bottomMenu.showBanChild = false
  691. this.$refs.bottomMenu.showChangChild = false
  692. if (!this.$refs.bottomMenu.showChild) {
  693. this.$refs.bottomMenu.showChild = true
  694. } else {
  695. this.$refs.bottomMenu.showChild = false
  696. }
  697. } else if (click == 'TVWall') {
  698. this.$refs.TVWall.showTVWall()
  699. this.$refs.supermap.isEditableLayers = false
  700. this.$refs.bottomMenu.showChild = false
  701. this.$refs.bottomMenu.showBanChild = false
  702. this.$refs.bottomMenu.showChangChild = false
  703. } else if (click == 'forestban') {
  704. this.$refs.supermap.isEditableLayers = false
  705. this.$refs.bottomMenu.showChild = false
  706. this.$refs.bottomMenu.showChangChild = false
  707. if (!this.$refs.bottomMenu.showBanChild) {
  708. this.$refs.bottomMenu.showBanChild = true
  709. } else {
  710. this.$refs.bottomMenu.showBanChild = false
  711. }
  712. } else if (click == 'forestchang') {
  713. this.$refs.supermap.isEditableLayers = false
  714. this.$refs.bottomMenu.showBanChild = false
  715. this.$refs.bottomMenu.showChild = false
  716. if (!this.$refs.bottomMenu.showChangChild) {
  717. this.$refs.bottomMenu.showChangChild = true
  718. } else {
  719. this.$refs.bottomMenu.showChangChild = false
  720. }
  721. }
  722. },
  723. //选择图层
  724. choseLayerSwitching(url, isClear) {
  725. this.$refs.supermap.layerSwitching(url, isClear)
  726. },
  727. //选择图层(传递数组)
  728. choseLayerSwitchingList(urlList) {
  729. this.$refs.supermap.layerSwitchingList(urlList)
  730. },
  731. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  732. }
  733. }
  734. </script>
  735. <style rel="stylesheet/scss" lang="scss" scoped>
  736. @import '@/assets/styles/base.scss';
  737. .paging {
  738. padding: .5rem .3rem;
  739. display: flex;
  740. justify-content: center;
  741. align-content: center;
  742. span {
  743. color: #2bacf7;
  744. display: flex;
  745. align-items: center;
  746. padding: 0 1rem;
  747. }
  748. button {
  749. padding: 0 0.3rem;
  750. height: 1.5rem;
  751. background-color: #112543;
  752. color: #2bacf7;
  753. border: 1px solid #33467f;
  754. }
  755. button:hover {
  756. padding: 0 0.3rem;
  757. height: 1.5rem;
  758. background-color: #112543;
  759. color: #0ff7c5;
  760. border: 1px solid #1d657f;
  761. }
  762. }
  763. </style>