@@ -63,7 +64,7 @@
{{ item.teamName }}
{{ item.attendanceNumber }} 人/{{ item.allNumber
- }}
+ }}
{{ item.attendanceRate }} %
{{ item.attendanceTime }}
@@ -88,6 +89,7 @@ const props = defineProps({
let mapChart = null
const mapChartRef = ref
(null);
+const contentRef = ref(null);
const news = ref([])
const newDetail = ref({
title: '',
@@ -135,19 +137,44 @@ const getNewsData = async () => {
const { data, code } = res
if (code === 200) {
news.value = data
+ autoScrollTable(5)
}
}
-/**
- * 初始化地图
- */
-const initMapChart = () => {
- if (!mapChartRef.value) {
+var lastTime = 0;
+const state = reactive({
+ events: [],
+ outputList: [],
+ detialInfoShow: false,
+ notShowPro: [{ id: 37 }, { id: 44 }, { id: 48 }], //模块内容区域不展示的项目(中煤科工 广东户用光伏项目 兴隆光伏)
+ scrolltimerTable: null,
+ flagPause: true, //滚动继续滚动
+});
+
+const autoScrollTable = (time, flag = true) => {
+ //表格自动滚动
+ const divData = document.getElementById('event_scroll');
+ if (!flag || !state.flagPause) {
+ cancelAnimationFrame(state.scrolltimerTable);
return;
}
- mapChart = echarts.init(mapChartRef.value);
- mapChart.setOption(mapOption);
-}
+ if (time - lastTime < 25) {
+ // 50毫秒更新一次
+ state.scrolltimerTable = requestAnimationFrame(autoScrollTable);
+ return; // 如果时间未到,则返回,不执行动画更新
+ }
+ lastTime = time;
+ // 元素自增距离顶部1像素
+ divData.scrollTop += 1;
+ // 判断元素是否滚动到底部(可视高度+距离顶部=整个高度)
+ if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) {
+ // 重置table距离顶部距离
+ divData.scrollTop = 0;
+ state.scrolltimerTable = requestAnimationFrame(autoScrollTable);
+ } else {
+ state.scrolltimerTable = requestAnimationFrame(autoScrollTable);
+ }
+};
onMounted(() => {
// nextTick(() => {