From 130894e6743115fe924358292f8f1603bc665e89 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期二, 19 八月 2025 13:47:54 +0800
Subject: [PATCH] 统计页面数据接入
---
src/views/index.vue | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/views/index.vue b/src/views/index.vue
index 5567763..acf04f8 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -133,8 +133,8 @@
绉戝鏈嶅姟閲�
<span>{{ endatd }} ~ {{ statd }}</span>
</div>
- <div style="max-height: 690px; width: 100%; overflow: auto">
- <el-table style="width: 100%" :data="SkuTop">
+ <div class="dept-table-container">
+ <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"
@@ -152,24 +152,26 @@
<template slot-scope="scope"> {{ scope.row.rc }}娆� </template>
</el-table-column>
</el-table>
+ <div v-else class="empty-tip">
+ <el-empty description="鏆傛棤绉戝鏈嶅姟鏁版嵁"></el-empty>
+</div>
</div>
</div>
</el-col>
</el-row>
<!-- 搴曢儴涓�涓� -->
<el-row :gutter="20" style="margin-bottom: 20px">
- <el-col :span="24">
+ <!-- <el-col :span="24">
<div class="grid-content bg-purple" style="min-height: 300px">
<div class="title">
瀹f暀缁熻
<span class="el-icon-s-unfold moreIcon"></span>
</div>
<div class="cooperate">
- <!-- 鍚堜綔鍖哄煙 -->
<div class="pieChart" id="pieCharts"></div>
</div>
</div>
- </el-col>
+ </el-col> -->
<!-- <el-col :span="9">
<div class="grid-content bg-purple" style="min-height: 300px">
<div class="title">
@@ -346,7 +348,7 @@
cylinderSeries: [],
cylinderXAxis: [],
customDateRange: [], // 鑷畾涔夋棩鏈熻寖鍥�
- dyat: 6,
+ dyat: 365,
intervalId: null,
};
},
@@ -371,6 +373,16 @@
}
return dayjs().subtract(this.dyat, "day").format("YYYY-MM-DD");
},
+ tableHeight() {
+ // 鏍规嵁鏁版嵁閲忓姩鎬佽绠楅珮搴�
+ const rowHeight = 40; // 姣忚澶х害楂樺害
+ const headerHeight = 40; // 琛ㄥご楂樺害
+ const minHeight = 200; // 鏈�灏忛珮搴�
+ const maxHeight = 600; // 鏈�澶ч珮搴�
+
+ const calculatedHeight = this.SkuTop.length * rowHeight + headerHeight;
+ return Math.min(Math.max(calculatedHeight, minHeight), maxHeight);
+ }
},
created() {
this.getTopdata();
@@ -892,6 +904,12 @@
flex: 1;
}
}
+.dept-table-container {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ min-height: 0; /* 閲嶈锛氬厑璁稿唴瀹规敹缂� */
+}
::v-deep .el-table {
td:first-child {
.cell {
--
Gitblit v1.9.3