This commit is contained in:
duanxiaohai 2024-06-06 17:30:20 +08:00
parent 99919c256b
commit 88ea9bb25b
4 changed files with 45 additions and 24 deletions

View File

@ -298,12 +298,14 @@ 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); //
});
data.list.data.forEach((item) => {
data.list1.push(item.jzrs); //
data.list2.push(item.jzje); //
});
}
};
watch(
() => props.list,

View File

@ -294,13 +294,15 @@ const setChart = () => {
};
const setChart1 = () => {
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);
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);
}
};
watch(
() => props.list,

View File

@ -431,18 +431,20 @@ const setChart = () => {
};
const setChart1 = () => {
data.list1 = [];
data.list2 = [];
data.list3 = [];
data.lineData = [];
data.lineData1 = [];
data.list.data.forEach((item) => {
data.lineData.push(item.tkjzje); //
data.lineData1.push(item.dbjzje); //
data.list1.push(item.tkjzrs); //
data.list2.push(item.dbjzrs); //
data.list3.push(item.dibianJzrs); //
});
if (data.list.length !== 0) {
data.list1 = [];
data.list2 = [];
data.list3 = [];
data.lineData = [];
data.lineData1 = [];
data.list.data.forEach((item) => {
data.lineData.push(item.tkjzje); //
data.lineData1.push(item.dbjzje); //
data.list1.push(item.tkjzrs); //
data.list2.push(item.dbjzrs); //
data.list3.push(item.dibianJzrs); //
});
}
};
// 使

View File

@ -202,6 +202,7 @@ const jz = ref([
choose: "1",
},
]);
const jzChange = (index, value) => {
jz.value[index].choose = value;
if (index === 0) {
@ -219,6 +220,18 @@ const jzChange = (index, value) => {
}
};
const typeSwitching = ref(true);
const onTypeSwitching = () => {
const toggleShow = () => {
typeSwitching.value = !typeSwitching.value;
const type = typeSwitching.value ? "1" : "2";
jzChange(0, type);
jzChange(1, type);
};
setInterval(toggleShow, 2000); // 2
};
const data = reactive({
list: {},
list1: {},
@ -380,7 +393,8 @@ const getData = async () => {
data.disabilitySubsidies.month =
res.data.underprivileged.disabilitySubsidies.month;
//
data.difficultSoldiers.data = res.data.underprivileged.difficultSoldiers.data;
data.difficultSoldiers.data =
res.data.underprivileged.difficultSoldiers.data;
data.difficultSoldiers.year =
res.data.underprivileged.difficultSoldiers.year;
//
@ -429,6 +443,7 @@ onBeforeMount(() => {
});
onMounted(() => {
startAutoScroll();
onTypeSwitching();
});
</script>