This commit is contained in:
duanxiaohai 2024-10-24 13:50:15 +08:00
parent b33f790fee
commit a4074d2546
5 changed files with 78 additions and 55 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -204,8 +204,6 @@ const setChart = () => {
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list;
console.log(666,data.list);
getOption();
setChart();
}, 600);

View File

@ -28,7 +28,7 @@ const props = defineProps({
// return [];
// },
// },
year: {
month: {
type: Array,
default: () => {
return [];
@ -42,7 +42,7 @@ const data = reactive({
list: [],
list1: [],
list2: [],
year: [],
month: [],
option: {},
// max: null,
});
@ -57,10 +57,10 @@ 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: ["救助金额", "救助人数"],
data: ["失业保险金享受人数", "发放失业保险金金额"],
top: "8%",
textStyle: {
fontSize: 14,
@ -91,19 +91,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: {
//线
@ -136,8 +136,7 @@ const getOption = () => {
type: "value",
scale: true,
min: 0,
name: "救助金额/万",
// name: "/",
splitLine: {
show: false,
lineStyle: {
@ -192,7 +191,7 @@ const getOption = () => {
series: [
{
yAxisIndex: 1,
name: "救助金额",
name: "失业保险金享受人数",
data: data.list2,
type: "line", //线
stack: "Total",
@ -207,15 +206,15 @@ const getOption = () => {
},
},
itemStyle: {
borderColor: "#00FCFF",
borderColor: "rgba(165, 255, 200, 1)",
borderWidth: 1,
color: "#00FCFF",
color: "rgba(165, 255, 200, 1)",
},
},
{
z: 1,
yAxisIndex: 0,
name: "救助人数",
name: "发放失业保险金金额",
data: data.list1,
barWidth: 20,
type: "bar",
@ -235,10 +234,10 @@ const getOption = () => {
y: 0,
y2: 0,
colorStops: [
{ offset: 0, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .7)" },
{ offset: 0.5, color: "rgba(255, 242, 142, .3)" },
{ offset: 1, color: "rgba(255, 242, 142, .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)" },
],
},
},
@ -271,8 +270,8 @@ const getOption = () => {
itemStyle: {
color: "rgba(221, 242, 255, 0.1)",
},
data: data.list.year.map(() => 100),
barWidth: 50,
data: data.month.map(() => 100),
barWidth: 30,
},
{
z: 1,
@ -282,10 +281,9 @@ const getOption = () => {
symbol: "diamond",
symbolOffset: ["0%", "-50%"],
symbolSize: [21, 15],
itemStyle: {
borderColor: "#2fffa4",
color: "rgba(255, 242, 142, 1)",
color: "rgba(142, 187, 255, 1)",
},
},
],
@ -298,34 +296,48 @@ const setChart = () => {
};
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); //
});
if (data.list.length !== 0) {
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;
// console.log("1", data.list);
// setChart1();
// getOption();
// setChart();
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, "");
// getOption();
// setChart();
// }, 600);
setTimeout(() => {
data.list = props.list;
data.month = props.month;
setChart1();
console.log("失业", props.list, data.list1, data.list2);
getOption();
setChart();
}, 600);
});
</script>

View File

@ -287,16 +287,16 @@ const data = reactive({
img: icon3,
visible: false,
son: [
// {
// id: "0",
// name: "",
// },
{
id: "0",
name: "就业创业服务",
name: "概况",
},
{
id: "1",
name: "就业创业服务",
},
{
id: "2",
name: "工伤失业保险服务",
},
],
@ -568,6 +568,8 @@ const tapshow = (parentId, childId) => {
childId == 0 &&
(parentId.name == "幼有所育" ||
parentId.name == "弱有所扶" ||
parentId.name == "劳有所得" ||
parentId.name == "学有所教" ||
parentId.name == "老有所养" ||
parentId.name == "病有所医" ||
@ -631,9 +633,9 @@ const gaikuang = (name) => {
} else if (name == "学有所教") {
gaikuangList.education = true;
}
// else if (name == "") {
// gaikuangList.lysd = true;
// }
else if (name == "劳有所得") {
gaikuangList.lysd = true;
}
else if (name == "老有所养") {
gaikuangList.yl = true;
} else if (name == "病有所医") {

View File

@ -76,7 +76,7 @@
参保人数
</div>
</div>
<!-- <eP4 :list="data.list2"></eP4> -->
<eP4 :list="data.list2" :month="data.sybx.month"></eP4>
</div>
<div class="flex1" style="flex: 1.1">
<div class="yd_title service">
@ -124,7 +124,7 @@ import jy7 from "@/assets/images/lysd/jy7.png";
import jy8 from "@/assets/images/lysd/jy8.png";
const data = reactive({
//
list2: {}, //
employmentList: [
{
name: "2024年发布人力资源供求信息",
@ -174,7 +174,7 @@ const data = reactive({
dw: "份",
img: jy8,
},
],
], //
ViewData: [
{
name: "一级/高级技师",
@ -222,7 +222,14 @@ const data = reactive({
{ name: "博士", value: 0 },
{ name: "其他", value: 0 },
], //
sybx: {}, //
sybx: {
month: [], //
cbrs: [], //
sybx: {
sybxjxsrs: [], //
ffsybxjje: [], //
}, //
}, //
gsbx: {}, //
});
const showEchart = ref(false);
@ -239,8 +246,8 @@ const jzChange = (index, value) => {
console.log(index, value);
jz.value[index].choose = value;
if (index === 0) {
data.list2 = value == "1" ? data.education : data.medical;
// console.log(value, data.education, data.medical);
data.list2 = value == "1" ? data.sybx.sybx : data.sybx.cbrs;
console.log(value, data.list2);
} else if (index === 1) {
data.list = value === "1" ? data.housing : data.temporary;
}
@ -280,7 +287,11 @@ const getData = async () => {
data.rczy[3].value = res.data.rczy.bs; //
data.rczy[4].value = res.data.rczy.qt; //
data.sybx = res.data.sybx; //
data.sybx.month = res.data.sybx.month; //
data.sybx.cbrs = res.data.sybx.cbrs; //
data.sybx.sybx = res.data.sybx.sybx; //
data.list2 = data.sybx.sybx;
data.gsbx = res.data.gsbx; //
}
});