WXL (wul)
5 天以前 17efc8b0fb7d3fa66eb8e22f32b81e3e14bcd7f6
src/views/index.vue
@@ -3,7 +3,7 @@
    <div class="home" style="margin-top: 40px; margin-left: 20px">
      <!-- 头部两个 -->
      <el-row :gutter="20">
        <el-col :span="11">
        <el-col :span="8">
          <!-- 就诊统计盒子 -->
          <div class="grid-content bg-purple headerBox bgc1">
            <div class="title">
@@ -45,7 +45,7 @@
            </el-row>
          </div>
        </el-col>
        <el-col :span="9">
        <el-col :span="12">
          <div class="grid-content bg-purple headerBox bgc2">
            <div class="title">
              出院服务
@@ -60,7 +60,8 @@
              <span>{{ endatd }} ~ {{ statd }}</span>
            </div>
            <el-row :gutter="20">
              <el-col :span="10">
              <!-- 出院就诊量 -->
              <el-col :span="6">
                <div class="home-user-task-stats">
                  <p style="color: red">{{ DischargeData.rc }}</p>
                </div>
@@ -68,12 +69,31 @@
                  <p>出院就诊量(人次)</p>
                </div>
              </el-col>
              <el-col :span="10">
              <!-- 首次服务 -->
              <el-col :span="6">
                <div class="home-user-task-stats">
                  <p style="color: red">{{ DischargeData.rs }}</p>
                  <div class="text-color2">
                    <p>出院服务量(人次)</p>
                  </div>
                  <p style="color: #67c23a">{{ DischargeData.scsf }}</p>
                </div>
                <div class="text-color2" style="color: #67c23a">
                  <p>首次服务(人次)</p>
                </div>
              </el-col>
              <!-- 再次服务 -->
              <el-col :span="6">
                <div class="home-user-task-stats">
                  <p style="color: #e6a23c">{{ DischargeData.zcsf }}</p>
                </div>
                <div class="text-color2" style="color: #e6a23c">
                  <p>再次服务(人次)</p>
                </div>
              </el-col>
              <!-- 专病服务 -->
              <el-col :span="6">
                <div class="home-user-task-stats">
                  <p style="color: #409eff">{{ DischargeData.zbsf }}</p>
                </div>
                <div class="text-color2" style="color: #409eff">
                  <p>专病服务(人次)</p>
                </div>
              </el-col>
            </el-row>
@@ -128,13 +148,18 @@
        </el-col>
        <!-- 右边列表 -->
        <el-col :span="4" class="aside">
          <div class="grid-content bg-purple" style="margin-top: -180px">
          <div class="grid-contentsa bg-purple" style="margin-top: -180px">
            <div class="title">
              科室服务量
              <span>{{ endatd }} ~ {{ statd }}</span>
            </div>
            <div class="dept-table-container">
              <el-table v-if="SkuTop.length > 0" style="width: 100%" :data="SkuTop" :height="tableHeight">
              <el-table
                v-if="SkuTop.length > 0"
                style="width: 100%"
                :data="SkuTop"
                :height="tableHeight"
              >
                <template v-for="(item, index) in SkuTop"></template>
                <el-table-column
                  prop="order"
@@ -153,8 +178,8 @@
                </el-table-column>
              </el-table>
              <div v-else class="empty-tip">
  <el-empty description="暂无科室服务数据"></el-empty>
</div>
                <el-empty description="暂无科室服务数据"></el-empty>
              </div>
            </div>
          </div>
        </el-col>
@@ -331,8 +356,11 @@
        年: "year",
      },
      DischargeData: {
        rs: "",
        rc: "",
        rc: "", // 出院就诊量(总人次)
        rs: "", // 出院服务量(总人次)
        scsf: 0, // 新增:首次服务人次
        zcsf: 0, // 新增:再次服务人次
        zbsf: 0, // 新增:专病服务人次
      },
      OutpatientData: {
        rs: "",
@@ -361,7 +389,7 @@
    atd() {
      return dayjs().subtract(this.dyat, "day").format("YYYY-MM-DD HH:mm:ss");
    },
   statd() {
    statd() {
      if (this.radio1 === "自定义" && this.customDateRange.length > 0) {
        return this.customDateRange[1];
      }
@@ -374,15 +402,15 @@
      return dayjs().subtract(this.dyat, "day").format("YYYY-MM-DD");
    },
    tableHeight() {
    // 根据数据量动态计算高度
    const rowHeight = 40; // 每行大约高度
    const headerHeight = 40; // 表头高度
    const minHeight = 500; // 最小高度
    const maxHeight = 600; // 最大高度
      // 根据数据量动态计算高度
      const rowHeight = 40; // 每行大约高度
      const headerHeight = 40; // 表头高度
      const minHeight = 500; // 最小高度
      const maxHeight = 600; // 最大高度
    const calculatedHeight = this.SkuTop.length * rowHeight + headerHeight;
    return Math.min(Math.max(calculatedHeight, minHeight), maxHeight);
  }
      const calculatedHeight = this.SkuTop.length * rowHeight + headerHeight;
      return Math.min(Math.max(calculatedHeight, minHeight), maxHeight);
    },
  },
  created() {
    this.getTopdata();
@@ -515,7 +543,7 @@
      let params = {
        startDate: this.endatd,
        endDate: this.statd,
        timeType: this.getTimeType()
        timeType: this.getTimeType(),
      };
      try {
@@ -542,7 +570,7 @@
      if (this.radio1 === "自定义" && this.customDateRange.length === 2) {
        const start = dayjs(this.customDateRange[0]);
        const end = dayjs(this.customDateRange[1]);
        const diffDays = end.diff(start, 'day');
        const diffDays = end.diff(start, "day");
        return diffDays > 60 ? "month" : "day";
      }
@@ -562,18 +590,19 @@
      const pmoData = [];
      sortedData.forEach((item) => {
  // 根据时间类型格式化显示
  const timeType = this.getTimeType();
  const timeLabel = timeType === "day"
    ? dayjs(item.timePeriod).format("MM-DD")
    : dayjs(item.timePeriod).format("YYYY-MM");
        // 根据时间类型格式化显示
        const timeType = this.getTimeType();
        const timeLabel =
          timeType === "day"
            ? dayjs(item.timePeriod).format("MM-DD")
            : dayjs(item.timePeriod).format("YYYY-MM");
  xAxisData.push(timeLabel);
  dischargeFollowData.push(item.dischargeFollowCount);
  outpatientFollowData.push(item.outpatientFollowCount);
  pmiData.push(item.pmiCount);
  pmoData.push(item.pmoCount);
});
        xAxisData.push(timeLabel);
        dischargeFollowData.push(item.dischargeFollowCount);
        outpatientFollowData.push(item.outpatientFollowCount);
        pmiData.push(item.pmiCount);
        pmoData.push(item.pmoCount);
      });
      // 更新图表
      this.updateChart(
@@ -867,7 +896,6 @@
    },
    // 页面变化调整大小
    handleResize() {
      console.log(111);
      // 调整 ECharts 图表大小
      if (this.myChart2) {
        this.myChart2.resize();
@@ -1167,6 +1195,12 @@
  padding: 0 10px;
  text-align: center;
}
.grid-contentsa {
  min-height: 600px;
  border-radius: 20px;
  padding: 0 10px;
  text-align: center;
}
.grid-contents {
  min-height: 36px;