forest.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207
  1. <!--可视化公共模板 林业-->
  2. <template>
  3. <div class="visual-con">
  4. <!--头部-->
  5. <vheader></vheader>
  6. <!--主体-->
  7. <div class="visual-body">
  8. <!-- 左侧 -->
  9. <div class="leftbar" ref="left">
  10. <!-- 1 基本情况 -->
  11. <div class="forthis">
  12. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  13. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  14. <div class="this-title">
  15. <span>基本情况</span>
  16. <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
  17. </div>
  18. <div class="i-list-con h-14">
  19. <div class="d-l-con no_hover">
  20. <div class="d-l-l-text w-100p no-weight">
  21. <h4 class="line-h-1 w-100p" v-html="forestInfo">{{ forestInfo }}</h4>
  22. </div>
  23. </div>
  24. </div>
  25. </dv-border-box-13>
  26. </div>
  27. <!-- 2 事件统计-->
  28. <div class="forthis">
  29. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  30. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  31. <div class="i-list-con h-29-5">
  32. <div class="d-l-con no_hover">
  33. <div class="event-count">
  34. <div class="count-number">{{ totalStr.charAt(0) }}</div>
  35. <div class="count-number">{{ totalStr.charAt(1) }}</div>
  36. <div class="count-number">{{ totalStr.charAt(2) }}</div>
  37. <div class="count-number">{{ totalStr.charAt(3) }}</div>
  38. <div class="count-number">{{ totalStr.charAt(4) }}</div>
  39. <div class="count-number">{{ totalStr.charAt(5) }}</div>
  40. <dv-decoration-5
  41. style="width:81%;height:15px;position: absolute; top:4.2rem;z-index: 0; "/>
  42. </div>
  43. </div>
  44. <div class="d-l-con-icon">
  45. <div class="icon-con w-33 flex-d t-a-center">
  46. <dv-decoration-9
  47. style="width: 5.5rem;height: 5.5rem; color:#16e29e;font-size: 1rem;font-weight: bolder;">
  48. {{ newReport_pre }}%
  49. </dv-decoration-9>
  50. <div class="e-state"
  51. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  52. <span>新上报</span> <span>{{ newReport }}</span>
  53. </div>
  54. </div>
  55. <div class="icon-con w-33 flex-d t-a-center">
  56. <dv-decoration-9
  57. style="width: 5.5rem;height: 5.5rem; color:#f18425;font-size: 1rem;font-weight: bolder;">
  58. {{ readySure_pre }}%
  59. </dv-decoration-9>
  60. <div class="e-state"
  61. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  62. <span>处理中</span> <span>{{ readySure }}</span>
  63. </div>
  64. </div>
  65. <div class="icon-con w-33 flex-d t-a-center">
  66. <dv-decoration-9
  67. style="width: 5.5rem;height: 5.5rem; color:#9179f1;font-size: 1rem;font-weight: bolder;">
  68. {{ readyFinish_pre }}%
  69. </dv-decoration-9>
  70. <div class="e-state"
  71. :style="{'background-image':`url(${require('@/assets/images/integrated/state-bg.png')})`}">
  72. <span>已完成</span> <span>{{ readyFinish }}</span>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="d-l-con no_hover">
  77. <div id="chart-event-ai" style="width: 100%;height:6vh;"></div>
  78. </div>
  79. </div>
  80. </dv-border-box-13>
  81. </div>
  82. <!-- 3 组织机构 -->
  83. <div class="forthis">
  84. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
  85. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  86. <div class="i-list-con h-27" style="padding-left: 1rem;">
  87. <el-collapse accordion>
  88. <el-collapse-item v-for="(item,index) in forestFarm" :key="index">
  89. <!-- deptId -->
  90. <template slot="title">
  91. <div class="d-l-con sj-collapse" :class="{on:listCurrentIndex1==item.deptId}"
  92. v-on:click="selectCameraByDeptId(item.deptId)">
  93. <div class="d-l-l-text">
  94. <h4 class="collapse-title">{{ item.deptName }}</h4>
  95. </div>
  96. <div class="d-l-l-count">{{ item.eventCount }}</div>
  97. </div>
  98. </template>
  99. </el-collapse-item>
  100. </el-collapse>
  101. </div>
  102. </dv-border-box-13>
  103. </div>
  104. </div>
  105. <!-- 地图 -->
  106. <supermap ref="supermap" style="width: 100%;height: 100vh;" class="indexSupermapClass" :mapDiv="'forestMap'"
  107. :dynamicPlotting="false"
  108. :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false"
  109. @showEventDialog="showEventDialog"/>
  110. <!-- 右侧 -->
  111. <div class="rightbar rightbar-index" ref="right">
  112. <div class="right-item1">
  113. <!-- 天气 -->
  114. <div class="forthis">
  115. <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)">
  116. <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
  117. <div class="i-list-con small-bottom-margin h-18">
  118. <el-row :gutter="20" v-if="todatWeather">
  119. <el-col :span="9">
  120. <div class="weather-img">
  121. <img v-if="weatherinformationWeather==1" 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(12, 19, 38, .90)" 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;"/>
  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(12, 19, 38, .90)" 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;"/>
  270. </div>
  271. <div class="i-list-con small-bottom-margin h-35">
  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!=''&& item.pictureType=='image'"
  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(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="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(12, 19, 38, .90)" 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;"/>
  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(12, 19, 38, .90)" 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;"/>
  374. </div>
  375. <div class="i-list-con small-bottom-margin h-19">
  376. <dv-scroll-ranking-board :config="reportList" style="width: 100%;height: 300px; padding:.5rem 1rem"/>
  377. </div>
  378. </dv-border-box-13>
  379. </div>
  380. </div>
  381. </div>
  382. <vBottomMenu ref="bottomMenu"></vBottomMenu>
  383. </div>
  384. <eventdetailsdialog ref="eventdetailsdialog" :calendarDay="calendarDay" @getEventList="getEventList"
  385. @getTodayEvents="getTodayEvents"></eventdetailsdialog>
  386. <eventLocation ref="eventLocation"></eventLocation>
  387. <TVWall ref="TVWall"></TVWall>
  388. </div>
  389. </template>
  390. <script>
  391. import dateChoose from '@/views/date.vue'//日历
  392. /** ----------------------------------weosocket开始------------------------------------- */
  393. import Cookies from 'js-cookie'
  394. /** ----------------------------------weosocket结束------------------------------------- */
  395. import {
  396. getBaseInfo,
  397. getTodayEvents,
  398. getDeptEventCount,
  399. getWeather,
  400. getEventList,
  401. getEventByEventType,
  402. getEventByReportorOrder,
  403. getExposureStage
  404. } from '@/api/forest'
  405. import supermap from '@/components/supermap' //超图
  406. import supermapNotProcessed from '@/components/supermap' //超图
  407. import supermapProcessed from '@/components/supermap' //超图
  408. import vheader from '@/components/v-header.vue' //一体化共用头部
  409. import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
  410. import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
  411. import TVWall from '@/components/TVWall.vue' //电视墙弹窗
  412. import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
  413. /** ----------------------------------摄像头预览开始------------------------------------- */
  414. import {
  415. getDahuaVideoServer
  416. } from '@/api/dahua/dahua'
  417. import DHWs from '@/dahua/lib/DHWs'
  418. /** ----------------------------------摄像头预览结束------------------------------------- */
  419. let echarts = require('echarts')
  420. export default {
  421. components: {
  422. supermap,
  423. supermapNotProcessed,
  424. supermapProcessed,
  425. vheader,
  426. vBottomMenu,
  427. eventLocation,
  428. TVWall,
  429. dateChoose,
  430. eventdetailsdialog
  431. },
  432. created() {
  433. /** ----------------------------------摄像头预览开始------------------------------------- */
  434. const DHWsInstance = DHWs.getInstance()
  435. this.ws = DHWsInstance
  436. /** ----------------------------------摄像头预览结束------------------------------------- */
  437. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  438. window.showDialog = this.showDialog
  439. window.choseLayerSwitching = this.choseLayerSwitching
  440. window.choseLayerSwitchingList = this.choseLayerSwitchingList
  441. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  442. },
  443. mounted() {
  444. this.getBaseInfo()
  445. this.getTodayEvents(this.getCurrentDataStr())
  446. this.getDeptEventCount(this.getCurrentDataStr())
  447. this.getWeather(this.getCurrentDataStr())
  448. this.getEventList(this.getCurrentDataStr())
  449. this.getEventByEventType(this.getCurrentDataStr())
  450. this.getEventByReportorOrder(this.getCurrentDataStr())
  451. this.getExposureStage(this.getCurrentDataStr())
  452. /** ----------------------------------weosocket开始------------------------------------- */
  453. // this.initWebSocket()
  454. /** ----------------------------------weosocket结束------------------------------------- */
  455. this.selectTaskList()//获取任务
  456. },
  457. data() {
  458. return {
  459. calendarDay: this.getCurrentDataStr(),
  460. //基本情况
  461. forestInfo: '', //基本情况
  462. //左侧获取事件信息统计
  463. totalStr: '000000',
  464. aiTotal: '',
  465. newReport: '',
  466. otherTotal: '',
  467. readyFinish: '',
  468. readySure: '',
  469. total: '',
  470. aiTotal_pre: '',
  471. newReport_pre: '',
  472. otherTotal_pre: '',
  473. readyFinish_pre: '',
  474. readySure_pre: '',
  475. //左侧部门事件数量
  476. forestFarm: [],
  477. //右侧天气
  478. todatWeather: false,
  479. weatherinformationDirection: '',
  480. weatherinformationHigh: '',
  481. weatherinformationLevel: '',
  482. weatherinformationLevelValue: '',//火险登记中文
  483. weatherinformationLow: '',
  484. weatherinformationPower: '',
  485. weatherinformationTemperature: '',
  486. weatherinformationTime: '',
  487. weatherinformationWeather: '',
  488. //右侧曝光台
  489. exposureStageList: [],
  490. //右侧事件列表
  491. eventList: [],
  492. eventListnew: [],
  493. eventListAll: [],
  494. eventSearch: '',//事件列表搜索
  495. listCurrentIndex1: '',
  496. // ----------------------------------事件分类柱状----------------------------------------
  497. eventKind: {},
  498. showEventKind: false,
  499. // ----------------------------------上报排行----------------------------------------
  500. reportList: {
  501. data: []
  502. },
  503. /** ----------------------------------weosocket开始------------------------------------- */
  504. weosocket: false,
  505. websock: '',
  506. setIntervalWesocketPush: null,
  507. /** ----------------------------------weosocket结束------------------------------------- */
  508. /** ----------------------------------摄像头预览开始------------------------------------- */
  509. activePanel: 'key1',
  510. isLogin: false,
  511. cameraParams: [],
  512. ws: null,
  513. /** ----------------------------------摄像头预览结束------------------------------------- */
  514. markersList: [], //点位列表
  515. cameraList: [] //摄像头列表
  516. }
  517. },
  518. /** ----------------------------------weosocket开始------------------------------------- */
  519. destroyed() { //离开页面关闭Socket连接
  520. if (this.websock) {
  521. clearInterval(this.setIntervalWesocketPush)
  522. this.websock.close()
  523. this.websock = null
  524. }
  525. },
  526. /** ----------------------------------weosocket结束------------------------------------- */
  527. methods: {
  528. searchEvent(eventSearch) {
  529. let that = this
  530. //事件列表搜索
  531. this.eventListnew = []
  532. if (eventSearch != null && eventSearch != '') {
  533. for (var i = 0; i < this.eventListAll.length; i++) {
  534. if (this.eventListAll[i].reportor.indexOf(eventSearch) > -1) {
  535. this.eventListnew.push(this.eventListAll[i])
  536. }
  537. }
  538. this.eventList = this.eventListnew
  539. } else {
  540. this.eventList = this.eventListAll
  541. }
  542. if (this.eventList != null && this.eventList.length > 0) {
  543. for (let i = 0; i < this.eventList.length; i++) {
  544. let markersMap = {
  545. lng: 124.59,
  546. lat: 43.02,
  547. icon: 'marker',
  548. bindPopupHtml: '',
  549. click: '',
  550. parameter: '',
  551. keepBindPopup: false,
  552. isAggregation: false
  553. }
  554. if (this.eventList.length > 200) {
  555. markersMap.isAggregation = true
  556. }
  557. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
  558. markersMap.click = 'showEventDialog'
  559. markersMap.icon = 'sj-icon-map-xinshangbao'
  560. }
  561. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  562. markersMap.click = 'showEventDialog'
  563. markersMap.icon = 'sj-icon-map-cuiban'
  564. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  565. markersMap.click = 'showEventDialog'
  566. markersMap.icon = 'sj-icon-map-qianshou'
  567. markersMap.isAggregation = false
  568. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  569. markersMap.click = 'showEventDialog'
  570. markersMap.icon = 'sj-icon-map-banjie'
  571. markersMap.isAggregation = false
  572. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  573. markersMap.click = 'showEventDialog'
  574. markersMap.icon = 'sj-icon-map-guidang'
  575. }
  576. markersMap.parameter = this.eventList[i].eventCode
  577. markersMap.lng = this.eventList[i].longitude
  578. markersMap.lat = this.eventList[i].latitude
  579. markersMap.bindPopupHtml = '<div class="map-tip">' +
  580. '<span>' +
  581. ' <div class="d-l-con">' +
  582. ' <div class="d-l-l-text">' +
  583. ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  584. ' </div>' +
  585. ' </div>' +
  586. ' </span>' +
  587. '<span>' +
  588. ' <div class="d-l-con">' +
  589. ' <div class="d-l-l-text">' +
  590. ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  591. ' </div>' +
  592. ' </div>' +
  593. ' </span>' +
  594. '<span>' +
  595. ' <div class="d-l-con">' +
  596. ' <div class="d-l-l-text">' +
  597. ' <h4>事件时间:' + this.eventList[i].createTime + '</h4>' +
  598. ' </div>' +
  599. ' </div>' +
  600. ' </span>'
  601. if(this.eventList[i].pictureType=='image'&&this.eventList[i].picturePath != null && this.eventList[i].picturePath != ''){
  602. markersMap.bindPopupHtml += '<span>' +
  603. ' <div class="d-l-con">' +
  604. ' <div class="d-l-l-text">' +
  605. '<img src="' + this.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  606. ' </div>' +
  607. ' </div>' +
  608. ' </span>'
  609. }
  610. markersMap.bindPopupHtml += '</div>'
  611. that.markersList.push(markersMap)
  612. }
  613. setTimeout(() => {
  614. that.$refs.supermap.clearM(false)
  615. that.$refs.supermap.clearM(true)
  616. that.$refs.supermap.setMarkers(that.markersList)
  617. }, 2000)
  618. } else {
  619. setTimeout(() => {
  620. that.$refs.supermap.clearM(false)
  621. that.$refs.supermap.clearM(true)
  622. }, 2000)
  623. }
  624. },
  625. dropLocation(lat, lng) {
  626. this.$refs.supermap.dropLocation(lat, lng)
  627. },
  628. showEventDialog(eventCode) {
  629. //事件信息弹出
  630. this.$refs.eventdetailsdialog.showEventDialog(eventCode)
  631. },
  632. getCurrentDataStr() {
  633. let date = new Date()
  634. let y = date.getFullYear()
  635. let m = date.getMonth() + 1
  636. m = m < 10 ? '0' + m : m
  637. let d = date.getDate()
  638. d = d < 10 ? '0' + d : d
  639. return y + '-' + m + '-' + d
  640. },
  641. selectDay(day) {//日历点击
  642. this.getTodayEvents(day)
  643. this.getDeptEventCount(day)
  644. this.getWeather(day)
  645. this.getEventList(day)
  646. this.getEventByEventType(day)
  647. this.getEventByReportorOrder(day)
  648. this.getExposureStage(day)
  649. this.calendarDay = day
  650. },
  651. //事件数量统计chart 样例地址http://192.144.199.210:8080/editor/index.html?chart_id=jTXf0Rv4A3oiBONB
  652. eventChartAi(aiTotal_pre, otherTotal_pre) {
  653. // 基于准备好的dom,初始化echarts实例
  654. let myChart = echarts.init(document.getElementById('chart-event-ai'))
  655. myChart.setOption({
  656. tooltip: {
  657. trigger: 'none'
  658. },
  659. grid: {
  660. top: '65%',
  661. left: '5%',
  662. right: '5%'
  663. },
  664. yAxis: {
  665. data: ['百分比'],
  666. axisTick: {
  667. show: false
  668. },
  669. axisLine: {
  670. show: false
  671. },
  672. axisLabel: {
  673. show: false
  674. }
  675. },
  676. xAxis: {
  677. splitLine: {
  678. show: false
  679. },
  680. axisTick: {
  681. show: false
  682. },
  683. axisLine: {
  684. show: false
  685. },
  686. axisLabel: {
  687. show: false
  688. }
  689. },
  690. legend: {
  691. data: ['AI', '其他'],
  692. bottom: '5%',
  693. textStyle: {
  694. color: '#1FC3CE',
  695. fontSize: 14
  696. }
  697. },
  698. series: [{
  699. // name: '最上层立体圆',
  700. type: 'pictorialBar',
  701. symbolSize: [10, 20],
  702. symbolOffset: [2, 0],
  703. z: 12,
  704. itemStyle: {
  705. normal: {
  706. color: '#293CA0'
  707. }
  708. },
  709. data: [{
  710. value: 100,
  711. symbolPosition: 'end'
  712. }]
  713. }, {
  714. // name: '中间立体圆',
  715. type: 'pictorialBar',
  716. symbolSize: [10, 20],
  717. symbolOffset: [2, 0],
  718. z: 12,
  719. itemStyle: {
  720. normal: {
  721. color: '#45ac8d'
  722. }
  723. },
  724. data: [{
  725. value: aiTotal_pre,
  726. symbolPosition: 'end'
  727. }]
  728. }, {
  729. // name: '最底部立体圆',
  730. type: 'pictorialBar',
  731. symbolSize: [10, 20],
  732. symbolOffset: [-4, 0],
  733. z: 12,
  734. itemStyle: {
  735. normal: {
  736. color: '#196d59'
  737. }
  738. },
  739. data: [otherTotal_pre]
  740. }, {
  741. name: 'AI',
  742. //底部立体柱
  743. stack: '1',
  744. type: 'bar',
  745. itemStyle: {
  746. normal: {
  747. color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
  748. offset: 0,
  749. color: '#29ac8f'
  750. }, {
  751. offset: 1,
  752. color: '#0a3f3f'
  753. }])
  754. }
  755. },
  756. label: {
  757. normal: {
  758. show: true,
  759. position: 'inside',
  760. offset: [0, 1],
  761. formatter: function(obj) {
  762. return (obj.value).toLocaleString() + '%'
  763. },
  764. textStyle: {
  765. align: 'center',
  766. baseline: 'middle',
  767. fontSize: 14,
  768. fontWeight: '400',
  769. color: '#fff',
  770. textShadowColor: '#000',
  771. textShadowBlur: '0',
  772. textShadowOffsetX: 1,
  773. textShadowOffsetY: 1
  774. }
  775. }
  776. },
  777. silent: true,
  778. barWidth: 20,
  779. barGap: '-100%', // Make series be overlap
  780. data: [aiTotal_pre]
  781. }, {
  782. name: '其他',
  783. //上部立体柱
  784. stack: '1',
  785. type: 'bar',
  786. itemStyle: {
  787. normal: {
  788. color: '#14257B',
  789. opacity: .7
  790. }
  791. },
  792. silent: true,
  793. barWidth: 20,
  794. barGap: '-100%', // Make series be overlap
  795. data: [otherTotal_pre],
  796. // itemStyle: {
  797. // normal: {
  798. // color: 'rgba(29,67,243,1)',
  799. // }
  800. // },
  801. label: {
  802. normal: {
  803. show: true,
  804. position: 'inside',
  805. offset: [0, 1],
  806. formatter: function(obj) {
  807. return (obj.value).toLocaleString() + '%'
  808. },
  809. textStyle: {
  810. align: 'center',
  811. baseline: 'middle',
  812. fontSize: 14,
  813. fontWeight: '400',
  814. color: '#fff',
  815. textShadowColor: '#000',
  816. textShadowBlur: '0',
  817. textShadowOffsetX: 1,
  818. textShadowOffsetY: 1
  819. }
  820. }
  821. }
  822. }]
  823. })
  824. },
  825. selectTaskList() {
  826. this.$refs.bottomMenu.selectTaskList()
  827. },
  828. getBaseInfo() {
  829. //左侧获取部门信息
  830. getBaseInfo().then(res => {
  831. if (res.code == 200) {
  832. if (res.msg == '未找到部门信息') {
  833. this.forestInfo = '未找到部门信息!'
  834. } else {
  835. this.forestInfo = res.data.baseinfo //基本情况
  836. }
  837. }
  838. })
  839. },
  840. getTodayEvents(day) {
  841. let that = this
  842. //左侧获取事件信息统计
  843. getTodayEvents({ day: day }).then(res => {
  844. this.aiTotal = res.data.aiTotal
  845. this.aiTotal_pre = res.data.aiTotal_pre
  846. this.newReport = res.data.newReport
  847. this.newReport_pre = res.data.newReport_pre
  848. this.otherTotal = res.data.otherTotal
  849. this.otherTotal_pre = res.data.otherTotal_pre
  850. this.readyFinish = res.data.readyFinish
  851. this.readyFinish_pre = res.data.readyFinish_pre
  852. this.readySure = res.data.readySure
  853. this.readySure_pre = res.data.readySure_pre
  854. this.totalStr = res.data.totalStr
  855. this.total = res.data.total
  856. this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
  857. })
  858. },
  859. getDeptEventCount(day) {
  860. let that = this
  861. //左侧获取事件部门数量
  862. getDeptEventCount({ day: day }).then(res => {
  863. this.forestFarm = res.data
  864. })
  865. },
  866. getWeather(day) {
  867. let that = this
  868. //右侧获取天气信息
  869. getWeather({ day: day }).then(res => {
  870. if (res.code == 200) {
  871. if (res.msg == '天气未添加') {
  872. this.todatWeather = false
  873. } else {
  874. this.todatWeather = true
  875. this.weatherinformationDirection = res.data.weatherinformationDirection
  876. this.weatherinformationHigh = res.data.weatherinformationHigh
  877. this.weatherinformationLevel = res.data.weatherinformationLevel
  878. this.weatherinformationLevelValue = res.data.weatherinformationLevelValue
  879. this.weatherinformationLow = res.data.weatherinformationLow
  880. this.weatherinformationPower = res.data.weatherinformationPower
  881. this.weatherinformationTemperature = res.data.weatherinformationTemperature
  882. this.weatherinformationTime = res.data.weatherinformationTime
  883. this.weatherinformationWeather = res.data.weatherinformationWeather
  884. }
  885. } else {
  886. this.todatWeather = false
  887. }
  888. })
  889. },
  890. getEventList(day) {
  891. let that = this
  892. this.eventList = []
  893. this.eventListAll = []
  894. //右侧获取事件列表
  895. getEventList({ day: day }).then(res => {
  896. this.eventList = res.data
  897. this.eventListAll = res.data
  898. that.markersList = []
  899. if (this.eventList != null && this.eventList.length > 0) {
  900. for (let i = 0; i < this.eventList.length; i++) {
  901. let markersMap = {
  902. lng: 124.59,
  903. lat: 43.02,
  904. icon: 'marker',
  905. bindPopupHtml: '',
  906. click: '',
  907. parameter: '',
  908. keepBindPopup: false,
  909. isAggregation: false
  910. }
  911. if (this.eventList.length > 200) {
  912. markersMap.isAggregation = true
  913. }
  914. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount == 0) {
  915. markersMap.click = 'showEventDialog'
  916. markersMap.icon = 'sj-icon-map-xinshangbao'
  917. }
  918. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  919. markersMap.click = 'showEventDialog'
  920. markersMap.icon = 'sj-icon-map-cuiban'
  921. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  922. markersMap.click = 'showEventDialog'
  923. markersMap.icon = 'sj-icon-map-qianshou'
  924. markersMap.isAggregation = false
  925. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  926. markersMap.click = 'showEventDialog'
  927. markersMap.icon = 'sj-icon-map-banjie'
  928. markersMap.isAggregation = false
  929. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  930. markersMap.click = 'showEventDialog'
  931. markersMap.icon = 'sj-icon-map-guidang'
  932. }
  933. markersMap.parameter = this.eventList[i].eventCode
  934. markersMap.lng = this.eventList[i].longitude
  935. markersMap.lat = this.eventList[i].latitude
  936. markersMap.bindPopupHtml = '<div class="map-tip">' +
  937. '<span>' +
  938. ' <div class="d-l-con">' +
  939. ' <div class="d-l-l-text">' +
  940. ' <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
  941. ' </div>' +
  942. ' </div>' +
  943. ' </span>' +
  944. '<span>' +
  945. ' <div class="d-l-con">' +
  946. ' <div class="d-l-l-text">' +
  947. ' <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
  948. ' </div>' +
  949. ' </div>' +
  950. ' </span>' +
  951. '<span>' +
  952. ' <div class="d-l-con">' +
  953. ' <div class="d-l-l-text">' +
  954. ' <h4>事件时间:' + this.eventList[i].createTime + '</h4>' +
  955. ' </div>' +
  956. ' </div>' +
  957. ' </span>';
  958. if(this.eventList[i].pictureType=='image'&&this.eventList[i].picturePath != null && this.eventList[i].picturePath != ''){
  959. markersMap.bindPopupHtml += '<span>' +
  960. ' <div class="d-l-con">' +
  961. ' <div class="d-l-l-text">' +
  962. '<img src="' + this.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
  963. ' </div>' +
  964. ' </div>' +
  965. ' </span>'
  966. }
  967. markersMap.bindPopupHtml += '</div>'
  968. that.markersList.push(markersMap)
  969. }
  970. setTimeout(() => {
  971. that.$refs.supermap.clearM(false)
  972. that.$refs.supermap.clearM(true)
  973. that.$refs.supermap.setMarkers(that.markersList)
  974. }, 2000)
  975. } else {
  976. setTimeout(() => {
  977. that.$refs.supermap.clearM(false)
  978. that.$refs.supermap.clearM(true)
  979. }, 2000)
  980. }
  981. })
  982. },
  983. getEventByEventType(day) {
  984. let that = this
  985. //右侧获取事件分类
  986. getEventByEventType({ day: day }).then(res => {
  987. if (res.data != null && res.data.length > 0) {
  988. this.showEventKind = true
  989. this.eventKind.data = res.data
  990. this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
  991. this.eventKind.showValue = true
  992. this.eventKind = { ...this.eventKind }
  993. } else {
  994. this.showEventKind = false
  995. this.eventKind = {}
  996. this.eventKind = { ...this.eventKind }
  997. }
  998. })
  999. },
  1000. getEventByReportorOrder(day) {
  1001. let that = this
  1002. //右侧获取上报排名
  1003. getEventByReportorOrder({ day: day }).then(res => {
  1004. if (res.data != null && res.data.length > 0) {
  1005. this.reportList.data = res.data
  1006. this.reportList = { ...this.reportList }
  1007. } else {
  1008. this.reportList.data = []
  1009. this.reportList = { ...this.reportList }
  1010. }
  1011. })
  1012. },
  1013. getExposureStage(day) {
  1014. let that = this
  1015. //右侧获取曝光台
  1016. getExposureStage({ day: day }).then(res => {
  1017. this.exposureStageList = res.data
  1018. })
  1019. },
  1020. /** ----------------------------------weosocket开始------------------------------------- */
  1021. initWebSocket() { //初始化weosocket
  1022. const wsuri = 'wss://www.hmzzxc.com:10012/websocket/forest-' + Cookies.get('username')
  1023. this.websock = new WebSocket(wsuri)
  1024. console.log('建立websocket连接')
  1025. this.websock.onopen = this.websocketonopen
  1026. this.websock.onmessage = this.websocketonmessage
  1027. this.websock.onerror = this.websocketonerror
  1028. this.websock.onclose = this.websocketclose
  1029. this.websock.onclose = this.websocketclose
  1030. },
  1031. websocketonopen() { //连接建立之后执行send方法发送数据
  1032. console.log('websocket连接成功')
  1033. this.weosocket = true
  1034. this.sendPing()
  1035. },
  1036. websocketonerror() { //连接建立失败重连
  1037. this.initWebSocket()
  1038. },
  1039. websocketonmessage(e) { //数据接收
  1040. console.log('接收数据', e.data)
  1041. },
  1042. websocketsend(Data) { //数据发送
  1043. this.websock.send(Data)
  1044. },
  1045. websocketclose(e) { //关闭
  1046. console.log('断开连接', e)
  1047. // clearInterval(this.setIntervalWesocketPush)
  1048. this.weosocket = false
  1049. },
  1050. /**发送心跳
  1051. * @param {number} time 心跳间隔毫秒 默认5000
  1052. * @param {string} ping 心跳名称 默认字符串ping
  1053. */
  1054. sendPing(time = 5000, ping = {
  1055. 'fromId': 'forest',
  1056. 'fromUserId': Cookies.get('username'),
  1057. 'toUserId': Cookies.get('username')
  1058. }) {
  1059. clearInterval(this.setIntervalWesocketPush)
  1060. this.websock.send(JSON.stringify(ping))
  1061. this.setIntervalWesocketPush = setInterval(() => {
  1062. if (this.weosocket) {
  1063. this.websock.send(JSON.stringify(ping))
  1064. } else {
  1065. this.initWebSocket()
  1066. }
  1067. }, time)
  1068. },
  1069. /** ----------------------------------weosocket结束------------------------------------- */
  1070. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  1071. showDialog(click) {
  1072. if (click == 'eventLocation') {
  1073. this.$refs.eventLocation.showEventLocation()
  1074. this.$refs.supermap.isEditableLayers = false
  1075. this.$refs.bottomMenu.showChild = false
  1076. this.$refs.bottomMenu.showBanChild = false
  1077. this.$refs.bottomMenu.showChangChild = false
  1078. } else if (click == 'editableLayers') {
  1079. this.$refs.bottomMenu.showChild = false
  1080. this.$refs.bottomMenu.showBanChild = false
  1081. this.$refs.bottomMenu.showChangChild = false
  1082. if (!this.$refs.supermap.isEditableLayers) {
  1083. this.$refs.supermap.isEditableLayers = true
  1084. } else {
  1085. this.$refs.supermap.isEditableLayers = false
  1086. }
  1087. } else if (click == 'layerSwitching') {
  1088. this.$refs.supermap.isEditableLayers = false
  1089. this.$refs.bottomMenu.showBanChild = false
  1090. this.$refs.bottomMenu.showChangChild = false
  1091. if (!this.$refs.bottomMenu.showChild) {
  1092. this.$refs.bottomMenu.showChild = true
  1093. } else {
  1094. this.$refs.bottomMenu.showChild = false
  1095. }
  1096. } else if (click == 'TVWall') {
  1097. this.$refs.TVWall.showTVWall()
  1098. this.$refs.supermap.isEditableLayers = false
  1099. this.$refs.bottomMenu.showChild = false
  1100. this.$refs.bottomMenu.showBanChild = false
  1101. this.$refs.bottomMenu.showChangChild = false
  1102. } else if (click == 'forestban') {
  1103. this.$refs.supermap.isEditableLayers = false
  1104. this.$refs.bottomMenu.showChild = false
  1105. this.$refs.bottomMenu.showChangChild = false
  1106. if (!this.$refs.bottomMenu.showBanChild) {
  1107. this.$refs.bottomMenu.showBanChild = true
  1108. } else {
  1109. this.$refs.bottomMenu.showBanChild = false
  1110. }
  1111. } else if (click == 'forestchang') {
  1112. this.$refs.supermap.isEditableLayers = false
  1113. this.$refs.bottomMenu.showBanChild = false
  1114. this.$refs.bottomMenu.showChild = false
  1115. if (!this.$refs.bottomMenu.showChangChild) {
  1116. this.$refs.bottomMenu.showChangChild = true
  1117. } else {
  1118. this.$refs.bottomMenu.showChangChild = false
  1119. }
  1120. }
  1121. },
  1122. //选择图层
  1123. choseLayerSwitching(url, isClear) {
  1124. this.$refs.supermap.layerSwitching(url, isClear)
  1125. },
  1126. //选择图层(传递数组)
  1127. choseLayerSwitchingList(urlList) {
  1128. this.$refs.supermap.layerSwitchingList(urlList)
  1129. },
  1130. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1131. /** ----------------------------------事件弹窗开始------------------------------------- */
  1132. /** ----------------------------------事件弹窗结束------------------------------------- */
  1133. /** ----------------------------------摄像头预览开始------------------------------------- */
  1134. alertLogin: function() {
  1135. this.$modal.msg('登录中....')
  1136. },
  1137. alertLoginSuccess: function() {
  1138. this.$modal.msgSuccess('登录成功!')
  1139. },
  1140. alertLoginFailed: function() {
  1141. this.$modal.msgError('登陆失败!')
  1142. },
  1143. alertReinstall: function() {
  1144. this.$modal.msgWarning('请重新安装客户端')
  1145. },
  1146. /** 预览按钮操作 */
  1147. preview(channelCode) {
  1148. getDahuaVideoServer().then(newResponse => {
  1149. this.ws.detectConnectQt().then(res => {
  1150. if (res) { // 连接客户端成功
  1151. this.alertLogin()
  1152. this.ws.login({
  1153. loginIp: newResponse.loginIp,
  1154. loginPort: newResponse.loginPort,
  1155. userName: newResponse.userName,
  1156. userPwd: newResponse.userPwd,
  1157. token: '',
  1158. https: 1
  1159. })
  1160. this.ws.on('loginState', (res) => {
  1161. this.isLogin = res
  1162. if (res) {
  1163. this.alertLoginSuccess()
  1164. this.activePanel = 'key2'
  1165. this.realTimeVideoDialog(channelCode)
  1166. } else {
  1167. this.alertLoginFailed()
  1168. }
  1169. })
  1170. } else { // 连接客户端失败
  1171. this.alertReinstall()
  1172. }
  1173. })
  1174. })
  1175. },
  1176. realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
  1177. if (!this.isLogin) {
  1178. this.$Message.info('正在登陆客户端,请稍等......')
  1179. return false
  1180. }
  1181. this.ws.openVideo(cameraParams)
  1182. }
  1183. /** ----------------------------------摄像头预览结束------------------------------------- */
  1184. }
  1185. }
  1186. </script>
  1187. <style rel="stylesheet/scss" lang="scss" scoped>
  1188. @import '@/assets/styles/base.scss';
  1189. </style>