This commit is contained in:
duanxiaohai 2024-10-24 14:29:08 +08:00
parent be30b6aa16
commit 53589c7ef8
6 changed files with 374 additions and 353 deletions

View File

@ -94,7 +94,7 @@ const updateSeries = () => {
data.legend.data = data.list.map((item) => item.name);
data.formatter =
"{b0}<br />" +
"{b0}<br />" +
data.list.map((_, index) => `{a${index}}:{c${index}}<br />`).join("");
};
@ -195,29 +195,11 @@ const setChart = () => {
myChart.setOption(data.option);
};
// watch(
// () => props.list,
// (newVal, oldVal) => {
// if (newVal.length < oldVal.length) {
// clear.value = true;
// } else {
// clear.value = false;
// }
// data.list = newVal;
// updateSeries();
// getOption();
// setChart();
// }
// );
onMounted(() => {
setTimeout(() => {
data.list = props.list;
data.month = props.month;
// console.log(666, data.list, data.month);
// data.month.forEach((item) => {
// item = item + "";
// });
data.month = props.month.map((item) => item + "月");
updateSeries();
getOption();

View File

@ -57,7 +57,7 @@ const getOption = () => {
data.option = {
tooltip: {
trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
},
legend: {
data: ["失业保险金享受人数", "发放失业保险金金额"],
@ -68,8 +68,8 @@ const getOption = () => {
},
},
grid: {
left: "6%",
right: "9%",
left: "3%",
right: "3%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
@ -311,7 +311,7 @@ watch(
() => props.list,
(newVal, oldVal) => {
data.list = newVal;
data.month = props.month;
data.month = props.month.map((item) => item + "月");
// console.log("1", data.list);
setChart1();
getOption();
@ -332,9 +332,10 @@ watch(
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list;
data.month = props.month;
// data.month = props.month;
data.month = props.month.map((item) => item + "月");
setChart1();
console.log("失业", props.list, data.list1, data.list2);
// console.log("", props.list, data.list1, data.list2);
getOption();
setChart();
}, 600);

View File

@ -7,9 +7,9 @@ import {
onBeforeMount,
onMounted,
ref,
watch,
reactive,
defineProps,
watch,
nextTick,
} from "vue";
// echarts
@ -28,7 +28,7 @@ const props = defineProps({
// return [];
// },
// },
year: {
month: {
type: Array,
default: () => {
return [];
@ -42,28 +42,35 @@ const data = reactive({
list: [],
list1: [],
list2: [],
year: [],
month: [],
option: {},
// max: null,
});
// const data1 = [120, 200, 50, 80, 70];
// const lineData = [1500, 2300, 204, 2018, 1305];
// const max = data1
// .concat(lineData)
// .reduce((pre, cur) => (pre > cur ? pre : cur), 0); //
const getOption = () => {
data.option = {
tooltip: {
trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
},
legend: {
data: ["救助金额", "救助人数"],
top: "8%",
textStyle: {
fontSize: 14,
color: "#ffffff", //
},
formatter: "{b0}<br/> {a0}:{c0}",
},
// legend: {
// data: [""],
// top: "8%",
// textStyle: {
// fontSize: 14,
// color: "#ffffff", //
// },
// },
grid: {
left: "6%",
right: "9%",
top: "0",
left: "3%",
right: "3%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
@ -85,19 +92,19 @@ const getOption = () => {
show: false, //
},
// data: ["2019", "2020", "2021", "2022", "2023"],
data: data.list.year,
data: data.month,
},
{
type: "category",
show: false,
data: data.list.year,
data: data.month,
},
],
yAxis: [
{
type: "value",
scale: true,
name: "救助人数",
// name: "",
min: 0,
splitLine: {
//线
@ -130,8 +137,7 @@ const getOption = () => {
type: "value",
scale: true,
min: 0,
name: "救助金额/万",
// name: "/",
splitLine: {
show: false,
lineStyle: {
@ -184,33 +190,33 @@ const getOption = () => {
},
],
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: 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: "rgba(165, 255, 200, 1)",
// borderWidth: 1,
// color: "rgba(165, 255, 200, 1)",
// },
// },
{
z: 1,
yAxisIndex: 0,
name: "救助人数",
data: data.list1,
name: "参保人数",
data: data.list,
barWidth: 20,
type: "bar",
label: {
@ -229,10 +235,10 @@ const getOption = () => {
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .3)" },
{ offset: 1, color: "rgba(23, 237, 255, .5)" },
{ offset: 0, color: "rgba(142, 187, 255, 0.7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, 0.7)" },
{ offset: 0.5, color: "rgba(142, 187, 255, 0.3)" },
{ offset: 1, color: "rgba(142, 187, 255, 0.5)" },
],
},
},
@ -265,23 +271,20 @@ const getOption = () => {
itemStyle: {
color: "rgba(221, 242, 255, 0.1)",
},
data: data.list.year.map(() => 100),
// data: 100,
barWidth: 50,
data: data.month.map(() => 100),
barWidth: 30,
},
//
{
z: 1,
type: "pictorialBar",
symbolPosition: "end",
data: data.list1,
data: data.list,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [21, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(23, 237, 255, 1)",
color: "rgba(142, 187, 255, 1)",
},
},
],
@ -297,30 +300,44 @@ const setChart1 = () => {
if (data.list.length !== 0) {
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);
data.list1 = data.list.sybxjxsrs;
data.list2 = data.list.ffsybxjje;
// data.list.forEach((item) => {
// data.list1.push(item.sybxjxsrs); //
// data.list2.push(item.ffsybxjje); //
// });
}
};
watch(
() => props.list,
(newVal, oldVal) => {
data.list = newVal;
// data.month = props.month;
data.month = props.month.map((item) => item + "月");
// console.log("1", data.list);
setChart1();
// setChart1();
getOption();
setChart();
}
);
// 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, data.list1, data.list2, "");
// data.month = props.month;
data.month = props.month.map((item) => item + "月");
// setChart1();
// console.log("", props.list);
getOption();
setChart();
}, 600);

View File

@ -1,53 +1,53 @@
<template>
<div ref="chart" style="width: 100%; height: 330px"></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 [];
},
<div ref="chart" style="width: 100%; height: 330px"></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 [];
},
// list2: {
// type: Array,
// default: () => {
// return [];
// },
// },
year: {
type: Array,
default: () => {
return [];
},
},
// list2: {
// type: Array,
// default: () => {
// return [];
// },
// },
month: {
type: Array,
default: () => {
return [];
},
});
const chart = ref(); // DOM
const data = reactive({
list: [],
list1: [],
year: [],
option: {},
// max: null,
});
const getOption = () => {
data.option = {
},
});
const chart = ref(); // DOM
const data = reactive({
list: [],
list1: [],
month: [],
option: {},
// max: null,
});
const getOption = () => {
data.option = {
// tooltip: {
// trigger: "axis",
// formatter: "{b0}<br/> {a0}:{c0}",
@ -60,214 +60,215 @@
// color: "#ffffff", //
// },
// },
grid: {
left: "6%",
right: "9%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
},
calculable: true,
xAxis: [
{
type: "category",
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 14,
},
},
axisTick: {
show: false, //
},
// data: ["2019", "2020", "2021", "2022", "2023"],
data: data.year,
},
{
type: "category",
show: false,
data: data.year,
},
],
yAxis: [
{
type: "value",
scale: true,
name: "工伤保险金累计享受人数",
min: 0,
splitLine: {
//线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 14,
width: 1,
},
},
axisLabel: {
//y
textStyle: {
fontSize: 14,
color: "#ffffff",
},
},
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,
grid: {
top: "3%",
left: "6%",
right: "3%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
},
calculable: true,
xAxis: [
{
type: "category",
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 14,
fontFamily: "MicrosoftYaHei",
color: "#ffffff",
lineHeight: 19,
},
},
],
series: [
{
z: 1,
yAxisIndex: 0,
name: "救助人数",
data: data.list1,
barWidth: 20,
type: "bar",
label: {
show: true,
// position: "insideTop",
axisTick: {
show: false, //
},
// data: ["2019", "2020", "2021", "2022", "2023"],
data: data.month,
},
{
type: "category",
show: false,
data: data.month,
},
],
yAxis: [
{
type: "value",
scale: true,
name: "工伤保险金累计享受人数",
min: 0,
splitLine: {
//线
show: false,
lineStyle: {
color: "#ffffff",
formatter: function (data) {
return data.value;
},
fontSize: 14,
width: 1,
},
},
axisLabel: {
//y
textStyle: {
fontSize: 14,
color: "#ffffff",
},
},
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: [
{
z: 1,
yAxisIndex: 0,
name: "救助人数",
data: data.list1,
barWidth: 30,
type: "bar",
label: {
show: true,
// position: "insideTop",
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 1,
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .3)" },
{ offset: 1, color: "rgba(23, 237, 255, .5)" },
],
},
},
},
{
type: "bar",
xAxisIndex: 1,
yAxisIndex: 1,
emphasis: {
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 1,
x2: 0,
y: 0,
y2: 0,
y2: 1,
colorStops: [
{ offset: 0, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .7)" },
{ offset: 0.5, color: "rgba(23, 237, 255, .3)" },
{ offset: 1, color: "rgba(23, 237, 255, .5)" },
{
offset: 0,
color: "rgba(64, 247, 176, 0.25)",
},
{
offset: 1,
color: "rgba(17, 34, 64, 0.25)",
},
],
},
},
},
{
type: "bar",
xAxisIndex: 1,
yAxisIndex: 1,
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.year.map(() => 100),
// data: 100,
barWidth: 50,
itemStyle: {
color: "rgba(221, 242, 255, 0.1)",
},
//
{
z: 1,
type: "pictorialBar",
symbolPosition: "end",
data: data.list1,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [21, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(23, 237, 255, 1)",
},
data: data.month.map(() => 100),
// data: 100,
barWidth: 40,
},
//
{
z: 1,
type: "pictorialBar",
symbolPosition: "end",
data: data.list1,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [31, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(23, 237, 255, 1)",
},
],
};
},
],
};
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
};
const setChart1 = () => {
// if (data.list.length !== 0) {
// data.list1 = [];
// data.list.data.forEach((item) => {
// data.list1.push(item.jzrs); //
// });
// }
};
watch(
() => props.list,
(newVal, oldVal) => {
data.list1 = newVal;
setChart1();
getOption();
setChart();
}
);
// 使
onBeforeMount(() => {
setTimeout(() => {
data.list1 = props.list;
data.year=props.year;
};
const setChart = () => {
var myChart = echarts.init(chart.value);
myChart.setOption(data.option);
};
const setChart1 = () => {
// if (data.list.length !== 0) {
// data.list1 = [];
// data.list.data.forEach((item) => {
// data.list1.push(item.jzrs); //
// });
// }
};
watch(
() => props.list,
(newVal, oldVal) => {
data.list1 = newVal;
setChart1();
getOption();
setChart();
}
);
// 使
onBeforeMount(() => {
setTimeout(() => {
data.list1 = props.list;
// data.month = props.month;
data.month = props.month.map((item) => item + "月");
// setChart1();
getOption();
setChart();
}, 600);
});
</script>
<style scoped></style>
getOption();
setChart();
}, 600);
});
</script>
<style scoped></style>

View File

@ -28,7 +28,7 @@
// return [];
// },
// },
year: {
month: {
type: Array,
default: () => {
return [];
@ -41,7 +41,7 @@
const data = reactive({
list: [],
list1: [],
year: [],
month: [],
option: {},
// max: null,
});
@ -61,8 +61,9 @@
// },
// },
grid: {
left: "6%",
right: "9%",
top: "3%",
left: "3%",
right: "3%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
@ -84,12 +85,12 @@
show: false, //
},
// data: ["2019", "2020", "2021", "2022", "2023"],
data: data.year,
data: data.month,
},
{
type: "category",
show: false,
data: data.year,
data: data.month,
},
],
yAxis: [
@ -157,7 +158,7 @@
yAxisIndex: 0,
name: "救助人数",
data: data.list1,
barWidth: 20,
barWidth: 30,
type: "bar",
label: {
show: true,
@ -211,9 +212,9 @@
itemStyle: {
color: "rgba(221, 242, 255, 0.1)",
},
data: data.year.map(() => 100),
data: data.month.map(() => 100),
// data: 100,
barWidth: 50,
barWidth: 40,
},
//
{
@ -223,7 +224,7 @@
data: data.list1,
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [21, 15],
symbolSize: [31, 15],
itemStyle: {
borderColor: "#2fffa4",
@ -261,7 +262,7 @@
onBeforeMount(() => {
setTimeout(() => {
data.list1 = props.list;
data.year=props.year;
data.month = props.month.map((item) => item + "月");
// setChart1();
getOption();
setChart();

View File

@ -76,10 +76,19 @@
参保人数
</div>
</div>
<eP4 :list="data.list2" :month="data.sybx.month"></eP4>
<eP4
:list="data.list2"
:month="data.sybx.month"
v-if="jz[0].choose == '1'"
></eP4>
<eP5
:list="data.list2"
:month="data.sybx.month"
v-if="jz[0].choose == '2'"
></eP5>
</div>
<div class="flex1" style="flex: 1.1">
<div class="yd_title service">
<div class="yd_title last">
<div class="animate-border">
<i></i>
<i></i>
@ -99,8 +108,16 @@
累计待遇金额
</div>
</div>
<gsbx_1 :list="data.gsbx.list1" :year="data.gsbx.year" v-if="jz[1].choose == '1'"></gsbx_1>
<gsbx_2 :list="data.gsbx.list1" :year="data.gsbx.year" v-if="jz[1].choose == '2'"></gsbx_2>
<gsbx_1
:list="data.gsbx.list1"
:month="data.gsbx.month"
v-if="jz[1].choose == '1'"
></gsbx_1>
<gsbx_2
:list="data.gsbx.list2"
:month="data.gsbx.month"
v-if="jz[1].choose == '2'"
></gsbx_2>
</div>
</div>
</div>
@ -233,9 +250,9 @@ const data = reactive({
}, //
}, //
gsbx: {
list1:[100,200,300],
list2:[],
year:['5','6','7']
list1: [100, 200, 300],
list2: [],
month: ["5", "6", "7"],
}, //
});
const showEchart = ref(false);
@ -298,7 +315,9 @@ const getData = async () => {
data.sybx.sybx = res.data.sybx.sybx; //
data.list2 = data.sybx.sybx;
data.gsbx = res.data.gsbx; //
data.gsbx.month = res.data.gsbx.month; //
data.gsbx.list1 = res.data.gsbx.gsbxjxsrs; //
data.gsbx.list2 = res.data.gsbx.gsffbxjje; //
}
});
};
@ -489,7 +508,7 @@ onMounted(() => {});
background-size: 100% 100%;
}
.last {
background-image: url(@/assets/images/hygiene/new_jkhd.png);
background-image: url(@/assets/images/lysd/lysd_6.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
@ -596,7 +615,7 @@ onMounted(() => {});
color: #ffffff;
line-height: 22px;
margin-right: 15px;
background-image: url(@/assets/images/hygiene/choose.png);
background-image: url(@/assets/images/lysd/lysd_7.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
@ -612,7 +631,7 @@ onMounted(() => {});
color: #ffffff;
line-height: 22px;
margin-right: 15px;
background-image: url(@/assets/images/hygiene/noChoose.png);
background-image: url(@/assets/images/lysd/lysd_8.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
@ -1228,7 +1247,7 @@ onMounted(() => {});
color: #ffffff;
line-height: 22px;
margin-right: 15px;
background-image: url(@/assets/images/work/choose.png);
background-image: url(@/assets/images/lysd/lysd_7.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
@ -1245,7 +1264,7 @@ onMounted(() => {});
color: #ffffff;
line-height: 22px;
margin-right: 15px;
background-image: url(@/assets/images/work/noChoose.png);
background-image: url(@/assets/images/lysd/lysd_8.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}