许成详 6 years ago
parent
commit
5de069d7f2
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      src/pages/user/fiveA/index.vue

+ 10
- 5
src/pages/user/fiveA/index.vue View File

@@ -95,11 +95,16 @@ export default {
95 95
   created () {
96 96
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
97 97
       this.nav = this.nav.concat(this.navList)
98
-      for (var n = 0; n < this.nav.length; n++) {
99
-        if(this.nav[n].LocationId === this.$route.query.id){
100
-          this.active.index = n
101
-          this.active.locationid = this.nav[n].LocationId
98
+      if (this.$route.query.id !== undefined) {
99
+        for (var n = 0; n < this.nav.length; n++) {
100
+          if (this.nav[n].LocationId === this.$route.query.id) {
101
+            this.active.index = n
102
+            this.active.locationid = this.nav[n].LocationId
103
+          }
102 104
         }
105
+      } else {
106
+        this.active.index = 0
107
+        this.active.locationid = this.nav[0].LocationId
103 108
       }
104 109
       this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
105 110
         // console.log(JSON.stringify(res))
@@ -155,7 +160,7 @@ export default {
155 160
       }
156 161
     },
157 162
     jump (item) {
158
-      console.log(item)
163
+      // console.log(item)
159 164
       item.ForwardType = item.ForwardType || ''
160 165
       if (item.ForwardType === 'url') {
161 166
         window.location.href = '//' + item.ForwardUrl