From 94f16f6a5770c10fce8267e9e851dfc35d8dfbc2 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 26 八月 2022 15:42:47 +0800
Subject: [PATCH] 新增读卡器功能

---
 /dev/null                  |   64 --------------------------------
 src/views/home/index.vue   |   15 +++++++
 src/samples/sockteStomp.ts |    2 +
 electron/main/index.ts     |    2 
 src/stores/sockteInfo.ts   |    4 +-
 5 files changed, 19 insertions(+), 68 deletions(-)

diff --git a/electron/main/index.ts b/electron/main/index.ts
index bed1464..ee10384 100644
--- a/electron/main/index.ts
+++ b/electron/main/index.ts
@@ -37,7 +37,7 @@
   win = new BrowserWindow({
     title: 'Main window',
     fullscreen: true,
-    autoHideMenuBar:true, 
+    // autoHideMenuBar:true, 
     webPreferences: {
       preload: splash,
       nodeIntegration: true,
diff --git a/src/samples/sockteStomp.ts b/src/samples/sockteStomp.ts
index 53fe14b..90db1c3 100644
--- a/src/samples/sockteStomp.ts
+++ b/src/samples/sockteStomp.ts
@@ -30,9 +30,11 @@
             return de.deviceName===resultInfo.deviceNumber
         })
         console.log(deviceInfo,'更具设备number查找到的设备')
+        console.log(resultInfo)
         if(deviceInfo!==undefined){
             switch(deviceInfo.deviceType){
                 case '读卡器':
+                    console.log('读卡器收到消息')
                     sockteStore().setdkqSockte(
                         {
                             deviceName:resultInfo.deviceNumber,
diff --git a/src/stores/meun.ts b/src/stores/meun.ts
deleted file mode 100644
index 8f55c0b..0000000
--- a/src/stores/meun.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { defineStore } from 'pinia'
-import { ref } from 'vue'
-import { Session } from '@/utils/storage'
-
-export const meunStore =defineStore('meun',()=>{
-    const meunIndex=ref(0)// 初始值
-    const meunPath=ref('/scheme')
-    const meuns=ref([
-        {
-            'value': 0,
-            'text': '透析处方',
-            'path': '/scheme'
-        },
-        {
-            'value': 1,
-            'text': '透前评估',
-            'path': '/pingguBefore'
-        },
-        {
-            'value': 2,
-            'text': '双人核对',
-            'path': '/douleCheck'
-        },
-        {
-            'value': 3,
-            'text': '监测记录',
-            'path': '/monitorData'
-        },
-        {
-            'value': 4,
-            'text': '耗材出库',
-            'path': '/checkOut'
-        },
-        {
-            'value': 5,
-            'text': '医嘱信息',
-            'path': '/drugOrder'
-        },
-        {
-            'value': 6,
-            'text': '透后评估',
-            'path': '/bodyStateAfter'
-        },
-        {
-            'value': 7,
-            'text': '治疗小结',
-            'path': '/zlxj'
-        },
-        {
-            'value': 8,
-            'text': '患者信息',
-            'path': '/patientInfo'
-        }
-    ])
-    function setMeunIndex(index:number){
-        console.log('设置菜单下标'+index)
-        meunIndex.value=index
-        meunPath.value=meuns.value[index].path
-    }
-    function setMeuns(Meuns:any){
-        meuns.value=Meuns
-    }
-    return {meunIndex,meunPath,setMeunIndex,setMeuns,meuns}
-})
\ No newline at end of file
diff --git a/src/stores/sockteInfo.ts b/src/stores/sockteInfo.ts
index e6d68bf..b2babab 100644
--- a/src/stores/sockteInfo.ts
+++ b/src/stores/sockteInfo.ts
@@ -77,8 +77,8 @@
         xyjSockte.value.state=state
     }
       /**
-     * 更新血压计结果
-     * @param info 体重结果
+     * 更新读卡器结果
+     * @param info 读卡器结果
      */
     function setdkqSockte(info:info){
         dkqSockte.value.deviceName=info.deviceName
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 6b21551..a612b9a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -34,6 +34,9 @@
         const xyjInfo = computed(() => {
             return sockte.xyjSockte
         })
+        const dkqInfo = computed(() => {
+            return sockte.dkqSockte
+        })
         const patientInfo = computed(() => {
             return patientInfoStore().patientInfo
         })
@@ -193,6 +196,17 @@
                 }
             }
         )
+        watch(
+            () => dkqInfo.value.resultTime,
+            () => {
+              console.log(dkqInfo.value,'读卡器')
+                if (dkqInfo.value.result !== ''&&dkqInfo.value.result !== undefined) {
+                  const code=dkqInfo.value.result.split(",")[0]
+                  console.log('获取读卡器的code',code)
+                  sendPationCode(code)
+                }
+            }
+        )
         watch(() => viewNumber,
             () => {
                 state.clockNum = viewNumber.value
@@ -252,7 +266,6 @@
               class="inputCode"
               @change="inputChabge"
               placeholder="请输入患者卡号或扫描条码"
-              :prefix-icon="Search"
             />
         <span class="text_1">自助签到</span> <span class="text_2">{{clockNum}}</span>
       </div>

--
Gitblit v1.8.0