From fe0ef3441cd689e3679696d990b0ca1b5d7193ac Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期四, 24 八月 2023 14:10:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
screen_standard/src/views/index.vue | 236 +++++++++++++++++++++++++++++------------------------------
1 files changed, 116 insertions(+), 120 deletions(-)
diff --git a/screen_standard/src/views/index.vue b/screen_standard/src/views/index.vue
index 989120a..c9970c2 100644
--- a/screen_standard/src/views/index.vue
+++ b/screen_standard/src/views/index.vue
@@ -59,7 +59,7 @@
:content="'宸叉姤宸ヨ壇鍝佹暟' + child.doneNum + '锛涘伐搴忚鍒掓暟' + child.planNum" placement="top">
<div class="scroll_item_row_item" @click="jump(child.procedureId, child.procedureName)">
<div class="scroll_item_row_item_x"></div>
- <span v-if="child.rate < 100">{{ child.rate.toFixed(0) }}%</span>
+ <span v-if="child.rate < 100">{{ Math.floor(child.rate) }}%</span>
<img v-else src="@/assets/img/ic_complete@2x.png" alt="" />
<span class="scroll_item_row_item_wz">{{ child.procedureName.substring(0, 3) }}</span>
</div>
@@ -103,7 +103,7 @@
<div class="content_left_item1_head">
<span>褰撴棩鍛樺伐浜ч噺TOP10</span>
</div>
- <div class="content_left_item1_content" ref="scrollContainer">
+ <div class="content_left_item1_content" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave" ref="scrollContainer">
<div class="content_left_item1_content_row" v-for="(item, index) in data.production" :key="index">
<div class="content_left_item1_content_row_name">
<div :class="index > 2 ? 'num bg1' : 'num bg2'">{{ index + 1 }}</div>
@@ -203,8 +203,8 @@
<script setup>
import { dateToSub } from '@/utils'
-import { reactive, ref, onMounted, nextTick, onUnmounted, computed, watch, toRefs } from 'vue'
-import { getPlanData, getTop, getStockList, getWorkPlansList, getProcedureProcessList, getRecordLogPage, getDeviceCheckPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
+import { reactive, ref, onMounted, onUnmounted, computed, watch, toRefs } from 'vue'
+import { getPlanData, getTop, getWorkPlansList, getProcedureProcessList, getRecordLogPage, getDeviceCheckPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
import { useCounterStore } from '@/stores/counter.js'
import * as echarts from 'echarts'
import { useRouter } from 'vue-router'
@@ -222,16 +222,16 @@
typeDistribution: [],
num: 0,
baseNum: 0,
- bottomAuthHeight: 284
+ firstScroll: false,
+ secondScroll: false,
+ thirdScroll: false,
+ fourthScroll: false,
+ fifthScroll: false,
})
-let { baseNum, bottomAuthHeight } = toRefs(data)
+let { baseNum } = toRefs(data)
let timer = ref(null)
-let timer1 = ref(null)
-let timer2 = ref(null)
-let timer3 = ref(null)
-let timer4 = ref(null)
let timer5 = ref(null)
let scrollContainer = ref(null)
let scrollContainer1 = ref(null)
@@ -276,17 +276,16 @@
}
})
-start1()
const init = () => {
- setBottomHeight();
+ console.log(timer.value);
// 褰撴棩鍛樺伐浜ч噺TOP10
getTop(companyId.value, departId.value)
.then(res => {
if (res.length > 0) {
data.baseNum = res[0].doneNum
data.production = res
- start()
+ data.fifthScroll = true
}
})
// 浠撳簱瀹炴椂浣欓噺缁熻
@@ -303,18 +302,14 @@
getProcedureProcessList(companyId.value, departId.value)
.then(res => {
data.processProgress = res
- nextTick(() => {
- start2()
- })
+ data.thirdScroll = true
})
} else {
// 鎴愬搧璁″垝杩涘害
getWorkPlansList(companyId.value, departId.value)
.then(res => {
data.plannedProgress = res
- nextTick(() => {
- start1()
- })
+ data.secondScroll = true
})
}
}
@@ -328,9 +323,7 @@
page: 1
}).then(res => {
data.log = res.records
- nextTick(() => {
- start3()
- })
+ data.fourthScroll = true
})
// 璁惧宸℃璁板綍
getDeviceCheckPage(companyId.value, departId.value, {
@@ -339,9 +332,7 @@
page: 1
}).then(res => {
data.patrolInspection = res.records
- nextTick(() => {
- start4()
- })
+ data.fifthScroll = true
})
// 杩戜竷澶╀笉鑹暟
getUnqualified7DayData(companyId.value, departId.value, '')
@@ -368,6 +359,7 @@
num: item.unqualifiedNum
}
})
+ console.log(data.num);
setTypeChart()
}
})
@@ -376,10 +368,6 @@
.then(res => {
enterprise.setNum(res)
})
-}
-function setBottomHeight(){
- const pageHeight = window.innerHeight;
- bottomAuthHeight = pageHeight - 700;
}
/**
@@ -390,20 +378,22 @@
let myChart = echarts.init(dayChartDom);
let dateList = []
let numList = []
- let num = 0
data.dayDistribution.forEach(item => {
dateList.push(item.date)
numList.push(item.num)
- num += item.num
})
let option;
option = {
title: {
- text: `杩戜竷鏃ヤ笉鑹搧鎬绘暟锛�${num}`,
+ text: ` 杩戜竷鏃ヤ笉鑹搧鎬绘暟锛�${data.num}`,
textStyle: {
color: '#fff',
fontSize: 12
}
+ },
+ grid: {
+ top: 40,
+ bottom: 30
},
xAxis: {
type: 'category',
@@ -531,9 +521,6 @@
}
}
},
- // labelLayout: {
- // hideOverlap: true
- // },
endLabel: {
show: true,
distance: 5,
@@ -552,17 +539,8 @@
}
option && myChart.setOption(option);
}
-onUnmounted(() => {
- clearTimeout(timer.value)
- clearTimeout(timer1.value)
- clearTimeout(timer2.value)
- clearTimeout(timer3.value)
- clearTimeout(timer4.value)
- clearTimeout(timer5.value)
-})
+
const clickCate = (index) => {
- clearTimeout(timer1.value)
- clearTimeout(timer2.value)
cate.value.forEach((item, i) => {
if (i === index) {
// 鎴愬搧璁″垝杩涘害
@@ -570,17 +548,13 @@
getWorkPlansList(companyId.value, departId.value)
.then(res => {
data.plannedProgress = res
- nextTick(() => {
- start1()
- })
+ data.secondScroll = true
})
} else {
getProcedureProcessList(companyId.value, departId.value)
.then(res => {
data.processProgress = res
- nextTick(() => {
- start2()
- })
+ data.thirdScroll = true
})
}
item.active = true
@@ -590,71 +564,39 @@
})
}
function handleMouseEnter() {
- clearTimeout(timer.value)
+ data.firstScroll = false
}
function handleMouseEnter1() {
- clearTimeout(timer1.value)
+ data.secondScroll = false
}
function handleMouseEnter2() {
- clearTimeout(timer2.value)
+ data.thirdScroll = false
}
function handleMouseEnter3() {
- clearTimeout(timer3.value)
+ data.fourthScroll = false
}
function handleMouseEnter4() {
- clearTimeout(timer4.value)
+ data.fifthScroll = false
}
function handleMouseLeave() {
- start()
+ data.firstScroll = true
}
function handleMouseLeave1() {
- start1()
+ data.secondScroll = true
}
function handleMouseLeave2() {
- start2()
+ data.thirdScroll = true
}
function handleMouseLeave3() {
- start3()
+ data.fourthScroll = true
}
function handleMouseLeave4() {
- start4()
+ data.fifthScroll = true
}
-// 寮�鍚畾鏃跺櫒
-function start() {
- clearTimeout(timer.value)
- // 瀹氭椂鍣ㄨЕ鍙戝懆鏈�
- let speed = ref(100)
- timer.value = setInterval(ListScroll, speed.value)
-}
-// 寮�鍚畾鏃跺櫒
-function start1() {
- clearTimeout(timer1.value)
- // 瀹氭椂鍣ㄨЕ鍙戝懆鏈�
- let speed1 = ref(100)
- timer1.value = setInterval(ListScroll1, speed1.value)
-}
-// 寮�鍚畾鏃跺櫒
-function start2() {
- clearTimeout(timer2.value)
- // 瀹氭椂鍣ㄨЕ鍙戝懆鏈�
- let speed2 = ref(100)
- timer2.value = setInterval(ListScroll2, speed2.value)
-}
-// 寮�鍚畾鏃跺櫒
-function start3() {
- clearTimeout(timer3.value)
- // 瀹氭椂鍣ㄨЕ鍙戝懆鏈�
- let speed3 = ref(100)
- timer3.value = setInterval(ListScroll3, speed3.value)
-}
-// 寮�鍚畾鏃跺櫒
-function start4() {
- clearTimeout(timer4.value)
- // 瀹氭椂鍣ㄨЕ鍙戝懆鏈�
- let speed4 = ref(100)
- timer4.value = setInterval(ListScroll4, speed4.value)
-}
+
function ListScroll() {
+ if (!data.firstScroll) return
+ // console.log('ListScroll');
let scrollDom = scrollContainer.value
if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
@@ -664,7 +606,7 @@
let maxLength = scrollDom.clientHeight/34
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
if (scrollDom.children.length <= maxLength) {
- clearTimeout(timer.value)
+ data.firstScroll = false
return
}
// 缁勪欢杩涜婊氬姩
@@ -683,6 +625,8 @@
}
}
function ListScroll1() {
+ if (!data.secondScroll) return
+ // console.log('ListScroll1');
let scrollDom = scrollContainer1.value
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
if (!scrollDom) return
@@ -691,13 +635,16 @@
} else {
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
if (scrollDom.children.length < 7) {
- clearTimeout(timer1.value)
+ data.secondScroll = false
return
}
// 缁勪欢杩涜婊氬姩
scrollDom.scrollTop += 2
+
// 鍒ゆ柇鏄惁婊氬姩鍒板簳閮�
- if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight - 2)) {
+ if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight-0.5)) {
+ console.log(scrollDom.scrollTop);
+ console.log(scrollDom.scrollHeight, scrollDom.clientHeight);
// 鑾峰彇缁勪欢绗竴涓妭鐐�
let first = scrollDom.children[0]
// 鍒犻櫎鑺傜偣
@@ -708,6 +655,8 @@
}
}
function ListScroll2() {
+ if (!data.thirdScroll) return
+ // console.log('ListScroll2');
let scrollDom = scrollContainer2.value
if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
@@ -716,7 +665,7 @@
} else {
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
if (scrollDom.children.length < 10) {
- clearTimeout(timer2.value)
+ data.thirdScroll = false
return
}
// 缁勪欢杩涜婊氬姩
@@ -735,6 +684,9 @@
}
}
function ListScroll3() {
+
+ if (!data.fourthScroll) return
+ // console.log('ListScroll3');
let scrollDom = scrollContainer3.value
if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
@@ -746,7 +698,7 @@
// alert(scrollDom.children.length +"---------------"+num)
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
if (scrollDom.children.length <= num) {
- clearTimeout(timer3.value)
+ data.fourthScroll = false
return
}
// 缁勪欢杩涜婊氬姩
@@ -763,6 +715,8 @@
}
}
function ListScroll4() {
+ if (!data.fifthScroll) return
+ // console.log('ListScroll4');
let scrollDom = scrollContainer4.value
if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
@@ -774,7 +728,7 @@
// alert(scrollDom.children.length +"---------------"+num)
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
if (scrollDom.children.length <= num) {
- clearTimeout(timer4.value)
+ data.fifthScroll = false
return
}
// 缁勪欢杩涜婊氬姩
@@ -790,17 +744,30 @@
}
}
}
-
-// onUnmounted(() => {
-
-// })
+function scrillAction() {
+ ListScroll()
+ ListScroll1()
+ ListScroll2()
+ ListScroll3()
+ ListScroll4()
+}
onMounted(() => {
- if (!departId.value) return;
window.addEventListener('resize', () => {
- init()
+ setTypeChart()
+ setDayChart()
})
- timer5.value = setInterval(init(), 60000)
+ if (!departId.value) return;
+ init()
+ timer5.value = setInterval(init, 60000)
+ timer.value = setInterval(scrillAction, 100)
+})
+
+onUnmounted(() => {
+ console.log('鍋滄婊寸瓟');
+ clearTimeout(timer.value)
+ clearTimeout(timer5.value)
+
})
</script>
@@ -808,6 +775,7 @@
$fixed-height: 690px;
.content1 {
+
flex: 1;
width: 100%;
height: auto;
@@ -1098,7 +1066,12 @@
&:nth-child(5) {
flex: 3;
-
+ }
+ &:nth-child(4) {
+ flex: 0.7;
+ }
+ &:nth-child(6) {
+ flex: 0.7;
}
}
}
@@ -1135,10 +1108,15 @@
justify-content: center;
color: #FFFFFF;
font-size: 13px;
-
+ &:nth-child(4) {
+ flex: 0.7;
+ }
&:nth-child(5) {
flex: 3;
justify-content: start;
+ }
+ &:nth-child(6) {
+ flex: 0.7;
}
.scroll_item_row_item {
margin-top: -11px;
@@ -1343,9 +1321,15 @@
font-weight: 500;
color: #01D9FE;
- &:nth-child(4) {
- flex: 2;
+ &:nth-child(5) {
+ flex: 0.5;
}
+ &:nth-child(6) {
+ flex: 0.5;
+ }
+ &:nth-child(7) {
+ flex: 0.7;
+ }
}
}
@@ -1384,9 +1368,16 @@
justify-content: center;
color: #FFFFFF;
- &:nth-child(4) {
- flex: 2;
+ &:nth-child(5) {
+ flex: 0.5;
}
+ &:nth-child(6) {
+ flex: 0.5;
+ }
+ &:nth-child(7) {
+ flex: 0.7;
+ }
+
}
}
}
@@ -1526,8 +1517,11 @@
font-weight: 500;
color: #01D9FE;
- &:first-child {
- flex: 2;
+ // &:first-child {
+ // flex: 2;
+ // }
+ &:nth-child(3) {
+ flex: 0.7;
}
}
}
@@ -1566,10 +1560,12 @@
align-items: center;
justify-content: center;
color: #FFFFFF;
-
- &:first-child {
- flex: 2;
+ &:nth-child(3) {
+ flex: 0.7;
}
+ // &:first-child {
+ // flex: 2;
+ // }
}
}
}
--
Gitblit v1.9.3