From 1e347af4f6d0cb54a18a5ae60871386db5bafbc1 Mon Sep 17 00:00:00 2001 From: JiXinHui <985276981@qq.com> Date: Tue, 12 Aug 2025 15:08:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B9=B3=E5=9D=87=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index/LeftCenter.vue | 24 ++- src/views/index/components/LeftCenter.vue | 188 ---------------------- src/views/index/index.vue | 2 +- 3 files changed, 10 insertions(+), 204 deletions(-) delete mode 100644 src/views/index/components/LeftCenter.vue diff --git a/src/views/index/LeftCenter.vue b/src/views/index/LeftCenter.vue index dfee453..7271208 100644 --- a/src/views/index/LeftCenter.vue +++ b/src/views/index/LeftCenter.vue @@ -30,15 +30,11 @@ const getChartData = () => { timeFilter: selectedTimeFilter.value }).then(res => { if (res.success) { - // 假设API返回的数据格式是 {dates: [], values: []} - // chartData.value = res.data; initChart(); } else { - // 如果API调用失败,使用模拟数据 initChart(); } }).catch(() => { - // 如果发生错误,使用模拟数据 initChart(); }); }; @@ -55,10 +51,10 @@ const initChart = () => { const option = { grid: { - top: '10%', - left: '8%', + top: '15%', + left: '0', right: '5%', - bottom: '15%', + bottom: '0', containLabel: true }, xAxis: { @@ -178,15 +174,13 @@ const onUnmounted = () => { .average-duration { width: 100%; height: 100%; - display: flex; - flex-direction: column; - background-color: #fff; - border-radius: 10px; - padding: 15px; - box-sizing: border-box; + position: relative; } .chart-header { + position: absolute; + right: 0; + top: -35px; display: flex; justify-content: space-between; align-items: center; @@ -214,7 +208,7 @@ const onUnmounted = () => { .filter-item { .filter-select { - width: 120px; + width: 100px; :deep(.el-input__wrapper) { background-color: #f5f7fa; @@ -231,7 +225,7 @@ const onUnmounted = () => { } .chart-container { - flex: 1; width: 100%; + height: 100%; } \ No newline at end of file diff --git a/src/views/index/components/LeftCenter.vue b/src/views/index/components/LeftCenter.vue deleted file mode 100644 index 0632e4c..0000000 --- a/src/views/index/components/LeftCenter.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - 总考生数量 - {{ chartData.totalCount.toLocaleString() }} - - - 同比增长 - +{{ chartData.growthRate }}% - - - - - - \ No newline at end of file diff --git a/src/views/index/index.vue b/src/views/index/index.vue index b2debac..bf8d41a 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -88,7 +88,7 @@ const RightBottom = defineAsyncComponent(() => import("./components/RightBottom. display: flex; flex-direction: column; width: 25%; - gap: 20px; + gap: 10px; } .center-content {