2213980799@qq.com пре 1 година
родитељ
комит
4923215635
1 измењених фајлова са 36 додато и 27 уклоњено
  1. 36 27
      src/views/home/index.vue

+ 36 - 27
src/views/home/index.vue

@@ -167,7 +167,11 @@ export default {
     unacceptedProduct: () => unacceptedProduct
   },
 
-  created() {
+  mounted() {
+    this.queryHomePage();
+    this.queryFactory();
+    this.queryTeam();
+    this.queryProductionLine();
     this.preOption = preOption([
       { value: 40, name: '  外观检测' },
       { value: 30, name: '  尺寸检测' },
@@ -175,11 +179,13 @@ export default {
       { value: 10, name: '  密度检测' },
       { value: 5, name: '  重量检测' }
     ]);
-
-    this.queryHomePage();
-    this.queryFactory();
-    this.queryTeam();
-    this.queryProductionLine();
+    setTimeout(() => {
+      this.$refs.pieRef1.resize();
+      this.$refs.pieRef2.resize();
+      this.$refs.pieRef3.resize();
+      this.$refs.pieRef4.resize();
+      this.$refs.lineRef.resize();
+    }, 300);
   },
   methods: {
     timeTypeChange() {
@@ -206,30 +212,33 @@ export default {
     },
     async queryProductionLine() {
       const data = await queryProductionLine();
-      (this.lineQualifiedOption = barOption(
+      this.lineQualifiedOption = barOption(
         data.map((item) => {
-          return { value: item.qualificationRate, name: item.productionLineName };
+          return {
+            value: item.qualificationRate,
+            name: item.productionLineName
+          };
         }),
-          {
-            normal: {
-              barBorderRadius: 30,
-              color: EleChart.graphic.LinearGradient(0, 0, 0, 1, [
-                {
-                  offset: 0,
-                  color: '#00feff'
-                },
-                {
-                  offset: 0.5,
-                  color: '#027eff'
-                },
-                {
-                  offset: 1,
-                  color: '#0286ff'
-                }
-              ])
-            }
+        {
+          normal: {
+            barBorderRadius: 30,
+            color: EleChart.graphic.LinearGradient(0, 0, 0, 1, [
+              {
+                offset: 0,
+                color: '#00feff'
+              },
+              {
+                offset: 0.5,
+                color: '#027eff'
+              },
+              {
+                offset: 1,
+                color: '#0286ff'
+              }
+            ])
           }
-        ))
+        }
+      );
     },
     async queryHomePage() {
       const data = await queryHomePage(this.form);