| | |
| | | <script setup lang="ts"> |
| | | |
| | | import dayjs from 'dayjs' |
| | | import {ScreenApi, statusMap, CallingVO} from "@/api/ecg/screen"; |
| | | |
| | | defineOptions({ name: 'bigscreen' }) |
| | |
| | | if ( curWorkDay === undefined) { |
| | | curSpeakSeqNum = 0; |
| | | curWorkDay = new Date() |
| | | } else if (!isSameDate(listReady.value[0].bookDate, curWorkDay)) { |
| | | } else if (!isSameDate(dayjs(listReady.value[0].bookDate).toDate(), curWorkDay)) { |
| | | curSpeakSeqNum = 0; |
| | | curWorkDay.setFullYear( listReady.value[0].bookDate[0] ) |
| | | curWorkDay.setMonth( listReady.value[0].bookDate[1] ) |
| | | curWorkDay.setDate( listReady.value[0].bookDate[2] ) |
| | | curWorkDay = dayjs(listReady.value[0].bookDate).toDate() |
| | | } |
| | | |
| | | return listReady.value.find( item => item.status === 30 && item.called === 0 && item.seqNum > curSpeakSeqNum) |
| | |
| | | speechSynthesis.speak(speech) |
| | | } |
| | | |
| | | const isSameDate = ( date1: number[], date2 : Date) => { |
| | | if ( date1[0] === date2.getFullYear() |
| | | && date1[1] === date2.getMonth() |
| | | && date1[2] === date2.getDate() ) { |
| | | const isSameDate = ( date1: Date, date2 : Date) => { |
| | | if (date1.getFullYear() === date2.getFullYear() |
| | | && date1.getMonth() === date2.getMonth() |
| | | && date1.getDate() === date2.getDate()) |
| | | return true |
| | | } else { |
| | | else |
| | | return false |
| | | } |
| | | } |
| | | |
| | | </script> |