From 53589c7ef8690ec84eb17f1d4adaad87b18969ba Mon Sep 17 00:00:00 2001 From: duanxiaohai <1812246227@qq.com> Date: Thu, 24 Oct 2024 14:29:08 +0800 Subject: [PATCH] gx --- src/view/echarts_lysd/eP1.vue | 24 +- src/view/echarts_lysd/eP4.vue | 13 +- src/view/echarts_lysd/eP5.vue | 143 +++++---- src/view/echarts_lysd/gsbx_1.vue | 479 ++++++++++++++++--------------- src/view/echarts_lysd/gsbx_2.vue | 23 +- src/view/table_gk/gk_lysd.vue | 45 ++- 6 files changed, 374 insertions(+), 353 deletions(-) diff --git a/src/view/echarts_lysd/eP1.vue b/src/view/echarts_lysd/eP1.vue index 3b3a67f..9b5b1b1 100644 --- a/src/view/echarts_lysd/eP1.vue +++ b/src/view/echarts_lysd/eP1.vue @@ -94,7 +94,7 @@ const updateSeries = () => { data.legend.data = data.list.map((item) => item.name); data.formatter = - "{b0}月
" + + "{b0}
" + data.list.map((_, index) => `{a${index}}:{c${index}}
`).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(); diff --git a/src/view/echarts_lysd/eP4.vue b/src/view/echarts_lysd/eP4.vue index 63ebee4..c3cac51 100644 --- a/src/view/echarts_lysd/eP4.vue +++ b/src/view/echarts_lysd/eP4.vue @@ -57,7 +57,7 @@ const getOption = () => { data.option = { tooltip: { trigger: "axis", - formatter: "{b0}月
{a0}:{c0}
{a1}:{c1}", + formatter: "{b0}
{a0}:{c0}
{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); diff --git a/src/view/echarts_lysd/eP5.vue b/src/view/echarts_lysd/eP5.vue index a948008..fbcf5e1 100644 --- a/src/view/echarts_lysd/eP5.vue +++ b/src/view/echarts_lysd/eP5.vue @@ -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}
{a0}:{c0}
{a1}:{c1}", - }, - legend: { - data: ["救助金额", "救助人数"], - top: "8%", - textStyle: { - fontSize: 14, - color: "#ffffff", //上文字标题颜色 - }, + formatter: "{b0}
{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); diff --git a/src/view/echarts_lysd/gsbx_1.vue b/src/view/echarts_lysd/gsbx_1.vue index 0a0ebb6..61679e5 100644 --- a/src/view/echarts_lysd/gsbx_1.vue +++ b/src/view/echarts_lysd/gsbx_1.vue @@ -1,53 +1,53 @@ - - - - - \ No newline at end of file + getOption(); + setChart(); + }, 600); +}); + + + diff --git a/src/view/echarts_lysd/gsbx_2.vue b/src/view/echarts_lysd/gsbx_2.vue index 3b1afdd..74f10f5 100644 --- a/src/view/echarts_lysd/gsbx_2.vue +++ b/src/view/echarts_lysd/gsbx_2.vue @@ -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(); diff --git a/src/view/table_gk/gk_lysd.vue b/src/view/table_gk/gk_lysd.vue index 40480ce..0192b4c 100644 --- a/src/view/table_gk/gk_lysd.vue +++ b/src/view/table_gk/gk_lysd.vue @@ -76,10 +76,19 @@ 参保人数 - + +
-
+
@@ -99,8 +108,16 @@ 累计待遇金额
- - + +
@@ -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%; }