修改跳转参数

master
夜笙歌 3 months ago
parent 49ad5f6238
commit f03596da0d

@ -1,6 +1,7 @@
<template> <template>
<div> <div>
<router-view></router-view> <router-view></router-view>
<div class="data" id="data">{{ data }}</div>
<div class="time" id="time">{{ time }}</div> <div class="time" id="time">{{ time }}</div>
<div class="date" id="date">{{ date }}</div> <div class="date" id="date">{{ date }}</div>
</div> </div>
@ -13,11 +14,14 @@ export default {
name: 'BoardIndex', name: 'BoardIndex',
data() { data() {
return { return {
data:'',
time: '', time: '',
date: '' date: ''
} }
}, },
created() { created() {
let floorData = JSON.parse(sessionStorage.getItem('FLOORDATA') || '{}')
this.data = floorData.query?.a
const getDate = () => { const getDate = () => {
let date = new Date() let date = new Date()
let YYYY = date.getFullYear() let YYYY = date.getFullYear()
@ -38,7 +42,7 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.time, .date { .time, .date, .data {
position: absolute; position: absolute;
font-size: 0.8vw; font-size: 0.8vw;
color: #fcfcfc; color: #fcfcfc;
@ -46,6 +50,11 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.data {
top: 3.2%;
right: 17%;
}
.time { .time {
top: 3.2%; top: 3.2%;
left: 85.8%; left: 85.8%;

@ -85,7 +85,7 @@ export default {
password: "admin123", password: "admin123",
rememberMe: false, rememberMe: false,
processId: '', processId: '',
processFloor:'', processFloor: '',
code: "", code: "",
uuid: "" uuid: ""
}, },
@ -206,14 +206,16 @@ export default {
Cookies.remove('rememberMe'); Cookies.remove('rememberMe');
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
let data = this.options.find(v=>v.processId === this.loginForm.processId) || {} let data = this.options.find(v => v.processId === this.loginForm.processId) || {}
let routeData = this.floorData.find(v=>v.floor === data.processFloor && v.processId === data.processId) || {} let routeData = this.floorData.find(v => v.floor === data.processFloor && v.processId === data.processId) || {}
if(routeData.route){ let query = {a:1}
routeData.query = query
if (routeData.route) {
sessionStorage.setItem("FLOORDATA", JSON.stringify(routeData)) sessionStorage.setItem("FLOORDATA", JSON.stringify(routeData))
} }
// this.$router.push({path: this.redirect || "/"}).catch(() => { // this.$router.push({path: this.redirect || "/"}).catch(() => {
// }); // });
this.$router.push({path: routeData.route || this.redirect || "/",query:{}}).catch(() => { this.$router.push({path: routeData.route || this.redirect || "/"}).catch(() => {
}); });
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
@ -226,8 +228,8 @@ export default {
}, },
changeProcess(processId){ changeProcess(processId) {
let process = this.options.find(v=>v.processId === processId) let process = this.options.find(v => v.processId === processId)
this.loginForm.processFloor = process.processFloor; this.loginForm.processFloor = process.processFloor;
} }
} }

Loading…
Cancel
Save