This commit is contained in:
duanxiaohai 2024-06-26 13:49:35 +08:00
parent 333538c8df
commit 7d3a54a1e1
3 changed files with 124 additions and 76 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -112,7 +112,7 @@
<i></i> <i></i>
</div> </div>
</div> </div>
<right1></right1> <right1 :list="data.wjybrysl"></right1>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title right_2"> <div class="yd_title right_2">
@ -260,6 +260,7 @@ const data = reactive({
data: ["0", "0", "0", "0", "0", "0"], // data: ["0", "0", "0", "0", "0", "0"], //
}, },
], // ], //
wjybrysl: [],
leftCenterYear: ["2019", "2020", "2021", "2022", "2023", "2024"], // leftCenterYear: ["2019", "2020", "2021", "2022", "2023", "2024"], //
zccs1: ["图书馆", "公共自行车", "小奔通"], // zccs1: ["图书馆", "公共自行车", "小奔通"], //
zccs2: ["100", "3924", "3905"], // zccs2: ["100", "3924", "3905"], //
@ -360,8 +361,10 @@ const getData = async () => {
ageBt.forEach((key, index) => { ageBt.forEach((key, index) => {
data.whistleblower.culeTotal.data[index] = res.data.lnr.rksj[key]; data.whistleblower.culeTotal.data[index] = res.data.lnr.rksj[key];
}); });
data.leftCenterYear = res.data.dataShow.year; data.leftCenterYear = res.data.dataShow.year;
data.wjybrysl = res.data.wjybrysl;
console.log(data.wjybrysl,1111);
data.ViewData[2].data = res.data.dataShow.gxyrs.gxyrs; // data.ViewData[2].data = res.data.dataShow.gxyrs.gxyrs; //
data.ViewData[2].value = res.data.dataShow.gxyrs.total; // data.ViewData[2].value = res.data.dataShow.gxyrs.total; //
data.ViewData[3].data = res.data.dataShow.tnbrs.tnbrs; //尿 data.ViewData[3].data = res.data.dataShow.tnbrs.tnbrs; //尿

View File

@ -3,11 +3,35 @@
</template> </template>
<script setup> <script setup>
import { onMounted, reactive, ref } from "vue"; import {
onMounted,
onBeforeMount,
reactive,
defineProps,
ref,
nextTick,
} from "vue";
// echarts // echarts
import * as echarts from "echarts"; import * as echarts from "echarts";
const chart = ref(null); // DOM const chart = ref(); // DOM
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
const data = reactive({
list: [],
list1: [],
list2: [],
year: [],
option: {},
});
const data1 = [ const data1 = [
"大街乡", "大街乡",
"社阳乡", "社阳乡",
@ -42,80 +66,80 @@ const data2 = [
"21307", "21307",
"20000", "20000",
]; ];
const getOption = () => {
let option = { data.option = {
grid: { grid: {
left: "2%", left: "2%",
right: "10%", right: "10%",
bottom: "2%", top: "4%",
top: "4%", bottom: "6%",
containLabel: true, containLabel: true,
},
tooltip: {
trigger: "axis", //axis , item
},
// backgroundColor: '#002D54',
xAxis: {
type: "value",
splitLine: {
lineStyle: {
color: "rgba(77, 128, 254, 0.2)",
type: "line",
},
}, },
axisTick: { tooltip: {
show: true, trigger: "axis", //axis , item
}, },
splitLine: { // backgroundColor: '#002D54',
show: false, xAxis: {
}, type: "value",
axisLabel: { splitLine: {
// x lineStyle: {
show: false, color: "rgba(77, 128, 254, 0.2)",
textStyle: { type: "line",
color: "#00c0fa",
fontSize: 19,
},
},
},
yAxis: [
{
type: "category",
inverse: true,
axisLabel: {
show: true,
textStyle: {
color: "#ffffff",
fontSize: "14",
}, },
}, },
axisTick: {
show: true,
},
splitLine: { splitLine: {
show: false, show: false,
}, },
axisTick: { axisLabel: {
// x
show: false, show: false,
textStyle: {
color: "#00c0fa",
fontSize: 19,
},
}, },
axisLine: {
show: false,
},
data: data1,
}, },
], yAxis: [
series: [ {
{ type: "category",
name: "未交医保人员", inverse: true,
type: "bar", axisLabel: {
zlevel: 1, show: true,
label: { textStyle: {
show: true, color: "#ffffff",
position: "right", // fontSize: "14",
color: "#ffffff", },
fontSize: 12, },
distance: 10, // splitLine: {
// formatter: '{c}%' // show: false,
}, // },
itemStyle: { axisTick: {
// normal: { show: false,
},
axisLine: {
show: false,
},
data: data.list1,
},
],
series: [
{
name: "未交医保人员",
type: "bar",
zlevel: 1,
label: {
show: true,
position: "right", //
color: "#ffffff",
fontSize: 12,
distance: 10, //
// formatter: '{c}%' //
}, //
itemStyle: {
// normal: {
borderWidth: 1, borderWidth: 1,
// borderColor: "rgba(0, 183, 255, 1)", // borderColor: "rgba(0, 183, 255, 1)",
borderRadius: [0, 0, 50, 0], // borderRadius: [0, 0, 50, 0], //
@ -123,18 +147,39 @@ let option = {
{ offset: 0, color: "rgba(0, 183, 255, 0)" }, { offset: 0, color: "rgba(0, 183, 255, 0)" },
{ offset: 1, color: "rgba(0, 183, 255, 1)" }, { offset: 1, color: "rgba(0, 183, 255, 1)" },
]), ]),
// }, // },
},
barWidth: 10,
data: data.list2,
}, },
barWidth: 10, ],
data: data2, };
},
],
}; };
onMounted(() => { // onMounted(() => {
// var myChart = echarts.init(chart.value);
// myChart.setOption(option);
// });
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value); var myChart = echarts.init(chart.value);
// 使
myChart.setOption(option); myChart.setOption(data.option);
};
const setChart1 = () => {
data.list.forEach((item) => {
data.list1.push(item.xzjd);
data.list2.push(item.rs);
});
console.log(data.list1, data.list2);
};
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list;
setChart1();
getOption();
setChart();
}, 600);
}); });
</script> </script>