Compare commits

..

8 Commits

Author SHA1 Message Date
zwq
fe2408c667 更新大屏 2026-07-01 09:38:25 +08:00
a2375325a0 Merge pull request 'projects/qhd-line-zhp' (#467) from projects/qhd-line-zhp into projects/qhd-line-test
Reviewed-on: #467
2025-12-23 08:52:44 +08:00
‘937886381’
04d5896f6e Merge branch 'projects/qhd-line-test' into projects/qhd-line-zhp 2025-12-23 08:51:19 +08:00
‘937886381’
46a23c249c 修改 2025-12-23 08:49:37 +08:00
242a52b98e Merge pull request 'projects/qhd-line-zhp' (#465) from projects/qhd-line-zhp into projects/qhd-line-test
Reviewed-on: #465
2025-12-17 16:30:08 +08:00
‘937886381’
945237557f 修改 2025-12-17 16:27:13 +08:00
‘937886381’
8eb0a9fee1 Merge branch 'projects/qhd-line-test' into projects/qhd-line-zhp 2025-12-15 10:48:29 +08:00
‘937886381’
a9645d03a9 修改bug 2025-12-15 10:46:44 +08:00
26 changed files with 2654 additions and 1668 deletions

View File

@@ -12,8 +12,8 @@ ENV = 'development'
VUE_APP_TITLE = 智能监控分析系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://172.16.32.79:48082'
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
# VUE_APP_BASE_API = 'http://172.16.32.79:48082'
VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
# 路由懒加载

BIN
dist.zip

Binary file not shown.

View File

@@ -111,3 +111,17 @@ export function getProcessAutoReportNew(data) {
data: data,
});
}
export function getProcessAutoReportLastGroup(data) {
return request({
url: '/monitoring/production-monitor/getProcessAutoReportLastGroup',
method: 'post',
data: data,
});
}
export function getPLlistByFactory(data) {
return request({
url: 'base/production-line/listByFactory',
method: 'post',
data: data,
});
}

View File

@@ -3,7 +3,7 @@
* @Date: 2023-09-12 09:44:53
* @LastEditTime: 2023-09-15 14:12:26
* @LastEditors: DY
* @Description:
* @Description:
*/
import request from '@/utils/request'
@@ -15,3 +15,11 @@ export function getPdlDataOneDay(data) {
data: data
})
}
// 获得近24小时产线生产数据-新版
export function getSectionDataOneDay(data) {
return request({
url: '/monitoring/production-monitor/getSectionDataOneDay',
method: 'post',
data: data
})
}

View File

@@ -2,7 +2,7 @@
<div class='centerBottomL'>
<div class='title'>
<svg-icon icon-class="dataBoard3" class='icon'/>
<span>月数据</span>
<span>月数据</span>
</div>
<div class='dataBox' style='top:50px'>
<p>
@@ -13,7 +13,7 @@
</p>
<p class='num'>{{monthData?.inputNum ? formatThousands(monthData.inputNum) : '-'}}</p>
</div>
<div class='dataBox'style='top:180px'>
<div class='dataBox' style='top:180px'>
<p>
<span class='text'>总生产片数</span>
<span class='precent' :class='{precentR:monthData?.outputNumChange>=0,precentG:monthData?.outputNumChange<0}'>{{monthData?.outputNumChange || '-'}}%</span>
@@ -37,7 +37,7 @@ export default {
watch: {
dataObj(val) {
val.monthAndLastMonth && val.monthAndLastMonth.forEach(item => {
if (item.dataType === "月") {
if (item.dataType === "月") {
this.monthData = item
}
})
@@ -113,4 +113,4 @@ export default {
}
}
}
</style>
</style>

View File

@@ -1,352 +1,563 @@
<template>
<div ref="centerTopBox" class='centerTopBox'>
<div>
<video src="/static/videos/01.webm" muted autoplay loop class='videoStyle'></video>
<div
class='eqTipBox'
v-show='showTooltip'
:style="'left:'+tooltipStyle.left+'px;top:'+tooltipStyle.top+'px;'"
>
<p><span class='eqTipTitle'>设备名称:</span><span class='eqTipNum'>{{eqTipMsg.name}}</span></p>
<p><span class='eqTipTitle'>进口数量:</span><span class='eqTipNum'>{{eqTipMsg.input}}</span></p>
<p><span class='eqTipTitle'>出口数量:</span><span class='eqTipNum'>{{eqTipMsg.output}}</span></p>
<p><span class='eqTipTitle'>报警状态:</span>
<span class='eqTipNum'>
<img v-show='eqTipMsg.alarm' :src='dotY' width='16'/>
<img v-show='!eqTipMsg.alarm' :src='dotG' width='16'/>
{{eqTipMsg.alarm?'报警':'未报警'}}
</span>
</p>
<p><span class='eqTipTitle'>在线状态:</span>
<span class='eqTipNum'>
<img v-show='eqTipMsg.status' :src='dotG' width='16'/>
<img v-show='!eqTipMsg.status' :src='dotR' width='16'/>
{{eqTipMsg.status?'在线':'离线'}}
</span>
</p>
</div>
<!-- 设备 -->
<div class='eqBox'>
<!-- line-从上到下-从右往左 -->
<span
v-for='(item,index) in eqList'
:key='index'
:style="'width:'+item.w+'px;height:'+item.h+'px;left:'+item.l+'px;top:'+item.t+'px'"
@mouseenter="handleMouseEnter(item, $event)"
@mouseleave="handleMouseLeave"
></span>
</div>
</div>
<div class='centerTopTopBox'>
<div style='display: inline-block;'>
<img src="../../../../assets/images/dataBoard/centerNumB.png" alt="" width='203'>
<p class='num'>{{dataObj?.productRate || '-'}}%</p>
<p class='title'>成品率</p>
</div>
<div style='display: inline-block;'>
<img src="../../../../assets/images/dataBoard/centerNumY.png" alt="" width='261'>
<p class='num' style='width: 260px;padding-left: 20px;'>{{dataObj?.todayProduct ? formatThousands(dataObj.todayProduct) : '-'}}</p>
<p class='title' style='color:#FFB625'>今日产量</p>
</div>
<div style='display: inline-block;'>
<img src="../../../../assets/images/dataBoard/centerNumY.png" alt="" width='261'>
<p class='num' style='width: 260px;padding-left: 20px;'>{{dataObj?.monthProduct ? formatThousands(dataObj.monthProduct) : '-'}}</p>
<p class='title' style='color:#FFB625'>本月产量</p>
</div>
<div style='display: inline-block;'>
<img src="../../../../assets/images/dataBoard/centerNumB.png" alt="" width='203'>
<p class='num'>{{dataObj?.alarmNum ? formatThousands(dataObj.alarmNum) : '-'}}</p>
<p class='title'>设备报警数</p>
</div>
</div>
</div>
<div ref="centerTopBox" class="centerTopBox">
<div>
<video
src="/static/videos/01.webm"
muted
autoplay
loop
class="videoStyle"></video>
<div class="zhegaiceng" v-if="dataObj">
<div
v-show="
!dataObj.productionDet.find((val) => val.line == 1).isProduction
"
class="production-line1"
data-line="1"
data-status="stopped">
<!-- 半透明渐变遮罩 -->
<div class="line-mask"></div>
<!-- 状态标签 -->
<div class="line-status-tag">
<span class="status-dot stopped"></span>
产线1 已停产
</div>
</div>
<div
v-show="
!dataObj.productionDet.find((val) => val.line == 2).isProduction
"
class="production-line2"
data-line="2"
data-status="stopped">
<!-- 半透明渐变遮罩 -->
<div class="line-mask"></div>
<!-- 状态标签 -->
<div class="line-status-tag">
<span class="status-dot stopped"></span>
产线2 已停产
</div>
</div>
<div
v-show="
!dataObj.productionDet.find((val) => val.line == 3).isProduction
"
class="production-line3"
data-line="3"
data-status="stopped">
<!-- 半透明渐变遮罩 -->
<div class="line-mask"></div>
<!-- 状态标签 -->
<div class="line-status-tag">
<span class="status-dot stopped"></span>
产线3 已停产
</div>
</div>
<div
v-show="
!dataObj.productionDet.find((val) => val.line == 4).isProduction
"
class="production-line4"
data-line="4"
data-status="stopped">
<!-- 半透明渐变遮罩 -->
<div class="line-mask"></div>
<!-- 状态标签 -->
<div class="line-status-tag">
<span class="status-dot stopped"></span>
产线4 已停产
</div>
</div>
<div
v-show="
!dataObj.productionDet.find((val) => val.line == 5).isProduction
"
class="production-line5"
data-line="5"
data-status="stopped">
<!-- 半透明渐变遮罩 -->
<div class="line-mask"></div>
<!-- 状态标签 -->
<div class="line-status-tag">
<span class="status-dot stopped"></span>
产线5 已停产
</div>
</div>
</div>
<div
class="eqTipBox"
v-show="showTooltip"
:style="
'left:' + tooltipStyle.left + 'px;top:' + tooltipStyle.top + 'px;'
">
<p>
<span class="eqTipTitle">设备名称:</span>
<span class="eqTipNum">{{ eqTipMsg.name }}</span>
</p>
<p>
<span class="eqTipTitle">进口数量:</span>
<span class="eqTipNum">{{ eqTipMsg.input }}</span>
</p>
<p>
<span class="eqTipTitle">出口数量:</span>
<span class="eqTipNum">{{ eqTipMsg.output }}</span>
</p>
<p>
<span class="eqTipTitle">报警状态:</span>
<span class="eqTipNum">
<img v-show="eqTipMsg.alarm" :src="dotY" width="16" />
<img v-show="!eqTipMsg.alarm" :src="dotG" width="16" />
{{ eqTipMsg.alarm ? '报警' : '未报警' }}
</span>
</p>
<p>
<span class="eqTipTitle">在线状态:</span>
<span class="eqTipNum">
<img v-show="eqTipMsg.status" :src="dotG" width="16" />
<img v-show="!eqTipMsg.status" :src="dotR" width="16" />
{{ eqTipMsg.status ? '在线' : '离线' }}
</span>
</p>
</div>
<!-- 设备 -->
<div class="eqBox">
<!-- line-从上到下-从右往左 -->
<span
v-for="(item, index) in eqList"
:key="index"
:style="
'width:' +
item.w +
'px;height:' +
item.h +
'px;left:' +
item.l +
'px;top:' +
item.t +
'px'
"
@mouseenter="handleMouseEnter(item, $event)"
@mouseleave="handleMouseLeave"></span>
</div>
</div>
<div class="centerTopTopBox">
<div style="display: inline-block">
<img
src="../../../../assets/images/dataBoard/centerNumB.png"
alt=""
width="203" />
<p class="num" style="font-size: 25px">
<span style="color: #2e7dff">
{{ dataObj?.productRateYesterday ?? '-' }}%
</span>
<span style="color: #999">/</span>
<span style="color: #ff8a00">
{{ dataObj?.productRate30day ?? '-' }}%
</span>
</p>
<p class="title">昨日/近30天成品率</p>
</div>
<div style="display: inline-block">
<img
src="../../../../assets/images/dataBoard/centerNumY.png"
alt=""
width="261" />
<p class="num" style="width: 260px; padding-left: 20px">
{{
dataObj?.todayProduct ? formatThousands(dataObj.todayProduct) : '-'
}}
</p>
<p class="title" style="color: #ffb625">当日产量</p>
</div>
<div style="display: inline-block">
<img
src="../../../../assets/images/dataBoard/centerNumY.png"
alt=""
width="261" />
<p class="num" style="width: 260px; padding-left: 20px">
{{
dataObj?.monthProduct ? formatThousands(dataObj.monthProduct) : '-'
}}
</p>
<p class="title" style="color: #ffb625">当月产量</p>
</div>
<div style="display: inline-block">
<img
src="../../../../assets/images/dataBoard/centerNumB.png"
alt=""
width="203" />
<p class="num">
{{ dataObj?.alarmNum ? formatThousands(dataObj.alarmNum) : '-' }}
</p>
<p class="title">设备报警数</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'CenterTop',
data() {
return {
showTooltip:false,
tooltipStyle: {
left: 0,
top: 0
},
dotY:require('../../../../assets/images/dataBoard/dotY.png'),
dotR:require('../../../../assets/images/dataBoard/dotR.png'),
dotG:require('../../../../assets/images/dataBoard/dotG.png'),
eqList:[
{name:'A1-磨边机-1',id:100301,w:70,h:18,l:830,t:160},
{name:'A1-磨边机-2',id:100302,w:70,h:18,l:830,t:183},
{name:'A1-磨边机-3',id:100303,w:70,h:18,l:832,t:206},
{name:'A1-磨边后清洗机-1',id:100401,w:30,h:15,l:798,t:160},
{name:'A1-磨边后清洗机-2',id:100402,w:30,h:15,l:798,t:183},
{name:'A1-磨边后清洗机-3',id:100403,w:30,h:15,l:800,t:206},
{name:'A1-打孔机-1',id:100501,w:13,h:12,l:730,t:163},
{name:'A1-打孔机-2',id:100502,w:13,h:12,l:730,t:187},
{name:'A1-打孔机-3',id:100503,w:13,h:12,l:730,t:210},
{name:'A1-打孔后清洗机-1',id:100601,w:32,h:15,l:665,t:160},
{name:'A1-打孔后清洗机-2',id:100602,w:32,h:15,l:665,t:183},
{name:'A1-打孔后清洗机-3',id:100603,w:32,h:15,l:665,t:206},
{name:'A1-丝印机-1',id:100701,w:30,h:12,l:605,t:163},
{name:'A1-丝印机-2',id:100702,w:30,h:12,l:605,t:187},
{name:'A1-丝印机-3',id:100703,w:30,h:12,l:605,t:210},
{name:'A1-丝印后固化机-1',id:101301,w:37,h:12,l:558,t:163},
{name:'A1-丝印后固化机-2',id:101302,w:37,h:12,l:558,t:187},
{name:'A1-丝印后固化机-3',id:101303,w:37,h:12,l:558,t:210},
{name:'A1-钢化炉',id:101401,w:75,h:15,l:382,t:209},
{name:'A1-包装清洗机-1',id:101501,w:30,h:15,l:228,t:173},
{name:'A1-包装清洗机-2',id:101502,w:30,h:15,l:228,t:206},
{name:'A1-铺纸机-1',id:101601,w:18,h:15,l:188,t:175},
{name:'A1-铺纸机-2',id:101602,w:18,h:15,l:188,t:206},
name: 'CenterTop',
data() {
return {
showTooltip: false,
tooltipStyle: {
left: 0,
top: 0,
},
dotY: require('../../../../assets/images/dataBoard/dotY.png'),
dotR: require('../../../../assets/images/dataBoard/dotR.png'),
dotG: require('../../../../assets/images/dataBoard/dotG.png'),
eqList: [
{ name: 'A1-磨边机-1', id: 100301, w: 70, h: 18, l: 830, t: 160 },
{ name: 'A1-磨边机-2', id: 100302, w: 70, h: 18, l: 830, t: 183 },
{ name: 'A1-磨边机-3', id: 100303, w: 70, h: 18, l: 832, t: 206 },
{ name: 'A1-磨边后清洗机-1', id: 100401, w: 30, h: 15, l: 798, t: 160 },
{ name: 'A1-磨边后清洗机-2', id: 100402, w: 30, h: 15, l: 798, t: 183 },
{ name: 'A1-磨边后清洗机-3', id: 100403, w: 30, h: 15, l: 800, t: 206 },
{ name: 'A1-打孔机-1', id: 100501, w: 13, h: 12, l: 730, t: 163 },
{ name: 'A1-打孔机-2', id: 100502, w: 13, h: 12, l: 730, t: 187 },
{ name: 'A1-打孔机-3', id: 100503, w: 13, h: 12, l: 730, t: 210 },
{ name: 'A1-打孔后清洗机-1', id: 100601, w: 32, h: 15, l: 665, t: 160 },
{ name: 'A1-打孔后清洗机-2', id: 100602, w: 32, h: 15, l: 665, t: 183 },
{ name: 'A1-打孔后清洗机-3', id: 100603, w: 32, h: 15, l: 665, t: 206 },
{ name: 'A1-丝印机-1', id: 100701, w: 30, h: 12, l: 605, t: 163 },
{ name: 'A1-丝印机-2', id: 100702, w: 30, h: 12, l: 605, t: 187 },
{ name: 'A1-丝印机-3', id: 100703, w: 30, h: 12, l: 605, t: 210 },
{ name: 'A1-丝印后固化机-1', id: 101301, w: 37, h: 12, l: 558, t: 163 },
{ name: 'A1-丝印后固化机-2', id: 101302, w: 37, h: 12, l: 558, t: 187 },
{ name: 'A1-丝印后固化机-3', id: 101303, w: 37, h: 12, l: 558, t: 210 },
{ name: 'A1-钢化炉', id: 101401, w: 75, h: 15, l: 382, t: 209 },
{ name: 'A1-包装清洗机-1', id: 101501, w: 30, h: 15, l: 228, t: 173 },
{ name: 'A1-包装清洗机-2', id: 101502, w: 30, h: 15, l: 228, t: 206 },
{ name: 'A1-铺纸机-1', id: 101601, w: 18, h: 15, l: 188, t: 175 },
{ name: 'A1-铺纸机-2', id: 101602, w: 18, h: 15, l: 188, t: 206 },
{name:'A2-磨边机-1',id:200301,w:70,h:18,l:832,t:233},
{name:'A2-磨边机-2',id:200302,w:70,h:18,l:833,t:257},
{name:'A2-磨边机-3',id:200303,w:70,h:18,l:834,t:281},
{name:'A2-磨边后清洗机-1',id:200401,w:30,h:15,l:800,t:233},
{name:'A2-磨边后清洗机-2',id:200402,w:30,h:15,l:801,t:257},
{name:'A2-磨边后清洗机-3',id:200403,w:30,h:15,l:802,t:281},
{name:'A2-打孔机-1',id:200501,w:13,h:12,l:731,t:240},
{name:'A2-打孔机-2',id:200502,w:13,h:12,l:731,t:262},
{name:'A2-打孔机-3',id:200503,w:13,h:12,l:731,t:285},
{name:'A2-打孔后清洗机-1',id:200601,w:32,h:15,l:666,t:234},
{name:'A2-打孔后清洗机-2',id:200602,w:32,h:15,l:666,t:258},
{name:'A2-打孔后清洗机-3',id:200603,w:32,h:15,l:666,t:282},
{name:'A2-丝印机-1',id:200701,w:30,h:12,l:605,t:238},
{name:'A2-丝印机-2',id:200702,w:30,h:12,l:605,t:262},
{name:'A2-丝印机-3',id:200703,w:30,h:12,l:605,t:286},
{name:'A2-丝印后固化机-1',id:201301,w:37,h:12,l:558,t:238},
{name:'A2-丝印后固化机-2',id:201302,w:37,h:12,l:558,t:262},
{name:'A2-丝印后固化机-3',id:201303,w:37,h:12,l:558,t:286},
{name:'A2-钢化炉',id:201401,w:75,h:15,l:382,t:238},
{name:'A2-包装清洗机-1',id:201501,w:30,h:15,l:228,t:234},
{name:'A2-包装清洗机-2',id:201502,w:30,h:15,l:228,t:267},
{name:'A2-铺纸机-1',id:201601,w:18,h:15,l:187,t:234},
{name:'A2-铺纸机-2',id:201602,w:18,h:15,l:186,t:267},
{ name: 'A2-磨边机-1', id: 200301, w: 70, h: 18, l: 832, t: 233 },
{ name: 'A2-磨边机-2', id: 200302, w: 70, h: 18, l: 833, t: 257 },
{ name: 'A2-磨边机-3', id: 200303, w: 70, h: 18, l: 834, t: 281 },
{ name: 'A2-磨边后清洗机-1', id: 200401, w: 30, h: 15, l: 800, t: 233 },
{ name: 'A2-磨边后清洗机-2', id: 200402, w: 30, h: 15, l: 801, t: 257 },
{ name: 'A2-磨边后清洗机-3', id: 200403, w: 30, h: 15, l: 802, t: 281 },
{ name: 'A2-打孔机-1', id: 200501, w: 13, h: 12, l: 731, t: 240 },
{ name: 'A2-打孔机-2', id: 200502, w: 13, h: 12, l: 731, t: 262 },
{ name: 'A2-打孔机-3', id: 200503, w: 13, h: 12, l: 731, t: 285 },
{ name: 'A2-打孔后清洗机-1', id: 200601, w: 32, h: 15, l: 666, t: 234 },
{ name: 'A2-打孔后清洗机-2', id: 200602, w: 32, h: 15, l: 666, t: 258 },
{ name: 'A2-打孔后清洗机-3', id: 200603, w: 32, h: 15, l: 666, t: 282 },
{ name: 'A2-丝印机-1', id: 200701, w: 30, h: 12, l: 605, t: 238 },
{ name: 'A2-丝印机-2', id: 200702, w: 30, h: 12, l: 605, t: 262 },
{ name: 'A2-丝印机-3', id: 200703, w: 30, h: 12, l: 605, t: 286 },
{ name: 'A2-丝印后固化机-1', id: 201301, w: 37, h: 12, l: 558, t: 238 },
{ name: 'A2-丝印后固化机-2', id: 201302, w: 37, h: 12, l: 558, t: 262 },
{ name: 'A2-丝印后固化机-3', id: 201303, w: 37, h: 12, l: 558, t: 286 },
{ name: 'A2-钢化炉', id: 201401, w: 75, h: 15, l: 382, t: 238 },
{ name: 'A2-包装清洗机-1', id: 201501, w: 30, h: 15, l: 228, t: 234 },
{ name: 'A2-包装清洗机-2', id: 201502, w: 30, h: 15, l: 228, t: 267 },
{ name: 'A2-铺纸机-1', id: 201601, w: 18, h: 15, l: 187, t: 234 },
{ name: 'A2-铺纸机-2', id: 201602, w: 18, h: 15, l: 186, t: 267 },
{name:'A3-磨边机-1',id:300301,w:70,h:18,l:834,t:318},
{name:'A3-磨边机-2',id:300302,w:70,h:18,l:834,t:342},
{name:'A3-磨边后清洗机-1',id:300401,w:30,h:15,l:802,t:319},
{name:'A3-磨边后清洗机-2',id:300402,w:30,h:15,l:802,t:342},
{name:'A3-打孔机-1',id:300501,w:13,h:12,l:731,t:324},
{name:'A3-打孔机-2',id:300502,w:13,h:12,l:731,t:348},
{name:'A3-打孔后清洗机-1',id:300601,w:32,h:15,l:666,t:320},
{name:'A3-打孔后清洗机-2',id:300602,w:32,h:15,l:666,t:342},
{name:'A3-丝印机-1',id:300701,w:30,h:12,l:605,t:324},
{name:'A3-丝印机-2',id:300702,w:30,h:12,l:605,t:348},
{name:'A3-一次镀膜机-1',id:300801,w:20,h:15,l:553,t:322},
{name:'A3-一次镀膜机-2',id:300802,w:20,h:15,l:553,t:346},
{name:'A3-丝印后固化机-1',id:301301,w:37,h:12,l:506,t:324},
{name:'A3-丝印后固化机-2',id:301302,w:37,h:12,l:506,t:347},
{name:'A3-钢化炉',id:301401,w:75,h:15,l:340,t:346},
{name:'A3-包装清洗机-1',id:301501,w:30,h:15,l:240,t:343},
{name:'A3-铺纸机-1',id:301601,w:18,h:15,l:200,t:343},
{name:'A3-铺纸机-2',id:301602,w:18,h:15,l:170,t:343},
{ name: 'A3-磨边机-1', id: 300301, w: 70, h: 18, l: 834, t: 318 },
{ name: 'A3-磨边机-2', id: 300302, w: 70, h: 18, l: 834, t: 342 },
{ name: 'A3-磨边后清洗机-1', id: 300401, w: 30, h: 15, l: 802, t: 319 },
{ name: 'A3-磨边后清洗机-2', id: 300402, w: 30, h: 15, l: 802, t: 342 },
{ name: 'A3-打孔机-1', id: 300501, w: 13, h: 12, l: 731, t: 324 },
{ name: 'A3-打孔机-2', id: 300502, w: 13, h: 12, l: 731, t: 348 },
{ name: 'A3-打孔后清洗机-1', id: 300601, w: 32, h: 15, l: 666, t: 320 },
{ name: 'A3-打孔后清洗机-2', id: 300602, w: 32, h: 15, l: 666, t: 342 },
{ name: 'A3-丝印机-1', id: 300701, w: 30, h: 12, l: 605, t: 324 },
{ name: 'A3-丝印机-2', id: 300702, w: 30, h: 12, l: 605, t: 348 },
{ name: 'A3-一次镀膜机-1', id: 300801, w: 20, h: 15, l: 553, t: 322 },
{ name: 'A3-一次镀膜机-2', id: 300802, w: 20, h: 15, l: 553, t: 346 },
{ name: 'A3-丝印后固化机-1', id: 301301, w: 37, h: 12, l: 506, t: 324 },
{ name: 'A3-丝印后固化机-2', id: 301302, w: 37, h: 12, l: 506, t: 347 },
{ name: 'A3-钢化炉', id: 301401, w: 75, h: 15, l: 340, t: 346 },
{ name: 'A3-包装清洗机-1', id: 301501, w: 30, h: 15, l: 240, t: 343 },
{ name: 'A3-铺纸机-1', id: 301601, w: 18, h: 15, l: 200, t: 343 },
{ name: 'A3-铺纸机-2', id: 301602, w: 18, h: 15, l: 170, t: 343 },
{name:'A4-磨边机-1',id:400301,w:70,h:18,l:838,t:380},
{name:'A4-磨边机-2',id:400302,w:70,h:18,l:838,t:405},
{name:'A4-磨边机-3',id:400303,w:70,h:18,l:839,t:428},
{name:'A4-磨边后清洗机-1',id:400401,w:30,h:15,l:804,t:380},
{name:'A4-磨边后清洗机-2',id:400402,w:30,h:15,l:805,t:405},
{name:'A4-磨边后清洗机-3',id:400403,w:30,h:15,l:806,t:427},
{name:'A4-一次镀膜机-1',id:400801,w:20,h:15,l:707,t:381},
{name:'A4-一次镀膜机-2',id:400802,w:20,h:15,l:707,t:407},
{name:'A4-一次镀膜机-3',id:400803,w:20,h:15,l:707,t:429},
{name:'A4-一次固化机-1',id:401001,w:37,h:12,l:660,t:383},
{name:'A4-一次固化机-2',id:401002,w:37,h:12,l:660,t:409},
{name:'A4-一次固化机-3',id:401003,w:37,h:12,l:660,t:431},
{name:'A4-二次镀膜机-1',id:401101,w:20,h:15,l:605,t:382},
{name:'A4-二次镀膜机-2',id:401102,w:20,h:15,l:605,t:408},
{name:'A4-二次镀膜机-3',id:401103,w:20,h:15,l:605,t:430},
{name:'A4-二次固化机-1',id:401201,w:37,h:12,l:557,t:383},
{name:'A4-二次固化机-2',id:401202,w:37,h:12,l:557,t:409},
{name:'A4-二次固化机-3',id:401203,w:37,h:12,l:557,t:431},
{name:'A4-钢化炉',id:401401,w:75,h:15,l:379,t:381},
{name:'A4-包装清洗机-1',id:401501,w:30,h:15,l:220,t:379},
{name:'A4-包装清洗机-2',id:401502,w:30,h:18,l:220,t:410},
{name:'A4-铺纸机-1',id:401601,w:18,h:15,l:180,t:381},
{name:'A4-铺纸机-2',id:401602,w:18,h:15,l:180,t:414},
{ name: 'A4-磨边机-1', id: 400301, w: 70, h: 18, l: 838, t: 380 },
{ name: 'A4-磨边机-2', id: 400302, w: 70, h: 18, l: 838, t: 405 },
{ name: 'A4-磨边机-3', id: 400303, w: 70, h: 18, l: 839, t: 428 },
{ name: 'A4-磨边后清洗机-1', id: 400401, w: 30, h: 15, l: 804, t: 380 },
{ name: 'A4-磨边后清洗机-2', id: 400402, w: 30, h: 15, l: 805, t: 405 },
{ name: 'A4-磨边后清洗机-3', id: 400403, w: 30, h: 15, l: 806, t: 427 },
{ name: 'A4-一次镀膜机-1', id: 400801, w: 20, h: 15, l: 707, t: 381 },
{ name: 'A4-一次镀膜机-2', id: 400802, w: 20, h: 15, l: 707, t: 407 },
{ name: 'A4-一次镀膜机-3', id: 400803, w: 20, h: 15, l: 707, t: 429 },
{ name: 'A4-一次固化机-1', id: 401001, w: 37, h: 12, l: 660, t: 383 },
{ name: 'A4-一次固化机-2', id: 401002, w: 37, h: 12, l: 660, t: 409 },
{ name: 'A4-一次固化机-3', id: 401003, w: 37, h: 12, l: 660, t: 431 },
{ name: 'A4-二次镀膜机-1', id: 401101, w: 20, h: 15, l: 605, t: 382 },
{ name: 'A4-二次镀膜机-2', id: 401102, w: 20, h: 15, l: 605, t: 408 },
{ name: 'A4-二次镀膜机-3', id: 401103, w: 20, h: 15, l: 605, t: 430 },
{ name: 'A4-二次固化机-1', id: 401201, w: 37, h: 12, l: 557, t: 383 },
{ name: 'A4-二次固化机-2', id: 401202, w: 37, h: 12, l: 557, t: 409 },
{ name: 'A4-二次固化机-3', id: 401203, w: 37, h: 12, l: 557, t: 431 },
{ name: 'A4-钢化炉', id: 401401, w: 75, h: 15, l: 379, t: 381 },
{ name: 'A4-包装清洗机-1', id: 401501, w: 30, h: 15, l: 220, t: 379 },
{ name: 'A4-包装清洗机-2', id: 401502, w: 30, h: 18, l: 220, t: 410 },
{ name: 'A4-铺纸机-1', id: 401601, w: 18, h: 15, l: 180, t: 381 },
{ name: 'A4-铺纸机-2', id: 401602, w: 18, h: 15, l: 180, t: 414 },
{name:'A5-磨边机-1',id:500301,w:70,h:18,l:817,t:465},
{name:'A5-磨边机-2',id:500302,w:70,h:18,l:817,t:488},
{name:'A5-磨边机-3',id:500303,w:70,h:18,l:819,t:512},
{name:'A5-磨边后清洗机-1',id:500401,w:30,h:15,l:784,t:462},
{name:'A5-磨边后清洗机-2',id:500402,w:30,h:15,l:784,t:488},
{name:'A5-磨边后清洗机-3',id:500403,w:30,h:15,l:785,t:512},
{name:'A5-一次镀膜机-1',id:500801,w:20,h:15,l:685,t:466},
{name:'A5-一次镀膜机-2',id:500802,w:20,h:15,l:685,t:490},
{name:'A5-一次镀膜机-3',id:500803,w:20,h:15,l:685,t:513},
{name:'A5-一次固化机-1',id:501001,w:37,h:12,l:638,t:468},
{name:'A5-一次固化机-2',id:501002,w:37,h:12,l:638,t:491},
{name:'A5-一次固化机-3',id:501003,w:37,h:12,l:638,t:514},
{name:'A5-二次镀膜机-1',id:501101,w:20,h:15,l:584,t:468},
{name:'A5-二次镀膜机-2',id:501102,w:20,h:15,l:584,t:490},
{name:'A5-二次镀膜机-3',id:501103,w:20,h:15,l:584,t:513},
{name:'A5-二次固化机-1',id:501201,w:37,h:12,l:535,t:468},
{name:'A5-二次固化机-2',id:501202,w:37,h:12,l:535,t:492},
{name:'A5-二次固化机-3',id:501203,w:37,h:12,l:535,t:514},
{name:'A5-钢化炉',id:501401,w:75,h:15,l:344,t:513},
{name:'A5-包装清洗机-1',id:501501,w:30,h:18,l:185,t:473},
{name:'A5-包装清洗机-2',id:501502,w:30,h:18,l:185,t:511},
{name:'A5-铺纸机-1',id:501601,w:18,h:15,l:144,t:475},
{name:'A5-铺纸机-2',id:501602,w:18,h:15,l:144,t:511}
],
eqTipMsg:{
name:'',
input:null,
output:null,
alarm:'未报警',
status:'在线'
}
}
},
props: {
scaleNum: {
type: Number,
default: 1
},
dataObj: {
type: Object,
default: () => {}
}
},
watch: {
scaleNum(val) {
this.scaleNum = val
},
dataObj(val) {
val.equipmentDets && val.equipmentDets.forEach(item => {
this.eqList.forEach(eq => {
if (eq.id == item.id) {
eq.name = item.name
eq.input = item.input
eq.output = item.output
eq.alarm = item.isError
eq.status = item.isRun
}
})
})
}
},
mounted() {},
methods: {
// 鼠标hover事件
handleMouseEnter(item, event) {
this.showTooltip = true;
this.eqTipMsg.name = item.name;
this.eqTipMsg.input = item.input;
this.eqTipMsg.output = item.output;
this.eqTipMsg.alarm = item.alarm;
this.eqTipMsg.status = item.status;
this.updateTooltipPosition(event);
},
handleMouseLeave() {
this.showTooltip = false;
},
updateTooltipPosition(event) {
const rect = this.$refs.centerTopBox.getBoundingClientRect()
const offset = 15;
const tooltipWidth = 315*this.scaleNum;
const tooltipHeight = 170*this.scaleNum;
const startX = rect.left;
const startY = rect.top;
const endX = rect.width;
const endY = rect.height;
let posX = event.clientX-startX + offset;
let posY = event.clientY-startY + offset;
if (posX + tooltipWidth > endX) {
posX = event.clientX-startX - tooltipWidth - offset;
}
if (posY + tooltipHeight > endY) {
posY = event.clientY -startY - tooltipHeight - offset;
}
this.tooltipStyle.left = posX/this.scaleNum;
this.tooltipStyle.top = posY/this.scaleNum;
}
}
}
{ name: 'A5-磨边机-1', id: 500301, w: 70, h: 18, l: 817, t: 465 },
{ name: 'A5-磨边机-2', id: 500302, w: 70, h: 18, l: 817, t: 488 },
{ name: 'A5-磨边机-3', id: 500303, w: 70, h: 18, l: 819, t: 512 },
{ name: 'A5-磨边后清洗机-1', id: 500401, w: 30, h: 15, l: 784, t: 462 },
{ name: 'A5-磨边后清洗机-2', id: 500402, w: 30, h: 15, l: 784, t: 488 },
{ name: 'A5-磨边后清洗机-3', id: 500403, w: 30, h: 15, l: 785, t: 512 },
{ name: 'A5-一次镀膜机-1', id: 500801, w: 20, h: 15, l: 685, t: 466 },
{ name: 'A5-一次镀膜机-2', id: 500802, w: 20, h: 15, l: 685, t: 490 },
{ name: 'A5-一次镀膜机-3', id: 500803, w: 20, h: 15, l: 685, t: 513 },
{ name: 'A5-一次固化机-1', id: 501001, w: 37, h: 12, l: 638, t: 468 },
{ name: 'A5-一次固化机-2', id: 501002, w: 37, h: 12, l: 638, t: 491 },
{ name: 'A5-一次固化机-3', id: 501003, w: 37, h: 12, l: 638, t: 514 },
{ name: 'A5-二次镀膜机-1', id: 501101, w: 20, h: 15, l: 584, t: 468 },
{ name: 'A5-二次镀膜机-2', id: 501102, w: 20, h: 15, l: 584, t: 490 },
{ name: 'A5-二次镀膜机-3', id: 501103, w: 20, h: 15, l: 584, t: 513 },
{ name: 'A5-二次固化机-1', id: 501201, w: 37, h: 12, l: 535, t: 468 },
{ name: 'A5-二次固化机-2', id: 501202, w: 37, h: 12, l: 535, t: 492 },
{ name: 'A5-二次固化机-3', id: 501203, w: 37, h: 12, l: 535, t: 514 },
{ name: 'A5-钢化炉', id: 501401, w: 75, h: 15, l: 344, t: 513 },
{ name: 'A5-包装清洗机-1', id: 501501, w: 30, h: 18, l: 185, t: 473 },
{ name: 'A5-包装清洗机-2', id: 501502, w: 30, h: 18, l: 185, t: 511 },
{ name: 'A5-铺纸机-1', id: 501601, w: 18, h: 15, l: 144, t: 475 },
{ name: 'A5-铺纸机-2', id: 501602, w: 18, h: 15, l: 144, t: 511 },
],
eqTipMsg: {
name: '',
input: null,
output: null,
alarm: '未报警',
status: '在线',
},
};
},
props: {
scaleNum: {
type: Number,
default: 1,
},
dataObj: {
type: Object,
default: () => {},
},
},
watch: {
scaleNum(val) {
this.scaleNum = val;
},
dataObj(val) {
val.equipmentDets &&
val.equipmentDets.forEach((item) => {
this.eqList.forEach((eq) => {
if (eq.id == item.id) {
eq.name = item.name;
eq.input = item.input;
eq.output = item.output;
eq.alarm = item.isError;
eq.status = item.isRun;
}
});
});
},
},
mounted() {},
methods: {
// 鼠标hover事件
handleMouseEnter(item, event) {
this.showTooltip = true;
this.eqTipMsg.name = item.name;
this.eqTipMsg.input = item.input;
this.eqTipMsg.output = item.output;
this.eqTipMsg.alarm = item.alarm;
this.eqTipMsg.status = item.status;
this.updateTooltipPosition(event);
},
handleMouseLeave() {
this.showTooltip = false;
},
updateTooltipPosition(event) {
const rect = this.$refs.centerTopBox.getBoundingClientRect();
const offset = 15;
const tooltipWidth = 315 * this.scaleNum;
const tooltipHeight = 170 * this.scaleNum;
const startX = rect.left;
const startY = rect.top;
const endX = rect.width;
const endY = rect.height;
let posX = event.clientX - startX + offset;
let posY = event.clientY - startY + offset;
if (posX + tooltipWidth > endX) {
posX = event.clientX - startX - tooltipWidth - offset;
}
if (posY + tooltipHeight > endY) {
posY = event.clientY - startY - tooltipHeight - offset;
}
this.tooltipStyle.left = posX / this.scaleNum;
this.tooltipStyle.top = posY / this.scaleNum;
},
},
};
</script>
<style lang="scss" scoped>
p{
margin: 0;
p {
margin: 0;
}
.centerTopBox {
width: 1041px;
height: 600px;
background: url('../../../../assets/images/dataBoard/center-top.png') no-repeat;
background-size: 100%;
position: absolute;
left: 440px;
top:113px;
overflow: hidden;
.videoStyle {
width: 1920px;
height: 1080px;
position: absolute;
left:-440px;
top:-113px;
}
.eqTipBox {
width: 315px;
height: 170px;
background: url('../../../../assets/images/dataBoard/eq-tip.png') no-repeat;
background-size: 100%;
position: absolute;
padding-top: 10px;
z-index: 1;
span{
display: inline-block;
font-size: 20px;
color: #FFFFFF;
letter-spacing: 1px;
vertical-align: middle;
}
.eqTipTitle {
width: 112px;
height: 30px;
padding-left: 15px;
}
.eqTipNum {
width: 190px;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.eqBox {
span{
display: inline-block;
// border: 1px solid red;
position: absolute;
}
}
.centerTopTopBox {
padding-left: 48px;
position: absolute;
top:30px;
.num {
width: 203px;
height: 65px;
line-height: 65px;
padding-left: 10px;
box-sizing: border-box;
font-weight: 500;
font-size: 38px;
color: #FFFFFF;
text-shadow: 0px 5px 2px rgba(0,0,0,0.62);
text-align: center;
position: absolute;
top:0px;
}
.title {
font-weight: 500;
font-size: 20px;
color: #00C8F7;
letter-spacing: 2px;
text-shadow: 0px 5px 2px rgba(0,0,0,0.62);
text-align: center;
}
}
width: 1041px;
height: 600px;
background: url('../../../../assets/images/dataBoard/center-top.png')
no-repeat;
background-size: 100%;
position: absolute;
left: 440px;
top: 113px;
overflow: hidden;
.videoStyle {
width: 1920px;
height: 1080px;
position: absolute;
left: -440px;
top: -113px;
}
.eqTipBox {
width: 315px;
height: 170px;
background: url('../../../../assets/images/dataBoard/eq-tip.png') no-repeat;
background-size: 100%;
position: absolute;
padding-top: 10px;
z-index: 1;
span {
display: inline-block;
font-size: 20px;
color: #ffffff;
letter-spacing: 1px;
vertical-align: middle;
}
.eqTipTitle {
width: 112px;
height: 30px;
padding-left: 15px;
}
.eqTipNum {
width: 190px;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.zhegaiceng {
.production-line1 {
position: absolute;
left: 3px;
top: 160px;
width: 99%;
height: 70px;
}
.production-line2 {
position: absolute;
left: 3px;
top: 232px;
width: 99%;
height: 75px;
}
.production-line3 {
position: absolute;
left: 3px;
top: 306px;
width: 99%;
height: 68px;
}
.production-line4 {
position: absolute;
left: 3px;
top: 372px;
width: 99%;
height: 86px;
}
.production-line5 {
position: absolute;
left: 3px;
top: 460px;
width: 99%;
height: 80px;
}
.line-mask {
position: absolute;
width: 100%;
height: 100%;
background: linear-gradient(
to right,
rgba(14, 14, 14, 0.9),
rgba(14, 14, 14, 0.7),
rgba(14, 14, 14, 0.9)
);
}
.line-status-tag {
position: absolute;
top: 50%;
left: 40%;
transform: translateY(-50%);
padding: 6px 12px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 4px;
font-size: 25px;
z-index: 10;
/* 新增:让内部元素 flex 垂直居中 */
display: flex;
align-items: center; /* 核心:垂直居中 */
gap: 6px; /* 控制点和文字的间距,避免重叠 */
}
.status-dot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
/* 移除可能影响对齐的 margin-top/margin-bottom */
margin: 0;
}
.status-dot.stopped {
background: #ff3d3d;
}
}
.eqBox {
span {
display: inline-block;
// border: 1px solid red;
position: absolute;
}
}
.centerTopTopBox {
padding-left: 48px;
position: absolute;
top: 30px;
.num {
width: 203px;
height: 65px;
line-height: 65px;
padding-left: 10px;
box-sizing: border-box;
font-weight: 500;
font-size: 38px;
color: #ffffff;
text-shadow: 0px 5px 2px rgba(0, 0, 0, 0.62);
text-align: center;
position: absolute;
top: 0px;
}
.title {
font-weight: 500;
font-size: 20px;
color: #00c8f7;
letter-spacing: 2px;
text-shadow: 0px 5px 2px rgba(0, 0, 0, 0.62);
text-align: center;
}
}
}
</style>
</style>

View File

@@ -1,286 +1,296 @@
<template>
<div class='leftBottomBox'>
<div class='title'>
<svg-icon icon-class="dataBoard2" class='icon'/>
<span>投入产出及良品率</span>
</div>
<div v-if='xData.length === 0' class='noData'>暂无数据</div>
<div v-else>
<div class="top_legend">
<span class="chart_legend_icon1">投入</span>
<span class="chart_legend_icon2">产出</span>
<span><span class="chart_legend_icon3"></span>良品率</span>
</div>
<div id='inOutputChart' style='width: 400px;height: 290px;'></div>
</div>
</div>
<div class="leftBottomBox">
<div class="title">
<svg-icon icon-class="dataBoard2" class="icon" />
<span>投入产出及良品率</span>
</div>
<div v-if="xData.length === 0" class="noData">暂无数据</div>
<div v-else>
<div class="top_legend">
<span class="chart_legend_icon1">投入</span>
<span class="chart_legend_icon2">产出</span>
<span>
<span class="chart_legend_icon3"></span>
良品率
</span>
</div>
<div id="inOutputChart" style="width: 400px; height: 290px"></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
export default {
name: 'LeftBottom',
props: {
dataObj: {
type: Object,
default: () => {}
}
},
watch: {
dataObj(val) {
this.xData = []
this.inputData = []
this.outputData = []
this.goodRateData = []
val.monthBar && val.monthBar.forEach(item => {
this.xData.push(item.dataType)
this.inputData.push(item.inputNum)
this.outputData.push(item.outputNum)
this.goodRateData.push(item.goodRate)
})
this.$nextTick(()=>{
this.initChart();
})
}
},
data() {
return {
chartDom: '',
chart: '',
xData:[],
inputData:[],
outputData:[],
goodRateData:[],
}
},
mounted() {},
methods: {
initChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // 页面多次刷新会出现警告Dom已经初始化了一个实例这是销毁实例
}
this.chartDom = document.getElementById('inOutputChart')
this.chart = echarts.init(this.chartDom)
var option;
option = {
grid: { top: 40, right: 10, bottom: 5, left: 10, containLabel: true },
legend: {
show: false,
},
xAxis: {
type: "category",
data: this.xData,
axisLabel: {
color: "#fff",
fontSize: 10,
interval: 0,
rotate:30
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 2,
color: "#5982B2",
},
},
},
yAxis: [{
name: "单位/片",
nameTextStyle: {
color: "#DFF1FE",
fontSize: 12,
},
type: "value",
axisLabel: {
color: "#DFF1FE",
fontSize: 12,
formatter: "{value}",
},
axisLine: {
show: true,
lineStyle: {
width: 2,
color: "#5982B2",
},
},
splitLine: {
lineStyle: {
width: 2,
color: "#5982B2",
},
},
},{
name: "良品率/%",
nameTextStyle: {
color: "#DFF1FE",
fontSize: 12,
},
type: "value",
axisLabel: {
color: "#DFF1FE",
fontSize: 12,
formatter: "{value}",
},
axisLine: {
show: true,
lineStyle: {
width: 2,
color: "#5982B2",
},
},
splitLine: {
lineStyle: {
width: 2,
color: "#5982B2",
},
},
}],
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
className: "qhd-chart-tooltip",
show: true,
},
series: [
{
data: this.inputData,
type: "bar",
barWidth: 10,
barGap:0,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(157, 234, 245, 1)' },
{ offset: 1, color: 'rgba(110, 249, 222, 1)' },
]),
},
},
{
data:this.outputData,
type: "bar",
barWidth: 10,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(92, 183, 255, 1)' },
{ offset: 1, color: 'rgba(54, 75, 254, 1)' },
]),
},
},
{
data:this.goodRateData,
type: "line",
yAxisIndex: 1,
symbol:'circle',
symbolSize: 7,
color:'rgba(18, 255, 245, 1)',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(18, 255, 245, 0.8)' },
{ offset: 0.2, color: 'rgba(18, 255, 245, 0.2)' },
{ offset: 0.4, color: 'rgba(18, 255, 245, 0)' },
]),
}
}
],
}
option && this.chart.setOption(option);
}
}
}
name: 'LeftBottom',
props: {
dataObj: {
type: Object,
default: () => {},
},
},
watch: {
dataObj(val) {
this.xData = [];
this.inputData = [];
this.outputData = [];
this.goodRateData = [];
val.monthBar &&
val.monthBar.forEach((item) => {
this.xData.push(item.dataType);
this.inputData.push(item.inputNum);
this.outputData.push(item.outputNum);
this.goodRateData.push(item.goodRate.toFixed(2));
});
this.$nextTick(() => {
this.initChart();
});
},
},
data() {
return {
chartDom: '',
chart: '',
xData: [],
inputData: [],
outputData: [],
goodRateData: [],
};
},
mounted() {},
methods: {
initChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose(); // 页面多次刷新会出现警告Dom已经初始化了一个实例这是销毁实例
}
this.chartDom = document.getElementById('inOutputChart');
this.chart = echarts.init(this.chartDom);
var option;
option = {
grid: { top: 40, right: 10, bottom: 5, left: 10, containLabel: true },
legend: {
show: false,
},
xAxis: {
type: 'category',
data: this.xData,
axisLabel: {
color: '#fff',
fontSize: 10,
interval: 0,
rotate: 30,
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 2,
color: '#5982B2',
},
},
},
yAxis: [
{
name: '单位/片',
nameTextStyle: {
color: '#DFF1FE',
fontSize: 12,
},
type: 'value',
axisLabel: {
color: '#DFF1FE',
fontSize: 12,
formatter: '{value}',
},
axisLine: {
show: true,
lineStyle: {
width: 2,
color: '#5982B2',
},
},
splitLine: {
lineStyle: {
width: 2,
color: '#5982B2',
},
},
},
{
name: '良品率/%',
nameTextStyle: {
color: '#DFF1FE',
fontSize: 12,
},
type: 'value',
max: 100,
min: 80,
axisLabel: {
color: '#DFF1FE',
fontSize: 12,
formatter: '{value}',
},
axisLine: {
show: true,
lineStyle: {
width: 2,
color: '#5982B2',
},
},
splitLine: {
lineStyle: {
width: 2,
color: '#5982B2',
},
},
},
],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
className: 'qhd-chart-tooltip',
show: true,
},
series: [
{
data: this.inputData,
type: 'bar',
barWidth: 10,
barGap: 0,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(157, 234, 245, 1)' },
{ offset: 1, color: 'rgba(110, 249, 222, 1)' },
]),
},
},
{
data: this.outputData,
type: 'bar',
barWidth: 10,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(92, 183, 255, 1)' },
{ offset: 1, color: 'rgba(54, 75, 254, 1)' },
]),
},
},
{
data: this.goodRateData,
type: 'line',
yAxisIndex: 1,
symbol: 'circle',
symbolSize: 7,
color: 'rgba(18, 255, 245, 1)',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(18, 255, 245, 0.8)' },
{ offset: 0.2, color: 'rgba(18, 255, 245, 0.2)' },
{ offset: 0.4, color: 'rgba(18, 255, 245, 0)' },
]),
},
},
],
};
option && this.chart.setOption(option);
},
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.leftBottomBox {
width: 402px;
height: 332px;
background: url('../../../../assets/images/dataBoard/left-bottom.png') no-repeat;
background-size: 100%;
position: absolute;
left: 23px;
bottom:23px;
.title {
margin: 7px 0 0 15px;
.icon {
width: 32px;
height: 32px;
margin-right: 5px;
vertical-align:middle;
margin-top: 5px;
}
span {
font-size: 24px;
color: #52FFF1;
line-height: 24px;
vertical-align:middle;
}
}
.top_legend {
color: #fff;
font-size: 14px;
position: absolute;
left:120px;
top:50px;
.chart_legend_icon1{
margin-right: 10px;
}
.chart_legend_icon2{
margin-right: 14px;
}
.chart_legend_icon1:before {
display: inline-block;
content: "";
width: 10px;
height: 10px;
margin-right: 5px;
border-radius: 2px;
background: #73F8E0;
}
.chart_legend_icon2:before {
display: inline-block;
content: "";
width: 10px;
height: 10px;
margin-right: 5px;
border-radius: 2px;
background: #497EFF;
}
.chart_legend_icon3 {
display: inline-block;
width: 8px;
height: 8px;
margin-right: 8px;
border-radius: 4px;
background: #73F8E0;
position:relative;
}
.chart_legend_icon3:before {
display: inline-block;
content: "";
width: 16px;
height:2px;
background: #73F8E0;
position:absolute;
top:3px;
left:-4px;
}
}
width: 402px;
height: 332px;
background: url('../../../../assets/images/dataBoard/left-bottom.png')
no-repeat;
background-size: 100%;
position: absolute;
left: 23px;
bottom: 23px;
.title {
margin: 7px 0 0 15px;
.icon {
width: 32px;
height: 32px;
margin-right: 5px;
vertical-align: middle;
margin-top: 5px;
}
span {
font-size: 24px;
color: #52fff1;
line-height: 24px;
vertical-align: middle;
}
}
.top_legend {
color: #fff;
font-size: 14px;
position: absolute;
left: 120px;
top: 50px;
.chart_legend_icon1 {
margin-right: 10px;
}
.chart_legend_icon2 {
margin-right: 14px;
}
.chart_legend_icon1:before {
display: inline-block;
content: '';
width: 10px;
height: 10px;
margin-right: 5px;
border-radius: 2px;
background: #73f8e0;
}
.chart_legend_icon2:before {
display: inline-block;
content: '';
width: 10px;
height: 10px;
margin-right: 5px;
border-radius: 2px;
background: #497eff;
}
.chart_legend_icon3 {
display: inline-block;
width: 8px;
height: 8px;
margin-right: 8px;
border-radius: 4px;
background: #73f8e0;
position: relative;
}
.chart_legend_icon3:before {
display: inline-block;
content: '';
width: 16px;
height: 2px;
background: #73f8e0;
position: absolute;
top: 3px;
left: -4px;
}
}
}
.noData {
font-size: 24px;
text-align: center;
padding-top: 100px;
.noData {
font-size: 24px;
text-align: center;
padding-top: 100px;
}
</style>
<style>
.qhd-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.qhd-chart-tooltip * {
color: #fff !important;
color: #fff !important;
}
</style>

View File

@@ -6,7 +6,7 @@
</div>
<div class='title-split'>
<img src="../../../../assets//images/dataBoard/leftbar.png" alt="">
<span class='text'></span>
<span class='text'></span>
<img src="../../../../assets//images/dataBoard/rightbar.png" alt="">
</div>
<div class='data-box'>
@@ -20,11 +20,11 @@
</div>
<div class='right-data' style="top:15px;">
<p><span class='num'>{{todayData?.inputNum ? formatThousands(todayData.inputNum) : '-'}}</span><span class='text'>片数</span></p>
<p><span class='num'>{{todayData?.inputArea ? formatThousands(todayData.inputArea) : '-'}}</span><span class='text'>面积/</span></p>
<!-- <p><span class='num'>{{todayData?.inputArea ? formatThousands(todayData.inputArea) : '-'}}</span><span class='text'>面积/</span></p> -->
</div>
<div class='right-data' style="top:132px;">
<p><span class='num'>{{todayData?.outputNum ? formatThousands(todayData.outputNum) : '-'}}</span><span class='text'>片数</span></p>
<p><span class='num'>{{todayData?.outputArea ? formatThousands(todayData.outputArea) : '-'}}</span><span class='text'>面积/</span></p>
<!-- <p><span class='num'>{{todayData?.outputArea ? formatThousands(todayData.outputArea) : '-'}}</span><span class='text'>面积/</span></p> -->
</div>
</div>
<div class='title-split'>
@@ -43,11 +43,11 @@
</div>
<div class='right-data' style="top:15px;">
<p><span class='num'>{{yesterdayData?.inputNum ? formatThousands(yesterdayData.inputNum) : '-'}}</span><span class='text'>片数</span></p>
<p><span class='num'>{{yesterdayData?.inputArea ? formatThousands(yesterdayData.inputArea) : '-'}}</span><span class='text'>面积/</span></p>
<!-- <p><span class='num'>{{yesterdayData?.inputArea ? formatThousands(yesterdayData.inputArea) : '-'}}</span><span class='text'>面积/</span></p> -->
</div>
<div class='right-data' style="top:132px;">
<p><span class='num'>{{yesterdayData?.outputNum ? formatThousands(yesterdayData.outputNum) : '-'}}</span><span class='text'>片数</span></p>
<p><span class='num'>{{yesterdayData?.outputArea ? formatThousands(yesterdayData.outputArea) : '-'}}</span><span class='text'>面积/</span></p>
<!-- <p><span class='num'>{{yesterdayData?.outputArea ? formatThousands(yesterdayData.outputArea) : '-'}}</span><span class='text'>面积/</span></p> -->
</div>
</div>
</div>
@@ -155,8 +155,9 @@ export default {
color: #FFFFFF;
letter-spacing: 1px;
text-shadow: 0px 4px 2px rgba(0,0,0,0.62);
line-height: 90px;
}
}
}
}
</style>
</style>

View File

@@ -2,7 +2,7 @@
<div class='rightBottomBox'>
<div class='title'>
<svg-icon icon-class="dataBoard3" class='icon'/>
<span><span class='dotted'></span>班组生产排名</span>
<span><span class='dotted'></span>班组生产排名</span>
</div>
<div class='rankingLeft'>
<div class='rankingLeftTitle'>产量</div>

View File

@@ -21,7 +21,7 @@
</div>
<div class='box' style='width: 115px;'>
<p class='name'>
<span style='margin-right: 3px;'>月</span>
<span style='margin-right: 3px;'>月</span>
<img v-show='nokSumDet.month >= nokSumDet.lastMonth' src="../../../../assets/images/dataBoard/arrUp.png" alt="" width='5' height='15'>
<img v-show='nokSumDet.month < nokSumDet.lastMonth' src="../../../../assets/images/dataBoard/arrDown.png" alt="" width='5' height='15'>
</p>
@@ -29,7 +29,7 @@
</div>
<div class='box' style='width: 110px;'>
<p class='name'>
<span style='margin-right: 3px;'>年</span>
<span style='margin-right: 3px;'>年</span>
<img v-show='nokSumDet.year >= nokSumDet.lastYear' src="../../../../assets/images/dataBoard/arrUp.png" alt="" width='5' height='15'>
<img v-show='nokSumDet.year < nokSumDet.lastYear' src="../../../../assets/images/dataBoard/arrDown.png" alt="" width='5' height='15'>
</p>

View File

@@ -88,7 +88,32 @@ export default {
};
},
created() {},
methods: {
},
methods: {
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
if (response.code === 1001033 || response.code === 1001034) {
return this.$modal.msgError(response.msg);
}
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
},
};
</script>

View File

@@ -120,7 +120,30 @@ export default {
.label;
}
});
},
},
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
console.log('response', response);
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
},
};
</script>

View File

@@ -6,65 +6,39 @@
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@select-changed="handleSearchBarChanged"
@headBtnClick="buttonClick" />
<div v-if="showData.length">
<base-table
class="right-aside"
v-loading="dataListLoading"
:table-props="tableProps"
:page="1"
:limit="999"
:table-data="showData">
<method-btn
v-if="showData.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<barChart
v-for="item in chartData"
:key="item.name + 'echart'"
style="margin-top: 50px"
height="600px"
:id="item.name + 'echart'"
:title="item.name + ' 节拍趋势图'"
:bar-data="item" />
</div>
<div v-else class="no-data-bg"></div>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
close-on-click-modal
top="0"
width="50%">
<eq-detail ref="eqDetail" />
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @select-changed="handleSearchBarChanged"
@headBtnClick="buttonClick" />
<div v-if="showData.length">
<base-table class="right-aside" v-loading="dataListLoading" :table-props="tableProps" :page="1" :limit="999"
:table-data="showData">
<method-btn v-if="showData.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<barChart v-for="item in chartData" :key="item.name + 'echart'" style="margin-top: 50px" height="600px"
:id="item.name + 'echart'" :title="item.name + ' 节拍趋势图'" :bar-data="item" />
</div>
<div v-else class="no-data-bg"></div>
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" close-on-click-modal top="0" width="50%">
<eq-detail ref="eqDetail" />
<slot name="footer">
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="handleCancel">
取消
</el-button>
</el-col>
</el-row>
</slot>
</base-dialog>
</div>
</template>
<script>
import eqDetail from './eq-detail';
import { parseTime } from '../../mixins/code-filter';
import { getPdList } from '@/api/core/monitoring/auto';
import { getPLlistByFactory } from '@/api/core/monitoring/auto';
import { getNewCTNow, getNewCTCharts } from '@/api/core/analysis/index';
import { getFactoryPage } from '@/api/core/base/factory';
// import codeFilter from '../../mixins/code-filter'
@@ -73,230 +47,233 @@ import FileSaver from 'file-saver';
import barChart from './BarChart.vue';
const tableProps = [
{
prop: 'factoryName',
label: '工厂',
},
{
prop: 'lineName',
label: '产线',
},
{
prop: 'size',
label: '规格',
showOverflowtooltip: true,
},
{
prop: 'process',
label: '产品工艺',
},
{
prop: 'edgeCt',
label: '磨边当前节拍pcs/min',
},
{
prop: 'temperCt',
label: '钢化当前节拍pcs/min',
},
{
prop: 'downCt',
label: '下片当前节拍pcs/min',
},
{
prop: 'factoryName',
label: '工厂',
},
{
prop: 'lineName',
label: '产线',
},
{
prop: 'size',
label: '规格',
showOverflowtooltip: true,
},
{
prop: 'process',
label: '产品工艺',
},
{
prop: 'edgeCt',
label: '磨边当前节拍pcs/min',
},
{
prop: 'temperCt',
label: '钢化当前节拍pcs/min',
},
{
prop: 'downCt',
label: '下片当前节拍pcs/min',
},
];
export default {
components: {
barChart,
eqDetail,
},
data() {
return {
urlOptions: {
getDataListURL: getNewCTNow,
},
listQuery: {
lineId: [],
},
fileName: '',
dataListLoading: false,
tableProps,
tableBtn: [
{
type: 'eq',
btnName: '详情',
},
].filter((v) => v),
showData: [],
tableData: [],
chartData: [],
formConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
onchange: true,
},
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
multiple: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
defaultTime: ['00:00:00', '23:59:59'],
param: 'timeVal',
width: 350,
clearable: false,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// // type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// type: 'button',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
addOrEditTitle: '',
addOrUpdateVisible: false,
};
},
created() {
// 获取当前时间
const now = new Date();
// 获取前一天的同一时间
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
// 设置为00:00:00
yesterday.setHours(0, 0, 0, 0);
// 设置为23:59:59
const end = new Date(yesterday.getTime());
end.setHours(23, 59, 59, 59);
this.listQuery.startTime = yesterday.getTime();
this.listQuery.endTime = end.getTime();
this.$nextTick(() => {
this.$refs.searchBarForm.formInline.timeVal = [
yesterday.getTime(),
end.getTime(),
];
});
this.getDataList();
this.getPdLineList();
},
methods: {
handleExport() {
let tables = document.querySelector('.el-table').cloneNode(true);
const fix = tables.querySelector('.el-table__fixed');
const fixRight = tables.querySelector('.el-table__fixed-right');
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'));
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'));
}
let exportTable = XLSX.utils.table_to_book(tables);
components: {
barChart,
eqDetail,
},
data() {
return {
urlOptions: {
getDataListURL: getNewCTNow,
},
listQuery: {
lineId: [],
},
fileName: '',
dataListLoading: false,
tableProps,
tableBtn: [
{
type: 'eq',
btnName: '详情',
},
].filter((v) => v),
showData: [],
tableData: [],
chartData: [],
formConfig: [
{
type: 'select',
label: '工厂',
selectOptions: [],
param: 'factoryId',
collapseTags: true,
multiple: true,
onchange: true,
},
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
collapseTags: true,
multiple: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
defaultTime: ['00:00:00', '23:59:59'],
param: 'timeVal',
width: 350,
clearable: false,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// // type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// type: 'button',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
addOrEditTitle: '',
addOrUpdateVisible: false,
};
},
created() {
// 获取当前时间
const now = new Date();
// 获取前一天的同一时间
const yesterday = new Date(now.getTime());
// 设置为00:00:00
yesterday.setHours(0, 0, 0, 0);
// 设置为23:59:59
const end = new Date(yesterday.getTime());
end.setHours(23, 59, 59, 59);
this.listQuery.startTime = yesterday.getTime();
this.listQuery.endTime = end.getTime();
this.$nextTick(() => {
this.$refs.searchBarForm.formInline.timeVal = [
yesterday.getTime(),
end.getTime(),
];
});
this.getDataList();
this.getPdLineList();
},
methods: {
handleExport() {
let tables = document.querySelector('.el-table').cloneNode(true);
const fix = tables.querySelector('.el-table__fixed');
const fixRight = tables.querySelector('.el-table__fixed-right');
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'));
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'));
}
let exportTable = XLSX.utils.table_to_book(tables);
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx',
bookSST: true,
type: 'array',
});
// sheetjs.xlsx为导出表格的标题名称
try {
FileSaver.saveAs(
new Blob([exportTableOut], {
type: 'application/octet-stream',
}),
this.fileName + '产线自动报表.xlsx'
);
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut);
}
return exportTableOut;
},
getPdLineList() {
getPdList().then((res) => {
this.formConfig[1].selectOptions = res.data || [];
});
const params = {
pageSize: 100,
pageNo: 1,
};
getFactoryPage(params).then((res) => {
this.formConfig[0].selectOptions = res.data.list || [];
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
this.showData = this.tableData;
});
getNewCTCharts(this.listQuery).then((response) => {
this.chartData = response.data;
});
},
handleSearchBarChanged({ param, value }) {
this.listQuery.lineId = [];
this.$refs.searchBarForm.formInline.lineId = undefined;
getPdList(value).then((res) => {
this.formConfig[1].selectOptions = res.data || [];
});
},
handleClick(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle =
val.data?.factoryName + '-' + val.data?.lineName + ' 详情';
this.$nextTick(() => {
this.$refs.eqDetail.init(
val.data.lineId,
this.listQuery.startTime,
this.listQuery.endTime
);
});
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.handleCancel();
},
},
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx',
bookSST: true,
type: 'array',
});
// sheetjs.xlsx为导出表格的标题名称
try {
FileSaver.saveAs(
new Blob([exportTableOut], {
type: 'application/octet-stream',
}),
this.fileName + '产线自动报表.xlsx'
);
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut);
}
return exportTableOut;
},
getPdLineList() {
// getPLlistByFactory().then((res) => {
// this.formConfig[1].selectOptions = res.data || [];
// });
const params = {
pageSize: 100,
pageNo: 1,
};
getFactoryPage(params).then((res) => {
this.formConfig[0].selectOptions = res.data.list || [];
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.lineId = val.lineId ? val.lineId : [];
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data;
this.dataListLoading = false;
this.showData = this.tableData;
});
getNewCTCharts(this.listQuery).then((response) => {
this.chartData = response.data;
});
},
handleSearchBarChanged({ param, value }) {
this.listQuery.lineId = [];
this.$refs.searchBarForm.formInline.lineId = undefined;
getPLlistByFactory({ factoryIds: this.$refs.searchBarForm.formInline.factoryId }).then((res) => {
this.formConfig[1].selectOptions = res.data || [];
});
},
handleClick(val) {
this.addOrUpdateVisible = true;
this.addOrEditTitle =
val.data?.factoryName + '-' + val.data?.lineName + ' 详情';
this.$nextTick(() => {
this.$refs.eqDetail.init(
val.data.lineId,
this.listQuery.startTime,
this.listQuery.endTime
);
});
},
handleCancel() {
this.addOrUpdateVisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.handleCancel();
},
},
};
</script>

View File

@@ -92,6 +92,8 @@ export default {
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ prop: 'name', label: '设备类型名称' },
{ prop: 'isCraft', label: '是否为生产设备',
filter: (val) => val?'是': '否', },
{ prop: 'code', label: '设备类型编码' },
{ prop: 'remark', label: '备注' },
],

View File

@@ -80,7 +80,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label=" 基板类型" prop="typeDictValue">
<el-select :disabled="isdetail" v-model="dataForm.typeDictValue" clearable style="width: 100%"
@@ -89,7 +89,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
</el-form>
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">

View File

@@ -12,19 +12,19 @@
<el-skeleton v-if="initing" :rows="6" animated />
<!-- :span-method="mergeColumnHandler" -->
<div v-else :class="{ 'no-data-bg': !tableData || tableData.length == 0 }">
<base-table
v-if="tableData && tableData.length > 0"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
@emitFun="handleEmitFun"
/>
<base-table
v-if="tableData && tableData.length > 0"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
:span-method="mergeColumnHandler"
@emitFun="handleEmitFun" />
</div>
</div>
</template>
<script>
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
import { getSectionDataOneDay } from '@/api/core/monitoring/data24';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
@@ -34,8 +34,8 @@ export default {
mixins: [tableHeightMixin],
data() {
return {
urlOptions: {
getDataListURL: getPdlDataOneDay
urlOptions: {
getDataListURL: getSectionDataOneDay,
},
initing: false,
queryParams: {
@@ -45,6 +45,7 @@ export default {
list: [],
arr: [],
spanArr: [],
spanArrProLine: [], // 产线合并行数组
timeList: [],
tableData: [],
tableProps: [],
@@ -58,78 +59,130 @@ export default {
methods: {
/** 构建tableProps - 依据第一个元素所提供的信息 */
buildProps(plData) {
plData.forEach(item => {
this.timeList.push(item.name)
})
const timeArray = Array.from(new Set(this.timeList))
console.log('nihc', timeArray)
this.timeList = []; // 重置避免重复
this.arr = []; // 重置避免重复
plData.forEach((item) => {
this.timeList.push(item.name);
});
const timeArray = Array.from(new Set(this.timeList));
for (const times of timeArray) {
if (times !== '投入数' && times !== '产出数' && times !== '报废数量' && times !== '产出面积') {
if (!['投入数', '产出数', '报废数量', '报废比例'].includes(times)) {
const subprop = {
label: times.slice(0, 10) + ' ' + times.slice(11),
label: `${times.slice(0, 10)} ${times.slice(11)}`,
align: 'center',
children: [
{ prop: times + '_in', label: '投入数量',
filter: (val) => (val != null ? val.toFixed(2) : '-'), },
{ prop: times + '_out', label: '产出数量',
filter: (val) => (val != null ? val.toFixed(2) : '-'), },
{ prop: times + '_junk', label: '报废数量',
filter: (val) => (val != null ? val.toFixed(2) : '-'), },
{ prop: times + '_area', label: '产出面积',
filter: (val) => (val != null ? val.toFixed(2) : '-'), }
]
}
this.arr.push(subprop)
{
prop: `${times}_in`,
label: '投入数',
filter: (val) => (val != null ? val : '-'),
},
{
prop: `${times}_out`,
label: '产出数',
filter: (val) => (val != null ? val : '-'),
},
{
prop: `${times}_junk`,
label: '报废数量',
filter: (val) => (val != null ? val : '-'),
},
{
prop: `${times}_area`,
label: '报废比例',
filter: (val) => (val != null ? val.toFixed(2) : '-'),
},
],
};
this.arr.push(subprop);
}
}
this.tableProps = this.arr
this.tableProps = [
{
prop: 'proLineName',
label: '产线',
fixed: 'left',
width: 120,
showOverflowTooltip: true,
},
{
prop: 'spec',
label: '产品规格',
fixed: 'left',
width: 110,
showOverflowTooltip: true,
filter: (val) => val != null ? val.join(' / ') : '-',
},
{
prop: 'sectionName',
label: '工段名称',
fixed: 'left',
width: 120,
showOverflowTooltip: true,
},
{
prop: 'allNum',
label: '生产总数',
fixed: 'left',
showOverflowTooltip: true,
},
...this.arr
];
},
/** 通用合并行计算方法 */
calcRowSpan(arr) {
const spanArr = [];
let count = 0;
arr.forEach((item, index) => {
if (index === 0) {
spanArr.push(1);
} else {
if (item === arr[index - 1]) {
spanArr[count] += 1;
spanArr.push(0);
} else {
count = index;
spanArr.push(1);
}
}
});
return spanArr;
},
setRowSpan(arr) {
let count = 0
arr.forEach((item, index) => {
if(index === 0) {
this.spanArr.push(1)
} else {
if (item === arr[index - 1]) {
this.spanArr[count] += 1
this.spanArr.push(0)
} else {
count = index
this.spanArr.push(1)
}
}
})
console.log('打印数组长度', this.spanArr)
},
/** 把 list 里的数据转换成 tableProps 对应的格式 */
convertList(list) {
let sectionArr= []
console.log('打印看下数据list', list)
list.forEach((ele, index) => {
let tempData = []
ele.data.forEach(item => {
item.children.forEach(params => {
if (params.dynamicName === '投入数量') {
tempData[item.dynamicName + '_in'] = params.dynamicValue
} else if (params.dynamicName === '产出数量') {
tempData[item.dynamicName + '_out'] = params.dynamicValue
} else if (params.dynamicName === '报废数量') {
tempData[item.dynamicName + '_junk'] = params.dynamicValue
} else {
tempData[item.dynamicName + '_area'] = params.dynamicValue
}
})
})
tempData['proLineName'] = ele.proLineName
tempData['spec'] = ele.spec
this.tableData.push(tempData)
console.log('看看数据', this.tableData, tempData)
const { proLineName } = tempData
sectionArr.push(proLineName)
})
this.setRowSpan(sectionArr)
console.log('工段名称列表', sectionArr)
this.tableData = []; // 重置避免重复
const proLineNames = []; // 存储产线名称用于计算合并
const specNames = []; // 存储规格名称用于计算合并
list.forEach((ele) => {
const tempData = {};
// 基础字段赋值
tempData.proLineName = ele.proLineName;
tempData.spec = ele.spec;
tempData.sectionName = ele.sectionName;
tempData.allNum = ele.allNum;
// 动态字段赋值
ele.data.forEach((item) => {
item.children.forEach((params) => {
const keyMap = {
'投入数': `${item.dynamicName}_in`,
'产出数': `${item.dynamicName}_out`,
'报废数量': `${item.dynamicName}_junk`,
'报废比例': `${item.dynamicName}_area`,
};
const key = keyMap[params.dynamicName];
if (key) tempData[key] = params.dynamicValue;
});
});
this.tableData.push(tempData);
proLineNames.push(ele.proLineName);
specNames.push(ele.spec);
});
// 计算合并行数组
this.spanArrProLine = this.calcRowSpan(proLineNames);
},
buildData(data) {
@@ -138,38 +191,55 @@ export default {
/** 合并table列的规则 */
mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
if (columnIndex == 0) {
if (this.spanArr[rowIndex]) {
return [
this.spanArr[rowIndex], // row span
1, // col span
];
} else {
return [0, 0];
}
// 列索引0: 产线列, 列索引1: 产品规格列
if (columnIndex === 0) {
return {
rowspan: this.spanArrProLine[rowIndex] || 0,
colspan: this.spanArrProLine[rowIndex] ? 1 : 0
};
}
if (columnIndex === 1) {
return {
rowspan: this.spanArrProLine[rowIndex] || 0,
colspan: this.spanArrProLine[rowIndex] ? 1 : 0
};
}
// 其他列不合并
return { rowspan: 1, colspan: 1 };
},
async getList() {
this.urlOptions.getDataListURL().then(res => {
console.log('看看数据', res)
this.urlOptions.getDataListURL().then((res) => {
console.log('看看数据', res);
this.arr = [
{
prop: 'proLineName',
label: '产线',
{
prop: 'proLineName',
label: '产线',
fixed: 'left',
showOverflowTooltip: true
},
{
prop: 'spec',
label: '产品规格',
showOverflowTooltip: true,
},
{
prop: 'spec',
label: '产品规格',
fixed: 'left',
showOverflowTooltip: true
}
]
showOverflowTooltip: true,
},
{
prop: 'sectionName',
label: '工段名称',
fixed: 'left',
showOverflowTooltip: true,
},
{
prop: 'allNum',
label: '生产总数',
fixed: 'left',
showOverflowTooltip: true,
},
];
this.buildProps(res.data.nameData);
this.buildData(res.data.data);
})
});
// // const data = this.res.data;
// // console.log('recent-24', data);

View File

@@ -348,7 +348,7 @@ export default {
dataListLoading: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`monitoring:group-off:update`)
this.$auth.hasPermi(`monitoring:group-off:detail`)
? {
type: 'eq',
btnName: '详情',

File diff suppressed because it is too large Load Diff

View File

@@ -101,7 +101,7 @@ const tableProps = [
},
{
prop: 'thick',
label: '玻璃度/mm'
label: '玻璃度/mm'
},
];
@@ -275,7 +275,7 @@ export default {
fileName += this.listQuery.thick + '_';
}
// 添加时间戳避免文件名重复
fileName += + '.xlsx';
fileName + '.xlsx';
FileSaver.saveAs(blob, fileName);
this.$message.success('导出成功');

View File

@@ -358,8 +358,8 @@ export default {
handleExport() {
// 处理查询参数
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
// params.pageNo = undefined;
// params.pageSize = undefined;
this.$modal.confirm('是否确认导出下片日志?').then(() => {
this.exportLoading = true;
return exportDownLogData(params);

File diff suppressed because it is too large Load Diff

View File

@@ -216,7 +216,7 @@ import {
import { getTree } from '@/api/base/equipment';
import { getEquipmentTypePage } from '@/api/base/equipmentType';
import { getEquipmentOverall } from '@/api/base/equipment';
import { getTenantId } from '@/utils/auth'
// import * as XLSX from 'xlsx';
// import FileSaver from 'file-saver';
import ButtonNav from '@/components/ButtonNav';
@@ -569,7 +569,7 @@ export default {
const token = getAccessToken();
const headers = new Headers({
Authorization: `Bearer ${token}`,
'tenant-id': store.getters.userId,
'tenant-id': getTenantId(),
'Content-Type': 'text/event-stream',
});

View File

@@ -34,28 +34,7 @@ export default {
mixins: [basicPageMixin],
data() {
return {
// tableBtn: [
// this.$auth.hasPermi('base:quality-inspection-type:update')
// ? {
// type: 'edit',
// btnName: '修改',
// }
// : undefined,
// this.$auth.hasPermi('base:quality-inspection-type:delete')
// ? {
// type: 'delete',
// btnName: '删除',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
// {
// prop: 'createTime',
// label: '添加时间',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'remark', label: '玻璃编号' },
@@ -74,42 +53,7 @@ export default {
},
{ prop: 'reason', label: '判等原因' },
{ prop: 'specifications', label: '规格' },
// {
// label: '操作',
// alignt: 'center',
// subcomponent: {
// render: function (h) {
// return h('div', null, [
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// h(
// 'el-button',
// {
// props: {
// icon: 'el-icon-edit',
// size: 'mini',
// type: 'text',
// },
// },
// ' 修改'
// ),
// ]);
// },
// },
// },
],
//
searchBarFormConfig: [
{
type: 'select',
@@ -135,13 +79,13 @@ export default {
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
width: 350,
defaultSelect: [],
},
{
type: 'button',
@@ -149,23 +93,9 @@ export default {
name: 'search',
color: 'primary',
},
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
{
type: 'separate',
},
// {
// type: this.$auth.hasPermi('base:quality-inspection-type:create')
// ? 'button'
// : '',
// btnName: '新增',
// name: 'add',
// plain: true,
// color: 'success',
// },
{
type: this.$auth.hasPermi('base:quality-inspection-type:export')
? 'button'
@@ -215,11 +145,55 @@ export default {
// deep: true
// },
// },
created() {
mounted() {
const { startTimestamp, endTimestamp } = this.getThreeDaysAgoThisTimeToNowTimeStamps();
// 找到时间范围的配置项并赋值对应你代码中的timeVal参数
this.searchBarFormConfig[3].defaultSelect = [startTimestamp, endTimestamp]; // 赋值给日期选择器
this.queryParams.startTime = startTimestamp;
this.queryParams.endTime = endTimestamp;
this.getList();
this.getDict()
},
methods: {
getThreeDaysAgoThisTimeToNowTimeStamps() {
const now = new Date();
// 1. 计算三天前的当前时刻使用setDate直接修改日期保留时分秒等信息
const threeDaysAgoThisTime = new Date(now); // 复制当前日期对象,避免修改原对象
threeDaysAgoThisTime.setDate(threeDaysAgoThisTime.getDate() - 3); // 日期减3天时分秒保持和当前一致
// 2. 获取时间戳(毫秒级和秒级)
// 开始时间戳:三天前的当前时刻
const startTimestamp = threeDaysAgoThisTime.getTime(); // 毫秒级
const startTimestampSec = Math.floor(startTimestamp / 1000); // 秒级
// 结束时间戳:当前时刻
const endTimestamp = now.getTime(); // 毫秒级
const endTimestampSec = Math.floor(endTimestamp / 1000); // 秒级
// 封装日期格式化函数转换为yyyy-MM-dd HH:mm:ss格式
const formatDateTime = (date) => {
const y = date.getFullYear();
// 月份是从0开始的所以要+1补零确保是两位
const m = String(date.getMonth() + 1).padStart(2, '0');
const d = String(date.getDate()).padStart(2, '0');
const h = String(date.getHours()).padStart(2, '0');
const min = String(date.getMinutes()).padStart(2, '0');
const s = String(date.getSeconds()).padStart(2, '0');
return `${y}-${m}-${d} ${h}:${min}:${s}`;
};
// 格式化后的字符串:三天前的当前时刻 和 当前时刻
const startDateTimeStr = formatDateTime(threeDaysAgoThisTime);
const endDateTimeStr = formatDateTime(now);
return {
startTimestamp, // 三天前当前时刻的毫秒级时间戳
endTimestamp, // 当前时刻的毫秒级时间戳
startTimestampSec, // 三天前当前时刻的秒级时间戳
endTimestampSec, // 当前时刻的秒级时间戳
startDateTimeStr, // yyyy-MM-dd HH:mm:ss格式的开始时间字符串
endDateTimeStr // yyyy-MM-dd HH:mm:ss格式的结束时间字符串
};
},
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];
@@ -250,11 +224,6 @@ export default {
this.queryParams.startTime = btn.timeVal ? btn.timeVal[0] : undefined
this.queryParams.endTime = btn.timeVal ? btn.timeVal[1] : undefined
this.queryParams.checkNum = btn.checkNum ? btn.checkNum : undefined
// keys.forEach((key) => {
// this.queryParams[key] = btn[key] || null;
// });
this.getList();
break;
case 'add':
@@ -263,10 +232,6 @@ export default {
case 'export':
this.handleExport();
break;
// case 'reset':
// this.$refs['search-bar'].resetForm();
// this.resetQuery();
// break;
}
},
/** 查询列表 */

View File

@@ -150,7 +150,8 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
width: 350,
defaultSelect: [],
},
{
type: 'button',
@@ -226,11 +227,56 @@ export default {
// deep: true
// },
// },
created() {
mounted() {
const { startTimestamp, endTimestamp } = this.getThreeDaysAgoThisTimeToNowTimeStamps();
// 找到时间范围的配置项并赋值对应你代码中的timeVal参数
this.searchBarFormConfig[2].defaultSelect = [startTimestamp, endTimestamp]; // 赋值给日期选择器
this.queryParams.startTime = startTimestamp;
this.queryParams.endTime = endTimestamp;
this.getList();
this.getDict()
},
methods: {
getThreeDaysAgoThisTimeToNowTimeStamps() {
const now = new Date();
// 1. 计算三天前的当前时刻使用setDate直接修改日期保留时分秒等信息
const threeDaysAgoThisTime = new Date(now); // 复制当前日期对象,避免修改原对象
threeDaysAgoThisTime.setDate(threeDaysAgoThisTime.getDate() - 3); // 日期减3天时分秒保持和当前一致
// 2. 获取时间戳(毫秒级和秒级)
// 开始时间戳:三天前的当前时刻
const startTimestamp = threeDaysAgoThisTime.getTime(); // 毫秒级
const startTimestampSec = Math.floor(startTimestamp / 1000); // 秒级
// 结束时间戳:当前时刻
const endTimestamp = now.getTime(); // 毫秒级
const endTimestampSec = Math.floor(endTimestamp / 1000); // 秒级
// 封装日期格式化函数转换为yyyy-MM-dd HH:mm:ss格式
const formatDateTime = (date) => {
const y = date.getFullYear();
// 月份是从0开始的所以要+1补零确保是两位
const m = String(date.getMonth() + 1).padStart(2, '0');
const d = String(date.getDate()).padStart(2, '0');
const h = String(date.getHours()).padStart(2, '0');
const min = String(date.getMinutes()).padStart(2, '0');
const s = String(date.getSeconds()).padStart(2, '0');
return `${y}-${m}-${d} ${h}:${min}:${s}`;
};
// 格式化后的字符串:三天前的当前时刻 和 当前时刻
const startDateTimeStr = formatDateTime(threeDaysAgoThisTime);
const endDateTimeStr = formatDateTime(now);
return {
startTimestamp, // 三天前当前时刻的毫秒级时间戳
endTimestamp, // 当前时刻的毫秒级时间戳
startTimestampSec, // 三天前当前时刻的秒级时间戳
endTimestampSec, // 当前时刻的秒级时间戳
startDateTimeStr, // yyyy-MM-dd HH:mm:ss格式的开始时间字符串
endDateTimeStr // yyyy-MM-dd HH:mm:ss格式的结束时间字符串
};
},
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];

View File

@@ -98,8 +98,8 @@ export default {
init(data) {
this.visible = true;
this.factoryName = data.factoryName || '';
this.lineName = data.lineName || '';
this.factoryName = data.factoryName || '未知工厂';
this.lineName = data.lineName || '未知产线';
if (data.startTime && data.endTime) {
const start = moment(data.startTime).format('yyyy-MM-DD HH:mm:ss');

View File

@@ -152,7 +152,8 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
width: 350,
defaultSelect: [],
},
{
type: 'button',
@@ -225,11 +226,56 @@ export default {
// deep: true
// },
// },
created() {
mounted() {
const { startTimestamp, endTimestamp } = this.getThreeDaysAgoThisTimeToNowTimeStamps();
// 找到时间范围的配置项并赋值对应你代码中的timeVal参数
this.searchBarFormConfig[2].defaultSelect = [startTimestamp, endTimestamp]; // 赋值给日期选择器
this.queryParams.startTime = startTimestamp;
this.queryParams.endTime = endTimestamp;
this.getList();
this.getDict()
},
methods: {
getThreeDaysAgoThisTimeToNowTimeStamps() {
const now = new Date();
// 1. 计算三天前的当前时刻使用setDate直接修改日期保留时分秒等信息
const threeDaysAgoThisTime = new Date(now); // 复制当前日期对象,避免修改原对象
threeDaysAgoThisTime.setDate(threeDaysAgoThisTime.getDate() - 3); // 日期减3天时分秒保持和当前一致
// 2. 获取时间戳(毫秒级和秒级)
// 开始时间戳:三天前的当前时刻
const startTimestamp = threeDaysAgoThisTime.getTime(); // 毫秒级
const startTimestampSec = Math.floor(startTimestamp / 1000); // 秒级
// 结束时间戳:当前时刻
const endTimestamp = now.getTime(); // 毫秒级
const endTimestampSec = Math.floor(endTimestamp / 1000); // 秒级
// 封装日期格式化函数转换为yyyy-MM-dd HH:mm:ss格式
const formatDateTime = (date) => {
const y = date.getFullYear();
// 月份是从0开始的所以要+1补零确保是两位
const m = String(date.getMonth() + 1).padStart(2, '0');
const d = String(date.getDate()).padStart(2, '0');
const h = String(date.getHours()).padStart(2, '0');
const min = String(date.getMinutes()).padStart(2, '0');
const s = String(date.getSeconds()).padStart(2, '0');
return `${y}-${m}-${d} ${h}:${min}:${s}`;
};
// 格式化后的字符串:三天前的当前时刻 和 当前时刻
const startDateTimeStr = formatDateTime(threeDaysAgoThisTime);
const endDateTimeStr = formatDateTime(now);
return {
startTimestamp, // 三天前当前时刻的毫秒级时间戳
endTimestamp, // 当前时刻的毫秒级时间戳
startTimestampSec, // 三天前当前时刻的秒级时间戳
endTimestampSec, // 当前时刻的秒级时间戳
startDateTimeStr, // yyyy-MM-dd HH:mm:ss格式的开始时间字符串
endDateTimeStr // yyyy-MM-dd HH:mm:ss格式的结束时间字符串
};
},
getDict() {
getPdList().then(res => {
this.searchBarFormConfig[1].selectOptions = res.data || [];