Browse Source

修改标题

luogang 9 months ago
parent
commit
6fcbdc1404

+ 4 - 3
ems-ui/src/App.vue

@@ -14,9 +14,10 @@ export default {
   metaInfo() {
     return {
       title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
-      titleTemplate: title => {
-        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
-      }
+      // titleTemplate: title => {
+      //   return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
+      // }
+      titleTemplate:'能源管理系统'
     }
   }
 };

+ 18 - 8
ems-ui/src/layout/components/Sidebar/Logo.vue

@@ -1,13 +1,18 @@
 <template>
-  <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
+  <div class="sidebar-logo-container" :class="{ 'collapse': collapse }"
+    :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
     <transition name="sidebarLogoFade">
       <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1 v-else class="sidebar-title"
+          :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{
+          title }} </h1>
       </router-link>
       <router-link v-else key="expand" class="sidebar-logo-link" to="/">
         <img v-if="logo" :src="logo" class="sidebar-logo" />
-        <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
+        <h1 class="sidebar-title"
+          :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{
+          title }} </h1>
       </router-link>
     </transition>
   </div>
@@ -26,19 +31,24 @@ export default {
     }
   },
   computed: {
-    variables() {
+    variables () {
       return variables;
     },
-    sideTheme() {
+    sideTheme () {
       return this.$store.state.settings.sideTheme
     }
   },
-  data() {
+  data () {
     return {
-      title: process.env.VUE_APP_TITLE,
+      title: '',
       logo: logoImg
     }
-  }
+  },
+  mounted () {
+    this.getConfigKey("sys.info.title").then(response => {
+      this.title = response.msg;
+    });
+  },
 }
 </script>
 

+ 0 - 5
ems-ui/src/router/index.js

@@ -52,11 +52,6 @@ export const constantRoutes = [
     component: () => import('@/views/register'),
     hidden: true
   },
-  // {
-  //   path: '/test',
-  //   component: () => import('@/views/mgr/test.vue'),
-  //   hidden: true
-  // },
   {
     path: '/404',
     component: () => import('@/views/error/404'),

+ 5 - 1
ems-ui/src/views/largeScreen/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="large-screen" id="largeScreen">
     <div class="header">
-      <span class="header-name">常泰大桥服务区智慧能源管理平台</span>
+      <span class="header-name">{{sysTitle}}</span>
     </div>
     <div class="left-sidebar-container">
       <div class="top-info-area">
@@ -40,6 +40,7 @@ export default {
   name: 'LargeScreen',
   data () {
     return {
+      sysTitle:'',
       nowDay: {
         currentTime: '',
         week: '',
@@ -67,6 +68,9 @@ export default {
     this.timer = setInterval(() => {
       this.getDate();
     }, 1000);
+    this.getConfigKey("sys.info.title").then(response => {
+      this.sysTitle = response.msg;
+    });
   },
   beforeDestroy () {
     clearInterval(this.timer)