|
@ -1,34 +1,97 @@
|
|
<template>
|
|
<template>
|
|
<div class='deviceReboot'>
|
|
<div class='deviceReboot'>
|
|
<div class='c-333 c-f14 p15 bgc-fff c-border-b'>
|
|
|
|
<div>设置重连时间</div>
|
|
|
|
<van-field class='mt10 c-border' v-model="time" placeholder="请输入重连时间" />
|
|
|
|
</div>
|
|
|
|
<div class='mt30 plr15'>
|
|
|
|
<van-button style='width:100%' class='c-border-r-5' type="info" @click="reboot">立即重启</van-button>
|
|
|
|
|
|
<div class="plr16 ptb16">
|
|
|
|
<van-button block class='c-border-r-5' type="info" @click="toggleDebug('openDebug')">开启调试</van-button>
|
|
|
|
<van-button block class='c-border-r-5' type="info" @click="toggleDebug('closeDebug')">关闭调试</van-button>
|
|
|
|
<van-button block class='c-border-r-5' type="danger" @click="systemUpdate()">设备程序更新</van-button>
|
|
|
|
<van-button block class='c-border-r-5' type="danger" @click="exeUpdate()">更新药柜程序</van-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
export default{
|
|
export default{
|
|
name: 'deviceReboot',
|
|
name: 'deviceReboot',
|
|
data(){
|
|
data(){
|
|
return {
|
|
return {
|
|
time: '',
|
|
|
|
|
|
equNum: this.$route.query.equNum,
|
|
|
|
equName: this.$route.query.equName,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
reboot(){
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
toggleDebug(event){
|
|
|
|
var p = {
|
|
|
|
equNum: this.equNum,
|
|
|
|
type: event,
|
|
|
|
mess: '开启关闭debugger'
|
|
|
|
}
|
|
|
|
medicineAbinetApi
|
|
|
|
.systemUpdate(p)
|
|
|
|
.then(res => {
|
|
|
|
this.$toast('操作成功')
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
systemUpdate(){
|
|
|
|
var { equName, equNum } = this
|
|
|
|
var message = `确认更新${equName}设备?`
|
|
|
|
|
|
|
|
this.$dialog.confirm({
|
|
|
|
title: '',
|
|
|
|
message,
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
this.$loading('')
|
|
|
|
var p = {
|
|
|
|
equNum,
|
|
|
|
type: 'systemUpdate',
|
|
|
|
mess: 'web程序更新'
|
|
|
|
}
|
|
|
|
medicineAbinetApi
|
|
|
|
.systemUpdate(p)
|
|
|
|
.then(res => {
|
|
|
|
this.$toast('操作成功')
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
exeUpdate(){
|
|
|
|
var { equName, equNum } = this
|
|
|
|
var message = `确认更新${equName}药柜程序?`
|
|
|
|
|
|
|
|
this.$dialog.confirm({
|
|
|
|
title: '',
|
|
|
|
message,
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
var p = {
|
|
|
|
equNum,
|
|
|
|
type: 'exeUpdate',
|
|
|
|
mess: 'exe程序更新'
|
|
|
|
}
|
|
|
|
medicineAbinetApi
|
|
|
|
.systemUpdate(p)
|
|
|
|
.then(res => {
|
|
|
|
this.$toast('操作成功')
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
},
|
|
},
|
|
created(){
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style scoped lang='scss'>
|
|
<style scoped lang='scss'>
|
|
.deviceReboot{
|
|
.deviceReboot{
|
|
|
|
|
|
|
|
.van-button{
|
|
|
|
&+.van-button{
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|