feat:完成等候大屏

main
@0Melon0 12 months ago
parent 907946fc3b
commit 2cc751f91a

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 2.5 MiB

@ -2,7 +2,7 @@ import axios from 'axios';
let _axios = axios.create({
baseURL: window.globalUrl.baseURL,
timeout: 5000,
timeout: 10000,
});
// _axios.interceptors.request.use(function (config) {

@ -0,0 +1,144 @@
// 根据手术状态输出文字
export const statusToTxt = type => {
if (type == -10) {
return '已取消';
}
if (type == -5) {
return '已归档';
}
if (type == -1) {
return '提交排程';
}
if (type == 0) {
return '术前准备';
}
if (type == 5) {
return '入手术室';
}
if (type == 10) {
return '入手术间';
}
if (type == 15) {
return '麻醉开始';
}
if (type == 20) {
return '手术开始';
}
if (type == 25) {
return '手术结束';
}
if (type == 30) {
return '麻醉结束';
}
if (type == 35) {
return '出手术间';
}
if (type == 40) {
return '入复苏室';
}
if (type == 45) {
return '出复苏室';
}
if (type == 50) {
return '出手术室';
}
return '未知';
};
// 根据手术状态输出颜色
export const textToColor = text => {
let color = '#87ceeb';
switch (text) {
case '提交排程':
color = '#D17975';
break;
case '术前准备':
color = '#497FEB';
break;
case '入手术间':
color = '#6C64CD';
break;
case '麻醉开始':
color = '#F09B55';
break;
case '手术开始':
color = '#FF8514';
break;
case '手术结束':
color = '#01D1C7';
break;
case '麻醉结束':
color = '#67C23A';
break;
case '出手术间':
color = '#56DE13';
break;
case '入复苏室':
color = '#9460FA';
break;
case '出复苏室':
color = '#559DF1';
break;
}
return color;
};
// 手术状态清单
export const opStatusList = [
{
label: '已取消',
value: -10,
},
{
label: '已归档',
value: -5,
},
{
label: '提交排程',
value: -1,
},
{
label: '术前准备',
value: 0,
},
{
label: '入手术室',
value: 5,
},
{
label: '入手术间',
value: 10,
},
{
label: '麻醉开始',
value: 15,
},
{
label: '手术开始',
value: 20,
},
{
label: '手术结束',
value: 25,
},
{
label: '麻醉结束',
value: 30,
},
{
label: '出手术间',
value: 35,
},
{
label: '入复苏室',
value: 40,
},
{
label: '出复苏室',
value: 45,
},
{
label: '出手术室',
value: 50,
},
];

@ -1,28 +1,58 @@
<template>
<section class="waitBox bg-[#F3F2FA]">
<nav class="h-[11.11vh] pl-[3.7vh] pr-[2.22vh] flex justify-between items-center bg-[#5D49AF]">
<div class="logBox w-[11.57vh] h-[7.4vh]">
<img class="h-full" src="@/assets/svg/Wait/logo.svg" />
<nav class="h-[11.11vh] pl-[3.7vh] pr-[2.22vh] flex justify-between items-center bg-[#5D49AF] relative">
<div class="logBox h-[5vh]">
<img class="h-full" src="@/assets/svg/Wait/logo.png" />
</div>
<div class="titleBox flex items-center">
<p class="text-[5.55vh] font-bold mr-[1.48vh]">家属等候大屏</p>
<span class="text-[2.96vh] text-[#ccc] tracking-widest">(9s)</span>
<div class="absolute titleBox w-full flex justify-around">
<div class="flex items-center">
<p class="text-[5.55vh] font-bold mr-[1.48vh]">家属等候大屏</p>
<span class="text-[2.96vh] text-[#ccc] tracking-widest">({{ carouselCountDown }}s)</span>
</div>
</div>
<div class="timeBox text-right">
<p class="text-[3.14vh] font-medium leading-tight">15:31</p>
<p class="text-[1.66vh]">2024-07-09 星期二</p>
<p class="text-[3.14vh] font-medium leading-tight">{{ formatTime }}</p>
<p class="text-[1.66vh]">{{ formatDate }}</p>
</div>
</nav>
<main class="h-[calc(100vh-18.51vh)] p-[2.22vh] pb-0" ref="mainRef">
<div class="bg-[#9A82FF] flex text-center" :style="carouselNav">
<div class="flex-1 border-r">手术间</div>
<div class="flex-1 border-r">患者姓名</div>
<div class="flex-1 border-r">床号</div>
<div class="flex-1 border-r">科室</div>
<div class="flex-1">状态</div>
<main class="h-[calc(100vh-18.51vh)] p-[24px] pb-0 relative" ref="mainRef">
<div class="absolute top-[24px] left-1/2 -translate-x-1/2 w-[calc(100%-48px)]">
<div class="bg-[#9A82FF] flex text-center" :style="carouselNav">
<div class="flex-1 border-r">手术间</div>
<div class="flex-1 border-r">患者姓名</div>
<div class="flex-1 border-r">床号</div>
<div class="flex-1 border-r">科室</div>
<div class="flex-1">状态</div>
</div>
<div :style="carouselWrap" class="border border-[#9A82FF] border-t-0" v-loading="isLoading">
<el-carousel direction="vertical" :autoplay="false" indicatorPosition="none" ref="carousel" @change="onCarouselChange">
<template v-if="patientList['length']">
<el-carousel-item v-for="(item, index) in patientList" :key="index">
<section class="carouselItemBox">
<template v-for="(subItem, index) in item">
<div :key="index" :style="carouselItemStyle">
<div class="flex text-center text-[#333]">
<div class="flex-1 border-r text-[#333]">{{ subItem['RoomName'] }}</div>
<div class="flex-1 border-r text-[#333]">{{ subItem['PatientName'] }}</div>
<div class="flex-1 border-r text-[#333]">{{ subItem['BedNo'] }}</div>
<div class="flex-1 border-r text-[#333]">{{ subItem['WardName'] }}</div>
<div class="flex-1 text-[#333]" :style="{ color: `${textToColor(statusToTxt(subItem['ProcStatus']))}` }">
{{ statusToTxt(subItem['ProcStatus']) }}
</div>
</div>
</div>
</template>
</section>
</el-carousel-item>
</template>
</el-carousel>
</div>
</div>
<div :style="carouselOuterWrap" v-loading="isLoading">
<div :style="carouselIneerWrap" class="border border-[#9A82FF] border-t-0"></div>
<div class="absolute bottom-4 left-1/2 -translate-x-1/2 flex">
<template v-for="(item, index) in patientList">
<div class="w-3 h-3 rounded-full bg-[#D8D8D8] mx-1" :class="{ 'bg-[#8C8D92]': index == activeIndex }" :key="index" />
</template>
</div>
</main>
<footer class="h-[7.4vh] flex items-center justify-around bg-[#5D49AF]">
@ -38,21 +68,31 @@
<script>
import { getAnesPatientList } from '@/api/waitList';
import { Carousel, CarouselItem } from 'element-ui';
import dayjs from 'dayjs';
import { statusToTxt, textToColor } from '@/utils/common';
export default {
data() {
return {
isLoading: true,
mainRefHeight: 0,
showItemNum: 9,
showItemNum: 8,
carouselNav: {},
carouselOuterWrap: {},
carouselIneerWrap: {},
carouselWrap: {},
carouselItemStyle: {},
patientList: [],
currentDateTime: dayjs().format('YYYY-MM-DD HH:mm dddd'),
dateTimer: null,
carouselCountDown: 10,
carouselTimer: null,
activeIndex: 0,
getDataTimer: null,
};
},
methods: {
statusToTxt,
textToColor,
onGetPageData() {
let today = dayjs().format('YYYY-MM-DD');
today = '2024-06-06';
@ -79,31 +119,118 @@ export default {
this.patientList[groupIndex] = [element];
}
}
console.log(this.patientList);
if (!this.carouselTimer) {
this.onCarouselTimer();
}
})
.finally(() => {
this.isLoading = false;
});
},
onCarouselTimer() {
this.$nextTick(() => {
this.carouselTimer = setInterval(() => {
this.carouselCountDown -= 1;
if (this.carouselCountDown == 0) {
this.$refs.carousel.next();
this.carouselCountDown = 3;
}
}, 1000);
});
},
onCalculate() {
//
this.mainRefHeight = parseInt(this.$refs.mainRef.clientHeight - 24 - 40);
const rowHeight = this.mainRefHeight / (this.showItemNum + 1);
this.carouselNav = {
'font-size': `${(rowHeight * 0.43).toFixed(2)}px`,
'line-height': `${rowHeight.toFixed(2)}px`,
};
this.carouselWrap = {
height: `${(rowHeight * this.showItemNum).toFixed(2)}px`,
};
this.carouselItemStyle = {
'line-height': `${rowHeight.toFixed(2)}px`,
'font-size': `${(rowHeight * 0.4).toFixed(2)}px`,
};
},
onCarouselChange(index) {
this.activeIndex = index;
},
},
mounted() {
const mainEl = window.getComputedStyle(this.$refs.mainRef);
this.mainRefHeight = parseInt(this.$refs.mainRef.clientHeight - parseFloat(mainEl['paddingTop'])) - 40;
const itemHeight = this.mainRefHeight / (this.showItemNum + 1);
const rowHeight = itemHeight / 1080;
this.carouselNav = {
'font-size': `${(rowHeight * 43).toFixed(2)}vh`,
'line-height': `${(rowHeight * 100).toFixed(2)}vh`,
};
this.carouselOuterWrap = {
height: `calc(100% - ${(rowHeight * 100).toFixed(2)}vh)`,
};
this.carouselIneerWrap = {
height: `calc(100% - 40px)`,
};
this.onGetPageData();
this.$nextTick(() => {
this.onCalculate();
//
this.dateTimer = setInterval(() => {
this.currentDateTime = dayjs().format('YYYY-MM-DD HH:mm dddd');
}, 10000);
this.onGetPageData();
this.getDataTimer = setInterval(() => {
this.onGetPageData();
}, 35000);
window.addEventListener('resize', this.onCalculate);
});
},
components: {
'el-carousel': Carousel,
'el-carousel-item': CarouselItem,
},
computed: {
formatDate() {
const timeArr = this.currentDateTime.split(' ');
let weekName = '星期一';
if (timeArr[2] == 'Tuesday') {
weekName = '星期二';
}
if (timeArr[2] == 'Wednesday') {
weekName = '星期三';
}
if (timeArr[2] == 'Thursday') {
weekName = '星期四';
}
if (timeArr[2] == 'Friday') {
weekName = '星期五';
}
if (timeArr[2] == 'Saturday') {
weekName = '星期六';
}
if (timeArr[2] == 'Sunday') {
weekName = '星期日';
}
return `${timeArr[0]} ${weekName}`;
},
formatTime() {
return this.currentDateTime.split(' ')[1];
},
},
beforeDestroy() {
//
clearInterval(this.dateTimer);
clearInterval(this.carouselTimer);
clearInterval(this.getDataTimer);
// resize
window.removeEventListener('resize', this.onCalculate);
},
};
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
:deep(.el-carousel) {
height: 100%;
.el-carousel__container,
.el-carousel__item {
height: 100%;
.carouselItemBox {
> div:nth-child(odd) {
background: #fff;
}
> div:nth-child(even) {
background: #f5f8ff;
}
}
}
}
</style>

Loading…
Cancel
Save