feat:完善首页 景区功能

This commit is contained in:
张先生
2025-03-14 15:56:54 +08:00
parent 15b119a994
commit 641753aee8
6 changed files with 81 additions and 141 deletions

View File

@@ -56,7 +56,7 @@
return props.list.map((item) => {
return {
...item,
value: parseFloat(item.value)
value: item.count
}
})
}
@@ -71,68 +71,66 @@
return () => `{value|${getTotal()}}` + '\n' + `{name|${props.subTitle}}`
}
let defaultCofig = {
color: ['#A665F1', '#0063FF', '#00D0FF', '#01FEFE', '#FC2638', '#FED958'],
legend: {
x: 'left',
y: '74%',
itemHeight: fitChartSize(12),
itemWidth: fitChartSize(12),
itemGap: fitChartSize(10),
formatter: function (name) {
return '{name|' + name + '}'
},
textStyle: {
rich: {
name: {
color: '#fff',
fontSize: fitChartSize(14)
const init = () => {
if (!params) {
params = {
color: ['#A665F1', '#0063FF', '#00D0FF', '#01FEFE', '#FC2638', '#FED958'],
legend: {
x: 'left',
y: '74%',
itemHeight: fitChartSize(12),
itemWidth: fitChartSize(12),
itemGap: fitChartSize(10),
formatter: function (name) {
return '{name|' + name + '}'
},
value: {
color: '#00D5F6',
fontSize: fitChartSize(14)
}
}
}
},
series: [
{
type: 'pie',
center: ['50%', '40%'],
radius: ['55%', '70%'],
itemStyle: {
borderWidth: fitChartSize(4),
borderColor: '#093672'
},
label: {
show: true,
position: 'center',
fontWeight: 'bold',
formatter: formatLabel(),
rich: {
value: {
color: '#fff',
fontSize: fitChartSize(24),
fontWeight: 'bold',
padding: [0, 0, 5, 0]
},
name: {
color: '#fff',
fontSize: fitChartSize(12)
textStyle: {
rich: {
name: {
color: '#fff',
fontSize: fitChartSize(14)
},
value: {
color: '#00D5F6',
fontSize: fitChartSize(14)
}
}
}
},
labelLine: {
show: false
},
data: getSeriesData()
series: [
{
type: 'pie',
center: ['50%', '40%'],
radius: ['55%', '70%'],
itemStyle: {
borderWidth: fitChartSize(4),
borderColor: '#093672'
},
label: {
show: true,
position: 'center',
fontWeight: 'bold',
formatter: formatLabel(),
rich: {
value: {
color: '#fff',
fontSize: fitChartSize(24),
fontWeight: 'bold',
padding: [0, 0, 5, 0]
},
name: {
color: '#fff',
fontSize: fitChartSize(12)
}
}
},
labelLine: {
show: false
},
data: getSeriesData()
}
]
}
]
}
const init = () => {
if (!params) {
params = defaultCofig
} else {
params.series[0].label.formatter = formatLabel()
params.series[0].data = getSeriesData()