From 015854c3952f95d88b8080ea410b35e41cf39bdb Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 04 Nov 2024 16:16:33 +0800
Subject: [PATCH] 首页优化
---
src/views/survey/components/box/fireContent.vue | 31 +++++++++++----
src/views/survey/components/box/dataContent.vue | 32 ++++++++++++----
src/views/survey/components/box/fireTrend.vue | 8 ++-
3 files changed, 52 insertions(+), 19 deletions(-)
diff --git a/src/views/survey/components/box/dataContent.vue b/src/views/survey/components/box/dataContent.vue
index 3f361a1..3c61513 100644
--- a/src/views/survey/components/box/dataContent.vue
+++ b/src/views/survey/components/box/dataContent.vue
@@ -23,13 +23,12 @@
function getStatistic() {
getRescueTeamStatistic().then(res => {
let xaxis_data = []
- res.data.data.forEach(element => {
- xaxis_data.push(element.type)
- });
let yaxis_data = []
res.data.data.forEach(element => {
+ xaxis_data.push(element.type)
yaxis_data.push(element.num)
});
+
myEcharts.setOption({
tooltip: {
trigger: 'axis',
@@ -37,15 +36,32 @@
type: 'shadow'
}
},
- xAxis: {
- data: xaxis_data
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
},
- yAxis: {},
+ xAxis: [
+ {
+ type: 'category',
+ data: xaxis_data,
+ axisTick: {
+ alignWithLabel: true
+ }
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value'
+ }
+ ],
series: [
{
+ name: 'Direct',
type: 'bar',
- data: yaxis_data,
- barWidth: '30%'
+ barWidth: '30%',
+ data: yaxis_data
}
]
})
diff --git a/src/views/survey/components/box/fireContent.vue b/src/views/survey/components/box/fireContent.vue
index eb14413..2e76023 100644
--- a/src/views/survey/components/box/fireContent.vue
+++ b/src/views/survey/components/box/fireContent.vue
@@ -20,11 +20,9 @@
function getRiskSource() {
getRiskSourceStatistic().then(res => {
let xaxis_data = []
- res.data.data.forEach(element => {
- xaxis_data.push(element.riskLevel)
- });
let yaxis_data = []
res.data.data.forEach(element => {
+ xaxis_data.push(element.riskLevel)
yaxis_data.push(element.num)
});
myEcharts.setOption({
@@ -34,15 +32,32 @@
type: 'shadow'
}
},
- xAxis: {
- data: xaxis_data
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
},
- yAxis: {},
+ xAxis: [
+ {
+ type: 'category',
+ data: xaxis_data,
+ axisTick: {
+ alignWithLabel: true
+ }
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value'
+ }
+ ],
series: [
{
+ name: 'Direct',
type: 'bar',
- data: yaxis_data,
- barWidth: '30%'
+ barWidth: '30%',
+ data: yaxis_data
}
]
})
diff --git a/src/views/survey/components/box/fireTrend.vue b/src/views/survey/components/box/fireTrend.vue
index af85115..75b8c7b 100644
--- a/src/views/survey/components/box/fireTrend.vue
+++ b/src/views/survey/components/box/fireTrend.vue
@@ -22,7 +22,7 @@
})
-function getPages () {
+function getPages() {
getPage().then(res => {
parkQy.value = res.data.data.records
console.log(res)
@@ -31,7 +31,7 @@
})
}
-function search () {
+function search() {
getPage({ name: searchQuery.value }).then(res => {
parkQy.value = res.data.data.records
console.log(res)
@@ -88,6 +88,8 @@
border: 1px solid #ccc;
border-radius: 4px 0 0 4px;
outline: none;
+ background-color: transparent;
+ color: #fff;
}
.search-button {
@@ -107,7 +109,7 @@
.data-content-item {
display: flex;
margin: 2px 10px;
- padding: 5px 0;
+ padding: 5px 5px;
background-color: #747bff;
justify-content: space-between;
border-radius: 5px;
--
Gitblit v1.9.3