Browse Source

大屏名称

seimin 1 day ago
parent
commit
b869771124
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/components/AppHeader.vue

+ 8 - 3
src/components/AppHeader.vue

@@ -39,10 +39,16 @@ import AppToday from './AppToday'
39
 import AppCumulative from './AppCumulative'
39
 import AppCumulative from './AppCumulative'
40
 export default {
40
 export default {
41
   name: 'AppHeader',
41
   name: 'AppHeader',
42
+  inject: ['parentDutyId', 'hosId', 'dutyId'],
42
   components: {
43
   components: {
43
     AppToday,
44
     AppToday,
44
     AppCumulative
45
     AppCumulative
45
   },
46
   },
47
+  computed: {
48
+    getHosId () {
49
+      return this.parentDutyId || this.dutyId || this.hosId
50
+    }
51
+  },
46
   data () {
52
   data () {
47
     return {
53
     return {
48
       logoTitle: '',
54
       logoTitle: '',
@@ -126,10 +132,9 @@ export default {
126
     }
132
     }
127
   },
133
   },
128
   mounted () {
134
   mounted () {
129
-    const loginUser = JSON.parse(localStorage.getItem('user'))
130
-    const hosId = loginUser.user.currentHospital ? loginUser.user.currentHospital.id : ''
131
     this.runTime()
135
     this.runTime()
132
-    this.getSysNameAndLogo(hosId)
136
+    this.getSysNameAndLogo(this.getHosId)
137
+    console.log('this.getHosId:', this.getHosId)
133
   },
138
   },
134
   beforeDestroy () {
139
   beforeDestroy () {
135
     clearTimeout(this.timer)
140
     clearTimeout(this.timer)