diff --git a/src/view/echarts_work/eP1.vue b/src/view/echarts_work/eP1.vue index ef6503f..5ed54d1 100644 --- a/src/view/echarts_work/eP1.vue +++ b/src/view/echarts_work/eP1.vue @@ -3,251 +3,297 @@ diff --git a/src/view/echarts_work/eP2.vue b/src/view/echarts_work/eP2.vue index b97f38e..135a291 100644 --- a/src/view/echarts_work/eP2.vue +++ b/src/view/echarts_work/eP2.vue @@ -1,268 +1,299 @@ diff --git a/src/view/work.vue b/src/view/work.vue index 3b6ecdc..f585254 100644 --- a/src/view/work.vue +++ b/src/view/work.vue @@ -21,14 +21,14 @@ > 医疗 -
就业 -
+ --> - +
住房
-
自然灾害 -
+
-->
- +
@@ -70,7 +70,12 @@ 金额(元)
-
+
-
-
+
+
-
-
- -
+
发起单位:
+
{{ item.fqdw }}
-
-
-
- 发起单位: {{ item.fqdw }} -
- 项目名称: {{ item.xmmc }} -
- 公众筹款金额(元): {{ item.gzzcje }} -
- 捐赠支出金额: {{ item.jzzcje }} -
- 捐赠人次: {{ item.jzrc }} -
-
+
项目名称:
+
{{ item.xmmc }}
-
+
公众筹款金额(元):
+
{{ item.gzzcje }}
+
+
+
捐赠支出金额:
+
{{ item.jzzcje }}
+
+
+
捐赠人次:
+
{{ item.jzrc }}
@@ -235,11 +229,12 @@ const getData = async () => { await http.get("/api/ggfwyth/succour").then((res) => { if (res.code == 200) { console.log(res.data); + data.diversification.hszhxms = res.data.diversification.hszhxms; // 专项救助模块 - // 教育&医疗&就业 + // 教育&医疗 data.education.data = res.data.specialAssistance.education.data; data.education.year = res.data.specialAssistance.education.year; - // 住房&自然灾害&临时救助 + // 住房&临时救助 data.housing.data = res.data.specialAssistance.housing.data; data.housing.year = res.data.specialAssistance.housing.year; // 救助概况 @@ -258,9 +253,42 @@ const getData = async () => { } }); }; + +//自动滚动 +const mainRef = ref(null); +let isAutoScrolling = true; + +const stopAutoScroll = () => { + isAutoScrolling = false; +}; + +const startAutoScroll = () => { + isAutoScrolling = true; + autoScroll(); +}; + +const autoScroll = () => { + if (!isAutoScrolling) return; + + const mainEl = mainRef.value; + mainEl.scrollTop += 1; // 每次滚动的距离 + + if (mainEl.scrollTop + 1 >= mainEl.scrollHeight - mainEl.clientHeight) { + setTimeout(() => { + mainEl.scrollTo({ top: 0, behavior: "smooth" }); + setTimeout(autoScroll, 2000); // 2秒后再次滚动到底部 + }, 1000); // 暂停1秒后开始快速滚回顶部 + } else { + requestAnimationFrame(autoScroll); + } +}; + onBeforeMount(() => { getData(); }); +onMounted(() => { + startAutoScroll(); +});