Merge branch 'main' of git.zdool.com:xs/ggfwjsc

This commit is contained in:
duanxiaohai 2024-05-24 11:07:24 +08:00
commit 6a2c7796ea
7 changed files with 380 additions and 150 deletions

View File

@ -84,8 +84,9 @@ const getOption = () => {
{ {
name: "在册数", name: "在册数",
type: "value", type: "value",
nameTextStyle: { // Y nameTextStyle: {
fontSize: 14 // 20 // Y
fontSize: 14, // 20
}, },
splitLine: { splitLine: {
show: true, show: true,
@ -119,11 +120,24 @@ const getOption = () => {
type: "bar", type: "bar",
data: data.rs, data: data.rs,
barWidth: 20, barWidth: 20,
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
itemStyle: { itemStyle: {
normal: { normal: {
color: function (params) { color: function (params) {
var colorList = [ var colorList = [
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{ {
offset: 0, offset: 0,
color: "rgba(23, 237, 255, 1)", color: "rgba(23, 237, 255, 1)",
@ -133,8 +147,14 @@ const getOption = () => {
color: "rgba(23, 237, 255, 0.20)", color: "rgba(23, 237, 255, 0.20)",
}, },
], ],
false), false
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ ),
new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{ {
offset: 0, offset: 0,
color: "rgba(255, 243, 119, 1)", color: "rgba(255, 243, 119, 1)",
@ -144,8 +164,14 @@ const getOption = () => {
color: "rgba(255, 242, 142, 0.20)", color: "rgba(255, 242, 142, 0.20)",
}, },
], ],
false), false
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ ),
new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{ {
offset: 0, offset: 0,
color: "rgba(142, 187, 255, 1)", color: "rgba(142, 187, 255, 1)",
@ -155,7 +181,8 @@ const getOption = () => {
color: "rgba(142, 187, 255, 0.20)", color: "rgba(142, 187, 255, 0.20)",
}, },
], ],
false), false
),
]; ];
return colorList[params.dataIndex % colorList.length]; return colorList[params.dataIndex % colorList.length];

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height: 250px"></div> <div ref="chart" style="width: 100%; height: 260px"></div>
</template> </template>
<script setup> <script setup>
@ -175,16 +175,16 @@ const getOption = () => {
legend: [ legend: [
{ {
orient: "vertical", orient: "vertical",
right: "6%", right: "1%",
top: "10%", top: "16%",
itemWidth: 25, // itemWidth: 20, //
itemHeight: 10, // itemHeight: 10, //
itemGap: 19, itemGap: 20,
itemStyle: { // itemStyle: {
borderColor: "rgba(255,255,255,0.2)", // // borderColor: "rgba(255,255,255,0.2)", //
borderWidth: 10, // // borderWidth: 10, //
borderRadius: 20, // borderRadius: 20,
}, // },
textStyle: { textStyle: {
color: "#ffffff", color: "#ffffff",
fontSize: 14, fontSize: 14,
@ -197,11 +197,16 @@ const getOption = () => {
}, },
}, },
data: data.list, data: data.list,
formatter: (name) => {
if (data.list.length) { //
const item = data.list.filter((item) => item.name === name)[0]; formatter: function (name) {
return `{name|${name}}`; var target;
for (var i = 0, l = data.list.length; i < l; i++) {
if (data.list[i].name == name) {
target = data.list[i].value;
} }
}
return `${name}:${target}`;
}, },
}, },
], ],
@ -221,8 +226,8 @@ const getOption = () => {
{ {
type: "pie", type: "pie",
roseType: "radius", roseType: "radius",
radius: ["20%", "85%"], radius: ["15%", "80%"],
center: ["25%", "50%"], center: ["20%", "50%"],
label: { label: {
position: "inside", position: "inside",
formatter(item) { formatter(item) {
@ -263,8 +268,8 @@ const getOption = () => {
{ {
type: "pie", type: "pie",
roseType: "radius", roseType: "radius",
radius: ["20%", "87%"], radius: ["15%", "82%"],
center: ["25%", "50%"], center: ["20%", "50%"],
label: { label: {
show: false, show: false,
}, },

View File

@ -35,17 +35,176 @@ const data = reactive({
list2: [], list2: [],
year: [], year: [],
option: {}, option: {},
bg:[]
}); });
// const getOption = () => {
// data.option = {
// tooltip: {
// trigger: "axis",
// formatter: "{b0}<br />{a0}:{c0} <br />{a1}:{c1} ",
// },
// legend: {
// top: "5%",
// right: "11%",
// textStyle: {
// fontSize: 16,
// color: "#ffffff",
// },
// },
// grid: {
// top: "25%",
// left: "1%",
// right: "10%",
// bottom: "5%",
// containLabel: true,
// },
// calculable: true,
// xAxis: [
// {
// type: "category",
// axisLabel: {
// //
// textStyle: {
// color: "#ffffff",
// fontSize: 16,
// },
// },
// data: data.year,
// },
// {
// axisTick: false,
// type: "category",
// data: data.year,
// axisLabel: {
// show: false,
// color: "#ffffff",
// fontSize: 16,
// },
// },
// ],
// yAxis: [
// {
// type: "value",
// splitLine: {
// show: true,
// lineStyle: {
// color: "rgba(226, 226, 226, 0.3)",
// width: 1,
// },
// },
// axisLabel: {
// //
// textStyle: {
// color: "#ffffff",
// fontSize: 16,
// },
// },
// },
// {
// type: "value",
// min: 0,
// max: 100,
// splitLine: {
// show: false,
// lineStyle: {
// type: "solid",
// color: "rgb(221, 242, 255,0.3)",
// },
// },
// axisLine: {
// show: false,
// lineStyle: {
// type: "dotted",
// },
// },
// axisLabel: {
// show: false,
// fontSize: 16,
// color: "#DEF1FF",
// fontFamily: "MicrosoftYaHei",
// lineHeight: 19,
// },
// },
// ],
// series: [
// {
// name: "",
// type: "bar",
// data: data.list1,
// barWidth: "18%",
// itemStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(162, 187, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(162, 187, 255, 0.20)",
// },
// ]),
// },
// label: {
// show: true,
// color: "#ffffff",
// position: "top",
// formatter: function (data) {
// return data.value;
// },
// },
// },
// {
// name: "",
// type: "bar",
// data: data.list2,
// barWidth: "18%",
// itemStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(23, 237, 255, 1)",
// },
// {
// offset: 1,
// color: "rgba(23, 237, 255, 0.20)",
// },
// ]),
// },
// label: {
// show: true,
// color: "#ffffff",
// position: "top",
// formatter: function (data) {
// return data.value;
// },
// },
// },
// {
// type: "bar",
// xAxisIndex: 1,
// yAxisIndex: 1,
// itemStyle: {
// color: "rgba(221, 242, 255, 0.1)",
// },
// data: data.year.map(() => 100),
// barWidth: 50,
// },
// ],
// };
// };
const getOption = () => { const getOption = () => {
data.option = { data.option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: "{b0}<br />{a0}:{c0} <br />{a1}:{c1} ", padding: [20, 10, 20, 10],
formatter: "{b0}<br />{a1}:{c1} <br />{a2}:{c2} ",
}, },
legend: { legend: {
data: ["特困补助金额", "低保补助金额"],
top: "5%", top: "5%",
right: "11%", right: "28%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
@ -55,13 +214,14 @@ const getOption = () => {
top: "25%", top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "5%", bottom: "3%",
containLabel: true, containLabel: true,
}, },
calculable: true,
xAxis: [ xAxis: {
{
type: "category", type: "category",
// boundaryGap: false,
data: data.year,
axisLabel: { axisLabel: {
// //
textStyle: { textStyle: {
@ -69,27 +229,25 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
data: data.year,
}, },
{
axisTick: false,
type: "category",
data: data.year,
axisLabel: {
show: false,
color: "#ffffff",
fontSize: 16,
},
},
],
yAxis: [ yAxis: [
{ {
name: "特困补助金额",
type: "value", type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 2) / 50) * 50;
},
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: "rgba(226, 226, 226, 0.3)", color: "rgba(255, 255, 255, 0.2)",
fontSize: 16,
width: 1, width: 1,
}, },
}, },
@ -100,95 +258,108 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
},
{
type: "value",
min: 0,
max: 100,
splitLine: {
show: false,
lineStyle: {
type: "solid",
color: "rgb(221, 242, 255,0.3)",
},
},
axisLine: { axisLine: {
//y线
show: false, show: false,
lineStyle: { lineStyle: {
type: "dotted",
},
},
axisLabel: {
show: false,
fontSize: 16,
color: "#DEF1FF",
fontFamily: "MicrosoftYaHei",
lineHeight: 19,
},
},
],
series: [
{
name: "特困补助金额",
type: "bar",
data: data.list1,
barWidth: "18%",
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(162, 187, 255, 1)",
},
{
offset: 1,
color: "rgba(162, 187, 255, 0.20)",
},
]),
},
label: {
show: true,
color: "#ffffff", color: "#ffffff",
position: "top", fontSize: 16,
formatter: function (data) { width: 1,
return data.value; type: "solid",
}, },
}, },
}, },
{ {
name: "低保补助金额", name: "低保补助金额",
type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.3) / 50) * 50;
},
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: {
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.2)",
fontSize: 16,
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [
{
name: "背景",
type: "bar", type: "bar",
data: data.list2, data: data.bg,
barWidth: "18%", showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
},
{
yAxisIndex: 0,
name: "特困补助金额",
type: "line",
symbol: "emptyCircle",
symbolSize: 10,
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ borderColor: "#00FCFF",
{ borderWidth: 1,
offset: 0, color: "#00FCFF",
color: "rgba(23, 237, 255, 1)",
},
{
offset: 1,
color: "rgba(23, 237, 255, 0.20)",
},
]),
}, },
label: { label: {
show: true, show: true,
color: "#ffffff", color: "#ffffff",
position: "top", position:'bottom',
formatter: function (data) { formatter: function (data) {
return data.value; return data.value;
}, },
}, },
data: data.list1,
}, },
{ {
type: "bar",
xAxisIndex: 1,
yAxisIndex: 1, yAxisIndex: 1,
name: "低保补助金额",
type: "line",
symbol: "emptyCircle",
symbolSize: 10,
itemStyle: { itemStyle: {
color: "rgba(221, 242, 255, 0.1)", borderColor: "#2468FF",
borderWidth: 1,
color: "#2468FF",
}, },
data: data.year.map(() => 100), label: {
barWidth: 50, show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
data: data.list2,
}, },
], ],
}; };
@ -207,6 +378,9 @@ onBeforeMount(() => {
data.list1 = props.list1; data.list1 = props.list1;
data.list2 = props.list2; data.list2 = props.list2;
data.year = props.year; data.year = props.year;
data.year.forEach(() => {
data.bg.push(0);
});
getOption(); getOption();
setChart(); setChart();
}, 600); }, 600);
@ -214,4 +388,5 @@ onBeforeMount(() => {
</script> </script>
<style scoped> <style scoped>
</style> </style>

View File

@ -232,7 +232,7 @@ const getOption = () => {
label:{ label:{
show:true, show:true,
position:'top', position:'top',
color:'rgba(0, 252, 255, 1)', color:'#ffffff',
formatter:function(data){ formatter:function(data){
return data.value return data.value
} }

View File

@ -160,11 +160,26 @@ const option = {
data: data, data: data,
barWidth: 20, barWidth: 20,
type: "bar", type: "bar",
label:{
show:true,
color:'#ffffff',
formatter:function(data){
return data.value
}
},
}, },
{ {
name: "上门服务次数", name: "上门服务次数",
data: lineData, data: lineData,
type: "line", //线 type: "line", //线
label:{
show:true,
position:'top',
color:'#ffffff',
formatter:function(data){
return data.value
}
},
itemStyle: { itemStyle: {
borderColor: "#00FCFF", borderColor: "#00FCFF",
borderWidth: 1, borderWidth: 1,

View File

@ -214,6 +214,14 @@ const getOption = () => {
{ offset: 1, color: "rgba(0, 183, 255, 1)" }, { offset: 1, color: "rgba(0, 183, 255, 1)" },
]), ]),
}, },
},
label:{
show:true,
position:'right',
color:'#ffffff',
formatter:function(data){
return data.value
}
}, },
}, },
], ],

View File

@ -196,7 +196,7 @@
</div> </div>
</div> </div>
<ePie2 style="margin-top: 20px" :list="data.ageRatio"></ePie2> <ePie2 style="margin-top: 20px" :list="data.ageRatio"></ePie2>
<ePie style="margin-bottom: 30px" :list="data.ageGroup"></ePie> <ePie style="margin-bottom: 20px" :list="data.ageGroup"></ePie>
<div class="table"> <div class="table">
<div class="table_choose"> <div class="table_choose">
<div <div