单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-07-24 9135933a27832ec2234b5e074d88192fb4bf52d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<template>
  <div class="under-treatment-container" :style="{ '--height': height + 'px' }">
    <div class="left-box">
      <div class="left-row1">
        <div class="left-row1-col1">
          <el-image
            :src="pageData.patientPhone"
            style="width: 100%; height: 100%"
          >
            <template #placeholder>
              <div class="image-slot">加载中<span class="dot">...</span></div>
            </template>
          </el-image>
        </div>
        <div class="left-row1-col2">
          <Card
            title="治疗模式"
            :icon="zlmsImg"
            background-color="#ffffff"
            class="mini-card left-row1-col2-row1"
            header-class-name="mihi-header"
          >
            <div class="item-box dialysis-mode-content">
              <div class="dialysis-mode-content-box">
                <span class="mini-text">{{
                  formatSubstituteMode(pageData.substituteMode)
                }}</span>
                <span class="text">{{ pageData.dialysisPlan }}</span>
              </div>
            </div>
          </Card>
          <Card
            title="处方备注"
            :icon="zlmsImg"
            background-color="#ffffff"
            class="mini-card left-row1-col2-item-row2"
            header-class-name="mihi-header"
          >
            <div class="prescription-remarks">
              {{ pageData.prescriptionRemarks }}
            </div>
          </Card>
        </div>
        <div class="left-row1-col3">
          <Card
            title="透析器"
            :icon="zlmsImg"
            background-color="#ffffff"
            class="mini-card left-row1-col3-row1"
            header-class-name="mihi-header"
          >
            <div class="item-box prescription-ehydration-olume">
              <span class="text">{{ pageData.dialyzer }}</span>
            </div>
          </Card>
          <Card
            title="异常指标"
            :icon="zlmsImg"
            background-color="#ffffff"
            class="mini-card left-row1-col3-row2"
            header-class-name="mihi-header"
          >
            <div class="dialysis-mode-content">
              <span
                v-for="(item, index) in pageData.abnormalItems"
                :key="index"
                class="abnormal-indicator"
                :style="{ color: formatTestColr(item.结果标记) }"
              >
                {{ getItemName(item.项目名称) }}
                {{ formatTestFlag(item.结果标记) }}
              </span>
            </div>
          </Card>
        </div>
      </div>
      <div class="left-row2">
        <Card
          title="血温监测"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row2-col1"
          header-class-name="mihi-header"
        >
          <div class="item-box current-lood0emperature">
            <span class="text">{{ pageData.currentBloodTemperature }}</span>
          </div>
        </Card>
        <Card
          title="血压监测"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row2-col2"
          header-class-name="mihi-header"
        >
          <div class="item-box venous-pressure">
            <span class="text"
              >{{ pageData.venousPressure }}/{{
                pageData.transmembranePressure
              }}</span
            >
          </div>
        </Card>
        <Card
          title="血压脉搏趋势图"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row2-col3"
          header-class-name="mihi-header"
        >
          <div class=""></div>
        </Card>
      </div>
      <div class="left-row3">
        <Card
          title="血容量监测"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row3-col1"
          header-class-name="mihi-header"
        >
          <div class="item-box current-lood0emperature">
            <span class="text">{{ pageData.bloodVolumeMonitoring }}</span>
          </div>
        </Card>
        <Card
          title="KTV监测"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row3-col2"
          header-class-name="mihi-header"
        >
          <div class="item-box venous-pressure">
            <span class="text">{{ pageData.ktv }}</span>
          </div>
        </Card>
        <Card
          title="KTV趋势图"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card ktv-card left-row3-col3"
          header-class-name="mihi-header"
        >
          <div style="height: 100%">
            <div ref="ktvListEchartRef" style="width: 100%; height: 100%"></div>
          </div>
        </Card>
      </div>
      <div class="left-row4">
        <Card
          title="血流量"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row4-col"
          header-class-name="mihi-header"
        >
          <div class="item-box current-lood0emperature">
            <span class="text">{{ pageData.bloodFlow }}</span>
          </div>
        </Card>
        <Card
          title="透析液流量"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card left-row4-col"
          header-class-name="mihi-header"
        >
          <div class="item-box current-lood0emperature">
            <span class="text">{{ pageData.dialysisFluidFlowRate }}</span>
          </div>
        </Card>
      </div>
    </div>
    <div class="right-box">
      <div class="right-box-row1">
        <Card
          title="治疗状态"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card right-box-row1-col1"
          header-class-name="mini-header"
        >
          <div class="item-box treatment-status">
            <span class="text">{{ treatmentStatusText }}</span>
          </div>
        </Card>
        <Card
          title="脱水量详情"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card right-box-row1-col2"
          header-class-name="mini-header"
        >
          <div class="dehydrated-level">
            <div class="dehydrated-level-item">
              <span class="item-left"
                >平均脱水量:{{ pageData.averageDehydrationRate }} L</span
              >
              <span class="item-right">(最近3周9次)</span>
            </div>
            <div class="dehydrated-level-item">
              <div class="item-left">
                <span
                  >最大脱水量:{{ pageData.maximumDehydrationCapacity }} L</span
                >
                <template v-if="pageData.maximumDehydrationDuration"
                  >/
                  <span class="level-dete">{{
                    pageData.maximumDehydrationDuration
                  }}</span>
                </template>
              </div>
              <span class="item-right"
                >({{ pageData.maximumDehydrationCapacityDate }})</span
              >
            </div>
          </div>
        </Card>
      </div>
      <div class="right-box-row2">
        <Card
          title="时间进度"
          :icon="zlmsImg"
          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>
        </Card>
        <Card
          title="超滤进度"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card right-box-row2-item"
          header-class-name="mini-header"
        >
          <div class="progress-box">
            <div class="item-num">
              {{ pageData.currentDehydrationVolume }}/{{
                pageData.currentDehydrationVolume
              }}({{ pageData.currentUltrafiltrationRate }})
            </div>
            <ProgressBar
              :percent="
                (pageData.currentDehydrationVolume /
                  pageData.currentDehydrationVolume) *
                100
              "
              color="#70CAAE"
              backgroundColor="#D6DEF1"
              borderRadius="50%"
            />
          </div>
        </Card>
      </div>
      <div class="right-box-row3">
        <Card
          title="临时医嘱"
          :icon="zlmsImg"
          background-color="#ffffff"
          class="mini-card right-box-row2-item"
          header-class-name="mini-header"
        >
          <DoctorAdvice :list="pageData.doctorAdvice" />
        </Card>
      </div>
      <div class="right-box-row4">
        <BlockBotttom
          :icon="dingShiImg"
          text="定时任务"
          backgroundColor="#20C6B6"
          @click="() => onScheduledTasksClick()"
          class="btn"
        />
        <BlockBotttom
          :icon="jiaoHaoImg"
          text="叫号"
          backgroundColor="#20C6B6"
          @click="() => onCallBumberClick()"
          class="btn"
        />
        <BlockBotttom
          :icon="addImg"
          text="添加记录"
          backgroundColor="#409EFF"
          @click="() => onAddRecordClick()"
          class="btn"
        />
        <BlockBotttom
          :icon="kaiShiImg"
          text="j结束透析"
          backgroundColor="#E6A23C"
          @click="() => onEndClick()"
          class="btn"
        />
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup name="UnderTreatment">
import { computed, ref, onMounted, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
// @ts-ignore
import Card from "../components/Card.vue";
// @ts-ignore
import ProgressBar from "../components/ProgressBar.vue";
import DoctorAdvice from "../components/DoctorAdvice/index.vue";
// @ts-ignore
import BlockBotttom from "../components/BlockBotttom.vue";
import { useBedsideAuxiliaryScreenStore } from "@/store/bedsideAuxiliaryScreen";
import {
  formatSubstituteMode,
  formatTestColr,
  getItemName,
  formatTestFlag,
  EMedStatus,
} from "@/store/type/bedsideAuxiliaryScreen.type";
import type { KtvItem } from "@/store/type/bedsideAuxiliaryScreen.type";
import { formatDate } 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";
 
interface Props {
  height: number;
}
const props = defineProps<Props>();
 
const bedsideAuxiliaryScreenStore = useBedsideAuxiliaryScreenStore();
 
// ktv趋势图的
const ktvListEchartRef = ref<HTMLElement | null>(null);
 
const pageData = computed(() => {
  return Object.assign(bedsideAuxiliaryScreenStore.deviceData.underTreatment, {
    patientPhone: bedsideAuxiliaryScreenStore.deviceData.patientPhone,
  });
});
 
const treatmentStatusText = computed(() => {
  const status = bedsideAuxiliaryScreenStore.deviceData.treatmentStatus;
  if (status === EMedStatus.NOT_CHECKED_IN) return "未签到";
  if (status === EMedStatus.SIGNED_IN) return "已签到";
  if (status === EMedStatus.DURING_DIALYSIS) return "透析中";
  if (status === EMedStatus.END) return "已结束";
  if (status === EMedStatus.CHECKED) return "已检查";
  if (status === EMedStatus.ARCHIVED) return "已归档";
  return "未知状态";
});
 
// const;
 
/** 生成ktv趋势图 */
const generateKtvListEchart = (ktvList: KtvItem[]) => {
  if (!ktvListEchartRef.value) return;
  if (!ktvList || ktvList.length === 0) return;
 
  // 检查是否已经有实例
  let chart = echarts.getInstanceByDom(ktvListEchartRef.value);
  if (!chart) {
    chart = echarts.init(ktvListEchartRef.value);
  }
 
  const option = {
    xAxis: {
      type: "category",
      data: ktvList.map((item) => formatDate(new Date(item.时间), "HH:mm")),
      axisLine: { show: true },
      axisTick: { show: true },
      // axisLabel: {
      //   margin: 5, // 控制文字与轴的距离,尽量小
      //   fontSize: 12,
      // },
    },
    yAxis: {
      type: "value",
      axisLine: { show: true },
      axisTick: { show: true },
      // axisLabel: {
      //   margin: 5,
      //   fontSize: 12,
      // },
      splitLine: { show: true },
    },
    series: [
      {
        data: ktvList.map((item) => item.ktv),
        type: "line",
        smooth: false,
        symbol: "circle",
        symbolSize: 6,
        lineStyle: {
          width: 2,
          color: "#70CAAE",
        },
        itemStyle: {
          color: "#70CAAE",
        },
      },
    ],
    tooltip: {
      trigger: "axis",
    },
  };
 
  chart.setOption(option, true); // 第二个参数为 true 表示全量更新
};
 
/** 定时任务 */
const onScheduledTasksClick = () => {};
 
/** 叫号 */
const onCallBumberClick = () => {};
 
/** 添加记录 */
const onAddRecordClick = () => {};
 
/** 结束透析 */
const onEndClick = () => {};
 
onMounted(() => {
  // 生成ktv趋势图
  generateKtvListEchart(pageData.value.ktvList);
});
 
onBeforeUnmount(() => {
  // 销毁图表实例
  if (ktvListEchartRef.value) {
    const chart = echarts.getInstanceByDom(ktvListEchartRef.value);
    if (chart) {
      chart.dispose();
    }
  }
});
</script>
 
<style lang="less" scoped>
* {
  box-sizing: border-box;
}
 
.under-treatment-container {
  display: flex;
  align-items: flex-start;
  height: var(--height);
  gap: 4px;
  padding-bottom: 2px;
  overflow: hidden;
  .left-box {
    width: 58.25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
 
    .left-row1 {
      width: 100%;
      height: 38.97%;
      display: flex;
      gap: 4px;
 
      .left-row1-col1,
      .left-row1-col2,
      .left-row1-col3 {
        height: 100%;
      }
 
      .left-row1-col1 {
        width: 26.94%;
        border-radius: 2px;
        overflow: hidden;
      }
      .left-row1-col2 {
        width: 26.43%;
        display: flex;
        flex-direction: column;
        gap: 4px;
        .left-row1-col2-row1 {
          height: 36.62%;
        }
 
        .left-row1-col2-item-row2 {
          height: 63.38%;
        }
      }
      .left-row1-col3 {
        width: 46.63%;
        display: flex;
        flex-direction: column;
        gap: 4px;
        .left-row1-col3-row1 {
          height: 36.62%;
        }
        .left-row1-col3-row2 {
          height: 63.38%;
          .dialysis-mode-content {
            height: 100%;
            .abnormal-indicator {
              display: inline-block;
              margin-right: 6px;
              margin-bottom: 4px;
              font-family: PingFangSC, PingFang SC;
              font-weight: 600;
              font-size: 5px;
              line-height: 6px;
              text-align: left;
              font-style: normal;
            }
          }
        }
      }
    }
    .left-row2 {
      width: 100%;
      height: 21.03%;
      display: flex;
      gap: 4px;
      .left-row2-col1 {
        width: 26.94%;
      }
      .left-row2-col2 {
        width: 26.43%;
      }
      .left-row2-col3 {
        width: 46.62%;
      }
    }
    .left-row3 {
      width: 100%;
      height: 21.03%;
      display: flex;
      gap: 4px;
      .left-row3-col1 {
        width: 26.94%;
      }
      .left-row3-col2 {
        width: 26.43%;
      }
      .left-row3-col3 {
        width: 46.62%;
      }
    }
    .left-row4 {
      width: 100%;
      height: 11.79%;
      display: flex;
      gap: 4px;
      .left-row4-col {
        width: 50%;
      }
    }
  }
  .right-box {
    width: 41.75%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    .right-box-row1,
    .right-box-row2,
    .right-box-row3 .right-box-row4 {
      width: 100%;
    }
    .right-box-row1 {
      height: 14.44%;
      display: flex;
      gap: 4px;
      .right-box-row1-col1 {
        width: 36.17%;
      }
      .right-box-row1-col2 {
        width: 63.83%;
      }
    }
    .right-box-row2 {
      height: 25%;
      display: flex;
      gap: 4px;
      .right-box-row2-item {
        width: 50%;
      }
    }
    .right-box-row3 {
      height: 47.78%;
    }
 
    .right-box-row4 {
      height: 12.78%;
      background: #ffffff;
      border-radius: 2px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 13px;
      .btn {
        margin-left: 9px;
      }
    }
  }
 
  .progress-box {
    display: flex;
    align-items: center;
    flex-direction: column;
    .item-num {
      margin-bottom: 4px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 600;
      font-size: 8px;
      color: #333333;
      text-align: left;
      font-style: normal;
    }
  }
 
  .item-box {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: PingFangSC, PingFang SC;
    font-weight: 600;
    font-size: 8px;
    color: #70a3dd;
    text-align: center;
    font-style: normal;
    &.dialysis-mode-content {
      color: #d58e56;
      display: flex;
      align-items: center;
      // align-items: baseline;
      .dialysis-mode-content-box {
        display: flex;
        align-items: flex-end;
        line-height: 1;
        .mini-text {
          margin-right: 1px;
          font-size: 5px;
          color: #c9a589;
        }
      }
    }
    &.treatment-status {
      color: #70a3dd;
    }
    &.prescription-ehydration-olume {
      color: #8079cb;
    }
    &.current-lood0emperature {
      color: #70a3dd;
      font-size: 9px;
    }
    &.venous-pressure {
      color: #70a3dd;
      font-size: 9px;
    }
  }
  .prescription-remarks {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 5px;
    color: #d58e56;
    line-height: 7px;
    text-align: left;
    font-style: normal;
  }
  .dehydrated-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    .dehydrated-level-item {
      width: 100%;
      display: flex;
      align-items: center;
      .item-left {
        flex: 1;
        font-family: PingFangSC, PingFang SC;
        font-weight: 600;
        font-size: 4px;
        color: #333333;
        line-height: 6px;
        font-style: normal;
        .level-dete {
          font-family: PingFangSC, PingFang SC;
          font-weight: 600;
          font-size: 4px;
          color: #d58e56;
          text-align: left;
          font-style: normal;
        }
      }
      .item-right {
        font-family: PingFangSC, PingFang SC;
        font-weight: 600;
        font-size: 4px;
        color: #777777;
        line-height: 6px;
        font-style: normal;
      }
    }
  }
  // card header class
  .mini-card {
    padding: 2px;
  }
  .ktv-card {
    .card-header {
      margin-bottom: 0px;
    }
  }
  :deep(.mihi-header) {
    flex: 0 0 4px;
    .card-icon {
      width: 4px;
      height: 4px;
    }
    .card-title {
      font-size: 4px;
    }
  }
  :deep(.big-header) {
    flex: 0 0 9px;
    .card-icon {
      width: 9px;
      height: 9px;
    }
    .card-title {
      font-size: 5px;
    }
  }
}
</style>