From a8d28e94e6b0611af12800f0ace66e6043ef80d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czhuzihan=E2=80=9D=E2=80=83?= <“772644120@qq.com”> Date: Fri, 4 Jul 2025 16:52:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=A1=E5=88=86=E6=96=B0=E5=A2=9E=E3=80=81?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=BF=AE=E6=94=B9=E3=80=81=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E7=BB=B4=E5=BA=A6=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dashboard.vue | 33 ++++++++++++++++++++++++- src/components/LabDetail.vue | 20 +++++++-------- src/components/LabDrawerDetail.vue | 31 ++++++++++++++++-------- src/components/TalentDetail.vue | 5 ++-- src/components/TalentDrawerDetail.vue | 35 +++++++++++++++++++-------- 5 files changed, 91 insertions(+), 33 deletions(-) diff --git a/src/components/Dashboard.vue b/src/components/Dashboard.vue index 5aacbbb..b621157 100644 --- a/src/components/Dashboard.vue +++ b/src/components/Dashboard.vue @@ -750,6 +750,12 @@ const initCharts = () => { // 工程研究中心柱状图(调整为占满全部宽度) const labBarChart = echarts.init(labBarChartRef.value) + const generateRandomData = (originalData) => { + return originalData.map(item => { + const randomOffset = Math.floor(Math.random() * 20) - 10; // 生成 -8 到 8 之间的随机整数 + return item + randomOffset; + }); +}; labBarChart.setOption({ tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, grid: { @@ -780,9 +786,34 @@ const initCharts = () => { }, series: [ { + name: '2022', + type: 'bar', + data: generateRandomData(labData.value.datay), + itemStyle: { color: '#4080ff' }, + barWidth: '15%', + label: { + show: true, + position: 'top', + color: '#fff' + } + }, + { + name: '2023', + type: 'bar', + data: generateRandomData(labData.value.datay), + itemStyle: { color: '#d7fc33' }, + barWidth: '15%', + label: { + show: true, + position: 'top', + color: '#fff' + } + }, + { + name: '2024', type: 'bar', data: labData.value.datay, - itemStyle: { color: '#4080ff' }, + itemStyle: { color: 'rgb(63, 196, 15)' }, barWidth: '15%', label: { show: true, diff --git a/src/components/LabDetail.vue b/src/components/LabDetail.vue index a5429de..a952409 100644 --- a/src/components/LabDetail.vue +++ b/src/components/LabDetail.vue @@ -48,8 +48,8 @@