Browse Source

页面优化

cuiHe 9 months ago
parent
commit
b928136f3b
2 changed files with 10 additions and 10 deletions
  1. 0 2
      src/utils/hooks.ts
  2. 10 8
      src/views/big-screen/single.vue

+ 0 - 2
src/utils/hooks.ts

@@ -106,7 +106,6 @@ export var _mqttMessageCallback: any
  * @param callback 消息回调
  */
 export const onSubscribe = (topics: string[], callback: any) => {
-  console.log(topics)
   _mqttMessageCallback = callback
   if (window.client == null) {
     useMqtt()
@@ -136,7 +135,6 @@ export const onUnsubscribe = (topic: string) => {
  */
 export const useMqtt = () => {
   const userInfo = JSON.parse(localStorage.getItem('yz-user') as string)
-  console.log(userInfo)
   const { userId, securityCode } = userInfo
   const { mqtt } = window as any
   const mqttOptions = {

+ 10 - 8
src/views/big-screen/single.vue

@@ -18,7 +18,7 @@
             </span>
             <div style="margin-top: 5px;">
               <span style="font-family: Alibaba-PuHuiTi-R;font-size: 36px;color: #4F80F8;">
-                {{ craneStrokeData.value}}
+                {{ craneStrokeData.value != null ? craneStrokeData.value : 0}}
               </span>
               <span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
                 m
@@ -105,7 +105,7 @@
             </span>
             <div style="margin-top: 5px;">
               <span style="font-family: Alibaba-PuHuiTi-R;font-size: 36px;color: #4F80F8;">
-                {{ hoistStrokeData.value}}
+                {{ hoistStrokeData.value != null ? hoistStrokeData.value : 0}}
               </span>
               <span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
                 m
@@ -213,7 +213,7 @@
                 </span>
               </div>
               <span style="margin-top: 5px;color: #608BF3;font-size: 18px;font-family: Alibaba-PuHuiTi-R;">
-                {{ currentDurationData.value }}
+                {{ currentDurationData.value != null ? currentDurationData.value : 0 }}
               </span>
           </div>
           <div style="display: flex;justify-content: space-between;align-items: center;border-top:0.5px solid #152844;">
@@ -224,7 +224,7 @@
                 </span>
               </div>
               <span style="margin-top: 5px;color: #608BF3;font-size: 18px;font-family: Alibaba-PuHuiTi-R;">
-                {{ totalDurationData.value }}
+                {{ totalDurationData.value != null ? totalDurationData.value : 0 }}
               </span>
           </div>
           <div style="display: flex;justify-content: space-between;align-items: center;border-top:0.5px solid #152844;">
@@ -235,7 +235,7 @@
                 </span>
               </div>
               <span style="margin-top: 5px;color: #608BF3;font-size: 18px;font-family: Alibaba-PuHuiTi-R;">
-                {{ totalCountData.value+' 次' }}
+                {{ totalCountData.value != null ? totalCountData.value : 0+' 次' }}
               </span>
           </div>
       </div>
@@ -299,7 +299,7 @@
             </span>
             <div style="margin-top: 5px;">
               <span style="font-family: Alibaba-PuHuiTi-R;font-size: 36px;color: #4F80F8;">
-                {{ trolleyStrokeData.value}}
+                {{ trolleyStrokeData.value != null ? trolleyStrokeData.value : 0}}
               </span>
               <span style="margin-left: -5px;font-family: Alibaba-PuHuiTi-R;font-size: 24px;color: #4F80F8;">
                 m
@@ -421,6 +421,9 @@
     loading.value = true
     try {
       await videoData.getData()
+      if(videoData.data.cameras == null){
+        return;
+      }
       channelNo.value = videoData.data.cameras[0].channelNo
       videoUrl.value = videoData.data.cameras[0].url
       myVideo.value = new EZUIKit.EZUIKitPlayer({
@@ -441,7 +444,7 @@
           loading.value = false
         }
       })
-    } finally {
+    }finally {
       loading.value = false
     }
   }
@@ -544,7 +547,6 @@
   }
   //解析数据
   const parseMqttData = (jsonArray: any) => {
-    console.log(JSON.stringify(jsonArray))
       jsonArray.forEach((res: any) => {
           const { Value, Code } = res