index.vue 34 KB

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