From d486f0fde9c7205fa39bceacb6773e4b2650fc27 Mon Sep 17 00:00:00 2001 From: Rain_ <904416525@qq.com> Date: Thu, 17 Apr 2025 16:56:31 +0800 Subject: [PATCH] =?UTF-8?q?flx=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=A8=A1=E5=9D=97=20=E5=BA=95=E9=83=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=A8=A1=E5=9D=97=E6=98=BE=E7=A4=BA=20=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E8=BD=AE=E6=92=AD=E5=87=BA=E7=8E=B0bug=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedulePlan/ganttChart.vue | 73 +++++++++++++++---- .../qualityControl/schedulePlan/index.vue | 14 +++- .../qualityControl/schedulePlan/rightTop.vue | 37 ++++++---- 3 files changed, 91 insertions(+), 33 deletions(-) diff --git a/src/views/sevenLargeScreen/qualityControl/schedulePlan/ganttChart.vue b/src/views/sevenLargeScreen/qualityControl/schedulePlan/ganttChart.vue index 54f3620..d283ca5 100644 --- a/src/views/sevenLargeScreen/qualityControl/schedulePlan/ganttChart.vue +++ b/src/views/sevenLargeScreen/qualityControl/schedulePlan/ganttChart.vue @@ -169,6 +169,7 @@ const userInfo = reactive({ pageSize: 10, isLoading: false, scheduleSwitchFlag: false, + minLength: 6 }); dayjs.extend(quarterOfYear); dayjs.extend(isBetween); @@ -186,7 +187,7 @@ const load = () => { } console.log("我触发了"); userInfo.isLoading = true; - userInfo.pageSize += 5; + userInfo.pageSize += props.showDwon ? 3 : 5; }; const projectChildList = computed(() => { @@ -222,7 +223,7 @@ const planChildren = (row: any) => { const splitData = computed(() => { const newResult = projectChildList.value.slice(userInfo.pageNo - 1, userInfo.pageSize * userInfo.pageNo); console.log(888, newResult); - if(newResult.length < 6) { + if(newResult.length < userInfo.minLength) { userInfo.scheduleSwitchFlag = true; } return newResult @@ -298,16 +299,40 @@ const monthListUp = computed(() => { }; }); +const gasanalysisInfo = reactive({ + setIntervalScrollLeft: 0, + setIntervalTime: null as any, + setIntervalScrollTop: 0, + setIntervalTime2: null as any, +}) + watch( () => { props.showDwon; }, (val: any) => { - if (!val) { - load(); + console.log("触发了", val, props.showDwon); + gasanalysisInfo.setIntervalScrollTop = 0; + nextTick(() => { + const tbodyTable = document.querySelector("#tbody_table") as any; + tbodyTable.scrollTop = gasanalysisInfo.setIntervalScrollTop; + }) + if (!props.showDwon) { + userInfo.pageSize = 10; + userInfo.pageNo = 1; + userInfo.minLength = 6; + // load(); + } else { + userInfo.pageSize = 6; + userInfo.pageNo = 1; + userInfo.minLength = 6; } + // if (!props.showDwon) { + // load(); + // } }, { + immediate: true, deep: true } ); @@ -316,20 +341,18 @@ onUpdated(() => { console.log("更新"); cancelAnimationFrame(gasanalysisInfo.setIntervalTime2); cancelAnimationFrame(gasanalysisInfo.setIntervalTime); - gasanalysisInfo.setIntervalScrollLeft = 0; - setIntervalTimeFn(); + if(store.schedulePlanFlag) { + gasanalysisInfo.setIntervalScrollLeft = 0; + setIntervalTimeFn(); + } + nextTick(() => { setTimeout(() => { userInfo.isLoading = false; }, 1000); }); }); -const gasanalysisInfo = reactive({ - setIntervalScrollLeft: 0, - setIntervalTime: null as any, - setIntervalScrollTop: 0, - setIntervalTime2: null as any, -}) + // 移入 const handleMouseEnter = () => { if(!store.schedulePlanFlag) return; @@ -351,13 +374,14 @@ const setIntervalTimeFn = () => { cancelAnimationFrame(gasanalysisInfo.setIntervalTime); const gasanalysisTable1 = document.querySelector(".gasanalysis-table1") as any; gasanalysisInfo.setIntervalScrollLeft = gasanalysisInfo.setIntervalScrollLeft + 0.1; - console.log(gasanalysisTable1.scrollLeft + gasanalysisTable1.clientWidth, gasanalysisTable1.scrollWidth, gasanalysisInfo.setIntervalScrollLeft); + // console.log(gasanalysisTable1.scrollLeft + gasanalysisTable1.clientWidth, gasanalysisTable1.scrollWidth, gasanalysisInfo.setIntervalScrollLeft); if(Math.ceil(gasanalysisTable1.scrollLeft + gasanalysisTable1.clientWidth) >= gasanalysisTable1.scrollWidth) { cancelAnimationFrame(gasanalysisInfo.setIntervalTime); gasanalysisTable1.scrollLeft = 0; gasanalysisInfo.setIntervalScrollLeft = 0; if(userInfo.scheduleSwitchFlag) { userInfo.pageSize = 10; + gasanalysisTable1.scrollTop = 0; emits("scheduleSwitchChange", true); return } @@ -389,13 +413,34 @@ const setIntervalTimeFn2 = () => { onMounted(() => { console.log("挂载了"); + console.log(props.showDwon); nextTick(() => { // const gasanalysisTable1 = document.querySelector(".gasanalysis-table1") as any; // console.log(gasanalysisTable1.scrollWidth); - if(store.schedulePlanFlag) { setIntervalTimeFn(); }; + + // io 为 IntersectionObserver对象 - 由IntersectionObserver()构造器创建 + // var io = new IntersectionObserver((entries) => { + // //entries 为 IntersectionObserverEntry对像数组 + // entries.forEach((item: any) => { + // //item 为 IntersectionObserverEntry对像 + // // isIntersecting是一个Boolean值,判断目标元素当前是否可见 + // if (item.isIntersecting) { + // //div 可见时 进行相关操作 + // console.log(1122333, item, item.target.__vnode, item.target.__vnode.el); + // // console.log(document.getElementsByClassName(item.target.className) as any); + // console.log(item.target.__vnode.el.previousElementSibling); + // // console.log(item.currentTarget.previousElementSibling); + // // console.log(item.currentTarget.previousElementSibling.getBoundingClientRect()); + // console.log(item.target.__vnode.el.nextElementSibling); + // io.unobserve(item.target); //停止监听该div DOM节点 + // } + // }); + // }); //不传options参数,默认根元素为浏览器视口 + // const divArr = [...document.querySelectorAll(".shape") as any]; + // divArr.forEach((div) => io.observe(div)); // 遍历监听所有div DOM节点 }) }) diff --git a/src/views/sevenLargeScreen/qualityControl/schedulePlan/index.vue b/src/views/sevenLargeScreen/qualityControl/schedulePlan/index.vue index d3d62e2..6c4ecea 100644 --- a/src/views/sevenLargeScreen/qualityControl/schedulePlan/index.vue +++ b/src/views/sevenLargeScreen/qualityControl/schedulePlan/index.vue @@ -1,7 +1,7 @@