forest.vue 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313
  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 no_hover">
  20. <div class="d-l-l-text w-100p no-weight">
  21. <h4 class="line-h-1 w-100p" v-html="forestInfo">{{ 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 no_hover">
  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 style="width:81%;height:15px;position: absolute; top:4.2rem;z-index: 0; " />
  41. </div>
  42. </div>
  43. <div class="d-l-con-icon">
  44. <div class="icon-con w-33 flex-d t-a-center">
  45. <dv-decoration-9
  46. style="width: 5.5rem;height: 5.5rem; color:#16e29e;font-size: 1rem;font-weight: bolder;">
  47. {{ newReport_pre }}%
  48. </dv-decoration-9>
  49. <div class="e-state"
  50. :style="{ 'background-image': `url(${require('@/assets/images/integrated/state-bg.png')})` }">
  51. <span>新上报</span> <span>{{ newReport }}</span>
  52. </div>
  53. </div>
  54. <div class="icon-con w-33 flex-d t-a-center">
  55. <dv-decoration-9
  56. style="width: 5.5rem;height: 5.5rem; color:#f18425;font-size: 1rem;font-weight: bolder;">
  57. {{ readySure_pre }}%
  58. </dv-decoration-9>
  59. <div class="e-state"
  60. :style="{ 'background-image': `url(${require('@/assets/images/integrated/state-bg.png')})` }">
  61. <span>处理中</span> <span>{{ readySure }}</span>
  62. </div>
  63. </div>
  64. <div class="icon-con w-33 flex-d t-a-center">
  65. <dv-decoration-9
  66. style="width: 5.5rem;height: 5.5rem; color:#9179f1;font-size: 1rem;font-weight: bolder;">
  67. {{ readyFinish_pre }}%
  68. </dv-decoration-9>
  69. <div class="e-state"
  70. :style="{ 'background-image': `url(${require('@/assets/images/integrated/state-bg.png')})` }">
  71. <span>已完成</span> <span>{{ readyFinish }}</span>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="d-l-con no_hover">
  76. <div id="chart-event-ai" style="width: 100%;height:6vh;"></div>
  77. </div>
  78. </div>
  79. </dv-border-box-13>
  80. </div>
  81. <!-- 3 组织机构 -->
  82. <div class="forthis">
  83. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  84. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  85. <div class="i-list-con h-27" style="padding-left: 1rem;">
  86. <el-collapse accordion>
  87. <el-collapse-item v-for="(item, index) in forestFarm" :key="index">
  88. <!-- deptId -->
  89. <template slot="title">
  90. <div class="d-l-con sj-collapse" :class="{ on: listCurrentIndex1 == item.deptId }"
  91. v-on:click="selectCameraByDeptId(item.deptId)">
  92. <div class="d-l-l-text">
  93. <h4 class="collapse-title">{{ item.deptName }}</h4>
  94. </div>
  95. <div class="d-l-l-count">{{ item.eventCount }}</div>
  96. </div>
  97. </template>
  98. </el-collapse-item>
  99. </el-collapse>
  100. </div>
  101. </dv-border-box-13>
  102. </div>
  103. </div>
  104. <!-- 地图 -->
  105. <supermap ref="supermap" style="width: 100%;height: 100vh;" class="indexSupermapClass" :mapDiv="'forestMap'"
  106. :dynamicPlotting="false" :mapSite="{ doubleClickZoom: false }" :codes="['9fa5']" :isSideBySide="false"
  107. @showEventDialog="showEventDialog"></supermap>
  108. <!-- 右侧 -->
  109. <div class="rightbar rightbar-index" ref="right">
  110. <div class="right-item1">
  111. <!-- 天气 -->
  112. <div class="forthis">
  113. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)">
  114. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  115. <div class="i-list-con small-bottom-margin h-18">
  116. <el-row :gutter="20" v-if="todatWeather">
  117. <el-col :span="9">
  118. <div class="weather-img">
  119. <img v-if="weatherinformationWeather == 1" src="../assets/images/integrated/weather/qing-1.png">
  120. <img v-if="weatherinformationWeather == 2" src="../assets/images/integrated/weather/duoyun-2.png">
  121. <img v-if="weatherinformationWeather == 3" src="../assets/images/integrated/weather/yin-3.png">
  122. <img v-if="weatherinformationWeather == 4" src="../assets/images/integrated/weather/zhenyu-4.png">
  123. <img v-if="weatherinformationWeather == 5"
  124. src="../assets/images/integrated/weather/leizhenyu-5.png">
  125. <img v-if="weatherinformationWeather == 6"
  126. src="../assets/images/integrated/weather/leizhenyubingbao-6.png">
  127. <img v-if="weatherinformationWeather == 7" src="../assets/images/integrated/weather/yujiaxue-7.png">
  128. <img v-if="weatherinformationWeather == 8" src="../assets/images/integrated/weather/xiaoyu-8.png">
  129. <img v-if="weatherinformationWeather == 9 || weatherinformationWeather == 22"
  130. src="../assets/images/integrated/weather/zhongyu-9.png">
  131. <img v-if="weatherinformationWeather == 10 || weatherinformationWeather == 23"
  132. src="../assets/images/integrated/weather/dayu-10.png">
  133. <img v-if="weatherinformationWeather == 11 || weatherinformationWeather == 24"
  134. src="../assets/images/integrated/weather/baoyu-11.png">
  135. <img v-if="weatherinformationWeather == 12 || weatherinformationWeather == 25"
  136. src="../assets/images/integrated/weather/dabaoyu-12.png">
  137. <img v-if="weatherinformationWeather == 13 || weatherinformationWeather == 26"
  138. src="../assets/images/integrated/weather/tedabaoyu-13.png">
  139. <img v-if="weatherinformationWeather == 14"
  140. src="../assets/images/integrated/weather/zhenxue-14.png">
  141. <img v-if="weatherinformationWeather == 15"
  142. src="../assets/images/integrated/weather/xiaoxue-15.png">
  143. <img v-if="weatherinformationWeather == 16 || weatherinformationWeather == 27"
  144. src="../assets/images/integrated/weather/zhongxue-16.png">
  145. <img v-if="weatherinformationWeather == 17 || weatherinformationWeather == 28"
  146. src="../assets/images/integrated/weather/daxue-17.png">
  147. <img v-if="weatherinformationWeather == 18 || weatherinformationWeather == 29"
  148. src="../assets/images/integrated/weather/baoxue-18.png">
  149. <img v-if="weatherinformationWeather == 19" src="../assets/images/integrated/weather/wu-19.png">
  150. <img v-if="weatherinformationWeather == 20" src="../assets/images/integrated/weather/dongyu-20.png">
  151. <img v-if="weatherinformationWeather == 21"
  152. src="../assets/images/integrated/weather/shachenbao-21.png">
  153. <img v-if="weatherinformationWeather == 30" src="../assets/images/integrated/weather/fuchen-30.png">
  154. <img v-if="weatherinformationWeather == 31"
  155. src="../assets/images/integrated/weather/yangsha-31.png">
  156. <img v-if="weatherinformationWeather == 32"
  157. src="../assets/images/integrated/weather/qiangshachenbao-32.png">
  158. <span v-if="weatherinformationWeather == 1">晴</span>
  159. <span v-if="weatherinformationWeather == 2">多云</span>
  160. <span v-if="weatherinformationWeather == 3">阴</span>
  161. <span v-if="weatherinformationWeather == 4">阵雨</span>
  162. <span v-if="weatherinformationWeather == 5">雷阵雨</span>
  163. <span v-if="weatherinformationWeather == 6">雷阵雨伴有冰雹</span>
  164. <span v-if="weatherinformationWeather == 7">雨夹雪</span>
  165. <span v-if="weatherinformationWeather == 8">小雨</span>
  166. <span v-if="weatherinformationWeather == 9">中雨</span>
  167. <span v-if="weatherinformationWeather == 10">大雨</span>
  168. <span v-if="weatherinformationWeather == 11">暴雨</span>
  169. <span v-if="weatherinformationWeather == 12">大暴雨</span>
  170. <span v-if="weatherinformationWeather == 13">特大暴雨</span>
  171. <span v-if="weatherinformationWeather == 14">阵雪</span>
  172. <span v-if="weatherinformationWeather == 15">小雪</span>
  173. <span v-if="weatherinformationWeather == 16">中雪</span>
  174. <span v-if="weatherinformationWeather == 17">大雪</span>
  175. <span v-if="weatherinformationWeather == 18">暴雪</span>
  176. <span v-if="weatherinformationWeather == 19">雾</span>
  177. <span v-if="weatherinformationWeather == 20">冻雨</span>
  178. <span v-if="weatherinformationWeather == 21">沙尘暴</span>
  179. <span v-if="weatherinformationWeather == 22">小雨—中雨</span>
  180. <span v-if="weatherinformationWeather == 23">中雨—大雨</span>
  181. <span v-if="weatherinformationWeather == 24">大雨—暴雨</span>
  182. <span v-if="weatherinformationWeather == 25">暴雨—大暴雨</span>
  183. <span v-if="weatherinformationWeather == 26">大暴雨—特大暴雨</span>
  184. <span v-if="weatherinformationWeather == 27">小雪—中雪</span>
  185. <span v-if="weatherinformationWeather == 28">中雪—大雪</span>
  186. <span v-if="weatherinformationWeather == 29">大雪—暴雪</span>
  187. <span v-if="weatherinformationWeather == 30">浮尘</span>
  188. <span v-if="weatherinformationWeather == 31">扬沙</span>
  189. <span v-if="weatherinformationWeather == 32">强沙尘暴</span>
  190. </div>
  191. </el-col>
  192. <el-col :span="15">
  193. <div class="weather-info">
  194. <ul>
  195. <li>风力:{{ weatherinformationPower }}级</li>
  196. <li>低温:{{ weatherinformationLow }}℃</li>
  197. <li v-if="weatherinformationDirection == 1">风向:东风</li>
  198. <li v-if="weatherinformationDirection == 2">风向:东南风</li>
  199. <li v-if="weatherinformationDirection == 3">风向:南风</li>
  200. <li v-if="weatherinformationDirection == 4">风向:西南风</li>
  201. <li v-if="weatherinformationDirection == 5">风向:西风</li>
  202. <li v-if="weatherinformationDirection == 6">风向:西北风</li>
  203. <li v-if="weatherinformationDirection == 7">风向:北风</li>
  204. <li v-if="weatherinformationDirection == 8">风向:东北风</li>
  205. <li>高温:{{ weatherinformationHigh }}℃</li>
  206. <li>火险:{{ weatherinformationLevelValue }}
  207. </li>
  208. <li>湿度:{{ weatherinformationTemperature }}</li>
  209. </ul>
  210. </div>
  211. </el-col>
  212. </el-row>
  213. <el-row :gutter="20" v-else>
  214. <el-col :span="24">
  215. <div class="weather-img">
  216. 暂无天气信息!
  217. </div>
  218. </el-col>
  219. </el-row>
  220. <div class="firestate" v-if="todatWeather">
  221. <div
  222. :class="weatherinformationLevel == 'forest_weatherinformation_level_1' ? 'state-block1 state-on' : 'state-block1'">
  223. </div>
  224. <div
  225. :class="weatherinformationLevel == 'forest_weatherinformation_level_2' ? 'state-block2 state-on' : 'state-block2'">
  226. </div>
  227. <div
  228. :class="weatherinformationLevel == 'forest_weatherinformation_level_3' ? 'state-block3 state-on' : 'state-block3'">
  229. </div>
  230. <div
  231. :class="weatherinformationLevel == 'forest_weatherinformation_level_4' ? 'state-block4 state-on' : 'state-block4'">
  232. </div>
  233. <div
  234. :class="weatherinformationLevel == 'forest_weatherinformation_level_5' ? 'state-block5 state-on' : 'state-block5'">
  235. </div>
  236. </div>
  237. </div>
  238. </dv-border-box-13>
  239. </div>
  240. <!-- 曝光台 -->
  241. <div class="forthis">
  242. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  243. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  244. <div class="this-title">
  245. <span>超期事件</span>
  246. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  247. </div>
  248. <div class="i-list-con small-bottom-margin h-18">
  249. <div class="d-l-con padding-box nowrap" v-for="(item, index) in exposureStageList">
  250. <div class="bgt-state">
  251. <div class="bgt-state-frequency">{{ item.urgeCount }}</div>
  252. <div class="bgt-state-minute">{{ item.timeDiff }}分钟</div>
  253. </div>
  254. <div class="bgt-info">
  255. <div class="bgt-info-name">{{ item.eventName }}</div>
  256. <div class="bgt-info-place">
  257. <ul>
  258. <li>{{ item.deptNames }}</li>
  259. </ul>
  260. </div>
  261. </div>
  262. </div>
  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" style="height: 30vh;">
  275. <div class="event-list-search">
  276. <el-input placeholder="请输入内容" prefix-icon="el-icon-search" v-model="eventSearch"
  277. @change="getEventList(calendarDay, 10, 1, eventSearch)">
  278. </el-input>
  279. </div>
  280. <div class="d-l-con padding-box nowrap" v-for="(item, index) in eventList"
  281. @click="dropLocation(item.latitude, item.longitude,item.eventCode)" data-html2canvas-ignore>
  282. <div class="bgt-img">
  283. <img v-if="item.picturePath != null && item.picturePath != '' && item.pictureType == 'image'"
  284. :src="item.picturePath" style="width: 93px;height: 64px" loading="lazy" />
  285. <img v-else src="../assets/images/integrated/event-img-sub.png" style="width: 93px;height: 64px" />
  286. </div>
  287. <div class="bgt-info">
  288. <div v-if="item.eventStatusValue == 'forest_event_status_1' && item.urgeCount == 0"
  289. class="event-state-sb">
  290. <i class="el-icon-caret-left"></i>
  291. <div class="event-list-state-sb">
  292. 新上报
  293. </div>
  294. </div>
  295. <div v-if="item.eventStatusValue == 'forest_event_status_1' && item.urgeCount > 0"
  296. class="event-state-cb">
  297. <i class="el-icon-caret-left"></i>
  298. <div class="event-list-state-cb">
  299. 催办
  300. </div>
  301. </div>
  302. <div v-if="item.eventStatusValue == 'forest_event_status_2'" class="event-state-qs">
  303. <i class="el-icon-caret-left"></i>
  304. <div class="event-list-state-qs">
  305. 签收
  306. </div>
  307. </div>
  308. <div v-if="item.eventStatusValue == 'forest_event_status_3'" class="event-state-wb">
  309. <i class="el-icon-caret-left"></i>
  310. <div class="event-list-state-wb">
  311. 误报
  312. </div>
  313. </div>
  314. <div v-if="item.eventStatusValue == 'forest_event_status_4'" class="event-state-cf">
  315. <i class="el-icon-caret-left"></i>
  316. <div class="event-list-state-cf">
  317. 重复
  318. </div>
  319. </div>
  320. <div v-if="item.eventStatusValue == 'forest_event_status_5'" class="event-state-bj">
  321. <i class="el-icon-caret-left"></i>
  322. <div class="event-list-state-bj">
  323. 办结
  324. </div>
  325. </div>
  326. <div v-if="item.eventStatusValue == 'forest_event_status_6'" class="event-state-gd">
  327. <i class="el-icon-caret-left"></i>
  328. <div class="event-list-state-gd">
  329. 归档
  330. </div>
  331. </div>
  332. <div v-if="item.eventStatusValue == 'forest_event_status_7'" class="event-state-qr">
  333. <i class="el-icon-caret-left"></i>
  334. <div class="event-list-state-qr">
  335. 确认
  336. </div>
  337. </div>
  338. <div class="bgt-info-name">{{ item.reportor }} {{ item.eventName }}</div>
  339. <div class="bgt-info-place">
  340. <ul>
  341. <li>{{ item.createTime }}</li>
  342. </ul>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. <!--分页-->
  348. <div class="paging">
  349. <el-button type="button" @click="getEventList(calendarDay, 10, pageNum - 1)">上一页
  350. </el-button>
  351. <!-- <span>第0页</span> -->
  352. <el-button type="button" @click="getEventList(calendarDay, 10, pageNum + 1)">下一页
  353. </el-button>
  354. </div>
  355. </dv-border-box-13>
  356. </div>
  357. </div>
  358. <div class="right-item2">
  359. <!-- 日历 -->
  360. <div class="forthis">
  361. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  362. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  363. <div class="i-list-con small-bottom-margin h-30">
  364. <dateChoose @selectDay="selectDay"></dateChoose>
  365. </div>
  366. </dv-border-box-13>
  367. </div>
  368. <!-- 事件分类 -->
  369. <div class="forthis">
  370. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  371. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  372. <div class="this-title" style="cursor: pointer"
  373. @click="setEventTypeId({ eventTypeIdDl: [], eventTypeId: [] })">
  374. <span>事件分类</span>
  375. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  376. </div>
  377. <div class="i-list-con small-bottom-margin h-19">
  378. <chart v-if="showEventKind" :config="eventKind" @setEventTypeId="setEventTypeId"
  379. style="width: 90%;height: 18vh; padding:.5rem 1rem" />
  380. </div>
  381. </dv-border-box-13>
  382. </div>
  383. <!-- 上报排行 -->
  384. <div class="forthis">
  385. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  386. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
  387. <div class="this-title">
  388. <span>上报排行</span>
  389. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" />
  390. </div>
  391. <div class="i-list-con small-bottom-margin h-19">
  392. <dv-scroll-ranking-board :config="reportList" style="width: 100%;height: 300px; padding:.5rem 1rem" />
  393. </div>
  394. </dv-border-box-13>
  395. </div>
  396. </div>
  397. </div>
  398. <vBottomMenu ref="bottomMenu" @stopAudio="stopAudio"></vBottomMenu>
  399. </div>
  400. <audio id="resource" ref="up" :src="audioSrc" controls style="display: none;"></audio>
  401. <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="calendarDay" @getEventList="getEventList"
  402. @getTodayEvents="getTodayEvents" @getFirespread="getFirespread" @getSupermap="getSupermap"></eventdetailsdialog>
  403. <firespread ref="firespread" :calendarDay="calendarDay" @getEventList="getEventList" @getTodayEvents="getTodayEvents"
  404. @showEventDialog="showEventDialog" @getSupermap="getSupermap" @showDialog="showDialog"></firespread>
  405. <eventLocation ref="eventLocation"></eventLocation>
  406. <TVWall ref="TVWall"></TVWall>
  407. </div>
  408. </template>
  409. <script>
  410. import dateChoose from '@/views/date.vue' //日历
  411. /** ----------------------------------weosocket开始------------------------------------- */
  412. import Cookies from 'js-cookie'
  413. /** ----------------------------------weosocket结束------------------------------------- */
  414. import {
  415. getMenuEventType,
  416. getEventPush,
  417. getBaseInfo,
  418. getTodayEvents,
  419. getDeptEventCount,
  420. getWeather,
  421. getEventList,
  422. getEventByEventType,
  423. getEventByReportorOrder,
  424. getExposureStage
  425. } from '@/api/forest'
  426. import {
  427. getNearEvent
  428. } from '@/api/event'
  429. import supermap from '@/components/supermap' //超图
  430. // import supermapNotProcessed from '@/components/supermap' //超图
  431. // import supermapProcessed from '@/components/supermap' //超图
  432. import vheader from '@/components/v-header.vue' //一体化共用头部
  433. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  434. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  435. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  436. import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
  437. import firespread from '@/views/firespread.vue' //事件详情弹窗
  438. import Firespread from "./firespread";
  439. import chart from "./from/dvCapsuleChart.vue";
  440. import {selectConfigKey} from "@/api/system/config";
  441. let echarts = require('echarts')
  442. export default {
  443. components: {
  444. chart,
  445. Firespread,
  446. supermap,
  447. // supermapNotProcessed,
  448. // supermapProcessed,
  449. vheader,
  450. vBottomMenu,
  451. eventLocation,
  452. TVWall,
  453. dateChoose,
  454. eventdetailsdialog,
  455. firespread
  456. },
  457. created() {
  458. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  459. window.showDialog = this.showDialog
  460. window.choseLayerSwitching = this.choseLayerSwitching
  461. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  462. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  463. },
  464. mounted() {
  465. this.getBaseInfo()
  466. this.getTodayEvents(this.getCurrentDataStr())
  467. this.getDeptEventCount(this.getCurrentDataStr())
  468. this.getWeather(this.getCurrentDataStr())
  469. this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum)
  470. this.getEventByEventType(this.getCurrentDataStr())
  471. this.getEventByReportorOrder(this.getCurrentDataStr())
  472. this.getExposureStage(this.getCurrentDataStr())
  473. this.getSupermap(this.getCurrentDataStr())
  474. this.getMenuEventType()
  475. /** ----------------------------------weosocket开始------------------------------------- */
  476. // this.initWebSocket()
  477. /** ----------------------------------weosocket结束------------------------------------- */
  478. this.bottomMenuList() //获取底部公共组件消息和任务
  479. },
  480. data() {
  481. return {
  482. //警报MP3文件
  483. audioSrc: require('@/assets/jingbao.mp3'),
  484. calendarDay: this.getCurrentDataStr(),
  485. //基本情况
  486. forestInfo: '', //基本情况
  487. //左侧获取事件信息统计
  488. totalStr: '000000',
  489. aiTotal: '',
  490. newReport: '',
  491. otherTotal: '',
  492. readyFinish: '',
  493. readySure: '',
  494. total: '',
  495. aiTotal_pre: '',
  496. newReport_pre: '',
  497. eventTypeIdDl: [],
  498. eventTypeId: [],
  499. otherTotal_pre: '',
  500. readyFinish_pre: '',
  501. readySure_pre: '',
  502. //左侧部门事件数量
  503. forestFarm: [],
  504. //右侧天气
  505. todatWeather: false,
  506. weatherinformationDirection: '',
  507. weatherinformationHigh: '',
  508. weatherinformationLevel: '',
  509. weatherinformationLevelValue: '', //火险登记中文
  510. weatherinformationLow: '',
  511. weatherinformationPower: '',
  512. weatherinformationTemperature: '',
  513. weatherinformationTime: '',
  514. weatherinformationWeather: '',
  515. //右侧曝光台
  516. exposureStageList: [],
  517. //右侧事件列表
  518. eventList: [],
  519. pageSize: 10,
  520. pageNum: 1,
  521. eventListnew: [],
  522. eventListAll: [],
  523. eventSearch: '', //事件列表搜索
  524. listCurrentIndex1: '',
  525. // ----------------------------------事件分类柱状----------------------------------------
  526. eventKind: {},
  527. showEventKind: false,
  528. // ----------------------------------上报排行----------------------------------------
  529. reportList: {
  530. data: []
  531. },
  532. /** ----------------------------------weosocket开始------------------------------------- */
  533. weosocket: false,
  534. websock: '',
  535. setIntervalWesocketPush: null,
  536. websockSid: {
  537. userId: '',
  538. eventTypeDl: '',
  539. eventType: '',
  540. },
  541. /** ----------------------------------weosocket结束------------------------------------- */
  542. /** ----------------------------------摄像头预览开始------------------------------------- */
  543. activePanel: 'key1',
  544. isLogin: false,
  545. cameraParams: [],
  546. ws: null,
  547. /** ----------------------------------摄像头预览结束------------------------------------- */
  548. markersList: [], //点位列表
  549. cameraList: [] //摄像头列表
  550. }
  551. },
  552. /** ----------------------------------weosocket开始------------------------------------- */
  553. destroyed() { //离开页面关闭Socket连接
  554. if (this.websock) {
  555. clearInterval(this.setIntervalWesocketPush)
  556. this.websock.close()
  557. this.websock = null
  558. }
  559. },
  560. /** ----------------------------------weosocket结束------------------------------------- */
  561. methods: {
  562. getMenuEventType() {
  563. let that = this
  564. getMenuEventType().then(res => {
  565. that.websockSid.userId = Cookies.get('userId')
  566. that.websockSid.eventTypeDl = res.data.eventTypeDl
  567. that.websockSid.eventType = res.data.eventType
  568. that.initWebSocket(that.websockSid.userId, that.websockSid.eventTypeDl, that.websockSid.eventType)
  569. console.log(that.websockSid)
  570. })
  571. },
  572. // searchEvent(pageSize,pageNum,eventSearch) {
  573. // this.pageSize = pageSize;
  574. // this.pageNum = pageNum;
  575. // let that = this
  576. // //事件列表搜索
  577. // this.eventList = []
  578. // //右侧获取事件列表
  579. // getEventList({ day: that.calendarDay,pageSize:pageSize,pageNum: pageNum ,eventName:eventSearch}).then(res => {
  580. // this.eventList = res.data
  581. // if (this.eventList != null && this.eventList.length > 0) {
  582. // if(this.eventList[0].eventStatusValue == 'forest_event_status_1'){
  583. // that.$refs.bottomMenu.updateAlert();
  584. // that.$refs.up.play();
  585. // }
  586. // }
  587. // })
  588. // },
  589. dropLocation(lat, lng,eventCode) {
  590. this.$refs.supermap.dropLocation(lat, lng,18)
  591. this.showEventDialog(eventCode)
  592. },
  593. showEventDialog(eventCode) {
  594. //事件信息弹出
  595. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  596. },
  597. getFirespread(eventCode) {
  598. this.$refs.firespread.showEventDialog(eventCode);
  599. },
  600. getCurrentDataStr() {
  601. let date = new Date()
  602. let y = date.getFullYear()
  603. let m = date.getMonth() + 1
  604. m = m < 10 ? '0' + m : m
  605. let d = date.getDate()
  606. d = d < 10 ? '0' + d : d
  607. return y + '-' + m + '-' + d
  608. },
  609. selectDay(day) { //日历点击
  610. this.getTodayEvents(day)
  611. this.getDeptEventCount(day)
  612. this.getWeather(day)
  613. this.getEventList(day, 10, 1)
  614. this.getEventByEventType(day)
  615. this.getEventByReportorOrder(day)
  616. this.getExposureStage(day)
  617. this.getSupermap(day);
  618. this.calendarDay = day
  619. },
  620. //事件数量统计chart 样例地址http://192.144.199.210:8080/editor/index.html?chart_id=jTXf0Rv4A3oiBONB
  621. eventChartAi(aiTotal_pre, otherTotal_pre) {
  622. // 基于准备好的dom,初始化echarts实例
  623. let myChart = echarts.init(document.getElementById('chart-event-ai'))
  624. myChart.setOption({
  625. tooltip: {
  626. trigger: 'none'
  627. },
  628. grid: {
  629. top: '65%',
  630. left: '5%',
  631. right: '5%'
  632. },
  633. yAxis: {
  634. data: ['百分比'],
  635. axisTick: {
  636. show: false
  637. },
  638. axisLine: {
  639. show: false
  640. },
  641. axisLabel: {
  642. show: false
  643. }
  644. },
  645. xAxis: {
  646. splitLine: {
  647. show: false
  648. },
  649. axisTick: {
  650. show: false
  651. },
  652. axisLine: {
  653. show: false
  654. },
  655. axisLabel: {
  656. show: false
  657. }
  658. },
  659. legend: {
  660. data: ['AI', '其他'],
  661. bottom: '5%',
  662. textStyle: {
  663. color: '#1FC3CE',
  664. fontSize: 14
  665. }
  666. },
  667. series: [{
  668. // name: '最上层立体圆',
  669. type: 'pictorialBar',
  670. symbolSize: [10, 20],
  671. symbolOffset: [2, 0],
  672. z: 12,
  673. itemStyle: {
  674. normal: {
  675. color: '#293CA0'
  676. }
  677. },
  678. data: [{
  679. value: 100,
  680. symbolPosition: 'end'
  681. }]
  682. }, {
  683. // name: '中间立体圆',
  684. type: 'pictorialBar',
  685. symbolSize: [10, 20],
  686. symbolOffset: [2, 0],
  687. z: 12,
  688. itemStyle: {
  689. normal: {
  690. color: '#45ac8d'
  691. }
  692. },
  693. data: [{
  694. value: aiTotal_pre,
  695. symbolPosition: 'end'
  696. }]
  697. }, {
  698. // name: '最底部立体圆',
  699. type: 'pictorialBar',
  700. symbolSize: [10, 20],
  701. symbolOffset: [-4, 0],
  702. z: 12,
  703. itemStyle: {
  704. normal: {
  705. color: '#196d59'
  706. }
  707. },
  708. data: [otherTotal_pre]
  709. }, {
  710. name: 'AI',
  711. //底部立体柱
  712. stack: '1',
  713. type: 'bar',
  714. itemStyle: {
  715. normal: {
  716. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  717. offset: 0,
  718. color: '#29ac8f'
  719. }, {
  720. offset: 1,
  721. color: '#0a3f3f'
  722. }])
  723. }
  724. },
  725. label: {
  726. normal: {
  727. show: true,
  728. position: 'inside',
  729. offset: [0, 1],
  730. formatter: function (obj) {
  731. return (obj.value).toLocaleString() + '%'
  732. },
  733. textStyle: {
  734. align: 'center',
  735. baseline: 'middle',
  736. fontSize: 14,
  737. fontWeight: '400',
  738. color: '#fff',
  739. textShadowColor: '#000',
  740. textShadowBlur: '0',
  741. textShadowOffsetX: 1,
  742. textShadowOffsetY: 1
  743. }
  744. }
  745. },
  746. silent: true,
  747. barWidth: 20,
  748. barGap: '-100%', // Make series be overlap
  749. data: [aiTotal_pre]
  750. }, {
  751. name: '其他',
  752. //上部立体柱
  753. stack: '1',
  754. type: 'bar',
  755. itemStyle: {
  756. normal: {
  757. color: '#14257B',
  758. opacity: .7
  759. }
  760. },
  761. silent: true,
  762. barWidth: 20,
  763. barGap: '-100%', // Make series be overlap
  764. data: [otherTotal_pre],
  765. // itemStyle: {
  766. // normal: {
  767. // color: 'rgba(29,67,243,1)',
  768. // }
  769. // },
  770. label: {
  771. normal: {
  772. show: true,
  773. position: 'inside',
  774. offset: [0, 1],
  775. formatter: function (obj) {
  776. return (obj.value).toLocaleString() + '%'
  777. },
  778. textStyle: {
  779. align: 'center',
  780. baseline: 'middle',
  781. fontSize: 14,
  782. fontWeight: '400',
  783. color: '#fff',
  784. textShadowColor: '#000',
  785. textShadowBlur: '0',
  786. textShadowOffsetX: 1,
  787. textShadowOffsetY: 1
  788. }
  789. }
  790. }
  791. }]
  792. })
  793. },
  794. getBaseInfo() {
  795. //左侧获取部门信息
  796. getBaseInfo().then(res => {
  797. if (res.code == 200) {
  798. if (res.msg == '未找到部门信息') {
  799. this.forestInfo = '未找到部门信息!'
  800. } else {
  801. this.forestInfo = res.data.baseinfo //基本情况
  802. }
  803. }
  804. })
  805. },
  806. getTodayEvents(day, loading) {
  807. let that = this
  808. //左侧获取事件信息统计
  809. getTodayEvents({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day }, loading).then(res => {
  810. this.aiTotal = res.data.aiTotal
  811. this.aiTotal_pre = res.data.aiTotal_pre
  812. this.newReport = res.data.newReport
  813. this.newReport_pre = res.data.newReport_pre
  814. this.otherTotal = res.data.otherTotal
  815. this.otherTotal_pre = res.data.otherTotal_pre
  816. this.readyFinish = res.data.readyFinish
  817. this.readyFinish_pre = res.data.readyFinish_pre
  818. this.readySure = res.data.readySure
  819. this.readySure_pre = res.data.readySure_pre
  820. this.totalStr = res.data.totalStr
  821. this.total = res.data.total
  822. this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
  823. })
  824. },
  825. getDeptEventCount(day, loading) {
  826. let that = this
  827. //左侧获取事件部门数量
  828. getDeptEventCount({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day }, loading).then(res => {
  829. this.forestFarm = res.data
  830. })
  831. },
  832. getWeather(day) {
  833. let that = this
  834. //右侧获取天气信息
  835. getWeather({ day: day }).then(res => {
  836. if (res.code == 200) {
  837. if (res.msg == '天气未添加') {
  838. this.todatWeather = false
  839. } else {
  840. this.todatWeather = true
  841. this.weatherinformationDirection = res.data.weatherinformationDirection
  842. this.weatherinformationHigh = res.data.weatherinformationHigh
  843. this.weatherinformationLevel = res.data.weatherinformationLevel
  844. this.weatherinformationLevelValue = res.data.weatherinformationLevelValue
  845. this.weatherinformationLow = res.data.weatherinformationLow
  846. this.weatherinformationPower = res.data.weatherinformationPower
  847. this.weatherinformationTemperature = res.data.weatherinformationTemperature
  848. this.weatherinformationTime = res.data.weatherinformationTime
  849. this.weatherinformationWeather = res.data.weatherinformationWeather
  850. }
  851. } else {
  852. this.todatWeather = false
  853. }
  854. })
  855. },
  856. getSupermap(day, loading) {
  857. let that = this
  858. getNearEvent('', '', day, loading, that.eventTypeIdDl, that.eventTypeId).then(res => {
  859. that.markersList = [];
  860. if (res.data != null && res.data.length > 0) {
  861. for (let i = 0; i < res.data.length; i++) {
  862. let markersMap = {
  863. lng: 124.59,
  864. lat: 43.02,
  865. icon: 'marker',
  866. bindPopupHtml: '',
  867. click: '',
  868. parameter: '',
  869. keepBindPopup: false,
  870. isAggregation: false
  871. }
  872. if (res.data.length > 200) {
  873. markersMap.isAggregation = true
  874. }
  875. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount == 0) {
  876. markersMap.click = 'showEventDialog'
  877. markersMap.icon = 'sj-icon-map-xinshangbao'
  878. }
  879. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount > 0) {
  880. markersMap.click = 'showEventDialog'
  881. markersMap.icon = 'sj-icon-map-cuiban'
  882. } else if (res.data[i].eventStatusValue == 'forest_event_status_2') {
  883. markersMap.click = 'showEventDialog'
  884. markersMap.icon = 'sj-icon-map-qianshou'
  885. markersMap.isAggregation = false
  886. } else if (res.data[i].eventStatusValue == 'forest_event_status_5') {
  887. markersMap.click = 'showEventDialog'
  888. markersMap.icon = 'sj-icon-map-banjie'
  889. markersMap.isAggregation = false
  890. } else if (res.data[i].eventStatusValue == 'forest_event_status_6') {
  891. markersMap.click = 'showEventDialog'
  892. markersMap.icon = 'sj-icon-map-guidang'
  893. } else if (res.data[i].eventStatusValue == 'forest_event_status_7') {
  894. markersMap.click = 'showEventDialog'
  895. markersMap.icon = 'sj-icon-map-queren'
  896. }
  897. markersMap.parameter = res.data[i].eventCode
  898. markersMap.lng = res.data[i].longitude
  899. markersMap.lat = res.data[i].latitude
  900. markersMap.bindPopupHtml = '<div class="map-tip">' +
  901. '<span>' +
  902. ' <div class="d-l-con">' +
  903. ' <div class="d-l-l-text">' +
  904. ' <h4>经纬度:' + res.data[i].longitude + ',' + res.data[i].latitude + '</h4>' +
  905. ' </div>' +
  906. ' </div>' +
  907. ' </span>' +
  908. '<span>' +
  909. ' <div class="d-l-con">' +
  910. ' <div class="d-l-l-text">' +
  911. ' <h4>事件名称:' + res.data[i].eventName + '</h4>' +
  912. ' </div>' +
  913. ' </div>' +
  914. ' </span>' +
  915. '<span>' +
  916. ' <div class="d-l-con">' +
  917. ' <div class="d-l-l-text">' +
  918. ' <h4>事件时间:' + res.data[i].createTime + '</h4>' +
  919. ' </div>' +
  920. ' </div>' +
  921. ' </span>';
  922. if (res.data[i].pictureType == 'image' && res.data[i].picturePath != null && res.data[i].picturePath != '') {
  923. markersMap.bindPopupHtml += '<span>' +
  924. ' <div class="d-l-con">' +
  925. ' <div class="d-l-l-text">' +
  926. '<img src="' + res.data[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  927. ' </div>' +
  928. ' </div>' +
  929. ' </span>'
  930. }
  931. markersMap.bindPopupHtml += '</div>'
  932. that.markersList.push(markersMap)
  933. }
  934. setTimeout(() => {
  935. that.$refs.supermap.clearM(false)
  936. that.$refs.supermap.clearM(true)
  937. that.$refs.supermap.setMarkers(that.markersList)
  938. }, 2000)
  939. } else {
  940. setTimeout(() => {
  941. that.$refs.supermap.clearM(false)
  942. that.$refs.supermap.clearM(true)
  943. }, 2000)
  944. }
  945. })
  946. },
  947. setEventTypeId(data) {
  948. // let data = {eventTypeIdDl: [], eventTypeId: []}
  949. // let data = {eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId}
  950. let that = this
  951. that.eventTypeIdDl = data.eventTypeIdDl
  952. that.eventTypeId = data.eventTypeId
  953. that.getSupermap(that.calendarDay, false)
  954. that.getTodayEvents(that.calendarDay, false)
  955. that.getEventByEventType(that.calendarDay, false)
  956. that.getExposureStage(that.calendarDay, false)
  957. that.getEventByReportorOrder(that.calendarDay, false)
  958. that.getDeptEventCount(that.calendarDay, false)
  959. that.getEventList(that.calendarDay, that.pageSize, that.pageNum, '', false)
  960. },
  961. getEventList(day, pageSize, pageNum, eventSearch, loading) {
  962. if (pageNum < 1) {
  963. this.$modal.msg('当前已是第一页')
  964. return;
  965. }
  966. this.pageSize = pageSize;
  967. this.pageNum = pageNum;
  968. let that = this
  969. this.eventList = []
  970. //右侧获取事件列表
  971. getEventList({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day, pageSize: pageSize, pageNum: pageNum, eventName: eventSearch }, loading).then(res => {
  972. this.eventList = res.data
  973. if (this.eventList != null && this.eventList.length > 0) {
  974. if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
  975. that.$refs.bottomMenu.updateAlert();
  976. that.$refs.up.play();
  977. } else {
  978. that.$refs.bottomMenu.updateAlertFalse();
  979. }
  980. }
  981. })
  982. },
  983. getEventByEventType(day, loading) {
  984. let that = this
  985. //右侧获取事件分类
  986. getEventByEventType({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day }, loading).then(res => {
  987. if (res.data != null && res.data.length > 0) {
  988. this.showEventKind = true
  989. this.eventKind.data = res.data
  990. this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
  991. this.eventKind.showValue = true
  992. this.eventKind = { ...this.eventKind }
  993. } else {
  994. this.showEventKind = false
  995. this.eventKind = {}
  996. this.eventKind = { ...this.eventKind }
  997. }
  998. })
  999. },
  1000. getEventByReportorOrder(day, loading) {
  1001. let that = this
  1002. //右侧获取上报排名
  1003. getEventByReportorOrder({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day }, loading).then(res => {
  1004. if (res.data != null && res.data.length > 0) {
  1005. this.reportList.data = res.data
  1006. this.reportList = { ...this.reportList }
  1007. } else {
  1008. this.reportList.data = []
  1009. this.reportList = { ...this.reportList }
  1010. }
  1011. })
  1012. },
  1013. getEventListNew() {
  1014. this.eventList = []
  1015. this.eventListAll = []
  1016. //右侧获取事件列表
  1017. getEventList({ day: this.getCurrentDataStr() }).then(res => {
  1018. this.eventList = res.data
  1019. this.eventListAll = res.data
  1020. })
  1021. },
  1022. getWebSocketEvent(data) {
  1023. let that = this
  1024. const event = data
  1025. //右侧获取事件列表
  1026. that.markersList = []
  1027. let markersMap = {
  1028. lng: 124.59,
  1029. lat: 43.02,
  1030. icon: 'marker',
  1031. bindPopupHtml: '',
  1032. click: '',
  1033. parameter: '',
  1034. keepBindPopup: false,
  1035. isAggregation: false
  1036. }
  1037. if (event.eventStatusValue == 'forest_event_status_1' && event.urgeCount == 0) {
  1038. markersMap.click = 'showEventDialog'
  1039. markersMap.icon = 'sj-icon-map-xinshangbao'
  1040. }
  1041. if (event.eventStatusValue == 'forest_event_status_1' && event.urgeCount > 0) {
  1042. markersMap.click = 'showEventDialog'
  1043. markersMap.icon = 'sj-icon-map-cuiban'
  1044. } else if (event.eventStatusValue == 'forest_event_status_2') {
  1045. markersMap.click = 'showEventDialog'
  1046. markersMap.icon = 'sj-icon-map-qianshou'
  1047. markersMap.isAggregation = false
  1048. } else if (event.eventStatusValue == 'forest_event_status_5') {
  1049. markersMap.click = 'showEventDialog'
  1050. markersMap.icon = 'sj-icon-map-banjie'
  1051. markersMap.isAggregation = false
  1052. } else if (event.eventStatusValue == 'forest_event_status_6') {
  1053. markersMap.click = 'showEventDialog'
  1054. markersMap.icon = 'sj-icon-map-guidang'
  1055. } else if (event.eventStatusValue == 'forest_event_status_7') {
  1056. markersMap.click = 'showEventDialog'
  1057. markersMap.icon = 'sj-icon-map-queren'
  1058. }
  1059. markersMap.parameter = event.eventCode
  1060. markersMap.lng = event.longitude
  1061. markersMap.lat = event.latitude
  1062. markersMap.bindPopupHtml = '<div class="map-tip">' +
  1063. '<span>' +
  1064. ' <div class="d-l-con">' +
  1065. ' <div class="d-l-l-text">' +
  1066. ' <h4>经纬度:' + event.longitude + ',' + event.latitude + '</h4>' +
  1067. ' </div>' +
  1068. ' </div>' +
  1069. ' </span>' +
  1070. '<span>' +
  1071. ' <div class="d-l-con">' +
  1072. ' <div class="d-l-l-text">' +
  1073. ' <h4>事件名称:' + event.eventName + '</h4>' +
  1074. ' </div>' +
  1075. ' </div>' +
  1076. ' </span>' +
  1077. '<span>' +
  1078. ' <div class="d-l-con">' +
  1079. ' <div class="d-l-l-text">' +
  1080. ' <h4>事件时间:' + event.createTime + '</h4>' +
  1081. ' </div>' +
  1082. ' </div>' +
  1083. ' </span>';
  1084. if (event.pictureType == 'image' && event.picturePath != null && event.picturePath != '') {
  1085. markersMap.bindPopupHtml += '<span>' +
  1086. ' <div class="d-l-con">' +
  1087. ' <div class="d-l-l-text">' +
  1088. '<img src="' + event.picturePath + '" style="width: 150px;height: 100px"/>' +
  1089. ' </div>' +
  1090. ' </div>' +
  1091. ' </span>'
  1092. }
  1093. markersMap.bindPopupHtml += '</div>'
  1094. that.markersList.push(markersMap)
  1095. setTimeout(() => {
  1096. that.$refs.supermap.setMarkers(that.markersList)
  1097. }, 1000)
  1098. },
  1099. getExposureStage(day, loading) {
  1100. let that = this
  1101. //右侧获取曝光台
  1102. getExposureStage({ eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId, day: day }, loading).then(res => {
  1103. this.exposureStageList = res.data
  1104. })
  1105. },
  1106. /** ----------------------------------weosocket开始------------------------------------- */
  1107. initWebSocket(userId, eventTypeDl, eventType) { //初始化weosocket
  1108. selectConfigKey('KSH_SOCKET').then(res => {
  1109. const wsuri = res.data + userId + '/' + eventTypeDl + '/' + eventType
  1110. this.websock = new WebSocket(wsuri)
  1111. console.log('建立websocket连接')
  1112. this.websock.onopen = this.websocketonopen
  1113. this.websock.onmessage = this.websocketonmessage
  1114. this.websock.onerror = this.websocketonerror
  1115. })
  1116. },
  1117. websocketonopen() { //连接建立之后执行send方法发送数据
  1118. console.log('websocket连接成功')
  1119. this.weosocket = true
  1120. this.sendPing()
  1121. },
  1122. websocketonerror() { //连接建立失败重连
  1123. this.initWebSocket(this.websockSid.userId, this.websockSid.eventTypeDl, this.websockSid.eventType,)
  1124. },
  1125. websocketonmessage(e) { //数据接收
  1126. console.log('接收数据', e.data)
  1127. // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
  1128. let data = "{\"fromId\":\"traffic\"}";
  1129. if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
  1130. // 处理收到的消息
  1131. this.handleWebSoceketEvent(e.data)
  1132. this.getTodayEvents(this.getCurrentDataStr(), false);
  1133. this.getDeptEventCount(this.getCurrentDataStr(), false);
  1134. this.getEventByEventType(this.getCurrentDataStr(), false);
  1135. this.getEventByReportorOrder(this.getCurrentDataStr(), false);
  1136. this.getExposureStage(this.getCurrentDataStr(), false);
  1137. this.$refs.bottomMenu.updateAlert();
  1138. this.$refs.up.play();
  1139. // thes.$refs.up.pause();//停止播放音乐
  1140. }
  1141. },
  1142. // 处理WebSocket事件
  1143. handleWebSoceketEvent(val) {
  1144. let that = this
  1145. let data = JSON.parse(val)
  1146. /**
  1147. * that.markersList.filter( item => data.eventCode == item.parameter).length == 0 如果地图中不存在当前事件则添加
  1148. * eventPush: 事件列表消息
  1149. * */
  1150. if (data.tag == "eventPush" && that.markersList.filter(item => data.eventCode == item.parameter).length == 0) {
  1151. getEventPush({ eventCode: data.eventCode }).then((res) => {
  1152. if (res.data != undefined) {
  1153. //插入到第一条
  1154. this.eventList.unshift(res.data)
  1155. // 插入后删除最后一条 保证列表中为10条数据
  1156. if (this.eventList.length > 9)
  1157. this.eventList.splice(10, 1)
  1158. // 将收到的数据在地图上添加
  1159. this.getWebSocketEvent(res.data)
  1160. }
  1161. })
  1162. }
  1163. console.log(that.eventList[0])
  1164. },
  1165. websocketsend(Data) { //数据发送
  1166. this.websock.send(Data)
  1167. },
  1168. websocketclose(e) { //关闭
  1169. console.log('断开连接', e)
  1170. // clearInterval(this.setIntervalWesocketPush)
  1171. this.weosocket = false
  1172. },
  1173. /**发送心跳
  1174. * @param {number} time 心跳间隔毫秒 默认5000
  1175. * @param {string} ping 心跳名称 默认字符串ping
  1176. */
  1177. sendPing(time = 60000, ping = {
  1178. 'fromId': 'traffic'
  1179. }) {
  1180. clearInterval(this.setIntervalWesocketPush)
  1181. this.setIntervalWesocketPush = setInterval(() => {
  1182. if (this.weosocket) {
  1183. this.websock.send(JSON.stringify(ping))
  1184. } else {
  1185. // this.initWebSocket()
  1186. }
  1187. }, time)
  1188. },
  1189. stopAudio() {
  1190. this.$refs.up.pause(); //停止播放音乐
  1191. this.$refs.up.currentTime = 0;
  1192. },
  1193. /** ----------------------------------weosocket结束------------------------------------- */
  1194. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  1195. bottomMenuList() {
  1196. this.$refs.bottomMenu.selectTaskList()//获取任务列表
  1197. this.$refs.bottomMenu.selectMessageList()//获取消息列表
  1198. },
  1199. showDialog(click) {
  1200. if (click == 'eventLocation') {
  1201. this.$refs.eventLocation.showEventLocation()
  1202. this.$refs.supermap.isEditableLayers = false
  1203. this.$refs.bottomMenu.showChild = false
  1204. this.$refs.bottomMenu.showBanChild = false
  1205. this.$refs.bottomMenu.showChangChild = false
  1206. } else if (click == 'editableLayers') {
  1207. this.$refs.bottomMenu.showChild = false
  1208. this.$refs.bottomMenu.showBanChild = false
  1209. this.$refs.bottomMenu.showChangChild = false
  1210. if (!this.$refs.supermap.isEditableLayers) {
  1211. this.$refs.supermap.isEditableLayers = true
  1212. } else {
  1213. this.$refs.supermap.isEditableLayers = false
  1214. }
  1215. } else if (click == 'layerSwitching') {
  1216. this.$refs.supermap.isEditableLayers = false
  1217. this.$refs.bottomMenu.showBanChild = false
  1218. this.$refs.bottomMenu.showChangChild = false
  1219. if (!this.$refs.bottomMenu.showChild) {
  1220. this.$refs.bottomMenu.showChild = true
  1221. } else {
  1222. this.$refs.bottomMenu.showChild = false
  1223. }
  1224. } else if (click == 'TVWall') {
  1225. this.$refs.TVWall.showTVWall()
  1226. this.$refs.supermap.isEditableLayers = false
  1227. this.$refs.bottomMenu.showChild = false
  1228. this.$refs.bottomMenu.showBanChild = false
  1229. this.$refs.bottomMenu.showChangChild = false
  1230. } else if (click == 'forestban') {
  1231. this.$refs.supermap.isEditableLayers = false
  1232. this.$refs.bottomMenu.showChild = false
  1233. this.$refs.bottomMenu.showChangChild = false
  1234. if (!this.$refs.bottomMenu.showBanChild) {
  1235. this.$refs.bottomMenu.showBanChild = true
  1236. } else {
  1237. this.$refs.bottomMenu.showBanChild = false
  1238. }
  1239. } else if (click == 'forestchang') {
  1240. this.$refs.supermap.isEditableLayers = false
  1241. this.$refs.bottomMenu.showBanChild = false
  1242. this.$refs.bottomMenu.showChild = false
  1243. if (!this.$refs.bottomMenu.showChangChild) {
  1244. this.$refs.bottomMenu.showChangChild = true
  1245. } else {
  1246. this.$refs.bottomMenu.showChangChild = false
  1247. }
  1248. }
  1249. },
  1250. //选择图层
  1251. choseLayerSwitching(url, isClear) {
  1252. this.$refs.supermap.layerSwitching(url, isClear)
  1253. },
  1254. //选择图层(传递数组)
  1255. choseLayerSwitchingList(urlList) {
  1256. this.$refs.supermap.layerSwitchingList(urlList)
  1257. },
  1258. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1259. }
  1260. }
  1261. </script>
  1262. <style rel="stylesheet/scss" lang="scss" scoped>
  1263. @import '@/assets/styles/base.scss';
  1264. .paging {
  1265. padding: .5rem .3rem;
  1266. display: flex;
  1267. justify-content: center;
  1268. align-content: center;
  1269. span {
  1270. color: #2bacf7;
  1271. display: flex;
  1272. align-items: center;
  1273. padding: 0 1rem;
  1274. }
  1275. button {
  1276. padding: 0 0.3rem;
  1277. height: 1.5rem;
  1278. background-color: #112543;
  1279. color: #2bacf7;
  1280. border: 1px solid #33467f;
  1281. }
  1282. button:hover {
  1283. padding: 0 0.3rem;
  1284. height: 1.5rem;
  1285. background-color: #112543;
  1286. color: #0ff7c5;
  1287. border: 1px solid #1d657f;
  1288. }
  1289. }</style>