修改跳转参数

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

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

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

Loading…
Cancel
Save