diff --git a/src/views/OperationalOverview/coldBoard.vue b/src/views/OperationalOverview/coldBoard.vue index c262ff02..a92aad06 100644 --- a/src/views/OperationalOverview/coldBoard.vue +++ b/src/views/OperationalOverview/coldBoard.vue @@ -83,10 +83,14 @@ --> - - + + + + @@ -137,6 +141,10 @@ import { parseTime } from '../core/mixins/code-filter'; import LinearBarChart from './components/linearBarChart' const qualityYearTableProps= [] +const EqMonitoringPropsFun = [ + { prop: 'equipmentName', label: '设备名称' }, + { prop: 'status', label: '运行状态', width: 80} +] const EqMonitoringProps = [ { prop: 'productLine', label: '产线' }, { prop: 'equipmentName', label: '设备名称' }, @@ -154,15 +162,15 @@ const EqMonitoringProps = [ }, ] const cutProps = [ - { prop: 'lineName', label: '产线' }, + { prop: 'lineName', label: '产线', width: 50 }, { prop: 'time', label: '时间', filter: parseTime }, { prop: 'size', label: '规格' }, - { prop: 'productArea', label: '良品面积' }, - { prop: 'wasteArea', label: '废片面积' }, - { prop: 'product', label: '良品率' }, + { prop: 'productArea', label: '良品面积', width: 80 }, + { prop: 'wasteArea', label: '废片面积', width: 80 }, + { prop: 'product', label: '良品率', width: 80 }, ] const cxNameList = ['周一', '周二', '周三', '周四', '周五'] @@ -246,6 +254,7 @@ export default { beilv: 1, value: 100, EqMonitoringProps, + EqMonitoringPropsFun, realEqList:[], qualityYearTableProps, ISRATableProps, @@ -263,9 +272,13 @@ export default { clientWidth: 0, containerWidth: 111111, isFullScreen: false, + cutWsData: {}, + funWsData: {}, + SJGWsData: {}, // orderProcessList: [], dateType: '0', funList:[], + annealFunList: [], queryParams: { pageNo: 1, pageSize: 10, @@ -334,7 +347,6 @@ export default { // this.beilv2 = window.innerWidth / 1920 // }) // erd.listenTo(document, (element) => { - // console.log(element.offsetWidth) // this.beilv2 = element.offsetWidth / 1920 // // var width = element.offsetWidth; @@ -352,7 +364,6 @@ 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 obj = JSON.parse(data) - // console.log('data', obj.data.FanFrequencyInfo) // // for() // let arr = [] // for (let i in obj.data.FanFrequencyInfo) { @@ -367,7 +378,6 @@ export default { 'get', this.queryParams ).then((res) => { - console.log('222222222222222', res); this.realEqList = res.data.list; // this.total = response.data.total; // this.loading = false; @@ -404,7 +414,6 @@ export default { // 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 SJGWsUrl = `ws://10.70.2.2:8080/websocket/message?userId=COLD${date}` this.SJGWebsocket = new WebSocket(SJGWsUrl) // 监听 WebSocket 连接 @@ -424,7 +433,6 @@ export default { // 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://10.70.2.2:8080/websocket/message?userId=CUTTING${date}` this.cutWebsocket = new WebSocket(cutWsUrl) @@ -439,46 +447,52 @@ export default { } }, funInitWebSocket() { - // 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() - // const funWsUrl = `ws://10.70.2.2:8080/xc-screen/websocket/${date}` - // this.funWebsocket = new WebSocket(funWsUrl) - // // 监听 WebSocket 连接 - // this.funWebsocket.onopen = this.funWebsocketOnOpen - // // 监听 WebSocket 错误信息 - // this.funWebsocket.onerror = this.funWebsocketOnError - // // 监听 WebSocket 消息 - // this.funWebsocket.onmessage = this.funWebsocketOnMessage - // // 监听 webSocket 断开信息 - // this.funWebsocket.onclose = this.funWebsocketClose - // } + 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() + const funWsUrl = `ws://10.70.180.10:8081/xc-screen/websocket/${date}` + this.funWebsocket = new WebSocket(funWsUrl) + // 监听 WebSocket 连接 + this.funWebsocket.onopen = this.funWebsocketOnOpen + // 监听 WebSocket 错误信息 + this.funWebsocket.onerror = this.funWebsocketOnError + // 监听 WebSocket 消息 + this.funWebsocket.onmessage = this.funWebsocketOnMessage + // 监听 webSocket 断开信息 + this.funWebsocket.onclose = this.funWebsocketClose + } }, funWebsocketOnOpen() { console.log('socket连接成功') - // console.log(this.SJGWebsocket.onmessage); this.SJGWebsocket.onmessage() }, // 连接建立失败重连 funWebsocketOnError(e) { - console.log('222222', e) this.funInitWebSocket() }, // 数据接收 funWebsocketOnMessage(e) { - // console.log(1111, e) - // console.log(this.wsData) - // console.log('22222', this.wsData.data) - this.funWsData = JSON.parse(e.data) - if (this.funWsData.type === 'FanFrequencyInfo') { + this.funWsData = e?.data ? JSON.parse(e?.data) : {} + // FanInfo + if (this.funWsData.type === 'AnnealFanInfo') { + let arr = [] + for (let i in this.funWsData.data.annealFanInfo) { + arr.push({ + equipmentName: i, + status: this.funWsData.data.annealFanInfo[i] + }) + } + this.annealFunList = arr + } + if (this.funWsData.type === 'FanInfo') { let arr = [] - for (let i in this.funWsData.FanFrequencyInfo) { + for (let i in this.funWsData.data.fanInfo) { arr.push({ equipmentName: i, - status: obj.data.FanFrequencyInfo[i] + status: this.funWsData.data.fanInfo[i] }) } this.funList = arr @@ -486,20 +500,15 @@ export default { }, cutWebsocketOnOpen() { console.log('socket连接成功') - // console.log(this.SJGWebsocket.onmessage); this.SJGWebsocket.onmessage() }, // 连接建立失败重连 cutWebsocketOnError(e) { - console.log('11111', e) this.CutInitWebSocket() }, // 数据接收 cutWebsocketOnMessage(e) { - // console.log(1111, e) - this.cutWsData = JSON.parse(e.data) - // console.log('22222', this.wsData.data) - console.log('table', this.cutWsData) + this.cutWsData = e?.data ? JSON.parse(e?.data) : {} if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') { this.cutTableDataList = this.cutWsData.productHourData.map((ele, index) => { // if (ele.progressRate != 1) { @@ -510,12 +519,11 @@ export default { size: ele.size, productArea: ele.productArea + '㎡', wasteArea: ele.wasteArea + '㎡', - product: (ele.product *100).toFixed + '%' + product: (ele.product * 100).toFixed(2) + '%' } // } }); - // console.log(this.orderList) } else if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'chart' && this.cutWsData.dateType === 'day') { let nameList = [] let nameWasteList = [] @@ -524,7 +532,8 @@ export default { let wasteList = [] let sumAreaList = [] let yieldList = [] - this.cutTableDataList = this.cutWsData.coldDetData.forEach((ele, index) => { + // this.cutTableDataList = + this.cutWsData.coldDetData.forEach((ele, index) => { nameList.push(ele.lineName) topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea) productList.push(ele.productArea) @@ -534,33 +543,22 @@ export default { yieldList.push((ele.yield *100).toFixed(3)) }) 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.pileChart.initWebSocket - // console.log(this.orderList) } }, SJGWebsocketOnOpen() { console.log('socket连接成功') - // console.log(this.SJGWebsocket.onmessage); this.SJGWebsocket.onmessage() }, // 连接建立失败重连 SJGWebsocketOnError(e) { - console.log('11111', e) this.SJGInitWebSocket() }, // 数据接收 SJGWebsocketOnMessage(e) { - console.log(e); - // console.log(1111, e) // 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) - // console.log(obj); - this.SJGWsData = JSON.parse(e.data) - console.log(this.SJGWsData) - // console.log('22222', this.wsData.data) + this.SJGWsData = e?.data ? JSON.parse(e?.data) : {} if (this.SJGWsData.type === 'isra') { this.ISRAList = this.SJGWsData.detData.map((ele, index) => { // if (ele.progressRate != 1) { @@ -574,7 +572,6 @@ export default { } // } }); - // console.log(this.orderList) } }, windowWidth(value) { diff --git a/src/views/OperationalOverview/components/baseTable.vue b/src/views/OperationalOverview/components/baseTable.vue index 83fbf703..2865e710 100644 --- a/src/views/OperationalOverview/components/baseTable.vue +++ b/src/views/OperationalOverview/components/baseTable.vue @@ -18,7 +18,7 @@