45
chenyc
2022-07-20 88b74f25d221cfd05878341bdce5b151de37be59
45
3个文件已修改
34 ■■■■■ 已修改文件
src/samples/sockteStomp.ts 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/patient.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/sockteStomp.ts
@@ -107,14 +107,18 @@
}
const writePatient=(resultInfo:any)=>{
    // 给一个时间变化
    const da=new Date().toTimeString()
    console.log(da)
    const info={
        id:resultInfo.patientInfo===null?0:resultInfo.patientInfo.id,
        code:resultInfo.patientInfo===null?'':resultInfo.patientInfo.code,
        name:resultInfo.patientInfo===null?0:resultInfo.patientInfo.patientName,
        patientAvatarIcon:resultInfo.patientInfo===null?0:resultInfo.patientInfo.patientAvatarIcon,
        name:resultInfo.patientInfo===null?'':resultInfo.patientInfo.patientName,
        patientAvatarIcon:resultInfo.patientInfo===null?'':resultInfo.patientInfo.patientAvatarIcon,
        deviceCode:resultInfo.deviceCode===null?"":resultInfo.deviceCode,
        hemoCode:resultInfo.hemoCode===null?"":resultInfo.hemoCode,
        pureWeight:resultInfo.pureWeight===null?"":resultInfo.pureWeight
        pureWeight:resultInfo.pureWeight===null?"":resultInfo.pureWeight,
        datetime:da
    }
    // 写入vuex里
    patientInfoStore().setpatientInfo(info)
src/stores/patient.ts
@@ -10,7 +10,8 @@
            patientAvatarIcon:'',
            deviceCode:'',
            hemoCode:'',
            pureWeight:''
            pureWeight:'',
            datetime:'',
       })// 初始值
    const viewNumber=ref(60)
src/views/home/index.vue
@@ -21,6 +21,7 @@
        const AudioRef = ref()
        const AudioRef2 = ref()
        const AudioRef3 = ref()
        const AudioRef4=ref()
        const isLink = computed(() => {
            return !sockte.isLink
        })
@@ -103,9 +104,8 @@
            mai_bu: ""//脉搏
        })
        watch(
            () => patientInfo.value.id,
            () => patientInfo.value.datetime,
            () => {
                console.log('患者变化了', patientInfo)
                if (patientInfo.value.id !== 0) {
                    AudioRef.value.play();
                    sockteStore().setweightSockte({
@@ -124,6 +124,11 @@
                    })
                    settime()
                }else{
                  if(patientInfo.value.name===''){
                    AudioRef4.value.play();
                  }
                }
            }
        )
@@ -209,7 +214,7 @@
            }, 1000)
        })
        return {
            ...toRefs(state), isLink, netLink, weightInfo, patientInfo, xyjInfo, inputRef, AudioRef0, AudioRef, AudioRef2, AudioRef3, inputChabge
            ...toRefs(state), isLink, netLink, weightInfo, patientInfo, xyjInfo, inputRef, AudioRef0, AudioRef, AudioRef4, AudioRef2, AudioRef3, inputChabge
        }
    }
}
@@ -217,13 +222,15 @@
<template>
    <div class="page flex-col">
         <!-- 提醒刷卡 -->
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step1.mp3" ref="AudioRef0" id="eventAudio"></audio>
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step1.mp3" ref="AudioRef0" id="eventAudio2"></audio>
        <!-- 患者信息读取成功 -->
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step2.mp3" ref="AudioRef" id="eventAudio"></audio>
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step2.mp3" ref="AudioRef" id="eventAudio2"></audio>
        <!-- 体重结果回传成功 -->
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step3.mp3" ref="AudioRef2" id="eventAudio"></audio>
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step3.mp3" ref="AudioRef2" id="eventAudio3"></audio>
        <!-- 血压结果回传成功 -->
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step4.mp3" ref="AudioRef3" id="eventAudio"></audio>
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step4.mp3" ref="AudioRef3" id="eventAudio4"></audio>
        <!-- 没有找到患者 -->
        <audio src="https://dhcdn.leon056.com/hemo/autoselfsign/step5.mp3" ref="AudioRef4" id="eventAudio5"></audio>
        <el-dialog title="提示" v-model="netLink" width="30%">
            <span>无法链接到网络!</span>
        </el-dialog>