forest.vue 56 KB

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