123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <template>
- <div class='deviceStatus' v-if="info">
- <div class='c-t-center ptb30 c-f20 c-333 c-border-b bgc-fff'>
- <span>当前设备状态:</span><span class='c-17b3ec'>{{info.networkStatus==1? '在线' : '离线'}}</span>
- </div>
- <div class='mt30 plr15'>
- <van-button style='width:100%' class='c-border-r-5' type="info" @click="findById">刷新设备状态</van-button>
- </div>
- </div>
- </template>
- <script>
- import medicineAbinetApi from '@/api/api-medicineAbinet'
- export default{
- name: 'deviceStatus',
- data(){
- return {
- id: this.$route.query.id,
- info: ''
- }
- },
- created(){
- this.findById()
- },
- methods:{
- findById(){
- this.$loading('加载中..')
- let p = {
- deviceId: this.id
- }
- medicineAbinetApi
- .findDeviceById(p)
- .then(res=>{
- this.$toast.clear()
- this.info = res.obj.device
- })
- .catch(err=>{
- console.error(err)
- })
- }
- },
-
- }
- </script>
- <style scoped lang='scss'>
- .deviceStatus{
- }
- </style>
|