index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="dashboard-editor-container">
  3. <panel-group :statisticsList="statisticsList"/>
  4. <el-row style="background:#fff;margin-bottom:32px;">
  5. <el-card style="height: 570px">
  6. <div class="bt"><span><i class="el-icon-coin i"></i> 泄露程度统计</span></div>
  7. <el-col :span="12">
  8. <el-card style="margin:0 5px 0 0;height: 500px" shadow="hover">
  9. <plant-count-chart :statistics="xlcdList"></plant-count-chart>
  10. </el-card>
  11. </el-col>
  12. <el-col :span="12">
  13. <el-card style="margin: 0 0 0 5px;height: 500px " shadow="hover">
  14. <pt-count-chart :queryParams="queryParams"></pt-count-chart>
  15. </el-card>
  16. </el-col>
  17. </el-card>
  18. </el-row>
  19. <el-row :gutter="32">
  20. <el-col :xs="24" :sm="24" :lg="8">
  21. <div class="chart-wrapper">
  22. <pfl-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></pfl-pie-chart>
  23. </div>
  24. </el-col>
  25. <el-col :xs="24" :sm="24" :lg="8">
  26. <div class="chart-wrapper">
  27. <xll-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></xll-pie-chart>
  28. </div>
  29. </el-col>
  30. <el-col :xs="24" :sm="24" :lg="8">
  31. <div class="chart-wrapper">
  32. <jpl-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></jpl-pie-chart>
  33. </div>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </template>
  38. <script>
  39. import PanelGroup from './dashboard/PanelGroup'
  40. import LineChart from './dashboard/LineChart'
  41. import RaddarChart from './dashboard/RaddarChart'
  42. import PieChart from './dashboard/PieChart'
  43. import BarChart from './dashboard/BarChart'
  44. import {countXlcd, listStatistics, pflByPoint} from "@/api/statistics/statistics";
  45. import PflPieChart from "@/views/statistics/pie/pflPieChart";
  46. import XllPieChart from "@/views/statistics/pie/xllPieChart";
  47. import JplPieChart from "@/views/statistics/pie/jplPieChart";
  48. import PlantCountChart from "@/views/statistics/plantCountChart";
  49. import PtCountChart from "@/views/statistics/ptCountChart";
  50. const lineChartData = {
  51. newVisitis: {
  52. expectedData: [100, 120, 161, 134, 105, 160, 165],
  53. actualData: [120, 82, 91, 154, 162, 140, 145]
  54. },
  55. messages: {
  56. expectedData: [200, 192, 120, 144, 160, 130, 140],
  57. actualData: [180, 160, 151, 106, 145, 150, 130]
  58. },
  59. purchases: {
  60. expectedData: [80, 100, 121, 104, 105, 90, 100],
  61. actualData: [120, 90, 100, 138, 142, 130, 130]
  62. },
  63. shoppings: {
  64. expectedData: [130, 140, 141, 142, 145, 150, 160],
  65. actualData: [120, 82, 91, 154, 162, 140, 130]
  66. }
  67. }
  68. export default {
  69. name: 'Index',
  70. components: {
  71. PtCountChart,
  72. PlantCountChart,
  73. JplPieChart,
  74. XllPieChart,
  75. PflPieChart,
  76. PanelGroup,
  77. LineChart,
  78. RaddarChart,
  79. PieChart,
  80. BarChart
  81. },
  82. data() {
  83. return {
  84. lineChartData: lineChartData.newVisitis,
  85. queryParams: {
  86. pageNum: 1,
  87. pageSize: 10,
  88. plantId: null,
  89. year: null,
  90. startTime: null,
  91. endTime: null,
  92. company: null,
  93. },
  94. show: false,
  95. showPoint: false,
  96. statisticsList: [],
  97. xlcdList: [],
  98. pointCountList: [],
  99. }
  100. },
  101. created() {
  102. this.getList();
  103. },
  104. methods: {
  105. handleSetLineChartData(type) {
  106. this.lineChartData = lineChartData[type]
  107. },
  108. getList() {
  109. this.queryParams.year = new Date().getFullYear();
  110. listStatistics(this.queryParams).then(response => {
  111. this.statisticsList = response.data;
  112. this.show = true;
  113. })
  114. pflByPoint(this.queryParams).then(response => {
  115. this.pointCountList = response.data;
  116. this.showPoint = true;
  117. })
  118. countXlcd(this.queryParams).then(response => {
  119. this.xlcdList = response.data;
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .dashboard-editor-container {
  127. padding: 10px 32px 32px;
  128. background-color: rgb(240, 242, 245);
  129. position: relative;
  130. .chart-wrapper {
  131. background: #fff;
  132. padding: 16px 16px 0;
  133. margin-bottom: 32px;
  134. }
  135. }
  136. @media (max-width:1024px) {
  137. .chart-wrapper {
  138. padding: 8px;
  139. }
  140. }
  141. </style>