SenEventCenter.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <!--设备中心-->
  2. <template>
  3. <div class="visual-con hz_body">
  4. <!--主体-->
  5. <div class="spsb_down">
  6. <el-date-picker
  7. v-model="dataValue"
  8. type="date"
  9. @change="updateDataValue"
  10. placeholder="选择日期">
  11. </el-date-picker>
  12. </div>
  13. <div class="con_left">
  14. <div class="list_tit">预警中心</div>
  15. <div class="yjzx_div">
  16. <!-- <div class="yjzx_k1">-->
  17. <!-- <img src="../assets/images/sentinel/sb_icon1.png"/>-->
  18. <!-- <span>总计</span>-->
  19. <!-- <b>{{eventTotal}}</b>-->
  20. <!-- </div>-->
  21. <div class="yjzx_k2">
  22. <p>
  23. <span>总计</span>
  24. <b>{{eventTotal}}</b>
  25. </p>
  26. <p v-for="item in eventNumberList">
  27. <span>{{item.eventTypeName}}</span>
  28. <b>{{item.countSum}}</b>
  29. </p>
  30. </div>
  31. </div>
  32. <div class="list_tit">事件分析</div>
  33. <div class="event_analyze" ref="eventAnalyze"></div>
  34. <div class="list_tit">企业分析</div>
  35. <div class="enterprise_analyze" ref="enterpriseAnalyze"></div>
  36. </div>
  37. <div class="con_right">
  38. <!-- <div class="list_tit list_tit2">应急中心<i>发起应急事件</i></div>-->
  39. <!-- <el-input-->
  40. <!-- placeholder="请输入事件名称"-->
  41. <!-- suffix-icon="el-icon-search"-->
  42. <!-- @change="getEventRight(1)"-->
  43. <!-- v-model="searchRight">-->
  44. <!-- </el-input>-->
  45. <!-- <dl class="sp_list yjsj_list">-->
  46. <!-- <dt><span class="dt1">序号</span><span class="dt2">应急事件名称</span><span class="dt3">发生时间</span></dt>-->
  47. <!-- <div class="hei_scroll hei64">-->
  48. <!-- <dd v-for="(item,index) in eventRightList">-->
  49. <!-- <span class="dt1">{{index+1}}</span><span class="dt2">{{item.eventTitle.length>5?item.eventTitle.substring(0,5)+'...':item.eventTitle}}</span><span class="dt3">{{item.createTime}}</span>-->
  50. <!-- </dd>-->
  51. <!-- </div>-->
  52. <!-- </dl>-->
  53. <!-- <el-pagination-->
  54. <!-- background-->
  55. <!-- layout="prev, pager, next"-->
  56. <!-- @prev-click="getEventRight"-->
  57. <!-- @next-click="getEventRight"-->
  58. <!-- @current-change="getEventRight"-->
  59. <!-- :total="rightTotal">-->
  60. <!-- </el-pagination>-->
  61. <div class="list_tit">事件列表</div>
  62. <div style="display: flex; gap: 10px;">
  63. <el-select v-model="eventType" placeholder="请选择" @change="getEventLeft(1)" style="flex: 1;">
  64. <el-option
  65. v-for="item in eventTypes"
  66. :key="item.eventTypeCode"
  67. :label="item.eventTypeName"
  68. :value="item.eventTypeCode">
  69. </el-option>
  70. </el-select>
  71. <el-input
  72. placeholder="请输入内容"
  73. suffix-icon="el-icon-search"
  74. @change="getEventLeft(1)"
  75. v-model="searchLeft"
  76. style="flex: 1;">
  77. </el-input>
  78. </div>
  79. <dl class="sp_list">
  80. <dt><span class="dtc1">序号</span><span class="dtc2">设备名称</span><span class="dtc3">定位</span></dt>
  81. <div class="hei_scroll hei62" >
  82. <dd v-for="(item,index) in eventLeftList">
  83. <span class="dtc1">{{index+1}}</span>
  84. <span class="dtc2">{{item.eventTitle.length>15?item.eventTitle.substring(0,15)+'...':item.eventTitle}}</span>
  85. <span class="dtc3" @click="flyTo(item.longitude,item.latitude)"><img src="../assets/images/sentinel/hz_list_d.png"/></span>
  86. </dd>
  87. </div>
  88. </dl>
  89. <el-pagination
  90. background
  91. layout="prev, pager, next"
  92. @prev-click="getEventLeft"
  93. @next-click="getEventLeft"
  94. @current-change="getEventLeft"
  95. :total="leftTotal">
  96. </el-pagination>
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. import Cookies from 'js-cookie'
  102. import {getUserProfile} from "@/api/system/user";
  103. import {
  104. countByDepartment,
  105. eventTypesListAll,
  106. getEventList,
  107. getStatisticByBrand,
  108. getStatisticByEventType
  109. } from "@/api/event";
  110. import '../assets/styles/sb_body.css';
  111. import {
  112. selectConfigKey
  113. } from "@/api/system/config";
  114. import {param} from "@/utils";
  115. // import * as echarts from 'echarts'
  116. let echarts = require("echarts");
  117. export default {
  118. components: {
  119. },
  120. metaInfo () {
  121. return {
  122. title:'四平市智慧哨兵监管平台',
  123. meta:[{
  124. charset: "utf-8"
  125. },
  126. {
  127. name: "viewport",
  128. content: "width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
  129. }]
  130. }
  131. },
  132. created() {
  133. // this.getEventRight(1);
  134. this.getSupermapEvent();
  135. this.getStatisticByEventType();
  136. this.eventTypesListAll();
  137. this.getStatisticByBrand();
  138. this.countByDepartment();
  139. this.getEventLeft(1);
  140. },
  141. mounted() {
  142. // 初始化地图数据
  143. setTimeout(() => {
  144. this.title = '四平市智慧哨兵监管平台'
  145. }, 1000);
  146. },
  147. data() {
  148. return {
  149. dialogVisible: false,
  150. pickerOptions: {
  151. disabledDate(time) {
  152. return time.getTime() > Date.now();
  153. },
  154. shortcuts: [{
  155. text: '今天',
  156. onClick(picker) {
  157. picker.$emit('pick', new Date());
  158. }
  159. }, {
  160. text: '昨天',
  161. onClick(picker) {
  162. const date = new Date();
  163. date.setTime(date.getTime() - 3600 * 1000 * 24);
  164. picker.$emit('pick', date);
  165. }
  166. }, {
  167. text: '一周前',
  168. onClick(picker) {
  169. const date = new Date();
  170. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  171. picker.$emit('pick', date);
  172. }
  173. }]
  174. },
  175. dataValue: this.getCurrentDataStr(new Date()),
  176. eventNumberList:[],
  177. eventTotal:0,
  178. title:'四平市智慧哨兵监管平台',
  179. searchLeft: '',
  180. eventLeftList:[],
  181. leftTotal:0,
  182. leftCurrentPage:1,
  183. searchRight:'',
  184. eventRightList:[],
  185. rightTotal:0,
  186. rightCurrentPage:1,
  187. eventTypes: [],
  188. eventType: ''
  189. }
  190. },
  191. methods: {
  192. //事件分析
  193. eventAnalyzeChart(data) {
  194. let datas = [];
  195. for(let item of data){
  196. datas.push({name:item.departmentName,value:item.count})
  197. }
  198. const chartDom = this.$refs.eventAnalyze;
  199. const myChart = echarts.init(chartDom);
  200. this.option = {
  201. tooltip: {
  202. trigger: "item",
  203. formatter: "{b} : {c} ({d}%)",
  204. },
  205. visualMap: {
  206. show: false,
  207. min: 500,
  208. max: 600,
  209. inRange: {
  210. //colorLightness: [0, 1]
  211. },
  212. },
  213. series: [{
  214. name: "访问来源",
  215. type: "pie",
  216. radius: "60%",
  217. center: ["50%", "50%"],
  218. color: ["rgb(131,249,103)", "#FBFE27", "#FE5050","#f17c7c","#1DB7E5"
  219. ], //'#FBFE27','rgb(11,228,96)','#FE5050'
  220. data: datas.sort(function(a, b) {
  221. return a.value - b.value;
  222. }),
  223. roseType: "radius",
  224. label: {
  225. normal: {
  226. formatter: ["{c|{c}}", "{b|{b}}"].join("\n"),
  227. rich: {
  228. c: {
  229. color: "rgb(241,246,104)",
  230. fontSize: 20,
  231. fontWeight: "bold",
  232. lineHeight: 5,
  233. },
  234. b: {
  235. color: "rgb(98,137,169)",
  236. fontSize: 15,
  237. height: 40,
  238. },
  239. },
  240. },
  241. },
  242. labelLine: {
  243. normal: {
  244. lineStyle: {
  245. color: "rgb(98,137,169)",
  246. },
  247. smooth: 0.2,
  248. length: 10,
  249. length2: 20,
  250. },
  251. },
  252. itemStyle: {
  253. normal: {
  254. shadowColor: "rgba(0, 0, 0, 0.8)",
  255. shadowBlur: 50,
  256. },
  257. },
  258. }, ],
  259. };
  260. myChart.setOption(this.option, true);
  261. window.addEventListener("resize", function() {
  262. myChart.resize();
  263. });
  264. },
  265. //企业分析
  266. enterpriseAnalyzeChart(data) {
  267. let series = [];
  268. let corors = ['#5470c6', '#91cc75', '#fac858', '#ee6666'];
  269. for (let i = 0; i < data.series.length; i++) {
  270. series.push({
  271. name: data.series[i].name,
  272. type: 'line',
  273. stack: 'Total',
  274. itemStyle: {
  275. color: corors[i] // 蓝色
  276. },
  277. data: data.series[i].data
  278. })
  279. }
  280. const chartDom = this.$refs.enterpriseAnalyze;
  281. const myChart = echarts.init(chartDom);
  282. this.option = {
  283. tooltip: {
  284. trigger: 'axis'
  285. },
  286. grid: {
  287. top: '5%',
  288. left: '12%',
  289. right: '4%',
  290. bottom: '2%',
  291. containLabel: true
  292. },
  293. xAxis: {
  294. type: 'category',
  295. boundaryGap: false,
  296. data: data.categories,
  297. axisLabel: {
  298. rotate: 45, // 旋转角度范围-90到90
  299. color: '#13e845' // X轴刻度颜色,这里设置为深灰色
  300. }
  301. },
  302. yAxis: {
  303. type: 'value',
  304. axisLabel: {
  305. color: '#eed113' // Y轴刻度颜色,这里设置为深灰色
  306. }
  307. },
  308. series: series
  309. };
  310. myChart.setOption(this.option, true);
  311. window.addEventListener("resize", function() {
  312. myChart.resize();
  313. });
  314. },
  315. getStatisticByEventType(){
  316. getStatisticByEventType({createTimeRange:this.dataValue+","+this.dataValue}).then(req => {
  317. this.eventNumberList = req.data;
  318. this.eventTotal = 0;
  319. for(let item of req.data){
  320. this.eventTotal += item.countSum
  321. }
  322. })
  323. },
  324. eventTypesListAll(){
  325. eventTypesListAll().then(req => {
  326. this.eventTypes = req.data;
  327. // this.eventType = req.data[0].eventTypeCode;
  328. })
  329. },
  330. getCurrentDataStr(date) {
  331. let y = date.getFullYear()
  332. let m = date.getMonth() + 1
  333. m = m < 10 ? '0' + m : m
  334. let d = date.getDate()
  335. d = d < 10 ? '0' + d : d
  336. return y + '-' + m + '-' + d
  337. },
  338. updateDataValue(value){
  339. this.dataValue = this.getCurrentDataStr(value);
  340. this.getEventLeft(1);
  341. this.getEventRight(1);
  342. this.getStatisticByEventType();
  343. this.getSupermapEvent();
  344. this.getStatisticByBrand();
  345. this.countByDepartment();
  346. },
  347. getStatisticByBrand(){
  348. let data ={
  349. selectDay:this.dataValue
  350. }
  351. getStatisticByBrand(data).then(req => {
  352. this.enterpriseAnalyzeChart(req.data)
  353. })
  354. },
  355. countByDepartment(){
  356. let data ={
  357. selectDay:this.dataValue
  358. }
  359. countByDepartment(data).then(req => {
  360. this.eventAnalyzeChart(req.data)
  361. })
  362. },
  363. getEventLeft(pageNum){
  364. let param = {
  365. pageNum: pageNum,
  366. pageSize: 10,
  367. eventTypeCode: this.eventType === '' ? 'all' : this.eventType,
  368. eventTitle: this.searchLeft,
  369. createTimeRange: this.dataValue+","+this.dataValue,
  370. };
  371. getEventList(param).then(req => {
  372. this.eventLeftList = req.rows;
  373. this.leftTotal = req.total;
  374. })
  375. },
  376. flyTo(longitude,latitude){
  377. this.$parent.$refs.supermap.dropLocation(longitude * 1,latitude * 1);
  378. },
  379. getEventRight(pageNum){
  380. let param = {
  381. pageNum:pageNum,
  382. pageSize:10,
  383. eventTitle:this.searchRight,
  384. createTimeRange:this.dataValue+","+this.dataValue,
  385. eventTypeCode:'2'
  386. };
  387. getEventList(param).then(req => {
  388. this.eventRightList = req.rows;
  389. this.rightTotal = req.total;
  390. })
  391. },
  392. getSupermapEvent(){
  393. let that = this;
  394. let param = {
  395. createTimeRange:this.dataValue+","+this.dataValue,
  396. eventTypeCode:"all"
  397. };
  398. getEventList(param).then(res => {
  399. const markersList = []
  400. if (res.rows != null && res.rows.length > 0) {
  401. for (let i = 0; i < res.rows.length; i++) {
  402. let markersMap = {
  403. lng: 124.59,
  404. lat: 43.02,
  405. icon: 'marker',
  406. bindPopupHtml: '',
  407. click: 'openDetails',
  408. parameter: res.rows[i],
  409. keepBindPopup: false,
  410. isAggregation: false
  411. }
  412. markersMap.icon = "sj-icon-event";
  413. if(res.rows[i].eventTypeCode == '2'){//应急事件
  414. markersMap.icon = "sj-icon-event-yingji";
  415. }
  416. markersMap.lng = res.rows[i].longitude
  417. markersMap.lat = res.rows[i].latitude
  418. markersList.push(markersMap);
  419. }
  420. setTimeout(() => {
  421. that.$parent.$refs.supermap.clearM()
  422. that.$parent.$refs.supermap.setMarkers(markersList)
  423. }, 1000)
  424. } else {
  425. setTimeout(() => {
  426. that.$parent.$refs.supermap.clearM()
  427. }, 1000)
  428. }
  429. })
  430. },
  431. }
  432. }
  433. </script>
  434. <style rel="stylesheet/scss" lang="scss">
  435. .spsb_down{
  436. position: absolute;
  437. top:52px;
  438. left: 30px;
  439. z-index: 999;
  440. .el-input__inner{
  441. background: linear-gradient(to right, rgb(37,50,54) 0%, rgb(43,140,152) 100%);
  442. border: 1px solid;
  443. border-image: linear-gradient(to top, #aafae0, #59f2cc, #4ab2ec) 1;
  444. }
  445. }
  446. .yjzx_div{
  447. display: flex;
  448. flex-direction: row;
  449. text-align: center;
  450. margin: 15px 0px!important;
  451. .yjzx_k1{
  452. background: url("../assets/images/sentinel/sb_btnbg.png") no-repeat center;
  453. background-size: 100% 100%;
  454. width: 127px;
  455. height: 211px;
  456. img{
  457. display: block;
  458. margin: 55px auto 20px auto;
  459. }
  460. }
  461. .yjzx_k2{
  462. height: 211px;
  463. //width: 100%;
  464. p{
  465. display: inline-block;
  466. background: url("../assets/images/sentinel/sb_btnbg2.png") no-repeat center;
  467. background-size: 100% 100%;
  468. width: 88px;
  469. height: 101px;
  470. }
  471. :nth-child(1),:nth-child(2),:nth-child(4),:nth-child(5){
  472. margin-right: 7px;
  473. margin-bottom: 7px;
  474. }
  475. :nth-child(3),:nth-child(6){
  476. margin-right: 7px;
  477. }
  478. span{
  479. padding-top: 20px;
  480. }
  481. b{
  482. padding-top: 10px;
  483. }
  484. }
  485. span{
  486. display: block;
  487. font-size: 16px;
  488. color: #ceebee;
  489. height: 30px;
  490. line-height: 30px;
  491. }
  492. b{
  493. display: block;
  494. font-size: 24px;
  495. font-family: ysbth;
  496. color: #fff;
  497. }
  498. }
  499. .qydw1{
  500. position: absolute;
  501. top: 63.5%;
  502. left: 38.2%;
  503. display: block;
  504. width:54px ;
  505. height: 77px;
  506. }
  507. .qydw2{
  508. position: absolute;
  509. top: 50%;
  510. left: 70%;
  511. display: block;
  512. width:54px ;
  513. height: 77px;
  514. }
  515. .qydw3{
  516. position: absolute;
  517. top: 40%;
  518. left: 80%;
  519. display: block;
  520. width:54px ;
  521. height: 77px;
  522. }
  523. .sjlc_con{
  524. display: flex;
  525. flex-direction: row;
  526. justify-content: space-between;
  527. .sjlc_div{
  528. background: rgba(50, 161, 175, 0.2);
  529. border: 1px solid #1e6a78;
  530. width: 250px;
  531. height: 300px;
  532. padding: 25px 20px;
  533. i{
  534. display: block;
  535. width: 50px;
  536. height: 50px;
  537. background:linear-gradient(to bottom,rgba(51,140,161,1),rgba(42,104,135,0.7));
  538. border-radius: 50%;
  539. margin: 5px auto;
  540. text-align: center;
  541. img{
  542. margin: 12px auto!important;
  543. display: inline-block;
  544. width: 23px;
  545. height: 24px;
  546. }
  547. }
  548. h4{
  549. font-size: 18px;
  550. font-weight: 900;
  551. color: #fff;
  552. text-align: center;
  553. height: 40px;
  554. line-height: 40px;
  555. }
  556. p{
  557. font-size: 14px;
  558. color: #fff;
  559. line-height: 30px;
  560. }
  561. }
  562. .date_div{
  563. background: linear-gradient(to top,rgba(170, 250, 224, 0.7),rgba(89, 242, 204, 0.8),rgba(74, 178, 236, 0.7));
  564. border: 1px solid #26cda0;
  565. i{
  566. display: block;
  567. width: 60px;
  568. height: 60px;
  569. background:linear-gradient(to bottom,rgba(38,255,196,1),rgba(0,198,255,0.7));
  570. border-radius: 50%;
  571. margin: 5px auto;
  572. text-align: center;
  573. img{
  574. margin: 14px auto!important;
  575. width: 32px;
  576. height: 33px;
  577. }
  578. }
  579. }
  580. u{
  581. background: url("../assets/images/sentinel/sb_icon7.png") no-repeat center;
  582. display: block;
  583. width: 10px;
  584. height: 16px;
  585. margin: auto auto;
  586. }
  587. .date{
  588. background: url("../assets/images/sentinel/sb_icon8.png") no-repeat center;
  589. }
  590. }
  591. .sjcl_media_con{
  592. display: flex;
  593. flex-direction: row;
  594. margin-top: 20px!important;
  595. .sjcl_media{
  596. width: 839px;
  597. height: 512px;
  598. margin-right: 15px;
  599. }
  600. .sjcl_img{
  601. width: 527px;
  602. img{
  603. display: inline-block;
  604. width: 255px;
  605. height: 247px;
  606. }
  607. :nth-child(1){
  608. margin-right: 10px!important;
  609. margin-bottom: 15px!important;
  610. }
  611. :nth-child(2){
  612. margin-bottom: 15px!important;
  613. }
  614. :nth-child(3){
  615. margin-right: 10px!important;
  616. }
  617. }
  618. }
  619. .sp_list span.dtc1 {
  620. width: 60px;
  621. background: url("../assets/images/sentinel/hz_list_j.png") no-repeat left;
  622. padding-left: 15px;
  623. }
  624. .sp_list span.dtc2 {
  625. width: 192px;
  626. text-align: left;
  627. }
  628. .sp_list span.dtc3 {
  629. width: 35px;
  630. text-align: center;
  631. line-height: 38px;
  632. position: relative;
  633. }
  634. .sp_list span.dtc3 img {
  635. display: inline-block;
  636. position: absolute;
  637. top: 10px;
  638. left: 11px;
  639. }
  640. //图表事件分析
  641. .event_analyze {
  642. width: 100%;
  643. height: 20vh;
  644. }
  645. .enterprise_analyze {
  646. width: 100%;
  647. height: 20vh;
  648. }
  649. </style>
  650. <style rel="stylesheet/scss" lang="scss" scoped>
  651. @import '@/assets/styles/base.scss';
  652. </style>