isv-robot 2 vuotta sitten
vanhempi
commit
53585b3d08
1 muutettua tiedostoa jossa 23 lisäystä ja 6 poistoa
  1. 23 6
      src/views/dashboard-screen/screen/ScreenSyjhbydxqk.vue

+ 23 - 6
src/views/dashboard-screen/screen/ScreenSyjhbydxqk.vue

@@ -7,6 +7,8 @@
   </div>
 </template>
 <script>
+import {chartSyjhbydxqk} from '@/api/dashboard-json'
+
 export default {
   name: 'ScreenSyjhbydxqk',
   data() {
@@ -19,6 +21,25 @@ export default {
   },
   methods: {
     async getOption() {
+      const arrMap = {
+        '计划': [],
+        '完成': []
+      }
+      const res = await chartSyjhbydxqk()
+      if (res?.code === 200) {
+        arrMap['计划'] = [
+          res.info.series[0].data[0],
+          res.info.series[2].data[0],
+          res.info.series[4].data[0],
+          res.info.series[6].data[0]
+        ]
+        arrMap['完成'] = [
+          res.info.series[1].data[0],
+          res.info.series[3].data[0],
+          res.info.series[5].data[0],
+          res.info.series[7].data[0]
+        ]
+      }
       this.option = {
         title: {},
         color: ['rgb(86, 202, 149)', 'rgb(96, 150, 230)'],
@@ -60,17 +81,13 @@ export default {
           {
             name: '计划',
             type: 'bar',
-            data: [
-              2.0, 4.9, 7.0, 23.2
-            ]
+            data: arrMap['计划']
 
           },
           {
             name: '完成',
             type: 'bar',
-            data: [
-              2.6, 5.9, 9.0, 26.4
-            ]
+            data: arrMap['完成']
 
           }
         ]