This commit is contained in:
2023-10-24 14:24:46 +08:00
parent 74f12153c8
commit aa376609f9
3 changed files with 26 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
import axios from 'axios' import axios from 'axios'
import { Dialog, toast } from './mUtils.js' import { Dialog } from './mUtils.js'
import store from '../../vuex/store' import store from '../../vuex/store'
import router from '@/router' // import router from '@/router'
axios.defaults.timeout = 50000 axios.defaults.timeout = 50000
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
@@ -33,13 +33,13 @@ axios.interceptors.response.use(
}, },
error => { error => {
if (error && error.response) { if (error && error.response) {
switch (error.response.status) { // switch (error.response.status) {
case 401: // case 401:
toast(error.response.data.message) // toast(error.response.data.message)
store.dispatch('setSignOut') // store.dispatch('setSignOut')
router.push('/login') // router.push('/setup')
break // break
} // }
return Promise.reject(error.response.data) return Promise.reject(error.response.data)
} else { } else {
return Promise.reject(error) return Promise.reject(error)

View File

@@ -219,10 +219,8 @@
<div class="p_device cpj_ssx_wrap"> <div class="p_device cpj_ssx_wrap">
<div class="ssx_wrap"> <div class="ssx_wrap">
<div class="ssx" v-for="(e, i) in vconveyorLine" :key="i"> <div class="ssx" v-for="(e, i) in vconveyorLine" :key="i">
<img v-show="e.status === 1" class="device_img" src="../assets/images/device/ssx_green.png" alt="" @click="getInfo(e)"> <img v-show="e.status === 2" class="device_img" src="../assets/images/device/ssx_green.png" alt="" @click="getInfo(e)">
<img v-show="e.status === 2" class="device_img" src="../assets/images/device/ssx_yellow.png" alt="" @click="getInfo(e)"> <img v-show="e.status !== 2" class="device_img" src="../assets/images/device/ssx_gray.png" alt="" @click="getInfo(e)">
<img v-show="e.status === 3" class="device_img" src="../assets/images/device/ssx_gray.png" alt="" @click="getInfo(e)">
<img v-show="e.status === 4" class="device_img" src="../assets/images/device/ssx_red.png" alt="" @click="getInfo(e)">
<device-pop <device-pop
type="ssx" type="ssx"
:pkId="pkId" :pkId="pkId"
@@ -676,6 +674,8 @@ export default {
}, },
data () { data () {
return { return {
interTime: this.$store.getters.setTime,
timer3: null,
mixingMachine: [], mixingMachine: [],
unloadLocation: [], unloadLocation: [],
storageLocation: [], storageLocation: [],
@@ -698,9 +698,21 @@ export default {
} }
}, },
created () { created () {
this._homepageEquipment() clearInterval(this.timer3)
this.refresh()
},
beforeDestroy () {
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer3)
})
}, },
methods: { methods: {
refresh () {
this._homepageEquipment()
this.timer3 = setInterval(() => {
this._homepageEquipment()
}, this.interTime)
},
async _homepageEquipment () { async _homepageEquipment () {
let res = await homepageEquipment() let res = await homepageEquipment()
// 混料机 // 混料机

View File

@@ -243,7 +243,6 @@ export default {
}, },
data () { data () {
return { return {
iTime: this.$store.getters.setTime1,
interTime: this.$store.getters.setTime, interTime: this.$store.getters.setTime,
timer1: null, timer1: null,
timer2: null, timer2: null,