修改bug

This commit is contained in:
‘937886381’
2024-01-05 08:44:31 +08:00
39 changed files with 2489 additions and 1305 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-01-02 10:07:03
* @LastEditTime: 2024-01-04 16:41:17
* @Description:
-->
<template>
@@ -41,8 +41,8 @@
<top-radio-group />
</div> -->
<!-- 像下面这样表格里的limit值也许可以用js动态计算出来 -->
<double-y-chart ref="productChart" :id="'doubleYChart'" :name-list="cxNameList" :data-list="cxDataList" :height="359"
:show-legend="true" />
<double-y-chart ref="productChart" :id="'doubleYChart'" :name-list="cxNameList" :data-list="cxDataList"
:height="359" :show-legend="true" />
</base-container>
</el-col>
@@ -62,7 +62,7 @@
</div> -->
<!-- <el-row :gutter="9"> -->
<!-- <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24"> -->
<pile-bar-chart ref="pileChart" :name-list="EnergyMonitoringNameList" :data-list="EnergyMonitoringList"
<pile-bar-chart ref="pileChart" :name-list="EnergyMonitoringNameList" :data-list="EnergyMonitoringList"
:height="359" />
<!-- </el-col> -->
<!-- <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
@@ -84,14 +84,17 @@
</div> -->
<!-- 像下面这样表格里的limit值也许可以用js动态计算出来 -->
<el-col :span="6">
<h4 style="margin: 5px 0 5px 0;">融化风机</h4>
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringPropsFun"
:table-data="funList" />
</el-col>
<el-col :span="6">
<h3 style="margin: 5px 0 5px 0;">退火风机</h3>
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringPropsFun"
:table-data="annealFunList" />
</el-col>
<el-col :span="12" style="float: right;">
<h3 style="margin: 5px 0 5px 0;">产线设备</h3>
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringProps"
:table-data="realEqList" />
</el-col>
@@ -146,19 +149,16 @@ const EqMonitoringPropsFun = [
{ prop: 'status', label: '运行状态', width: 80}
]
const EqMonitoringProps = [
{ prop: 'productLine', label: '产线' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'line', label: '产线' },
{ prop: 'name', label: '设备名称' },
{ prop: 'code', label: '设备编码' },
{
prop: 'status',
prop: 'run',
label: '运行状态',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '',
},
{
prop: 'error',
label: '故障状态',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
},
]
const cutProps = [
@@ -324,7 +324,7 @@ export default {
this.funInitWebSocket()
this.CutInitWebSocket()
this.SJGInitWebSocket()
// this.getList()
this.getTimes()
const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920
@@ -334,7 +334,7 @@ export default {
this.beilv2 = _this.clientWidth / 1920
})()
}
this.getList()
// this.getList()
// const _this = this;
// window.onresize = () => {
// return (() => {
@@ -359,30 +359,30 @@ export default {
// removeEventListener('resize', resizeFun)
// },
methods: {
getList() {
// this.loading = true;
// 执行查询
// 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)
// // for()
// let arr = []
// for (let i in obj.data.FanFrequencyInfo) {
// arr.push({
// equipmentName: i,
// status: obj.data.FanFrequencyInfo[i]
// })
// }
// this.funList = arr``
this.$axios.get(
'/monitoring/equipment-monitor/realtime-page',
'get',
this.queryParams
).then((res) => {
this.realEqList = res.data.list;
// this.total = response.data.total;
// this.loading = false;
});
},
// getList() {
// // this.loading = true;
// // 执行查询
// // 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)
// // // for()
// // let arr = []
// // for (let i in obj.data.FanFrequencyInfo) {
// // arr.push({
// // equipmentName: i,
// // status: obj.data.FanFrequencyInfo[i]
// // })
// // }
// // this.funList = arr``
// this.$axios.get(
// '/monitoring/equipment-monitor/realtime-page',
// 'get',
// this.queryParams
// ).then((res) => {
// this.realEqList = res.data.list;
// // this.total = response.data.total;
// // this.loading = false;
// });
// },
getTimes() {
setInterval(this.getTimesInterval, 1000);
},
@@ -414,7 +414,7 @@ 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()
const SJGWsUrl = `ws://10.70.2.2:8080/websocket/message?userId=COLD${date}`
const SJGWsUrl = process.env.VUE_APP_Socket_API + `/websocket/message?userId=COLD${date}`
this.SJGWebsocket = new WebSocket(SJGWsUrl)
// 监听 WebSocket 连接
this.SJGWebsocket.onopen = this.SJGWebsocketOnOpen
@@ -433,7 +433,7 @@ 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()
const cutWsUrl = `ws://10.70.2.2:8080/websocket/message?userId=CUTTING${date}`
const cutWsUrl = process.env.VUE_APP_Socket_API + `/websocket/message?userId=CUTTING${date}`
this.cutWebsocket = new WebSocket(cutWsUrl)
// 监听 WebSocket 连接
@@ -506,6 +506,14 @@ export default {
cutWebsocketOnError(e) {
this.CutInitWebSocket()
},
getSize(str) {
console.log(str.match(/\d+(\.\d+)?/g))
let size = str.match(/\d+(\.\d+)?/g).map(ele => {
return parseFloat(ele)
})
console.log(size[0] + '*' + size[1] + '*' + size[2]);
return size[0] + '*' + size[1] + '*' + size[2]
},
// 数据接收
cutWebsocketOnMessage(e) {
this.cutWsData = e?.data ? JSON.parse(e?.data) : {}
@@ -516,7 +524,7 @@ export default {
id: ele.id,
lineName: ele.lineName,
time: ele.time,
size: ele.size,
size: this.getSize(ele.size),
productArea: ele.productArea + '㎡',
wasteArea: ele.wasteArea + '㎡',
product: (ele.product * 100).toFixed(2) + '%'
@@ -572,6 +580,20 @@ export default {
}
// }
});
} else if (this.SJGWsData.type === 'equipment') {
this.realEqList = this.SJGWsData.detData.map((ele, index) => {
// if (ele.progressRate != 1) {
return {
line: ele.line,
name: ele.name,
code: ele.code,
run: ele.run,
error: ele.error,
// percent: ele.percent
}
// }
});
}
},
windowWidth(value) {