index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <div style="width:100%;height:100%;position:relative">
  3. <headerdiv ref="headerDiv" :currentindexP = currentindexNew></headerdiv>
  4. <div style="display:fix;">
  5. <div style="width:25%;height:100%;display: inline-flex;">
  6. <div style="width:100%">
  7. <div class="divtitle" style="margin-top:0.5rem">
  8. <img src="../../assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  9. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">预警分析</div>
  10. </div>
  11. <!-- <br/> -->
  12. <div>
  13. <div class="yjcontent1" style="padding-left:2rem;padding-top:1.5rem">
  14. <div>
  15. <div style="font-size: 1.4rem;
  16. font-family: Adobe Heiti Std;
  17. font-weight: normal;
  18. color: #FFFFFF;
  19. ">预警总数</div>
  20. <div style='font-size: 2rem;
  21. font-family: Myriad Pro;
  22. font-weight: 400;
  23. color: #21F5F2;'>394</div>
  24. </div>
  25. </div>
  26. <div class="yjcontent2" style="padding-left:2rem;padding-top:1.5rem">
  27. <div>
  28. <div style="font-size: 1.4rem;
  29. font-family: Adobe Heiti Std;
  30. font-weight: normal;
  31. color: #FFFFFF;">未处理预警</div>
  32. <div style='font-size: 2rem;
  33. font-family: Myriad Pro;
  34. font-weight: 400;
  35. color: #23B9FF;'>226</div>
  36. </div>
  37. </div>
  38. </div>
  39. <div id='yjchart' style="width:45rem;height:30rem"></div>
  40. <div class="divtitle" style="margin-top:0.5rem">
  41. <img src="../../assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  42. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">站点预警量</div>
  43. </div>
  44. <div class="zdyjcontrnt"></div>
  45. <div id='zdyjchart' style="width:45rem;height:27rem"></div>
  46. </div>
  47. </div>
  48. <div style="width:50%;height:95%;position:absolute;display: inline-flex;">
  49. <mapdiv ref="mapdiv" style=""></mapdiv>
  50. </div>
  51. <div style="width:25%;height:100%;margin-left:96rem;display: inline-flex;">
  52. <div style="width:100%;padding-left:1rem">
  53. <div class="divtitle" style="margin-top:1.5rem">
  54. <img src="../../assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  55. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">各部门处理工单量</div>
  56. </div>
  57. <div style="display: inline-flex;margin-top:3rem">
  58. <div style="display: inline-flex;margin-left:5rem">
  59. <div class='bgcontent' style="padding-top:2.1rem;padding-left:2.1rem">
  60. <img src='../../assets/images/safe/icon.png' style="width:2.6rem;height:2.6rem;"/>
  61. </div>
  62. <div style="margin-top:1.5rem;margin-left:1rem">
  63. <div class='countClass'>32531</div>
  64. <div class='deptClass'>部门一</div>
  65. </div>
  66. </div>
  67. <div style="display: inline-flex;margin-left:3rem">
  68. <div class='bgcontent' style="padding-top:2.1rem;padding-left:2.1rem">
  69. <img src='../../assets/images/safe/icon.png' style="width:2.6rem;height:2.6rem;"/>
  70. </div>
  71. <div style="margin-top:1.5rem;margin-left:1rem">
  72. <div class='countClass'>13325</div>
  73. <div class='deptClass'>部门三</div>
  74. </div>
  75. </div>
  76. </div>
  77. <div style="display: inline-flex;">
  78. <div style="display: inline-flex;margin-left:5rem">
  79. <div class='bgcontent' style="padding-top:2.1rem;padding-left:2.1rem">
  80. <img src='../../assets/images/safe/icon.png' style="width:2.6rem;height:2.6rem;"/>
  81. </div>
  82. <div style="margin-top:1.5rem;margin-left:1rem">
  83. <div class='countClass'>62255</div>
  84. <div class='deptClass'>部门二</div>
  85. </div>
  86. </div>
  87. <div style="display: inline-flex;margin-left:3rem">
  88. <div class='bgcontent' style="padding-top:2.1rem;padding-left:2.1rem">
  89. <img src='../../assets/images/safe/icon.png' style="width:2.6rem;height:2.6rem;"/>
  90. </div>
  91. <div style="margin-top:1.5rem;margin-left:1rem">
  92. <div class='countClass'>72123</div>
  93. <div class='deptClass'>其它合作单位</div>
  94. </div>
  95. </div>
  96. </div>
  97. <div class='pieChart' style='margin-top:5rem'></div>
  98. <!-- <div id='lcChart' style="width:45rem;height:25rem"></div> -->
  99. <div class="divtitle" style="margin-top:1.5rem">
  100. <img src="../../assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
  101. <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:0.5rem">巡检考核</div>
  102. </div>
  103. <!-- <div class='gdChart' style='margin-top:5rem'></div> -->
  104. <div id='gdChart' style="width:45rem;height:37rem"></div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="bottombg">
  109. <div class="item item2" @click="changeMapTab(1)"><div class="num">1123</div><div>静态资源</div></div>
  110. <div class="item item1 item2" @click="changeMapTab(2)"><div class="num">113</div><div>动态资源</div></div>
  111. <div class="item item1 item2" @click="changeMapTab(3)"><div class="num">531</div><div>重点区域</div></div>
  112. <div class="item"><div class="num" @click="changeMapTab(4)">16</div><div>实时告警</div></div>
  113. </div>
  114. <!-- <videodiv :cameracode="ccode" style="width:700px;height:300px;position:absolute;top:100px;left:100px"></videodiv> -->
  115. </div>
  116. </template>
  117. <script>
  118. import moment from "moment";
  119. import mapdiv from "../../components/map/index.vue"
  120. import headerdiv from '@/components/HeaderDiv/index.vue'
  121. import { httpRequest } from "@/api/data/http";
  122. import { getLineData,getResource,getgovern } from "@/api/qdtl/data";
  123. import videodiv from "../../components/Videoplayer/index.vue"
  124. export default {
  125. name: "big",
  126. data() {
  127. return {
  128. userList:[],
  129. tdxjCount:111,
  130. tdcsCount:152,
  131. currentindexNew:4,
  132. ccode:"32068166001320000235",
  133. videoParams:{
  134. url:'http://2.90.220.252:9017/artemis-web/debug',
  135. params:'{"httpMethod":"POST","path":"/api/resource/v1/cameras","headers":{},"query":{},"parameter":{},"body":{"pageNo": 1,"pageSize": 5000,"treeCode": "0"},"contentType":"application/json;charset=UTF-8","mock":false,"appKey":"27794545","appSecret":"5Xi27Gl7JrbHHF1MpdaB"}'
  136. },
  137. };
  138. },
  139. components:{
  140. mapdiv,
  141. headerdiv,
  142. videodiv,
  143. },
  144. mounted() {
  145. console.log(111)
  146. this.initchart();
  147. this.getResource();
  148. this.getvideoList();
  149. // this.getGovern();
  150. this.inityjchart();
  151. this.getGdChart();
  152. },
  153. methods:{
  154. getGdChart(){
  155. var myChart = this.$echarts.init(document.getElementById('gdChart'));
  156. var option = {
  157. xAxis: {
  158. type: 'category',
  159. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  160. axisLabel: {
  161. show: true,
  162. textStyle: {
  163. color: '#ACB6B9' //这里用参数代替了
  164. }
  165. },
  166. },
  167. yAxis: {
  168. axisLabel: {
  169. show: true,
  170. textStyle: {
  171. color: '#ACB6B9' //这里用参数代替了
  172. }
  173. },
  174. type: 'value'
  175. },
  176. color: new this.$echarts.graphic.LinearGradient(
  177. 0, 0, 0, 1,
  178. [
  179. {offset: 1, color: '#2275E4'}, //柱图渐变色
  180. {offset: 0, color: '#56CCF2'}, //柱图渐变色
  181. ]
  182. ),
  183. series: [
  184. {
  185. barWidth:15,
  186. data: [120, 200, 150, 80, 70, 110, 130],
  187. type: 'bar'
  188. }
  189. ]
  190. };
  191. myChart.setOption(option);
  192. },
  193. tableRowClassName({ row, rowIndex }) {
  194. if ((rowIndex + 1) % 2 === 0) {
  195. return "warning-row";
  196. } else {
  197. return "success-row";
  198. }
  199. },
  200. changeMapTab(index){
  201. this.$refs.mapdiv.iconSelect = index
  202. },
  203. getGovern(){
  204. getgovern().then(data =>{
  205. console.log(data);
  206. this.userList = data.data.checkStatic;
  207. console.log(this.userList);
  208. this.tdxjCount = data.data.xunTotalDistance;
  209. this.tdcsCount = data.data.checkPointLogNum;
  210. })
  211. },
  212. initchart(){
  213. var myChart = this.$echarts.init(document.getElementById('yjchart'));
  214. var option = {
  215. color: ['#3DFCCD', '#23B9FF'],
  216. tooltip: {
  217. trigger: 'axis',
  218. axisPointer: {
  219. type: 'shadow'
  220. }
  221. },
  222. legend: {
  223. x:'left',
  224. textStyle:{
  225. fontSize: 12,//字体大小
  226. color: '"#fft'//字体颜色
  227. },
  228. },
  229. grid: {
  230. left: '3%',
  231. right: '4%',
  232. bottom: '3%',
  233. containLabel: true
  234. },
  235. xAxis: {
  236. type: 'value',
  237. boundaryGap: [0, 0.01],
  238. axisLabel: {
  239. show: true,
  240. textStyle: {
  241. color: '#ACB6B9' //这里用参数代替了
  242. }
  243. },
  244. },
  245. yAxis: {
  246. type: 'category',
  247. data: ['汇龙镇', '南阳镇', '海复镇', '王鲍镇', '北新镇', '吕四镇','东宇镇','近海镇'],
  248. axisLabel: {
  249. show: true,
  250. textStyle: {
  251. color: '#ACB6B9' //这里用参数代替了
  252. }
  253. },
  254. },
  255. series: [
  256. {
  257. name: '已处理预警',
  258. type: 'bar',
  259. data: [573, 289, 357, 405, 501, 286,471,421]
  260. },
  261. {
  262. name: '预警总数',
  263. type: 'bar',
  264. data: [582, 366, 391, 498, 577, 337, 483, 492]
  265. }
  266. ]
  267. };
  268. myChart.setOption(option);
  269. },
  270. inityjchart(){
  271. var myChart = this.$echarts.init(document.getElementById('zdyjchart'));
  272. var option = {
  273. series: [
  274. {
  275. name: 'Nightingale Chart',
  276. type: 'pie',
  277. radius: [20, 100],
  278. center: ['50%', '50%'],
  279. roseType: 'area',
  280. itemStyle: {
  281. borderRadius: 8
  282. },
  283. label: {
  284. normal: {
  285. show: true,
  286. formatter: '{b} ({d}%)'
  287. }
  288. },
  289. data: [
  290. { value: 40, name: '汇龙镇', itemStyle: { color: '#38CAFB' }, },
  291. { value: 38, name: '海复镇', itemStyle: { color: '#4CAFF9' }, },
  292. { value: 32, name: '王鲍镇', itemStyle: { color: '#4ADDC9' }, },
  293. { value: 30, name: '北新镇', itemStyle: { color: '#2AA4EA' }, },
  294. { value: 28, name: '吕四镇', itemStyle: { color: '#0965D2' }, },
  295. { value: 26, name: '其它' , itemStyle: { color: '#1C3F83' },},
  296. { value: 22, name: '南阳镇' , itemStyle: { color: '#488CF7' },},
  297. ]
  298. }
  299. ]
  300. };
  301. myChart.setOption(option);
  302. },
  303. getResource(){
  304. getResource({date:'2022-03-12'}).then(response =>{
  305. var trainArry = [];
  306. var bridgeArry = [];
  307. var railArry = [];
  308. var stationLocation = [];
  309. var areaList = [];
  310. for(var index in response.data.staticLocation){
  311. var obj = response.data.staticLocation[index]
  312. obj.fence = obj.lnglat
  313. obj.name = obj.locationName
  314. stationLocation.push(obj)
  315. }
  316. for(var index in response.data.area){
  317. var obj = response.data.area[index]
  318. if(obj.areaType == '1'){
  319. areaList.push(obj);
  320. }else if(obj.areaType == '2'){
  321. obj.name = obj.areaName
  322. trainArry.push(obj);
  323. }else if(obj.areaType == '3'){
  324. obj.name = obj.areaName
  325. bridgeArry.push(obj);
  326. }else if(obj.areaType == '4'){
  327. obj.name = obj.areaName
  328. railArry.push(obj);
  329. }
  330. }
  331. for(var index in areaList){
  332. var json = JSON.parse(areaList[index].fence)
  333. this.$refs.mapdiv.addPolygon(json);
  334. }
  335. for(var key in response.data.deviceTrail){
  336. var jsonStr = '['
  337. for(var index in response.data.deviceTrail[key]){
  338. var obj = response.data.deviceTrail[key][index]
  339. if(index == response.data.deviceTrail[key].length - 1){
  340. var location = '['+obj.fence.split(',')[0]+','+obj.fence.split(',')[1]+']'
  341. }else{
  342. var location = '['+obj.fence.split(',')[0]+','+obj.fence.split(',')[1]+'],'
  343. }
  344. jsonStr += location
  345. // deviceArry.push(obj.fence.split(','));
  346. }
  347. jsonStr += ']'
  348. var json = JSON.parse(jsonStr);
  349. this.$refs.mapdiv.addPoints(response.data.deviceTrail[key],'device.png',0.6,'device');
  350. this.$refs.mapdiv.addline(json,'device');
  351. }
  352. this.$refs.mapdiv.addPoints(trainArry,'train.png',0.6,'train');
  353. this.$refs.mapdiv.addPoints(bridgeArry,'bridge.png',0.6,'bridge');
  354. this.$refs.mapdiv.addPoints(railArry,'rail.png',0.6,'rail');
  355. this.$refs.mapdiv.addPoints(stationLocation,'location.png',0.6,'location');
  356. })
  357. },
  358. getvideoList(){
  359. httpRequest(this.videoParams).then(data =>{
  360. var json = JSON.parse(data.data);
  361. this.$refs.mapdiv.addPoints(json.data.list,'video.png',0.6,'video');
  362. });
  363. }
  364. }
  365. };
  366. </script>
  367. <style rel="stylesheet/scss" lang="scss">
  368. .divtitle{
  369. background: url("~@/assets/images/title@2x.png") no-repeat;
  370. background-size: 100% 100%;
  371. width:95%;
  372. height:3.9rem;
  373. padding-left:1.5rem;
  374. padding-top:0.7rem;
  375. display: inline-flex;
  376. }
  377. .yjcontent1{
  378. background: url("~@/assets/images/safe/bg2.png") no-repeat;
  379. background-size: 100% 100%;
  380. width:18.7rem;
  381. height:8.3rem;
  382. margin-left:3.5rem;
  383. margin-top:1rem;
  384. display: inline-flex;
  385. // display: inline-flex;
  386. }
  387. .yjcontent2{
  388. background: url("~@/assets/images/safe/bg1.png") no-repeat;
  389. background-size: 100% 100%;
  390. width:18.7rem;
  391. height:8.3rem;
  392. margin-left:3.5rem;
  393. margin-top:1rem;
  394. display: inline-flex;
  395. // display: inline-flex;
  396. }
  397. .zdyjcontrnt{
  398. background: url("~@/assets/images/safe/组 15@2x.png") no-repeat;
  399. background-size: 100% 100%;
  400. width:42.7rem;
  401. height:12rem;
  402. margin-left:1.5rem;
  403. margin-top:1rem;
  404. display: inline-flex;
  405. }
  406. .bgcontent{
  407. background: url("~@/assets/images/safe/bg@2x.png") no-repeat;
  408. background-size: 100% 100%;
  409. width:6.9rem;
  410. height:6.9rem;
  411. margin-left:1.5rem;
  412. margin-top:1rem;
  413. display: inline-flex;
  414. }
  415. .pieChart{
  416. background: url("~@/assets/images/safe/piechart.png") no-repeat;
  417. background-size: 100% 100%;
  418. width:38.8rem;
  419. height:17.5rem;
  420. margin-left:4rem;
  421. margin-top:1rem;
  422. display: inline-flex;
  423. }
  424. .countClass{
  425. font-size: 2.4rem;
  426. font-family: AlibabaSans;
  427. font-weight: 500;
  428. color: #30FDFF;
  429. }
  430. .deptClass{
  431. font-size: 1.4rem;
  432. font-family: Adobe Heiti Std;
  433. font-weight: normal;
  434. color: #BAC3C4;
  435. }
  436. .tdgove2{
  437. background: url("~@/assets/images/goverce/态势2@2x.png") no-repeat;
  438. background-size: 100% 100%;
  439. width:37.2rem;
  440. height:9.9rem;
  441. margin-left:3.5rem;
  442. display: inline-flex;
  443. // display: inline-flex;
  444. }
  445. .fontClass{
  446. font-size: 1.5rem;
  447. font-family: Microsoft YaHei;
  448. font-weight: 400;
  449. color: #FFFFFF;
  450. line-height: 2.6rem;
  451. }
  452. .EngClass{
  453. font-size: 1.2rem;
  454. font-family: AlibabaSans;
  455. font-weight: 400;
  456. color: #B7D0FA;
  457. line-height: 1.1rem;
  458. opacity: 0.4;
  459. }
  460. .countClass2{
  461. font-size: 1.5rem;
  462. font-family: Microsoft YaHei;
  463. font-weight: 400;
  464. color: #FFFFFF;
  465. line-height: 2.6rem;
  466. }
  467. </style>