see999 4 lat temu
rodzic
commit
d4eced665d

+ 12 - 8
src/xt_pages/index/verify_token.vue Wyświetl plik

11
     this.$store.dispatch('VerifyToken', this.$route.query.token).then(() => {
11
     this.$store.dispatch('VerifyToken', this.$route.query.token).then(() => {
12
       this.$store.dispatch('xt_GenerateRoutes', this.$store.getters.current_role_urls).then(() => {
12
       this.$store.dispatch('xt_GenerateRoutes', this.$store.getters.current_role_urls).then(() => {
13
         this.$store.dispatch('VerifyConfigList').then(() => {
13
         this.$store.dispatch('VerifyConfigList').then(() => {
14
-          // alert('token 验证成功')
15
-          // console.log(this.$store.getters.xt_permission.addRouters)
16
-          this.$router.addRoutes(this.$store.getters.xt_permission.addRouters) // 动态添加可访问路由表
17
-  //          next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
18
-          if(this.$store.getters.current_role_urls.includes('/dialysis/dialysisrecord')){
19
-            this.$router.replace({ path: '/dialysis/dialysisrecord' })
20
-
14
+          if(sessionStorage.getItem('signIn') != null){
15
+            this.$router.replace({ path: '/signIn' })
21
           }else{
16
           }else{
22
-            this.$router.replace({ path: '/home' })
17
+            // alert('token 验证成功')
18
+            // console.log(this.$store.getters.xt_permission.addRouters)
19
+            this.$router.addRoutes(this.$store.getters.xt_permission.addRouters) // 动态添加可访问路由表
20
+    //          next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
21
+            if(this.$store.getters.current_role_urls.includes('/dialysis/dialysisrecord')){
22
+              this.$router.replace({ path: '/dialysis/dialysisrecord' })
23
+
24
+            }else{
25
+              this.$router.replace({ path: '/home' })
23
 
26
 
24
 
27
 
28
+            }
25
           }
29
           }
26
 
30
 
27
         })
31
         })

+ 24 - 0
src/xt_pages/sign/components/beforeDialysisCalling.vue Wyświetl plik

105
             data: {type:3},
105
             data: {type:3},
106
         };
106
         };
107
         this.websocketSend(unObj)
107
         this.websocketSend(unObj)
108
+
109
+        let unObj1 = {
110
+            cmd: "queue/unjoin",
111
+            data: {type:4},
112
+        };
113
+        this.websocketSend(unObj1)
108
     },
114
     },
109
     methods:{
115
     methods:{
110
         websocketSend(data) {
116
         websocketSend(data) {
170
                             this.waitingCalledPm = waitingCalledPm
176
                             this.waitingCalledPm = waitingCalledPm
171
                             this.called = calledArr
177
                             this.called = calledArr
172
                         }
178
                         }
179
+                        if(res.data.type == 4){
180
+                            let arr = res.data.patientQueueList.data
181
+                            let calledArr = []
182
+                            arr.map(item => {
183
+                                if(item.status == 2){
184
+                                    item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
185
+                                    calledArr.push(item)
186
+                                }
187
+                            })
188
+                            this.called = calledArr
189
+                        }
173
                     }else if(res.channel == 'allQueueList'){
190
                     }else if(res.channel == 'allQueueList'){
174
                         let arr = res.data.queue_list.data
191
                         let arr = res.data.queue_list.data
175
                         // let waitingCalledArr = []
192
                         // let waitingCalledArr = []
223
             //     }) 
240
             //     }) 
224
             //     this.waitingCalledPm = newArr
241
             //     this.waitingCalledPm = newArr
225
             // }
242
             // }
243
+            if(index == 2){
244
+                let obj = {
245
+                    cmd: "queue/join",
246
+                    data: {type:4,page:0,size:0},
247
+                };
248
+                this.websocketSend(obj)
249
+            }
226
             let fisrtQueueInfo = []
250
             let fisrtQueueInfo = []
227
             if(this.newFisrtQueueInfo != null){
251
             if(this.newFisrtQueueInfo != null){
228
                 if(this.patientStateVal == 0){
252
                 if(this.patientStateVal == 0){

+ 18 - 0
src/xt_pages/sign/components/computerCalling.vue Wyświetl plik

145
                         this.waitingCalledPm = waitingCalledPm
145
                         this.waitingCalledPm = waitingCalledPm
146
                         this.called = calledArr
146
                         this.called = calledArr
147
                     }
147
                     }
148
+                    if(res.data.type == 5){
149
+                            let arr = res.data.patientQueueList.data
150
+                            let calledArr = []
151
+                            arr.map(item => {
152
+                                if(item.status == 3){
153
+                                    item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
154
+                                    calledArr.push(item)
155
+                                }
156
+                            })
157
+                            this.called = calledArr
158
+                        }
148
                 }else if(res.channel == 'allQueueList'){
159
                 }else if(res.channel == 'allQueueList'){
149
                     let arr = res.data.queue_list.data
160
                     let arr = res.data.queue_list.data
150
                     // let waitingCalledArr = []
161
                     // let waitingCalledArr = []
197
             //     }) 
208
             //     }) 
198
             //     this.waitingCalledPm = newArr
209
             //     this.waitingCalledPm = newArr
199
             // }
210
             // }
211
+            if(index == 2){
212
+                let obj = {
213
+                    cmd: "queue/join",
214
+                    data: {type:5,page:0,size:0},
215
+                };
216
+                this.websocketSend(obj)
217
+            }
200
             let fisrtQueueInfo = []
218
             let fisrtQueueInfo = []
201
             if(this.newFisrtQueueInfo != null){
219
             if(this.newFisrtQueueInfo != null){
202
                 if(this.patientStateVal == 0){
220
                 if(this.patientStateVal == 0){

+ 15 - 7
src/xt_pages/sign/signIn.vue Wyświetl plik

170
         },
170
         },
171
     },
171
     },
172
     created(){
172
     created(){
173
-        if(sessionStorage.getItem('signInKey') != null){
174
-            if(sessionStorage.getItem('signInKey') == 1){
173
+        if(sessionStorage.getItem('signIn') != null){
174
+            if(sessionStorage.getItem('signIn') == 1){
175
                 this.dialogTableVisible = true
175
                 this.dialogTableVisible = true
176
             }
176
             }
177
+            sessionStorage.removeItem('signIn')
177
         }
178
         }
179
+        // if(sessionStorage.getItem('signInKey') != null){
180
+        //     if(sessionStorage.getItem('signInKey') == 1){
181
+        //         this.dialogTableVisible = true
182
+        //     }
183
+        // }
178
         this.initData = {
184
         this.initData = {
179
             cmd: "queue/join",
185
             cmd: "queue/join",
180
             data: {type:1,page:1,size:10},
186
             data: {type:1,page:1,size:10},
209
             this.updateTime()
215
             this.updateTime()
210
         }, 1000);
216
         }, 1000);
211
         // this.updateTime();
217
         // this.updateTime();
212
-        // this.newTimes = setInterval(() => {
213
-        //     this.reload()
214
-        // }, 1000 * 60 * 3);
218
+        this.newTimes = setInterval(() => {
219
+            // this.reload()
220
+            sessionStorage.setItem('signIn',1);
221
+            window.location.reload()
222
+        }, 1000 * 30);
215
     },
223
     },
216
     beforeDestroy(){
224
     beforeDestroy(){
217
         clearInterval(this.timer);  // 清除定时器
225
         clearInterval(this.timer);  // 清除定时器
218
         clearInterval(this.timerID);  // 清除定时器
226
         clearInterval(this.timerID);  // 清除定时器
219
-        // clearInterval(this.newTimes);  // 清除定时器
220
-        // this.newTimes = null
227
+        clearInterval(this.newTimes);  // 清除定时器
228
+        this.newTimes = null
221
         let obj = {
229
         let obj = {
222
             cmd: "queue/unjoin",
230
             cmd: "queue/unjoin",
223
             data: {type:1},
231
             data: {type:1},