forest.vue 54 KB

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