Sfoglia il codice sorgente

修改首页接口

mxx 3 anni fa
parent
commit
f29f4223c4
2 ha cambiato i file con 13 aggiunte e 9 eliminazioni
  1. 1 1
      src/model/home/index.js
  2. 12 8
      src/views/home/index.vue

+ 1 - 1
src/model/home/index.js

@@ -25,4 +25,4 @@ export const getFileList = appRx.get(API_GET_GETFILELIST, errorCatcher, errorHan
 export const getCurrentUserInfo = appRx.get(API_GET_GETCURRENTUSERINFO, errorCatcher, errorHandle, filter)
 
 export const getStaffHomeShowList = appRx.get(API_GET_GETSTAFFHOMESHOWLIST, errorCatcher, errorHandle, filter)
-export const getChartsData = appRx.get(API_GET_GETCHARTSDATA, errorCatcher, errorHandle, filter)
+export const gChartsData = appRx.get(API_GET_GETCHARTSDATA, errorCatcher, errorHandle, filter)

+ 12 - 8
src/views/home/index.vue

@@ -10,7 +10,7 @@
             <img src="../../../public/img/8b2c7255e9b19c71d68b33a08f20f74.png" alt="">
 
           </div>
-          <div class="right">
+         <div class="right">
             <div class="top">
               {{ nowDate }}
             </div>
@@ -83,14 +83,14 @@
                 <div class="left">
                   <img src="../../../public/img/1637204557176-s4AMbBA8.png" alt="">
                   <span>总库存量</span>
-                  <span class="content3-number blue">27631</span>
+                  <span class="content3-number blue">{{inventoryCost}}</span>
                   <span style="margin-top: 10px;">吨</span>
                 </div>
                 <div class="right">
                   <img src="../../../public/img/1637204768818-70JRjz0H.png" alt="">
                   <span>库存价值</span>
-                  <span class="content3-number yellow">37745671</span>
-                  <span style="margin-top: 10px;"></span>
+                  <span class="content3-number yellow">{{inventoryValue}}</span>
+                  <span style="margin-top: 10px;"></span>
                 </div>
               </div>
             </el-row>
@@ -160,7 +160,7 @@
     noticeNumber,
     queryCircularManagementReceiveList,
     getStaffHomeShowList,
-    getChartsData
+    gChartsData
   } from '@/model/home/index'
   import {
     getUserVesselList,
@@ -211,6 +211,8 @@
 
     data() {
       return {
+        inventoryCost:'',
+        inventoryValue:'',
         carCount1:'',
         carCount2:'',
         carCount3:'',
@@ -325,9 +327,9 @@
       //获取快捷路口列表
       this.getRouteList()
       // this.checkUserInfoDialog()
-      {
+      // {
         this.timer = setInterval(this.getTime, 1000);
-      }
+      // }
     },
     beforeDestroy() {
       clearInterval(this.timer);
@@ -354,12 +356,14 @@
       //    }, 2000);
       //获取新闻列表
       // this.getNewList()
-      getChartsData().toPromise().then(res => {
+      gChartsData().toPromise().then(res => {
         console.log(res)
         this.chartsData = res
         this.carCount1 = res[6].biViewInfoList[0].count
         this.carCount2 = res[6].biViewInfoList[1].count
         this.carCount3 = res[6].biViewInfoList[2].count
+        this.inventoryCost = res[7].biViewInfoList[0].count
+        this.inventoryValue =  res[7].biViewInfoList[1].count
 
         this.initCharts()
       })