guoxiaohuan 5 gadi atpakaļ
vecāks
revīzija
9fe380f355

+ 72 - 65
src/views/evaluate/evEnergySavingRate.vue

@@ -1,72 +1,79 @@
 <template>
-  <div id="box3" style="width:100%;height:100%;"></div>
+    <div id='box3' style='width:100%;height:100%;'></div>
 </template>
 <script>
-import echarts from "echarts";
+import echarts from 'echarts'
 
 export default {
-  data() {
-    return {};
-  },
-  mounted() {
-    this.$nextTick(function() {
-      this.pie(this.energySavingRate, "#box3", ["#00D6B9", "#D5F6F2"]);
-    });
-  },
-  props: ["energySavingRate"],
-  methods: {
-    pie(pieData, box, colors) {
-      const that = this;
-      const myChart = echarts.init(document.querySelector(box));
-      const data = pieData;
-      const option = {
-        grid: {
-          top: 5,
-          bottom: 5
-        },
-        color: colors,
-        series: [
-          {
-            name: "valueOfMarket",
-            type: "pie",
-            center: ["50%", "50%"],
-            radius: ["60%", "70%"],
-            avoidLabelOverlap: false,
-            hoverAnimation: false,
-            label: {
-              normal: {
-                show: true,
-                position: "center",
-                color: "#000000",
-                fontSize: 20,
-                lineHeight: 0,
-                formatter: "{b}\n{c}%"
-              }
-            },
-            data: [
-              {
-                value: data,
-                label: {
-                  normal: {
-                    show: true
-                  }
-                }
-              },
-              {
-                value: 100 - data,
-                name: "",
-                label: {
-                  normal: {
-                    show: false
-                  }
-                }
-              }
-            ]
-          }
-        ]
-      };
-      myChart.setOption(option);
+    data() {
+        return {}
+    },
+    mounted() {
+        this.$nextTick(function() {
+            this.pie(this.energySavingRate, '#box3', ['#00D6B9', '#D5F6F2'])
+        })
+    },
+    props: ['energySavingRate'],
+    watch: {
+        energySavingRate(val, old) {
+            if (val) {
+                this.pie(val, '#box3', ['#00D6B9', '#D5F6F2'])
+            }
+        }
+    },
+    methods: {
+        pie(pieData, box, colors) {
+            const that = this
+            const myChart = echarts.init(document.querySelector(box))
+            const data = pieData
+            const option = {
+                grid: {
+                    top: 5,
+                    bottom: 5
+                },
+                color: colors,
+                series: [
+                    {
+                        name: 'valueOfMarket',
+                        type: 'pie',
+                        center: ['50%', '50%'],
+                        radius: ['60%', '70%'],
+                        avoidLabelOverlap: false,
+                        hoverAnimation: false,
+                        label: {
+                            normal: {
+                                show: true,
+                                position: 'center',
+                                color: '#000000',
+                                fontSize: 20,
+                                lineHeight: 0,
+                                formatter: '{b}\n{c}%'
+                            }
+                        },
+                        data: [
+                            {
+                                value: data,
+                                label: {
+                                    normal: {
+                                        show: true
+                                    }
+                                }
+                            },
+                            {
+                                value: 100 - data,
+                                name: '',
+                                label: {
+                                    normal: {
+                                        show: false
+                                    }
+                                }
+                            }
+                        ]
+                    }
+                ]
+            }
+            myChart.setOption(option)
+        }
     }
-  }
-};
+}
 </script>

+ 72 - 65
src/views/evaluate/evImplementationRate.vue

@@ -1,72 +1,79 @@
 <template>
-  <div id="box2" style="width:100%;height:100%;"></div>
+    <div id='box2' style='width:100%;height:100%;'></div>
 </template>
 <script>
-import echarts from "echarts";
+import echarts from 'echarts'
 
 export default {
-  data() {
-    return {};
-  },
-  props: ["chillerExecuteRate"],
-  mounted() {
-    this.$nextTick(function() {
-      this.pie(this.chillerExecuteRate, "#box2", ["#FFBA6B", "#FEE9D2"]);
-    });
-  },
-  methods: {
-    pie(pieData, box, colors) {
-      const that = this;
-      const myChart = echarts.init(document.querySelector(box));
-      const data = pieData;
-      const option = {
-        grid: {
-          top: 5,
-          bottom: 5
-        },
-        color: colors,
-        series: [
-          {
-            name: "valueOfMarket",
-            type: "pie",
-            center: ["50%", "50%"],
-            radius: ["60%", "70%"],
-            avoidLabelOverlap: false,
-            hoverAnimation: false,
-            label: {
-              normal: {
-                show: true,
-                position: "center",
-                color: "#000000",
-                fontSize: 20,
-                lineHeight: 0,
-                formatter: "{b}\n{c}%"
-              }
-            },
-            data: [
-              {
-                value: data,
-                label: {
-                  normal: {
-                    show: true
-                  }
-                }
-              },
-              {
-                value: 100 - data,
-                name: "",
-                label: {
-                  normal: {
-                    show: false
-                  }
-                }
-              }
-            ]
-          }
-        ]
-      };
-      myChart.setOption(option);
+    data() {
+        return {}
+    },
+    props: ['chillerExecuteRate'],
+    mounted() {
+        this.$nextTick(function() {
+            this.pie(this.chillerExecuteRate, '#box2', ['#FFBA6B', '#FEE9D2'])
+        })
+    },
+    watch: {
+        chillerExecuteRate(val, old) {
+            if (val) {
+                this.pie(val, '#box2', ['#FFBA6B', '#FEE9D2'])
+            }
+        }
+    },
+    methods: {
+        pie(pieData, box, colors) {
+            const that = this
+            const myChart = echarts.init(document.querySelector(box))
+            const data = pieData
+            const option = {
+                grid: {
+                    top: 5,
+                    bottom: 5
+                },
+                color: colors,
+                series: [
+                    {
+                        name: 'valueOfMarket',
+                        type: 'pie',
+                        center: ['50%', '50%'],
+                        radius: ['60%', '70%'],
+                        avoidLabelOverlap: false,
+                        hoverAnimation: false,
+                        label: {
+                            normal: {
+                                show: true,
+                                position: 'center',
+                                color: '#000000',
+                                fontSize: 20,
+                                lineHeight: 0,
+                                formatter: '{b}\n{c}%'
+                            }
+                        },
+                        data: [
+                            {
+                                value: data,
+                                label: {
+                                    normal: {
+                                        show: true
+                                    }
+                                }
+                            },
+                            {
+                                value: 100 - data,
+                                name: '',
+                                label: {
+                                    normal: {
+                                        show: false
+                                    }
+                                }
+                            }
+                        ]
+                    }
+                ]
+            }
+            myChart.setOption(option)
+        }
     }
-  }
-};
+}
 </script>

+ 74 - 65
src/views/evaluate/evSatisfactionRate.vue

@@ -1,72 +1,81 @@
 <template>
-  <div id="box1" style="width:100%;height:100%;"></div>
+    <div id='box1' style='width:100%;height:100%;'></div>
 </template>
 <script>
-import echarts from "echarts";
+import echarts from 'echarts'
 
 export default {
-  data() {
-    return {};
-  },
-  props: ["tindoorFillRate"],
-  mounted() {
-    this.$nextTick(function() {
-      this.pie(this.tindoorFillRate, "#box1", ["#0091FF", "#E1F2FF"]);
-    });
-  },
-  methods: {
-    pie(pieData, box, colors) {
-      const that = this;
-      const myChart = echarts.init(document.querySelector(box));
-      const data = pieData;
-      const option = {
-        grid: {
-          top: 5,
-          bottom: 5
-        },
-        color: colors,
-        series: [
-          {
-            name: "valueOfMarket",
-            type: "pie",
-            center: ["50%", "50%"],
-            radius: ["60%", "70%"],
-            avoidLabelOverlap: false,
-            hoverAnimation: false,
-            label: {
-              normal: {
-                show: true,
-                position: "center",
-                color: "#000000",
-                fontSize: 20,
-                lineHeight: 0,
-                formatter: "{b}\n{c}%"
-              }
-            },
-            data: [
-              {
-                value: data,
-                label: {
-                  normal: {
-                    show: true
-                  }
-                }
-              },
-              {
-                value: 100 - data,
-                name: "",
-                label: {
-                  normal: {
-                    show: false
-                  }
-                }
-              }
-            ]
-          }
-        ]
-      };
-      myChart.setOption(option);
+    data() {
+        return {}
+    },
+    props: ['tindoorFillRate'],
+    mounted() {
+        this.$nextTick(function() {
+            this.pie(this.tindoorFillRate, '#box1', ['#0091FF', '#E1F2FF'])
+        })
+    },
+    methods: {
+        pie(pieData, box, colors) {
+            const that = this
+            const myChart = echarts.init(document.querySelector(box))
+            const data = pieData
+            const option = {
+                grid: {
+                    top: 5,
+                    bottom: 5
+                },
+                color: colors,
+                series: [
+                    {
+                        name: 'valueOfMarket',
+                        type: 'pie',
+                        center: ['50%', '50%'],
+                        radius: ['60%', '70%'],
+                        avoidLabelOverlap: false,
+                        hoverAnimation: false,
+                        label: {
+                            normal: {
+                                show: true,
+                                position: 'center',
+                                color: '#000000',
+                                fontSize: 20,
+                                lineHeight: 0,
+                                formatter: '{b}\n{c}%'
+                            }
+                        },
+                        data: [
+                            {
+                                value: data,
+                                label: {
+                                    normal: {
+                                        show: true
+                                    }
+                                }
+                            },
+                            {
+                                value: 100 - data,
+                                name: '',
+                                label: {
+                                    normal: {
+                                        show: false
+                                    }
+                                }
+                            }
+                        ]
+                    }
+                ]
+            }
+            myChart.setOption(option)
+        }
+    },
+    watch: {
+        tindoorFillRate(val, old) {
+            console.log(val)
+            console.log(old)
+            if (val) {
+                this.pie(val, '#box1', ['#0091FF', '#E1F2FF'])
+            }
+        }
     }
-  }
-};
+}
 </script>