This commit is contained in:
parent
2ff3bdaf78
commit
a3b805a61b
|
@ -7,6 +7,7 @@ import {
|
||||||
onBeforeMount,
|
onBeforeMount,
|
||||||
onMounted,
|
onMounted,
|
||||||
ref,
|
ref,
|
||||||
|
watch,
|
||||||
reactive,
|
reactive,
|
||||||
defineProps,
|
defineProps,
|
||||||
nextTick,
|
nextTick,
|
||||||
|
@ -286,7 +287,16 @@ const setChart1 = () => {
|
||||||
data.list2.push(item.jzje); //救助金额
|
data.list2.push(item.jzje); //救助金额
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
watch(
|
||||||
|
() => props.list,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
data.list = newVal;
|
||||||
|
// console.log("救助人1", data.list);
|
||||||
|
setChart1();
|
||||||
|
getOption();
|
||||||
|
setChart();
|
||||||
|
}
|
||||||
|
);
|
||||||
// 使用生命钩子
|
// 使用生命钩子
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -268,6 +268,7 @@ const getOption = () => {
|
||||||
color: "rgba(221, 242, 255, 0.1)",
|
color: "rgba(221, 242, 255, 0.1)",
|
||||||
},
|
},
|
||||||
data: data.list.year.map(() => 100),
|
data: data.list.year.map(() => 100),
|
||||||
|
// data: 100,
|
||||||
barWidth: 50,
|
barWidth: 50,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -3,283 +3,307 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
defineProps,
|
||||||
|
watch,
|
||||||
|
nextTick,
|
||||||
|
} from "vue";
|
||||||
// 局部引入echarts核心模块
|
// 局部引入echarts核心模块
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// list2: {
|
||||||
|
// type: Array,
|
||||||
|
// default: () => {
|
||||||
|
// return [];
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
year: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const chart = ref(); // 创建DOM引用
|
const chart = ref(); // 创建DOM引用
|
||||||
|
|
||||||
const data = [120, 200, 50, 80, 70];
|
const data = reactive({
|
||||||
const data2 = [12, 20, 5, 8, 7];
|
list: [],
|
||||||
const lineData = [150, 230, 24, 218, 135];
|
list1: [],
|
||||||
const lineData2 = [15, 23, 4, 18, 15];
|
list2: [],
|
||||||
const max = data
|
year: [],
|
||||||
.concat(lineData)
|
option: {},
|
||||||
.reduce((pre, cur) => (pre > cur ? pre : cur), 0); //找到这个新数组中的最大值
|
initialLegendData: ["生活补贴人数", "生活补贴金额"],
|
||||||
// 背景颜色
|
});
|
||||||
const color = [
|
|
||||||
{
|
|
||||||
type: "linear",
|
|
||||||
x: 0,
|
|
||||||
x2: 0,
|
|
||||||
y: 0,
|
|
||||||
y2: 1,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const option = {
|
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}<br/>{a2}:{c2}<br/>{a3}:{c3}",
|
|
||||||
},
|
|
||||||
|
|
||||||
legend: {
|
const getOption = () => {
|
||||||
data: [
|
data.option = {
|
||||||
"困难残疾人生活补贴人数",
|
tooltip: {
|
||||||
"护理补贴人数",
|
trigger: "axis",
|
||||||
"",
|
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
|
||||||
"困难残疾人生活补贴金额",
|
|
||||||
"护理补贴金额",
|
|
||||||
],
|
|
||||||
top: "3%",
|
|
||||||
textStyle: {
|
|
||||||
fontSize: 14,
|
|
||||||
color: "#ffffff", //上文字标题颜色
|
|
||||||
},
|
},
|
||||||
},
|
legend: {
|
||||||
grid: {
|
show: true,
|
||||||
top: "25%",
|
data: data.initialLegendData,
|
||||||
left: "6%",
|
top: "3%",
|
||||||
right: "9%",
|
textStyle: {
|
||||||
bottom: "5%",
|
|
||||||
containLabel: true,
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
},
|
|
||||||
calculable: true,
|
|
||||||
color,
|
|
||||||
xAxis: [
|
|
||||||
{
|
|
||||||
type: "category",
|
|
||||||
|
|
||||||
axisLabel: {
|
|
||||||
//坐标轴刻度标签的相关设置
|
|
||||||
textStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisTick: {
|
|
||||||
show: false, // 设置轴刻度不显示
|
|
||||||
},
|
|
||||||
data: ["2019", "2020", "2021", "2022", "2023"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "category",
|
|
||||||
show: false,
|
|
||||||
data: ["2019", "2020", "2021", "2022", "2023"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
scale: true,
|
|
||||||
name: "补贴人数",
|
|
||||||
|
|
||||||
splitLine: {
|
|
||||||
//分割线配置
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
width: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
//y轴文字的配置
|
|
||||||
textStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
//y轴线的颜色以及宽度
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
width: 1,
|
|
||||||
type: "solid",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
scale: true,
|
|
||||||
min: 0,
|
|
||||||
|
|
||||||
name: "救助金额/元",
|
|
||||||
splitLine: {
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "rgba(226, 226, 226, 0.3)",
|
|
||||||
width: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
//y轴文字的配置
|
|
||||||
textStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
//y轴线的颜色以及宽度
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
color: "#ffffff",
|
|
||||||
fontSize: 14,
|
|
||||||
width: 1,
|
|
||||||
type: "solid",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
min: 0,
|
|
||||||
max: 100,
|
|
||||||
splitLine: {
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
type: "solid",
|
|
||||||
color: "rgb(221, 242, 255,0.1)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLine: {
|
|
||||||
show: false,
|
|
||||||
lineStyle: {
|
|
||||||
type: "dotted",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
show: false,
|
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#ffffff",
|
color: "#ffffff", //上文字标题颜色
|
||||||
lineHeight: 19,
|
|
||||||
fontFamily: "MicrosoftYaHei",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
grid: {
|
||||||
series: [
|
left: "6%",
|
||||||
{
|
right: "9%",
|
||||||
yAxisIndex: 0,
|
bottom: "5%",
|
||||||
name: "困难残疾人生活补贴人数",
|
containLabel: true,
|
||||||
data: data,
|
color: "#ffffff",
|
||||||
barWidth: 10,
|
fontSize: 14,
|
||||||
type: "bar",
|
|
||||||
itemStyle: {
|
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
||||||
{
|
|
||||||
offset: 0,
|
|
||||||
color: "rgba(142, 187, 255, 1)",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: "rgba(142, 187, 255, 0.20)",
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
calculable: true,
|
||||||
|
|
||||||
{
|
xAxis: [
|
||||||
yAxisIndex: 0,
|
{
|
||||||
name: "护理补贴人数",
|
type: "category",
|
||||||
data: data2,
|
|
||||||
barWidth: 10,
|
axisLabel: {
|
||||||
type: "bar",
|
//坐标轴刻度标签的相关设置
|
||||||
itemStyle: {
|
textStyle: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: "#ffffff",
|
||||||
{
|
fontSize: 14,
|
||||||
offset: 0,
|
|
||||||
color: "rgba(23, 237, 255, 1)",
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
offset: 1,
|
axisTick: {
|
||||||
color: "rgba(23, 237, 255, 0.20)",
|
show: false, // 设置轴刻度不显示
|
||||||
|
},
|
||||||
|
// data: ["2019", "2020", "2021", "2022", "2023"],
|
||||||
|
data: data.list.year,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
show: false,
|
||||||
|
data: data.list.year,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
scale: true,
|
||||||
|
name: "补贴人数",
|
||||||
|
min: 0,
|
||||||
|
splitLine: {
|
||||||
|
//分割线配置
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
fontSize: 14,
|
||||||
|
width: 1,
|
||||||
},
|
},
|
||||||
]),
|
},
|
||||||
},
|
axisLabel: {
|
||||||
},
|
//y轴文字的配置
|
||||||
{
|
textStyle: {
|
||||||
yAxisIndex: 1,
|
fontSize: 14,
|
||||||
name: "困难残疾人生活补贴金额",
|
color: "#ffffff",
|
||||||
data: lineData,
|
},
|
||||||
type: "line", //线状图
|
},
|
||||||
itemStyle: {
|
axisLine: {
|
||||||
borderColor: "#00FCFF",
|
//y轴线的颜色以及宽度
|
||||||
borderWidth: 1,
|
show: false,
|
||||||
color: "#00FCFF",
|
lineStyle: {
|
||||||
},
|
color: "#ffffff",
|
||||||
},
|
fontSize: 14,
|
||||||
{
|
width: 1,
|
||||||
yAxisIndex: 1,
|
type: "solid",
|
||||||
name: "护理补贴金额",
|
|
||||||
data: lineData2,
|
|
||||||
type: "line", //线状图
|
|
||||||
itemStyle: {
|
|
||||||
borderColor: "#00FCFF",
|
|
||||||
borderWidth: 1,
|
|
||||||
color: "#2468FF",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
yAxisIndex: 2,
|
|
||||||
xAxisIndex: 1,
|
|
||||||
itemStyle: {
|
|
||||||
color: "rgba(180, 180, 180, 0.2)", //外阴影背景
|
|
||||||
},
|
|
||||||
data: data.map(() => 100),
|
|
||||||
barWidth: 60, //外阴影背景宽
|
|
||||||
emphasis: {
|
|
||||||
itemStyle: {
|
|
||||||
color: {
|
|
||||||
type: "linear",
|
|
||||||
x: 0,
|
|
||||||
x2: 0,
|
|
||||||
y: 0,
|
|
||||||
y2: 1,
|
|
||||||
colorStops: [
|
|
||||||
{
|
|
||||||
offset: 0,
|
|
||||||
color: "rgba(64, 247, 176, 0.25)",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
offset: 1,
|
|
||||||
color: "rgba(17, 34, 64, 0.25)",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "bar",
|
{
|
||||||
},
|
type: "value",
|
||||||
],
|
scale: true,
|
||||||
|
min: 0,
|
||||||
|
|
||||||
|
name: "补贴金额/万",
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
color: "rgba(226, 226, 226, 0.3)",
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
//y轴文字的配置
|
||||||
|
textStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
//y轴线的颜色以及宽度
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
color: "#ffffff",
|
||||||
|
fontSize: 14,
|
||||||
|
width: 1,
|
||||||
|
type: "solid",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "solid",
|
||||||
|
color: "rgb(221, 242, 255,0.1)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dotted",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
show: false,
|
||||||
|
fontSize: 14,
|
||||||
|
fontFamily: "MicrosoftYaHei",
|
||||||
|
color: "#ffffff",
|
||||||
|
lineHeight: 19,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
yAxisIndex: 1,
|
||||||
|
name: "生活补贴金额",
|
||||||
|
data: data.list2,
|
||||||
|
type: "line", //线状图
|
||||||
|
stack: "Total",
|
||||||
|
symbol: "emptyCircle",
|
||||||
|
symbolSize: 10,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
color: "#ffffff",
|
||||||
|
formatter: function (data) {
|
||||||
|
return data.value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
borderColor: "#00FCFF",
|
||||||
|
borderWidth: 1,
|
||||||
|
color: "#2468FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
yAxisIndex: 0,
|
||||||
|
name: "生活补贴人数",
|
||||||
|
data: data.list1,
|
||||||
|
barWidth: 20,
|
||||||
|
type: "bar",
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
// position: "insideTop",
|
||||||
|
color: "#ffffff",
|
||||||
|
formatter: function (data) {
|
||||||
|
return data.value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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)",
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "bar",
|
||||||
|
xAxisIndex: 1,
|
||||||
|
yAxisIndex: 2,
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
color: {
|
||||||
|
type: "linear",
|
||||||
|
x: 0,
|
||||||
|
x2: 0,
|
||||||
|
y: 0,
|
||||||
|
y2: 1,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: "rgba(64, 247, 176, 0.25)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: "rgba(17, 34, 64, 0.25)",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
color: "rgba(221, 242, 255, 0.1)",
|
||||||
|
},
|
||||||
|
data: data.list.year.map(() => 100),
|
||||||
|
barWidth: 50,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// 使用生命钩子
|
const setChart = () => {
|
||||||
onMounted(() => {
|
|
||||||
// 基于准备好的dom,初始化echarts实例
|
|
||||||
// var myChart = echarts.init(document.getElementById('main'));
|
|
||||||
// Vue3中: 需要引入
|
|
||||||
var myChart = echarts.init(chart.value);
|
var myChart = echarts.init(chart.value);
|
||||||
|
myChart.setOption(data.option);
|
||||||
|
};
|
||||||
|
|
||||||
// init(); // vue3.2没有this
|
const setChart1 = () => {
|
||||||
// 使用刚指定的配置项和数据显示图表。
|
data.list1 = [];
|
||||||
myChart.setOption(option);
|
data.list2 = [];
|
||||||
|
data.list.data.forEach((item) => {
|
||||||
|
data.list1.push(item.jzrs); //补贴人数
|
||||||
|
data.list2.push(item.jzje); //补贴金额
|
||||||
|
});
|
||||||
|
// console.log("补贴人2", data.list1, data.list2);
|
||||||
|
};
|
||||||
|
watch(
|
||||||
|
() => props.list,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
data.list = newVal;
|
||||||
|
// console.log("补贴人1", data.list);
|
||||||
|
setChart1();
|
||||||
|
getOption();
|
||||||
|
setChart();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// 单图表响应式: 跟随浏览器大小改变
|
// 使用生命钩子
|
||||||
// window.addEventListener("resize", () => {
|
onBeforeMount(() => {
|
||||||
// myChart.resize();
|
setTimeout(() => {
|
||||||
// });
|
data.list = props.list;
|
||||||
|
setChart1();
|
||||||
|
console.log(data.list, data.list1, data.list2, "教育");
|
||||||
|
getOption();
|
||||||
|
setChart();
|
||||||
|
}, 600);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,358 @@
|
||||||
|
<template>
|
||||||
|
<div ref="chart" style="width: 100%; height: 360px"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
defineProps,
|
||||||
|
watch,
|
||||||
|
nextTick,
|
||||||
|
} from "vue";
|
||||||
|
// 局部引入echarts核心模块
|
||||||
|
import * as echarts from "echarts";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
year: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const chart = ref(); // 创建DOM引用
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
list: [],
|
||||||
|
list1: [],
|
||||||
|
list2: [],
|
||||||
|
year: [],
|
||||||
|
option: {},
|
||||||
|
initialLegendData: ["困难军人生活补贴人数", "困难军人生活补贴金额"],
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// const data1 = [120, 200, 50, 80, 70];
|
||||||
|
// const data2 = [12, 20, 5, 8, 7];
|
||||||
|
// const lineData = [150, 230, 24, 218, 135];
|
||||||
|
// const lineData2 = [15, 23, 4, 18, 15];
|
||||||
|
// const max = data
|
||||||
|
// .concat(lineData)
|
||||||
|
// .reduce((pre, cur) => (pre > cur ? pre : cur), 0); //找到这个新数组中的最大值
|
||||||
|
// // 背景颜色
|
||||||
|
// const color = [
|
||||||
|
// {
|
||||||
|
// type: "linear",
|
||||||
|
// x: 0,
|
||||||
|
// x2: 0,
|
||||||
|
// y: 0,
|
||||||
|
// y2: 1,
|
||||||
|
// },
|
||||||
|
// ];
|
||||||
|
|
||||||
|
// const getOption = () => {
|
||||||
|
// data.option = {
|
||||||
|
// tooltip: {
|
||||||
|
// trigger: "axis",
|
||||||
|
// formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}<br/>{a2}:{c2}<br/>{a3}:{c3}",
|
||||||
|
// },
|
||||||
|
|
||||||
|
// legend: {
|
||||||
|
// data: [
|
||||||
|
// "困难残疾人生活补贴人数",
|
||||||
|
// "护理补贴人数",
|
||||||
|
// "",
|
||||||
|
// "困难残疾人生活补贴金额",
|
||||||
|
// "护理补贴金额",
|
||||||
|
// ],
|
||||||
|
// top: "3%",
|
||||||
|
// textStyle: {
|
||||||
|
// fontSize: 14,
|
||||||
|
// color: "#ffffff", //上文字标题颜色
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// grid: {
|
||||||
|
// top: "25%",
|
||||||
|
// left: "6%",
|
||||||
|
// right: "9%",
|
||||||
|
// bottom: "5%",
|
||||||
|
// containLabel: true,
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// },
|
||||||
|
// calculable: true,
|
||||||
|
// color,
|
||||||
|
// xAxis: [
|
||||||
|
// {
|
||||||
|
// type: "category",
|
||||||
|
|
||||||
|
// axisLabel: {
|
||||||
|
// //坐标轴刻度标签的相关设置
|
||||||
|
// textStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisTick: {
|
||||||
|
// show: false, // 设置轴刻度不显示
|
||||||
|
// },
|
||||||
|
// data: ["2019", "2020", "2021", "2022", "2023"],
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: "category",
|
||||||
|
// show: false,
|
||||||
|
// data: ["2019", "2020", "2021", "2022", "2023"],
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// yAxis: [
|
||||||
|
// {
|
||||||
|
// type: "value",
|
||||||
|
// scale: true,
|
||||||
|
// name: "补贴人数",
|
||||||
|
|
||||||
|
// splitLine: {
|
||||||
|
// //分割线配置
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// width: 1,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLabel: {
|
||||||
|
// //y轴文字的配置
|
||||||
|
// textStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLine: {
|
||||||
|
// //y轴线的颜色以及宽度
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// width: 1,
|
||||||
|
// type: "solid",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: "value",
|
||||||
|
// scale: true,
|
||||||
|
// min: 0,
|
||||||
|
|
||||||
|
// name: "救助金额/元",
|
||||||
|
// splitLine: {
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// color: "rgba(226, 226, 226, 0.3)",
|
||||||
|
// width: 1,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLabel: {
|
||||||
|
// //y轴文字的配置
|
||||||
|
// textStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLine: {
|
||||||
|
// //y轴线的颜色以及宽度
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// color: "#ffffff",
|
||||||
|
// fontSize: 14,
|
||||||
|
// width: 1,
|
||||||
|
// type: "solid",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: "value",
|
||||||
|
// min: 0,
|
||||||
|
// max: 100,
|
||||||
|
// splitLine: {
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// type: "solid",
|
||||||
|
// color: "rgb(221, 242, 255,0.1)",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLine: {
|
||||||
|
// show: false,
|
||||||
|
// lineStyle: {
|
||||||
|
// type: "dotted",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// axisLabel: {
|
||||||
|
// show: false,
|
||||||
|
// fontSize: 14,
|
||||||
|
// color: "#ffffff",
|
||||||
|
// lineHeight: 19,
|
||||||
|
// fontFamily: "MicrosoftYaHei",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// series: [
|
||||||
|
// {
|
||||||
|
// yAxisIndex: 0,
|
||||||
|
// name: "困难残疾人生活补贴人数",
|
||||||
|
// data: data1,
|
||||||
|
// barWidth: 10,
|
||||||
|
// type: "bar",
|
||||||
|
// itemStyle: {
|
||||||
|
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
// {
|
||||||
|
// offset: 0,
|
||||||
|
// color: "rgba(142, 187, 255, 1)",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// offset: 1,
|
||||||
|
// color: "rgba(142, 187, 255, 0.20)",
|
||||||
|
// },
|
||||||
|
// ]),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
|
||||||
|
// {
|
||||||
|
// yAxisIndex: 0,
|
||||||
|
// name: "护理补贴人数",
|
||||||
|
// data: data2,
|
||||||
|
// barWidth: 10,
|
||||||
|
// type: "bar",
|
||||||
|
// 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)",
|
||||||
|
// },
|
||||||
|
// ]),
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// yAxisIndex: 1,
|
||||||
|
// name: "困难残疾人生活补贴金额",
|
||||||
|
// data: lineData,
|
||||||
|
// type: "line", //线状图
|
||||||
|
// itemStyle: {
|
||||||
|
// borderColor: "#00FCFF",
|
||||||
|
// borderWidth: 1,
|
||||||
|
// color: "#00FCFF",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// yAxisIndex: 1,
|
||||||
|
// name: "护理补贴金额",
|
||||||
|
// data: lineData2,
|
||||||
|
// type: "line", //线状图
|
||||||
|
// itemStyle: {
|
||||||
|
// borderColor: "#00FCFF",
|
||||||
|
// borderWidth: 1,
|
||||||
|
// color: "#2468FF",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// yAxisIndex: 2,
|
||||||
|
// xAxisIndex: 1,
|
||||||
|
// itemStyle: {
|
||||||
|
// color: "rgba(180, 180, 180, 0.2)", //外阴影背景
|
||||||
|
// },
|
||||||
|
// data: data.map(() => 100),
|
||||||
|
// barWidth: 60, //外阴影背景宽
|
||||||
|
// emphasis: {
|
||||||
|
// itemStyle: {
|
||||||
|
// color: {
|
||||||
|
// type: "linear",
|
||||||
|
// x: 0,
|
||||||
|
// x2: 0,
|
||||||
|
// y: 0,
|
||||||
|
// y2: 1,
|
||||||
|
// colorStops: [
|
||||||
|
// {
|
||||||
|
// offset: 0,
|
||||||
|
// color: "rgba(64, 247, 176, 0.25)",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// offset: 1,
|
||||||
|
// color: "rgba(17, 34, 64, 0.25)",
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// type: "bar",
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 使用生命钩子
|
||||||
|
// onMounted(() => {
|
||||||
|
// // 基于准备好的dom,初始化echarts实例
|
||||||
|
// // var myChart = echarts.init(document.getElementById('main'));
|
||||||
|
// // Vue3中: 需要引入
|
||||||
|
// var myChart = echarts.init(chart.value);
|
||||||
|
|
||||||
|
// // init(); // vue3.2没有this
|
||||||
|
// // 使用刚指定的配置项和数据显示图表。
|
||||||
|
// myChart.setOption(option);
|
||||||
|
|
||||||
|
// // 单图表响应式: 跟随浏览器大小改变
|
||||||
|
// // window.addEventListener("resize", () => {
|
||||||
|
// // myChart.resize();
|
||||||
|
// // });
|
||||||
|
// });
|
||||||
|
|
||||||
|
// const setChart = () => {
|
||||||
|
// var myChart = echarts.init(chart.value);
|
||||||
|
// myChart.setOption(data.option);
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const setChart1 = () => {
|
||||||
|
// data.list1 = [];
|
||||||
|
// data.list2 = [];
|
||||||
|
// data.list.data.forEach((item) => {
|
||||||
|
// data.list1.push(item.jzrs); //补贴人数
|
||||||
|
// data.list2.push(item.jzje); //补贴金额
|
||||||
|
// });
|
||||||
|
// // console.log("补贴人2", data.list1, data.list2);
|
||||||
|
// };
|
||||||
|
// watch(
|
||||||
|
// () => props.list,
|
||||||
|
// (newVal, oldVal) => {
|
||||||
|
// data.list = newVal;
|
||||||
|
// // console.log("补贴人1", data.list);
|
||||||
|
// setChart1();
|
||||||
|
// getOption();
|
||||||
|
// setChart();
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
|
||||||
|
// 使用生命钩子
|
||||||
|
onBeforeMount(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
data.list = props.list;
|
||||||
|
// setChart1();
|
||||||
|
console.log(data.list, "残疾人补助信息");
|
||||||
|
// getOption();
|
||||||
|
// setChart();
|
||||||
|
}, 600);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
|
@ -23,7 +23,7 @@
|
||||||
就业
|
就业
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<eP1 :list="data.education"></eP1>
|
<eP1 :list="data.list2"></eP1>
|
||||||
<div class="choose">
|
<div class="choose">
|
||||||
<div
|
<div
|
||||||
:class="jz[1].choose == '1' ? 'choose_1' : 'choose_2'"
|
:class="jz[1].choose == '1' ? 'choose_1' : 'choose_2'"
|
||||||
|
@ -111,8 +111,9 @@
|
||||||
困难职工
|
困难职工
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<eP5 v-if="jz[2].choose == '2'" :list="data.difficultSoldiers"></eP5>
|
<eP4 :list="data.list1"></eP4>
|
||||||
<eP4 v-else :list="data.difficultSoldiers"></eP4>
|
<!-- <eP6 v-if="jz[2].choose == '1'" :list="data.difficultSoldiers"></eP6>
|
||||||
|
<eP5 v-if="jz[2].choose == '2'" :list="data.difficultSoldiers"></eP5> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
<div class="yd_title right_2"></div>
|
<div class="yd_title right_2"></div>
|
||||||
|
@ -157,6 +158,7 @@ import eP2 from "./echarts_work/eP2.vue";
|
||||||
import eP3 from "./echarts_work/eP3.vue";
|
import eP3 from "./echarts_work/eP3.vue";
|
||||||
import eP4 from "./echarts_work/eP4.vue";
|
import eP4 from "./echarts_work/eP4.vue";
|
||||||
import eP5 from "./echarts_work/eP5.vue";
|
import eP5 from "./echarts_work/eP5.vue";
|
||||||
|
import eP6 from "./echarts_work/eP6.vue";
|
||||||
import ePjz from "./echarts_work/ePjz.vue";
|
import ePjz from "./echarts_work/ePjz.vue";
|
||||||
import http from "@/utils/request.js";
|
import http from "@/utils/request.js";
|
||||||
// 专项&其他救助切换
|
// 专项&其他救助切换
|
||||||
|
@ -178,24 +180,25 @@ const jz = ref([
|
||||||
]);
|
]);
|
||||||
const jzChange = (index, value) => {
|
const jzChange = (index, value) => {
|
||||||
jz.value[index].choose = value;
|
jz.value[index].choose = value;
|
||||||
switch (index) {
|
if (index === 0) {
|
||||||
case 0:
|
data.list2 = value === "1" ? data.education : data.education1;
|
||||||
// console.log(111, jz.value[index].choose);
|
console.log(111, jz.value[index].choose);
|
||||||
break;
|
} else if (index === 1) {
|
||||||
case 1:
|
data.list = value === "1" ? data.housing : data.temporary;
|
||||||
value == "1" ? (data.list = data.housing) : (data.list = data.temporary);
|
} else if (index === 2) {
|
||||||
// console.log(data.list, jz.value[index].choose);
|
const listMap = {
|
||||||
break;
|
1: data.needyWorkers1,
|
||||||
case 2:
|
2: data.difficultSoldiers,
|
||||||
// console.log(333, jz.value[index].choose);
|
3: data.needyWorkers,
|
||||||
break;
|
};
|
||||||
default:
|
data.list1 = listMap[value];
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
list: {},
|
list: {},
|
||||||
|
list1: {},
|
||||||
|
list2: {},
|
||||||
education: {
|
education: {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
|
@ -206,6 +209,16 @@ const data = reactive({
|
||||||
],
|
],
|
||||||
year: ["2019"],
|
year: ["2019"],
|
||||||
}, //教育
|
}, //教育
|
||||||
|
education1: {
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
nf: "2019", //救助年份
|
||||||
|
jzrs: "4202", //救助人数
|
||||||
|
jzje: "1523", //救助金额
|
||||||
|
},
|
||||||
|
],
|
||||||
|
year: ["2019"],
|
||||||
|
}, //医疗
|
||||||
housing: {
|
housing: {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
|
@ -245,6 +258,26 @@ const data = reactive({
|
||||||
],
|
],
|
||||||
year: ["2019"],
|
year: ["2019"],
|
||||||
}, //困难军人
|
}, //困难军人
|
||||||
|
needyWorkers1: {
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
nf: "2019", //补贴年份
|
||||||
|
jzrs: "0", //补贴人数
|
||||||
|
jzje: "0", //补贴金额 万元
|
||||||
|
},
|
||||||
|
],
|
||||||
|
year: ["2019"],
|
||||||
|
}, //困难残疾人补助信息
|
||||||
|
needyWorkers: {
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
nf: "2019", //补贴年份
|
||||||
|
jzrs: "0", //补贴人数
|
||||||
|
jzje: "0", //补贴金额 万元
|
||||||
|
},
|
||||||
|
],
|
||||||
|
year: ["2019"],
|
||||||
|
}, //困难职工补助信息
|
||||||
diversification: {
|
diversification: {
|
||||||
hszhxms: [
|
hszhxms: [
|
||||||
{
|
{
|
||||||
|
@ -274,6 +307,7 @@ const getData = async () => {
|
||||||
// 教育&医疗
|
// 教育&医疗
|
||||||
data.education.data = res.data.specialAssistance.education.data;
|
data.education.data = res.data.specialAssistance.education.data;
|
||||||
data.education.year = res.data.specialAssistance.education.year;
|
data.education.year = res.data.specialAssistance.education.year;
|
||||||
|
data.list2 = data.education;
|
||||||
// 住房&临时救助
|
// 住房&临时救助
|
||||||
data.housing.data = res.data.specialAssistance.housing.data;
|
data.housing.data = res.data.specialAssistance.housing.data;
|
||||||
data.housing.year = res.data.specialAssistance.housing.year;
|
data.housing.year = res.data.specialAssistance.housing.year;
|
||||||
|
@ -286,19 +320,25 @@ const getData = async () => {
|
||||||
// 生活类救助模块
|
// 生活类救助模块
|
||||||
// 一卡通补贴
|
// 一卡通补贴
|
||||||
data.lifeAssistance.yktTotal = addThousandSeparator(
|
data.lifeAssistance.yktTotal = addThousandSeparator(
|
||||||
String((res.data.lifeAssistance.yktTotal/ 10000).toFixed(2))
|
String((res.data.lifeAssistance.yktTotal / 10000).toFixed(2))
|
||||||
);
|
);
|
||||||
data.lifeAssistance.subsidyInformation = res.data.lifeAssistance.subsidyInformation;
|
data.lifeAssistance.subsidyInformation =
|
||||||
|
res.data.lifeAssistance.subsidyInformation;
|
||||||
res.data.lifeAssistance.subsidyInformation.forEach((item, index) => {
|
res.data.lifeAssistance.subsidyInformation.forEach((item, index) => {
|
||||||
data.lifeAssistance.subsidyInformation[index].btje =
|
data.lifeAssistance.subsidyInformation[index].btje =
|
||||||
addThousandSeparator((item.btje/ 10000).toFixed(2));
|
addThousandSeparator((item.btje / 10000).toFixed(2));
|
||||||
});
|
});
|
||||||
// 弱势群体补贴
|
// 弱势群体补贴
|
||||||
// 困难残疾人&困难军人&困难职工
|
// 困难残疾人&困难军人&困难职工
|
||||||
|
// 困难军人
|
||||||
data.difficultSoldiers.data =
|
data.difficultSoldiers.data =
|
||||||
res.data.underprivileged.difficultSoldiers.data;
|
res.data.underprivileged.difficultSoldiers.data;
|
||||||
data.difficultSoldiers.year =
|
data.difficultSoldiers.year =
|
||||||
res.data.underprivileged.difficultSoldiers.year;
|
res.data.underprivileged.difficultSoldiers.year;
|
||||||
|
// 困难职工
|
||||||
|
data.needyWorkers.data = res.data.underprivileged.needyWorkers.data;
|
||||||
|
data.needyWorkers.year = res.data.underprivileged.needyWorkers.year;
|
||||||
|
data.list1 = data.needyWorkers1;
|
||||||
|
|
||||||
// 多元化力量参与
|
// 多元化力量参与
|
||||||
data.diversification.hszhxms = res.data.diversification.hszhxms;
|
data.diversification.hszhxms = res.data.diversification.hszhxms;
|
||||||
|
|
Loading…
Reference in New Issue