Browse Source

网页表头动态配置

彭宇 2 years ago
parent
commit
9c6cfa8917
3 changed files with 32 additions and 11 deletions
  1. 12 2
      src/components/v-header.vue
  2. 17 6
      src/views/bigdata/bigdata.vue
  3. 3 3
      src/views/system/login.vue

+ 12 - 2
src/components/v-header.vue

@@ -5,7 +5,7 @@
 		<!--中间LOGO -->
 		<div class="title">
 			<!-- <img src="@/assets/images/integrated/bigdata-header-nav-left2.png" /> -->
-			<h3><img class="logo" src="@/assets/images/integrated/logo-small.png" />通榆县乡村振兴监管平台 {{titlename}}
+			<h3><img class="logo" src="@/assets/images/integrated/logo-small.png" />{{systemTitle.title}} {{titlename}}
 			</h3>
 			<!-- <img src="@/assets/images/integrated/bigdata-header-nav-right2.png" /> -->
 		</div>
@@ -28,6 +28,8 @@
 	import {constantRoutes} from '@/router/index'//navbar导航引用了router路由的数组
 	import Clock from '@/components/clock.vue' // 时钟+天气
 	import VfastMenu from '@/components/v-fastmenu.vue' // 头部右侧菜单
+  import { fontConfig } from '@/api/login'
+
 	export default{
 		components:{
 			VfastMenu,
@@ -35,16 +37,24 @@
 
 		},
 		created(){
+      this.fontConfig()
 			this.navbar
 		},
 		data(){
 			return{
-
+        systemTitle:{
+          title:'',  //标题
+        },
 			}
 		},
 		methods:{
 		},
 		computed:{
+      fontConfig(){
+        fontConfig().then(res => {
+          this.systemTitle.title = res.data.fontTitle;
+        })
+      },
 			titlename(){
 				return this.$route.meta.title
 			},

+ 17 - 6
src/views/bigdata/bigdata.vue

@@ -5,7 +5,7 @@
     <div class="header">
       <!-- title -->
       <div class="header-left"><img class="logo" src="@/assets/images/integrated/logo-small.png"/>
-        <h3 class="title">通榆县乡村振兴监管平台-乡村振兴-统计分析</h3>
+        <h3 class="title">{{systemTitle.title}}-{{systemTitle.subTitle}}-统计分析</h3>
       </div>
       <div class="bignav">
         <img src="@/assets/images/integrated/bigdata-header-nav-left.png"/>
@@ -154,7 +154,8 @@ import chartGridStaff from './chart-gridStaff.vue' //13 网格人员、、
 import chartWeatherStation from './chart-weatherStation.vue' //14 气象站、、
 import chartEquipmentDistribution from './chart-equipmentDistribution' //16 设备分布、、
 
-import {getRlt} from '@/api/bigdata'
+import { getRlt } from '@/api/bigdata'
+import { fontConfig } from '@/api/login'
 
 export default {
   components: {
@@ -178,6 +179,10 @@ export default {
   data() {
 
     return {
+      systemTitle: {
+        title: '',  //标题
+        subTitle: ''//副标题 数字通榆
+      },
       visited: '',
       navbar: [
         {
@@ -226,8 +231,16 @@ export default {
 
     }
   },
-
-  methods:{
+created() {
+  this.fontConfig()
+},
+  methods: {
+    fontConfig(){
+      fontConfig().then(res => {
+        this.systemTitle.title = res.data.fontTitle;
+        this.systemTitle.subTitle = res.data.subTitle;
+      })
+    },
     rlt() {
       let that = this
       getRlt().then(resp => {
@@ -244,8 +257,6 @@ export default {
 }
 
 
-
-
 </script>
 
 <style rel="stylesheet/scss" lang="scss" scoped>

+ 3 - 3
src/views/system/login.vue

@@ -70,8 +70,8 @@
 			return {
         backgroudImg:'', //背景图片
         systemTitle:{
-          title:'通榆县乡村振兴综合监管平台',  //标题
-          subTitle:'数字通榆'  ,//副标题
+          title:'',  //标题
+          subTitle:''  ,//副标题 数字通榆
         },
 				codeUrl: '',
 				loginForm: {
@@ -117,7 +117,7 @@
 		created() {
 			this.getCode()
 			this.getCookie()
-      this.fontConfig();
+      this.fontConfig()
 		},
 		methods: {
       fontConfig(){