forest.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  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. <!-- 1 基本情况 -->
  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="this-title">
  15. <span>基本情况</span>
  16. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  17. </div>
  18. <div class="i-list-con h-14">
  19. <div class="d-l-con">
  20. <div class="d-l-l-text w-100p">
  21. <h4 class="line-h-1 w-100p">{{ forestInfo }}</h4>
  22. </div>
  23. </div>
  24. </div>
  25. </dv-border-box-13>
  26. </div>
  27. <!-- 2 事件统计-->
  28. <div class="forthis">
  29. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  30. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  31. <div class="i-list-con h-29-5">
  32. <div class="d-l-con">
  33. <div class="event-count">
  34. <div class="count-number">{{ totalStr.charAt(0) }}</div>
  35. <div class="count-number">{{ totalStr.charAt(1) }}</div>
  36. <div class="count-number">{{ totalStr.charAt(2) }}</div>
  37. <div class="count-number">{{ totalStr.charAt(3) }}</div>
  38. <div class="count-number">{{ totalStr.charAt(4) }}</div>
  39. <div class="count-number">{{ totalStr.charAt(5) }}</div>
  40. <dv-decoration-5
  41. style="width:81%;height:15px;position: absolute; top:4.2rem;z-index: 0; "/>
  42. </div>
  43. </div>
  44. <div class="d-l-con-icon">
  45. <div class="icon-con w-33 flex-d t-a-center">
  46. <dv-decoration-9
  47. style="width: 5.5rem;height: 5.5rem; color:#16e29e;font-size: 1rem;font-weight: bolder;">
  48. {{ newReport_pre }}%
  49. </dv-decoration-9>
  50. <div class="e-state"
  51. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  52. <span>新上报</span> <span>{{ newReport }}</span>
  53. </div>
  54. </div>
  55. <div class="icon-con w-33 flex-d t-a-center">
  56. <dv-decoration-9
  57. style="width: 5.5rem;height: 5.5rem; color:#f18425;font-size: 1rem;font-weight: bolder;">
  58. {{ readySure_pre }}%
  59. </dv-decoration-9>
  60. <div class="e-state"
  61. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  62. <span>处理中</span> <span>{{ readySure }}</span>
  63. </div>
  64. </div>
  65. <div class="icon-con w-33 flex-d t-a-center">
  66. <dv-decoration-9
  67. style="width: 5.5rem;height: 5.5rem; color:#9179f1;font-size: 1rem;font-weight: bolder;">
  68. {{ readyFinish_pre }}%
  69. </dv-decoration-9>
  70. <div class="e-state"
  71. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  72. <span>已完成</span> <span>{{ readyFinish }}</span>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="d-l-con">
  77. <div id="chart-event-ai" style="width: 100%;height:6vh;"></div>
  78. </div>
  79. </div>
  80. </dv-border-box-13>
  81. </div>
  82. <!-- 3 组织机构 -->
  83. <div class="forthis">
  84. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  85. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  86. <div class="i-list-con h-27" style="padding-left: 1rem;">
  87. <el-collapse accordion>
  88. <el-collapse-item v-for="(item,index) in forestFarm" :key="index">
  89. <!-- deptId -->
  90. <template slot="title">
  91. <div class="d-l-con sj-collapse" :class="{on:listCurrentIndex1==item.deptId}"
  92. v-on:click="selectCameraByDeptId(item.deptId)">
  93. <div class="d-l-l-text">
  94. <h4 class="collapse-title">{{ item.deptName }}</h4>
  95. </div>
  96. <div class="d-l-l-count">{{ item.eventCount }}</div>
  97. </div>
  98. </template>
  99. </el-collapse-item>
  100. </el-collapse>
  101. </div>
  102. </dv-border-box-13>
  103. </div>
  104. </div>
  105. <!-- 地图 -->
  106. <supermap ref="supermap" style="width: 100%;height: 100vh;" :mapDiv="'forestMap'" :dynamicPlotting="false"
  107. :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"
  108. @showEventDialog="showEventDialog"/>
  109. <!-- 右侧 -->
  110. <div class="rightbar rightbar-index" ref="right">
  111. <div class="right-item1">
  112. <!-- 天气 -->
  113. <div class="forthis">
  114. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)">
  115. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  116. <div class="i-list-con small-bottom-margin h-13">
  117. <el-row :gutter="20" v-if="todatWeather">
  118. <el-col :span="9">
  119. <div class="weather-img">
  120. <img src="../assets/images/integrated/weather/yin.png">
  121. <span>{{ weatherinformationWeather }}</span>
  122. </div>
  123. </el-col>
  124. <el-col :span="15">
  125. <div class="weather-info">
  126. <ul>
  127. <li>风力:{{ weatherinformationPower }}级</li>
  128. <li>低温:{{ weatherinformationLow }}℃</li>
  129. <li>风向:{{ weatherinformationDirection }}</li>
  130. <li>高温:{{ weatherinformationHigh }}℃</li>
  131. <li>火险:{{ weatherinformationLevel }}</li>
  132. <li>湿度:{{ weatherinformationTemperature }}</li>
  133. </ul>
  134. </div>
  135. </el-col>
  136. </el-row>
  137. <el-row :gutter="20" v-else>
  138. <el-col :span="24">
  139. <div class="weather-img">
  140. 暂无天气信息!
  141. </div>
  142. </el-col>
  143. </el-row>
  144. <div class="firestate">
  145. <div class="state-block1"></div>
  146. <div class="state-block2"></div>
  147. <div class="state-block3 state-on"></div>
  148. <div class="state-block4"></div>
  149. <div class="state-block5"></div>
  150. </div>
  151. </div>
  152. </dv-border-box-13>
  153. </div>
  154. <!-- 曝光台 -->
  155. <div class="forthis">
  156. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  157. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  158. <div class="this-title">
  159. <span>曝光台</span>
  160. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  161. </div>
  162. <div class="i-list-con small-bottom-margin h-18">
  163. <div class="d-l-con padding-box nowrap" v-for="(item,index) in exposureStageList">
  164. <div class="bgt-state">
  165. <div class="bgt-state-frequency">{{ item.urgeCount }}</div>
  166. <div class="bgt-state-minute">{{item.timeDiff}}分钟</div>
  167. </div>
  168. <div class="bgt-info">
  169. <div class="bgt-info-name">{{ item.eventName }}</div>
  170. <div class="bgt-info-place">
  171. <ul>
  172. <li>{{ item.deptNames }}</li>
  173. </ul>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </dv-border-box-13>
  179. </div>
  180. <!-- 事件列表 -->
  181. <div class="forthis">
  182. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  183. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  184. <div class="this-title">
  185. <span>事件列表</span>
  186. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  187. </div>
  188. <div class="i-list-con small-bottom-margin h-39">
  189. <div class="event-list-search">
  190. <el-input
  191. placeholder="请输入内容"
  192. prefix-icon="el-icon-search"
  193. v-model="eventSearch" @change="searchEvent(eventSearch)">
  194. </el-input>
  195. </div>
  196. <div class="d-l-con padding-box nowrap" v-for="(item,index) in eventList" @click="dropLocation(item.latitude,item.longitude)">
  197. <div class="bgt-img">
  198. <img v-if="item.picturePath!=null&&item.picturePath!=''" :src="item.picturePath" style="width: 93px;height: 64px"/>
  199. <img v-else src="../assets/images/integrated/event-img-sub.png" style="width: 93px;height: 64px"/>
  200. </div>
  201. <div class="bgt-info">
  202. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount==0" class="event-state-sb">
  203. <i class="el-icon-caret-left"></i>
  204. <div class="event-list-state-sb">
  205. 新上报
  206. </div>
  207. </div>
  208. <div v-if="item.eventStatusValue=='forest_event_status_1'&&item.urgeCount>0" class="event-state-cb">
  209. <i class="el-icon-caret-left"></i>
  210. <div class="event-list-state-cb">
  211. 催办
  212. </div>
  213. </div>
  214. <div v-if="item.eventStatusValue=='forest_event_status_2'" class="event-state-qs">
  215. <i class="el-icon-caret-left"></i>
  216. <div class="event-list-state-qs">
  217. 签收
  218. </div>
  219. </div>
  220. <div v-if="item.eventStatusValue=='forest_event_status_3'" class="event-state-wb">
  221. <i class="el-icon-caret-left"></i>
  222. <div class="event-list-state-wb">
  223. 误报
  224. </div>
  225. </div>
  226. <div v-if="item.eventStatusValue=='forest_event_status_4'" class="event-state-cf">
  227. <i class="el-icon-caret-left"></i>
  228. <div class="event-list-state-cf">
  229. 重复
  230. </div>
  231. </div>
  232. <div v-if="item.eventStatusValue=='forest_event_status_5'" class="event-state-bj">
  233. <i class="el-icon-caret-left"></i>
  234. <div class="event-list-state-bj">
  235. 办结
  236. </div>
  237. </div>
  238. <div v-if="item.eventStatusValue=='forest_event_status_6'" class="event-state-gd">
  239. <i class="el-icon-caret-left"></i>
  240. <div class="event-list-state-gd">
  241. 归档
  242. </div>
  243. </div>
  244. <div class="bgt-info-name">{{ item.reportor }} {{ item.eventName }}</div>
  245. <div class="bgt-info-place">
  246. <ul>
  247. <li>{{ item.reportTime }}</li>
  248. </ul>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </dv-border-box-13>
  254. </div>
  255. </div>
  256. <div class="right-item2">
  257. <!-- 日历 -->
  258. <div class="forthis">
  259. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  260. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  261. <div class="i-list-con small-bottom-margin h-30">
  262. <dateChoose @selectDay="selectDay"></dateChoose>
  263. </div>
  264. </dv-border-box-13>
  265. </div>
  266. <!-- 事件分类 -->
  267. <div class="forthis">
  268. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  269. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  270. <div class="this-title">
  271. <span>事件分类</span>
  272. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  273. </div>
  274. <div class="i-list-con small-bottom-margin h-19">
  275. <dv-capsule-chart :config="eventKind" style="width: 90%;height: 18vh; padding:.5rem 1rem"/>
  276. </div>
  277. </dv-border-box-13>
  278. </div>
  279. <!-- 上报排行 -->
  280. <div class="forthis">
  281. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  282. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  283. <div class="this-title">
  284. <span>上报排行</span>
  285. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  286. </div>
  287. <div class="i-list-con small-bottom-margin h-19">
  288. <dv-scroll-ranking-board :config="reportList" style="width: 100%;height: 20vh; padding:.5rem 1rem"/>
  289. </div>
  290. </dv-border-box-13>
  291. </div>
  292. </div>
  293. </div>
  294. <vBottomMenu ref="bottomMenu"></vBottomMenu>
  295. </div>
  296. <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="calendarDay" @getEventList="getEventList" @getTodayEvents="getTodayEvents"></eventdetailsdialog>
  297. <eventLocation ref="eventLocation"></eventLocation>
  298. <TVWall ref="TVWall"></TVWall>
  299. </div>
  300. </template>
  301. <script>
  302. import dateChoose from '@/views/date.vue'//日历
  303. /** ----------------------------------weosocket开始------------------------------------- */
  304. import Cookies from 'js-cookie'
  305. /** ----------------------------------weosocket结束------------------------------------- */
  306. import {
  307. getBaseInfo,
  308. getTodayEvents,
  309. getDeptEventCount,
  310. getWeather,
  311. getEventList,
  312. getEventByEventType,
  313. getEventByReportorOrder,
  314. getExposureStage
  315. } from '@/api/forest'
  316. import supermap from '@/components/supermap' //超图
  317. import supermapNotProcessed from '@/components/supermap' //超图
  318. import supermapProcessed from '@/components/supermap' //超图
  319. import vheader from '@/components/v-header.vue' //一体化共用头部
  320. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  321. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  322. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  323. import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
  324. /** ----------------------------------摄像头预览开始------------------------------------- */
  325. import {
  326. getDahuaVideoServer
  327. } from '@/api/dahua/dahua'
  328. import DHWs from '@/dahua/lib/DHWs'
  329. /** ----------------------------------摄像头预览结束------------------------------------- */
  330. let echarts = require('echarts')
  331. export default {
  332. components: {
  333. supermap,
  334. supermapNotProcessed,
  335. supermapProcessed,
  336. vheader,
  337. vBottomMenu,
  338. eventLocation,
  339. TVWall,
  340. dateChoose,
  341. eventdetailsdialog
  342. },
  343. created() {
  344. /** ----------------------------------摄像头预览开始------------------------------------- */
  345. const DHWsInstance = DHWs.getInstance()
  346. this.ws = DHWsInstance
  347. /** ----------------------------------摄像头预览结束------------------------------------- */
  348. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  349. window.showDialog = this.showDialog
  350. window.choseLayerSwitching = this.choseLayerSwitching
  351. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  352. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  353. },
  354. mounted() {
  355. this.getBaseInfo()
  356. this.getTodayEvents(this.getCurrentDataStr())
  357. this.getDeptEventCount(this.getCurrentDataStr())
  358. this.getWeather(this.getCurrentDataStr())
  359. this.getEventList(this.getCurrentDataStr())
  360. this.getEventByEventType(this.getCurrentDataStr())
  361. this.getEventByReportorOrder(this.getCurrentDataStr())
  362. this.getExposureStage(this.getCurrentDataStr())
  363. /** ----------------------------------weosocket开始------------------------------------- */
  364. // this.initWebSocket()
  365. /** ----------------------------------weosocket结束------------------------------------- */
  366. this.selectTaskList()//获取任务
  367. },
  368. data() {
  369. return {
  370. calendarDay:this.getCurrentDataStr(),
  371. //基本情况
  372. forestInfo: '', //基本情况
  373. //左侧获取事件信息统计
  374. totalStr: '',
  375. aiTotal: '',
  376. newReport: '',
  377. otherTotal: '',
  378. readyFinish: '',
  379. readySure: '',
  380. total: '',
  381. aiTotal_pre: '',
  382. newReport_pre: '',
  383. otherTotal_pre: '',
  384. readyFinish_pre: '',
  385. readySure_pre: '',
  386. //左侧部门事件数量
  387. forestFarm: [],
  388. //右侧天气
  389. todatWeather:false,
  390. weatherinformationDirection: '',
  391. weatherinformationHigh: '',
  392. weatherinformationLevel: '',
  393. weatherinformationLow: '',
  394. weatherinformationPower: '',
  395. weatherinformationTemperature: '',
  396. weatherinformationTime: '',
  397. weatherinformationWeather: '',
  398. //右侧曝光台
  399. exposureStageList:[],
  400. //右侧事件列表
  401. eventList: [],
  402. eventListnew: [],
  403. eventListAll: [],
  404. eventSearch: '',//事件列表搜索
  405. listCurrentIndex1: '',
  406. // ----------------------------------事件分类柱状----------------------------------------
  407. eventKind: {},
  408. // ----------------------------------上报排行----------------------------------------
  409. reportList: {
  410. data: []
  411. },
  412. /** ----------------------------------weosocket开始------------------------------------- */
  413. weosocket: false,
  414. websock: '',
  415. setIntervalWesocketPush: null,
  416. /** ----------------------------------weosocket结束------------------------------------- */
  417. /** ----------------------------------摄像头预览开始------------------------------------- */
  418. activePanel: 'key1',
  419. isLogin: false,
  420. cameraParams: [],
  421. ws: null,
  422. /** ----------------------------------摄像头预览结束------------------------------------- */
  423. markersList: [], //点位列表
  424. cameraList: [] //摄像头列表
  425. }
  426. },
  427. /** ----------------------------------weosocket开始------------------------------------- */
  428. destroyed() { //离开页面关闭Socket连接
  429. if (this.websock) {
  430. clearInterval(this.setIntervalWesocketPush)
  431. this.websock.close()
  432. this.websock = null
  433. }
  434. },
  435. /** ----------------------------------weosocket结束------------------------------------- */
  436. methods: {
  437. searchEvent(eventSearch) {
  438. let that = this
  439. //事件列表搜索
  440. this.eventListnew = [];
  441. if(eventSearch!=null&&eventSearch!=""){
  442. for (var i = 0; i < this.eventListAll.length; i++) {
  443. if (this.eventListAll[i].reportor.indexOf(eventSearch)>-1) {
  444. this.eventListnew.push(this.eventListAll[i]);
  445. }
  446. }
  447. this.eventList=this.eventListnew
  448. }else{
  449. this.eventList=this.eventListAll
  450. }
  451. if (this.eventList != null && this.eventList.length > 0) {
  452. for (let i = 0; i < this.eventList.length; i++) {
  453. let markersMap = {
  454. lng: 124.59,
  455. lat: 43.02,
  456. icon: 'marker',
  457. bindPopupHtml: '',
  458. click: '',
  459. parameter: '',
  460. keepBindPopup: false,
  461. isAggregation: false
  462. }
  463. if (this.eventList.length > 50) {
  464. markersMap.isAggregation = true
  465. }
  466. if (this.eventList[i].eventStatusValue == 'forest_event_status_1') {
  467. markersMap.click = 'showEventDialog'
  468. markersMap.icon = 'sj-icon-map-wcl'
  469. markersMap.isAggregation = false
  470. } else if ( this.eventList[i].eventStatusValue == 'forest_event_status_2' || this.eventList[i].eventStatusValue == 'forest_event_status_3' || this.eventList[i].eventStatusValue == 'forest_event_status_4' || this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  471. markersMap.click = 'showEventDialog'
  472. markersMap.icon = 'sj-icon-map-clz'
  473. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  474. markersMap.click = 'showEventDialog'
  475. markersMap.icon = 'sj-icon-map-ywc'
  476. } else {
  477. markersMap.click = 'showEventDialog'
  478. markersMap.icon = 'sj-icon-map-clz'
  479. }
  480. markersMap.parameter = this.eventList[i].eventCode
  481. markersMap.lng = this.eventList[i].longitude
  482. markersMap.lat = this.eventList[i].latitude
  483. markersMap.bindPopupHtml = '<div class="map-tip">' +
  484. '<span>' +
  485. ' <div class="d-l-con">' +
  486. ' <div class="d-l-l-text">' +
  487. ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  488. ' </div>' +
  489. ' </div>' +
  490. ' </span>' +
  491. '<span>' +
  492. ' <div class="d-l-con">' +
  493. ' <div class="d-l-l-text">' +
  494. ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  495. ' </div>' +
  496. ' </div>' +
  497. ' </span>' +
  498. '<span>' +
  499. ' <div class="d-l-con">' +
  500. ' <div class="d-l-l-text">' +
  501. ' <h4>事件时间:' + this.eventList[i].reportTime + '</h4>' +
  502. ' </div>' +
  503. ' </div>' +
  504. ' </span>' +
  505. '</div>'
  506. that.markersList.push(markersMap)
  507. }
  508. setTimeout(() => {
  509. that.$refs.supermap.clearM(false)
  510. that.$refs.supermap.clearM(true)
  511. that.$refs.supermap.setMarkers(that.markersList)
  512. }, 1000)
  513. } else {
  514. setTimeout(() => {
  515. that.$refs.supermap.clearM(false)
  516. that.$refs.supermap.clearM(true)
  517. }, 1000)
  518. }
  519. },
  520. dropLocation(lat, lng){
  521. this.$refs.supermap.dropLocation(lat, lng)
  522. },
  523. showEventDialog(eventCode) {
  524. //事件信息弹出
  525. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  526. },
  527. getCurrentDataStr() {
  528. let date = new Date()
  529. let y = date.getFullYear()
  530. let m = date.getMonth() + 1
  531. m = m < 10 ? '0' + m : m
  532. let d = date.getDate()
  533. d = d < 10 ? '0' + d : d
  534. return y + '-' + m + '-' + d
  535. },
  536. selectDay(day) {//日历点击
  537. this.getTodayEvents(day)
  538. this.getDeptEventCount(day)
  539. this.getWeather(day)
  540. this.getEventList(day)
  541. this.getEventByEventType(day)
  542. this.getEventByReportorOrder(day)
  543. this.getExposureStage(day)
  544. this.calendarDay=day
  545. },
  546. //事件数量统计chart 样例地址http://192.144.199.210:8080/editor/index.html?chart_id=jTXf0Rv4A3oiBONB
  547. eventChartAi(aiTotal_pre, otherTotal_pre) {
  548. // 基于准备好的dom,初始化echarts实例
  549. let myChart = echarts.init(document.getElementById('chart-event-ai'))
  550. myChart.setOption({
  551. tooltip: {
  552. trigger: 'none'
  553. },
  554. grid: {
  555. top: '65%',
  556. left: '5%',
  557. right: '5%'
  558. },
  559. yAxis: {
  560. data: ['百分比'],
  561. axisTick: {
  562. show: false
  563. },
  564. axisLine: {
  565. show: false
  566. },
  567. axisLabel: {
  568. show: false
  569. }
  570. },
  571. xAxis: {
  572. splitLine: {
  573. show: false
  574. },
  575. axisTick: {
  576. show: false
  577. },
  578. axisLine: {
  579. show: false
  580. },
  581. axisLabel: {
  582. show: false
  583. }
  584. },
  585. legend: {
  586. data: ['AI', '其他'],
  587. bottom: '5%',
  588. textStyle: {
  589. color: '#1FC3CE',
  590. fontSize: 14
  591. }
  592. },
  593. series: [{
  594. // name: '最上层立体圆',
  595. type: 'pictorialBar',
  596. symbolSize: [10, 20],
  597. symbolOffset: [2, 0],
  598. z: 12,
  599. itemStyle: {
  600. normal: {
  601. color: '#293CA0'
  602. }
  603. },
  604. data: [{
  605. value: 100,
  606. symbolPosition: 'end'
  607. }]
  608. }, {
  609. // name: '中间立体圆',
  610. type: 'pictorialBar',
  611. symbolSize: [10, 20],
  612. symbolOffset: [2, 0],
  613. z: 12,
  614. itemStyle: {
  615. normal: {
  616. color: '#45ac8d'
  617. }
  618. },
  619. data: [{
  620. value: aiTotal_pre,
  621. symbolPosition: 'end'
  622. }]
  623. }, {
  624. // name: '最底部立体圆',
  625. type: 'pictorialBar',
  626. symbolSize: [10, 20],
  627. symbolOffset: [-4, 0],
  628. z: 12,
  629. itemStyle: {
  630. normal: {
  631. color: '#196d59'
  632. }
  633. },
  634. data: [otherTotal_pre]
  635. }, {
  636. name: 'AI',
  637. //底部立体柱
  638. stack: '1',
  639. type: 'bar',
  640. itemStyle: {
  641. normal: {
  642. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  643. offset: 0,
  644. color: '#29ac8f'
  645. }, {
  646. offset: 1,
  647. color: '#0a3f3f'
  648. }])
  649. }
  650. },
  651. label: {
  652. normal: {
  653. show: true,
  654. position: 'inside',
  655. offset: [0, 1],
  656. formatter: function(obj) {
  657. return (obj.value).toLocaleString() + '%'
  658. },
  659. textStyle: {
  660. align: 'center',
  661. baseline: 'middle',
  662. fontSize: 14,
  663. fontWeight: '400',
  664. color: '#fff',
  665. textShadowColor: '#000',
  666. textShadowBlur: '0',
  667. textShadowOffsetX: 1,
  668. textShadowOffsetY: 1
  669. }
  670. }
  671. },
  672. silent: true,
  673. barWidth: 20,
  674. barGap: '-100%', // Make series be overlap
  675. data: [aiTotal_pre]
  676. }, {
  677. name: '其他',
  678. //上部立体柱
  679. stack: '1',
  680. type: 'bar',
  681. itemStyle: {
  682. normal: {
  683. color: '#14257B',
  684. opacity: .7
  685. }
  686. },
  687. silent: true,
  688. barWidth: 20,
  689. barGap: '-100%', // Make series be overlap
  690. data: [otherTotal_pre],
  691. // itemStyle: {
  692. // normal: {
  693. // color: 'rgba(29,67,243,1)',
  694. // }
  695. // },
  696. label: {
  697. normal: {
  698. show: true,
  699. position: 'inside',
  700. offset: [0, 1],
  701. formatter: function(obj) {
  702. return (obj.value).toLocaleString() + '%'
  703. },
  704. textStyle: {
  705. align: 'center',
  706. baseline: 'middle',
  707. fontSize: 14,
  708. fontWeight: '400',
  709. color: '#fff',
  710. textShadowColor: '#000',
  711. textShadowBlur: '0',
  712. textShadowOffsetX: 1,
  713. textShadowOffsetY: 1
  714. }
  715. }
  716. }
  717. }]
  718. })
  719. },
  720. selectTaskList(){
  721. this.$refs.bottomMenu.selectTaskList();
  722. },
  723. getBaseInfo() {
  724. //左侧获取部门信息
  725. getBaseInfo().then(res => {
  726. if(res.code==200){
  727. if(res.msg=="未找到部门信息"){
  728. this.forestInfo='未找到部门信息!'
  729. }else{
  730. this.forestInfo = res.data.baseinfo //基本情况
  731. }
  732. }
  733. })
  734. },
  735. getTodayEvents(day) {
  736. let that = this
  737. //左侧获取事件信息统计
  738. getTodayEvents({ day: day }).then(res => {
  739. this.aiTotal = res.data.aiTotal
  740. this.aiTotal_pre = res.data.aiTotal_pre
  741. this.newReport = res.data.newReport
  742. this.newReport_pre = res.data.newReport_pre
  743. this.otherTotal = res.data.otherTotal
  744. this.otherTotal_pre = res.data.otherTotal_pre
  745. this.readyFinish = res.data.readyFinish
  746. this.readyFinish_pre = res.data.readyFinish_pre
  747. this.readySure = res.data.readySure
  748. this.readySure_pre = res.data.readySure_pre
  749. this.totalStr = res.data.totalStr
  750. this.total = res.data.total
  751. this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
  752. })
  753. },
  754. getDeptEventCount(day) {
  755. let that = this
  756. //左侧获取事件部门数量
  757. getDeptEventCount({ day: day }).then(res => {
  758. this.forestFarm = res.data
  759. })
  760. },
  761. getWeather(day) {
  762. let that = this
  763. //右侧获取天气信息
  764. getWeather({ day: day }).then(res => {
  765. if(res.code==200){
  766. if(res.msg=="天气未添加"){
  767. this.todatWeather=false
  768. }else{
  769. this.todatWeather=true
  770. this.weatherinformationDirection = res.data.weatherinformationDirection
  771. this.weatherinformationHigh = res.data.weatherinformationHigh
  772. this.weatherinformationLevel = res.data.weatherinformationLevel
  773. this.weatherinformationLow = res.data.weatherinformationLow
  774. this.weatherinformationPower = res.data.weatherinformationPower
  775. this.weatherinformationTemperature = res.data.weatherinformationTemperature
  776. this.weatherinformationTime = res.data.weatherinformationTime
  777. this.weatherinformationWeather = res.data.weatherinformationWeather
  778. }
  779. }else{
  780. this.todatWeather=false
  781. }
  782. })
  783. },
  784. getEventList(day) {
  785. let that = this
  786. this.eventList = []
  787. this.eventListAll = []
  788. //右侧获取事件列表
  789. getEventList({ day: day }).then(res => {
  790. this.eventList = res.data
  791. this.eventListAll = res.data
  792. that.markersList = []
  793. if (this.eventList != null && this.eventList.length > 0) {
  794. for (let i = 0; i < this.eventList.length; i++) {
  795. let markersMap = {
  796. lng: 124.59,
  797. lat: 43.02,
  798. icon: 'marker',
  799. bindPopupHtml: '',
  800. click: '',
  801. parameter: '',
  802. keepBindPopup: false,
  803. isAggregation: false
  804. }
  805. if (this.eventList.length > 50) {
  806. markersMap.isAggregation = true
  807. }
  808. if (this.eventList[i].eventStatusValue == 'forest_event_status_1') {
  809. if(this.eventList[i].urgeCount>0){
  810. markersMap.click = 'showEventDialog'
  811. markersMap.icon = 'sj-icon-map-wcl'
  812. markersMap.isAggregation = false
  813. }else{
  814. markersMap.click = 'showEventDialog'
  815. markersMap.icon = 'sj-icon-map-wcl'
  816. markersMap.isAggregation = false
  817. }
  818. } else if ( this.eventList[i].eventStatusValue == 'forest_event_status_2' || this.eventList[i].eventStatusValue == 'forest_event_status_3' || this.eventList[i].eventStatusValue == 'forest_event_status_4' || this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  819. markersMap.click = 'showEventDialog'
  820. markersMap.icon = 'sj-icon-map-clz'
  821. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  822. markersMap.click = 'showEventDialog'
  823. markersMap.icon = 'sj-icon-map-ywc'
  824. } else {
  825. markersMap.click = 'showEventDialog'
  826. markersMap.icon = 'sj-icon-map-clz'
  827. }
  828. markersMap.parameter = this.eventList[i].eventCode
  829. markersMap.lng = this.eventList[i].longitude
  830. markersMap.lat = this.eventList[i].latitude
  831. markersMap.bindPopupHtml = '<div class="map-tip">' +
  832. '<span>' +
  833. ' <div class="d-l-con">' +
  834. ' <div class="d-l-l-text">' +
  835. ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  836. ' </div>' +
  837. ' </div>' +
  838. ' </span>' +
  839. '<span>' +
  840. ' <div class="d-l-con">' +
  841. ' <div class="d-l-l-text">' +
  842. ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  843. ' </div>' +
  844. ' </div>' +
  845. ' </span>' +
  846. '<span>' +
  847. ' <div class="d-l-con">' +
  848. ' <div class="d-l-l-text">' +
  849. ' <h4>事件时间:' + this.eventList[i].reportTime + '</h4>' +
  850. ' </div>' +
  851. ' </div>' +
  852. ' </span>' +
  853. '</div>'
  854. that.markersList.push(markersMap)
  855. }
  856. setTimeout(() => {
  857. that.$refs.supermap.clearM(false)
  858. that.$refs.supermap.clearM(true)
  859. that.$refs.supermap.setMarkers(that.markersList)
  860. }, 1000)
  861. } else {
  862. setTimeout(() => {
  863. that.$refs.supermap.clearM(false)
  864. that.$refs.supermap.clearM(true)
  865. }, 1000)
  866. }
  867. })
  868. },
  869. getEventByEventType(day) {
  870. let that = this
  871. //右侧获取事件分类
  872. getEventByEventType({ day: day }).then(res => {
  873. if (res.data != null && res.data.length > 0) {
  874. this.eventKind.data = res.data
  875. this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
  876. this.eventKind.showValue = true
  877. this.eventKind = { ...this.eventKind }
  878. } else {
  879. this.eventKind={}
  880. this.eventKind = { ...this.eventKind }
  881. }
  882. })
  883. },
  884. getEventByReportorOrder(day) {
  885. let that = this
  886. //右侧获取上报排名
  887. getEventByReportorOrder({ day: day }).then(res => {
  888. if (res.data != null && res.data.length > 0) {
  889. this.reportList.data = res.data
  890. this.reportList = { ...this.reportList }
  891. } else {
  892. this.reportList.data = []
  893. this.reportList = { ...this.reportList }
  894. }
  895. })
  896. },
  897. getExposureStage(day) {
  898. let that = this
  899. //右侧获取曝光台
  900. getExposureStage({ day: day }).then(res => {
  901. this.exposureStageList = res.data
  902. })
  903. },
  904. /** ----------------------------------weosocket开始------------------------------------- */
  905. initWebSocket() { //初始化weosocket
  906. const wsuri = 'wss://www.hmzzxc.com:10012/websocket/forest-' + Cookies.get('username')
  907. this.websock = new WebSocket(wsuri)
  908. console.log('建立websocket连接')
  909. this.websock.onopen = this.websocketonopen
  910. this.websock.onmessage = this.websocketonmessage
  911. this.websock.onerror = this.websocketonerror
  912. this.websock.onclose = this.websocketclose
  913. this.websock.onclose = this.websocketclose
  914. },
  915. websocketonopen() { //连接建立之后执行send方法发送数据
  916. console.log('websocket连接成功')
  917. this.weosocket = true
  918. this.sendPing()
  919. },
  920. websocketonerror() { //连接建立失败重连
  921. this.initWebSocket()
  922. },
  923. websocketonmessage(e) { //数据接收
  924. console.log('接收数据', e.data)
  925. },
  926. websocketsend(Data) { //数据发送
  927. this.websock.send(Data)
  928. },
  929. websocketclose(e) { //关闭
  930. console.log('断开连接', e)
  931. // clearInterval(this.setIntervalWesocketPush)
  932. this.weosocket = false
  933. },
  934. /**发送心跳
  935. * @param {number} time 心跳间隔毫秒 默认5000
  936. * @param {string} ping 心跳名称 默认字符串ping
  937. */
  938. sendPing(time = 5000, ping = {
  939. 'fromId': 'forest',
  940. 'fromUserId': Cookies.get('username'),
  941. 'toUserId': Cookies.get('username')
  942. }) {
  943. clearInterval(this.setIntervalWesocketPush)
  944. this.websock.send(JSON.stringify(ping))
  945. this.setIntervalWesocketPush = setInterval(() => {
  946. if (this.weosocket) {
  947. this.websock.send(JSON.stringify(ping))
  948. } else {
  949. this.initWebSocket()
  950. }
  951. }, time)
  952. },
  953. /** ----------------------------------weosocket结束------------------------------------- */
  954. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  955. showDialog(click) {
  956. if (click == 'eventLocation') {
  957. this.$refs.eventLocation.showEventLocation()
  958. this.$refs.supermap.isEditableLayers = false
  959. this.$refs.bottomMenu.showChild = false
  960. this.$refs.bottomMenu.showBanChild = false
  961. this.$refs.bottomMenu.showChangChild = false
  962. } else if (click == 'editableLayers') {
  963. this.$refs.bottomMenu.showChild = false
  964. this.$refs.bottomMenu.showBanChild = false
  965. this.$refs.bottomMenu.showChangChild = false
  966. if (!this.$refs.supermap.isEditableLayers) {
  967. this.$refs.supermap.isEditableLayers = true
  968. } else {
  969. this.$refs.supermap.isEditableLayers = false
  970. }
  971. } else if (click == 'layerSwitching') {
  972. this.$refs.supermap.isEditableLayers = false
  973. this.$refs.bottomMenu.showBanChild = false
  974. this.$refs.bottomMenu.showChangChild = false
  975. if (!this.$refs.bottomMenu.showChild) {
  976. this.$refs.bottomMenu.showChild = true
  977. } else {
  978. this.$refs.bottomMenu.showChild = false
  979. }
  980. } else if (click == 'TVWall') {
  981. this.$refs.TVWall.showTVWall()
  982. this.$refs.supermap.isEditableLayers = false
  983. this.$refs.bottomMenu.showChild = false
  984. this.$refs.bottomMenu.showBanChild = false
  985. this.$refs.bottomMenu.showChangChild = false
  986. } else if (click == 'forestban') {
  987. this.$refs.bottomMenu.showBanChild = true
  988. this.$refs.supermap.isEditableLayers = false
  989. this.$refs.bottomMenu.showChild = false
  990. this.$refs.bottomMenu.showChangChild = false
  991. if (!this.$refs.bottomMenu.showBanChild) {
  992. this.$refs.bottomMenu.showBanChild = false
  993. }
  994. }else if (click == 'forestchang') {
  995. this.$refs.bottomMenu.showChangChild = true
  996. this.$refs.supermap.isEditableLayers = false
  997. this.$refs.bottomMenu.showBanChild = false
  998. this.$refs.bottomMenu.showChild = false
  999. if (!this.$refs.bottomMenu.showChangChild) {
  1000. this.$refs.bottomMenu.showChangChild = false
  1001. }
  1002. }
  1003. },
  1004. //选择图层
  1005. choseLayerSwitching(url,isClear) {
  1006. this.$refs.supermap.layerSwitching(url, isClear)
  1007. },
  1008. //选择图层(传递数组)
  1009. choseLayerSwitchingList(urlList) {
  1010. this.$refs.supermap.layerSwitchingList(urlList)
  1011. },
  1012. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1013. /** ----------------------------------事件弹窗开始------------------------------------- */
  1014. /** ----------------------------------事件弹窗结束------------------------------------- */
  1015. /** ----------------------------------摄像头预览开始------------------------------------- */
  1016. alertLogin: function() {
  1017. this.$modal.msg('登录中....')
  1018. },
  1019. alertLoginSuccess: function() {
  1020. this.$modal.msgSuccess('登录成功!')
  1021. },
  1022. alertLoginFailed: function() {
  1023. this.$modal.msgError('登陆失败!')
  1024. },
  1025. alertReinstall: function() {
  1026. this.$modal.msgWarning('请重新安装客户端')
  1027. },
  1028. /** 预览按钮操作 */
  1029. preview(channelCode) {
  1030. getDahuaVideoServer().then(newResponse => {
  1031. this.ws.detectConnectQt().then(res => {
  1032. if (res) { // 连接客户端成功
  1033. this.alertLogin()
  1034. this.ws.login({
  1035. loginIp: newResponse.loginIp,
  1036. loginPort: newResponse.loginPort,
  1037. userName: newResponse.userName,
  1038. userPwd: newResponse.userPwd,
  1039. token: '',
  1040. https: 1
  1041. })
  1042. this.ws.on('loginState', (res) => {
  1043. this.isLogin = res
  1044. if (res) {
  1045. this.alertLoginSuccess()
  1046. this.activePanel = 'key2'
  1047. this.realTimeVideoDialog(channelCode)
  1048. } else {
  1049. this.alertLoginFailed()
  1050. }
  1051. })
  1052. } else { // 连接客户端失败
  1053. this.alertReinstall()
  1054. }
  1055. })
  1056. })
  1057. },
  1058. realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
  1059. if (!this.isLogin) {
  1060. this.$Message.info('正在登陆客户端,请稍等......')
  1061. return false
  1062. }
  1063. this.ws.openVideo(cameraParams)
  1064. }
  1065. /** ----------------------------------摄像头预览结束------------------------------------- */
  1066. }
  1067. }
  1068. </script>
  1069. <style rel="stylesheet/scss" lang="scss" scoped>
  1070. @import '@/assets/styles/base.scss';
  1071. </style>