单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-09-12 5548b8c1c50947c862c85d0c4048459a39482d3b
src/views/mobile/bedsideAuxiliaryScreen/pages/SignedIn.vue
@@ -100,6 +100,8 @@
                    item.是否为追加 ? item.追加剂量 : item.维持剂量
                  }}{{ item.单位 }}</span
                >
              </div>
              <div class="list-item-num">
                <span>总量:{{ item.总量 }}{{ item.单位 }}</span>
              </div>
            </div>
@@ -127,7 +129,7 @@
                <template v-if="pageData.最近最大脱水量透析时长"
                  >/
                  <span class="level-dete">{{
                    pageData.最近最大脱水量透析时长
                    formatDuration(pageData.最近最大脱水量透析时长)
                  }}</span>
                </template>
              </div>
@@ -312,7 +314,7 @@
  </div>
</template>
<script lang="ts" setup name="SignedIn">
import { computed, defineAsyncComponent, onMounted, ref } from "vue";
import { computed, defineAsyncComponent, onMounted, ref, watch } from "vue";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
dayjs.locale("zh-cn");
@@ -412,6 +414,13 @@
    ? value
    : Number(value.toFixed(1));
  return formattedValue;
});
watch(
  () => pageData.value.四点血压图数据,
  (newVal) => {
    genderBloodPressureRectangularChart(newVal);
});
/** 点击定时任务 */
@@ -569,6 +578,12 @@
  const cylinderY = chartHeight;
  const cylinderRadius = 6;
  const cylinderHeight = 计算脱水量刻度 * (datas?.[0]?.超滤总量 || 0);
  const 体重增长_透前减干体重 = weightGain2.value;
  const 透前减干体重减超滤总量差值 =
  Math.round(
    (体重增长_透前减干体重 - (datas?.[0]?.超滤总量 || 0)) * 10
  ) / 10;
  drawCylinder(
    ctx,
@@ -580,7 +595,9 @@
    cylinderHeight,
    datas?.[0]?.超滤总量?.toString() ?? "0 L",
    datas?.[0]?.脱水百分比 ?? 0,
    datas?.[0]?.透后体重减干体重的差值 ?? 0
    datas?.[0]?.透后体重减干体重的差值 ?? 0,
    体重增长_透前减干体重,
    透前减干体重减超滤总量差值,
  );
  ctx.restore(); // 恢复
@@ -598,7 +615,9 @@
  height: number,
  超滤总量: string, // 超滤总量
  脱水百分比: number, // 脱水百分比
  透后体重减干体重的差值: number // 透后体重减干体重的差值
  透后体重减干体重的差值: number, // 透后体重减干体重的差值
  体重增长_透前减干体重: number, // 体重增长_透前减干体重
  透前减干体重减超滤总量差值: number, // 透前减干体重减超滤总量差值
) => {
  ctx.beginPath();
  ctx.arc(x, y + height, radius, 0, Math.PI * 2);
@@ -624,21 +643,54 @@
  ctx.fill();
  ctx.stroke();
  const cylinderWidth = radius;
  const textX = x + cylinderWidth + 20; // 文本位置在圆柱体右侧
  const baseFontSize = 16;
  // 添加文本说明
  ctx.font = `${baseFontSize * scale}px Arial`;
  ctx.textAlign = "center";
  ctx.fillStyle = "#409EFF";
  ctx.fillText(超滤总量, x, canvasHeight - height - 5); // 文本位于圆柱上方一点
  if (透后体重减干体重的差值 > 0) {
  // 如果超滤总量 与 体重增长_透前减干体重 相等,则显示 "/超滤总量"
  if (Number(超滤总量) && 体重增长_透前减干体重 === Number(超滤总量)) {
      ctx.font = `${baseFontSize * scale}px Arial`;
      ctx.textAlign = "center";
      ctx.fillStyle = "#07c160";
      ctx.fillText('/' + 超滤总量, textX, canvasHeight - height + height * 0.3 + 10);
  } else {
    // 透析前-干体重
    ctx.font = `${baseFontSize * scale}px Arial`;
    ctx.textAlign = "center";
    ctx.fillStyle = "#409EFF";
    ctx.fillText(体重增长_透前减干体重 + '', textX, canvasHeight - height + 10);
    // 超滤总量
    ctx.font = `${baseFontSize * scale}px Arial`;
    ctx.textAlign = "center";
    ctx.fillStyle = "#07c160";
    ctx.fillText(超滤总量, textX, canvasHeight - height + height * 0.3 + 10);
  }
  if (透前减干体重减超滤总量差值 > 0) {
    ctx.font = `${baseFontSize * scale}px Arial`;
    ctx.textAlign = "center";
    ctx.fillStyle = "#000000";
    ctx.fillText(透后体重减干体重的差值 + "", x, canvasHeight - 5); // 文本位于圆柱上方一点
    ctx.fillText(透前减干体重减超滤总量差值 + "", textX, canvasHeight - 10); // 文本位于圆柱上方一点
  }
};
function formatDuration(input: string): string {
  const match = input.match(/(\d+)小时(\d+)分钟/);
  if (!match) return input; // 如果不符合格式,直接返回原字符串
  const hours = parseInt(match[1], 10);
  const minutes = parseInt(match[2], 10);
  if (minutes > 0) {
    return `${hours}h${minutes}min`;
  }
  return `${hours}h`;
}
onMounted(() => {
  genderBloodPressureRectangularChart(pageData.value.四点血压图数据);
});
@@ -775,7 +827,7 @@
              text-align: left;
              font-style: normal;
              .list-item-name {
                margin-bottom: 2px;
                // margin-bottom: 2px;
              }
            }
          }