许成详 6 年之前
父節點
當前提交
5de069d7f2
共有 1 個檔案被更改,包括 10 行新增5 行删除
  1. 10
    5
      src/pages/user/fiveA/index.vue

+ 10
- 5
src/pages/user/fiveA/index.vue 查看文件

95
   created () {
95
   created () {
96
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
96
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
97
       this.nav = this.nav.concat(this.navList)
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
       this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
109
       this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
105
         // console.log(JSON.stringify(res))
110
         // console.log(JSON.stringify(res))
155
       }
160
       }
156
     },
161
     },
157
     jump (item) {
162
     jump (item) {
158
-      console.log(item)
163
+      // console.log(item)
159
       item.ForwardType = item.ForwardType || ''
164
       item.ForwardType = item.ForwardType || ''
160
       if (item.ForwardType === 'url') {
165
       if (item.ForwardType === 'url') {
161
         window.location.href = '//' + item.ForwardUrl
166
         window.location.href = '//' + item.ForwardUrl