From dbf761cb549cdc0e8ef1ed266a41f515b8ef148d Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期五, 04 七月 2025 21:06:55 +0800
Subject: [PATCH] 11
---
public/static/jinhua.png | 0
public/integration.html | 601 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
public/ConsultationRoom.html | 0
3 files changed, 601 insertions(+), 0 deletions(-)
diff --git a/public/roomtwo.html b/public/ConsultationRoom.html
similarity index 100%
rename from public/roomtwo.html
rename to public/ConsultationRoom.html
diff --git a/public/integration.html b/public/integration.html
new file mode 100644
index 0000000..f84d262
--- /dev/null
+++ b/public/integration.html
@@ -0,0 +1,601 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+ <title>閲戝崕浜烘皯鍖婚櫌澶у睆鍙彿绯荤粺</title>
+ <style>
+ /* 鍩虹鏍峰紡 */
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ font-family: 'Helvetica Neue', Arial, sans-serif;
+ }
+
+ body {
+ background: linear-gradient(135deg, #e6f0f8, #d9e4f0);
+ color: #4a5568;
+ height: 100vh;
+ overflow: hidden;
+ }
+
+ .bigscreen-container {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ 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);
+ }
+
+ .hospital-header img {
+ margin-right: 8px;
+ height: 40px;
+ }
+
+ .running-indicator {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ margin-left: 12px;
+ transition: background-color 0.3s;
+ }
+
+ /* 鍒楁爣棰樺尯鍩� */
+ .column-header {
+ display: flex;
+ 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: 0;
+ text-align: center;
+ padding: 0 12px;
+ border-left: 1px solid rgba(91, 140, 255, 0.2);
+ }
+
+ .column-title:first-child {
+ border-left: none;
+ flex: 2; /* 绗竴涓埧闂存爣棰樺崰涓ゅ垪瀹藉害 */
+ }
+
+ /* 鎮h�呭垪琛ㄥ尯鍩� */
+ .patient-list-container {
+ display: flex;
+ 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;
+ }
+
+ .patient-column {
+ flex: 1;
+ min-width: 0;
+ padding: 0 12px;
+ border-left: 1px solid rgba(91, 140, 255, 0.2);
+ }
+
+ .patient-column:first-child {
+ border-left: none;
+ flex: 2; /* 绗竴涓埧闂村崰涓ゅ垪瀹藉害 */
+ }
+
+ /* 绗竴涓埧闂村垎鎴愪袱鍒楃殑鐗规畩鏍峰紡 */
+ .first-room-columns {
+ display: flex;
+ flex: 2;
+ min-width: 0;
+ }
+
+ .first-room-column {
+ flex: 1;
+ min-width: 0;
+ padding: 0 12px;
+ }
+
+ .first-room-column:first-child {
+ border-right: 1px solid rgba(91, 140, 255, 0.2);
+ }
+
+ /* 鎮h�呴」鏍峰紡 - 浼樺寲鍚庣殑甯冨眬 */
+ .patient-item {
+ padding: 10px 8px;
+ margin-bottom: 8px;
+ border-radius: 8px;
+ transition: all 0.3s;
+ background: rgba(255, 255, 255, 0.8);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
+ }
+
+ .patient-item:hover {
+ background: rgba(91, 140, 255, 0.1);
+ }
+
+ .patient-info-row {
+ display: flex;
+ width: 100%;
+ margin-bottom: 4px;
+ }
+
+ .patient-number-name {
+ display: flex;
+ flex-wrap: wrap;
+ }
+
+ .patient-number {
+ color: #5b8cff;
+ font-weight: bold;
+ margin-right: 10px;
+ min-width: 80px;
+ }
+
+ .patient-name {
+ flex: 1;
+ min-width: 100px;
+ }
+
+ .patient-status {
+ width: 100%;
+ color: #67c23a;
+ margin-top: 4px;
+ }
+
+ .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;
+ cursor: pointer;
+ }
+
+ .welcome-btn:hover {
+ background: rgba(91, 140, 255, 0.2);
+ }
+
+ /* 婊氬姩鏉℃牱寮� */
+ .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;
+ }
+
+ /* 鍝嶅簲寮忚皟鏁� */
+ @media (max-width: 1200px) {
+ .hospital-header {
+ font-size: 18px;
+ }
+ .column-header {
+ font-size: 16px;
+ }
+ .patient-list-container {
+ font-size: 14px;
+ }
+ .patient-number {
+ min-width: 60px;
+ }
+ }
+
+ @media (max-width: 768px) {
+ .hospital-header {
+ font-size: 16px;
+ padding: 8px;
+ }
+ .column-header {
+ flex-direction: column;
+ padding: 8px 0;
+ }
+ .column-title {
+ min-width: 100%;
+ padding: 8px 0;
+ border-left: none;
+ border-bottom: 1px solid rgba(91, 140, 255, 0.2);
+ }
+ .patient-list-container {
+ flex-direction: column;
+ }
+ .patient-column, .first-room-columns {
+ min-width: 100%;
+ padding: 8px 0;
+ border-left: none;
+ border-bottom: 1px solid rgba(91, 140, 255, 0.2);
+ }
+ .first-room-column {
+ padding: 0 8px;
+ }
+ }
+ </style>
+</head>
+<body>
+ <div class="bigscreen-container">
+ <!-- 椤堕儴鍖婚櫌鏍囬 -->
+ <div class="hospital-header">
+ <img src="./static/jinhua.png"/>
+ <span>閲戝崕浜烘皯鍖婚櫌</span>
+ <div class="running-indicator" id="runningIndicator"></div>
+ </div>
+
+ <!-- 鍒楁爣棰樺尯鍩� -->
+ <div class="column-header" id="columnHeader">
+ <!-- 鍒楁爣棰樺皢閫氳繃JS鍔ㄦ�佺敓鎴� -->
+ </div>
+
+ <!-- 鎮h�呭垪琛ㄥ尯鍩� -->
+ <div class="patient-list-container" id="patientListContainer">
+ <!-- 鎮h�呭垪琛ㄥ皢閫氳繃JS鍔ㄦ�佺敓鎴� -->
+ </div>
+
+ <div class="footer-controls">
+ <button class="welcome-btn" id="welcomeBtn">娆㈣繋璇�</button>
+ </div>
+ </div>
+
+ <script src="./static/jquery.min.js"></script>
+ <script>
+ // 搴旂敤鐘舵��
+ var appState = {
+ runningIndicator: 0,
+ displayColInfo: {
+ "0": ["甯歌蹇冪數鍥続", "搴婅竟蹇冪數鍥�(甯歌+棰戣氨)M", "甯歌蹇冪數鍥�-蹇冪數鍚戦噺鍥綨"],
+ "1": ["鍔ㄦ�佸績鐢礏", "鍔ㄦ�佽鍘婥"],
+ "2": ["骞虫澘杩愬姩蹇冪數D"],
+ "3": ["椋熼亾鐢电敓鐞咶"],
+ "4": ["鍔ㄨ剦纭寲鐩戞祴E"]
+ },
+ mapColumnVsPatients: new Map(),
+ curSpeakPat: null,
+ timer: null,
+ speechSynthesis: window.speechSynthesis || null,
+ apiBaseUrl: 'http://localhost:48080/admin-api'
+ };
+
+ // 椤甸潰鍔犺浇瀹屾垚鍚庡垵濮嬪寲
+ $(document).ready(function() {
+ // 鍒濆鍖栦簨浠剁洃鍚�
+ $('#welcomeBtn').click(function() {
+ speak('娆㈣繋浣跨敤閲戝崕浜烘皯鍖婚櫌鍙彿绯荤粺');
+ });
+
+ // 鍒濆鍖栨暟鎹�
+ updateColumnHeader();
+ startScrolling();
+
+ // 鍒濆鍖栬闊冲悎鎴�
+ if (appState.speechSynthesis) {
+ appState.speechSynthesis.onend = onSpeachEndEvent;
+ }
+ });
+
+ // 鏇存柊鍒楁爣棰樻樉绀�
+ function updateColumnHeader() {
+ var $header = $('#columnHeader');
+ $header.empty();
+
+ // 鎸夌収鍥哄畾椤哄簭鏄剧ず浜斾釜鎴块棿鐨勬爣棰�
+ for (var i = 0; i < 5; i++) {
+ var disColId = i.toString();
+ var disNameList = appState.displayColInfo[disColId] || [];
+ var isFirstColumn = disColId === "0";
+
+ var $title = $('<div class="column-title' + (isFirstColumn ? ' double-column' : '') + '"></div>');
+
+ disNameList.forEach(function(dispName) {
+ $title.append('<div>' + dispName + '</div>');
+ });
+
+ $header.append($title);
+ }
+ }
+
+ // 鑾峰彇鎮h�呭垪琛�
+ function getList() {
+ // 杩欓噷鏇挎崲涓哄疄闄呯殑API璋冪敤
+ $.ajax({
+ url: appState.apiBaseUrl + '/ecg/screen/big-screen-data',
+ type: 'GET',
+ dataType: 'json',
+ success: function(response) {
+ // 纭繚鏁版嵁鎸夌収浜斾釜鎴块棿鐨勯『搴忔帓鍒�
+ var data = response.data || response;
+ appState.mapColumnVsPatients = new Map();
+
+ // 鎸夌収鍥哄畾椤哄簭澶勭悊浜斾釜鎴块棿鐨勬暟鎹�
+ for (var i = 0; i < 5; i++) {
+ var roomId = i.toString();
+ appState.mapColumnVsPatients.set(roomId, data[roomId] || []);
+ }
+
+ updatePatientList();
+ },
+ error: function(xhr, status, error) {
+ console.error('鑾峰彇鎮h�呭垪琛ㄥけ璐�:', error);
+ // 浣跨敤妯℃嫙鏁版嵁浣滀负鍚庡
+ appState.mapColumnVsPatients = generateMockPatients();
+ updatePatientList();
+ }
+ });
+ }
+
+ // 鏇存柊鎮h�呭垪琛ㄦ樉绀�
+ function updatePatientList() {
+ var $container = $('#patientListContainer');
+ $container.empty();
+
+ // 鎸夌収鍥哄畾椤哄簭鏄剧ず浜斾釜鎴块棿鐨勬偅鑰呮暟鎹�
+ for (var i = 0; i < 5; i++) {
+ var disColId = i.toString();
+ var patients = appState.mapColumnVsPatients.get(disColId) || [];
+ var isFirstColumn = disColId === "0";
+
+ if (isFirstColumn) {
+ // 绗竴涓埧闂寸壒娈婂鐞�
+ if (patients.length > 10) {
+ // 瓒呰繃10浜猴紝鍒嗘垚涓ゅ垪
+ var $firstRoomColumns = $('<div class="first-room-columns"></div>');
+
+ // 绗竴鍒�(鍓�10鏉�)
+ var $firstCol = $('<div class="first-room-column"></div>');
+ patients.slice(0, 10).forEach(function(item, itemIndex) {
+ $firstCol.append(createPatientItem(item));
+ });
+ $firstRoomColumns.append($firstCol);
+
+ // 绗簩鍒�(鍓╀綑鏁版嵁)
+ var $secondCol = $('<div class="first-room-column"></div>');
+ patients.slice(10).forEach(function(item, itemIndex) {
+ $secondCol.append(createPatientItem(item, itemIndex + 10));
+ });
+ $firstRoomColumns.append($secondCol);
+
+ $container.append($firstRoomColumns);
+ } else {
+ // 涓嶈秴杩�10浜猴紝鍗曞垪鏄剧ず浣嗗崰涓ゅ垪瀹藉害
+ var $col = $('<div class="patient-column" style="flex:2"></div>');
+ patients.forEach(function(item, itemIndex) {
+ $col.append(createPatientItem(item, itemIndex));
+ });
+ $container.append($col);
+ }
+ } else {
+ // 鍏朵粬鎴块棿鍗曞垪鏄剧ず
+ var $col = $('<div class="patient-column"></div>');
+ patients.forEach(function(item, itemIndex) {
+ $col.append(createPatientItem(item, itemIndex));
+ });
+ $container.append($col);
+ }
+ }
+ }
+
+ // 鍒涘缓鎮h�呴」 - 浼樺寲鍚庣殑鐗堟湰
+ function createPatientItem(item, index) {
+ var statusClass = getItemCssClass(item);
+ var $item = $('<div class="patient-item ' + statusClass + '"></div>');
+
+ // 鍙风爜鍜屽鍚嶅湪涓�琛�
+ var $numberNameRow = $('<div class="patient-info-row patient-number-name"></div>');
+ $numberNameRow.append('<span class="patient-number">' + getCheckTypeSeqPrefix(item.bookCheckType) + item.bookSeqNum + '</span>');
+ $numberNameRow.append('<span class="patient-name">' + nameDesensitize(item.patName) + '</span>');
+ $item.append($numberNameRow);
+
+ // 鐘舵�佸湪涓嬩竴琛�
+ var $statusRow = $('<div class="patient-info-row"></div>');
+ $statusRow.append('<span class="patient-status">' + queueStatusConvert(item.status) + '</span>');
+ $item.append($statusRow);
+
+ return $item;
+ }
+
+ // 寮�濮嬪畾鏃跺埛鏂�
+ function startScrolling() {
+ getList();
+ appState.timer = setInterval(function() {
+ appState.runningIndicator++;
+ $('#runningIndicator').css('backgroundColor', appState.runningIndicator % 2 === 0 ? '#67c23a' : '#e6a23c');
+ getList();
+
+ if (appState.curSpeakPat == null) {
+ initiateSpeak();
+ }
+ }, 5000);
+ }
+
+ // 璇煶缁撴潫浜嬩欢
+ function onSpeachEndEvent(event) {
+ console.log("Speech ended... " + event.currentTarget.text);
+
+ // 杩欓噷鏇挎崲涓哄疄闄呯殑API璋冪敤
+ $.ajax({
+ url: appState.apiBaseUrl + '/ecg/call/update',
+ method: 'PUT',
+ data: {
+ id: appState.curSpeakPat.id,
+ called: 1
+ },
+ success: function() {
+ initiateSpeak();
+ },
+ error: function(xhr, status, error) {
+ console.error('鏇存柊鍙彿鐘舵�佸け璐�:', error);
+ }
+ });
+ }
+
+ // 鍙彿鍔熻兘
+ function initiateSpeak() {
+ // 杩欓噷鏇挎崲涓哄疄闄呯殑API璋冪敤
+ $.ajax({
+ url: appState.apiBaseUrl + '/ecg/call/next',
+ type: 'GET',
+ dataType: 'json',
+ success: function(response) {
+ appState.curSpeakPat = response.data || response;
+ if (appState.curSpeakPat != null && appState.curSpeakPat.called === 0) {
+ speak("璇枫��" + appState.curSpeakPat.patName + "鍒�" + appState.curSpeakPat.roomName + "灏辫瘖");
+ }
+ },
+ error: function(xhr, status, error) {
+ console.error('鑾峰彇涓嬩竴涓彨鍙峰け璐�:', error);
+ }
+ });
+ }
+
+ // 璇煶鎾姤
+ function speak(msg) {
+ console.info("speak " + msg);
+
+ if (!appState.speechSynthesis) {
+ console.warn("褰撳墠娴忚鍣ㄤ笉鏀寔璇煶鍚堟垚");
+ return;
+ }
+
+ // 鍙栨秷褰撳墠姝e湪杩涜鐨勮闊�
+ appState.speechSynthesis.cancel();
+
+ 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;
+
+ appState.speechSynthesis.speak(speech);
+ }
+
+ // 宸ュ叿鍑芥暟
+ function nameDesensitize(patName) {
+ if (!patName) return '';
+ 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);
+ }
+ return patName;
+ }
+
+ function getItemCssClass(item) {
+ if (item.status === 5 || item.status === 7) {
+ return "warning-row";
+ }
+ return "";
+ }
+
+ function queueStatusConvert(status) {
+ var statusMap = {
+ 3: '宸茶繃鍙�-鎺掗槦',
+ 5: '宸茶繃鍙�',
+ 7: '宸茶繃鍙�-瀹夎',
+ 10: '鎺掗槦涓�',
+ 12: '浜插拰',
+ 13: '浜插拰-瀹夎',
+ 15: '宸插彫鍥�',
+ 20: '鍊欒瘖涓�',
+ 30: '灏辫瘖涓�',
+ 33: '宸查鐢�',
+ 34: '宸插彫鍥�-瀹夎',
+ 36: '瀹夎涓�',
+ 40: '宸插氨璇�'
+ };
+ return statusMap[status] || '鏈煡鐘舵��';
+ }
+
+ function getCheckTypeSeqPrefix(type) {
+ var types = {
+ 1: 'A001',
+ 2: 'A002',
+ 3: 'A003',
+ 4: 'A004'
+ };
+ return types[type] || '';
+ }
+
+ // 鐢熸垚妯℃嫙鎮h�呮暟鎹�
+ function generateMockPatients() {
+ var mockData = {
+ "0": generateMockPatientsForRoom(15, "甯歌蹇冪數鍥続"),
+ "1": generateMockPatientsForRoom(8, "鍔ㄦ�佸績鐢礏"),
+ "2": generateMockPatientsForRoom(5, "骞虫澘杩愬姩蹇冪數D"),
+ "3": generateMockPatientsForRoom(3, "椋熼亾鐢电敓鐞咶"),
+ "4": generateMockPatientsForRoom(4, "鍔ㄨ剦纭寲鐩戞祴E")
+ };
+ return new Map(Object.entries(mockData));
+ }
+
+ function generateMockPatientsForRoom(count, checkTypeName) {
+ var mockPatients = [];
+ var names = ['寮犱笁', '鏉庡洓', '鐜嬩簲', '璧靛叚', '閽变竷', '瀛欏叓', '鍛ㄤ節', '鍚村崄'];
+ var rooms = ['蹇冪數鍥惧1', '蹇冪數鍥惧2', '鍔ㄦ�佸績鐢靛', '蹇冪數鐩戞姢瀹�'];
+ var statuses = [5, 7, 10, 12, 13, 15, 20, 30, 33, 34, 36, 40];
+ var checkTypes = [1, 2, 3, 4];
+
+ for (var i = 0; i < count; i++) {
+ mockPatients.push({
+ id: i + 1,
+ patName: names[Math.floor(Math.random() * names.length)],
+ roomName: rooms[Math.floor(Math.random() * rooms.length)],
+ bedNo: '搴�' + (Math.floor(Math.random() * 20) + 1),
+ status: statuses[Math.floor(Math.random() * statuses.length)],
+ bookCheckType: checkTypes[Math.floor(Math.random() * checkTypes.length)],
+ bookSeqNum: Math.floor(Math.random() * 50) + 1,
+ called: 0,
+ checkTypeName: checkTypeName
+ });
+ }
+
+ return mockPatients;
+ }
+ </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/public/static/jinhua.png b/public/static/jinhua.png
new file mode 100644
index 0000000..cf85138
--- /dev/null
+++ b/public/static/jinhua.png
Binary files differ
--
Gitblit v1.9.3