From d79ce11fcd47db138764557d214f4ea2169fb90a Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期五, 20 六月 2025 18:05:38 +0800
Subject: [PATCH] 维护

---
 src/views/ecg/callingscreen/bigscreen.vue |  464 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 353 insertions(+), 111 deletions(-)

diff --git a/src/views/ecg/callingscreen/bigscreen.vue b/src/views/ecg/callingscreen/bigscreen.vue
index 98b4cab..d31a8dc 100644
--- a/src/views/ecg/callingscreen/bigscreen.vue
+++ b/src/views/ecg/callingscreen/bigscreen.vue
@@ -1,140 +1,382 @@
 <script setup lang="ts">
-
+import {ScreenApi, ScreenQueueVO} from "@/api/ecg/screen";
+import {CallApi, CallVO} from "@/api/ecg/call";
+import {queueStatusConvert} from "@/utils/statusFormatter";
+import {useCheckTypeStore} from "@/store/modules/checkType";
+import {getCheckTypeSeqPrefix} from "../../../utils/checkTypeFormatter";
+import { computed } from 'vue'
 defineOptions({ name: 'bigscreen' })
 
-  const tableData = [{
-      date: '2016-05-02',
-      name: '鐜嬪皬铏�',
-      address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�'
-    }, {
-      date: '2016-05-04',
-      name: '鐜嬪皬铏�',
-      address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�'
-    }, {
-      date: '2016-05-01',
-      name: '鐜嬪皬铏�',
-      address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�'
-    }, {
-      date: '2016-05-03',
-      name: '鐜嬪皬铏�',
-      address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�'
-    }]
+const runningIndicator = ref<number>(0)
+const checkTypeStore = useCheckTypeStore()
+const displayColInfo = ref<Map<number, String[]>>(new Map())
+const mapColumnVsPatients = ref<Map<number, ScreenQueueVO[]>>(new Map());
+let curSpeakPat : CallVO | null = null;
 
-  const names = ["Alice", "Bob", "Charlie", "David", "Eve", "Frank", "Grace",
-    "鐗规湕鏅�", "椹崱榫�", "鏅噾", "绌嗚开鑰佷粰", "鎷滅櫥", "鍗$壒"]
-  const visibleCount = 5 // 鍙悓鏃舵樉绀虹殑鍚嶅瓧鏁伴噺
-  const startIndex = ref<number>(0);
+const getDisplayColInfo = async () => {
+  const data = await ScreenApi.getDisplayColInfo()
+  displayColInfo.value = data
+}
 
-  const visibleNames : string[] =  computed(() => {
-    const endIndex = (startIndex.value + visibleCount) % names.length;
-    if (endIndex > startIndex.value) {
-      return names.slice(startIndex.value, endIndex);
+const getList = async () => {
+  const data = await ScreenApi.getBigScreenData()
+  mapColumnVsPatients.value = data;
+}
+
+const startScrolling = () => {
+  setInterval(() => {
+    runningIndicator.value++;
+    getList();
+    if ( curSpeakPat == null ) {
+      initiateSpeak()
+    }
+  }, 5000);
+}
+
+onMounted( () => {
+  getDisplayColInfo()
+  startScrolling()
+})
+
+const onSpeachEndEvent = async (event) => {
+  console.log("Speech ended... " + event.currentTarget.text);
+  curSpeakPat!.called = 1
+  await CallApi.updateCall(curSpeakPat!)
+  initiateSpeak()
+}
+
+const initiateSpeak = async () => {
+  curSpeakPat = await CallApi.getNextCall()
+  if (curSpeakPat != null && curSpeakPat.called === 0) {
+    speak("璇枫��" + curSpeakPat.patName + "鍒�" + curSpeakPat.roomName + "灏辫瘖");
+  }
+}
+const splitPatientColumns = computed(() => {
+  const result = new Map<number, ScreenQueueVO[][]>();
+  
+  for (const [colId, patients] of mapColumnVsPatients.value.entries()) {
+    if (colId === 0 && patients.length > 10) {
+      // 绗竴鍒椾笖鏁版嵁瓒呰繃10鏉★紝鍒嗘垚涓ゅ垪
+      const firstCol = patients.slice(0, 10);
+      const secondCol = patients.slice(10);
+      result.set(colId, [firstCol, secondCol]);
     } else {
-      return [...names.slice(startIndex.value), ...names.slice(0, endIndex)];
-    }
-  })
-
-  const startScrolling = () => {
-    setInterval(() => {
-      // console.info("...")
-      startIndex.value = (startIndex.value + visibleCount) % names.length;
-    }, 3000); // 姣忎袱绉掓粴鍔ㄤ竴娆�
-  }
-
-  onMounted( () => {
-    startScrolling()
-  })
-
-  const speak = (msg) => {
-    //const msg = new SpeechSynthesisUtterance(`璇�${this.currentNumber}鍙峰氨璇奰);
-    const repeatNum = 3
-    var speech = new SpeechSynthesisUtterance()
-    speech.text = msg
-    speech.pitch = 1 // 鑾峰彇骞惰缃瘽璇殑闊宠皟(0-2 榛樿1锛屽�艰秺澶ц秺灏栭攼,瓒婁綆瓒婁綆娌�)
-    speech.rate = 0.9 // 鑾峰彇骞惰缃璇濈殑閫熷害(0.1-10 榛樿1锛屽�艰秺澶ц閫熻秺蹇�,瓒婂皬璇�熻秺鎱�)
-    speech.volume = 100 // 鑾峰彇骞惰缃璇濈殑闊抽噺
-    speech.lang = 'zh-CN' // 璁剧疆鎾斁璇█
-    // 澧炲姞鎺у埗鎾斁娆℃暟
-    let count = 1
-    speechSynthesis.speak(speech)
-    while (count < repeatNum) {
-      speechSynthesis.speak(speech)
-      count++
+      // 鍏朵粬鍒椾繚鎸佸師鏍�
+      result.set(colId, [patients]);
     }
   }
+  
+  return result;
+});
+const speak = (msg) => {
+  console.info("speak " + msg);
+  var speech = new SpeechSynthesisUtterance()
+  speech.text = msg + "銆傘�傘��" + msg + "銆傘�傘��" + msg  + "銆傘�傘��"
+  speech.pitch = 1
+  speech.rate = 0.9
+  speech.volume = 100
+  speech.lang = 'zh-CN'
+  speech.onend = onSpeachEndEvent
+  speechSynthesis.speak(speech)
+}
 
+const nameDesensitize = (patName) => {
+  if (patName.length == 2) {
+    return patName.substring(0, 1) + '*';
+  } else if (patName.length == 3) {
+    return patName.substring(0, 1) + '*' + patName.substring(2, 3);
+  } else if (patName.length > 3) {
+    return patName.substring(0, 1) + '*' + '*' + patName.substring(3, patName.length);
+  }
+}
+
+const getItemCssClass = (item: ScreenQueueVO) => {
+  if (item.status === 5 || item.status === 7) {
+    return "warning-row";
+  }
+  return "";
+}
 </script>
 
 <template>
-  <el-container>
-    <el-header>Header</el-header>
-    <el-container>
-      <el-aside width="500px">
-        <el-table
-            :data="tableData"
-            stripe
-            :show-header="false"
-            style="width: 100%">
-          <el-table-column
-              prop="date"
-              label="鏃ユ湡"
-              width="180"/>
-          <el-table-column
-              prop="name"
-              label="濮撳悕"
-              width="180"/>
-          <el-table-column
-              prop="address"
-              label="鍦板潃"/>
-        </el-table>
-      </el-aside>
-      <el-container>
-        <el-main>
-          <div class="name-scroller">
-            <div class="name-box">
-              <span v-for="(name, index) in visibleNames" :key="index">{{ name }}</span>
-            </div>
+  <div class="bigscreen-container">
+    <!-- 椤堕儴鍖婚櫌鏍囬 -->
+    <div class="hospital-header">
+      <img height="40px" src="@/assets/imgs/jinhua.png"/>
+      <span>閲戝崕浜烘皯鍖婚櫌</span>
+      <div class="running-indicator" :style="{ backgroundColor: runningIndicator%2 === 0 ? '#67c23a' : '#e6a23c' }"></div>
+    </div>
+    
+    <!-- 鍒楁爣棰樺尯鍩� -->
+    <div class="column-header">
+      <template v-for="([disColId, disNameList], index) of Object.entries(displayColInfo)" :key="disColId">
+        <div 
+          class="column-title"
+          :class="{ 'double-column': index === 0 }"
+        >
+          <div v-for="(dispName, dispName_index) in disNameList" :key="dispName_index">
+            {{dispName}}
           </div>
-        </el-main>
-        <el-footer>Footer</el-footer>
-      </el-container>
-    </el-container>
-    <el-button @click="speak('璇� 鐗规湕鏅� 鍒颁簩鍙疯瘖瀹� 灏辫瘖')" >鍙彿</el-button>
-  </el-container>
+        </div>
+      </template>
+    </div>
+    
+    <!-- 鎮h�呭垪琛ㄥ尯鍩� -->
+    <div class="patient-list-container">
+  <template v-for="([disColId2, columnPatientList], index) of Object.entries(mapColumnVsPatients)" :key="disColId2">
+    <!-- 绗竴鍒椾笖鏁版嵁瓒呰繃10鏉℃椂锛屽垎鎴愪袱鍒� -->
+    <template v-if="index === 0 && columnPatientList.length > 13">
+      <!-- 绗竴鍒�(鍓�10鏉�) -->
+      <div class="patient-column">
+        <div 
+          v-for="(item, itemIndex) in columnPatientList.slice(0, 13)" 
+          :key="itemIndex" 
+          :class="getItemCssClass(item)"
+          class="patient-item"
+        >
+          <span class="patient-number">{{getCheckTypeSeqPrefix(item.bookCheckType)}}{{item.bookSeqNum}}</span>
+          <span class="patient-name">{{ nameDesensitize(item.patName) }}</span>
+          <span class="patient-status">{{queueStatusConvert(item.status)}}</span>
+          <span class="patient-room">{{item.roomName}} {{item.bedNo}}</span>
+        </div>
+      </div>
+      
+      <!-- 绗簩鍒�(鍓╀綑鏁版嵁) -->
+      <div class="patient-column continuation-column">
+        <div 
+          v-for="(item, itemIndex) in columnPatientList.slice(13)" 
+          :key="itemIndex + 10" 
+          :class="getItemCssClass(item)"
+          class="patient-item"
+        >
+          <span class="patient-number">{{getCheckTypeSeqPrefix(item.bookCheckType)}}{{item.bookSeqNum}}</span>
+          <span class="patient-name">{{ nameDesensitize(item.patName) }}</span>
+          <span class="patient-status">{{queueStatusConvert(item.status)}}</span>
+          <span class="patient-room">{{item.roomName}} {{item.bedNo}}</span>
+        </div>
+      </div>
+    </template>
+    
+    <!-- 鍏朵粬鎯呭喌姝e父鏄剧ず -->
+    <template v-else>
+      <div 
+        class="patient-column"
+        :class="{ 'double-column': index === 0 }"
+      >
+        <div 
+          v-for="(item, itemIndex) in columnPatientList" 
+          :key="itemIndex" 
+          :class="getItemCssClass(item)"
+          class="patient-item"
+        >
+          <span class="patient-number">{{getCheckTypeSeqPrefix(item.bookCheckType)}}{{item.bookSeqNum}}</span>
+          <span class="patient-name">{{ nameDesensitize(item.patName) }}</span>
+          <span class="patient-status">{{queueStatusConvert(item.status)}}</span>
+          <span class="patient-room">{{item.roomName}} {{item.bedNo}}</span>
+        </div>
+      </div>
+    </template>
+  </template>
+</div>
+  </div>
 </template>
 
 <style scoped lang="scss">
-.el-header, .el-footer {
-  background-color: #B3C0D1;
-  color: #333;
+/* 淇濇寔鍘熸湁鐨勫熀纭�鏍峰紡涓嶅彉 */
+.bigscreen-container {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  background: linear-gradient(135deg, #e6f0f8, #d9e4f0);
+  color: #4a5568;
+  padding: 8px;
+}
+
+.hospital-header {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: rgba(255, 255, 255, 0.9);
+  border-radius: 12px;
+  padding: 12px;
+  margin-bottom: 8px;
+  font-size: 22px;
+  font-weight: bold;
+  color: #4a7dff;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+  
+  img {
+    margin-right: 8px;
+  }
+}
+
+.running-indicator {
+  width: 12px;
+  height: 12px;
+  border-radius: 50%;
+  margin-left: 12px;
+  transition: background-color 0.3s;
+}
+
+/* 淇敼鍒楁爣棰樺尯鍩� */
+.column-header {
+  display: flex;
+  justify-content: space-around;
+  align-items: flex-start;
+  background: rgba(255, 255, 255, 0.9);
+  border-radius: 12px;
+  padding: 12px 0;
+  margin-bottom: 8px;
+  font-size: 20px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.column-title {
+  flex: 1;
+  min-width: 300px;
   text-align: center;
-  line-height: 60px;
+  padding: 0 12px;
+  border-left: 1px solid rgba(91, 140, 255, 0.2);
+  
+  &:first-child {
+    border-left: none;
+  }
+  
+  &.double-column {
+    flex: 2; /* 鍗犳嵁涓ゅ�嶅搴� */
+    min-width: 600px;
+  }
 }
 
-.el-aside {
-  background-color: #D3DCE6;
-  color: #333;
-  text-align: center;
-  line-height: 200px;
+/* 淇敼鎮h�呭垪琛ㄥ尯鍩� */
+.patient-list-container {
+  display: flex;
+  justify-content: space-around;
+  align-items: flex-start;
+  flex-grow: 1;
+  background: rgba(255, 255, 255, 0.9);
+  border-radius: 12px;
+  padding: 12px 0;
+  margin-bottom: 8px;
+  font-size: 18px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+  overflow-y: auto;
 }
 
-.el-main {
-  background-color: #E9EEF3;
-  color: #333;
-  text-align: center;
-  line-height: 160px;
+.patient-column {
+  flex: 1;
+  min-width: 300px;
+  padding: 0 12px;
+  border-left: 1px solid rgba(91, 140, 255, 0.2);
+  
+  &:first-child {
+    border-left: none;
+  }
+  
+  &.double-column {
+    flex: 2; /* 鍗犳嵁涓ゅ�嶅搴� */
+    min-width: 600px;
+    display: flex;
+    flex-wrap: wrap;
+    
+    .patient-item {
+      width: 48%; /* 涓ゅ垪甯冨眬锛岀暀涓�鐐归棿璺� */
+      margin-right: 2%;
+      
+      &:nth-child(2n) {
+        margin-right: 0;
+      }
+    }
+  }
+  
+
 }
 
-body > .el-container {
-  margin-bottom: 40px;
+/* 淇濇寔鍘熸湁鐨勬偅鑰呴」鏍峰紡 */
+.patient-item {
+  padding: 10px 8px;
+  margin-bottom: 8px;
+  border-radius: 8px;
+  transition: all 0.3s;
+  
+  &:hover {
+    background: rgba(91, 140, 255, 0.1);
+  }
+  
+  span {
+    display: inline-block;
+    margin-right: 10px;
+  }
 }
 
-.el-container:nth-child(5) .el-aside,
-.el-container:nth-child(6) .el-aside {
-  line-height: 260px;
+.patient-number {
+  width: 80px;
+  color: #5b8cff;
+  font-weight: bold;
 }
 
-.el-container:nth-child(7) .el-aside {
-  line-height: 320px;
+.patient-name {
+  width: 100px;
+}
+
+.patient-status {
+  width: 100px;
+  color: #67c23a;
+}
+
+.patient-room {
+  color: #666;
+}
+
+.warning-row {
+  background-color: rgba(230, 162, 60, 0.1);
+  color: #e6a23c;
+}
+
+
+.footer-controls {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background: rgba(255, 255, 255, 0.9);
+  border-radius: 12px;
+  padding: 12px;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+}
+
+.welcome-btn {
+  background: rgba(91, 140, 255, 0.1);
+  color: #4a7dff;
+  border: none;
+  border-radius: 8px;
+  padding: 10px 20px;
+  font-size: 16px;
+  
+  &:hover {
+    background: rgba(91, 140, 255, 0.2);
+  }
+  
+  &:active {
+    transform: scale(0.98);
+  }
+}
+
+/* 婊氬姩鏉℃牱寮� */
+.patient-list-container::-webkit-scrollbar {
+  width: 6px;
+}
+
+.patient-list-container::-webkit-scrollbar-track {
+  background: rgba(0, 0, 0, 0.05);
+  border-radius: 4px;
+}
+
+.patient-list-container::-webkit-scrollbar-thumb {
+  background: rgba(91, 140, 255, 0.4);
+  border-radius: 4px;
+}
+
+.patient-list-container::-webkit-scrollbar-thumb:hover {
+  background: rgba(91, 140, 255, 0.6);
 }
 </style>

--
Gitblit v1.9.3