water.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  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"
  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)">
  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)" 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)" 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)" 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)" 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)" 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 chart from "./from/dvCapsuleChart.vue";
  459. /** ----------------------------------摄像头预览开始------------------------------------- */
  460. import {
  461. getDahuaVideoServer
  462. } from '@/api/dahua/dahua'
  463. // import DHWs from '@/dahua/lib/DHWs'
  464. import Firespread from "./firespread";
  465. /** ----------------------------------摄像头预览结束------------------------------------- */
  466. let echarts = require('echarts')
  467. export default {
  468. components: {
  469. Firespread,
  470. supermap,
  471. chart,
  472. // supermapNotProcessed,
  473. // supermapProcessed,
  474. vheader,
  475. vBottomMenu,
  476. eventLocation,
  477. TVWall,
  478. dateChoose,
  479. eventdetailsdialog,
  480. firespread
  481. },
  482. created() {
  483. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  484. window.showDialog = this.showDialog
  485. window.choseLayerSwitching = this.choseLayerSwitching
  486. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  487. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  488. },
  489. mounted() {
  490. this.getBaseInfo()
  491. this.getTodayEvents(this.getCurrentDataStr())
  492. this.getDeptEventCount(this.getCurrentDataStr())
  493. this.getWeather(this.getCurrentDataStr())
  494. this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum)
  495. this.getEventByEventType(this.getCurrentDataStr())
  496. this.getEventByReportorOrder(this.getCurrentDataStr())
  497. this.getExposureStage(this.getCurrentDataStr())
  498. this.getSupermap(this.getCurrentDataStr())
  499. this.getMenuEventType()
  500. /** ----------------------------------weosocket开始------------------------------------- */
  501. // this.initWebSocket()
  502. /** ----------------------------------weosocket结束------------------------------------- */
  503. setInterval(() => {
  504. if (this.calendarDay == this.getCurrentDataStr()) {
  505. this.getTodayEvents(this.getCurrentDataStr(), true);
  506. this.getDeptEventCount(this.getCurrentDataStr(), true);
  507. // this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum, '', true);
  508. this.getEventByEventType(this.getCurrentDataStr(), true);
  509. this.getEventByReportorOrder(this.getCurrentDataStr(), true);
  510. this.getExposureStage(this.getCurrentDataStr(), true);
  511. // this.getSupermap(this.getCurrentDataStr(), true);
  512. }
  513. }, 30000)
  514. this.bottomMenuList() //获取底部公共组件消息和任务
  515. },
  516. data() {
  517. return {
  518. //警报MP3文件
  519. audioSrc: require('@/assets/jingbao.mp3'),
  520. calendarDay: this.getCurrentDataStr(),
  521. //基本情况
  522. forestInfo: '', //基本情况
  523. //左侧获取事件信息统计
  524. totalStr: '000000',
  525. aiTotal: '',
  526. newReport: '',
  527. otherTotal: '',
  528. readyFinish: '',
  529. readySure: '',
  530. total: '',
  531. aiTotal_pre: '',
  532. newReport_pre: '',
  533. otherTotal_pre: '',
  534. readyFinish_pre: '',
  535. readySure_pre: '',
  536. //左侧部门事件数量
  537. forestFarm: [],
  538. //右侧天气
  539. todatWeather: false,
  540. weatherinformationDirection: '',
  541. weatherinformationHigh: '',
  542. weatherinformationLevel: '',
  543. weatherinformationLevelValue: '', //火险登记中文
  544. weatherinformationLow: '',
  545. weatherinformationPower: '',
  546. weatherinformationTemperature: '',
  547. weatherinformationTime: '',
  548. weatherinformationWeather: '',
  549. //右侧曝光台
  550. exposureStageList: [],
  551. //右侧事件列表
  552. eventList: [],
  553. pageSize: 10,
  554. pageNum: 1,
  555. eventTypeIdDl:[],
  556. eventTypeId:[],
  557. eventListnew: [],
  558. eventListAll: [],
  559. eventSearch: '', //事件列表搜索
  560. listCurrentIndex1: '',
  561. // ----------------------------------事件分类柱状----------------------------------------
  562. eventKind: {},
  563. showEventKind: false,
  564. // ----------------------------------上报排行----------------------------------------
  565. reportList: {
  566. data: []
  567. },
  568. /** ----------------------------------weosocket开始------------------------------------- */
  569. weosocket: false,
  570. websock: '',
  571. setIntervalWesocketPush: null,
  572. websockSid: {
  573. userId: '',
  574. eventTypeDl: '',
  575. eventType: '',
  576. },
  577. /** ----------------------------------weosocket结束------------------------------------- */
  578. /** ----------------------------------摄像头预览开始------------------------------------- */
  579. activePanel: 'key1',
  580. isLogin: false,
  581. cameraParams: [],
  582. ws: null,
  583. /** ----------------------------------摄像头预览结束------------------------------------- */
  584. markersList: [], //点位列表
  585. cameraList: [] //摄像头列表
  586. }
  587. },
  588. /** ----------------------------------weosocket开始------------------------------------- */
  589. destroyed() { //离开页面关闭Socket连接
  590. if (this.websock) {
  591. clearInterval(this.setIntervalWesocketPush)
  592. this.websock.close()
  593. this.websock = null
  594. }
  595. },
  596. /** ----------------------------------weosocket结束------------------------------------- */
  597. methods: {
  598. getMenuEventType() {
  599. let that = this
  600. getMenuEventType().then(res => {
  601. that.websockSid.userId = Cookies.get('userId')
  602. that.websockSid.eventTypeDl = res.data.eventTypeDl
  603. that.websockSid.eventType = res.data.eventType
  604. that.initWebSocket(that.websockSid.userId, that.websockSid.eventTypeDl, that.websockSid.eventType)
  605. console.log(that.websockSid)
  606. })
  607. },
  608. setEventTypeId(data) {
  609. // let data = {eventTypeIdDl: [], eventTypeId: []}
  610. // let data = {eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId}
  611. let that = this
  612. that.eventTypeIdDl = data.eventTypeIdDl
  613. that.eventTypeId = data.eventTypeId
  614. that.getSupermap(that.calendarDay, false)
  615. that.getTodayEvents(that.calendarDay, false)
  616. that.getEventByEventType(that.calendarDay, false)
  617. that.getExposureStage(that.calendarDay, false)
  618. that.getEventByReportorOrder(that.calendarDay, false)
  619. that.getDeptEventCount(that.calendarDay, false)
  620. that.getEventList(that.calendarDay, that.pageSize, that.pageNum, '', false)
  621. },
  622. // searchEvent(pageSize,pageNum,eventSearch) {
  623. // this.pageSize = pageSize;
  624. // this.pageNum = pageNum;
  625. // let that = this
  626. // //事件列表搜索
  627. // this.eventList = []
  628. // //右侧获取事件列表
  629. // getEventList({ day: that.calendarDay,pageSize:pageSize,pageNum: pageNum ,eventName:eventSearch}).then(res => {
  630. // this.eventList = res.data
  631. // if (this.eventList != null && this.eventList.length > 0) {
  632. // if(this.eventList[0].eventStatusValue == 'forest_event_status_1'){
  633. // that.$refs.bottomMenu.updateAlert();
  634. // that.$refs.up.play();
  635. // }
  636. // }
  637. // })
  638. // },
  639. dropLocation(lat, lng) {
  640. this.$refs.supermap.dropLocation(lat, lng)
  641. },
  642. showEventDialog(eventCode) {
  643. //事件信息弹出
  644. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  645. },
  646. getFirespread(eventCode) {
  647. this.$refs.firespread.showEventDialog(eventCode);
  648. },
  649. getCurrentDataStr() {
  650. let date = new Date()
  651. let y = date.getFullYear()
  652. let m = date.getMonth() + 1
  653. m = m < 10 ? '0' + m : m
  654. let d = date.getDate()
  655. d = d < 10 ? '0' + d : d
  656. return y + '-' + m + '-' + d
  657. },
  658. selectDay(day) { //日历点击
  659. this.getTodayEvents(day)
  660. this.getDeptEventCount(day)
  661. this.getWeather(day)
  662. this.getEventList(day, 10, 1)
  663. this.getEventByEventType(day)
  664. this.getEventByReportorOrder(day)
  665. this.getExposureStage(day)
  666. this.getSupermap(day);
  667. this.calendarDay = day
  668. },
  669. //事件数量统计chart 样例地址http://192.144.199.210:8080/editor/index.html?chart_id=jTXf0Rv4A3oiBONB
  670. eventChartAi(aiTotal_pre, otherTotal_pre) {
  671. // 基于准备好的dom,初始化echarts实例
  672. let myChart = echarts.init(document.getElementById('chart-event-ai'))
  673. myChart.setOption({
  674. tooltip: {
  675. trigger: 'none'
  676. },
  677. grid: {
  678. top: '65%',
  679. left: '5%',
  680. right: '5%'
  681. },
  682. yAxis: {
  683. data: ['百分比'],
  684. axisTick: {
  685. show: false
  686. },
  687. axisLine: {
  688. show: false
  689. },
  690. axisLabel: {
  691. show: false
  692. }
  693. },
  694. xAxis: {
  695. splitLine: {
  696. show: false
  697. },
  698. axisTick: {
  699. show: false
  700. },
  701. axisLine: {
  702. show: false
  703. },
  704. axisLabel: {
  705. show: false
  706. }
  707. },
  708. legend: {
  709. data: ['AI', '其他'],
  710. bottom: '5%',
  711. textStyle: {
  712. color: '#1FC3CE',
  713. fontSize: 14
  714. }
  715. },
  716. series: [{
  717. // name: '最上层立体圆',
  718. type: 'pictorialBar',
  719. symbolSize: [10, 20],
  720. symbolOffset: [2, 0],
  721. z: 12,
  722. itemStyle: {
  723. normal: {
  724. color: '#293CA0'
  725. }
  726. },
  727. data: [{
  728. value: 100,
  729. symbolPosition: 'end'
  730. }]
  731. }, {
  732. // name: '中间立体圆',
  733. type: 'pictorialBar',
  734. symbolSize: [10, 20],
  735. symbolOffset: [2, 0],
  736. z: 12,
  737. itemStyle: {
  738. normal: {
  739. color: '#45ac8d'
  740. }
  741. },
  742. data: [{
  743. value: aiTotal_pre,
  744. symbolPosition: 'end'
  745. }]
  746. }, {
  747. // name: '最底部立体圆',
  748. type: 'pictorialBar',
  749. symbolSize: [10, 20],
  750. symbolOffset: [-4, 0],
  751. z: 12,
  752. itemStyle: {
  753. normal: {
  754. color: '#196d59'
  755. }
  756. },
  757. data: [otherTotal_pre]
  758. }, {
  759. name: 'AI',
  760. //底部立体柱
  761. stack: '1',
  762. type: 'bar',
  763. itemStyle: {
  764. normal: {
  765. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  766. offset: 0,
  767. color: '#29ac8f'
  768. }, {
  769. offset: 1,
  770. color: '#0a3f3f'
  771. }])
  772. }
  773. },
  774. label: {
  775. normal: {
  776. show: true,
  777. position: 'inside',
  778. offset: [0, 1],
  779. formatter: function (obj) {
  780. return (obj.value).toLocaleString() + '%'
  781. },
  782. textStyle: {
  783. align: 'center',
  784. baseline: 'middle',
  785. fontSize: 14,
  786. fontWeight: '400',
  787. color: '#fff',
  788. textShadowColor: '#000',
  789. textShadowBlur: '0',
  790. textShadowOffsetX: 1,
  791. textShadowOffsetY: 1
  792. }
  793. }
  794. },
  795. silent: true,
  796. barWidth: 20,
  797. barGap: '-100%', // Make series be overlap
  798. data: [aiTotal_pre]
  799. }, {
  800. name: '其他',
  801. //上部立体柱
  802. stack: '1',
  803. type: 'bar',
  804. itemStyle: {
  805. normal: {
  806. color: '#14257B',
  807. opacity: .7
  808. }
  809. },
  810. silent: true,
  811. barWidth: 20,
  812. barGap: '-100%', // Make series be overlap
  813. data: [otherTotal_pre],
  814. // itemStyle: {
  815. // normal: {
  816. // color: 'rgba(29,67,243,1)',
  817. // }
  818. // },
  819. label: {
  820. normal: {
  821. show: true,
  822. position: 'inside',
  823. offset: [0, 1],
  824. formatter: function (obj) {
  825. return (obj.value).toLocaleString() + '%'
  826. },
  827. textStyle: {
  828. align: 'center',
  829. baseline: 'middle',
  830. fontSize: 14,
  831. fontWeight: '400',
  832. color: '#fff',
  833. textShadowColor: '#000',
  834. textShadowBlur: '0',
  835. textShadowOffsetX: 1,
  836. textShadowOffsetY: 1
  837. }
  838. }
  839. }
  840. }]
  841. })
  842. },
  843. getBaseInfo() {
  844. //左侧获取部门信息
  845. getBaseInfo().then(res => {
  846. if (res.code == 200) {
  847. if (res.msg == '未找到部门信息') {
  848. this.forestInfo = '未找到部门信息!'
  849. } else {
  850. this.forestInfo = res.data.baseinfo //基本情况
  851. }
  852. }
  853. })
  854. },
  855. getTodayEvents(day, loading) {
  856. let that = this
  857. //左侧获取事件信息统计
  858. getTodayEvents({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
  859. this.aiTotal = res.data.aiTotal
  860. this.aiTotal_pre = res.data.aiTotal_pre
  861. this.newReport = res.data.newReport
  862. this.newReport_pre = res.data.newReport_pre
  863. this.otherTotal = res.data.otherTotal
  864. this.otherTotal_pre = res.data.otherTotal_pre
  865. this.readyFinish = res.data.readyFinish
  866. this.readyFinish_pre = res.data.readyFinish_pre
  867. this.readySure = res.data.readySure
  868. this.readySure_pre = res.data.readySure_pre
  869. this.totalStr = res.data.totalStr
  870. this.total = res.data.total
  871. this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
  872. })
  873. },
  874. getDeptEventCount(day, loading) {
  875. let that = this
  876. //左侧获取事件部门数量
  877. getDeptEventCount({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
  878. this.forestFarm = res.data
  879. })
  880. },
  881. getWeather(day) {
  882. let that = this
  883. //右侧获取天气信息
  884. getWeather({day: day}).then(res => {
  885. if (res.code == 200) {
  886. if (res.msg == '天气未添加') {
  887. this.todatWeather = false
  888. } else {
  889. this.todatWeather = true
  890. this.weatherinformationDirection = res.data.weatherinformationDirection
  891. this.weatherinformationHigh = res.data.weatherinformationHigh
  892. this.weatherinformationLevel = res.data.weatherinformationLevel
  893. this.weatherinformationLevelValue = res.data.weatherinformationLevelValue
  894. this.weatherinformationLow = res.data.weatherinformationLow
  895. this.weatherinformationPower = res.data.weatherinformationPower
  896. this.weatherinformationTemperature = res.data.weatherinformationTemperature
  897. this.weatherinformationTime = res.data.weatherinformationTime
  898. this.weatherinformationWeather = res.data.weatherinformationWeather
  899. }
  900. } else {
  901. this.todatWeather = false
  902. }
  903. })
  904. },
  905. getSupermap(day, loading) {
  906. let that = this
  907. getNearEvent('', '', day, loading, that.eventTypeIdDl, that.eventTypeId).then(res => {
  908. that.markersList = [];
  909. if (res.data != null && res.data.length > 0) {
  910. for (let i = 0; i < res.data.length; i++) {
  911. let markersMap = {
  912. lng: 124.59,
  913. lat: 43.02,
  914. icon: 'marker',
  915. bindPopupHtml: '',
  916. click: '',
  917. parameter: '',
  918. keepBindPopup: false,
  919. isAggregation: false
  920. }
  921. if (res.data.length > 200) {
  922. markersMap.isAggregation = true
  923. }
  924. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount == 0) {
  925. markersMap.click = 'showEventDialog'
  926. markersMap.icon = 'sj-icon-map-xinshangbao'
  927. }
  928. if (res.data[i].eventStatusValue == 'forest_event_status_1' && res.data[i].urgeCount > 0) {
  929. markersMap.click = 'showEventDialog'
  930. markersMap.icon = 'sj-icon-map-cuiban'
  931. } else if (res.data[i].eventStatusValue == 'forest_event_status_2') {
  932. markersMap.click = 'showEventDialog'
  933. markersMap.icon = 'sj-icon-map-qianshou'
  934. markersMap.isAggregation = false
  935. } else if (res.data[i].eventStatusValue == 'forest_event_status_5') {
  936. markersMap.click = 'showEventDialog'
  937. markersMap.icon = 'sj-icon-map-banjie'
  938. markersMap.isAggregation = false
  939. } else if (res.data[i].eventStatusValue == 'forest_event_status_6') {
  940. markersMap.click = 'showEventDialog'
  941. markersMap.icon = 'sj-icon-map-guidang'
  942. } else if (res.data[i].eventStatusValue == 'forest_event_status_7') {
  943. markersMap.click = 'showEventDialog'
  944. markersMap.icon = 'sj-icon-map-queren'
  945. }
  946. markersMap.parameter = res.data[i].eventCode
  947. markersMap.lng = res.data[i].longitude
  948. markersMap.lat = res.data[i].latitude
  949. markersMap.bindPopupHtml = '<div class="map-tip">' +
  950. '<span>' +
  951. ' <div class="d-l-con">' +
  952. ' <div class="d-l-l-text">' +
  953. ' <h4>经纬度:' + res.data[i].longitude + ',' + res.data[i].latitude + '</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].eventName + '</h4>' +
  961. ' </div>' +
  962. ' </div>' +
  963. ' </span>' +
  964. '<span>' +
  965. ' <div class="d-l-con">' +
  966. ' <div class="d-l-l-text">' +
  967. ' <h4>事件时间:' + res.data[i].createTime + '</h4>' +
  968. ' </div>' +
  969. ' </div>' +
  970. ' </span>';
  971. if (res.data[i].pictureType == 'image' && res.data[i].picturePath != null && res.data[i].picturePath != '') {
  972. markersMap.bindPopupHtml += '<span>' +
  973. ' <div class="d-l-con">' +
  974. ' <div class="d-l-l-text">' +
  975. '<img src="' + res.data[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  976. ' </div>' +
  977. ' </div>' +
  978. ' </span>'
  979. }
  980. markersMap.bindPopupHtml += '</div>'
  981. that.markersList.push(markersMap)
  982. }
  983. setTimeout(() => {
  984. that.$refs.supermap.clearM(false)
  985. that.$refs.supermap.clearM(true)
  986. that.$refs.supermap.setMarkers(that.markersList)
  987. }, 2000)
  988. } else {
  989. setTimeout(() => {
  990. that.$refs.supermap.clearM(false)
  991. that.$refs.supermap.clearM(true)
  992. }, 2000)
  993. }
  994. })
  995. },
  996. getEventList(day, pageSize, pageNum, eventSearch, loading) {
  997. if (pageNum < 1) {
  998. this.$modal.msg('当前已是第一页')
  999. return;
  1000. }
  1001. this.pageSize = pageSize;
  1002. this.pageNum = pageNum;
  1003. let that = this
  1004. this.eventList = []
  1005. //右侧获取事件列表
  1006. getEventList({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId, day: day, pageSize: pageSize, pageNum: pageNum, eventName: eventSearch}, loading).then(res => {
  1007. this.eventList = res.data
  1008. if (this.eventList != null && this.eventList.length > 0) {
  1009. if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
  1010. that.$refs.bottomMenu.updateAlert();
  1011. that.$refs.up.play();
  1012. } else {
  1013. that.$refs.bottomMenu.updateAlertFalse();
  1014. }
  1015. }
  1016. })
  1017. },
  1018. getEventByEventType(day, loading) {
  1019. let that = this
  1020. //右侧获取事件分类
  1021. getEventByEventType({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId, day: day}, loading).then(res => {
  1022. if (res.data != null && res.data.length > 0) {
  1023. this.showEventKind = true
  1024. this.eventKind.data = res.data
  1025. this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
  1026. this.eventKind.showValue = true
  1027. this.eventKind = {...this.eventKind}
  1028. } else {
  1029. this.showEventKind = false
  1030. this.eventKind = {}
  1031. this.eventKind = {...this.eventKind}
  1032. }
  1033. })
  1034. },
  1035. getEventByReportorOrder(day, loading) {
  1036. let that = this
  1037. //右侧获取上报排名
  1038. getEventByReportorOrder({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
  1039. if (res.data != null && res.data.length > 0) {
  1040. this.reportList.data = res.data
  1041. this.reportList = {...this.reportList}
  1042. } else {
  1043. this.reportList.data = []
  1044. this.reportList = {...this.reportList}
  1045. }
  1046. })
  1047. },
  1048. getEventListNew() {
  1049. this.eventList = []
  1050. this.eventListAll = []
  1051. //右侧获取事件列表
  1052. getEventList({day: this.getCurrentDataStr()}).then(res => {
  1053. this.eventList = res.data
  1054. this.eventListAll = res.data
  1055. })
  1056. },
  1057. getWebSocketEvent(data) {
  1058. let that = this
  1059. const event = data //右侧获取事件列表
  1060. that.markersList = []
  1061. let markersMap = {
  1062. lng: 124.59,
  1063. lat: 43.02,
  1064. icon: 'marker',
  1065. bindPopupHtml: '',
  1066. click: '',
  1067. parameter: '',
  1068. keepBindPopup: false,
  1069. isAggregation: false
  1070. }
  1071. if (event.eventStatusValue == 'forest_event_status_1' && event.urgeCount == 0) {
  1072. markersMap.click = 'showEventDialog'
  1073. markersMap.icon = 'sj-icon-map-xinshangbao'
  1074. }
  1075. if (event.eventStatusValue == 'forest_event_status_1' && event.urgeCount > 0) {
  1076. markersMap.click = 'showEventDialog'
  1077. markersMap.icon = 'sj-icon-map-cuiban'
  1078. } else if (event.eventStatusValue == 'forest_event_status_2') {
  1079. markersMap.click = 'showEventDialog'
  1080. markersMap.icon = 'sj-icon-map-qianshou'
  1081. markersMap.isAggregation = false
  1082. } else if (event.eventStatusValue == 'forest_event_status_5') {
  1083. markersMap.click = 'showEventDialog'
  1084. markersMap.icon = 'sj-icon-map-banjie'
  1085. markersMap.isAggregation = false
  1086. } else if (event.eventStatusValue == 'forest_event_status_6') {
  1087. markersMap.click = 'showEventDialog'
  1088. markersMap.icon = 'sj-icon-map-guidang'
  1089. } else if (event.eventStatusValue == 'forest_event_status_7') {
  1090. markersMap.click = 'showEventDialog'
  1091. markersMap.icon = 'sj-icon-map-queren'
  1092. }
  1093. markersMap.parameter = event.eventCode
  1094. markersMap.lng = event.longitude
  1095. markersMap.lat = event.latitude
  1096. markersMap.bindPopupHtml = '<div class="map-tip">' +
  1097. '<span>' +
  1098. ' <div class="d-l-con">' +
  1099. ' <div class="d-l-l-text">' +
  1100. ' <h4>经纬度:' + event.longitude + ',' + event.latitude + '</h4>' +
  1101. ' </div>' +
  1102. ' </div>' +
  1103. ' </span>' +
  1104. '<span>' +
  1105. ' <div class="d-l-con">' +
  1106. ' <div class="d-l-l-text">' +
  1107. ' <h4>事件名称:' + event.eventName + '</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.createTime + '</h4>' +
  1115. ' </div>' +
  1116. ' </div>' +
  1117. ' </span>';
  1118. if (event.pictureType == 'image' && event.picturePath != null && event.picturePath != '') {
  1119. markersMap.bindPopupHtml += '<span>' +
  1120. ' <div class="d-l-con">' +
  1121. ' <div class="d-l-l-text">' +
  1122. '<img src="' + event.picturePath + '" style="width: 150px;height: 100px"/>' +
  1123. ' </div>' +
  1124. ' </div>' +
  1125. ' </span>'
  1126. }
  1127. markersMap.bindPopupHtml += '</div>'
  1128. that.markersList.push(markersMap)
  1129. setTimeout(() => {
  1130. that.$refs.supermap.setMarkers(that.markersList)
  1131. }, 1000)
  1132. },
  1133. getExposureStage(day, loading) {
  1134. let that = this
  1135. //右侧获取曝光台
  1136. getExposureStage({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
  1137. this.exposureStageList = res.data
  1138. })
  1139. },
  1140. /** ----------------------------------weosocket开始------------------------------------- */
  1141. initWebSocket(userId, eventTypeDl, eventType) { //初始化weosocket
  1142. const wsuri = 'ws://127.0.0.1:10003/eventPush/' + userId + '/' + eventTypeDl + '/' + eventType
  1143. this.websock = new WebSocket(wsuri)
  1144. console.log('建立websocket连接')
  1145. this.websock.onopen = this.websocketonopen
  1146. this.websock.onmessage = this.websocketonmessage
  1147. this.websock.onerror = this.websocketonerror
  1148. },
  1149. websocketonopen() { //连接建立之后执行send方法发送数据
  1150. console.log('websocket连接成功')
  1151. this.weosocket = true
  1152. this.sendPing()
  1153. },
  1154. websocketonerror() { //连接建立失败重连
  1155. this.initWebSocket(this.websockSid.userId, this.websockSid.eventTypeDl, this.websockSid.eventType,)
  1156. },
  1157. websocketonmessage(e) { //数据接收
  1158. console.log('接收数据', e.data)
  1159. // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
  1160. let data = "{\"fromId\":\"forest\",\"fromUserId\":\"admin\",\"toUserId\":\"admin\"}";
  1161. if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
  1162. // 处理收到的消息
  1163. this.handleWebSoceketEvent(e.data)
  1164. // this.getEventListNew();
  1165. // this.getTodayEvents(this.getCurrentDataStr());
  1166. // this.getDeptEventCount(this.getCurrentDataStr());
  1167. // this.getEventByEventType(this.getCurrentDataStr());
  1168. // this.getEventByReportorOrder(this.getCurrentDataStr());
  1169. // this.$refs.bottomMenu.updateAlert();
  1170. // this.$refs.up.play();
  1171. // thes.$refs.up.pause();//停止播放音乐
  1172. }
  1173. },
  1174. // 处理WebSocket事件
  1175. handleWebSoceketEvent(val) {
  1176. let that = this
  1177. let data = JSON.parse(val)
  1178. /**
  1179. * that.markersList.filter( item => data.eventCode == item.parameter).length == 0 如果地图中不存在当前事件则添加
  1180. * eventPush: 事件列表消息
  1181. * */
  1182. if (data.tag == "eventPush" && that.markersList.filter( item => data.eventCode == item.parameter).length == 0) {
  1183. getEventPush({eventCode: data.eventCode}).then((res) => {
  1184. if (res.data != undefined) {
  1185. //插入到第一条
  1186. this.eventList.unshift(res.data)
  1187. // 插入后删除最后一条 保证列表中为10条数据
  1188. if (this.eventList.length > 9)
  1189. this.eventList.splice(10, 1)
  1190. // 将收到的数据在地图上添加
  1191. this.getWebSocketEvent(res.data)
  1192. }
  1193. })
  1194. }
  1195. console.log(that.eventList[0])
  1196. },
  1197. websocketsend(Data) { //数据发送
  1198. this.websock.send(Data)
  1199. },
  1200. websocketclose(e) { //关闭
  1201. console.log('断开连接', e)
  1202. // clearInterval(this.setIntervalWesocketPush)
  1203. this.weosocket = false
  1204. },
  1205. /**发送心跳
  1206. * @param {number} time 心跳间隔毫秒 默认5000
  1207. * @param {string} ping 心跳名称 默认字符串ping
  1208. */
  1209. sendPing(time = 60000, ping = {
  1210. 'fromId': 'forest',
  1211. 'fromUserId': Cookies.get('username'),
  1212. 'toUserId': Cookies.get('username')
  1213. }) {
  1214. clearInterval(this.setIntervalWesocketPush)
  1215. this.setIntervalWesocketPush = setInterval(() => {
  1216. if (this.weosocket) {
  1217. this.websock.send(JSON.stringify(ping))
  1218. } else {
  1219. // this.initWebSocket()
  1220. }
  1221. }, time)
  1222. },
  1223. stopAudio() {
  1224. this.$refs.up.pause(); //停止播放音乐
  1225. this.$refs.up.currentTime = 0;
  1226. },
  1227. /** ----------------------------------weosocket结束------------------------------------- */
  1228. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  1229. bottomMenuList() {
  1230. this.$refs.bottomMenu.selectTaskList()//获取任务列表
  1231. this.$refs.bottomMenu.selectMessageList()//获取消息列表
  1232. },
  1233. showDialog(click) {
  1234. if (click == 'eventLocation') {
  1235. this.$refs.eventLocation.showEventLocation()
  1236. this.$refs.supermap.isEditableLayers = false
  1237. this.$refs.bottomMenu.showChild = false
  1238. this.$refs.bottomMenu.showBanChild = false
  1239. this.$refs.bottomMenu.showChangChild = false
  1240. } else if (click == 'editableLayers') {
  1241. this.$refs.bottomMenu.showChild = false
  1242. this.$refs.bottomMenu.showBanChild = false
  1243. this.$refs.bottomMenu.showChangChild = false
  1244. if (!this.$refs.supermap.isEditableLayers) {
  1245. this.$refs.supermap.isEditableLayers = true
  1246. } else {
  1247. this.$refs.supermap.isEditableLayers = false
  1248. }
  1249. } else if (click == 'layerSwitching') {
  1250. this.$refs.supermap.isEditableLayers = false
  1251. this.$refs.bottomMenu.showBanChild = false
  1252. this.$refs.bottomMenu.showChangChild = false
  1253. if (!this.$refs.bottomMenu.showChild) {
  1254. this.$refs.bottomMenu.showChild = true
  1255. } else {
  1256. this.$refs.bottomMenu.showChild = false
  1257. }
  1258. } else if (click == 'TVWall') {
  1259. this.$refs.TVWall.showTVWall()
  1260. this.$refs.supermap.isEditableLayers = false
  1261. this.$refs.bottomMenu.showChild = false
  1262. this.$refs.bottomMenu.showBanChild = false
  1263. this.$refs.bottomMenu.showChangChild = false
  1264. } else if (click == 'forestban') {
  1265. this.$refs.supermap.isEditableLayers = false
  1266. this.$refs.bottomMenu.showChild = false
  1267. this.$refs.bottomMenu.showChangChild = false
  1268. if (!this.$refs.bottomMenu.showBanChild) {
  1269. this.$refs.bottomMenu.showBanChild = true
  1270. } else {
  1271. this.$refs.bottomMenu.showBanChild = false
  1272. }
  1273. } else if (click == 'forestchang') {
  1274. this.$refs.supermap.isEditableLayers = false
  1275. this.$refs.bottomMenu.showBanChild = false
  1276. this.$refs.bottomMenu.showChild = false
  1277. if (!this.$refs.bottomMenu.showChangChild) {
  1278. this.$refs.bottomMenu.showChangChild = true
  1279. } else {
  1280. this.$refs.bottomMenu.showChangChild = false
  1281. }
  1282. }
  1283. },
  1284. //选择图层
  1285. choseLayerSwitching(url, isClear) {
  1286. this.$refs.supermap.layerSwitching(url, isClear)
  1287. },
  1288. //选择图层(传递数组)
  1289. choseLayerSwitchingList(urlList) {
  1290. this.$refs.supermap.layerSwitchingList(urlList)
  1291. },
  1292. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1293. }
  1294. }
  1295. </script>
  1296. <style rel="stylesheet/scss" lang="scss" scoped>
  1297. @import '@/assets/styles/base.scss';
  1298. .paging {
  1299. padding: .5rem .3rem;
  1300. display: flex;
  1301. justify-content: center;
  1302. align-content: center;
  1303. span {
  1304. color: #2bacf7;
  1305. display: flex;
  1306. align-items: center;
  1307. padding: 0 1rem;
  1308. }
  1309. button {
  1310. padding: 0 0.3rem;
  1311. height: 1.5rem;
  1312. background-color: #112543;
  1313. color: #2bacf7;
  1314. border: 1px solid #33467f;
  1315. }
  1316. button:hover {
  1317. padding: 0 0.3rem;
  1318. height: 1.5rem;
  1319. background-color: #112543;
  1320. color: #0ff7c5;
  1321. border: 1px solid #1d657f;
  1322. }
  1323. }
  1324. </style>