forest.vue 50 KB

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