From 043dcd114446f3f78d5fa5b82af29b2069de297f Mon Sep 17 00:00:00 2001 From: "shengwen.chen" Date: Thu, 15 May 2025 11:18:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E6=89=8B=E6=9C=AF?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=E5=A2=9E=E5=8A=A0=E5=88=86=E5=8C=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- src/views/scheduleList/index.vue | 27 ++++++++++++++++++++++++++- src/views/waitList/index.vue | 31 ++++++++++++++----------------- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 798273f..422f544 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -47,7 +47,7 @@ const routes = [ component: () => import('@/views/waitList/index.vue'), }, { - path: '/scheduleList', + path: '/scheduleList/:groupIndex?', name: 'scheduleList', meta: { title: '手术排程' }, component: () => import('@/views/scheduleList/index.vue'), diff --git a/src/views/scheduleList/index.vue b/src/views/scheduleList/index.vue index a61554a..a08c1f5 100644 --- a/src/views/scheduleList/index.vue +++ b/src/views/scheduleList/index.vue @@ -113,6 +113,8 @@ export default { queryCondition: [], logoUrl: "", logoUrlBackup: "", + groupIndex: -1, + roomNameList: [], }; }, methods: { @@ -134,7 +136,18 @@ export default { }) .then(res => { this.patientList = []; + console.log(res['Data']['Data']); + if (res['Data']['Data']['length']) { + if (this.groupIndex >= 0) { + if (this.roomNameList[this.groupIndex]) { + res['Data']['Data'] = res['Data']['Data'].filter(item => { + return this.roomNameList[this.groupIndex].includes(item['RoomName']) + }) + } else { + res['Data']['Data'] = []; + } + } for (let index = 0; index < res['Data']['Data']['length']; index++) { const element = res['Data']['Data'][index]; const groupIndex = parseInt(index / this.showItemNum); @@ -196,8 +209,10 @@ export default { if (item['Key'] == "CorporateLogo") { this.logoUrlBackup = item['Value'] } + if (item['Key'] == "RoomName") { + this.roomNameList = JSON.parse(item['Value']) + } }) - }) } }, @@ -259,6 +274,16 @@ export default { return this.currentDateTime.split(' ')[1]; }, }, + watch: { + '$route.params.groupIndex'(newVal) { + if (newVal) { + this.groupIndex = newVal; + } else { + this.groupIndex = -1; + } + this.onGetPageData(); + } + }, beforeDestroy() { // 清除定时器 clearInterval(this.dateTimer); diff --git a/src/views/waitList/index.vue b/src/views/waitList/index.vue index 021681c..bac946f 100644 --- a/src/views/waitList/index.vue +++ b/src/views/waitList/index.vue @@ -267,7 +267,7 @@ export default { this.popupMag = this.popupMsgList[0].replace(/[,,]/g, '').split('#'); this.showPopup = true; this.playNum++; - + if (this.synth) { const utterance = new SpeechSynthesisUtterance(this.popupMsgList[0].replace(/#/g, '')); utterance.rate = 0.6; @@ -328,10 +328,17 @@ export default { this.roomNameList = JSON.parse(item['Value']) } }) - this.onInitData() }) }, - onInitData() { + }, + mounted() { + this.$nextTick(() => { + this.onCalculate(); + this.onGetblobe(); + // 每秒更新一次当前时间 + this.dateTimer = setInterval(() => { + this.currentDateTime = dayjs().format('YYYY-MM-DD HH:mm dddd'); + }, 10000); getDynamicTableHeader({ query: 'JSDHQDP', }).then(res => { @@ -344,22 +351,12 @@ export default { this.getDataTimer = setInterval(() => { this.onGetPageData(); }, 35000); + this.popupTimer = setInterval(() => { + this.onPopupPlay(); + }, 2000); window.addEventListener('resize', this.onCalculate); this.setRabitMQ(); }); - } - }, - mounted() { - this.$nextTick(() => { - this.onCalculate(); - this.onGetblobe(); - // 每秒更新一次当前时间 - this.dateTimer = setInterval(() => { - this.currentDateTime = dayjs().format('YYYY-MM-DD HH:mm dddd'); - }, 10000); - this.popupTimer = setInterval(() => { - this.onPopupPlay(); - }, 2000); // setTimeout(() => { // this.popupMsgList.push('请,金尧仙,的家属#到,手术室门口接病人'); // this.popupMsgList.push('请,金尧仙,的家属#到,手术室门口接病人'); @@ -406,7 +403,7 @@ export default { } else { this.groupIndex = -1; } - this.onInitData(); + this.onGetPageData(); } }, beforeDestroy() {