Bläddra i källkod

菜谱随时间选择变化

tianyabing 2 år sedan
förälder
incheckning
77d050296b

+ 1 - 1
index.html

@@ -6,7 +6,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>智慧楼宇平台</title>
     <script type="module" src="/src/plugins/gverify.js"></script>
-    <script type="module" src="/src/plugins/jessibuca/jessibuca.js"></script>
+    <script type="module" src="/jessibuca/jessibuca.js"></script>
   </head>
   <body>
     <div id="app"></div>

+ 0 - 0
src/plugins/jessibuca/decoder.js → public/jessibuca/decoder.js


+ 0 - 0
src/plugins/jessibuca/decoder.wasm → public/jessibuca/decoder.wasm


+ 0 - 0
src/plugins/jessibuca/jessibuca.js → public/jessibuca/jessibuca.js


+ 0 - 327
src/components/common/player/jessibuca.vue

@@ -1,327 +0,0 @@
-<template>
-  <div ref="container" @dblclick="fullscreenSwich" style="width:100%;height:100%;background-color: #000000;margin:0 auto;">
-    <div class="buttons-box" id="buttonsBox">
-      <div class="buttons-box-left">
-        <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
-        <i v-if="playing" class="iconfont icon-pause jessibuca-btn" @click="pause"></i>
-        <i class="iconfont icon-stop jessibuca-btn" @click="destroy"></i>
-        <i v-if="isNotMute" class="iconfont icon-audio-high jessibuca-btn" @click="mute()"></i>
-        <i v-if="!isNotMute" class="iconfont icon-audio-mute jessibuca-btn" @click="cancelMute()"></i>
-      </div>
-      <div class="buttons-box-right">
-        <span class="jessibuca-btn">{{ kBps }} kb/s</span>
-        <!--          <i class="iconfont icon-file-record1 jessibuca-btn"></i>-->
-        <!--          <i class="iconfont icon-xiangqing2 jessibuca-btn" ></i>-->
-        <i class="iconfont icon-camera1196054easyiconnet jessibuca-btn" @click="jessibuca.screenshot('截图','png',0.5)"
-           style="font-size: 1rem !important"></i>
-        <i class="iconfont icon-shuaxin11 jessibuca-btn" @click="playBtnClick"></i>
-        <i v-if="!fullscreen" class="iconfont icon-weibiaoti10 jessibuca-btn" @click="fullscreenSwich"></i>
-        <i v-if="fullscreen" class="iconfont icon-weibiaoti11 jessibuca-btn" @click="fullscreenSwich"></i>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-let jessibucaPlayer = {};
-export default {
-  name: 'jessibuca',
-  data() {
-    return {
-      playing: false,
-      isNotMute: false,
-      quieting: false,
-      fullscreen: false,
-      loaded: false, // mute
-      speed: 0,
-      performance: "", // 工作情况
-      kBps: 0,
-      btnDom: null,
-      videoInfo: null,
-      volume: 1,
-      rotate: 0,
-      vod: true, // 点播
-      forceNoOffscreen: false,
-    };
-  },
-  props: ['videoUrl', 'error', 'hasAudio', 'height'],
-  mounted() {
-    window.onerror = (msg) => {
-      // console.error(msg)
-    };
-    console.log(this._uid)
-    let paramUrl = decodeURIComponent(this.$route.params.url)
-    this.$nextTick(() => {
-      this.updatePlayerDomSize()
-      window.onresize = () => {
-        this.updatePlayerDomSize()
-      }
-      if (typeof (this.videoUrl) == "undefined") {
-        this.videoUrl = paramUrl;
-      }
-      this.btnDom = document.getElementById("buttonsBox");
-      console.log("初始化时的地址为: " + this.videoUrl)
-      this.play(this.videoUrl)
-    })
-  },
-  watch: {
-    videoUrl(newData, oldData) {
-      this.play(newData)
-    },
-    immediate: true
-  },
-  methods: {
-    updatePlayerDomSize() {
-      let dom = this.$refs.container;
-      let width = dom.parentNode.clientWidth
-      let height = (9 / 16) * width
-
-      const clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight)
-      if (height > clientHeight) {
-        height = clientHeight
-        width = (16 / 9) * height
-      }
-
-      dom.style.width = width + 'px';
-      dom.style.height = height + "px";
-    },
-    create() {
-      let options = {};
-      console.log("hasAudio  " + this.hasAudio)
-
-      jessibucaPlayer[this._uid] = new window.Jessibuca(Object.assign(
-        {
-          container: this.$refs.container,
-          videoBuffer: 0.2, // 最大缓冲时长,单位秒
-          isResize: true,
-          decoder: "static/js/jessibuca/decoder.js",
-          useMSE: false,
-          showBandwidth: false,
-          isFlv: true,
-          // text: "WVP-PRO",
-          // background: "static/images/zlm-logo.png",
-          loadingText: "加载中",
-          hasAudio: typeof (this.hasAudio) == "undefined" ? true : this.hasAudio,
-          debug: false,
-          supportDblclickFullscreen: false, // 是否支持屏幕的双击事件,触发全屏,取消全屏事件。
-          operateBtns: {
-            fullscreen: false,
-            screenshot: false,
-            play: false,
-            audio: false,
-            recorder: false,
-          },
-          record: "record",
-          vod: this.vod,
-          forceNoOffscreen: this.forceNoOffscreen,
-          isNotMute: this.isNotMute,
-        },
-        options
-      ));
-      let jessibuca = jessibucaPlayer[this._uid];
-      let _this = this;
-      jessibuca.on("load", function () {
-        console.log("on load init");
-      });
-
-      jessibuca.on("log", function (msg) {
-        console.log("on log", msg);
-      });
-      jessibuca.on("record", function (msg) {
-        console.log("on record:", msg);
-      });
-      jessibuca.on("pause", function () {
-        _this.playing = false;
-      });
-      jessibuca.on("play", function () {
-        _this.playing = true;
-      });
-      jessibuca.on("fullscreen", function (msg) {
-        console.log("on fullscreen", msg);
-        _this.fullscreen = msg
-      });
-
-      jessibuca.on("mute", function (msg) {
-        console.log("on mute", msg);
-        _this.isNotMute = !msg;
-      });
-      jessibuca.on("audioInfo", function (msg) {
-        // console.log("audioInfo", msg);
-      });
-
-      jessibuca.on("videoInfo", function (msg) {
-        // this.videoInfo = msg;
-        console.log("videoInfo", msg);
-
-      });
-
-      jessibuca.on("bps", function (bps) {
-        // console.log('bps', bps);
-
-      });
-      let _ts = 0;
-      jessibuca.on("timeUpdate", function (ts) {
-        // console.log('timeUpdate,old,new,timestamp', _ts, ts, ts - _ts);
-        _ts = ts;
-      });
-
-      jessibuca.on("videoInfo", function (info) {
-        console.log("videoInfo", info);
-      });
-
-      jessibuca.on("error", function (error) {
-        console.log("error", error);
-      });
-
-      jessibuca.on("timeout", function () {
-        console.log("timeout");
-      });
-
-      jessibuca.on('start', function () {
-        console.log('start');
-      })
-
-      jessibuca.on("performance", function (performance) {
-        let show = "卡顿";
-        if (performance === 2) {
-          show = "非常流畅";
-        } else if (performance === 1) {
-          show = "流畅";
-        }
-        _this.performance = show;
-      });
-      jessibuca.on('buffer', function (buffer) {
-        // console.log('buffer', buffer);
-      })
-
-      jessibuca.on('stats', function (stats) {
-        // console.log('stats', stats);
-      })
-
-      jessibuca.on('kBps', function (kBps) {
-        _this.kBps = Math.round(kBps);
-      });
-
-      // 显示时间戳 PTS
-      jessibuca.on('videoFrame', function () {
-
-      })
-
-      //
-      jessibuca.on('metadata', function () {
-
-      });
-    },
-    playBtnClick: function (event) {
-      this.play(this.videoUrl)
-    },
-    play: function (url) {
-      console.log(url)
-      if (jessibucaPlayer[this._uid]) {
-        this.destroy();
-      }
-      this.create();
-      jessibucaPlayer[this._uid].on("play", () => {
-        this.playing = true;
-        this.loaded = true;
-        this.quieting = jessibuca.quieting;
-      });
-      if (jessibucaPlayer[this._uid].hasLoaded()) {
-        jessibucaPlayer[this._uid].play(url);
-      } else {
-        jessibucaPlayer[this._uid].on("load", () => {
-          console.log("load 播放")
-          jessibucaPlayer[this._uid].play(url);
-        });
-      }
-    },
-    pause: function () {
-      if (jessibucaPlayer[this._uid]) {
-        jessibucaPlayer[this._uid].pause();
-      }
-      this.playing = false;
-      this.err = "";
-      this.performance = "";
-    },
-    mute: function () {
-      if (jessibucaPlayer[this._uid]) {
-        jessibucaPlayer[this._uid].mute();
-      }
-    },
-    cancelMute: function () {
-      if (jessibucaPlayer[this._uid]) {
-        jessibucaPlayer[this._uid].cancelMute();
-      }
-    },
-    destroy: function () {
-      if (jessibucaPlayer[this._uid]) {
-        jessibucaPlayer[this._uid].destroy();
-      }
-      if (document.getElementById("buttonsBox") == null) {
-        this.$refs.container.appendChild(this.btnDom)
-      }
-      jessibucaPlayer[this._uid] = null;
-      this.playing = false;
-      this.err = "";
-      this.performance = "";
-
-    },
-    eventcallbacK: function (type, message) {
-      // console.log("player 事件回调")
-      // console.log(type)
-      // console.log(message)
-    },
-    fullscreenSwich: function () {
-      let isFull = this.isFullscreen()
-      jessibucaPlayer[this._uid].setFullscreen(!isFull)
-      this.fullscreen = !isFull;
-    },
-    isFullscreen: function () {
-      return document.fullscreenElement ||
-        document.msFullscreenElement ||
-        document.mozFullScreenElement ||
-        document.webkitFullscreenElement || false;
-    }
-  },
-  destroyed() {
-    if (jessibucaPlayer[this._uid]) {
-      jessibucaPlayer[this._uid].destroy();
-    }
-    this.playing = false;
-    this.loaded = false;
-    this.performance = "";
-  },
-}
-</script>
-
-<style>
-.buttons-box {
-  width: 100%;
-  height: 28px;
-  background-color: rgba(43, 51, 63, 0.7);
-  position: absolute;
-  display: -webkit-box;
-  display: -ms-flexbox;
-  display: flex;
-  left: 0;
-  bottom: 0;
-  user-select: none;
-  z-index: 10;
-}
-
-.jessibuca-btn {
-  width: 20px;
-  color: rgb(255, 255, 255);
-  line-height: 27px;
-  margin: 0px 10px;
-  padding: 0px 2px;
-  cursor: pointer;
-  text-align: center;
-  font-size: 0.8rem !important;
-}
-
-.buttons-box-right {
-  position: absolute;
-  right: 0;
-}
-</style>

+ 5 - 1
src/components/dashboard/portrait/cold/coldTrendChart.vue

@@ -26,13 +26,17 @@ export default {
           {
             name: '冷量(kWh)',
             type: 'value',
+            max: 12,
+            interval: 3,
             nameTextStyle: {
-              padding: [10, 0, 10, 0]
+              padding: [10, 0, 10, 15]
             },
           },
           {
             name: '温度(℃)',
             type: 'value',
+            max: 40,
+            interval: 10,
             nameTextStyle: {
               padding: [10, 0, 10, -12]
             },

+ 1 - 1
src/components/dashboard/portrait/coldPortrait.vue

@@ -34,7 +34,7 @@ export default {
         },
         {
           type: 0,
-          title: '人均用冷量(kWh)',
+          title: '人均用冷量(kWh)',
           num: 0,
           historyDesc: '同比',
           historyNum: '0'

+ 1 - 1
src/components/dashboard/portrait/electricityPortrait.vue

@@ -25,7 +25,7 @@ export default {
                     type: 0,
                     title: '今日用电量(kWh)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: 0
                 },
                 {

+ 5 - 1
src/components/dashboard/portrait/hot/hotTrendChart.vue

@@ -26,13 +26,17 @@ export default {
           {
             name: '热量(kWh)',
             type: 'value',
+            max: 12,
+            interval: 3,
             nameTextStyle: {
-              padding: [10, 0, 10, 0]
+              padding: [10, 0, 10, 15]
             },
           },
           {
             name: '温度(℃)',
             type: 'value',
+            max: 40,
+            interval: 10,
             nameTextStyle: {
               padding: [10, 0, 10, -12]
             },

+ 1 - 1
src/components/dashboard/portrait/hotPortrait.vue

@@ -34,7 +34,7 @@ export default {
                 },
                 {
                     type: 0,
-                    title: '人均用热量(kWh/天)',
+                    title: '人均用热量(kWh/天)',
                     num: 0,
                     historyDesc: '同比',
                     historyNum: '0'

+ 2 - 2
src/components/dashboard/portrait/money/investYearChart.vue

@@ -33,7 +33,7 @@ export default {
             name: '已使用时间',
             type: 'value',
             min: 0,
-            max: 50,
+            max: 20,
             nameTextStyle: {
               padding: [10, 0, 10, 15]
             },
@@ -42,7 +42,7 @@ export default {
             type: 'value',
             name: '标准年限',
             min: 0,
-            max: 50,
+            max: 20,
             nameTextStyle: {
               padding: [10, 20, 10, 0]
             },

+ 7 - 7
src/components/dashboard/portrait/personPortrait.vue

@@ -16,30 +16,30 @@ export default {
             coreData: [
                 {
                     type: 0,
-                    title: '进入大楼(人)',
+                    title: '24h内进入大楼(人)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: 0
                 },
                 {
                     type: 0,
-                    title: '离开大楼(人)',
+                    title: '24h离开大楼(人)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: 0
                 },
                 {
                     type: 0,
                     title: '9点前进入大楼(人)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: 0
                 },
                 {
                     type: 0,
-                    title: '楼内人员数量(人)',
+                    title: '24h人员保有量(人)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: 0
                 },
                 {

+ 7 - 7
src/components/dashboard/portrait/restaurantPortrait.vue

@@ -15,28 +15,28 @@ export default {
       coreData: [
         {
           type: 0,
-          title: '餐厅消费金额(元)',
+          title: '今日餐厅消费金额(元)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {
           type: 0,
-          title: '餐厅消费订单(单)',
+          title: '今日餐厅消费订单(单)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {
           type: 0,
-          title: '餐厅平均单价(元/单)',
+          title: '今日餐厅平均单价(元/单)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {
           type: 1,
-          title: '第三方结算费用(元)',
+          title: '今日第三方结算费用(元)',
           content: '0'
         },
         {

+ 6 - 6
src/components/dashboard/portrait/supermarketPortrait.vue

@@ -14,23 +14,23 @@ export default {
       coreData: [
         {
           type: 0,
-          title: '商超消费金额(元)',
+          title: '今日商超消费金额(元)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {
           type: 0,
-          title: '商超消费订单(单)',
+          title: '今日商超消费订单(单)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {
           type: 0,
-          title: '商超平均单价(元/单)',
+          title: '今日商超平均单价(元/单)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: '0'
         },
         {

+ 1 - 1
src/components/dashboard/portrait/waterPortrait.vue

@@ -25,7 +25,7 @@ export default {
                     type: 0,
                     title: '今日用水总量(m³)',
                     num: 0,
-                    historyDesc: '比',
+                    historyDesc: '比',
                     historyNum: '0'
                 },
                 {

+ 0 - 2
src/components/home/ContainerAside.vue

@@ -29,8 +29,6 @@ export default {
       }
       let currMenu = matchRoutes[matchRoutes.length-1];
       let index = this.menuList.findIndex(item => item.router==currMenu.path);
-      console.log(currMenu)
-      console.log(this.menuList)
       if (index>-1) {
         currMenu = this.menuList[index];
         if (currMenu.children && currMenu.children.length>0) {

+ 7 - 11
src/components/life/restaurant/components/lifeRestDailyMenu.vue

@@ -7,13 +7,8 @@
     :pagination="false"
     :customRow="customRow"
   >
-    <template #cuisineType="text,record">
-      <span v-if="text==1">主食</span>
-      <span v-if="text==2">汤</span>
-      <span v-if="text==3">热菜</span>
-    </template>
     <template #price="text, record">
-      {{ text }}(元)
+      {{ text }}
     </template>
   </a-table>
 </template>
@@ -25,12 +20,12 @@ export default {
   },
   data() {
     return {
+      menus: [],
       columns: [
         {
-          dataIndex: "cuisineType",
-          key: "cuisineType",
-          scopedSlots: { customRender: 'cuisineType' },
-          width: 80,
+          dataIndex: "cuisineTypeTwo",
+          key: "cuisineTypeTwo",
+          //width: 80,
           align: 'center',
         },
         {
@@ -40,7 +35,8 @@ export default {
         {
           dataIndex: "price",
           key: "price",
-          width: 120,
+          align: 'center',
+          //width: 120,
           scopedSlots: { customRender: 'price' },
         },
       ],

+ 16 - 6
src/components/life/restaurant/lifeRestaurant.vue

@@ -26,13 +26,11 @@ export default {
           title: '当天就餐人数预测',
           num: 0,
           isHighLight: true,
-          historyDesc: '同比',
-          historyNum: 0
         },
         {
-          title: '累计就餐人数(人)',
+          title: '当天累计就餐人数(人)',
           num: 0,
-          historyDesc: '比',
+          historyDesc: '比',
           historyNum: 0
         },
         {
@@ -54,6 +52,7 @@ export default {
           content: ''
         },
       ],
+      oriDailyMenu: [],
       dailyMenu: [],
       topMenu: [],
     }
@@ -118,7 +117,18 @@ export default {
     getDailyMenu() {
       this.queryData['type'] = this.eatTimeSelect;
       return apiLifeRestaurant.getTodayMenu(this.queryData).then(res=>{
-        this.dailyMenu = res;
+        this.oriDailyMenu = res;
+        this.filterTimeMenu();
+      })
+    },
+    filterTimeMenu() {
+      this.dailyMenu = this.oriDailyMenu.filter(item=>item.cuisineType==this.eatTimeSelect);
+      this.dailyMenu.sort((a,b)=>{
+        if (a.cuisineTypeTwo>=b.cuisineTypeTwo) {
+          return 1;
+        } else {
+          return -1;
+        }
       })
     },
     getTopMenu() {
@@ -197,7 +207,7 @@ export default {
               </div>
 
               <template #title-extra>
-                <a-select v-model="eatTimeSelect" default-value="1" style="width: 100px;" size="small" @change="getDailyMenu">
+                <a-select v-model="eatTimeSelect" default-value="1" style="width: 100px;" size="small" @change="filterTimeMenu">
                   <a-select-option value="1">早餐</a-select-option>
                   <a-select-option value="2">午餐</a-select-option>
                   <a-select-option value="3">晚餐</a-select-option>

+ 36 - 1
src/components/security/alarm/securityAlarmGrid.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="securityAlarmGrid">
-    <Card title="宫格模式" style="height: 99%">
+    <Card title="宫格模式" style="height: 99%;padding-bottom: 12px">
       <div style="height: 100%;margin: 0 15px 15px">
         <a-row style="height: 100%">
           <a-col :span="4" style="height: 90%">
@@ -30,6 +30,11 @@ export default {
   },
   data() {
     return {
+      gridConfig: {
+        span: 8,
+        num: 1,
+      },
+      playerIdx: 1,
       treeData: [
         {
           title: '一层大厅',
@@ -168,6 +173,36 @@ export default {
         },
       ],
     }
+  },
+  methods: {
+    shot(e) {
+      // console.log(e)
+      // send({code:'image',data:e})
+      var base64ToBlob = function (code) {
+        let parts = code.split(';base64,');
+        let contentType = parts[0].split(':')[1];
+        let raw = window.atob(parts[1]);
+        let rawLength = raw.length;
+        let uInt8Array = new Uint8Array(rawLength);
+        for (let i = 0; i < rawLength; ++i) {
+          uInt8Array[i] = raw.charCodeAt(i);
+        }
+        return new Blob([uInt8Array], {
+          type: contentType
+        });
+      };
+      let aLink = document.createElement('a');
+      let blob = base64ToBlob(e); //new Blob([content]);
+      let evt = document.createEvent("HTMLEvents");
+      evt.initEvent("click", true, true); //initEvent 不加后两个参数在FF下会报错  事件类型,是否冒泡,是否阻止浏览器的默认行为
+      aLink.download = '截图';
+      aLink.href = URL.createObjectURL(blob);
+      aLink.click();
+    },
+    destroy(idx) {
+      console.log(idx);
+      this.clear(idx.substring(idx.length - 1))
+    },
   }
 }
 </script>

+ 2 - 2
src/components/security/alarm/securityAlarmMap.vue

@@ -53,13 +53,13 @@
     <a-modal
         title="实时预览"
         v-if="showcamera"
-        :visible="showcamera"
+        :visible="true"
         width="800px"
         @cancel="()=>{this.showcamera=false}"
         :footer="null"
     >
       <div style="height: 450px">
-        <hkwsCamera />
+        <hkwsCamera  />
       </div>
     </a-modal>
 

+ 8 - 6
src/components/security/camera/hkwsCamera.vue

@@ -1,5 +1,5 @@
 <template>
-  <hik-comp ref="hkws" class="hkws-camera" :playConfig="playConfig"
+  <hik-comp v-if="show" ref="hkws" class="hkws-camera" :playConfig="playConfig"
             :nameId="jkInfo.nameId" :cameraIndexCode="jkInfo.cameraIndexCode" />
 
 </template>
@@ -8,9 +8,10 @@
 export default {
   data() {
     return {
+      show: false,
       jkInfo: {
         nameId: "playWnd1", // nameId 具有唯一性,否则无效,如果有多个,一定不能重复
-        cameraIndexCode: "549136751cbd49798d3ee9368f9aae89",  // 监控点编号
+        cameraIndexCode: "4d43345c64744929b68e6a76678d60",  // 监控点编号
       }
     }
   },
@@ -27,16 +28,17 @@ export default {
         layout: "1x1",
         enableHTTPS: 1,
         encryptedFields: 'secret',
-        showToolbar: 1,
+        showToolbar: 0,
         showSmart: 0,
         buttonIDs: "",
-        toolBarButtonIDs: "4098,4097",
+        toolBarButtonIDs: "4098",
       }
     }
   },
   mounted() {
-    console.log(this.$refs.hkws)
-
+    this.$nextTick(()=>{
+      this.show=true
+    })
   },
   beforeDestroy() {
     this.$refs.hkws.oWebControl.JS_StopService('window')

+ 1 - 1
src/components/security/common/securityDeviceSelect.vue

@@ -36,7 +36,7 @@ import Card from "@/components/common/card.vue";
 
 export default {
   props: {
-    treeData: Object,
+    treeData: Array,
   },
   data() {
     return {