单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-06-20 0a384d93299aa97e988122aa7d3e992eede7be04
src/views/deviceWindoes2.vue
@@ -2,7 +2,7 @@
  <div class="divice">
    <!-- {{数据初始化}} -->
    <div class="youzhiliao" style="height: 100%" v-if="deviceData.患者姓名">
      <div class="toubu" style="height: 11%">
      <div id="toubu" class="toubu" style="height: 11%">
        <el-row
          v-if="deviceData.患者姓名 !== ''"
          style="
@@ -79,6 +79,8 @@
          </div>
        </el-row>
      </div>
      <el-carousel v-if="contentHeight > 0" height="auto" :autoplay="false" motion-blur :initial-index="0">
        <el-carousel-item :style="{ height: (contentHeight - 10) + 'px' }">
      <div class="chongjian" style="height: 50%">
        <el-row :gutter="20" style="height: 100%; padding: 20px 20px 10px 20px">
          <el-col :span="6" style="height: 100%; padding-bottom: 10px">
@@ -1088,6 +1090,11 @@
          </el-col>
        </el-row>
      </div>
      </el-carousel-item>
      <el-carousel-item :style="{ height: (contentHeight - 10) + 'px' }">
        <DoctorAdvice :height="(contentHeight - 10)" :list="deviceData.透析单医嘱列表" />
      </el-carousel-item>
    </el-carousel>
    </div>
    <div v-else style="height: 100%">
      <div class="toubu" style="height: 11%">
@@ -1676,11 +1683,13 @@
  watch,
  onUnmounted,
  onBeforeUnmount,
  nextTick
} from "vue";
import { Local } from "../utils/storage";
import * as echarts from "echarts";
import { jgTime4 } from "../utils/formatTime";
import { setTimeoutAlert } from "../utils/httpApi";
import DoctorAdvice from '../components/doctorAdvice/index.vue';
// 创建 Audio 对象,指向 public 目录下的音频文件
const alarmSound = new Audio(alertbaojin)
@@ -1734,6 +1743,7 @@
const 当前客户耗材集合 = ref({});
const deviceData = ref({
  透析单医嘱列表: [],
  iot_传输时间: "2025-01-10 19:15:24",
  iot_当前脱水量: 2.04,
  iot_脱水目标量: 3.3,
@@ -1908,6 +1918,7 @@
const wd = ref("");
const ls = ref("");
const ddd = ref("");
const contentHeight = ref(0); // 中间内容的高度
const isShowXY = computed(() => {
  if (床旁血压计.value.zuihouTime > shishiTime.value) {
    return true;
@@ -1920,9 +1931,11 @@
  () => {
    if (床旁血压计.value.zuihouTime > shishiTime.value) {
    } else {
            nextTick(() => {
      setTimeout(() => {
        initTupiao();
      }, 500);
            });
    }
  }
);
@@ -2240,9 +2253,24 @@
      if (!xiaoduzhuangti.value) {
        initTupiao();
      }
    }, 500);
    }, 1000);
  }
);
watch(() => deviceData.value.患者姓名, (newVal: string) => {
  console.log("患者姓名变化:", newVal);
  if (newVal) {
    contentHeight.value = 0; // 重置高度
    setTimeout(() => {
    const windowHeight = window.innerHeight
    const toubu = document.getElementById('toubu')
    const toubuHeight = toubu ? toubu.offsetHeight : 0
    contentHeight.value = windowHeight - toubuHeight
    console.log("contentHeight.value: ", contentHeight.value)
    }, 500);
  }
})
const 数据初始化 = ref(false);
//创建链接对象
const creatSource = () => {
@@ -2307,9 +2335,13 @@
              dbp: dataBody?.床旁血压结果?.dbp,
              zuihouTime: date,
            };
            nextTick(() => {
            setTimeout(() => {
              initTupiao();
            }, 500);
            });
          } else if (dataBody.推送类型 === "中央监控大屏信息") {
            数据初始化.value = false;
            // loading.close()
@@ -2329,6 +2361,9 @@
            deviceData.value.属性历史列表 = dataBody?.IOT信息?.属性历史列表;
            console.log(deviceData.value.设备变化);
            deviceData.value.设备状态列表 = dataBody.IOT信息.状态列表;
            if ('透析单医嘱列表' in dataBody.透析状态) {
              deviceData.value.透析单医嘱列表 = dataBody.透析状态.透析单医嘱列表;
            }
          }
        }
      }
@@ -2580,9 +2615,14 @@
        xAxisData.push(1);
      }
      try {
        const myChart = echarts.init(
        let myChart = null;
        if (proxy.$refs["echartsDiv" + deviceData.value.设备编号]) {
          myChart = echarts.init(
          proxy.$refs["echartsDiv" + deviceData.value.设备编号]
        );
        }
        const option = {
          // backgroundColor: 床旁血压计.value.zuihouTime>shishiTime.value?'#ffffff':textcolor.value,
          backgroundColor: "#ffffff",
@@ -2619,15 +2659,22 @@
          },
          series: seriesData,
        };
        if (myChart) {
        myChart.setOption(option);
        }
      } catch (e) {
        console.log("图标渲染异常异常");
      }
    } else {
      try {
        const myChart = echarts.init(
        let myChart = null;
        if (proxy.$refs["echartsDiv" + deviceData.value.设备编号]) {
          myChart = echarts.init(
          proxy.$refs["echartsDiv" + deviceData.value.设备编号]
        );
        }
        const option = {
          backgroundColor:
@@ -2662,8 +2709,11 @@
          },
          series: [],
        };
        if (myChart) {
        myChart.setOption(option);
        }
      } catch (e) {
        console.log("图表渲染异常异常: ", e);
        console.log(
          "异常",
          proxy.$refs["echartsDiv" + deviceData.value.设备编号]
@@ -2671,7 +2721,6 @@
      }
    }
  } else if (deviceData.value.患者姓名 === "") {
    console.log("2222");
    const tbdata1 = [];
    const tbdata2 = [];
    const tbdata3 = [];
@@ -2707,15 +2756,28 @@
    }
    try {
      console.log("渲染设备");
      const myChart1 = echarts.init(
      let myChart1 = null;
      let myChart2 = null;
      let myChart3 = null;
      if (proxy.$refs["echartsDivwd" + deviceData.value.设备编号]) {
        myChart1 = echarts.init(
        proxy.$refs["echartsDivwd" + deviceData.value.设备编号]
      );
      const myChart2 = echarts.init(
      }
      if (proxy.$refs["echartsDivls" + deviceData.value.设备编号]) {
          myChart2 = echarts.init(
        proxy.$refs["echartsDivls" + deviceData.value.设备编号]
      );
      const myChart3 = echarts.init(
      }
      if (proxy.$refs["echartsDivddd" + deviceData.value.设备编号]) {
        myChart3 = echarts.init(
        proxy.$refs["echartsDivddd" + deviceData.value.设备编号]
      );
      }
      const option1 = {
        // backgroundColor: textcolor.value,
        tooltip: {
@@ -2838,9 +2900,15 @@
          },
        ],
      };
      if (myChart1) {
      myChart1.setOption(option1);
      }
      if (myChart2) {
      myChart2.setOption(option2);
      }
      if (myChart3) {
      myChart3.setOption(option3);
      }
    } catch (e) {
      console.log("图标渲染异常异常");
    }