This commit is contained in:
duanxiaohai 2024-06-07 11:48:45 +08:00
parent 88ea9bb25b
commit 4b43206af9
2 changed files with 23 additions and 17 deletions

View File

@ -356,7 +356,7 @@ onBeforeMount(() => {
data.year = data.list.year;
data.list.data.forEach((item) => {
data.list1.push(item.jzrs);
data.list2.push(item.jzje);
data.list2.push(Math.floor(item.jzje)); //
});
getOption();
setChart();

View File

@ -220,18 +220,6 @@ 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: {},
@ -438,12 +426,30 @@ const autoScroll = () => {
}
};
onBeforeMount(() => {
getData();
});
const typeSwitching = ref(true);
const toggleShow = () => {
typeSwitching.value = !typeSwitching.value;
const type = typeSwitching.value ? "1" : "2";
jz.value[2].choose = (jz.value[2].choose % 3) + 1;
jzChange(0, type);
jzChange(1, type);
jzChange(2, jz.value[2].choose);
};
let interval;
const startAutoSwitching = () => {
interval = setInterval(toggleShow, 6000); // 6
};
onMounted(() => {
startAutoScroll();
onTypeSwitching();
startAutoSwitching();
});
onBeforeMount(() => {
getData();
clearInterval(interval); //
});
</script>