Browse Source

餐饮数据接入,弹框关闭

wangtao 3 năm trước cách đây
mục cha
commit
b835b4ca4c

+ 1 - 1
package.json

@@ -95,4 +95,4 @@
         "> 1%",
         "last 2 versions"
     ]
-}
+}

+ 1 - 1
public/index.html

@@ -120,7 +120,7 @@
             top: 0;
             width: 51%;
             height: 100%;
-            background: #7171C6;
+            background: #000;
             z-index: 1000;
             -webkit-transform: translateX(0);
             -ms-transform: translateX(0);

+ 5 - 3
src/App.vue

@@ -34,7 +34,7 @@ export default {
       let myWidth = document.documentElement.clientWidth;
       let myHeight = document.documentElement.clientHeight;
       if (myHeight / 3840 !== 0 && myWidth / 3840 / (myHeight / 1080) >= 1) {
-        
+
         this.scalesNum = myHeight / 1080;
       } else {
         this.scalesNum = myWidth / 3840;
@@ -172,7 +172,7 @@ export default {
 /*去除底边框*/
 .el-table td.el-table__cell {
   border: 0;
-  
+
 }
 .el-table th.el-table__cell.is-leaf {
   border: 0;
@@ -203,7 +203,9 @@ tr .cell{
   padding-left:40px !important;
   text-align: left;
 }
-
+.el-loading-mask{
+  background-color:transparent !important;
+}
 </style>
 
 

+ 2 - 2
src/components2/equipmentAlarm/seTable.vue

@@ -35,7 +35,7 @@ export default {
   methods: {
     //初始化数据
     initData() {
-      // 
+      //
       axios({
         method: 'post',
         url: 'https://smartpark.caih.com/dmapi/tbAlarm/page',
@@ -97,7 +97,7 @@ export default {
     //数据滚动
     dataScrolling:function(){
         let top=this.$refs.initList.bodyWrapper;
-        
+
         this.table_interval=setInterval(() => {
             top.scrollTop+=1;
             if(top.clientHeight+top.scrollTop==top.scrollHeight){

+ 2 - 2
src/components2/populationStatistics/index.vue

@@ -54,7 +54,7 @@ export default {
               this.populationStatisticsList.data[1].push(res.data[i].card_number)
               total += res.data[i].card_number
             }
-            this.populationStatisticsList.num = total 
+            this.populationStatisticsList.num = total
           }
       }).catch(err =>{
       })
@@ -79,7 +79,7 @@ export default {
     font-size: 20px;
     font-family: "DINAlternate-Bold";
     font-weight: 700;
-    
+
   }
 }
 </style>

+ 11 - 11
src/components2/realTimeVideo/index.vue

@@ -23,9 +23,9 @@
     </div>
     <el-row class="videoList" :gutter="20">
         <el-col class="video" :span="12">
-            <video 
+            <video
                 preload="true"
-                autoplay="autoplay" 
+                autoplay="autoplay"
                 class="hlsVideo monitor-height"
                 ref="hlsVideo1"
                 style="width: 100%"
@@ -36,9 +36,9 @@
              <div class="videoTitle">{{name1}}</div>
         </el-col>
         <el-col class="video" :span="12">
-            <video 
+            <video
                 preload="true"
-                autoplay="autoplay" 
+                autoplay="autoplay"
                 class="hlsVideo monitor-height"
                 ref="hlsVideo2"
                 style="width: 100%"
@@ -49,7 +49,7 @@
             <div class="videoTitle">{{name2}}</div>
         </el-col>
     </el-row>
-    
+
   </el-col>
 </template>
 <script>
@@ -97,9 +97,9 @@ export default {
             }
         }).catch(err =>{
         })
-        
+
       },
-      
+
       videoSelect1(value){
         this.destroyHls(1)
         let arr = value.split(',')
@@ -124,7 +124,7 @@ export default {
                     this.hls2.destroy();
                     this.hls2 = null;
                 }
-                
+
             }
         },
         loadVideoFn(id,url) {//视频播放
@@ -187,7 +187,7 @@ export default {
       }
 
       }
-      
+
   }
 
 }
@@ -210,7 +210,7 @@ export default {
       font-size: 14px;
     }
   }
-  
+
 }
 /**修改下拉图标颜色 */
 ::v-deep .el-input__suffix {
@@ -238,7 +238,7 @@ export default {
 <style >
 .el-scrollbar{
     background-color: rgba(35,40,49,1);
-} 
+}
 .el-scrollbar{
     border:1px solid rgba(35,40,49,1) !important;
 

+ 226 - 0
src/components2/restaurant/index copy.vue

@@ -0,0 +1,226 @@
+<template>
+  <el-col :span="24" class="restaurant modular" style="padding:10px 20px 0;">
+    <el-col class="title" style="margin-left:0">智慧餐饮</el-col>
+    <el-col class="restaurantLeft">
+      <el-col :span="24" class="nh">
+        <el-image :src="restaurant1" fit="scale-down" />
+        <el-col class="name"
+          >今日营业额<el-col class="num"
+            >{{num[0]}}<span class="unit">元</span></el-col
+          ></el-col
+        >
+      </el-col>
+      <el-col :span="24" class="nh">
+        <el-image :src="restaurant1" fit="scale-down" />
+        <el-col class="name"
+          >今日销售人/次<el-col class="num"
+            >{{num[1]}}<span class="unit">份</span></el-col
+          ></el-col
+        >
+      </el-col>
+    </el-col>
+    <el-col class="restaurantRight">
+      <el-col class="top">
+        <el-image :src="restaurant2" fit="scale-down" class="leftImg" />
+        <el-col class="name">昨日最受欢迎菜品</el-col>
+        <el-image :src="restaurant3" fit="scale-down" class="rightImg" />
+      </el-col>
+      <el-col class="bottom">
+        <div class="dish" v-for="(item,index) in list2" :key="index" @click="canyin(index + 1)">
+          <el-col :span="8"><el-image :src="item.id" fit="scale-down" class="leftImg"/></el-col>
+          <el-col :span="8" class="dishName">{{item.name || "未营业"}}</el-col>
+          <el-col :span="8" class="fs">{{item.num || 0}}份</el-col>
+        </div>
+      </el-col>
+    </el-col>
+  </el-col>
+</template>
+<script>
+import axios from 'axios'
+import restaurant1 from "@/assets/images2/智慧餐饮icon.png";
+import restaurant2 from "@/assets/images2/排名-左边.png";
+import restaurant3 from "@/assets/images2/排名-右边.png";
+import num1 from "@/assets/images2/第一名icon.png";
+import num2 from "@/assets/images2/第二名icon.png";
+import num3 from "@/assets/images2/第三名icon.png";
+import { getWeekDate } from "@/assets/js/dataFormate.js";
+export default {
+  name: "restaurant",
+  data() {
+    return {
+      restaurant1: restaurant1,
+      restaurant2: restaurant2,
+      restaurant3: restaurant3,
+      num1: num1,
+      num2: num2,
+      num3: num3,
+      data:{
+        total:undefined,
+        list:{}
+      },
+      list2:[
+        {id:num1,name:"清炒时蔬",num:412},
+        {id:num2,name:"柠檬鸭",num:315},
+        {id:num3,name:"番茄炒蛋",num:267},
+      ],
+      num:[38155,15642],
+      tapNo:false,
+    };
+  },
+  created(){
+    console.log(getWeekDate())
+    if(getWeekDate() == "周一" || getWeekDate() == "周日"){
+      this.list2 = [
+        {id:num1,name:"未营业",num:0},
+        {id:num2,name:"未营业",num:0},
+        {id:num3,name:"未营业",num:0},
+      ]
+      // this.num = [0,0]
+      this.tapNo = true
+    }
+    if(getWeekDate() == "周六" || getWeekDate() == "周日"){
+      this.num = [0,0]
+    }
+  },
+  mounted() {
+    this.init()
+    this.timing()
+  },
+  methods: {
+    init(){
+      axios({
+        method: 'get',
+        url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/countOrderAmt',
+        timeout: 3000,
+      }).then(res =>{
+        console.log(res)
+        this.data.total = res.data
+      }).catch(err =>{
+      })
+
+      axios({
+        method: 'get',
+        url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/hyFood',
+        timeout: 3000,
+      }).then(res =>{
+        if(res.data){
+          this.data.list = res.data
+          this.data.list[0].id = this.num1
+          this.data.list[1].id = this.num2
+          this.data.list[2].id = this.num3
+        }
+      }).catch(err =>{
+      })
+    },
+    timing(){
+      setInterval(() =>{
+        this.init()
+      },1000 * 60 * 5)
+    },
+    canyin(id){
+      if(this.tapNo == true){
+        //禁止跳转(周六周日休业)
+      }else{
+        this.$emit("canyinClick",id)
+      }
+
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+@import '@/assets/styles/common.scss';
+.restaurantLeft {
+  width: 50%;
+  display: inline-block;
+  margin-top:0vh !important;
+  .nh {
+    margin-top: 50px;
+    .el-image {
+      width: 24px;
+      margin-top: -25px;
+      float: left;
+    }
+    .name {
+      font-size: 16px;
+      margin: -25px 30px 0 !important;
+      width: 150px;
+      display: block;
+      color:$white2;
+      .num {
+        font-size: 24px;
+        font-family: "DINAlternate-Bold";
+        font-weight: 700;
+        margin-top: 0.5vh;
+        display: inline-block;
+        color:$white;
+        .unit {
+          font-size: 16px;
+          margin-left:2px;
+        }
+      }
+    }
+  }
+}
+.restaurantRight {
+  width: 50%;
+  text-align: center;
+  .top {
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+    .name {
+      font-size: 16px;
+      color: $orange;
+      padding-bottom: 10px;
+      display: inline-block;
+      vertical-align: middle;
+      width: auto;
+      margin: 0 6px;
+    }
+    .name::after {
+      content: "";
+      width: 60%;
+      height: 1px;
+      display: block;
+      margin: 0 auto;
+      border-bottom: 1px solid $orange;
+      padding: 1px;
+    }
+
+    .leftImg,
+    .rightImg {
+      width: 25px;
+      margin-top:10px;
+    }
+  }
+  .bottom {
+    display: flex;
+    flex-direction: column;
+    .dish {
+      margin-top: 8px;
+      height: 33px;
+      line-height: 33px;
+      background-color: $modularHoverBackGround;
+      text-align: center;
+      vertical-align: middle;
+      cursor: pointer;
+      .el-image {
+        width: 24px;
+        margin: 4.5px 0;
+      }
+      .dishName,
+      .fs {
+        font-size: 16px;
+        margin-top:-2px;
+        font-family: 'DINAlternate-Bold';
+      }
+      .dishName{
+
+        display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
+      }
+    }
+  }
+}
+</style>

+ 32 - 42
src/components2/restaurant/index.vue

@@ -1,12 +1,12 @@
 <template>
-  <el-col :span="24" class="restaurant modular" style="padding:10px 20px 0;">
+  <el-col :span="24" class="restaurant modular" style="padding:10px 20px 0;" v-loading="loading">
     <el-col class="title" style="margin-left:0">智慧餐饮</el-col>
     <el-col class="restaurantLeft">
       <el-col :span="24" class="nh">
         <el-image :src="restaurant1" fit="scale-down" />
         <el-col class="name"
           >今日营业额<el-col class="num"
-            >{{num[0]}}<span class="unit">元</span></el-col
+            >{{ data.consumerNowNumber || 0 }}<span class="unit">元</span></el-col
           ></el-col
         >
       </el-col>
@@ -14,7 +14,7 @@
         <el-image :src="restaurant1" fit="scale-down" />
         <el-col class="name"
           >今日销售人/次<el-col class="num"
-            >{{num[1]}}<span class="unit">份</span></el-col
+            >{{ data.nowIncome || 0 }}<span class="unit">份</span></el-col
           ></el-col
         >
       </el-col>
@@ -26,10 +26,10 @@
         <el-image :src="restaurant3" fit="scale-down" class="rightImg" />
       </el-col>
       <el-col class="bottom">
-        <div class="dish" v-for="(item,index) in list2" :key="index" @click="canyin(index + 1)">
-          <el-col :span="8"><el-image :src="item.id" fit="scale-down" class="leftImg"/></el-col>
+        <div class="dish" v-for="(item,index) in data.countTheTopThree" :key="index">
+          <el-col :span="8"><el-image :src="item.img" fit="scale-down" class="leftImg"/></el-col>
           <el-col :span="8" class="dishName">{{item.name}}</el-col>
-          <el-col :span="8" class="fs">{{item.num}}份</el-col>
+          <el-col :span="8" class="fs">{{item.countPid}}份</el-col>
         </div>
       </el-col>
     </el-col>
@@ -48,23 +48,14 @@ export default {
   name: "restaurant",
   data() {
     return {
+      loading:true,
       restaurant1: restaurant1,
       restaurant2: restaurant2,
       restaurant3: restaurant3,
       num1: num1,
       num2: num2,
       num3: num3,
-      data:{
-        total:undefined,
-        list:{}
-      },
-      list2:[
-        {id:num1,name:"清炒时蔬",num:412},
-        {id:num2,name:"柠檬鸭",num:315},
-        {id:num3,name:"番茄炒蛋",num:267},
-      ],
-      num:[38155,15642],
-      tapNo:false,
+      data:{},
     };
   },
   created(){
@@ -75,7 +66,7 @@ export default {
         {id:num2,name:"未营业",num:0},
         {id:num3,name:"未营业",num:0},
       ]
-      this.num = [0,0]
+      // this.num = [0,0]
       this.tapNo = true
     }
     if(getWeekDate() == "周六" || getWeekDate() == "周日"){
@@ -88,27 +79,23 @@ export default {
   },
   methods: {
     init(){
+      this.loading = true
       axios({
         method: 'get',
-        url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/countOrderAmt',
+        url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/getCanYinData',
         timeout: 3000,
       }).then(res =>{
-        this.data.total = res.data
-      }).catch(err =>{
-      })
-
-      axios({
-        method: 'get',
-        url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/hyFood',
-        timeout: 3000,
-      }).then(res =>{
-        if(res.data){
-          this.data.list = res.data
-          this.data.list[0].id = this.num1
-          this.data.list[1].id = this.num2
-          this.data.list[2].id = this.num3
+        this.data = res.data.data
+        if(this.data.countTheTopThree.length>0){
+          this.data.countTheTopThree[0].img= this.num1
+          this.data.countTheTopThree[1].img= this.num2
+          this.data.countTheTopThree[2].img= this.num3
+        }else{
+          this.data.countTheTopThree[0] = {img:this.num1,name:"暂未营业",countPid:0}
+          this.data.countTheTopThree[1] = {img:this.num2,name:"暂未营业",countPid:0}
+          this.data.countTheTopThree[2] = {img:this.num3,name:"暂未营业",countPid:0}
         }
-      }).catch(err =>{
+        this.loading= false
       })
     },
     timing(){
@@ -116,14 +103,14 @@ export default {
         this.init()
       },1000 * 60 * 5)
     },
-    canyin(id){
-      if(this.tapNo == true){
-        //禁止跳转(周六周日休业)
-      }else{
-        this.$emit("canyinClick",id)
-      }
+    // canyin(id){
+    //   if(this.tapNo == true){
+    //     //禁止跳转(周六周日休业)
+    //   }else{
+    //     this.$emit("canyinClick",id)
+    //   }
 
-    }
+    // }
   },
 };
 </script>
@@ -204,11 +191,14 @@ export default {
       background-color: $modularHoverBackGround;
       text-align: center;
       vertical-align: middle;
-      cursor: pointer;
+      // cursor: pointer;
       .el-image {
         width: 24px;
         margin: 4.5px 0;
       }
+      .dishName{
+        text-align: left;
+      }
       .dishName,
       .fs {
         font-size: 16px;