Browse Source

默认显示数据

luguang 2 months ago
parent
commit
065c0f0b4f
2 changed files with 27 additions and 11 deletions
  1. 2 2
      src/utils/request.js
  2. 25 9
      src/views/index.vue

+ 2 - 2
src/utils/request.js

@@ -34,7 +34,7 @@ service.interceptors.response.use(
   error => {
     console.log(error)
     if (error.toString().indexOf('Error: Network Error') !== -1) {
-      alert('网络请求错误')
+      // alert('网络请求错误')
       // removeToken()
       return Promise.reject(error)
     }
@@ -44,7 +44,7 @@ service.interceptors.response.use(
     }
 
     if (error.toString().indexOf('Error: timeout') !== -1) {
-      alert('网络请求超时')
+      // alert('网络请求超时')
       return Promise.reject(error)
     }
   }

+ 25 - 9
src/views/index.vue

@@ -105,7 +105,7 @@ export default {
         // 循环不间断图片连在一起
         loop: true,
         // 循环时间(毫秒)
-        autoplay: 1000 * window.Glod.wareRollSecond,
+        autoplay: 0,
         // 展示多少张图片
         slidesPerView: 5,
         // 图片间的间隔
@@ -116,15 +116,30 @@ export default {
         // 循环不间断图片连在一起
         loop: true,
         // 循环时间(毫秒)
-        autoplay: 1000 * window.Glod.securitiesRollSecond,
+        autoplay: 0,
         speed: 1000
       },
-      deptInfo: {},
+      deptInfo: {
+        name: ['造币三部','造币二部','造币一部'],
+        production: [0,0,0],
+        inventory: [0,0,0]
+
+      },
       planList: [],
-      securitiesInfo: {},
-      dayInfoList: [],
-      swiperList: [], // 总库滚动list
-      proportionInfo: {},
+      securitiesInfo: {
+        name: ['-','-','-'],
+        production: [0,0,0],
+        inventory: [0,0,0]
+      },
+      dayInfoList: [{securities:'', qty:0, dayOutQty:0, dayInQty:0}],
+      swiperList: [
+        {wareCn:'-', securities: '-',qty:0,dayInQty:0,dayOutQty:0},
+        {wareCn:'-', securities: '-',qty:0,dayInQty:0,dayOutQty:0},
+        {wareCn:'-', securities: '-',qty:0,dayInQty:0,dayOutQty:0},
+        {wareCn:'-', securities: '-',qty:0,dayInQty:0,dayOutQty:0},
+        {wareCn:'-', securities: '-',qty:0,dayInQty:0,dayOutQty:0}
+      ], // 总库滚动list
+      proportionInfo: {proportionStr1:'纪念币库存占比', proportion1:0, proportionStr2:'流通币库存占比', proportion2:0},
       showTop: true,
       defWareAutoplay: 1000 * window.Glod.wareRollSecond, // 总库库存页面滚动毫秒数
       defSecuritiesAutoplay: 1000 * window.Glod.securitiesRollSecond // 品名库存页面滚动毫秒数
@@ -154,9 +169,10 @@ export default {
   methods: {
     async getTableData() {
       // console.log('轮询请求接口')
-      this.showTop = false
       const { retObj, code } = await getInfo()
+      this.showTop = false
       if (code === 0) {
+        console.log('轮询请求接口')
         this.swiperList = retObj.wareList
         if (this.swiperList.length > 5) {
           this.swiperOptions = {
@@ -187,8 +203,8 @@ export default {
         this.planList = retObj.planList
         this.deptInfo = retObj.deptInfo
         this.securitiesInfo = retObj.securitiesInfo
-        this.showTop = true
       }
+      this.showTop = true
     },
     cancelLoading() {
       setTimeout(() => {