From c89c0df89e8f230bdcfae099018fabb5f223a866 Mon Sep 17 00:00:00 2001 From: duanxiaohai <1812246227@qq.com> Date: Thu, 6 Jun 2024 09:45:15 +0800 Subject: [PATCH] gx --- src/view/echarts_education/pie5.vue | 35 +++++++++++------------------ src/view/echarts_yl/ylSMFW.vue | 12 +++++----- src/view/yl.vue | 1 + 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/view/echarts_education/pie5.vue b/src/view/echarts_education/pie5.vue index 8eaecad..5413cce 100644 --- a/src/view/echarts_education/pie5.vue +++ b/src/view/echarts_education/pie5.vue @@ -45,6 +45,7 @@ const getOption = () => { textStyle: { fontSize: 16, color: "#ffffff", + // color: ["rgba(255, 234, 90, 1)", "rgba(23, 255, 206, 1)"], }, }, grid: { @@ -125,17 +126,12 @@ const getOption = () => { }, }, itemStyle: { - normal: { - color: function (params) { - var colorList = [ - new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "rgba(255, 234, 90, 0)" }, - { offset: 0.5, color: "rgba(255, 234, 90, 0.5)" }, - { offset: 1, color: "rgba(255, 234, 90, 1)" }, - ]), - ]; - return colorList[params.dataIndex % colorList.length]; - }, + color: { + type: "linear", + colorStops: [ + { offset: 0, color: "rgba(255, 234, 90, 0.2)" }, + { offset: 1, color: "rgba(255, 234, 90, 1)" }, + ], }, }, }, @@ -156,17 +152,12 @@ const getOption = () => { }, }, itemStyle: { - normal: { - color: function (params) { - var colorList = [ - new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "rgba(0, 255, 208,0)" }, - { offset: 0.5, color: "rgba(23, 255, 202, 0.20)" }, - { offset: 1, color: "rgba(23, 255, 206, 1)" }, - ]), - ]; - return colorList[params.dataIndex % colorList.length]; - }, + color: { + type: "linear", + colorStops: [ + { offset: 0, color: "rgba(23, 255, 206, 0.2)" }, + { offset: 1, color: "rgba(23, 255, 206, 1)" }, + ], }, }, }, diff --git a/src/view/echarts_yl/ylSMFW.vue b/src/view/echarts_yl/ylSMFW.vue index 1d06b5f..e65d0fc 100644 --- a/src/view/echarts_yl/ylSMFW.vue +++ b/src/view/echarts_yl/ylSMFW.vue @@ -324,10 +324,13 @@ const setChart = () => { const setChart1 = () => { data.list1 = []; data.list2 = []; - data.list.data.forEach((item) => { - data.list1.push(item.sc); //服务时长 - data.list2.push(item.fwcs); //服务次数 - }); + if (data.list.length !== 0) { + // console.log(data.list, "助老服务"); + data.list.data.forEach((item) => { + data.list1.push(item.sc); //服务时长 + data.list2.push(item.fwcs); //服务次数 + }); + } }; // 使用生命钩子 @@ -335,7 +338,6 @@ onBeforeMount(() => { setTimeout(() => { data.list = props.list; data.day = props.list.day; - // console.log(data.list, "助老服务"); setChart1(); getOption(); setChart(); diff --git a/src/view/yl.vue b/src/view/yl.vue index e161cb1..3c5e6f2 100644 --- a/src/view/yl.vue +++ b/src/view/yl.vue @@ -503,6 +503,7 @@ const getData = async () => { data.yljgzlzx.zlzx = res.data.yljgzlzx.zlzx; // 助老服务 data.smfwcs = res.data.zlfw.smfwcs; + console.log(data.smfwcs,6666); // 乡镇助餐次数 res.data.zlfw.xzzccs.forEach((element) => { data.zccs1.push(element.xzjd); // 地点