forest.vue 56 KB

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