|
@@ -118,8 +118,7 @@ export default defineComponent({
|
|
|
}
|
|
|
percentage += 1; // 每次增加1%
|
|
|
if (percentage > Math.max(forms.totalInfo.supportRate, forms.totalInfo.participationRate)) {
|
|
|
- clearInterval(state.intervalOne); // 停止定时器
|
|
|
- state.intervalOne = null;
|
|
|
+ clearDataAnimation();
|
|
|
}
|
|
|
}, 25); // 每25ms更新一次
|
|
|
});
|
|
@@ -212,18 +211,22 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const onRefresh = async () => {
|
|
|
- console.log('刷新111')
|
|
|
- clearInterval(state.intervalOne); // 停止定时器
|
|
|
- state.intervalOne = null;
|
|
|
+ // console.log('刷新111')
|
|
|
+ clearDataAnimation();
|
|
|
forms.areaColumns = []
|
|
|
finished.value = false;
|
|
|
// 重新加载数据
|
|
|
// 将 loading 设置为 true,表示处于加载状态
|
|
|
loading.value = true;
|
|
|
- await queryArea();
|
|
|
- refreshing.value = false
|
|
|
+ await queryArea();
|
|
|
+ refreshing.value = false
|
|
|
};
|
|
|
|
|
|
+ const clearDataAnimation = () => {
|
|
|
+ clearInterval(state.intervalOne); // 停止定时器
|
|
|
+ state.intervalOne = null;
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
console.log('刷新页面')
|
|
|
forms.areaIdx = sessionStorage.getItem('areaIdx') || 0;
|
|
@@ -239,13 +242,13 @@ export default defineComponent({
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
- clearInterval(state.intervalOne); // 停止定时器
|
|
|
- state.intervalOne = null;
|
|
|
+ clearDataAnimation();
|
|
|
});
|
|
|
|
|
|
return () => (
|
|
|
<OFullRefresh
|
|
|
v-model:modelValue={refreshing.value}
|
|
|
+ freshDisabled={forms.areaStatus}
|
|
|
onRefresh={onRefresh}
|
|
|
class={styles.refreshC}>
|
|
|
<div class={[styles.statisBody]}>
|
|
@@ -422,9 +425,10 @@ export default defineComponent({
|
|
|
forms.schoolName = '';
|
|
|
forms.currentAreaInfo = forms.areaList[val.selectedOptions[0].value]
|
|
|
sessionStorage.setItem('areaIdx', forms.areaIdx)
|
|
|
+ clearDataAnimation()
|
|
|
queryInfo()
|
|
|
getList()
|
|
|
- console.log('选择1111',val,forms.areaOptionIndex)
|
|
|
+ // console.log('选择1111',val,forms.areaOptionIndex)
|
|
|
}}
|
|
|
/>
|
|
|
)}
|