forest.vue 50 KB

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