forest.vue 70 KB

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