Ver Fonte

ly 首页

ly há 2 anos atrás
pai
commit
6a6de3f7a8

+ 16 - 0
ui/src/views/dashboard/PanelGroup.vue

@@ -79,6 +79,22 @@ export default {
       })
     })
   },
+  watch: {
+    statisticsList: {
+      deep: true,
+      immediate: true, // 监听到后,立即执行 handler方法
+      handler: function(newVal, oldVal) {
+        this.statisticsList = newVal
+        this.statisticsList.forEach(item => {
+          if (item.plantName == '合计') {
+            this.pfl = parseFloat(item.pfl);
+            this.jpl = parseFloat(item.jpl);
+            this.sjpfl = parseFloat(item.sjpfl);
+          }
+        })
+      },
+    }
+  },
   methods: {
     handleSetLineChartData(type) {
       this.$emit('handleSetLineChartData', type)

+ 11 - 11
ui/src/views/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="dashboard-editor-container">
 
-    <panel-group :statisticsList="statisticsList" v-if="show"/>
+    <panel-group :statisticsList="statisticsList"/>
 
     <el-row  style="background:#fff;margin-bottom:32px;">
       <el-card style="height: 570px">
@@ -20,20 +20,20 @@
     </el-row>
 
     <el-row :gutter="32">
-      <el-col :span="8">
-        <el-card>
+      <el-col :xs="24" :sm="24" :lg="8">
+        <div class="chart-wrapper">
           <pfl-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></pfl-pie-chart>
-        </el-card>
+        </div>
       </el-col>
-      <el-col :span="8">
-        <el-card>
+      <el-col :xs="24" :sm="24" :lg="8">
+        <div class="chart-wrapper">
           <xll-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></xll-pie-chart>
-        </el-card>
+        </div>
       </el-col>
-      <el-col :span="8">
-        <el-card>
+      <el-col :xs="24" :sm="24" :lg="8">
+        <div class="chart-wrapper">
           <jpl-pie-chart v-if="showPoint" :pointList="pointCountList" :plant-name="''"></jpl-pie-chart>
-        </el-card>
+        </div>
       </el-col>
     </el-row>
 
@@ -129,7 +129,7 @@ export default {
 
 <style lang="scss" scoped>
 .dashboard-editor-container {
-  padding: 32px;
+  padding: 10px 32px 32px;
   background-color: rgb(240, 242, 245);
   position: relative;
 

+ 3 - 0
ui/src/views/statistics/pie/jplPieChart.vue

@@ -3,8 +3,11 @@
 </template>
 
 <script>
+import resize from "@/views/dashboard/mixins/resize";
+
 export default {
   name: "jplPieChart",
+  mixins: [resize],
   props: {
     pointList: {
       type: Array,

+ 3 - 0
ui/src/views/statistics/pie/pflPieChart.vue

@@ -3,8 +3,11 @@
 </template>
 
 <script>
+import resize from "@/views/dashboard/mixins/resize";
+
 export default {
   name: "pflPieChart",
+  mixins: [resize],
   props: {
     pointList: {
       type: Array,

+ 3 - 0
ui/src/views/statistics/pie/xllPieChart.vue

@@ -3,8 +3,11 @@
 </template>
 
 <script>
+import resize from "@/views/dashboard/mixins/resize";
+
 export default {
   name: "xllPieChart",
+  mixins: [resize],
   props: {
     pointList: {
       type: Array,

+ 3 - 0
ui/src/views/statistics/plantCountChart.vue

@@ -4,7 +4,10 @@
 
 <script>
 
+import resize from "@/views/dashboard/mixins/resize";
+
 export default {
+  mixins: [resize],
   props: {
     statistics: {
       type: Array,

+ 2 - 0
ui/src/views/statistics/ptCountChart.vue

@@ -5,8 +5,10 @@
 <script>
 
 import {xlcdByPoint} from "@/api/statistics/statistics";
+import resize from "@/views/dashboard/mixins/resize";
 
 export default {
+  mixins: [resize],
   props: {
     queryParams: {
       type: Object,