forest.vue 58 KB

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