dedsudiyu 5 天之前
父节点
当前提交
fa4cf656cb
共有 2 个文件被更改,包括 14 次插入7 次删除
  1. 5 5
      src/views/components/right.vue
  2. 9 2
      src/views/home.vue

+ 5 - 5
src/views/components/right.vue

@@ -91,14 +91,14 @@
 
     },
     mounted() {
-      this.getDataTimerFunction()
+      let self = this;
+      setTimeout(function() {
+        self.initH5Player(1);
+        self.getDataTimerFunction()
+      },500)
     },
     methods: {
       getDataTimerFunction() {
-        let self = this;
-        setTimeout(function() {
-          self.initH5Player(1);
-        },500)
         clearInterval(this.getDataTimer)
         this.iotIotdbSensorDailyStats()
         this.iotIotdbSensorRealDataCombined()

+ 9 - 2
src/views/home.vue

@@ -134,8 +134,15 @@
           if(res.data[0]){
             obj = {...obj,...res.data[0]};
             obj.status = obj.runningStateName == '维修' ? '3':(obj.stateName == '租用'?'2':'1')
-            if(obj.userName('-') != -1) {
-              obj.userName = obj.userName.split('-')[0]
+            if(obj.userName){
+              if(obj.userName('-') != -1) {
+                obj.userName = obj.userName.split('-')[0]
+              }
+            }
+            if(obj.headName){
+              if(obj.headName('-') != -1) {
+                obj.headName = obj.headName.split('-')[0]
+              }
             }
             //假数据
             // obj.monitorVisable = true;