forest.vue 58 KB

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