From e25465c223a2e63422acfb58414597ca8fc4df09 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 13 十一月 2025 18:01:55 +0800
Subject: [PATCH] 排队异常、小屏适配问题
---
public/ConsultationRoom.html | 142 +++++++++++++++++++++++++++-------------------
1 files changed, 83 insertions(+), 59 deletions(-)
diff --git a/public/ConsultationRoom.html b/public/ConsultationRoom.html
index d01ec88..433072d 100644
--- a/public/ConsultationRoom.html
+++ b/public/ConsultationRoom.html
@@ -184,28 +184,31 @@
width: 80px;
font-weight: bold;
color: #5b8cff;
- font-size: 0.95rem;
+ font-size: 1.5rem;
+ font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
}
.patient-name {
width: 100px;
- font-size: 0.95rem;
+ font-size: 1.2rem;
+ font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
}
.patient-check-type {
flex: 1;
- font-size: 0.95rem;
+ font-size: 1.2rem;
+ font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
}
.patient-status {
width: 70px;
- font-size: 0.8rem;
+ font-size: 1.2rem;
font-weight: bold;
text-align: center;
padding: 3px 8px;
@@ -350,7 +353,7 @@
}
.clinic-info {
- font-size: 0.8rem;
+ font-size: 1.2rem;
}
.panel {
@@ -358,7 +361,8 @@
}
.panel-header {
- font-size: 0.9rem;
+ font-size: 1.6rem;
+ font-weight: 700;
padding: 6px 10px;
}
@@ -369,12 +373,12 @@
.patient-number,
.patient-name {
width: 60px;
- font-size: 0.9rem;
+ font-size: 1.2rem;
}
.patient-status {
width: 60px;
- font-size: 0.7rem;
+ font-size: 1.2rem;
}
.patient-bed {
@@ -400,22 +404,22 @@
<body>
<div id="app">
- <div class="search-bar">
+ <div class="search-bar" >
<input class="search-input" type="text" placeholder="璇疯緭鍏ユ埧闂村彿鏌ヨ" id="searchRoomInput">
<button class="search-btn" id="searchRoomBtn">鏌ヨ</button>
</div>
- <div class="header">
- <div class="clinic-title">蹇冪數鍥捐瘖闂村彨鍙风郴缁�</div>
- <div class="clinic-info">
+ <div class="header" >
+ <div class="clinic-title" id="titleroomName">蹇冪數鍥捐瘖闂村彨鍙风郴缁�</div>
+ <!-- <div class="clinic-info">
<div class="room-name" id="roomName">璇婇棿鍔犺浇涓�...</div>
<div class="screen-type" id="screenType">妯″紡锛氬姞杞戒腑...</div>
- </div>
+ </div> -->
</div>
<div class="main-content">
<div class="panel">
- <div class="panel-header">妫�鏌ラ槦鍒�</div>
+ <div class="panel-header">绛夊緟闃熷垪</div>
<div class="patient-list" id="checkPatientList">
<div class="empty-state">
鏆傛棤绛夊緟妫�鏌ョ殑鎮h��
@@ -424,7 +428,7 @@
</div>
</div>
- <div class="footer">
+ <div class="footer" style="display: none;">
<div class="announcement" id="announcementText">
绯荤粺杩愯涓�...
</div>
@@ -459,13 +463,19 @@
roomId: 1,
timer: null,
speechSynthesis: window.speechSynthesis || null,
- apiBaseUrl: 'http://10.0.2.193/admin-api'
- // apiBaseUrl: 'http://localhost:48080/admin-api'
+ // apiBaseUrl: 'http://10.0.2.193/admin-api'
+ apiBaseUrl: 'http://localhost:48080/admin-api'
};
// 椤甸潰鍔犺浇瀹屾垚鍚庡垵濮嬪寲
// 椤甸潰鍔犺浇瀹屾垚鍚庡垵濮嬪寲
document.addEventListener('DOMContentLoaded', function () {
+ // 浠嶶RL鑾峰彇roomId鍙傛暟
+ const urlParams = new URLSearchParams(window.location.search);
+ const roomId = urlParams.get('roomId') || '1'; // 榛樿鍊�1
+
+ // 璁剧疆鍒版悳绱㈡锛堝彲閫夛級
+ document.getElementById('searchRoomInput').value = roomId;
// 鍒濆鍖栦簨浠剁洃鍚�
document.getElementById('searchRoomBtn').addEventListener('click', searchRoom);
document.getElementById('callBtn').addEventListener('click', initiateSpeak);
@@ -475,7 +485,7 @@
document.getElementById('changeRoomBtn').addEventListener('click', changeRoom);
// 鍒濆鍖栨暟鎹�
- getRoomByIp();
+ getRoomByIp(roomId);
startScrolling();
// 鍒濆鍖栬闊冲悎鎴�
@@ -503,7 +513,7 @@
var response = JSON.parse(xhr.responseText);
appState.roomProfile = response.data || response;
updateRoomInfo();
- updateAnnouncement('宸插姞杞� ' + appState.roomProfile.roomName + ' 淇℃伅');
+ updatetitleroomName(appState.roomProfile[0].roomName);
getList(); // 鑾峰彇璇ユ埧闂寸殑鎮h�呭垪琛�
} catch (e) {
updateAnnouncement('瑙f瀽鍝嶅簲鏁版嵁澶辫触');
@@ -518,46 +528,51 @@
xhr.send();
}
- function getRoomByIp() {
- var searchInput = document.getElementById('searchRoomInput').value.trim();
+ function getRoomByIp(roomId) {
+ // 濡傛灉鏈紶閫抮oomId锛屽皾璇曚粠杈撳叆妗嗚幏鍙�
+ if (!roomId) {
+ roomId = document.getElementById('searchRoomInput').value.trim() || '1';
+ }
- var xhr = new XMLHttpRequest();
- xhr.open('GET', appState.apiBaseUrl + '/ecg/screen/room-screen-data?roomId=' + encodeURIComponent(searchInput), true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- if (xhr.status === 200) {
- try {
- var response = JSON.parse(xhr.responseText);
- appState.roomProfile = response.data || response;
- updateRoomInfo();
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', appState.apiBaseUrl + '/ecg/screen/room-screen-data?roomId=' + encodeURIComponent(roomId), true);
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ if (xhr.status === 200) {
+ try {
+ var response = JSON.parse(xhr.responseText);
+ appState.roomProfile = response.data || response;
+ updateRoomInfo();
- // 妫�鏌ユ槸鍚︽湁闇�瑕佸彨鍙风殑鎮h��
- if (response.data && response.data.called === 0) {
- appState.curSpeakPat = response.data;
- speak('璇�' + response.data.patName + '鍒�' + appState.roomProfile.roomName + '瑁呮満');
- }
- } catch (e) {
- console.error('瑙f瀽鍝嶅簲澶辫触:', e);
- // 浣跨敤妯℃嫙鏁版嵁浣滀负鍚庡
- appState.roomProfile = {
- roomName: '蹇冪數鍥捐瘖瀹� ' + (appState.roomId + 1),
- callingScreenType: [40, 10, 30][appState.roomId % 3]
- };
- updateRoomInfo();
- }
- } else {
- console.error('鑾峰彇鎴块棿淇℃伅澶辫触:', xhr.status);
- // 浣跨敤妯℃嫙鏁版嵁浣滀负鍚庡
- appState.roomProfile = {
- roomName: '蹇冪數鍥捐瘖瀹� ' + (appState.roomId + 1),
- callingScreenType: [40, 10, 30][appState.roomId % 3]
- };
- updateRoomInfo();
+ // 鏇存柊褰撳墠roomId鐘舵��
+ appState.roomId = roomId;
+
+ // 妫�鏌ユ槸鍚﹂渶瑕佸彨鍙�
+ if (response.data && response.data.called === 0) {
+ appState.curSpeakPat = response.data;
+ speak('璇�' + response.data.patName + '鍒�' + appState.roomProfile.roomName + '瑁呮満');
}
+ } catch (e) {
+ console.error('瑙f瀽鍝嶅簲澶辫触:', e);
+ fallbackRoomData(roomId);
}
- };
- xhr.send();
+ } else {
+ console.error('鑾峰彇鎴块棿淇℃伅澶辫触:', xhr.status);
+ fallbackRoomData(roomId);
+ }
}
+ };
+ xhr.send();
+}
+
+// 鍚庡鏁版嵁鍑芥暟
+function fallbackRoomData(roomId) {
+ appState.roomProfile = {
+ roomName: '蹇冪數鍥捐瘖瀹� ' + roomId,
+ callingScreenType: [40, 10, 30][roomId % 3]
+ };
+ updateRoomInfo();
+}
// 鏇存柊鎴块棿淇℃伅鏄剧ず
function updateRoomInfo() {
@@ -645,6 +660,9 @@
// 鏇存柊鍏憡淇℃伅
function updateAnnouncement(text) {
$('#announcementText').text(text);
+ }
+ function updatetitleroomName(text) {
+ $('#titleroomName').text(text);
}
// 宸ュ叿鍑芥暟
@@ -773,11 +791,17 @@
}
// 鍒囨崲鎴块棿
- function changeRoom() {
- appState.roomId = (appState.roomId + 1) % 3;
- getRoomByIp();
- updateAnnouncement('姝e湪鍒囨崲璇婇棿...');
- }
+ function changeRoom() {
+ // 杞崲roomId锛堢ず渚嬶細1鈫�2鈫�3鈫�1锛�
+ const newRoomId = (parseInt(appState.roomId) % 3) + 1;
+
+ // 鏇存柊URL浣嗕笉鍒锋柊椤甸潰
+ window.history.pushState({}, '', `?roomId=${newRoomId}`);
+
+ // 閲嶆柊鍔犺浇鏁版嵁
+ getRoomByIp(newRoomId.toString());
+ updateAnnouncement('姝e湪鍒囨崲鍒拌瘖闂� ' + newRoomId);
+}
</script>
</body>
--
Gitblit v1.9.3