Compare commits

..

No commits in common. "9d34ca02f1302602f68f68543de6be5dae7cdfb0" and "0789decfd90d3a93092d0aed61bf7c2ac82ef531" have entirely different histories.

4 changed files with 227 additions and 180 deletions

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-12-29 16:19:38 * @LastEditTime: 2023-12-28 11:52:08
* @Description: * @Description:
--> -->
<template> <template>
@ -132,8 +132,6 @@ import doubleYChart from './components/doubleYChart '
// import elementResizeDetectorMaker from 'element-resize-detector'; // import elementResizeDetectorMaker from 'element-resize-detector';
// var erd = elementResizeDetectorMaker(); // // var erd = elementResizeDetectorMaker(); //
// let resizeFun = null // let resizeFun = null
import { parseTime } from '../core/mixins/code-filter';
import LinearBarChart from './components/linearBarChart' import LinearBarChart from './components/linearBarChart'
const qualityYearTableProps= [] const qualityYearTableProps= []
@ -155,10 +153,7 @@ const EqMonitoringProps = [
] ]
const cutProps = [ const cutProps = [
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ { prop: 'time', label: '时间' },
prop: 'time', label: '时间',
filter: parseTime
},
{ prop: 'size', label: '规格' }, { prop: 'size', label: '规格' },
{ prop: 'productArea', label: '良品面积' }, { prop: 'productArea', label: '良品面积' },
{ prop: 'wasteArea', label: '废片面积' }, { prop: 'wasteArea', label: '废片面积' },
@ -308,10 +303,7 @@ export default {
this.init() this.init()
}, },
mounted() { mounted() {
this.funInitWebSocket() this.initWebSocket()
this.CutInitWebSocket()
this.SJGInitWebSocket()
this.getTimes() this.getTimes()
const _this = this; const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920 _this.beilv2 = document.documentElement.clientWidth / 1920
@ -361,13 +353,13 @@ export default {
// status: obj.data.FanFrequencyInfo[i] // status: obj.data.FanFrequencyInfo[i]
// }) // })
// } // }
// this.funList = arr`` this.funList = arr``
this.$axios.get( this.$axios.get(
'/monitoring/equipment-monitor/realtime-page', '/monitoring/equipment-monitor/realtime-page',
'get', 'get',
this.queryParams this.queryParams
).then((res) => { ).then((res) => {
console.log('222222222222222', res); console.log(res);
this.realEqList = res.data.list; this.realEqList = res.data.list;
// this.total = response.data.total; // this.total = response.data.total;
// this.loading = false; // this.loading = false;
@ -397,7 +389,7 @@ export default {
// //
this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}, },
SJGInitWebSocket() { initWebSocket() {
if (typeof (WebSocket) === 'undefined') { if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket') alert('您的浏览器不支持WebSocket')
} else { } else {
@ -405,7 +397,7 @@ export default {
// const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG' // const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG'
let date = new Date().valueOf() let date = new Date().valueOf()
console.log(date); console.log(date);
const SJGWsUrl = `ws://192.168.0.30:8888/websocket/message?userId=COLD${date}` const SJGWsUrl = `ws://192.168.0.33:48082/websocket/message?userId=COLD${date}`
this.SJGWebsocket = new WebSocket(SJGWsUrl) this.SJGWebsocket = new WebSocket(SJGWsUrl)
// WebSocket // WebSocket
this.SJGWebsocket.onopen = this.SJGWebsocketOnOpen this.SJGWebsocket.onopen = this.SJGWebsocketOnOpen
@ -415,17 +407,7 @@ export default {
this.SJGWebsocket.onmessage = this.SJGWebsocketOnMessage this.SJGWebsocket.onmessage = this.SJGWebsocketOnMessage
// webSocket // webSocket
this.SJGWebsocket.onclose = this.SJGWebsocketClose this.SJGWebsocket.onclose = this.SJGWebsocketClose
} const cutWsUrl = `ws://192.168.0.33:48082/websocket/message?userId=CUTTING${date}`
},
CutInitWebSocket() {
if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket')
} else {
// const wsUrl = 'ws://192.168.1.74:48080/websocket/message?userId=EN111'
// const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG'
let date = new Date().valueOf()
console.log(date);
const cutWsUrl = `ws://192.168.0.30:8888/websocket/message?userId=CUTTING${date}`
this.cutWebsocket = new WebSocket(cutWsUrl) this.cutWebsocket = new WebSocket(cutWsUrl)
// WebSocket // WebSocket
@ -436,26 +418,28 @@ export default {
this.cutWebsocket.onmessage = this.cutWebsocketOnMessage this.cutWebsocket.onmessage = this.cutWebsocketOnMessage
// webSocket // webSocket
this.cutWebsocket.onclose = this.cutWebsocketClose this.cutWebsocket.onclose = this.cutWebsocketClose
} const funWsUrl = `ws://10.70.180.10:8081/xc-screen/websocket/${date}`
}, this.funWebsocket = new WebSocket(funWsUrl)
funInitWebSocket() { // WebSocket
// if (typeof (WebSocket) === 'undefined') { this.funWebsocket.onopen = this.funWebsocketOnOpen
// alert('WebSocket') // WebSocket
// } else { this.funWebsocket.onerror = this.funWebsocketOnError
// // const wsUrl = 'ws://192.168.1.74:48080/websocket/message?userId=EN111' // WebSocket
// // const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG' this.funWebsocket.onmessage = this.funWebsocketOnMessage
// let date = new Date().valueOf() // webSocket
// const funWsUrl = `ws://10.70.2.2:8080/xc-screen/websocket/${date}` this.funWebsocket.onclose = this.funWebsocketClose
// this.funWebsocket = new WebSocket(funWsUrl) // const wsUrl = 'ws://192.168.0.33:48082/websocket/message?userId=EN111'
// WebSocket
// this.websocket = new WebSocket(wsUrl)
// // WebSocket // // WebSocket
// this.funWebsocket.onopen = this.funWebsocketOnOpen // this.websocket.onopen = this.websocketOnOpen
// // WebSocket // // WebSocket
// this.funWebsocket.onerror = this.funWebsocketOnError // this.websocket.onerror = this.websocketOnError
// // WebSocket // // WebSocket
// this.funWebsocket.onmessage = this.funWebsocketOnMessage // this.websocket.onmessage = this.websocketOnMessage
// // webSocket // // webSocket
// this.funWebsocket.onclose = this.funWebsocketClose // this.websocket.onclose = this.websocketClose
// } }
}, },
funWebsocketOnOpen() { funWebsocketOnOpen() {
console.log('socket连接成功') console.log('socket连接成功')
@ -465,23 +449,23 @@ export default {
// //
funWebsocketOnError(e) { funWebsocketOnError(e) {
console.log('222222', e) console.log('222222', e)
this.funInitWebSocket() this.initWebSocket()
}, },
// //
funWebsocketOnMessage(e) { funWebsocketOnMessage(e) {
// console.log(1111, e) // console.log(1111, e)
// console.log(this.wsData) // console.log(this.wsData)
// console.log('22222', this.wsData.data) // console.log('22222', this.wsData.data)
this.funWsData = JSON.parse(e.data) this.wsData = JSON.parse(e.data)
if (this.funWsData.type === 'FanFrequencyInfo') { if (this.wsData.type === 'FanFrequencyInfo') {
let arr = [] // let arr = []
for (let i in this.funWsData.FanFrequencyInfo) { // for (let i in this.wsData.FanFrequencyInfo) {
arr.push({ // arr.push({
equipmentName: i, // equipmentName: i,
status: obj.data.FanFrequencyInfo[i] // status: obj.data.FanFrequencyInfo[i]
}) // })
} // }
this.funList = arr // this.funList = arr
} }
}, },
cutWebsocketOnOpen() { cutWebsocketOnOpen() {
@ -492,16 +476,16 @@ export default {
// //
cutWebsocketOnError(e) { cutWebsocketOnError(e) {
console.log('11111', e) console.log('11111', e)
this.CutInitWebSocket() this.initWebSocket()
}, },
// //
cutWebsocketOnMessage(e) { cutWebsocketOnMessage(e) {
// console.log(1111, e) // console.log(1111, e)
this.cutWsData = JSON.parse(e.data) this.wsData = JSON.parse(e.data)
console.log(this.wsData)
// console.log('22222', this.wsData.data) // console.log('22222', this.wsData.data)
console.log('table', this.cutWsData) if (this.wsData.type === 'cutting' && this.wsData.name === 'table' ) {
if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') { this.cutTableDataList = this.wsData.productHourData.map((ele, index) => {
this.cutTableDataList = this.cutWsData.productHourData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -516,7 +500,7 @@ export default {
// } // }
}); });
// console.log(this.orderList) // console.log(this.orderList)
} else if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'chart' && this.cutWsData.dateType === 'day') { } else if (this.wsData.type === 'cutting' && this.wsData.name === 'chart') {
let nameList = [] let nameList = []
let nameWasteList = [] let nameWasteList = []
let topNameList = [] let topNameList = []
@ -524,18 +508,14 @@ export default {
let wasteList = [] let wasteList = []
let sumAreaList = [] let sumAreaList = []
let yieldList = [] let yieldList = []
this.cutTableDataList = this.cutWsData.coldDetData.forEach((ele, index) => { this.cutTableDataList = this.wsData.detData.forEach((ele, index) => {
nameList.push(ele.lineName) nameList.push(ele.lineName)
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea) topNameList.push(ele.lineName + ' ' + '总面积' + ele.sumArea)
productList.push(ele.productArea) productList.push(ele.productArea)
wasteList.push(ele.wastArea) wasteList.push(ele.wastArea)
nameWasteList.push('缺陷面积:' + ele.wastArea) nameWasteList.push('缺陷面积:'+ele.wastArea)
sumAreaList.push(ele.sumArea)
yieldList.push(ele.yield)
}) })
this.$refs.pileChart.initChart(nameList, topNameList, nameWasteList, productList, wasteList) this.$refs.pileChart.initChart(nameList, topNameList, nameWasteList, productList, wasteList)
// console.log(this.cutWsData)
// console.log('chart',nameList, topNameList, nameWasteList, productList, wasteList);
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList) this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
// this.$refs.pileChart.initWebSocket // this.$refs.pileChart.initWebSocket
// console.log(this.orderList) // console.log(this.orderList)
@ -549,7 +529,7 @@ export default {
// //
SJGWebsocketOnError(e) { SJGWebsocketOnError(e) {
console.log('11111', e) console.log('11111', e)
this.SJGInitWebSocket() this.initWebSocket()
}, },
// //
SJGWebsocketOnMessage(e) { SJGWebsocketOnMessage(e) {
@ -558,11 +538,11 @@ export default {
// let data = { "data": { "FanFrequencyInfo": { "1#10": "0", "1#L": "0", "1#": "44.8", "1#": "40", "1#": "43", "1#": "48", "2#10": "50", "2#L": "49.7", "2#": "0", "2#": "0", "2#": "0", "2#": "48", "3#": "0", "3#": "0", "4#": "40", "4#": "43" } }, "type": "FanFrequencyInfo" } // let data = { "data": { "FanFrequencyInfo": { "1#10": "0", "1#L": "0", "1#": "44.8", "1#": "40", "1#": "43", "1#": "48", "2#10": "50", "2#L": "49.7", "2#": "0", "2#": "0", "2#": "0", "2#": "48", "3#": "0", "3#": "0", "4#": "40", "4#": "43" } }, "type": "FanFrequencyInfo" }
// let obj = JSON.parse(data.data) // let obj = JSON.parse(data.data)
// console.log(obj); // console.log(obj);
this.SJGWsData = JSON.parse(e.data) this.wsData = JSON.parse(e.data)
console.log(this.SJGWsData) console.log(this.wsData)
// console.log('22222', this.wsData.data) // console.log('22222', this.wsData.data)
if (this.SJGWsData.type === 'isra') { if (this.wsData.type === 'isra') {
this.ISRAList = this.SJGWsData.detData.map((ele, index) => { this.ISRAList = this.wsData.detData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -577,6 +557,63 @@ export default {
// console.log(this.orderList) // console.log(this.orderList)
} }
}, },
//
// SJGWebsocketSend() {
// this.websocket.send('11111')
// },
// //
// SJGWebsocketClose(e) {
// console.log('WebSocket ', e)
// },
// // send
// websocketOnOpen() {
// console.log('socket')
// this.websocket.onmessage()
// },
// //
// websocketOnError(e) {
// console.log('11111', e)
// this.initWebSocket()
// },
// //
// websocketOnMessage(e) {
// console.log(1111, e)
// this.wsData = JSON.parse(e.data)
// // console.log('22222', this.wsData.data)
// if (this.wsData.type === 'EnergyMonitoring') {
// let EnergyNameList = []
// this.wsData.data.forEach((ele) => {
// EnergyNameList.push(ele.lineName)
// })
// this.EnergyMonitoringNameList = EnergyNameList
// let EnergyDataList = []
// this.wsData.data.forEach((ele) => {
// EnergyDataList.push(ele.useQuantity
// // {
// // type: 'bar',
// // data: ele.useQuantity,
// // barWidth: 6
// // }
// )
// })
// this.EnergyMonitoringList = EnergyDataList
// console.log(EnergyDataList)
// // console.log(this.EnergyMonitoringNameList)
// // console.log(this.EnergyMonitoringList)
// // this.$nextTick(() => {
// this.$refs.EnergyMonitoringChart.initChart(this.EnergyMonitoringNameList, this.EnergyMonitoringList)
// // })
// }
// },
// //
// websocketSend() {
// this.websocket.send('11111')
// },
// //
// websocketClose(e) {
// console.log('WebSocket ', e)
// },
windowWidth(value) { windowWidth(value) {
this.clientWidth = value this.clientWidth = value
this.beilv2 = this.clientWidth / 1920 this.beilv2 = this.clientWidth / 1920

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2023-12-29 16:18:17 * @LastEditTime: 2023-12-27 18:28:45
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -138,7 +138,7 @@ export default {
} }
}, },
grid: { grid: {
left: "4%", left: "3%",
right: "4%", right: "4%",
bottom: "3%", bottom: "3%",
width: 'auto', width: 'auto',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-27 13:54:52 * @Date: 2023-12-27 13:54:52
* @LastEditTime: 2023-12-29 16:28:26 * @LastEditTime: 2023-12-27 19:47:27
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -93,50 +93,54 @@ export default {
initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) { initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
// console.log(1) // console.log(1)
this.chart = echarts.init(document.getElementById(this.id)) this.chart = echarts.init(document.getElementById(this.id))
let series = [ let series = [{
{ name: '成品面积',
//
name: '良品',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
// silent: true, // label: {
// itemStyle: { // show: true
color: '#0fdedb',
// }, // },
barWidth: 10, emphasis: {
data: passRateList focus: 'series'
},
data: passRateList,
itemStyle: {
normal: { color: '#2359ec' }
}
}, },
{ {
name: '废片面积',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
name: '废品',
data: wasteList,
barWidth: 10,
// barWidth: 15,
// label: { // label: {
// position: [10, 10], // show: true
// normal: {
// position: [800, -24],
// show: true,
// textStyle: {
// color: '#2359ec',
// fontSize: 16,
// },
// },
// }, // },
emphasis: {
focus: 'series'
},
barWidth: 12,
data: wasteList,
itemStyle: {
normal: { color: '#745fe4' }
} }
] },]
// for (i = 0; i < 5; i++) { // for (i = 0; i < 5; i++) {
// series.push({ // series.push({
// }) // })
// } // }
const yAxisDataLeft = topNameList;
// const yAxisDataRight = ['', '', '', '', ''];
const yAxisDataRight = nameWasteList
this.chart.setOption({ this.chart.setOption({
legend: { tooltip: {
textStyle: { trigger: 'axis',
color: '#ffffff' axisPointer: {
// Use axis to trigger tooltip
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
} }
}, },
// legend: {},
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
@ -145,38 +149,43 @@ export default {
height: 'auto', height: 'auto',
containLabel: true containLabel: true
}, },
xAxis: {
type: 'value',
show: false, // 线线
axisTick: {
show: false // 线
},
axisLine: {
show: false, // 线
},
axisLabel: {
show: false, //
},
splitLine: {
show: false // 线
},
},
yAxis: [ yAxis: [
{ {
type: 'category',
inverse: true, inverse: true,
splitLine: { data: yAxisDataLeft,
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: { axisLabel: {
show: true, show: true,
inside: true, inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: { textStyle: {
color: '#ffffff', color: '#ffffff',
verticalAlign: 'bottom',
fontSize: 12, fontSize: 12,
align: 'left', align: 'left',
padding: [0, 0, 15, -5] },
formatter: '{value}\n{a|占位}\n{a|占位}',
rich: {
a: {
color: 'transparent',
lineHeight: 24,
}
} }
}, },
data: topNameList //offset: 30,
},
{
type: 'category',
inverse: true,
splitLine: { splitLine: {
show: false show: false
}, },
@ -185,29 +194,40 @@ export default {
}, },
axisLine: { axisLine: {
show: false show: false
}
}, },
{
inverse: false,
data: yAxisDataRight,
axisLabel: { axisLabel: {
show: true,
inside: true, inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: { textStyle: {
color: '#ffffff', color: '#ffffff',
verticalAlign: 'bottom',
fontSize: 12, fontSize: 12,
align: 'right', align: 'right',
padding: [0, 0, 15, -5] },
formatter: '{value}\n{a|占位}\n{a|占位}',
rich: {
a: {
color: 'transparent',
lineHeight: 24,
fontFamily: 'digital'
}
} }
}, },
data: nameWasteList offset: 0,
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
}
} }
], ],
xAxis: { series: series
// max: 120,
show: false,
},
series:series
}) })
} }
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-12-29 15:15:50 * @LastEditTime: 2023-12-28 10:22:06
* @Description: * @Description:
--> -->
<template> <template>
@ -557,7 +557,6 @@ export default {
mounted() { mounted() {
this.getList() this.getList()
this.initWebSocket() this.initWebSocket()
this.SJGInitWebSocket()
this.getTimes() this.getTimes()
const _this = this; const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920 _this.beilv2 = document.documentElement.clientWidth / 1920
@ -598,14 +597,14 @@ export default {
'get', 'get',
this.queryParams this.queryParams
).then((res) => { ).then((res) => {
// console.log('11111', res); console.log('11111', res);
this.productLineList = res.data this.productLineList = res.data
}) })
this.$axios.get( this.$axios.get(
'base/quality-inspection-record/dayStatistics', 'base/quality-inspection-record/dayStatistics',
'get', 'get',
).then((res) => { ).then((res) => {
// console.log('11111', res); console.log('11111', res);
this.qualityMonthList = res.data this.qualityMonthList = res.data
}) })
}, },
@ -640,6 +639,17 @@ export default {
const wsUrl = `ws://192.168.0.33:48082/websocket/message?userId=EN${date}` const wsUrl = `ws://192.168.0.33:48082/websocket/message?userId=EN${date}`
// const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG' // const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG'
let date = new Date().valueOf() let date = new Date().valueOf()
console.log(date);
const SJGWsUrl = `ws://192.168.0.33:48082/websocket/message?userId=SJG${date}`
this.SJGWebsocket = new WebSocket(SJGWsUrl)
// WebSocket
this.SJGWebsocket.onopen = this.SJGWebsocketOnOpen
// WebSocket
this.SJGWebsocket.onerror = this.SJGWebsocketOnError
// WebSocket
this.SJGWebsocket.onmessage = this.SJGWebsocketOnMessage
// webSocket
this.SJGWebsocket.onclose = this.SJGWebsocketClose
// const wsUrl = 'ws://192.168.0.33:48082/websocket/message?userId=EN111' // const wsUrl = 'ws://192.168.0.33:48082/websocket/message?userId=EN111'
// WebSocket // WebSocket
this.websocket = new WebSocket(wsUrl) this.websocket = new WebSocket(wsUrl)
@ -653,26 +663,6 @@ export default {
this.websocket.onclose = this.websocketClose this.websocket.onclose = this.websocketClose
} }
}, },
SJGInitWebSocket() {
if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket')
} else {
// const wsUrl = `ws://192.168.0.33:48082/websocket/message?userId=EN${date}`
// const wsUrl = 'ws://192.168.1.104:48082/websocket/message?userId=SJG'
let date = new Date().valueOf()
// console.log(date);
const SJGWsUrl = `ws://192.168.0.33:48082/websocket/message?userId=SJG${date}`
this.SJGWebsocket = new WebSocket(SJGWsUrl)
// WebSocket
this.SJGWebsocket.onopen = this.SJGWebsocketOnOpen
// WebSocket
this.SJGWebsocket.onerror = this.SJGWebsocketOnError
// WebSocket
this.SJGWebsocket.onmessage = this.SJGWebsocketOnMessage
// webSocket
this.SJGWebsocket.onclose = this.SJGWebsocketClose
}
},
SJGWebsocketOnOpen() { SJGWebsocketOnOpen() {
console.log('socket连接成功') console.log('socket连接成功')
console.log(this.SJGWebsocket.onmessage); console.log(this.SJGWebsocket.onmessage);
@ -681,16 +671,16 @@ export default {
// //
SJGWebsocketOnError(e) { SJGWebsocketOnError(e) {
// console.log('11111', e) // console.log('11111', e)
this.SJGInitWebSocket() this.initWebSocket()
}, },
// //
SJGWebsocketOnMessage(e) { SJGWebsocketOnMessage(e) {
// console.log(1111, e) // console.log(1111, e)
this.SJGWsData = JSON.parse(e.data) this.wsData = JSON.parse(e.data)
// console.log(this.wsData.detData); // console.log(this.wsData.detData);
// console.log('22222', this.wsData.data) // console.log('22222', this.wsData.data)
if (this.SJGWsData.type === 'order') { if (this.wsData.type === 'order') {
this.orderList = this.SJGWsData.detData.map((ele, index) => { this.orderList = this.wsData.detData.map((ele, index) => {
if (ele.progressRate != 1) { if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -700,8 +690,8 @@ export default {
} }
}); });
console.log(this.orderList) console.log(this.orderList)
} else if (this.SJGWsData.type === 'equipment') { } else if (this.wsData.type === 'equipment') {
this.equipmentList = this.SJGWsData.detData.map((ele, index) => { this.equipmentList = this.wsData.detData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -712,16 +702,16 @@ export default {
} }
// } // }
}); });
// console.log(SJGWsData.orderList) // console.log(this.orderList)
} else if (this.SJGWsData.type === 'productline') { } else if (this.wsData.type === 'productline') {
// console.log(this.wsData.detData); console.log(this.wsData.detData);
let nameList = [] let nameList = []
let passRateList = [] let passRateList = []
let outputNumList = [] let outputNumList = []
// console.log('2222222222', this.productLineList); // console.log('2222222222', this.productLineList);
this.productLineList.forEach((item) => { this.productLineList.forEach((item) => {
this.SJGWsData.detData.forEach((ele) => { this.wsData.detData.forEach((ele) => {
if (item.id == ele.productionLineId) { if (item.id == ele.productionLineId) {
nameList.push(item.name) nameList.push(item.name)
} }
@ -730,11 +720,11 @@ export default {
console.log(Array.from(new Set(nameList))) console.log(Array.from(new Set(nameList)))
// progressRateList = EnergyNameList // progressRateList = EnergyNameList
// let EnergyDataList = [] // let EnergyDataList = []
this.SJGWsData.detData.forEach((ele) => { this.wsData.detData.forEach((ele) => {
passRateList.push(ele.passRate *100 passRateList.push(ele.passRate *100
) )
}) })
this.SJGWsData.detData.forEach((ele) => { this.wsData.detData.forEach((ele) => {
outputNumList.push(ele.outputNum outputNumList.push(ele.outputNum
) )
}) })