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 = () => { const setChart1 = () => {
if(data.list.length !== 0) {
data.list1 = []; data.list1 = [];
data.list2 = []; data.list2 = [];
data.list.data.forEach((item) => { data.list.data.forEach((item) => {
data.list1.push(item.jzrs); // data.list1.push(item.jzrs); //
data.list2.push(item.jzje); // data.list2.push(item.jzje); //
}); });
}
}; };
watch( watch(
() => props.list, () => props.list,

View File

@ -294,6 +294,7 @@ const setChart = () => {
}; };
const setChart1 = () => { const setChart1 = () => {
if (data.list.length !== 0) {
data.list1 = []; data.list1 = [];
data.list2 = []; data.list2 = [];
data.list.data.forEach((item) => { data.list.data.forEach((item) => {
@ -301,6 +302,7 @@ const setChart1 = () => {
data.list2.push(item.jzje); // data.list2.push(item.jzje); //
}); });
// console.log("2", data.list1, data.list2); // console.log("2", data.list1, data.list2);
}
}; };
watch( watch(
() => props.list, () => props.list,

View File

@ -431,6 +431,7 @@ const setChart = () => {
}; };
const setChart1 = () => { const setChart1 = () => {
if (data.list.length !== 0) {
data.list1 = []; data.list1 = [];
data.list2 = []; data.list2 = [];
data.list3 = []; data.list3 = [];
@ -443,6 +444,7 @@ const setChart1 = () => {
data.list2.push(item.dbjzrs); // data.list2.push(item.dbjzrs); //
data.list3.push(item.dibianJzrs); // data.list3.push(item.dibianJzrs); //
}); });
}
}; };
// 使 // 使

View File

@ -202,6 +202,7 @@ const jz = ref([
choose: "1", choose: "1",
}, },
]); ]);
const jzChange = (index, value) => { const jzChange = (index, value) => {
jz.value[index].choose = value; jz.value[index].choose = value;
if (index === 0) { 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({ const data = reactive({
list: {}, list: {},
list1: {}, list1: {},
@ -380,7 +393,8 @@ const getData = async () => {
data.disabilitySubsidies.month = data.disabilitySubsidies.month =
res.data.underprivileged.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 = data.difficultSoldiers.year =
res.data.underprivileged.difficultSoldiers.year; res.data.underprivileged.difficultSoldiers.year;
// //
@ -429,6 +443,7 @@ onBeforeMount(() => {
}); });
onMounted(() => { onMounted(() => {
startAutoScroll(); startAutoScroll();
onTypeSwitching();
}); });
</script> </script>