浏览代码

页面title显示问题

JX.LI 2 年之前
父节点
当前提交
19a74537eb
共有 1 个文件被更改,包括 50 次插入43 次删除
  1. 50 43
      src/views/forest.vue

+ 50 - 43
src/views/forest.vue

@@ -472,7 +472,9 @@
     selectResourcesByLabel
   } from "@/api/resources"
 
-import {getUserProfile} from "@/api/system/user";
+  import {
+    getUserProfile
+  } from "@/api/system/user";
   import {
     selectConfigKey
   } from "@/api/system/config";
@@ -501,35 +503,39 @@ import {getUserProfile} from "@/api/system/user";
       window.choseLayerSwitchingList = this.choseLayerSwitchingList
       /** ----------------------------------底部按钮公用组件结束------------------------------------- */
     },
-    metaInfo () {
+    metaInfo() {
       return {
-        title:this.title,
-        meta:[{
-          charset: "utf-8"
-        },
+        title: this.title,
+        meta: [{
+            charset: "utf-8"
+          },
           {
             name: "viewport",
             content: "width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
-          }]
+          }
+        ]
       }
     },
     mounted() {
 
-          // 初始化地图数据
-          this.getSuperMapUrl();
+      // 初始化地图数据
+      this.getSuperMapUrl();
       this.getBaseInfo()
-    setTimeout(() => {
-      this.getTodayEvents(this.getCurrentDataStr())
-      this.getDeptEventCount(this.getCurrentDataStr())
-      this.getWeather(this.getCurrentDataStr())
-      this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum)
-      this.getEventByEventType(this.getCurrentDataStr())
-      this.getEventByReportorOrder(this.getCurrentDataStr())
-      this.getExposureStage(this.getCurrentDataStr())
-      this.getSupermap(this.getCurrentDataStr())
-      this.getMenuEventType()
-      this.getResourcesCount();
-    }, 2000)
+      setTimeout(() => {
+        this.title = '四平市态势感知平台'
+      }, 1000)
+      setTimeout(() => {
+        this.getTodayEvents(this.getCurrentDataStr())
+        this.getDeptEventCount(this.getCurrentDataStr())
+        this.getWeather(this.getCurrentDataStr())
+        this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum)
+        this.getEventByEventType(this.getCurrentDataStr())
+        this.getEventByReportorOrder(this.getCurrentDataStr())
+        this.getExposureStage(this.getCurrentDataStr())
+        this.getSupermap(this.getCurrentDataStr())
+        this.getMenuEventType()
+        this.getResourcesCount();
+      }, 2000)
       /** ----------------------------------weosocket开始------------------------------------- */
       // this.initWebSocket()
       /** ----------------------------------weosocket结束------------------------------------- */
@@ -538,6 +544,7 @@ import {getUserProfile} from "@/api/system/user";
     },
     data() {
       return {
+        title: "",
         // 搜索框
         // 搜索名称
         searchName: undefined,
@@ -629,27 +636,27 @@ import {getUserProfile} from "@/api/system/user";
     /** ----------------------------------weosocket结束------------------------------------- */
     methods: {
 
-          //初始化地图数据
-          getSuperMapUrl(){
-            getUserProfile().then(response => {
-              let mapDeptId=response.mapDeptId
-              let num = 0;
-              if (mapDeptId == "365") {
-                num = 0;
-              } else if (mapDeptId == "369") {
-                num = 1;
-              } else if (mapDeptId == "371") {
-                num = 2;
-              } else if (mapDeptId == "373") {
-                num = 3;
-              } else if (mapDeptId == "372") {
-                num = 4;
-              } else if (mapDeptId == "370") {
-                num = 5;
-              }
-              this.$refs.supermap.removeAllviewer(num, -1);
-            });
-          },
+      //初始化地图数据
+      getSuperMapUrl() {
+        getUserProfile().then(response => {
+          let mapDeptId = response.mapDeptId
+          let num = 0;
+          if (mapDeptId == "365") {
+            num = 0;
+          } else if (mapDeptId == "369") {
+            num = 1;
+          } else if (mapDeptId == "371") {
+            num = 2;
+          } else if (mapDeptId == "373") {
+            num = 3;
+          } else if (mapDeptId == "372") {
+            num = 4;
+          } else if (mapDeptId == "370") {
+            num = 5;
+          }
+          this.$refs.supermap.removeAllviewer(num, -1);
+        });
+      },
       // 根据名称筛选资源点位
       searchByName() {
         this.$modal.msgSuccess("正在查询,请稍后...");
@@ -1732,4 +1739,4 @@ import {getUserProfile} from "@/api/system/user";
       background-color: #0f3655;
     }
   }
-</style>
+</style>