| | |
| | | .then(res => { |
| | | if (res.length > 0) { |
| | | data.baseNum = res[0].doneNum |
| | | data.production = res |
| | | start() |
| | | } else { |
| | | data.baseNum = 0 |
| | | } |
| | | data.production = res |
| | | data.fifthScroll = true |
| | | }) |
| | | // 仓库实时余量统计 |
| | | // getStockList(companyId.value, departId.value) |
| | |
| | | fontSize: 12 |
| | | } |
| | | }, |
| | | grid: { |
| | | top: 40, |
| | | bottom: 30, |
| | | left: 60, |
| | | right: 10 |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | |
| | | lineStyle: { |
| | | width: 0.5, |
| | | color: ['#fff'] |
| | | } |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | onZero: true, |
| | | lineStyle: { |
| | | width: 0.5, |
| | | color: '#fff', |
| | | opacity: .5 |
| | | } |
| | | }, |
| | | axisLabel: { |
| | |
| | | lineStyle: { |
| | | width: 0.5, |
| | | color: ['#fff'] |
| | | } |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | onZero: true, |
| | | lineStyle: { |
| | | width: 1, |
| | | color: '#fff', |
| | | opacity: .5 |
| | | } |
| | | }, |
| | | axisLabel: { |
| | |
| | | scrollDom = scrollContainer1.value |
| | | } else { |
| | | // 如果列表数量过少不进行滚动 |
| | | if (scrollDom.children.length < 6) { |
| | | if (scrollDom.children.length <= 6) { |
| | | clearTimeout(timer1.value) |
| | | return |
| | | } |
| | | // console.log(data.plannedProgress); |
| | | // 组件进行滚动 |
| | | scrollDom.scrollTop += 2 |
| | | // scrollDom.scrollTo(0, scrollDom.scrollTop + 3) |
| | | // console.log('2-----',scrollDom.scrollTop, scrollDom.scrollHeight, scrollDom.clientHeight ); |
| | | // 判断是否滚动到底部 |
| | | if (scrollDom.scrollTop+2 >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | // 获取组件第一个节点 |
| | | let first = scrollDom.children[0] |
| | | // 删除节点 |
| | |
| | | scrollDom = scrollContainer2.value |
| | | } else { |
| | | // 如果列表数量过少不进行滚动 |
| | | if (scrollDom.children.length < 10) { |
| | | if (scrollDom.children.length <= 10) { |
| | | clearTimeout(timer2.value) |
| | | return |
| | | } |
| | | // 组件进行滚动 |
| | | scrollDom.scrollTop += 1 |
| | | scrollDom.scrollTo(0, scrollDom.scrollTop + 1) // += 1 |
| | | // scrollDom.scrollTop(scrollDom.scrollTop + 1) |
| | | // console.log('scrollDom.scrollTop', scrollDom.scrollTop); |
| | | // console.log('scrollDom.scrollHeight - scrollDom.clientHeight', scrollDom.scrollHeight - scrollDom.clientHeight); |
| | | // 判断是否滚动到底部 |
| | | if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | if (scrollDom.scrollTop &&scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | // 获取组件第一个节点 |
| | | let first = scrollDom.children[0] |
| | | // 删除节点 |
| | |
| | | // 组件进行滚动 |
| | | scrollDom.scrollTop = scrollDom.scrollTop+2 |
| | | // 判断是否滚动到底部 |
| | | if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | // 获取组件第一个节点 |
| | | let first = scrollDom.children[0] |
| | | // 删除节点 |
| | |
| | | let scrollDom = scrollContainer4.value |
| | | if (!scrollDom) return |
| | | // 判读组件是否渲染完成 |
| | | if (scrollDom.offsetHeight == 0) { |
| | | if (scrollDom.scrollTop && scrollDom.offsetHeight == 0) { |
| | | scrollDom = scrollContainer4.value |
| | | } else { |
| | | // console.log(bottom1.value.height); |
| | | let num = scrollContainer4.value.offsetHeight / 35; |
| | | // alert(scrollDom.children.length +"---------------"+num) |
| | | // 如果列表数量过少不进行滚动 |
| | | // console.log(scrollDom.offsetHeight); |
| | | let num = scrollDom.offsetHeight / 35; |
| | | num = num + (scrollDom.offsetHeight % 35 > 0 ? 1 : 0) |
| | | if (scrollDom.children.length <= num) { |
| | | clearTimeout(timer4.value) |
| | | return |
| | | } |
| | | // 组件进行滚动 |
| | | scrollDom.scrollTop += 2 |
| | | scrollDom.scrollTop += 1 |
| | | |
| | | // 判断是否滚动到底部 |
| | | if (scrollDom.scrollTop+1 >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) { |
| | | // if (scrollDom.scrollTop >= 35) { |
| | | |
| | | // 获取组件第一个节点 |
| | | let first = scrollDom.children[0] |
| | | // 删除节点 |
| | |
| | | // }) |
| | | |
| | | onMounted(() => { |
| | | if (!departId.value) return; |
| | | timer5.value = setInterval(init(), 60000) |
| | | if (departId.value) { |
| | | console.log('onMounted'); |
| | | init() |
| | | timer5.value = setInterval(init, 60000) |
| | | // timer.value = setInterval(scrillAction, 100) |
| | | } |
| | | window.addEventListener('resize', () => { |
| | | setTypeChart() |
| | | setDayChart() |
| | | }) |
| | | |
| | | }) |
| | | |
| | | onUnmounted(() => { |
| | | clearTimeout(timer.value) |
| | | clearTimeout(timer5.value) |
| | | |
| | | }) |
| | | </script> |
| | | |