Browse Source

动态标题

yuhan 1 year ago
parent
commit
da34eb640d
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/views/modules_guAn/visualization/index.vue

+ 7 - 3
src/views/modules_guAn/visualization/index.vue

@@ -3,7 +3,7 @@
     <!-- 头部标题区域 -->
     <div class="top-title-container u-flex-jac">
       <div class="title-content">
-        <span class="text">高温高湿试验项目</span>
+        <span class="text" :data-attr="titleName">{{titleName}}</span>
       </div>
     </div>
     <!-- 报警按钮 -->
@@ -100,12 +100,13 @@ export default {
   },
   data () {
     return {
+      titleName: '高温高湿高辐射试验',
       eqRealData: [],
       yuzhiData: [],
       curveData: [],
       newAlarmData: [],
       websock: null,
-      newAlarmData: null
+      newAlarmData: null,
     }
   },
   destroyed () {
@@ -167,6 +168,9 @@ export default {
       this.curveData = redata['设备历史值']
       this.newAlarmData = redata['最新一条报警信息']
       this.yuzhiData = redata['预制曲线']
+      var titleObj = redata['设备实时值'].find(item => item.Name === '试验名称')
+      console.log(titleObj)
+      this.titleName = titleObj ? titleObj.Value : '高温高湿试验项目'
     },
     // websocket连接后发送数据(send发送)
     websocketonopen () {
@@ -236,7 +240,7 @@ export default {
           // font-family: "楷体_GB2312";
           &::before{
             // content: attr(text); // div中设置了text=>相当于又写了一个标题覆盖在原来设置了阴影的文字上面
-            content: '高温高湿试验项目';
+            content:  attr(data-attr);
             position: absolute;
             z-index: 10;
             background-image: linear-gradient(to bottom, #ffffff, #8DD4F7);