¶Ô±ÈÐÂÎļþ |
| | |
| | | <!----> |
| | | <script setup lang="ts"> |
| | | |
| | | import {ScreenApi, ScreenQueueVO} from "@/api/ecg/screen"; |
| | | import {CallApi, CallVO} from "@/api/ecg/call"; |
| | | import {queueStatusConvert} from "@/utils/statusFormatter"; |
| | | |
| | | defineOptions({ name: 'bigscreen' }) |
| | | |
| | | const displayColInfo = ref(); |
| | | |
| | | const listReady = ref<ScreenQueueVO[]>([]) // åè¡¨çæ°æ® |
| | | const listWaiting = ref<ScreenQueueVO[]>([]) // åè¡¨çæ°æ® |
| | | const listPassed = ref<ScreenQueueVO[]>([]) // |
| | | |
| | | let curSpeakPat : CallVO | null = null; |
| | | |
| | | const getDisplayColInfo = async () => { |
| | | const data = await ScreenApi.getDisplayColInfo() |
| | | displayColInfo.value = data |
| | | } |
| | | |
| | | const getList = async () => { |
| | | const data = await ScreenApi.getBigScreenData() |
| | | listReady.value = data[1] |
| | | listWaiting.value = data[2] |
| | | listPassed.value = data[3] |
| | | } |
| | | |
| | | const startScrolling = () => { |
| | | setInterval(() => { |
| | | getList(); |
| | | if ( curSpeakPat === null ) { |
| | | initiateSpeak() |
| | | } |
| | | }, 5000); // æ¯Xç§æ»å¨ä¸æ¬¡ |
| | | } |
| | | |
| | | 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() |
| | | console.info( curSpeakPat ) |
| | | if (curSpeakPat !== null) { |
| | | speak("请ã" + curSpeakPat.patName + "å°" + curSpeakPat.roomName + "å°±è¯"); |
| | | } |
| | | } |
| | | |
| | | const speak = (msg) => { |
| | | console.info("speak " + msg); |
| | | var speech = new SpeechSynthesisUtterance() |
| | | speech.text = msg + "ããã" + msg + "ããã" + msg + "ããã" |
| | | speech.pitch = 1 // è·å并设置è¯è¯çé³è°(0-2 é»è®¤1ï¼å¼è¶å¤§è¶å°é,è¶ä½è¶ä½æ²) |
| | | speech.rate = 0.9 // è·å并设置说è¯çé度(0.1-10 é»è®¤1ï¼å¼è¶å¤§è¯éè¶å¿«,è¶å°è¯éè¶æ
¢) |
| | | speech.volume = 100 // è·å并设置说è¯çé³é |
| | | speech.lang = 'zh-CN' // è®¾ç½®ææ¾è¯è¨ |
| | | |
| | | speech.onend = onSpeachEndEvent |
| | | speechSynthesis.speak(speech) |
| | | } |
| | | |
| | | const nameDesensitize = (patName) => { |
| | | if (patName.length == 2) { |
| | | //æªåname å符串æªå第ä¸ä¸ªåç¬¦ï¼ |
| | | return patName.substring(0, 1) + '*'; |
| | | } else if (patName.length == 3) { |
| | | //æªå第ä¸ä¸ªå第ä¸ä¸ªå符 |
| | | return patName.substring(0, 1) + '*' + patName.substring(2, 3); |
| | | } else if (patName.length > 3) { |
| | | //æªå第ä¸ä¸ªå大äºç¬¬4个å符 |
| | | return ( |
| | | patName.substring(0, 1) + '*' + '*' + patName.substring(3, patName.length) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <el-container style="height: 100%;"> |
| | | <el-header> |
| | | <img |
| | | height="40px" |
| | | src="@/assets/imgs/jinhua.png" |
| | | /> |
| | | éå人æ°å»é¢ |
| | | </el-header> |
| | | <el-container> |
| | | <el-aside width="500px"> |
| | | <el-table |
| | | :data="listReady" |
| | | stripe |
| | | :show-header="false" |
| | | style="width: 100%; height: 100%; border: solid var(--el-color-primary-light-7); font-size: 18px;"> |
| | | <el-table-column |
| | | prop="patName" |
| | | label="æ£è
å§å" |
| | | width="80"> |
| | | <template #default="scope"> |
| | | {{scope.row.seqNum}} {{ nameDesensitize(scope.row.patName) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="status" width="100"> |
| | | <template #default="scope"> |
| | | <!-- <dict-tag :type="DICT_TYPE.ECG_QUEUE_STATUS" :value="scope.row.status" />--> |
| | | {{queueStatusConvert(scope.row.status)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="roomName" |
| | | label="è¯å®¤" |
| | | width="120"/> |
| | | </el-table> |
| | | </el-aside> |
| | | <el-container> |
| | | <el-main style="padding: 0 0 "> |
| | | <el-header height="30px" style="background-color: #98b8e5; line-height: 30px;">çååº</el-header> |
| | | <span v-for="(waitingItem, index) in listWaiting" :key="index"> |
| | | {{nameDesensitize(waitingItem.patName) + " "}} |
| | | </span> |
| | | </el-main> |
| | | <el-footer height="100px" style="padding: 0 0"> |
| | | <el-header height="30px" style="background-color: #98b8e5; line-height: 30px;">è¿å·åº</el-header> |
| | | <span v-for="(passedItem, index) in listPassed" :key="index"> |
| | | {{nameDesensitize(passedItem.patName) + " " + passedItem.roomName + " "}} |
| | | </span> |
| | | </el-footer> |
| | | </el-container> |
| | | </el-container> |
| | | <el-button @click="speak('欢è¿ä½¿ç¨')" >欢è¿ä½¿ç¨</el-button> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <style scoped lang="scss"> |
| | | .el-header { |
| | | background-color: var(--el-color-primary-light-7); |
| | | color: #333; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .el-footer { |
| | | //background-color: var(--el-color-primary-light-7); |
| | | color: #333; |
| | | text-align: center; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .el-aside { |
| | | background-color: var(--el-color-primary-light-7); |
| | | color: #333; |
| | | text-align: center; |
| | | line-height: 200px; |
| | | } |
| | | |
| | | .el-main { |
| | | //background-color: var(--el-color-primary-light-7); |
| | | color: #333; |
| | | text-align: center; |
| | | line-height: 160px; |
| | | } |
| | | |
| | | body > .el-container { |
| | | margin-bottom: 40px; |
| | | } |
| | | |
| | | </style> |