WXL (wul)
5 天以前 5e3f064530fe71987e2a5920fe59967ef348cbd7
统计页面展示优化
已修改1个文件
64 ■■■■■ 文件已修改
src/views/index.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue
@@ -128,13 +128,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 +158,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>
@@ -361,7 +366,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 +379,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 +520,7 @@
      let params = {
        startDate: this.endatd,
        endDate: this.statd,
        timeType: this.getTimeType()
        timeType: this.getTimeType(),
      };
      try {
@@ -542,7 +547,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 +567,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(
@@ -1167,6 +1173,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;