|
@@ -0,0 +1,129 @@
|
|
|
+<template>
|
|
|
+ <div class="inpatient-board layout_container">
|
|
|
+ <header class="header">
|
|
|
+ <div class="title-line">
|
|
|
+ <div class="title">护理看板</div>
|
|
|
+ <div class="ward">
|
|
|
+ 当前病房:
|
|
|
+ <el-select v-model="currentWard" @change="handleWardChange" style="width: 120px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in allWards"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.code"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <div class="speed-text">
|
|
|
+ 滚动速度:
|
|
|
+ </div>
|
|
|
+ <div class="speed-box">
|
|
|
+ <el-slider v-model="speedBarDisplay" :step="10" :min="10" :max="100" @change="changeInterval"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <div class="layout_main" id="boardBox">
|
|
|
+ <div style="display: flex; flex-wrap: wrap; overflow-y: auto" id="boardContent">
|
|
|
+ <Inpatient v-for="(itm, index) in briefs" :key="index" :brief="itm" :show-order-entry="false"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script setup>
|
|
|
+import Inpatient from "@/components/dashboard/Inpatient.vue";
|
|
|
+import {selectInpatientBriefs} from "@/api/dashboard";
|
|
|
+import {getAllWards} from "@/api/login";
|
|
|
+
|
|
|
+const currentWard = ref('')
|
|
|
+const allWards = ref([])
|
|
|
+const briefs = ref([]);
|
|
|
+
|
|
|
+function handleWardChange(ward) {
|
|
|
+ localStorage.setItem('inpatientBoardWard', ward)
|
|
|
+ getPatients(ward)
|
|
|
+}
|
|
|
+
|
|
|
+function getPatients(ward) {
|
|
|
+ selectInpatientBriefs(ward).then(res => {
|
|
|
+ briefs.value = res
|
|
|
+ setTimeout(() => {
|
|
|
+ startScroll()
|
|
|
+ },500)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const speedBarDisplay = ref(50)
|
|
|
+const interval = ref(50)
|
|
|
+
|
|
|
+function changeInterval(val) {
|
|
|
+ interval.value = 110 - val
|
|
|
+ clearInterval(scrollInterval)
|
|
|
+ startScroll()
|
|
|
+}
|
|
|
+
|
|
|
+let scrollInterval
|
|
|
+function startScroll() {
|
|
|
+ const windowHeight = window.innerHeight - 43
|
|
|
+ const boardContent = document.getElementById("boardContent")
|
|
|
+ const clientHeight = boardContent.clientHeight
|
|
|
+ if (clientHeight > windowHeight) {
|
|
|
+ console.log('start scrolling')
|
|
|
+ const boardBox = document.getElementById('boardBox')
|
|
|
+ scrollInterval = setInterval(() => {
|
|
|
+ boardBox.scrollTop += 1
|
|
|
+ const maxScrollHeight = boardContent.scrollHeight - boardBox.clientHeight
|
|
|
+ if (boardBox.scrollTop >= maxScrollHeight) {
|
|
|
+ boardBox.scrollTop = 0
|
|
|
+ }
|
|
|
+ }, interval.value)
|
|
|
+ } else {
|
|
|
+ console.log('clear scrolling')
|
|
|
+ clearInterval(scrollInterval)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getAllWards().then(res => {
|
|
|
+ allWards.value = res
|
|
|
+ currentWard.value = localStorage.getItem('inpatientBoardWard')
|
|
|
+ if (currentWard.value) {
|
|
|
+ getPatients(currentWard.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.inpatient-board {
|
|
|
+ .header {
|
|
|
+ background-color: #1d8300;
|
|
|
+ padding: 8px;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .title-line {
|
|
|
+ color: white;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ .title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .ward {
|
|
|
+ position: absolute;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ left: 10px;
|
|
|
+ top: 6px;
|
|
|
+ .speed-text {
|
|
|
+ margin-left: 32px;
|
|
|
+ }
|
|
|
+ .speed-box {
|
|
|
+ width: 220px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|