| | |
| | | import { userInfoStore } from '@/stores/userInfo' |
| | | import { sockteStore } from '@/stores/sockteInfo' |
| | | import { ipcRenderer } from 'electron' |
| | | import { reactive,computed, toRefs } from "vue" |
| | | import { reactive,computed, toRefs,onMounted ,ref} from "vue" |
| | | import{sendPationCode} from '../../samples/sockteStomp' |
| | | import {formatDate} from '@/utils/formatTime' |
| | | import { popper } from '@popperjs/core' |
| | | export default { |
| | | setup() { |
| | | const user = userInfoStore() |
| | | const sockte= sockteStore() |
| | | const inputRef=ref() |
| | | const isLink= computed(()=>{ |
| | | return sockte.isLink |
| | | return !sockte.isLink |
| | | }) |
| | | const netLink= computed(()=>{ |
| | | return sockte.netLink |
| | | return !sockte.netLink |
| | | }) |
| | | const weightInfo= computed(()=>{ |
| | | return sockte.weightSockte |
| | | }) |
| | | const state=reactive({ |
| | | dialogVisible:false, |
| | | isActive:false, |
| | | inputCode:"", |
| | | Newdate:"" |
| | | }) |
| | | const ubtCilert=()=>{ |
| | | console.log('ss') |
| | | // console.log(user.userInfo) |
| | | // console.log(sockteStore().isLink) |
| | | // ipcRenderer.send('main-process-message2', { 'param1': "hello" }); |
| | | // console.log(window.myApi.fun('陈银城')) |
| | | const inputChabge=()=>{ |
| | | sendPationCode(state.inputCode) |
| | | } |
| | | return{ ...toRefs(state), ubtCilert,isLink,netLink |
| | | onMounted(() => { |
| | | console.log('Component is mounted!') |
| | | inputRef.value.focus(); |
| | | console.log(inputRef) |
| | | setTimeout(function(){ |
| | | // state.inputCode="3434" |
| | | console.log('-----------sdsds') |
| | | inputRef.value.focus(); |
| | | },10000) |
| | | setInterval(function(){ |
| | | state.Newdate=formatDate(new Date(),"YYYY-mm-dd HH:MM:SS") |
| | | console.log(state.Newdate,'----ss') |
| | | },1000) |
| | | }) |
| | | return{ ...toRefs(state),isLink,netLink,weightInfo,inputRef,inputChabge |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <template> |
| | | <div class="home"> |
| | | <!-- <el-button @click="ubtCilert"> |
| | | test |
| | | </el-button> --> |
| | | <el-dialog |
| | | title="提示" |
| | | v-model="netLink" |
| | | width="30%"> |
| | | <span>无法链接到网络!</span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="提示" |
| | | v-model="isLink" |
| | | width="30%"> |
| | | <span>sockte连接失败正在重连。。。。。。</span> |
| | | </el-dialog> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <div class="tale"> |
| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div> sockte连接状态{{isLink}}</div> |
| | | <div> 网络连接状态{{netLink}}</div> |
| | | <!-- <div> sockte连接状态{{isLink}}</div> |
| | | <div> 网络连接状态{{netLink}}</div> --> |
| | | <el-input id="inputCode" @change="inputChabge" v-model="inputCode" ref="inputRef" placeholder="" /> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="grid-container"> |
| | |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">当前时间:</div> |
| | | <div class="conText">2022-06-21 14:10</div> |
| | | <div class="conText">{{Newdate}}</div> |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">当前时间:</div> |
| | | <div class="conText">2022-06-21 14:10</div> |
| | | <div class="lableText">透析号:</div> |
| | | <div class="conText">123456</div> |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">机号:</div> |
| | |
| | | <div class="conText">88</div> |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">透前称重(kg):</div> |
| | | <div class="conText">90</div> |
| | | <div> |
| | | <div class="lableText" v-if="weightInfo.state===2">透前称重(kg):</div> |
| | | <div class="lableText" v-if="weightInfo.state===1" style="color:red">体重秤通讯服务正常运行但未联通设备</div> |
| | | <div class="lableText" v-if="weightInfo.state===0" style="color:red">体重秤通讯服务不正常 </div> |
| | | <div class="conText">{{weightInfo.result}}</div> |
| | | </div> |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">目标脱水量:</div> |
| | |
| | | margin-top: 15pt; |
| | | color: #769aff; |
| | | } |
| | | .active{ |
| | | background: #c1c2c6; |
| | | color: black; |
| | | } |
| | | </style> |