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

View File

@@ -219,10 +219,8 @@
<div class="p_device cpj_ssx_wrap">
<div class="ssx_wrap">
<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_yellow.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)">
<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_gray.png" alt="" @click="getInfo(e)">
<device-pop
type="ssx"
:pkId="pkId"
@@ -676,6 +674,8 @@ export default {
},
data () {
return {
interTime: this.$store.getters.setTime,
timer3: null,
mixingMachine: [],
unloadLocation: [],
storageLocation: [],
@@ -698,9 +698,21 @@ export default {
}
},
created () {
this._homepageEquipment()
clearInterval(this.timer3)
this.refresh()
},
beforeDestroy () {
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer3)
})
},
methods: {
refresh () {
this._homepageEquipment()
this.timer3 = setInterval(() => {
this._homepageEquipment()
}, this.interTime)
},
async _homepageEquipment () {
let res = await homepageEquipment()
// 混料机

View File

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