index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525
  1. <template>
  2. <div id="content">
  3. <el-carousel indicator-position="none" :autoplay="false">
  4. <el-carousel-item v-for="item in 1" :key="item">
  5. <div v-if=" item==1 ">
  6. <previewV1
  7. :date='date'
  8. :nowWeek='nowWeek'
  9. :workData='workData'
  10. :alarmData='alarmData'
  11. :deviceStatusData='deviceStatusData'
  12. :pieStateOptions='pieStateOptions'
  13. :pieFaultOptions='pieFaultOptions'
  14. :pieDeviceOptions='pieDeviceOptions'
  15. :pieOptions='pieOptions'
  16. :pieRightOptions='pieRightOptions'
  17. :pieCenterOptions='pieCenterOptions'
  18. :barPlanOptions='barPlanOptions'
  19. :barOptions='barOptions'
  20. :lineOptions='lineOptions'
  21. :mapOptions='mapOptions'
  22. />
  23. </div>
  24. <!-- <div v-else>
  25. <previewV2
  26. :date='date'
  27. :nowWeek='nowWeek'
  28. :alarm_data='alarm_data'
  29. :alarmData='alarmData'
  30. :deviceStatusData='deviceStatusData'
  31. :netPieOptions='netPieOptions'
  32. :barPlanOptions='barPlanOptions'
  33. :barOptions='barOptions'
  34. :lineOptions='lineOptions'
  35. :barRealtimeAlarmOptions='barRealtimeAlarmOptions'
  36. :subRealtimeAlarmOptions='subRealtimeAlarmOptions'
  37. />
  38. </div> -->
  39. </el-carousel-item>
  40. </el-carousel>
  41. </div>
  42. </template>
  43. <script>
  44. import previewV1 from "./preview_v1";
  45. import previewV2 from "./preview_v2";
  46. export default {
  47. name: "screen_screen",
  48. components: {
  49. previewV1,
  50. previewV2,
  51. },
  52. data() {
  53. return {
  54. data:[],
  55. date: this.initDate(),//实时时间
  56. nowWeek:'',
  57. netPieData:[],
  58. workData:[
  59. {
  60. 'number': 'A0001B',
  61. 'position': '固定轴—机座',
  62. 'user': '员工1'
  63. },{
  64. 'number': 'A0001B',
  65. 'position': '固定轴—机座',
  66. 'user': '员工1'
  67. },{
  68. 'number': 'A0001B',
  69. 'position': '固定轴—机座',
  70. 'user': '员工1'
  71. },{
  72. 'number': 'A0001B',
  73. 'position': '固定轴—机座',
  74. 'user': '员工1'
  75. },{
  76. 'number': 'A0001B',
  77. 'position': '固定轴—机座',
  78. 'user': '员工1'
  79. },
  80. ],
  81. mapData: [],//地图数据
  82. mapData1: [],//地图数据
  83. mapData2: [],//地图数据
  84. alarmData: [],//实时告警数据
  85. PlanBarxAxisData:['1月','2月','3月','4月','5月','6月','7月'],//频繁告警区域X轴
  86. PlanBarData: [70,42,28,23,45,23,52],//频繁告警区域数据
  87. // fengxAxisData:['总数','在线','异常'],//液压泵设备统计X轴
  88. fengTypeData:[
  89. {
  90. 'value': 150,
  91. 'name': '新增'
  92. }, {
  93. 'value': 37,
  94. 'name': '异常'
  95. },
  96. ],//井类型数据
  97. barTypexAxisData:['一季度','二季度','三季度','四季度'],//液压泵设备统计X轴
  98. barTypeData:[100,76,24,20],//井类型数据
  99. lineAlarmxAxisData:[],//月告警曲线图X轴
  100. lineAlarmData:[],//月告警曲线图数据
  101. deviceStatusData:[],//设备状态统计数据
  102. pieOptions: {},
  103. pieStateOptions:{},
  104. pieFaultOptions:{},
  105. pieRightOptions:{},
  106. pieCenterOptions:{},
  107. pieDeviceOptions:{},
  108. netPieOptions:{},
  109. barPlanOptions: {},
  110. RealAlarmBarData:[],
  111. RealAlarmBarxAxisData:[],
  112. barRealtimeAlarmOptions:{},//当前告警数统计
  113. subRealAlarmBarData:[],
  114. subRealAlarmBarxAxisData:[],
  115. subRealtimeAlarmOptions:{},//分体告警
  116. barOptions: {},
  117. lineOptions:{},
  118. mapOptions: {},
  119. signalColor:[],
  120. netStateColor:[],
  121. deviceTotal:'',
  122. };
  123. },
  124. methods: {
  125. goback(){
  126. this.$router.go(-1)
  127. },
  128. getNetPieOptions() {
  129. return {
  130. color: this.netStateColor,
  131. title: {
  132. text: "设备状态",
  133. textStyle: {
  134. fontWeight: "600",
  135. fontSize: "18",
  136. color: "#3fd5f1"
  137. }
  138. },
  139. tooltip: {
  140. trigger: "item",
  141. formatter: "{a} <br/>{b} : {c} ({d}%)"
  142. },
  143. legend: {
  144. orient: "vertical",
  145. left: 10,
  146. top: 30,
  147. textStyle: {
  148. color: "#FFF"
  149. }
  150. },
  151. series: [
  152. {
  153. name: "设备状态",
  154. type: "pie",
  155. radius: ["45%", "60%"], // 内外半径
  156. left: 200,
  157. avoidLabelOverlap: false,
  158. label: {
  159. show: false,
  160. position: "center"
  161. },
  162. center: ['10%', '50%'],
  163. emphasis: {
  164. label: {
  165. show: true,
  166. fontSize: "30",
  167. fontWeight: "bold",
  168. }
  169. },
  170. labelLine: {
  171. show: false
  172. },
  173. data: this.netPieData
  174. }
  175. ]
  176. };
  177. },
  178. getPieDeviceOptions(){
  179. return {
  180. title: {
  181. text: "故障设备状态",
  182. textStyle: {
  183. fontWeight: "600",
  184. fontSize: "18",
  185. color: "#3fd5f1"
  186. }
  187. },
  188. color:['#FE7E00','#FEC400','#22DACE'],
  189. tooltip: {},
  190. legend: {
  191. x : '50%',
  192. y : '38%',
  193. textStyle : {
  194. color:'#FFF',
  195. },
  196. orient : 'vertical',
  197. data:['液压泵','液压扳手','中空液压扳手'],
  198. formatter: function(name) {
  199. var index = 0;
  200. var clientlabels =['液压泵','液压扳手','中空液压扳手']
  201. var clientcounts = [400,300,200];
  202. clientlabels.forEach(function(value,i){
  203. if(value == name){
  204. index = i;
  205. }
  206. });
  207. return name + " " + clientcounts[index];
  208. }
  209. },
  210. calculable : false,
  211. series: [{
  212. name: '故障设备',
  213. type: 'pie',
  214. radius: ["35%", "60%"], // 内外半径
  215. center: ['25%', '55%'],
  216. startAngle:90, //开始 的旋转角度
  217. itemStyle: {
  218. normal: {
  219. label: {
  220. show: false,
  221. position: 'inner'
  222. },
  223. labelLine: {
  224. show: false,
  225. }
  226. }
  227. },
  228. data: [
  229. {value:400, name:'液压泵'},
  230. {value:300, name:'液压扳手'},
  231. {value:200, name:'中空液压扳手'},
  232. ]
  233. }
  234. ]
  235. };
  236. },
  237. getpieRightOptions(){
  238. return {
  239. tooltip: {
  240. show: false,
  241. trigger: 'item',
  242. formatter: "{a} : {c} ({d}%)"
  243. },
  244. legend: {
  245. show:false
  246. },
  247. // color: ['#546570', '#c4ccd3'],
  248. // color: ['rgb(255,159,127)', 'rgb(50,197,233)'],
  249. // legend: {
  250. // orient: 'vertical',
  251. // x: '35%',
  252. // top: '27%',
  253. // itemHeight: 10,//图例的高度
  254. // itemGap: 8,//图例之间的间距
  255. // data: ['通过率' + pass_rate + '%', '平均值' + average + '%']
  256. // //图例的名字需要和饼图的name一致,才会显示图例
  257. // },
  258. title: {
  259. text: 80+ '%', //图形标题,配置在中间对应效果图的80%
  260. left: "center",
  261. top: "50%",
  262. textStyle: {
  263. color: "rgb(50,197,233)",
  264. fontSize: 16,
  265. align: "center"
  266. }
  267. },
  268. series: [
  269. {
  270. type: 'pie',
  271. radius: ['70%', '90%'], //设置内外环半径,两者差值越大,环越粗
  272. hoverAnimation: false,  //移入图形是否放大
  273. label: { //对应效果图中的Angular显示与否以及设置样式
  274. // show: true,
  275. // position: 'center',
  276. normal: {
  277. show: true,
  278. position: 'center',
  279. padding: [0, 0, 20, 0], //设置字angular的边距
  280. fontSize: 16,
  281. }
  282. },
  283. labelLine: {
  284. normal: { //label线不显示
  285. show: false
  286. }
  287. },
  288. // emphasis: { //鼠标移入时效果
  289. // label: {
  290. // show: false,
  291. // fontSize: '20',
  292. // fontWeight: 'bold'
  293. // }
  294. // },
  295. data: [
  296. {
  297. name: '良好', //数据,name对应Angular
  298. value: 80, //对应显示的部分数据即80%
  299. itemStyle: {
  300. normal: {
  301. color: 'rgb(50,197,233)',
  302. }
  303. }
  304. },
  305. {
  306. value: 20,
  307. itemStyle: {
  308. normal: {
  309. color: 'transparent'
  310. }
  311. }
  312. }
  313. ]
  314. }
  315. ]
  316. };
  317. },
  318. getpieCenterOptions(){
  319. return {
  320. tooltip: {
  321. show: false,
  322. trigger: 'item',
  323. formatter: "{a} : {c} ({d}%)"
  324. },
  325. legend: {
  326. show:false
  327. },
  328. // color: ['#546570', '#c4ccd3'],
  329. // color: ['rgb(255,159,127)', 'rgb(50,197,233)'],
  330. // legend: {
  331. // orient: 'vertical',
  332. // x: '35%',
  333. // top: '27%',
  334. // itemHeight: 10,//图例的高度
  335. // itemGap: 8,//图例之间的间距
  336. // data: ['通过率' + pass_rate + '%', '平均值' + average + '%']
  337. // //图例的名字需要和饼图的name一致,才会显示图例
  338. // },
  339. title: {
  340. text: 70+ '%', //图形标题,配置在中间对应效果图的80%
  341. left: "center",
  342. top: "50%",
  343. textStyle: {
  344. color: "green",
  345. fontSize: 16,
  346. align: "center"
  347. }
  348. },
  349. series: [
  350. {
  351. type: 'pie',
  352. radius: ['70%', '90%'], //设置内外环半径,两者差值越大,环越粗
  353. hoverAnimation: false,  //移入图形是否放大
  354. label: { //对应效果图中的Angular显示与否以及设置样式
  355. // show: true,
  356. // position: 'center',
  357. normal: {
  358. show: true,
  359. position: 'center',
  360. padding: [0, 0, 20, 0], //设置字angular的边距
  361. fontSize: 16,
  362. }
  363. },
  364. labelLine: {
  365. normal: { //label线不显示
  366. show: false
  367. }
  368. },
  369. // emphasis: { //鼠标移入时效果
  370. // label: {
  371. // show: false,
  372. // fontSize: '20',
  373. // fontWeight: 'bold'
  374. // }
  375. // },
  376. data: [
  377. {
  378. name: '良好', //数据,name对应Angular
  379. value: 70, //对应显示的部分数据即80%
  380. itemStyle: {
  381. normal: {
  382. color: 'green',
  383. }
  384. }
  385. },
  386. {
  387. value: 30,
  388. itemStyle: {
  389. normal: {
  390. color: 'transparent'
  391. }
  392. }
  393. }
  394. ]
  395. }
  396. ]
  397. };
  398. },
  399. getPieFaultOptions(){
  400. return {
  401. title: {
  402. text: "故障代码状态(TOP5)",
  403. textStyle: {
  404. fontWeight: "600",
  405. fontSize: "18",
  406. color: "#3fd5f1"
  407. }
  408. },
  409. tooltip: {},
  410. legend: {
  411. x : '50%',
  412. y : '28%',
  413. textStyle : {
  414. color:'#FFF',
  415. },
  416. orient : 'vertical',
  417. data:['液压油偏低','扳手校验不合格','液压泵校验过期','扳手外观不合格','设备异常'],
  418. formatter: function(name) {
  419. var index = 0;
  420. var clientlabels =['液压油偏低','扳手校验不合格','液压泵校验过期','扳手外观不合格','设备异常']
  421. var clientcounts = [400,300,200,200,200];
  422. clientlabels.forEach(function(value,i){
  423. if(value == name){
  424. index = i;
  425. }
  426. });
  427. return name + " " + clientcounts[index];
  428. }
  429. },
  430. calculable : false,
  431. series: [{
  432. name: '故障代码',
  433. type: 'pie',
  434. radius: ["35%", "60%"], // 内外半径
  435. center: ['25%', '55%'],
  436. startAngle:90, //开始 的旋转角度
  437. itemStyle: {
  438. normal: {
  439. label: {
  440. show: false,
  441. position: 'inner'
  442. },
  443. labelLine: {
  444. show: false,
  445. }
  446. }
  447. },
  448. data: [
  449. {value:400, name:'液压油偏低'},
  450. {value:300, name:'扳手校验不合格'},
  451. {value:200, name:'液压泵校验过期'},
  452. {value:200, name:'扳手外观不合格'},
  453. {value:200, name:'设备异常'},
  454. ]
  455. }
  456. ]
  457. };
  458. },
  459. getPieStateOptions(){
  460. return {
  461. color: ['green','red','yellow'],
  462. tooltip: {
  463. trigger: 'item'
  464. },
  465. legend: {
  466. show:false
  467. },
  468. series: [
  469. {
  470. name: '校准状态',
  471. type: 'pie',
  472. radius: ['0', '90%'],
  473. avoidLabelOverlap: false,
  474. label: {
  475. normal: {
  476. show: true,
  477. position: 'inner', // 数值显示在内部
  478. color:'#32c5e9',
  479. formatter: '{b}', // 格式化数值百分比输出
  480. },
  481. },
  482. emphasis: {
  483. label: {
  484. show: true,
  485. fontSize: '16',
  486. fontWeight: 'bold'
  487. }
  488. },
  489. labelLine: {
  490. show: false
  491. },
  492. data: [
  493. { value: 1048, name: '已校准' },
  494. { value: 735, name: '过期' },
  495. { value: 580, name: '待检' },
  496. ]
  497. }
  498. ]
  499. };
  500. },
  501. getPieOptions() {
  502. return {
  503. color: this.signalColor,
  504. legend: {
  505. show: false
  506. },
  507. title: {
  508. text: "服务螺栓区域分布(单位:根)",
  509. textStyle: {
  510. fontWeight: "600",
  511. fontSize: "18",
  512. color: "#3fd5f1"
  513. }
  514. },
  515. tooltip: {
  516. trigger: 'item',
  517. formatter: '{a} <br/>{b} : {c}({d}%)'
  518. },
  519. graphic:{
  520. type: "text",
  521. left: "center",
  522. top: "center",
  523. style:{
  524. text: this.total,
  525. fill: "#fff",
  526. fontSize: 30,
  527. fontWeight: 700
  528. }
  529. },
  530. series: [
  531. {
  532. name: '服务螺栓数',
  533. type: 'pie',
  534. radius: [0, '57%'],
  535. center: ['50%', '50%'],
  536. roseType: 'area',
  537. itemStyle: {
  538. borderRadius: 20
  539. },
  540. label: {
  541. // show: false,
  542. formatter: '{b} : {c}',
  543. position: 'outer',
  544. alignTo: 'labelLine',
  545. bleedMargin: 5
  546. },
  547. data: [
  548. { value: 40, name: '华北大区' },
  549. { value: 38, name: '东北大区' },
  550. { value: 32, name: '西北大区' },
  551. { value: 30, name: '南部大区' },
  552. { value: 28, name: '中部大区' },
  553. { value: 26, name: '内蒙大区' },
  554. { value: 22, name: '江苏大区' }
  555. ]
  556. }
  557. ]
  558. }
  559. },
  560. getBarOptions() {
  561. return {
  562. title: {
  563. text: "已服务统计",
  564. textStyle: {
  565. fontWeight: "600",
  566. fontSize: "18",
  567. color: "#3fd5f1"
  568. }
  569. },
  570. color: ["#3398DB"],
  571. tooltip: {
  572. trigger: "axis"
  573. },
  574. grid: {
  575. left: "1%",
  576. bottom: "5%",
  577. containLabel: true
  578. },
  579. xAxis: [
  580. {
  581. type: "category",
  582. nameLocation: "end",
  583. data: this.barTypexAxisData,
  584. nameTextStyle: {
  585. color: "#fff"
  586. },
  587. axisLine: {
  588. lineStyle: { color: "#FFF" }
  589. },
  590. axisLabel: {
  591. textStyle: {
  592. color: "#fff"
  593. },
  594. interval: 0,
  595. rotate: 40
  596. }
  597. }
  598. ],
  599. yAxis: [
  600. {
  601. type: "value",
  602. nameTextStyle: {
  603. color: "#fff"
  604. },
  605. splitLine: {
  606. show: false
  607. },
  608. axisLine: {
  609. lineStyle: { color: "#FFF" }
  610. },
  611. axisLabel: {
  612. textStyle: {
  613. color: "#fff"
  614. }
  615. }
  616. }
  617. ],
  618. series: [
  619. {
  620. type: "bar",
  621. barWidth: "40%",
  622. data:this.barTypeData,
  623. showBackground: true,
  624. itemStyle: {
  625. normal: {
  626. label: {
  627. show: true, //开启显示
  628. position: 'top', //在上方显示
  629. textStyle: { //数值样式
  630. color: "white",
  631. fontSize: 12
  632. }
  633. }
  634. },
  635. },
  636. }
  637. ]
  638. };
  639. },
  640. getLineOptions() {
  641. return {
  642. title: {
  643. text: "设备利用率",
  644. textStyle: {
  645. fontWeight: "600",
  646. fontSize: "18",
  647. color: "#3fd5f1"
  648. }
  649. },
  650. grid: {
  651. left: "14%",
  652. right: "13%",
  653. },
  654. tooltip: {
  655. trigger: "axis",
  656. axisPointer: {
  657. type: "line"
  658. },
  659. padding: [5, 10]
  660. },
  661. xAxis: {
  662. type: "category",
  663. name: "月份",
  664. nameLocation: "end",
  665. data: this.lineAlarmxAxisData,
  666. nameTextStyle: {
  667. color: "#fff"
  668. },
  669. axisLine: {
  670. lineStyle: { color: "#FFF" }
  671. },
  672. axisLabel: {
  673. textStyle: {
  674. fontSize: "10",
  675. color: "#fff"
  676. },
  677. rotate: -40
  678. }
  679. },
  680. yAxis: {
  681. nameTextStyle: {
  682. color: "#fff"
  683. },
  684. splitLine: {
  685. show: false
  686. },
  687. axisLine: {
  688. lineStyle: { color: "#FFF" }
  689. },
  690. axisLabel: {
  691. textStyle: {
  692. color: "#fff"
  693. }
  694. }
  695. },
  696. series: [
  697. {
  698. data: this.lineAlarmData,
  699. type: "line",
  700. smooth: true,
  701. lineStyle: {
  702. color: "#eab72c"
  703. },
  704. itemStyle: {
  705. color: "#eab72c"
  706. }
  707. }
  708. ]
  709. };
  710. },
  711. getSubRealAlarmBarOptions(){
  712. return {
  713. title: {
  714. text: "告警状态统计(分体)",
  715. textStyle: {
  716. fontWeight: "600",
  717. fontSize: "18",
  718. color: "#3fd5f1"
  719. }
  720. },
  721. color: ["#3398DB"],
  722. tooltip: {
  723. trigger: "axis"
  724. },
  725. grid: {
  726. left: "5%",
  727. right: "15%",
  728. bottom: "5%",
  729. containLabel: true
  730. },
  731. xAxis: [
  732. {
  733. type: "category",
  734. name: "状态",
  735. nameLocation: "end",
  736. data: this.subRealAlarmBarxAxisData,
  737. nameTextStyle: {
  738. color: "#fff"
  739. },
  740. axisLine: {
  741. lineStyle: { color: "#FFF" }
  742. },
  743. axisLabel: {
  744. textStyle: {
  745. color: "#fff",
  746. fontSize:10
  747. },
  748. rotate: -40
  749. }
  750. }
  751. ],
  752. yAxis: [
  753. {
  754. type: "value",
  755. name: "设备数量",
  756. nameTextStyle: {
  757. color: "#fff"
  758. },
  759. splitLine: {
  760. show: false
  761. },
  762. axisLine: {
  763. lineStyle: { color: "#FFF" }
  764. },
  765. axisLabel: {
  766. textStyle: {
  767. color: "#fff"
  768. }
  769. }
  770. }
  771. ],
  772. series: [
  773. {
  774. type: "bar",
  775. barWidth: "20%",
  776. data: this.subRealAlarmBarData,
  777. itemStyle: {
  778. normal: {
  779. label: {
  780. show: true, //开启显示
  781. position: 'top', //在上方显示
  782. textStyle: { //数值样式
  783. color: "white",
  784. fontSize: 12
  785. }
  786. }
  787. }
  788. }
  789. }
  790. ]
  791. };
  792. },
  793. getRealAlarmBarOptions(){
  794. return {
  795. title: {
  796. text: "告警状态统计(主体)",
  797. textStyle: {
  798. fontWeight: "600",
  799. fontSize: "18",
  800. color: "#3fd5f1"
  801. }
  802. },
  803. color: ["#3398DB"],
  804. tooltip: {
  805. trigger: "axis"
  806. },
  807. grid: {
  808. left: "5%",
  809. right: "15%",
  810. bottom: "5%",
  811. containLabel: true
  812. },
  813. xAxis: [
  814. {
  815. type: "category",
  816. name: "状态",
  817. nameLocation: "end",
  818. data: this.RealAlarmBarxAxisData,
  819. nameTextStyle: {
  820. color: "#fff"
  821. },
  822. axisLine: {
  823. lineStyle: { color: "#FFF" }
  824. },
  825. axisLabel: {
  826. textStyle: {
  827. color: "#fff",
  828. fontSize:10
  829. },
  830. rotate: -40
  831. }
  832. }
  833. ],
  834. yAxis: [
  835. {
  836. type: "value",
  837. name: "设备数量",
  838. nameTextStyle: {
  839. color: "#fff"
  840. },
  841. splitLine: {
  842. show: false
  843. },
  844. axisLine: {
  845. lineStyle: { color: "#FFF" }
  846. },
  847. axisLabel: {
  848. textStyle: {
  849. color: "#fff"
  850. }
  851. }
  852. }
  853. ],
  854. series: [
  855. {
  856. type: "bar",
  857. barWidth: "20%",
  858. data: this.RealAlarmBarData,
  859. itemStyle: {
  860. normal: {
  861. label: {
  862. show: true, //开启显示
  863. position: 'top', //在上方显示
  864. textStyle: { //数值样式
  865. color: "white",
  866. fontSize: 12
  867. }
  868. }
  869. }
  870. }
  871. }
  872. ]
  873. };
  874. },
  875. getPlanBarOptions() {
  876. return {
  877. title: {
  878. text: "校准计划",
  879. textStyle: {
  880. fontWeight: "600",
  881. fontSize: "18",
  882. color: "#3fd5f1"
  883. }
  884. },
  885. color: ["#3398DB"],
  886. tooltip: {
  887. trigger: "axis"
  888. },
  889. legend: {
  890. show: false
  891. },
  892. grid: {
  893. left: "5%",
  894. right: "10%",
  895. bottom: "5%",
  896. containLabel: true
  897. },
  898. xAxis: [
  899. {
  900. type: "category",
  901. nameLocation: "end",
  902. data: this.PlanBarxAxisData,
  903. nameTextStyle: {
  904. color: "#fff"
  905. },
  906. axisLine: {
  907. lineStyle: { color: "#FFF" }
  908. },
  909. axisLabel: {
  910. textStyle: {
  911. color: "#fff"
  912. },
  913. }
  914. }
  915. ],
  916. yAxis: [
  917. {
  918. type: "value",
  919. nameTextStyle: {
  920. color: "#fff"
  921. },
  922. splitLine: {
  923. show: false
  924. },
  925. axisLine: {
  926. lineStyle: { color: "#FFF" }
  927. },
  928. axisLabel: {
  929. textStyle: {
  930. color: "#fff"
  931. }
  932. }
  933. }
  934. ],
  935. series: [
  936. {
  937. type: "bar",
  938. name:'实际校准',
  939. barWidth: "20%",
  940. data: this.PlanBarData,
  941. itemStyle: {
  942. normal: {
  943. label: {
  944. show: false, //开启显示
  945. position: 'top', //在上方显示
  946. textStyle: { //数值样式
  947. color: "white",
  948. fontSize: 12
  949. }
  950. }
  951. }
  952. }
  953. },
  954. {
  955. type: "bar",
  956. name:'计划校准',
  957. barWidth: "20%",
  958. data: this.PlanBarData,
  959. itemStyle: {
  960. normal: {
  961. label: {
  962. show: false, //开启显示
  963. position: 'top', //在上方显示
  964. textStyle: { //数值样式
  965. color: "white",
  966. fontSize: 12
  967. }
  968. }
  969. }
  970. }
  971. }
  972. ]
  973. };
  974. },
  975. getMapOptions() {
  976. return {
  977. // title: {
  978. // text: "风场位置地图",
  979. // textStyle: {
  980. // fontWeight: "600",
  981. // fontSize: "18",
  982. // color: "#3fd5f1"
  983. // }
  984. // },
  985. color: ['#dd4444', '#fec42c', '#80F1BE'],
  986. geo: {
  987. // 这个是重点配置区
  988. map: "china",
  989. label: {
  990. emphasis: {
  991. show: true
  992. }
  993. },
  994. roam: false,
  995. itemStyle: {
  996. normal: {
  997. areaColor: "#245baf",
  998. borderColor: "#FFF"
  999. },
  1000. emphasis: {
  1001. areaColor: "#33c4f6" //鼠标指上市时的颜色
  1002. }
  1003. }
  1004. },
  1005. // aspectScale: 1.1, //地图的长宽比
  1006. // itemStyle: {
  1007. // borderWidth: 1,
  1008. // borderColor: '#0090fe', //边框颜色
  1009. // areaColor: '#003399', //地图区域颜色
  1010. // shadowColor: '#182f68',
  1011. // shadowOffsetX: 0,
  1012. // shadowOffsetY: 10
  1013. // },
  1014. // emphasis: {
  1015. // itemStyle: {
  1016. // show: 'true',
  1017. // borderWidth: 4,
  1018. // borderColor: '#b2163c', //边框颜色
  1019. // areaColor: '#531f67', //鼠标移上去的颜色
  1020. // },
  1021. // label: {
  1022. // color: '#fff',
  1023. // fontWeight: 'bold',
  1024. // show: true,
  1025. // }
  1026. // },
  1027. //滑动显示数据
  1028. tooltip: {
  1029. trigger: "item",
  1030. formatter:function (params) {
  1031. var res = '';
  1032. // res+=params['data'].name+'</br>';
  1033. res+='风场名称' +' : '+params['name']+'</br>';
  1034. res+='风场位置' +' : '+params['data']['address']+'</br>';
  1035. res+='液压泵数量' +' : '+params['data']['number']+'</br>';
  1036. res+='液压扳手数量' +' : '+params['data']['number']+'</br>';
  1037. return res;
  1038. }
  1039. },
  1040. series: [
  1041. {
  1042. name: "三天内使用",
  1043. type: "scatter",
  1044. coordinateSystem: "geo",
  1045. zlevel: 2,
  1046. label: {
  1047. position: "right",
  1048. show: false
  1049. },
  1050. symbolSize: 10,
  1051. itemStyle: {
  1052. normal: {
  1053. color: "yellow"
  1054. }
  1055. },
  1056. data: this.mapData
  1057. },
  1058. {
  1059. name: "静止状态",
  1060. type: "scatter",
  1061. coordinateSystem: "geo",
  1062. zlevel: 2,
  1063. label: {
  1064. position: "right",
  1065. show: false
  1066. },
  1067. symbolSize: 10,
  1068. itemStyle: {
  1069. normal: {
  1070. color: "red"
  1071. }
  1072. },
  1073. data: this.mapData1
  1074. },
  1075. {
  1076. name: "当天使用",
  1077. type: "scatter",
  1078. coordinateSystem: "geo",
  1079. zlevel: 2,
  1080. label: {
  1081. position: "right",
  1082. show: false
  1083. },
  1084. symbolSize: 10,
  1085. itemStyle: {
  1086. normal: {
  1087. color: "green"
  1088. }
  1089. },
  1090. data: this.mapData2
  1091. }
  1092. ]
  1093. };
  1094. },
  1095. //地图左上 设备状态数量统计
  1096. // getDeviceStatusCount(){
  1097. // this.$http.get('total/device/statusCount').then(response => {
  1098. // this.deviceStatusData=response.data
  1099. // })
  1100. // },
  1101. //获取地图上设备数据
  1102. getDeviceData() {
  1103. // this.$http.get('preview/getDeviceTotal').then(response => {
  1104. // console.log(response.data);
  1105. let data=[];
  1106. // //设备地址
  1107. // this.mapData =data.addrList
  1108. // this.mapOptions = this.getMapOptions();
  1109. //地图左上 设备状态数量统计
  1110. // this.deviceStatusData=data.statusTotal
  1111. let netState= this.$appConfig.netState;
  1112. let netTotalArr=[];
  1113. for(let i=0;i<netState.length;i++){
  1114. // let netItem={value: data.statusTotal[netState[i].value], name: netState[i].label}
  1115. // netTotalArr.push(netItem)
  1116. }
  1117. // this.netPieData=netTotalArr
  1118. this.netPieOptions = this.getNetPieOptions();
  1119. //左上 设备信号统计
  1120. // this.pieData=data.signalTotal
  1121. this.pieOptions = this.getPieOptions();
  1122. this.pieStateOptions = this.getPieStateOptions();
  1123. this.pieFaultOptions=this.getPieFaultOptions();
  1124. this.pieCenterOptions=this.getpieCenterOptions()
  1125. this.pieRightOptions=this.getpieRightOptions()
  1126. this.pieDeviceOptions=this.getPieDeviceOptions()
  1127. //左中 液压泵设备统计
  1128. // this.barTypeData = data.typeTotal.yAxisData;
  1129. // this.barTypexAxisData=data.typeTotal.xAxisData;
  1130. this.barOptions = this.getBarOptions();
  1131. // })
  1132. },
  1133. async getDeviceAddress() {
  1134. var query={start:0,limit:10000}
  1135. var that=this
  1136. await this.$http.get('preview/getDeviceAddressList',{ params: query}).then(response => {
  1137. // console.log(response.data);
  1138. let data=response.data;
  1139. //设备地址
  1140. this.mapData =data.addrList
  1141. this.mapData1 =data.addrList1
  1142. this.mapData2 =data.addrList2
  1143. this.mapOptions = this.getMapOptions();
  1144. })
  1145. },
  1146. async getDeviceAddressBatch(start,limit) {
  1147. var query={start:start,limit:limit}
  1148. await this.$http.get('preview/getDeviceAddressList',{ params: query}).then(response => {
  1149. let data=response.data;
  1150. this.mapData = this.mapData.concat(data.addrList)
  1151. this.deviceTotal = data.total;
  1152. })
  1153. },
  1154. async getAlldeviceListBatch(start,limit){
  1155. var length=Math.ceil(this.deviceTotal/limit)
  1156. if(length<=start){
  1157. return
  1158. }
  1159. for(var i=start;i<length;i++){
  1160. await this.getDeviceAddressBatch(i,limit);
  1161. }
  1162. this.mapOptions = this.getMapOptions();
  1163. },
  1164. //左下 当天告警统计
  1165. getAlarmData(){
  1166. // this.$http.get('preview/alarmTotal').then(response => {
  1167. // console.log(response.data)
  1168. // this.alarm_data=response.data
  1169. // })
  1170. },
  1171. //右上 月告警统计
  1172. getLineAlarmData(){
  1173. this.$http.get('preview/monthAlarmData').then(response => {
  1174. this.lineAlarmxAxisData=response.data.xAxisData;
  1175. this.lineAlarmData=response.data.yAxisData;
  1176. this.lineOptions = this.getLineOptions();
  1177. })
  1178. },
  1179. //右下 实时告警信息
  1180. getScrollAndAreaData() {
  1181. // this.$http.get('preview/realTimeAlarmData').then(response => {
  1182. // let data =response.data
  1183. // this.alarmData =data.scrollData
  1184. this.alarmData=[
  1185. {
  1186. 'date': '2022-03-04 09:40:35',
  1187. 'name': '测试设备',
  1188. 'number': '000001',
  1189. 'result': '正常',
  1190. },{
  1191. 'date': '2022-03-04 09:40:35',
  1192. 'name': '测试设备',
  1193. 'number': '000001',
  1194. 'result': '正常',
  1195. },{
  1196. 'date': '2022-03-04 09:40:35',
  1197. 'name': '测试设备',
  1198. 'number': '000001',
  1199. 'result': '正常',
  1200. },{
  1201. 'date': '2022-03-04 09:40:35',
  1202. 'name': '测试设备',
  1203. 'number': '000001',
  1204. 'result': '正常',
  1205. },{
  1206. 'date': '2022-03-04 09:40:35',
  1207. 'name': '测试设备',
  1208. 'number': '000001',
  1209. 'result': '正常',
  1210. },{
  1211. 'date': '2022-03-04 09:40:35',
  1212. 'name': '测试设备',
  1213. 'number': '000001',
  1214. 'result': '正常',
  1215. },{
  1216. 'date': '2022-03-04 09:40:35',
  1217. 'name': '测试设备',
  1218. 'number': '000001',
  1219. 'result': '正常',
  1220. },{
  1221. 'date': '2022-03-04 09:40:35',
  1222. 'name': '测试设备',
  1223. 'number': '000001',
  1224. 'result': '正常',
  1225. },{
  1226. 'date': '2022-03-04 09:40:35',
  1227. 'name': '测试设备',
  1228. 'number': '000001',
  1229. 'result': '正常',
  1230. }
  1231. ,{
  1232. 'date': '2022-03-04 09:40:35',
  1233. 'name': '测试设备',
  1234. 'number': '000001',
  1235. 'result': '正常',
  1236. },{
  1237. 'date': '2022-03-04 09:40:35',
  1238. 'name': '测试设备',
  1239. 'number': '000001',
  1240. 'result': '正常',
  1241. },{
  1242. 'date': '2022-03-04 09:40:35',
  1243. 'name': '测试设备',
  1244. 'number': '000001',
  1245. 'result': '正常',
  1246. },{
  1247. 'date': '2022-03-04 09:40:35',
  1248. 'name': '测试设备',
  1249. 'number': '000001',
  1250. 'result': '正常',
  1251. },{
  1252. 'date': '2022-03-04 09:40:35',
  1253. 'name': '测试设备',
  1254. 'number': '000001',
  1255. 'result': '正常',
  1256. },{
  1257. 'date': '2022-03-04 09:40:35',
  1258. 'name': '测试设备',
  1259. 'number': '000001',
  1260. 'result': '正常',
  1261. },{
  1262. 'date': '2022-03-04 09:40:35',
  1263. 'name': '测试设备',
  1264. 'number': '000001',
  1265. 'result': '正常',
  1266. },{
  1267. 'date': '2022-03-04 09:40:35',
  1268. 'name': '测试设备',
  1269. 'number': '000001',
  1270. 'result': '正常',
  1271. },{
  1272. 'date': '2022-03-04 09:40:35',
  1273. 'name': '测试设备',
  1274. 'number': '000001',
  1275. 'result': '正常',
  1276. },{
  1277. 'date': '2022-03-04 09:40:35',
  1278. 'name': '测试设备',
  1279. 'number': '000001',
  1280. 'result': '正常',
  1281. }
  1282. ]
  1283. //中下 频繁告警区域
  1284. // this.PlanBarData =data.areaData.yAxisData;
  1285. // this.PlanBarxAxisData=data.areaData.xAxisData;
  1286. this.barPlanOptions = this.getPlanBarOptions();
  1287. // })
  1288. },
  1289. //中下 实时告警类型统计
  1290. getrealAlarmTypeTotal(){
  1291. // this.$http.get('preview/realAlarmTypeTotal').then(response => {
  1292. // console.log(response.data)
  1293. // this.barRealtimeAlarmOptions=response.data
  1294. // this.RealAlarmBarData =response.data.yAxisData;
  1295. // this.RealAlarmBarxAxisData=response.data.xAxisData;
  1296. this.barRealtimeAlarmOptions = this.getRealAlarmBarOptions();
  1297. // this.subRealAlarmBarData =response.data.subyAxisData;
  1298. // this.subRealAlarmBarxAxisData=response.data.subxAxisData;
  1299. this.subRealtimeAlarmOptions= this.getSubRealAlarmBarOptions();
  1300. // })
  1301. },
  1302. //获取并格式化时间
  1303. initDate(){
  1304. var tmpDate = new Date(); // 每一秒取一次当前时间
  1305. let wk = tmpDate.getDay()
  1306. //格式化 Date()
  1307. var year = tmpDate.getFullYear();
  1308. var month = ("0" + (tmpDate.getMonth() + 1)).slice(-2)
  1309. var date = ("0" + tmpDate.getDate()).slice(-2)
  1310. var h =("0" + tmpDate.getHours()).slice(-2)
  1311. var m =("0" + tmpDate.getMinutes()).slice(-2)
  1312. var s =("0" + tmpDate.getSeconds()).slice(-2)
  1313. let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  1314. this.nowWeek = weeks[wk]
  1315. return year+'-'+month+'-'+date+ ' '+h+':'+m+':'+s
  1316. },
  1317. initSignalColor(){
  1318.   let signal_color = this.$appConfig.signalColor;
  1319. signal_color .forEach((item) => {
  1320.                 this.signalColor.push(item.color)
  1321.         })
  1322. let netStateColor= this.$appConfig.netState;
  1323. netStateColor.forEach((item) => {
  1324.                 this.netStateColor.push(item.color)
  1325.         })
  1326. }
  1327. },
  1328. mounted() {
  1329. var that = this;
  1330. var alarmTimer=30000
  1331. var deviceTimer=900000
  1332. //初始化大屏
  1333. //获取地图设备数据时 重新调用获取地图options方法
  1334. this.getDeviceData();
  1335. this.getDeviceAddress();
  1336. //获取设备状态统计数据
  1337. // this.getDeviceStatusCount();
  1338. //获取告警统计
  1339. this.getAlarmData();
  1340. //告警状态统计
  1341. this.getrealAlarmTypeTotal();
  1342. //获取月告警曲线图数据
  1343. this.getLineAlarmData();
  1344. //实时滚动警告信息 频繁告警区域信息
  1345. this.getScrollAndAreaData();
  1346. this.initSignalColor();
  1347. //初始化时间
  1348. this.timer = setInterval(() => {
  1349. that.date = this.initDate()
  1350. }, 1000)
  1351. //获取配置请求时间
  1352. // this.$http.get('preview/getScreenRequestConfig').then(response => {
  1353. // var config=response.data
  1354. // if(config.device_request_interval){
  1355. // deviceTimer=config.device_request_interval*1000
  1356. // }
  1357. // if(config.alarm_request_interval){
  1358. // alarmTimer=config.alarm_request_interval*1000
  1359. // }
  1360. // this.timer1 = setInterval(() => {
  1361. // this.getScrollAndAreaData();
  1362. // this.getAlarmData();
  1363. // this.getrealAlarmTypeTotal();
  1364. // }, alarmTimer)
  1365. // this.timer2 = setInterval(() => {
  1366. // this.getDeviceData();
  1367. // this.mapData=[];
  1368. // this.getAlldeviceListBatch(0,10000);
  1369. // this.getLineAlarmData();
  1370. // }, deviceTimer)
  1371. // })
  1372. },
  1373. beforeDestroy() {
  1374. if (this.timer) {
  1375. clearInterval(this.timer); // 在Vue实例销毁前,清除我们的定时器
  1376. }
  1377. if (this.timer1) {
  1378. clearInterval(this.timer1); // 在Vue实例销毁前,清除我们的定时器
  1379. }
  1380. if (this.timer2) {
  1381. clearInterval(this.timer2); // 在Vue实例销毁前,清除我们的定时器
  1382. }
  1383. }
  1384. }
  1385. </script>
  1386. <style scoped>
  1387. #content{
  1388. width:100%;
  1389. min-width: 1280px;
  1390. height: calc(60vw - 84px);
  1391. /* height: 100vh; */
  1392. min-height: calc(100vh - 84px);
  1393. background-image: url("../../assets/screen/bg_body.png");
  1394. background-position-x: initial;
  1395. background-position-y: initial;
  1396. background-size: 100% 100%;
  1397. background-attachment: initial;
  1398. background-origin: initial;
  1399. background-clip: initial;
  1400. background-color: initial;
  1401. }
  1402. ::v-deep .el-carousel{
  1403. width:100%;
  1404. height:100%;
  1405. }
  1406. ::v-deep .el-carousel__container{
  1407. width:100%;
  1408. height:100%;
  1409. }
  1410. ::v-deep .el-carousel__item h3 {
  1411. color: #475669;
  1412. font-size: 18px;
  1413. opacity: 0.75;
  1414. line-height: 100%;
  1415. margin: 0;
  1416. }
  1417. ::v-deep .el-carousel__item:nth-child(2n) {
  1418. background-image: url("../../assets/screen/bg_body.png");
  1419. background-position-x: initial;
  1420. background-position-y: initial;
  1421. background-size: 100% 100%;
  1422. background-attachment: initial;
  1423. background-origin: initial;
  1424. background-clip: initial;
  1425. background-color: initial;
  1426. }
  1427. ::v-deep .el-carousel__item:nth-child(2n+1) {
  1428. background-image: url("../../assets/screen/bg_body.png");
  1429. background-position-x: initial;
  1430. background-position-y: initial;
  1431. background-size: 100% 100%;
  1432. background-attachment: initial;
  1433. background-origin: initial;
  1434. background-clip: initial;
  1435. background-color: initial;
  1436. }
  1437. ::v-deep .el-carousel__indicators{
  1438. display: none;
  1439. }
  1440. ::v-deep .el-carousel__arrow{
  1441. display: none;
  1442. }
  1443. </style>