From 69a37b00da3147c95c18e922d113c9a176563af0 Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期四, 24 七月 2025 21:10:19 +0800
Subject: [PATCH] ID1625-x
---
src/views/mobile/bedsideAuxiliaryScreen/pages/UnderTreatment.vue | 350 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 297 insertions(+), 53 deletions(-)
diff --git a/src/views/mobile/bedsideAuxiliaryScreen/pages/UnderTreatment.vue b/src/views/mobile/bedsideAuxiliaryScreen/pages/UnderTreatment.vue
index 93b8d55..b05d642 100644
--- a/src/views/mobile/bedsideAuxiliaryScreen/pages/UnderTreatment.vue
+++ b/src/views/mobile/bedsideAuxiliaryScreen/pages/UnderTreatment.vue
@@ -18,7 +18,7 @@
:icon="zlmsImg"
background-color="#ffffff"
class="mini-card left-row1-col2-row1"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box dialysis-mode-content">
<div class="dialysis-mode-content-box">
@@ -34,7 +34,7 @@
:icon="zlmsImg"
background-color="#ffffff"
class="mini-card left-row1-col2-item-row2"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="prescription-remarks">
{{ pageData.prescriptionRemarks }}
@@ -44,10 +44,10 @@
<div class="left-row1-col3">
<Card
title="透析器"
- :icon="zlmsImg"
+ :icon="txqImg"
background-color="#ffffff"
class="mini-card left-row1-col3-row1"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box prescription-ehydration-olume">
<span class="text">{{ pageData.dialyzer }}</span>
@@ -55,10 +55,10 @@
</Card>
<Card
title="异常指标"
- :icon="zlmsImg"
+ :icon="xinlvImg"
background-color="#ffffff"
class="mini-card left-row1-col3-row2"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="dialysis-mode-content">
<span
@@ -77,10 +77,10 @@
<div class="left-row2">
<Card
title="血温监测"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
class="mini-card left-row2-col1"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box current-lood0emperature">
<span class="text">{{ pageData.currentBloodTemperature }}</span>
@@ -88,10 +88,10 @@
</Card>
<Card
title="血压监测"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
class="mini-card left-row2-col2"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box venous-pressure">
<span class="text"
@@ -103,21 +103,26 @@
</Card>
<Card
title="血压脉搏趋势图"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
- class="mini-card left-row2-col3"
- header-class-name="mihi-header"
+ class="mini-card ktv-card left-row2-col3"
+ header-class-name="mini-header"
>
- <div class=""></div>
+ <div style="height: 100%">
+ <div
+ ref="bloodPressureAndPulseEchartRef"
+ style="width: 100%; height: 100%"
+ ></div>
+ </div>
</Card>
</div>
<div class="left-row3">
<Card
title="血容量监测"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
class="mini-card left-row3-col1"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box current-lood0emperature">
<span class="text">{{ pageData.bloodVolumeMonitoring }}</span>
@@ -125,10 +130,10 @@
</Card>
<Card
title="KTV监测"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
class="mini-card left-row3-col2"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box venous-pressure">
<span class="text">{{ pageData.ktv }}</span>
@@ -136,10 +141,10 @@
</Card>
<Card
title="KTV趋势图"
- :icon="zlmsImg"
+ :icon="xinLv2Img"
background-color="#ffffff"
class="mini-card ktv-card left-row3-col3"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div style="height: 100%">
<div ref="ktvListEchartRef" style="width: 100%; height: 100%"></div>
@@ -149,10 +154,10 @@
<div class="left-row4">
<Card
title="血流量"
- :icon="zlmsImg"
+ :icon="txqImg"
background-color="#ffffff"
class="mini-card left-row4-col"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box current-lood0emperature">
<span class="text">{{ pageData.bloodFlow }}</span>
@@ -160,10 +165,10 @@
</Card>
<Card
title="透析液流量"
- :icon="zlmsImg"
+ :icon="txqImg"
background-color="#ffffff"
class="mini-card left-row4-col"
- header-class-name="mihi-header"
+ header-class-name="mini-header"
>
<div class="item-box current-lood0emperature">
<span class="text">{{ pageData.dialysisFluidFlowRate }}</span>
@@ -175,7 +180,7 @@
<div class="right-box-row1">
<Card
title="治疗状态"
- :icon="zlmsImg"
+ :icon="txztImg"
background-color="#ffffff"
class="mini-card right-box-row1-col1"
header-class-name="mini-header"
@@ -186,7 +191,7 @@
</Card>
<Card
title="脱水量详情"
- :icon="zlmsImg"
+ :icon="cljdImg"
background-color="#ffffff"
class="mini-card right-box-row1-col2"
header-class-name="mini-header"
@@ -220,18 +225,32 @@
<div class="right-box-row2">
<Card
title="时间进度"
- :icon="zlmsImg"
+ :icon="sjjdImg"
background-color="#ffffff"
class="mini-card right-box-row2-item"
header-class-name="mini-header"
>
- <div class="item-box">
- <div class="item-num"></div>
+ <div class="progress-box">
+ <div class="item-num">
+ {{ jgTime4(pageData.dialysisDuration) }}/{{
+ pageData.prescriptionDialysisDuration
+ }}:{{ pageData.prescriptionDialysisDurationMin }}
+ </div>
+ <ProgressBar
+ :percent="
+ (Number(pageData.dialysisDuration) /
+ (Number(pageData.prescriptionDialysisDuration) * 60)) *
+ 100
+ "
+ color="#70A3DD"
+ backgroundColor="#D6DEF1"
+ borderRadius="50%"
+ />
</div>
</Card>
<Card
title="超滤进度"
- :icon="zlmsImg"
+ :icon="cljdImg"
background-color="#ffffff"
class="mini-card right-box-row2-item"
header-class-name="mini-header"
@@ -245,7 +264,7 @@
<ProgressBar
:percent="
(pageData.currentDehydrationVolume /
- pageData.currentDehydrationVolume) *
+ pageData.prescriptionDehydrationVolume) *
100
"
color="#70CAAE"
@@ -258,7 +277,7 @@
<div class="right-box-row3">
<Card
title="临时医嘱"
- :icon="zlmsImg"
+ :icon="yizhuImg"
background-color="#ffffff"
class="mini-card right-box-row2-item"
header-class-name="mini-header"
@@ -289,8 +308,9 @@
class="btn"
/>
<BlockBotttom
+ v-if="!whetherDialysisHasBeenEnded"
:icon="kaiShiImg"
- text="j结束透析"
+ text="结束透析"
backgroundColor="#E6A23C"
@click="() => onEndClick()"
class="btn"
@@ -300,8 +320,10 @@
</div>
</template>
<script lang="ts" setup name="UnderTreatment">
-import { computed, ref, onMounted, onBeforeUnmount } from "vue";
+import { computed, ref, onMounted, onBeforeUnmount, watch } from "vue";
import * as echarts from "echarts";
+import dayjs from "dayjs";
+
// @ts-ignore
import Card from "../components/Card.vue";
// @ts-ignore
@@ -317,13 +339,24 @@
formatTestFlag,
EMedStatus,
} from "@/store/type/bedsideAuxiliaryScreen.type";
-import type { KtvItem } from "@/store/type/bedsideAuxiliaryScreen.type";
-import { formatDate } from "@/utils/formatTime";
+import type {
+ KtvItem,
+ MonitoringRecord,
+} from "@/store/type/bedsideAuxiliaryScreen.type";
+import { formatDate, jgTime4, jgTime5 } from "@/utils/formatTime";
import zlmsImg from "@/img/zlms.png";
import dingShiImg from "@/img/dingshi2.png";
import jiaoHaoImg from "@/img/jiaoHao.png";
import kaiShiImg from "@/img/kaiShi.png";
import addImg from "@/img/add.png";
+import txqImg from "@/img/txq.png";
+import xinlvImg from "@/img/xinlv.png";
+import xinLv2Img from "@/img/xinlv2.png";
+import txztImg from "@/img/txzt.png";
+import cljdImg from "@/img/cljd.png";
+import sjjdImg from "@/img/sjjd.png";
+import yizhuImg from "@/img/yizhu.png";
+import { ElMessage } from "element-plus";
interface Props {
height: number;
@@ -334,6 +367,8 @@
// ktv趋势图的
const ktvListEchartRef = ref<HTMLElement | null>(null);
+// 血压脉搏趋势图的
+const bloodPressureAndPulseEchartRef = ref<HTMLElement | null>(null);
const pageData = computed(() => {
return Object.assign(bedsideAuxiliaryScreenStore.deviceData.underTreatment, {
@@ -342,7 +377,7 @@
});
const treatmentStatusText = computed(() => {
- const status = bedsideAuxiliaryScreenStore.deviceData.treatmentStatus;
+ const status = +bedsideAuxiliaryScreenStore.deviceData.treatmentStatus;
if (status === EMedStatus.NOT_CHECKED_IN) return "未签到";
if (status === EMedStatus.SIGNED_IN) return "已签到";
if (status === EMedStatus.DURING_DIALYSIS) return "透析中";
@@ -352,12 +387,33 @@
return "未知状态";
});
-// const;
+/** 是否已结束透析 */
+const whetherDialysisHasBeenEnded = computed(() => {
+ return (
+ +bedsideAuxiliaryScreenStore.deviceData.treatmentStatus >= EMedStatus.END
+ );
+});
+
+watch(
+ () => pageData.value.ktvList,
+ (newVal) => {
+ generateKtvListEchart(newVal);
+ },
+ { deep: true }
+);
+
+watch(
+ () => pageData.value.monitoringRecord,
+ (newVal) => {
+ generatBloodPressureAndPulseEchart(newVal);
+ },
+ { deep: true }
+);
/** 生成ktv趋势图 */
const generateKtvListEchart = (ktvList: KtvItem[]) => {
if (!ktvListEchartRef.value) return;
- if (!ktvList || ktvList.length === 0) return;
+ // if (!ktvList || ktvList.length === 0) return;
// 检查是否已经有实例
let chart = echarts.getInstanceByDom(ktvListEchartRef.value);
@@ -366,25 +422,25 @@
}
const option = {
+ grid: {
+ top: 6,
+ bottom: 20,
+ right: 20,
+ },
xAxis: {
type: "category",
- data: ktvList.map((item) => formatDate(new Date(item.时间), "HH:mm")),
+ data: ktvList.map((item) => dayjs(item.时间).format("HH:mm")),
axisLine: { show: true },
axisTick: { show: true },
- // axisLabel: {
- // margin: 5, // 控制文字与轴的距离,尽量小
- // fontSize: 12,
- // },
+ splitLine: { show: false },
},
yAxis: {
type: "value",
axisLine: { show: true },
axisTick: { show: true },
- // axisLabel: {
- // margin: 5,
- // fontSize: 12,
- // },
- splitLine: { show: true },
+ splitLine: { show: false },
+
+ splitNumber: 4,
},
series: [
{
@@ -410,27 +466,208 @@
chart.setOption(option, true); // 第二个参数为 true 表示全量更新
};
+/** 生成血压脉搏趋势图 */
+const generatBloodPressureAndPulseEchart = (
+ bloodPressureAndPulses: MonitoringRecord[]
+) => {
+ if (!bloodPressureAndPulseEchartRef.value) return;
+
+ let chart = echarts.getInstanceByDom(bloodPressureAndPulseEchartRef.value);
+ if (!chart) {
+ chart = echarts.init(bloodPressureAndPulseEchartRef.value);
+ }
+
+ const telescopicPressureDatas: number[] = []; // 伸缩压
+ const diastolicPressureDatas: number[] = []; // 舒张压
+ const pulseDatas: number[] = []; // 脉搏
+ const xAxisData: string[] = []; // 横坐标
+
+ bloodPressureAndPulses.forEach((item, index) => {
+ telescopicPressureDatas.push(+item.伸缩压);
+ diastolicPressureDatas.push(+item.舒张压);
+ pulseDatas.push(+item.脉搏);
+ xAxisData.push(String(index + 1));
+ });
+
+ const option = {
+ grid: [
+ { top: "10%", height: "25%", left: 30, right: 20 },
+ { top: "38%", height: "25%", left: 30, right: 20 },
+ { top: "66%", height: "25%", left: 30, right: 20 },
+ ],
+ tooltip: {
+ trigger: "axis",
+ },
+ xAxis: [
+ {
+ type: "category",
+ data: xAxisData,
+ boundaryGap: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: false },
+ splitLine: { show: false },
+ gridIndex: 0,
+ },
+ {
+ type: "category",
+ data: xAxisData,
+ boundaryGap: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: false },
+ splitLine: { show: false },
+ gridIndex: 1,
+ },
+ {
+ type: "category",
+ data: xAxisData,
+ boundaryGap: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: true }, // 最下面一层显示时间轴
+ splitLine: { show: false },
+ gridIndex: 2,
+ },
+ ],
+ yAxis: [
+ {
+ type: "value",
+ show: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: false },
+ splitLine: { show: false },
+ min: "dataMin", // 自动以数据最小值为最小值
+ max: "dataMax",
+ gridIndex: 0,
+ },
+ {
+ type: "value",
+ show: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: false },
+ splitLine: { show: false },
+ min: "dataMin", // 自动以数据最小值为最小值
+ max: "dataMax",
+ gridIndex: 1,
+ },
+ {
+ type: "value",
+ show: false,
+ axisLine: { show: false },
+ axisTick: { show: false },
+ axisLabel: { show: false },
+ splitLine: { show: false },
+ min: "dataMin", // 自动以数据最小值为最小值
+ max: "dataMax",
+ gridIndex: 2,
+ },
+ ],
+ series: [
+ {
+ name: "伸缩压",
+ xAxisIndex: 0,
+ yAxisIndex: 0,
+ data: wrapData(telescopicPressureDatas),
+ type: "line",
+ smooth: false,
+ symbol: "circle",
+ symbolSize: 6,
+ lineStyle: { width: 2, color: "#FE0201" },
+ itemStyle: { color: "#FE0201" },
+ label: { color: "#FE0201" },
+ },
+ {
+ name: "舒张压",
+ xAxisIndex: 1,
+ yAxisIndex: 1,
+ data: wrapData(diastolicPressureDatas),
+ type: "line",
+ smooth: false,
+ symbol: "circle",
+ symbolSize: 6,
+ lineStyle: { width: 2, color: "#70A3DD" },
+ itemStyle: { color: "#70A3DD" },
+ label: { color: "#70A3DD" },
+ },
+ {
+ name: "脉搏",
+ xAxisIndex: 2,
+ yAxisIndex: 2,
+ data: wrapData(pulseDatas),
+ type: "line",
+ smooth: false,
+ symbol: "circle",
+ symbolSize: 6,
+ lineStyle: { width: 2, color: "#8079CB" },
+ itemStyle: { color: "#8079CB" },
+ label: { color: "#8079CB" },
+ },
+ ],
+ };
+
+ chart.setOption(option);
+};
+
+// 给首尾点加上 label
+const wrapData = (arr: number[]) => {
+ return arr.map((v, i) => ({
+ value: v,
+ label: {
+ show: i === 0 || i === arr.length - 1,
+ position: "top",
+ fontSize: 12,
+ },
+ }));
+};
+
/** 定时任务 */
const onScheduledTasksClick = () => {};
/** 叫号 */
-const onCallBumberClick = () => {};
+const onCallBumberClick = () => {
+ ElMessage({
+ message: "功能开发中,敬请期待!",
+ type: "warning",
+ });
+};
/** 添加记录 */
-const onAddRecordClick = () => {};
+const onAddRecordClick = () => {
+ ElMessage({
+ message: "功能开发中,敬请期待!",
+ type: "warning",
+ });
+};
/** 结束透析 */
-const onEndClick = () => {};
+const onEndClick = () => {
+ ElMessage({
+ message: "功能开发中,敬请期待!",
+ type: "warning",
+ });
+};
onMounted(() => {
// 生成ktv趋势图
generateKtvListEchart(pageData.value.ktvList);
+ generatBloodPressureAndPulseEchart(pageData.value.monitoringRecord);
});
onBeforeUnmount(() => {
// 销毁图表实例
if (ktvListEchartRef.value) {
const chart = echarts.getInstanceByDom(ktvListEchartRef.value);
+ if (chart) {
+ chart.dispose();
+ }
+ }
+ if (bloodPressureAndPulseEchartRef.value) {
+ const chart = echarts.getInstanceByDom(
+ bloodPressureAndPulseEchartRef.value
+ );
if (chart) {
chart.dispose();
}
@@ -709,11 +946,18 @@
padding: 2px;
}
.ktv-card {
+ overflow: visible;
.card-header {
margin-bottom: 0px;
}
+ ::v-deep(.card-main) {
+ overflow: visible !important;
+ div {
+ overflow: visible;
+ }
+ }
}
- :deep(.mihi-header) {
+ :deep(.mini-header) {
flex: 0 0 4px;
.card-icon {
width: 4px;
--
Gitblit v1.8.0