Quellcode durchsuchen

生产经营的母猪存栏问题

East vor 3 Jahren
Ursprung
Commit
a47ea7de13
2 geänderte Dateien mit 15 neuen und 13 gelöschten Zeilen
  1. 6 3
      src/views/Production/Production.vue
  2. 9 10
      src/views/Production/board/ChartSowBar.vue

+ 6 - 3
src/views/Production/Production.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-21 17:51:22
- * @LastEditTime: 2022-01-05 15:42:56
+ * @LastEditTime: 2022-01-05 18:13:08
  * @LastEditors: Please set LastEditors
  * @Description: 生产经营页面
  * @FilePath: \hyyfScreen\src\views\Production\Production.vue
@@ -59,7 +59,7 @@
       >
         <pro-board :title="'母猪分布'">
           <chart-sow-bar
-            v-if="amountPieData.length > 0"
+            v-if="amountPieData.name.length > 0"
             :data="amountPieData"
           ></chart-sow-bar>
           <div
@@ -400,7 +400,10 @@ export default {
   data() {
     return {
       inventoryPieData: [],
-      amountPieData: [],
+      amountPieData: {
+        name: [],
+        data: [],
+      },
       amountLineData: {
         boarStock: [],
         fatpigStock: [],

+ 9 - 10
src/views/Production/board/ChartSowBar.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-10-26 11:02:38
- * @LastEditTime: 2021-12-02 15:58:08
+ * @LastEditTime: 2022-01-05 18:16:17
  * @LastEditors: Please set LastEditors
  * @Description: 母猪分布
  * @FilePath: \hyyfScreen\src\views\Production\board\ChartSowBar.vue
@@ -21,7 +21,7 @@ export default {
   },
   props: {
     data: {
-      type: Array,
+      type: Object,
       required: true,
     },
   },
@@ -59,10 +59,10 @@ export default {
         // },
         color: ["#3aa0ff", "#4dcb73", "#fad337", "#f2637b", "#975fe4"],
         grid: {
-          top: "22%",
-          left: "10%",
-          bottom: "10%",
-          right: "15%",
+          top: "15%",
+          left: "15%",
+          bottom: "20%",
+          right: "5%",
         },
         xAxis: [
           {
@@ -140,17 +140,16 @@ export default {
           },
         ],
       };
-      this.myChart.setOption(options);
+      this.myChart.setOption(options, true);
     },
   },
   mounted() {
     this.myChart = this.$echarts.init(document.getElementById("chartSowBar"));
-    // this.init();
+    this.init();
   },
   watch: {
     data: {
-      handler(newValue) {
-        console.log(newValue);
+      handler() {
         this.init();
       },
       deep: true,