forest.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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)">
  281. <div class="bgt-img">
  282. <img v-if="item.picturePath!=null&&item.picturePath!=''&& isAssetTypeAnImage(item.picturePath)"
  283. :src="item.picturePath"
  284. style="width: 93px;height: 64px"/>
  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.reportTime }}</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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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(7, 19, 20, .90)" style="padding-bottom: 1rem;" :color="['#0c4b53', '#18caca']">
  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: 20vh; 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: '',
  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 > 50) {
  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. markersMap.isAggregation = false
  561. }
  562. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  563. markersMap.click = 'showEventDialog'
  564. markersMap.icon = 'sj-icon-map-cuiban'
  565. markersMap.isAggregation = false
  566. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  567. markersMap.click = 'showEventDialog'
  568. markersMap.icon = 'sj-icon-map-qianshou'
  569. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  570. markersMap.click = 'showEventDialog'
  571. markersMap.icon = 'sj-icon-map-banjie'
  572. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  573. markersMap.click = 'showEventDialog'
  574. markersMap.icon = 'sj-icon-map-guidnag'
  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].reportTime + '</h4>' +
  598. ' </div>' +
  599. ' </div>' +
  600. ' </span>'
  601. if (this.eventList[i].picturePath != null && this.eventList[i].picturePath != '' && this.isAssetTypeAnImage(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 > 50) {
  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. markersMap.isAggregation = false
  918. }
  919. if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
  920. markersMap.click = 'showEventDialog'
  921. markersMap.icon = 'sj-icon-map-cuiban'
  922. markersMap.isAggregation = false
  923. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
  924. markersMap.click = 'showEventDialog'
  925. markersMap.icon = 'sj-icon-map-qianshou'
  926. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
  927. markersMap.click = 'showEventDialog'
  928. markersMap.icon = 'sj-icon-map-banjie'
  929. } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
  930. markersMap.click = 'showEventDialog'
  931. markersMap.icon = 'sj-icon-map-guidnag'
  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].reportTime + '</h4>' +
  955. ' </div>' +
  956. ' </div>' +
  957. ' </span>'
  958. if (this.eventList[i].picturePath != null && this.eventList[i].picturePath != '' && this.isAssetTypeAnImage(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. // 判断是否为图片
  984. isAssetTypeAnImage(filePath) {
  985. //获取最后一个.的位置
  986. var index = filePath.lastIndexOf('.')
  987. //获取后缀
  988. var ext = filePath.substr(index + 1)
  989. let aa = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].indexOf(ext.toLowerCase()) !== -1
  990. return aa
  991. },
  992. getEventByEventType(day) {
  993. let that = this
  994. //右侧获取事件分类
  995. getEventByEventType({ day: day }).then(res => {
  996. if (res.data != null && res.data.length > 0) {
  997. this.showEventKind = true
  998. this.eventKind.data = res.data
  999. this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
  1000. this.eventKind.showValue = true
  1001. this.eventKind = { ...this.eventKind }
  1002. } else {
  1003. this.showEventKind = false
  1004. this.eventKind = {}
  1005. this.eventKind = { ...this.eventKind }
  1006. }
  1007. })
  1008. },
  1009. getEventByReportorOrder(day) {
  1010. let that = this
  1011. //右侧获取上报排名
  1012. getEventByReportorOrder({ day: day }).then(res => {
  1013. if (res.data != null && res.data.length > 0) {
  1014. this.reportList.data = res.data
  1015. this.reportList = { ...this.reportList }
  1016. } else {
  1017. this.reportList.data = []
  1018. this.reportList = { ...this.reportList }
  1019. }
  1020. })
  1021. },
  1022. getExposureStage(day) {
  1023. let that = this
  1024. //右侧获取曝光台
  1025. getExposureStage({ day: day }).then(res => {
  1026. this.exposureStageList = res.data
  1027. })
  1028. },
  1029. /** ----------------------------------weosocket开始------------------------------------- */
  1030. initWebSocket() { //初始化weosocket
  1031. const wsuri = 'wss://www.hmzzxc.com:10012/websocket/forest-' + Cookies.get('username')
  1032. this.websock = new WebSocket(wsuri)
  1033. console.log('建立websocket连接')
  1034. this.websock.onopen = this.websocketonopen
  1035. this.websock.onmessage = this.websocketonmessage
  1036. this.websock.onerror = this.websocketonerror
  1037. this.websock.onclose = this.websocketclose
  1038. this.websock.onclose = this.websocketclose
  1039. },
  1040. websocketonopen() { //连接建立之后执行send方法发送数据
  1041. console.log('websocket连接成功')
  1042. this.weosocket = true
  1043. this.sendPing()
  1044. },
  1045. websocketonerror() { //连接建立失败重连
  1046. this.initWebSocket()
  1047. },
  1048. websocketonmessage(e) { //数据接收
  1049. console.log('接收数据', e.data)
  1050. },
  1051. websocketsend(Data) { //数据发送
  1052. this.websock.send(Data)
  1053. },
  1054. websocketclose(e) { //关闭
  1055. console.log('断开连接', e)
  1056. // clearInterval(this.setIntervalWesocketPush)
  1057. this.weosocket = false
  1058. },
  1059. /**发送心跳
  1060. * @param {number} time 心跳间隔毫秒 默认5000
  1061. * @param {string} ping 心跳名称 默认字符串ping
  1062. */
  1063. sendPing(time = 5000, ping = {
  1064. 'fromId': 'forest',
  1065. 'fromUserId': Cookies.get('username'),
  1066. 'toUserId': Cookies.get('username')
  1067. }) {
  1068. clearInterval(this.setIntervalWesocketPush)
  1069. this.websock.send(JSON.stringify(ping))
  1070. this.setIntervalWesocketPush = setInterval(() => {
  1071. if (this.weosocket) {
  1072. this.websock.send(JSON.stringify(ping))
  1073. } else {
  1074. this.initWebSocket()
  1075. }
  1076. }, time)
  1077. },
  1078. /** ----------------------------------weosocket结束------------------------------------- */
  1079. /** ----------------------------------底部按钮公用组件开始------------------------------------- */
  1080. showDialog(click) {
  1081. if (click == 'eventLocation') {
  1082. this.$refs.eventLocation.showEventLocation()
  1083. this.$refs.supermap.isEditableLayers = false
  1084. this.$refs.bottomMenu.showChild = false
  1085. this.$refs.bottomMenu.showBanChild = false
  1086. this.$refs.bottomMenu.showChangChild = false
  1087. } else if (click == 'editableLayers') {
  1088. this.$refs.bottomMenu.showChild = false
  1089. this.$refs.bottomMenu.showBanChild = false
  1090. this.$refs.bottomMenu.showChangChild = false
  1091. if (!this.$refs.supermap.isEditableLayers) {
  1092. this.$refs.supermap.isEditableLayers = true
  1093. } else {
  1094. this.$refs.supermap.isEditableLayers = false
  1095. }
  1096. } else if (click == 'layerSwitching') {
  1097. this.$refs.supermap.isEditableLayers = false
  1098. this.$refs.bottomMenu.showBanChild = false
  1099. this.$refs.bottomMenu.showChangChild = false
  1100. if (!this.$refs.bottomMenu.showChild) {
  1101. this.$refs.bottomMenu.showChild = true
  1102. } else {
  1103. this.$refs.bottomMenu.showChild = false
  1104. }
  1105. } else if (click == 'TVWall') {
  1106. this.$refs.TVWall.showTVWall()
  1107. this.$refs.supermap.isEditableLayers = false
  1108. this.$refs.bottomMenu.showChild = false
  1109. this.$refs.bottomMenu.showBanChild = false
  1110. this.$refs.bottomMenu.showChangChild = false
  1111. } else if (click == 'forestban') {
  1112. this.$refs.supermap.isEditableLayers = false
  1113. this.$refs.bottomMenu.showChild = false
  1114. this.$refs.bottomMenu.showChangChild = false
  1115. if (!this.$refs.bottomMenu.showBanChild) {
  1116. this.$refs.bottomMenu.showBanChild = true
  1117. } else {
  1118. this.$refs.bottomMenu.showBanChild = false
  1119. }
  1120. } else if (click == 'forestchang') {
  1121. this.$refs.supermap.isEditableLayers = false
  1122. this.$refs.bottomMenu.showBanChild = false
  1123. this.$refs.bottomMenu.showChild = false
  1124. if (!this.$refs.bottomMenu.showChangChild) {
  1125. this.$refs.bottomMenu.showChangChild = true
  1126. } else {
  1127. this.$refs.bottomMenu.showChangChild = false
  1128. }
  1129. }
  1130. },
  1131. //选择图层
  1132. choseLayerSwitching(url, isClear) {
  1133. this.$refs.supermap.layerSwitching(url, isClear)
  1134. },
  1135. //选择图层(传递数组)
  1136. choseLayerSwitchingList(urlList) {
  1137. this.$refs.supermap.layerSwitchingList(urlList)
  1138. },
  1139. /** ----------------------------------底部按钮公用组件结束------------------------------------- */
  1140. /** ----------------------------------事件弹窗开始------------------------------------- */
  1141. /** ----------------------------------事件弹窗结束------------------------------------- */
  1142. /** ----------------------------------摄像头预览开始------------------------------------- */
  1143. alertLogin: function() {
  1144. this.$modal.msg('登录中....')
  1145. },
  1146. alertLoginSuccess: function() {
  1147. this.$modal.msgSuccess('登录成功!')
  1148. },
  1149. alertLoginFailed: function() {
  1150. this.$modal.msgError('登陆失败!')
  1151. },
  1152. alertReinstall: function() {
  1153. this.$modal.msgWarning('请重新安装客户端')
  1154. },
  1155. /** 预览按钮操作 */
  1156. preview(channelCode) {
  1157. getDahuaVideoServer().then(newResponse => {
  1158. this.ws.detectConnectQt().then(res => {
  1159. if (res) { // 连接客户端成功
  1160. this.alertLogin()
  1161. this.ws.login({
  1162. loginIp: newResponse.loginIp,
  1163. loginPort: newResponse.loginPort,
  1164. userName: newResponse.userName,
  1165. userPwd: newResponse.userPwd,
  1166. token: '',
  1167. https: 1
  1168. })
  1169. this.ws.on('loginState', (res) => {
  1170. this.isLogin = res
  1171. if (res) {
  1172. this.alertLoginSuccess()
  1173. this.activePanel = 'key2'
  1174. this.realTimeVideoDialog(channelCode)
  1175. } else {
  1176. this.alertLoginFailed()
  1177. }
  1178. })
  1179. } else { // 连接客户端失败
  1180. this.alertReinstall()
  1181. }
  1182. })
  1183. })
  1184. },
  1185. realTimeVideoDialog(cameraParams) { // 调用弹窗实时播放接口
  1186. if (!this.isLogin) {
  1187. this.$Message.info('正在登陆客户端,请稍等......')
  1188. return false
  1189. }
  1190. this.ws.openVideo(cameraParams)
  1191. }
  1192. /** ----------------------------------摄像头预览结束------------------------------------- */
  1193. }
  1194. }
  1195. </script>
  1196. <style rel="stylesheet/scss" lang="scss" scoped>
  1197. @import '@/assets/styles/base.scss';
  1198. </style>