diff --git a/src/assets/css/homeScreen.scss b/src/assets/css/homeScreen.scss
index 80efb6e..6a3bf6a 100644
--- a/src/assets/css/homeScreen.scss
+++ b/src/assets/css/homeScreen.scss
@@ -258,7 +258,7 @@
left: 50%;
bottom: 2px;
transform: translateX(-50%);
- width: calc(100% - 920px);
+ width: calc(100% - 890px);
height: calc((100% - 141px)/3 - 32px);
min-width: 560px;
overflow: hidden;
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index b8b1f3f..1cf3376 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -2,9 +2,7 @@
-
-
@@ -36,16 +34,10 @@
diff --git a/src/views/home/model/deployControl.vue b/src/views/home/model/deployControl.vue
index ac52967..758b8a9 100644
--- a/src/views/home/model/deployControl.vue
+++ b/src/views/home/model/deployControl.vue
@@ -6,7 +6,7 @@
-
+
-
@@ -21,7 +21,7 @@ import { qcckPost } from "@/api/qcckApi.js";
import DeployControlItem from "@/views/home/components/deployControlItem.vue";
import * as MOSTY from "@/components/MyComponents/index";
import CheckBox from "@/components/checkBox/index.vue";
-import { ref ,reactive, onMounted,getCurrentInstance} from 'vue';
+import { ref ,reactive, onMounted,onUnmounted,getCurrentInstance} from 'vue';
const { proxy } = getCurrentInstance();
const {D_BZ_HPZL} =proxy.$dict('D_BZ_HPZL')
const checkData = reactive({
@@ -33,9 +33,50 @@ const yjJb = ref('10,20,30,40');
const pageNum = ref(1);
const loading = ref(false); // 加载中
const personList = ref([]);
+
+const scrollTableRef = ref(null) // 滚动元素区域
+let isAutoScrolling = true // 是否自动滚动
+const intervalId = ref(null) //定时器
+
onMounted(()=>{
getList()
+ autoScroll()
})
+onUnmounted(() => {
+ if (intervalId.value) clearInterval(intervalId.value)// 清理定时器
+})
+// 自动滚动
+const autoScroll = () => {
+ intervalId.value = setInterval(() => {
+ if (!isAutoScrolling) return
+ const scrollTableEl = scrollTableRef.value
+ scrollTableEl.scrollTop += 1 // 垂直滚动距离
+ let scrollTop = scrollTableEl.scrollTop;
+ let scrollHeight = scrollTableEl.scrollHeight;
+ let offsetHeight = Math.ceil(scrollTableEl.getBoundingClientRect().height);
+ let currentHeight = scrollTop + offsetHeight;
+ if (currentHeight >= scrollHeight) { // 到底部
+ if(personList.value.length == total.value){
+ scrollTableEl.scrollTop = 0;
+ }else{
+ pageNum.value++;
+ getList('load')
+ }
+ }
+ }, 100)
+}
+// 停止滚动
+const stopAutoScroll = () => {
+ isAutoScrolling = false
+}
+
+// 开始滚动
+const startAutoScroll = () => {
+ isAutoScrolling = true
+ autoScroll()
+}
+
+
// 复选框切换
function changeData(val){
pageNum.value = 1;
@@ -60,9 +101,9 @@ const loadList = () =>{
getList()
}
-const getList = () =>{
+const getList = (type) =>{
let data = { pageSize:10, pageNum:pageNum.value,yjJb:yjJb.value ,bkyj:1};
- loading.value = true;
+ loading.value = !type ? true : false;
qcckPost(data,'/mosty-gsxt/tbYjxx/getPageList').then(res=>{
loading.value = false;
let arr = res.records || [];
diff --git a/src/views/home/model/zdryWarning.vue b/src/views/home/model/zdryWarning.vue
index 6f22842..eb41d76 100644
--- a/src/views/home/model/zdryWarning.vue
+++ b/src/views/home/model/zdryWarning.vue
@@ -6,7 +6,7 @@
-
+
-
@@ -21,7 +21,7 @@ import { qcckPost } from "@/api/qcckApi.js";
import YjItem from "@/views/home/components/yjItem.vue";
import * as MOSTY from "@/components/MyComponents/index";
import CheckBox from "@/components/checkBox/index.vue";
-import { ref ,reactive, onMounted,getCurrentInstance} from 'vue';
+import { ref ,reactive, onMounted,getCurrentInstance , onUnmounted} from 'vue';
const { proxy } = getCurrentInstance();
const {D_BZ_HPZL} =proxy.$dict('D_BZ_HPZL')
const checkData = reactive({
@@ -33,9 +33,49 @@ const yjJb = ref('1,2');
const pageNum = ref(1);
const loading = ref(false); // 加载中
const personList = ref([]);
+
+const scrollCgTableRef = ref(null) // 滚动元素区域
+let isAutoScrolling = true // 是否自动滚动
+const intervalId = ref(null) //定时器
+
onMounted(()=>{
getList()
+ autoScroll()
})
+onUnmounted(() => {
+ if (intervalId.value) clearInterval(intervalId.value)// 清理定时器
+})
+// 自动滚动
+const autoScroll = () => {
+ intervalId.value = setInterval(() => {
+ if (!isAutoScrolling) return
+ const scrollTableEl = scrollCgTableRef.value
+ scrollTableEl.scrollTop += 1 // 垂直滚动距离
+ let scrollTop = scrollTableEl.scrollTop;
+ let scrollHeight = scrollTableEl.scrollHeight;
+ let offsetHeight = Math.ceil(scrollTableEl.getBoundingClientRect().height);
+ let currentHeight = scrollTop + offsetHeight;
+ if (currentHeight >= scrollHeight) { // 到底部
+ if(personList.value.length == total.value){
+ scrollTableEl.scrollTop = 0;
+ }else{
+ pageNum.value++;
+ getList('load')
+ }
+ }
+ }, 100)
+}
+// 停止滚动
+const stopAutoScroll = () => {
+ isAutoScrolling = false
+}
+
+// 开始滚动
+const startAutoScroll = () => {
+ isAutoScrolling = true
+ autoScroll()
+}
+
// 复选框切换
function changeData(val){
pageNum.value = 1;
@@ -58,9 +98,9 @@ const loadList = () =>{
getList()
}
-const getList = () =>{
+const getList = (type) =>{
let data = { pageSize:10, pageNum:pageNum.value,yjLx:yjJb.value };
- loading.value = true;
+ loading.value = !type ? true : false;
qcckPost(data,'/mosty-gsxt/tbYjxx/getPageList').then(res=>{
loading.value = false;
let arr = res.records || [];