fire-data-analysis.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  1. <template>
  2. <el-row class="contentBox">
  3. <transition name="el-fade-in-linear">
  4. <el-col class="leftBox" v-show="stroes.$state.leftBtn">
  5. <div class="leftTop2">
  6. <h4>火灾信息统计</h4>
  7. <div class="threeBox">
  8. <div class="flexBoxE11">
  9. <el-row class="hzxxtj">
  10. <el-col :span="8" >
  11. 财产损失:<Strong>{{ hzxxtj.a1 }}</Strong> 万
  12. </el-col>
  13. <el-col :span="8">
  14. 火灾总数:<Strong>{{ hzxxtj.a2 }}</Strong> 起
  15. </el-col>
  16. <el-col :span="8">
  17. 重大火灾:<Strong>{{ hzxxtj.a3 }}</Strong> 起
  18. </el-col>
  19. <el-col :span="8">
  20. 亡人数:<Strong>{{ hzxxtj.a4 }}</Strong> 人
  21. </el-col>
  22. <el-col :span="8">
  23. 过火面积:<Strong>{{ hzxxtj.a5 }}</Strong>㎡
  24. </el-col>
  25. <el-col :span="8">
  26. 较大火灾:<Strong>{{ hzxxtj.a6 }}</Strong> 起
  27. </el-col>
  28. <el-col :span="8">
  29. 伤人数:<Strong>{{ hzxxtj.a7 }}</Strong>人
  30. </el-col>
  31. <el-col :span="8">
  32. 特大火灾:<Strong>{{ hzxxtj.a8 }}</Strong>起
  33. </el-col>
  34. <el-col :span="8">
  35. 轻微火灾:<Strong>{{ hzxxtj.a9 }}</Strong> 起
  36. </el-col>
  37. </el-row>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="leftBot">
  42. <div style="display: flex">
  43. <h4>火灾原因占比</h4>
  44. <div
  45. style="
  46. display: flex;
  47. border-bottom: 0.0125rem solid
  48. rgba(115, 251, 253, 0.5);
  49. "
  50. >
  51. <el-button
  52. size="mini"
  53. @click="vsClick('isVsFirePie')"
  54. class="btnClick"
  55. >
  56. {{ isVsFirePie ? "返回" : "对比" }}
  57. </el-button>
  58. </div>
  59. </div>
  60. <el-row class="threeBox">
  61. <div
  62. class="flexBoxE"
  63. :style="{
  64. 'padding-top': isVsFirePie ? '0.02rem' : 0,
  65. }"
  66. >
  67. <el-form
  68. v-show="isVsFirePie"
  69. :inline="true"
  70. size="mini"
  71. :model="fireCauseRatioObj"
  72. >
  73. <el-form-item label="街道:">
  74. <el-select
  75. @change="getFireCause(1)"
  76. v-model="fireCauseRatioObj.address"
  77. placeholder="选择街道"
  78. filterable
  79. clearable
  80. >
  81. <el-option
  82. :label="item"
  83. :value="item"
  84. v-for="item in fireAddressList"
  85. :key="item"
  86. ></el-option>
  87. </el-select>
  88. </el-form-item>
  89. </el-form>
  90. <!-- 饼图 -->
  91. <fire-pie
  92. ref="firePie1"
  93. :dataMap="fireCauseRatioList"
  94. :isVs="isVsFirePie"
  95. :radius="isVsFirePie ? 60 : 60"
  96. ></fire-pie>
  97. </div>
  98. <div class="line" v-show="isVsFirePie"></div>
  99. <div class="flexBoxE" v-show="isVsFirePie">
  100. <el-form
  101. v-show="isVsFirePie"
  102. :inline="true"
  103. size="mini"
  104. :model="fireCauseRatioObj"
  105. >
  106. <el-form-item label="街道:">
  107. <el-select
  108. @change="getFireCause(2)"
  109. v-model="fireCauseRatioObj.address2"
  110. placeholder="选择街道"
  111. filterable
  112. clearable
  113. >
  114. <el-option
  115. :label="item"
  116. :value="item"
  117. v-for="item in fireAddressList"
  118. :key="item"
  119. ></el-option>
  120. </el-select>
  121. </el-form-item>
  122. </el-form>
  123. <fire-pie
  124. style="flex: 1"
  125. ref="firePie2"
  126. :dataMap="fireCauseRatioList2"
  127. :isVs="isVsFirePie"
  128. :radius="isVsFirePie ? 80 : 80"
  129. ></fire-pie>
  130. </div>
  131. <!-- <div class="VS" @click="vsClick('isVsFirePie')" :style="{ 'font-size': isVsFirePie ? '.15rem' : '.15rem' }">
  132. {{ isVsFirePie ? "返回" : "对比" }}
  133. </div> -->
  134. </el-row>
  135. </div>
  136. <div class="leftTop">
  137. <div style="display: flex">
  138. <h4>火灾趋势图</h4>
  139. <div
  140. style="
  141. display: flex;
  142. border-bottom: 0.0125rem solid
  143. rgba(115, 251, 253, 0.5);
  144. "
  145. >
  146. <el-button
  147. size="mini"
  148. @click="searchTime(1)"
  149. :class="{ btnClick: timeArea === 1 }"
  150. >近一年</el-button
  151. >
  152. <el-button
  153. size="mini"
  154. @click="searchTime(3)"
  155. :class="{ btnClick: timeArea === 3 }"
  156. >近三年</el-button
  157. >
  158. <el-button
  159. size="mini"
  160. @click="searchTime(5)"
  161. :class="{ btnClick: timeArea === 5 }"
  162. >近五年</el-button
  163. >
  164. </div>
  165. </div>
  166. <div class="leftTopContent">
  167. <div class="selectBar">
  168. <el-form
  169. :inline="true"
  170. size="mini"
  171. :model="barForm"
  172. >
  173. <el-form-item label="">
  174. <el-select
  175. v-model="barForm.address"
  176. @change="getTrend()"
  177. filterable
  178. clearable
  179. placeholder="街道"
  180. >
  181. <el-option
  182. :label="item"
  183. :value="item"
  184. v-for="(
  185. item, ind
  186. ) in fireAddressList"
  187. :key="ind"
  188. ></el-option>
  189. </el-select>
  190. </el-form-item>
  191. <el-form-item label="">
  192. <el-select
  193. @change="getTrend()"
  194. v-model="barForm.fireType"
  195. placeholder="火灾原因"
  196. filterable
  197. clearable
  198. >
  199. <el-option
  200. :value="item"
  201. v-for="(item, ind) in fireTypeList"
  202. :key="ind"
  203. ></el-option>
  204. </el-select>
  205. </el-form-item>
  206. <el-form-item label="">
  207. <el-select
  208. @change="getTrend()"
  209. v-model="barForm.fireType2"
  210. placeholder="起火场所"
  211. filterable
  212. clearable
  213. >
  214. <el-option
  215. :value="item"
  216. v-for="(item, ind) in fireTypeList2"
  217. :key="ind"
  218. ></el-option>
  219. </el-select>
  220. </el-form-item>
  221. </el-form>
  222. </div>
  223. <el-row class="fireBar">
  224. <!-- 折线图 -->
  225. <category-line
  226. ref="categoryLine"
  227. :dataMap="timeData"
  228. ></category-line>
  229. </el-row>
  230. </div>
  231. </div>
  232. </el-col>
  233. </transition>
  234. <transition name="el-fade-in-linear">
  235. <el-col class="centerBox" style="width: 100%">
  236. <div
  237. :class="
  238. stroes.$state.leftBtn ? 'leftBtn btnW' : 'leftBtn0 btnW'
  239. "
  240. @click="stores.leftBtnClick()"
  241. >
  242. <img src="@/assets/img/svg/left.svg" alt="" class="img" />
  243. </div>
  244. <el-col class="centerContent" id="mapF"></el-col>
  245. <div
  246. :class="
  247. stroes.$state.rightBtn
  248. ? 'rightBtn btnW'
  249. : 'rightBtn0 btnW'
  250. "
  251. @click="stores.rightBtnClick()"
  252. >
  253. <img src="@/assets/img/svg/left.svg" alt="" class="img" />
  254. </div>
  255. <div class="mapTips_type">
  256. <img
  257. src="@/assets/img/svg/danweitop.svg"
  258. alt=""
  259. class="img"
  260. />
  261. <div class="content">
  262. <p>街镇筛选</p>
  263. <el-select
  264. class="mtb-12"
  265. v-model="stroes.$state.streetTown"
  266. placeholder="请选择街镇"
  267. @change="checkStreetTown"
  268. >
  269. <el-option
  270. v-for="item in stroes.$state.streetTownList"
  271. :key="item.value"
  272. :label="item.label"
  273. :value="item.value"
  274. >
  275. </el-option>
  276. </el-select>
  277. <p>类型筛选</p>
  278. <div class="selectType">
  279. <div @click="checkboxChange(0)" :class="checkedArray.checkedData[0] == 0 ? 'checkTypeSelect' : ''">
  280. <img :src="stores.sadianIcon.wrhz" alt="" />
  281. <span>亡人火灾</span>
  282. </div>
  283. <div @click="checkboxChange(2)" :class="checkedArray.checkedData[0] == 2 ? 'checkTypeSelect' : ''">
  284. <img :src="stores.sadianIcon.srhz" alt="" />
  285. <span>伤人火灾</span>
  286. </div>
  287. <div @click="checkboxChange(1)" :class="checkedArray.checkedData[0] == 1 ? 'checkTypeSelect' : ''">
  288. <img :src="stores.sadianIcon.lshz" alt="" />
  289. <span>历史火灾</span>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </el-col>
  295. </transition>
  296. <transition name="el-fade-in-linear">
  297. <el-col class="rightBox" v-show="stroes.$state.rightBtn">
  298. <el-col class="rightTop">
  299. <!-- <h4>火灾情况分析</h4> -->
  300. <div style="display: flex">
  301. <h4>典型火灾案例</h4>
  302. <div
  303. style="
  304. display: flex;
  305. border-bottom: 0.0125rem solid
  306. rgba(115, 251, 253, 0.5);
  307. "
  308. >
  309. <el-button
  310. size="mini"
  311. @click="fireCase(1)"
  312. :class="{ btnClick: tabsArea == 'qg' }"
  313. >
  314. 全国
  315. </el-button>
  316. <el-button
  317. size="mini"
  318. @click="fireCase(2)"
  319. :class="{ btnClick: tabsArea == 'bs' }"
  320. >
  321. 本市
  322. </el-button>
  323. <el-button
  324. size="mini"
  325. @click="fireCase(3)"
  326. :class="{ btnClick: tabsArea == 'bq' }"
  327. >
  328. 本区
  329. </el-button>
  330. </div>
  331. </div>
  332. <div class="contentNew" style="height:44vh;overflow-y: scroll;">
  333. <p v-for="(item,index) in fireCaseData" :key="index">
  334. {{ index + 1}}、{{ item.caseBrief }} <a :href="item.fileUrl" v-if="item.fileUrl" target="_blank" style="color:#73fbfd">查看详情</a>
  335. </p>
  336. </div>
  337. </el-col>
  338. <el-col class="rightBot">
  339. <!-- <h4>详细火灾情况</h4> -->
  340. <h4>火灾统计</h4>
  341. <div class="rightBotCenter">
  342. <pie5
  343. :dataMap="pieData"
  344. ></pie5>
  345. <el-table
  346. ref="seTable"
  347. :key="windowWidth"
  348. :data="tableData"
  349. class="transparentTableRow"
  350. height="100%"
  351. :cell-class-name="tableRowClassName"
  352. style="display:none"
  353. >
  354. <!-- <el-table-column
  355. show-overflow-tooltip
  356. min-width="20"
  357. v-for="item in headerData"
  358. :key="item.prop"
  359. :prop="item.prop"
  360. align="center"
  361. :label="item.name"
  362. >
  363. <template
  364. v-if="item.prop === 'address'"
  365. #default="scope"
  366. >
  367. <el-popover
  368. trigger="click"
  369. placement="left"
  370. >
  371. <template #default>
  372. <div class="tableTooltip">
  373. <div class="tableTitle">
  374. <div>详细火灾情况</div>
  375. </div>
  376. <el-row class="tableContent">
  377. <el-col :span="24"
  378. >火灾地址:{{
  379. scope.row.address
  380. }}</el-col
  381. >
  382. <el-col :span="12"
  383. >过火面积:{{
  384. scope.row
  385. .burnedArea
  386. }}(m²)</el-col
  387. >
  388. <el-col :span="12"
  389. >财产损失:{{
  390. scope.row
  391. .propertyLoss
  392. }}(万)</el-col
  393. >
  394. <el-col :span="12"
  395. >死亡人数:{{
  396. scope.row.deathToll
  397. }}(人)</el-col
  398. >
  399. <el-col :span="12"
  400. >受伤人数:{{
  401. scope.row.nonFatal
  402. }}(人)</el-col
  403. >
  404. <el-col
  405. :span="12"
  406. v-if="scope.row.nature"
  407. >场所性质:{{
  408. scope.row.nature
  409. }}</el-col
  410. >
  411. <el-col
  412. :span="24"
  413. v-if="
  414. scope.row.fireCause
  415. "
  416. >火灾原因:{{
  417. scope.row.fireCause
  418. }}</el-col
  419. >
  420. <el-col :span="24"
  421. >起火物:{{
  422. scope.row
  423. .fireGoodsOne
  424. }}</el-col
  425. >
  426. </el-row>
  427. </div>
  428. </template>
  429. <template #reference>
  430. <div>
  431. {{ scope.row.address }}
  432. </div>
  433. </template>
  434. </el-popover>
  435. </template>
  436. </el-table-column> -->
  437. </el-table>
  438. </div>
  439. </el-col>
  440. </el-col>
  441. </transition>
  442. </el-row>
  443. </template>
  444. <script>
  445. import pie5 from "@c/pie/index5";
  446. import linstener from "@c/mixins/linstener";
  447. import categoryLine from "@c/category-line";
  448. import firePie from "@c/fire-pie";
  449. import scatter from "@c/scatter";
  450. import map from "@c/mixins/map-data1";
  451. // import map from "@c/mixins/map-gaode-public";
  452. export default {
  453. components: { categoryLine, firePie, scatter, pie5 },
  454. mixins: [linstener, map, ],
  455. data() {
  456. return {
  457. hzxxtj:{
  458. a1:100,
  459. a2:200,
  460. a3:100,
  461. a4:100,
  462. a5:100,
  463. a6:100,
  464. a7:100,
  465. a8:100,
  466. a9:100,
  467. },//火灾信息统计
  468. fireCaseData:[],//火灾案例
  469. pieData:[
  470. {value:2,name:"亡人火灾数"},
  471. {value:138,name:"本月全区火灾总数"},
  472. {value:1047,name:"本年度火灾总数"},
  473. {value:502,name:"平均过火面积"},
  474. ],//饼图数据
  475. tabsArea:"qg",//国、市、区
  476. stores: this.$useStore(),
  477. checkedArray: {
  478. checkedData: [1],
  479. checkedList: [
  480. { value: 0, label: "亡人火灾" },
  481. { value: 1, label: "历史火灾" },
  482. { value: 2, label: "伤人火灾" },
  483. ],
  484. }, //类型筛选
  485. box: null,
  486. tableData: [
  487. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  488. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  489. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  490. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  491. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  492. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  493. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  494. // {"address":"x街道45号","burnedArea":"2","propertyLoss":"5","deathToll":"0","nonFatal":"1","disasterHome":"2","nature":"居民","fireCause":"家电","fireGoodsOne":"电视机"},
  495. ],
  496. headerData: [
  497. { prop: "address", name: "火灾地址" },
  498. { prop: "burnedArea", name: "过火面积" },
  499. { prop: "propertyLoss", name: "财产损失" },
  500. { prop: "deathToll", name: "死亡人数" },
  501. { prop: "nonFatal", name: "受伤人数" },
  502. // { prop: "disasterHome", name: "受灾户" },
  503. // { prop: "nature", name: "场所性质" },
  504. // { prop: "fireCause", name: "火灾原因" },
  505. { prop: "fireGoodsOne", name: "起火物" },
  506. ],
  507. // headerData: [
  508. // { prop: "address", name: "火灾地址" },
  509. // { prop: "burnedArea", name: "过火面积(m²)" },
  510. // { prop: "propertyLoss", name: "财产损失(万元)" },
  511. // { prop: "deathToll", name: "死亡人数(人)" },
  512. // { prop: "nonFatal", name: "受伤人数(人)" },
  513. // { prop: "disasterHome", name: "受灾户(户)" },
  514. // { prop: "nature", name: "场所性质" },
  515. // { prop: "fireCause", name: "火灾原因" },
  516. // { prop: "fireGoodsOne", name: "起火物" },
  517. // ],
  518. fireAddressList: [],
  519. fireTypeList: [],
  520. fireTypeList2: [
  521. "厂房",
  522. "交通工具",
  523. "住宅",
  524. "垃圾及废弃物",
  525. "交通枢纽站",
  526. "宿舍",
  527. "物资仓储场所",
  528. "其他",
  529. ],//起火场所
  530. fireCauseRatioList: [],
  531. fireCauseRatioList2: [],
  532. fireCauseRatioObj: {
  533. address: "",
  534. address2: "",
  535. },
  536. tabObj: {
  537. address: "",
  538. address2: "",
  539. },
  540. timeData: [],
  541. fireBubbleList: [],
  542. barForm: {
  543. fireType: "",
  544. fireType2: "",
  545. address: "",
  546. },
  547. timeArea: 1,
  548. isScroll: true,
  549. };
  550. },
  551. created() {
  552. this.getData();
  553. },
  554. watch: {
  555. isVsFirePie(val) {
  556. if (!val) {
  557. this.fireCauseRatioObj.address = "";
  558. this.getFireCause(1);
  559. }
  560. },
  561. },
  562. mounted() {
  563. // // 通过$refs获取dom元素
  564. // this.box = this.$refs.seTable.$el.childNodes[2];
  565. // // 监听这个dom的scroll事件
  566. // this.box.addEventListener("scroll", (e) => {
  567. // const scrollTop = e.target.scrollTop; // 已滚动到可视区域上方的高度
  568. // const clientHeight = e.target.clientHeight; // 可视区域高度
  569. // const scrollHeight = e.target.scrollHeight; // 滚动内容的总高度
  570. // if (scrollHeight - (scrollTop + clientHeight) <= 20) {
  571. // // 不足10像素触发加载更多
  572. // if (this.isScroll) {
  573. // this.isScroll = false;
  574. // ++this.current;
  575. // this.getFireStatis();
  576. // console.log(
  577. // scrollHeight - (scrollTop + clientHeight) <= 20
  578. // );
  579. // }
  580. // }
  581. // });
  582. window.addEventListener(
  583. "resize",
  584. () =>
  585. this.resizeTimeActions([
  586. this.$refs.categoryLine,
  587. this.$refs.firePie1,
  588. this.$refs.firePie2,
  589. this.$refs.scatter,
  590. ]),
  591. true
  592. );
  593. this.initMap();
  594. },
  595. methods: {
  596. tableRowClassName({ row, column }) {
  597. if (column.property === "deathToll" && row.deathToll > 0) {
  598. return "death";
  599. }
  600. },
  601. async getData() {
  602. this.fireCase(1)
  603. let res = await this.$axios.get(
  604. this.$api.fire.fireType + "?" + this.$qs.stringify({})
  605. );
  606. if (res.data.length > 0) {
  607. this.fireTypeList = res.data;
  608. }
  609. for(let i =0;i<this.stores.mhjz.length;i++){
  610. if(this.stores.mhjz[i].streetTown == "全区"){
  611. this.fireAddressList.push("街道")
  612. }else{
  613. this.fireAddressList.push(this.stores.mhjz[i].streetTown)
  614. }
  615. }
  616. // let res1 = await this.$axios.get(
  617. // this.$api.fire.fireAddress + "?" + this.$qs.stringify({})
  618. // );
  619. // if (res1.data.length > 0) {
  620. // this.fireAddressList = res1.data;
  621. // }
  622. this.getTrend();
  623. this.getFireCause();
  624. // this.getFireStatis();
  625. this.policeInfo();
  626. this.sadianSelect(1)
  627. // this.getPage();
  628. },
  629. /**
  630. * 撒点类型选择
  631. */
  632. checkboxChange(id){
  633. this.checkedArray.checkedData[0] = id
  634. this.sadianSelect(id)
  635. },
  636. /**
  637. * 街镇切换
  638. */
  639. checkStreetTown(){
  640. let data = undefined;
  641. for (let i = 0; i < this.stroes.$state.mhjz.length; i++) {
  642. if (
  643. this.stroes.$state.streetTown ==
  644. this.stroes.$state.mhjz[i].streetTown
  645. ) {
  646. data = this.stroes.$state.mhjz[i];
  647. break;
  648. }
  649. }
  650. if (!this.stroes.$state.streetTown) {
  651. data = this.stroes.$state.mhjz[0];
  652. }
  653. if (this.stroes.$state.mapBool == 2) {
  654. this.streetTownSwitch(data);
  655. }
  656. this.sadianSelect(this.checkedArray.checkedData[0]);
  657. },
  658. /* 火灾情况分析 气泡图*/
  659. async policeInfo() {
  660. await this.$axios
  661. .get(
  662. this.$api.fire.fireBubble +
  663. "?" +
  664. this.$qs.stringify({
  665. unitId: "",
  666. fireType: "",
  667. startTime:
  668. dayjs()
  669. .subtract(90, "day")
  670. .format("YYYY-MM-DD HH:mm:ss")
  671. .slice(0, 10) + " 00:00:00",
  672. endTime:
  673. dayjs()
  674. .subtract(0, "day")
  675. .format("YYYY-MM-DD HH:mm:ss")
  676. .slice(0, 10) + " 00:00:00",
  677. // startTime: this.stores.$state.timeList[0] || "",
  678. // endTime: this.stores.$state.timeList[1] || "",
  679. })
  680. )
  681. .then((res) => {
  682. this.fireBubbleList = res.data;
  683. });
  684. },
  685. /* 火灾趋势图 折线图 */
  686. async getTrend() {
  687. await this.$axios
  688. .get(
  689. this.$api.fire.trendQuery +
  690. "?" +
  691. this.$qs.stringify({
  692. address: this.barForm.address,
  693. fireType: this.barForm.fireType,
  694. fireType2: this.barForm.fireType2,
  695. startTime:
  696. new Date().getFullYear() -
  697. this.timeArea +
  698. "-" +
  699. (new Date().getMonth() + 1) +
  700. "-" +
  701. new Date().getDate() +
  702. " 00:00:00",
  703. endTime:
  704. new Date().getFullYear() +
  705. "-" +
  706. (new Date().getMonth() + 1) +
  707. "-" +
  708. new Date().getDate() +
  709. " 00:00:00",
  710. })
  711. )
  712. .then((res) => {
  713. this.timeData = res.data;
  714. });
  715. },
  716. /* 火灾原因占比 饼图 */
  717. async getFireCause(val) {
  718. await this.$axios
  719. .get(
  720. this.$api.fire.fireCauseRatio +
  721. "?" +
  722. this.$qs.stringify({
  723. // startTime: this.stores.$state.timeList[0] || "",
  724. // endTime: this.stores.$state.timeList[1] || "",
  725. address:
  726. val === 1
  727. ? this.fireCauseRatioObj.address
  728. : val === 2
  729. ? this.fireCauseRatioObj.address2
  730. : "",
  731. })
  732. )
  733. .then((res) => {
  734. let ratioList = res.data.map((val) => {
  735. return {
  736. name: val.fireType || " ",
  737. value: val.radio ? val.radio * 100 : 0,
  738. itemStyle: {
  739. opacity: 0.9,
  740. },
  741. };
  742. });
  743. if (val === 1) {
  744. this.fireCauseRatioList = ratioList;
  745. } else if (val === 2) {
  746. this.fireCauseRatioList2 = ratioList;
  747. } else {
  748. this.fireCauseRatioList = ratioList;
  749. this.fireCauseRatioList2 = ratioList;
  750. }
  751. });
  752. },
  753. // 详细火灾情况,表格val
  754. async getFireStatis() {
  755. await this.$axios
  756. .get(
  757. this.$api.fire.fireStatistics +
  758. "?" +
  759. this.$qs.stringify({
  760. current: this.current,
  761. size: 300,
  762. startTime:
  763. dayjs()
  764. .subtract(90, "day")
  765. .format("YYYY-MM-DD HH:mm:ss")
  766. .slice(0, 10) + " 00:00:00",
  767. // startTime: "2022-10-01 00:00:00",
  768. endTime:
  769. dayjs()
  770. .format("YYYY-MM-DD HH:mm:ss")
  771. .slice(0, 10) + " 23:59:59",
  772. })
  773. )
  774. .then((res) => {
  775. this.isScroll = true;
  776. this.tableData.push(
  777. ...res.data.records.map((val) => {
  778. val.propertyLoss =
  779. (val.propertyLoss &&
  780. val.propertyLoss / 10000) ||
  781. val.propertyLoss;
  782. val.deathToll = Number(val.deathToll).toFixed(0);
  783. val.nonFatal = Number(val.nonFatal).toFixed(0);
  784. return val;
  785. })
  786. );
  787. });
  788. },
  789. /* 历史警情 */
  790. async historicalWarning() {
  791. let monthDay = dayjs()
  792. .subtract(30, "day")
  793. .format("YYYY-MM-DD HH:mm:ss")
  794. let today = dayjs()
  795. .subtract(0, "day")
  796. .format("YYYY-MM-DD HH:mm:ss")
  797. return await this.$axios.get(
  798. this.$api.jqzhcz.page2 +
  799. "?" +
  800. this.$qs.stringify({
  801. streetTown: this.stroes.$state.streetTown, //街镇
  802. current: 1,
  803. size: 1000,
  804. // startTime: monthDay,
  805. startTime: "2022-08-31 00:00:00",
  806. endTime: today,
  807. })
  808. )
  809. },
  810. searchTime(val) {
  811. if (val === this.timeArea) return;
  812. this.timeArea = val;
  813. this.getTrend();
  814. },
  815. /**
  816. * @街镇复选事件
  817. */
  818. // checkboxChange(value) {
  819. // this.checkedArray.checkedData =
  820. // this.checkedArray.checkedData.includes(value) ? [value] : [];
  821. // //1.高德 2.测绘院
  822. // if (this.stroes.$state.mapBool == 1) {
  823. // if (this.checkedArray.checkedData.length < 1) {
  824. // } else {
  825. // this.mapCluster(value);
  826. // }
  827. // } else if (this.stroes.$state.mapBool == 2) {
  828. // if (this.checkedArray.checkedData.length < 1) {
  829. // this.addMarker([], "self-management");
  830. // } else {
  831. // this.sadian(value);
  832. // }
  833. // }
  834. // },
  835. /**
  836. * 撒点测绘院、高德
  837. */
  838. sadianSelect(id) {
  839. console.log(id)
  840. //1.高德 2.测绘院
  841. if (this.stroes.$state.mapBool == 1) {
  842. if(id == 1){
  843. this.historicalWarning().then(res=>{
  844. let data = res.data.records
  845. let arr = []
  846. // console.log(this.stroes.$state.streetTown)
  847. for(let i =0;i<data.length;i++){
  848. if(data[i].ajlxdm == 1 && data[i].gisX && data[i].gisY ){
  849. arr.push(data[i])
  850. }
  851. }
  852. this.initMarkers(arr,"fire-data-analysis",this.checkedArray.checkedList[id].label)
  853. })
  854. }else{
  855. this.initMarkers([],"fire-data-analysis",this.checkedArray.checkedList[id].label)
  856. }
  857. } else if (this.stroes.$state.mapBool == 2) {
  858. if(id == 1){
  859. this.historicalWarning().then(res=>{
  860. let data = res.data.records
  861. let arr = []
  862. for(let i =0;i<data.length;i++){
  863. if(data[i].ajlxdm == 1 && data[i].gisX && data[i].gisY ){
  864. arr.push(data[i])
  865. }
  866. }
  867. this.sadian(arr,"fire-data-analysis",this.checkedArray.checkedList[id].label)
  868. })
  869. }else{
  870. this.sadian([],"fire-data-analysis",this.checkedArray.checkedList[id].label)
  871. }
  872. }
  873. },
  874. /**
  875. * 撒点
  876. */
  877. sadian(data,pageType,type){
  878. if(data.length>0){
  879. this.heatMap(data,pageType,type);
  880. }else{
  881. this.heatMap([],pageType,type);
  882. }
  883. },
  884. /**
  885. * 典型火灾案例
  886. */
  887. async fireCase(id){
  888. let regionType = id
  889. if(id == 1){
  890. this.tabsArea = "qg"
  891. }
  892. if(id == 2){
  893. this.tabsArea = "bs"
  894. }
  895. if(id == 3){
  896. this.tabsArea = "bq"
  897. }
  898. let res = await await this.$axios.get(this.$api.fire.infoList +
  899. "?" +
  900. this.$qs.stringify({
  901. regionType:regionType
  902. }))
  903. this.fireCaseData = res.data
  904. console.log(11,res)
  905. }
  906. },
  907. };
  908. </script>
  909. <style lang="scss" scoped>
  910. @import "@/assets/scss/color.scss";
  911. .contentBox {
  912. .leftBox {
  913. .leftTop,.leftTop2 {
  914. height: 50%;
  915. max-height: 33%;
  916. justify-content: center;
  917. align-items: center;
  918. box-sizing: border-box;
  919. width: 100%;
  920. margin-top: 0.125rem;
  921. .leftTopContent {
  922. height: calc(100% - 0.4375rem);
  923. vertical-align: top;
  924. .el-button {
  925. vertical-align: top;
  926. padding: 0;
  927. }
  928. .selectBar {
  929. width: 100%;
  930. display: flex;
  931. justify-content: space-between;
  932. height: 0.675rem;
  933. line-height: 0.675rem;
  934. .el-row {
  935. display: flex;
  936. }
  937. }
  938. .fireBar {
  939. width: 100%;
  940. height: calc(100% - 0.675rem);
  941. }
  942. }
  943. .threeBox {
  944. & >.flexBoxE11{
  945. color:#fff;
  946. & > .el-row {
  947. width: 100%;
  948. font-size: 0.175rem;
  949. align-items: center;
  950. margin-top:0.12rem;
  951. .el-col {
  952. margin-top: 0.45rem;
  953. span {
  954. margin-right: 0.125rem;
  955. }
  956. .el-progress {
  957. flex: 1;
  958. height: 0.3rem;
  959. }
  960. }
  961. }
  962. }
  963. }
  964. }
  965. .leftBot {
  966. height: calc(50% - 0.125rem);
  967. max-height: calc(33% - 0.125rem);
  968. width: 100%;
  969. .threeBox {
  970. width: 100%;
  971. height: calc(100% - 0.4375rem);
  972. position: relative;
  973. justify-content: space-between;
  974. align-items: center;
  975. flex-wrap: nowrap;
  976. & > .flexBoxE {
  977. flex: 1;
  978. display: flex;
  979. flex-direction: column;
  980. justify-content: space-between;
  981. width: 100%;
  982. height: 100%;
  983. padding-top:0.02rem;
  984. box-sizing: border-box;
  985. .el-form {
  986. text-align: center;
  987. .el-form-item {
  988. margin: 0;
  989. }
  990. }
  991. }
  992. .line {
  993. flex: none;
  994. width: 1px;
  995. height: 3rem;
  996. opacity: 1;
  997. background: linear-gradient(
  998. rgba(255, 255, 255, 0),
  999. #30cfff,
  1000. rgba(255, 255, 255, 0)
  1001. );
  1002. }
  1003. // 对比按钮
  1004. .VS {
  1005. position: absolute;
  1006. right: 0;
  1007. top: 0.2rem;
  1008. padding: 0.0625rem 0.2rem;
  1009. box-sizing: border-box;
  1010. text-align: center;
  1011. box-shadow: inset 0 0 0.05rem 0.05rem rgba(27, 79, 144, 1);
  1012. background: rgba(#132a5a, 0.8) !important;
  1013. color: #fff;
  1014. cursor: pointer;
  1015. -webkit-touch-callout: none;
  1016. -webkit-user-select: none;
  1017. -moz-user-select: none;
  1018. -ms-user-select: none;
  1019. user-select: none;
  1020. border-radius: 0.0625rem;
  1021. }
  1022. }
  1023. }
  1024. }
  1025. .rightBox {
  1026. .rightTop {
  1027. height: 55%;
  1028. max-height: 55%;
  1029. justify-content: center;
  1030. align-items: center;
  1031. box-sizing: border-box;
  1032. width: 100%;
  1033. .rightTopCenter {
  1034. height: calc(100% - 0.4375rem);
  1035. }
  1036. }
  1037. .rightBot {
  1038. height: calc(45% - 0.125rem);
  1039. max-height: calc(45% - 0.125rem);
  1040. margin-top: 0.125rem;
  1041. width: 100%;
  1042. .rightBotCenter {
  1043. padding: 0.25rem 0 0 0;
  1044. // height: calc(100% - 0.4375rem);
  1045. height: calc(100% - 0.6875rem);
  1046. }
  1047. }
  1048. }
  1049. }
  1050. .contentNew{
  1051. font-size: 14px;
  1052. color:#fff;
  1053. margin-top:20px;
  1054. p{
  1055. margin-top:10px;
  1056. }
  1057. }
  1058. </style>
  1059. <style lang="scss" >
  1060. .buttonLine{
  1061. display: inline;
  1062. margin-top:40px;
  1063. .btnClick {
  1064. border-bottom: 2px solid #73fbfd;
  1065. }
  1066. .el-button>span{
  1067. font-size: 16px !important;
  1068. }
  1069. }
  1070. </style>