From deaa638544da41dbc8b46f158e600e74ebbb26e3 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 23 八月 2023 18:03:03 +0800
Subject: [PATCH] 大屏
---
screen_standard/src/views/process.vue | 67 +++++++++++++++++++--------------
1 files changed, 38 insertions(+), 29 deletions(-)
diff --git a/screen_standard/src/views/process.vue b/screen_standard/src/views/process.vue
index c4e6f42..030023c 100644
--- a/screen_standard/src/views/process.vue
+++ b/screen_standard/src/views/process.vue
@@ -23,7 +23,7 @@
<div class="scroll_item_row">{{ item.qualifiedNum }}</div>
<div class="scroll_item_row">{{ item.unqualifiedNum }}</div>
<div class="scroll_item_row">{{ item.undoneNum }}</div>
- <div class="scroll_item_row">{{ item.unqualifiedRate }}%</div>
+ <div class="scroll_item_row">{{ (item.unqualifiedRate||0).toFixed(2) }}%</div>
</div>
</div>
</div>
@@ -40,10 +40,10 @@
<span>{{ item.userName }}</span>
</div>
<div class="content_left_item1_content_row_line">
- <el-progress :show-text="false" :percentage="item.doneNum / baseNum">
+ <el-progress :show-text="false" :percentage="(item.doneNum||0) / baseNum * 100">
</el-progress>
</div>
- <div class="content_left_item1_content_row_num">{{ item.doneNum }}</div>
+ <div class="content_left_item1_content_row_num">{{ item.doneNum||0 }}</div>
</div>
</div>
</div>
@@ -55,7 +55,7 @@
<span>{{ item.userName }}</span>
</div>
<div class="content_left_item1_content_row_line">
- <el-progress :show-text="false" :percentage="item.doneNum / baseNum">
+ <el-progress :show-text="false" :percentage="item.doneNum / baseNum * 100">
</el-progress>
</div>
<div class="content_left_item1_content_row_num">{{ item.doneNum }}</div>
@@ -86,10 +86,10 @@
<div class="scroll_item_row">{{ item.userName }}</div>
<div class="scroll_item_row">{{ item.materialName }}</div>
<div class="scroll_item_row">{{ item.materialCode }}</div>
- <div class="scroll_item_row">{{ item.createTime }}</div>
+ <div class="scroll_item_row">{{ dateToSub(item.createTime) }}</div>
<div class="scroll_item_row">{{ item.qualifiedNum }}</div>
<div class="scroll_item_row">{{ item.unqualifiedNum }}</div>
- <div class="scroll_item_row">{{ item.unqualifiedRate }}%</div>
+ <div class="scroll_item_row">{{ (item.unqualifiedRate||0).toFixed(2) }}%</div>
</div>
</div>
</div>
@@ -117,9 +117,11 @@
import { getProcedurePlanData, getTop, getProcedurePlansList, getRecordLogPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
import { useCounterStore } from '@/stores/counter.js'
import { useRoute } from 'vue-router'
+import { dateToSub } from '@/utils'
import * as echarts from 'echarts'
const route = useRoute()
const enterprise = useCounterStore()
+let mainTimer = ref(null)
let planTimer = ref(null)
let reportTimer = ref(null)
let planContainer = ref(null)
@@ -131,15 +133,7 @@
top2: [],
baseNum: 0,
allBad: 0,
- dayDistribution: [
- { date: '8/1', num: '20' },
- { date: '8/2', num: '10' },
- { date: '8/3', num: '20' },
- { date: '8/4', num: '40' },
- { date: '8/5', num: '30' },
- { date: '8/6', num: '10' },
- { date: '8/7', num: '20' },
- ],
+ dayDistribution: [],
typeDistribution: [
{ categoryName: '澶栬涓嶈壇', unqualifiedNum: 15 },
{ categoryName: '鏈夋瘺鍒�', unqualifiedNum: 12 },
@@ -149,21 +143,26 @@
]
})
-let { listData, top1, top2, baseNum, allBad } = toRefs(data)
+let { listData, top1, top2, baseNum, allBad, reportListData } = toRefs(data)
// start()
onBeforeUnmount(() => {
clearTimeout(planTimer.value)
clearTimeout(reportTimer.value)
+ clearTimeout(mainTimer.value)
})
onMounted(() => {
initData()
+ mainTimer.value = setInterval(() => {
+ initData()
+ }, 60000)
})
onUnmounted(() => {
clearTimeout(planTimer.value)
clearTimeout(reportTimer.value)
+ clearTimeout(mainTimer.value)
})
function initData() {
@@ -200,7 +199,7 @@
start()
})
// 鎶ュ伐鏃ュ織鍒嗛〉鏌ヨ
- getRecordLogPage(enterprise.companyId, enterprise.departId, { capacity: 9999, page: 1, model: { procedureId: route.query.procedureId } })
+ getRecordLogPage(enterprise.companyId, enterprise.departId, { capacity: 20, page: 1, model: { procedureId: route.query.procedureId } })
.then(res => {
data.reportListData = res.records
reportStart()
@@ -213,7 +212,7 @@
getUnqualifiedCateData(enterprise.companyId, enterprise.departId, route.query.procedureId)
.then(res => {
data.typeDistribution = res
- data.allBad = res.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
+ data.allBad = res.reduce((accumulator, currentValue) => accumulator + currentValue.unqualifiedNum, 0)
setTypeChart()
})
}
@@ -244,12 +243,13 @@
}
function ListScroll() {
let scrollDom = planContainer.value
+ if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
if (scrollDom.offsetHeight == 0) {
scrollDom = planContainer.value
} else {
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
- if (scrollDom.children.length <= 10) {
+ if (scrollDom.children.length < 10) {
clearTimeout(planTimer.value)
return
}
@@ -277,12 +277,13 @@
}
function reportScroll() {
let scrollDom = reportLogContainer.value
+ if (!scrollDom) return
// 鍒よ缁勪欢鏄惁娓叉煋瀹屾垚
if (scrollDom.offsetHeight == 0) {
scrollDom = reportLogContainer.value
} else {
// 濡傛灉鍒楄〃鏁伴噺杩囧皯涓嶈繘琛屾粴鍔�
- if (scrollDom.children.length <= 10) {
+ if (scrollDom.children.length < 10) {
clearTimeout(reportTimer.value)
return
}
@@ -310,12 +311,12 @@
data.dayDistribution.forEach(item => {
dateList.push(item.createTime)
- numList.push(item.unqualifiedNum)
+ numList.push(item.unqualifiedNum || 0)
})
let option;
option = {
title: {
- text: ' 杩戜竷鏃ヤ笉鑹搧鎬绘暟锛�67',
+ text: ` 杩戜竷鏃ヤ笉鑹搧鎬绘暟锛�${data.allBad}`,
textStyle: {
color: '#fff',
fontSize: 12
@@ -430,13 +431,16 @@
show: false
},
label: {
- formatter: '{dot| } {title|{b} {c}}\n\n{per|{d}%}',
+ formatter: '{dot| } {title|{b} {c}}\n{per|{d}%}',
rich: {
title: {
- color: '#fff'
+ color: '#fff',
+ lineHeight: 13,
+ fontSize: 10
},
per: {
- color: '#01D9FE'
+ color: '#01D9FE',
+ fontSize: 10
},
dot: {
backgroundColor: 'inherit',
@@ -472,7 +476,7 @@
<style lang="scss" scoped>
.proccess-content {
display: flex;
-
+ flex: 1;
.header-title {
background-image: url('@/assets/img/gongxu_title@2x.png');
height: 28px;
@@ -490,9 +494,8 @@
.process-left {
flex: 1;
margin-right: 20px;
-
.proccess-plan {
- height: 460px;
+ height: 424px;
background: linear-gradient(180deg, rgba(52, 88, 159, 0) 0%, rgba(0, 86, 255, 0.4) 100%);
margin-bottom: 20px;
}
@@ -534,6 +537,11 @@
font-weight: 400;
color: #D2E0FF;
margin-left: 9px;
+ width: 50px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ -webkit-text-overflow: ellipsis;
+ overflow: hidden;
}
.num {
@@ -593,7 +601,7 @@
flex: 1;
.report-log {
- height: 460px;
+ height: 424px;
background: linear-gradient(180deg, rgba(52, 88, 159, 0) 0%, rgba(0, 86, 255, 0.4) 100%);
margin-bottom: 20px;
}
@@ -722,6 +730,7 @@
display: flex;
align-items: center;
justify-content: center;
+ font-size: 13px;
}
}
}
--
Gitblit v1.9.3