修改bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 16:50:26
|
||||
* @LastEditTime: 2024-03-26 09:25:08
|
||||
* @LastEditTime: 2024-03-26 09:56:20
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -134,143 +134,31 @@
|
||||
<script>
|
||||
import baseContainer from './components/baseContainer'
|
||||
import baseTable1 from './components/baseTable'
|
||||
// import baseContainer1 from './components/baseContainer/indexcopy'
|
||||
// import baseTable2 from './components/baseTable'
|
||||
// import baseTable3 from './components/baseTable'
|
||||
// import TopRadioGroup from './components/topRadioGroup'
|
||||
import screenfull from 'screenfull'
|
||||
// import BaseVideo from './components/baseVideo.vue'
|
||||
// import alarmLevel from './components/alarmLevel'
|
||||
import pileBarChart from './components/pileBarChart'
|
||||
import colorDiv from './components/colorDiv'
|
||||
import moment from "moment";
|
||||
|
||||
// import axios from '@/utils/request'
|
||||
import doubleYChart from './components/coldDoubleYChart'
|
||||
import { parseTime } from '../core/mixins/code-filter';
|
||||
import ISRAChart from './components/ISRAChart.vue';
|
||||
import { getDcsMsg, closeDcsMsg } from "./wsInterface"
|
||||
import LinearBarChart from './components/linearBarChart'
|
||||
const qualityYearTableProps= []
|
||||
const EqMonitoringPropsFun = [
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'status', label: '运行状态', width: 80}
|
||||
]
|
||||
const EqMonitoringProps = [
|
||||
{ prop: 'line', label: '产线' },
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ prop: 'code', label: '设备编码' },
|
||||
{
|
||||
prop: 'run',
|
||||
label: '运行状态',
|
||||
},
|
||||
{
|
||||
prop: 'error',
|
||||
label: '故障状态',
|
||||
},
|
||||
]
|
||||
const cutProps = [
|
||||
{ prop: 'lineName', label: '产线', width: 50 },
|
||||
{
|
||||
prop: 'time', label: '时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{ prop: 'size', label: '规格' },
|
||||
{ prop: 'productArea', label: '良品面积', width: 80 },
|
||||
{ prop: 'wasteArea', label: '废片面积', width: 80 },
|
||||
{
|
||||
prop: 'product', label: '良品率', width: 80,
|
||||
subcomponent: colorDiv,
|
||||
},
|
||||
]
|
||||
const cxNameList = ['周一', '周二', '周三', '周四', '周五']
|
||||
|
||||
const cxDataList = [
|
||||
{
|
||||
topColor: '#9DD5FF',
|
||||
bottomColor: '#1295FF',
|
||||
name: '电耗能',
|
||||
data: [100, 150, 121, 97, 140]
|
||||
},
|
||||
{
|
||||
topColor: '#FF8BC3',
|
||||
bottomColor: '#EB46A1',
|
||||
name: '水耗能',
|
||||
data: [110, 110, 151, 77, 110]
|
||||
},
|
||||
{
|
||||
topColor: '#85F6E9',
|
||||
bottomColor: '#2EC6B4',
|
||||
name: '天然气',
|
||||
data: [110, 120, 171, 287, 40]
|
||||
},
|
||||
{
|
||||
topColor: '#9496FF',
|
||||
bottomColor: '#6567FF',
|
||||
name: '焦炉煤气',
|
||||
data: [140, 157, 122, 27, 240]
|
||||
},
|
||||
{
|
||||
topColor: '#F68E8A',
|
||||
bottomColor: '#E95552',
|
||||
name: '余热发电',
|
||||
data: [170, 180, 127, 17, 340]
|
||||
},
|
||||
{
|
||||
topColor: '#FFE873',
|
||||
bottomColor: '#E7AE2A',
|
||||
name: '二氧化硫',
|
||||
data: [140, 160, 121, 57, 170]
|
||||
}
|
||||
]
|
||||
const ISRATableProps = [
|
||||
{
|
||||
prop: 'linename',
|
||||
label:'产线'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '时间'
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label:'缺陷类型'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '缺陷数量'
|
||||
},
|
||||
{
|
||||
prop: 'percent',
|
||||
label: '占比'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: 'ProductionMonitoringCockpit',
|
||||
components: {
|
||||
baseContainer,
|
||||
baseTable1,
|
||||
pileBarChart,
|
||||
// TopRadioGroup,
|
||||
doubleYChart,
|
||||
LinearBarChart,
|
||||
ISRAChart
|
||||
// baseContainer1
|
||||
// pieChart1,
|
||||
// pieChart2
|
||||
// pieChart3
|
||||
// BaseVideo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
beilv2: 1,
|
||||
beilv: 1,
|
||||
value: 100,
|
||||
EqMonitoringProps,
|
||||
EqMonitoringPropsFun,
|
||||
realEqList:[],
|
||||
qualityYearTableProps,
|
||||
ISRATableProps,
|
||||
orderList: [],
|
||||
times: '',
|
||||
cutConfig: {
|
||||
@@ -330,15 +218,7 @@ export default {
|
||||
},
|
||||
ISRAList:[],
|
||||
EnergyMonitoringNameList: [],
|
||||
equipmentList: [],
|
||||
EnergyMonitoringList: [],
|
||||
// offsetWidth: null,
|
||||
cxNameList,
|
||||
cxDataList,
|
||||
// time:12,
|
||||
cutProps,
|
||||
// logoutTime: 43200000,
|
||||
cutTableDataList:[],
|
||||
clientWidth: 0,
|
||||
containerWidth: 111111,
|
||||
isFullScreen: false,
|
||||
@@ -385,10 +265,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.fetchList('exception-alarm')
|
||||
// this.fetchList('inAndOutOfEachLine')
|
||||
// this.fetchList('order-process')
|
||||
// this.fetchList('line-chart-data')
|
||||
this.init()
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
@@ -428,25 +304,8 @@ export default {
|
||||
this.beilv2 = _this.clientWidth / 1920
|
||||
})()
|
||||
}
|
||||
// logoutInterval = setInterval(() => {
|
||||
// this.logoutTime -= 1000
|
||||
// }, 1000)
|
||||
// if (this.logoutTime === 0) {
|
||||
// this.SJGInitWebSocket()
|
||||
// this.CutInitWebSocket()
|
||||
// this.funInitWebSocket()
|
||||
// this.logoutTimeReset()
|
||||
// }
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// //离开页面删除检测器和所有侦听器
|
||||
// // erd.uninstall(document); //这里用ref是因为vue离开页面后获取不到dom
|
||||
// removeEventListener('resize', resizeFun)
|
||||
// },
|
||||
methods: {
|
||||
// logoutTimeReset() {
|
||||
// this.logoutTime = this.time * 60 * 60 * 1000
|
||||
// },
|
||||
CutWebsocketClose(e) {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
@@ -457,30 +316,8 @@ export default {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
formatTime(time, option) {
|
||||
// if (('' + time).length === 10) {
|
||||
// time = parseInt(time) * 1000
|
||||
// } else {
|
||||
// time = +time
|
||||
// }
|
||||
console.log(time);
|
||||
const d = new Date(time)
|
||||
// const now = Date.now()
|
||||
// console.log(time);
|
||||
// const diff = (now - d) / 1000
|
||||
|
||||
// if (diff < 30) {
|
||||
// return '刚刚'
|
||||
// } else if (diff < 3600) {
|
||||
// // less 1 hour
|
||||
// return Math.ceil(diff / 60) + '分钟前'
|
||||
// } else if (diff < 3600 * 24) {
|
||||
// return Math.ceil(diff / 3600) + '小时前'
|
||||
// } else if (diff < 3600 * 24 * 2) {
|
||||
// return '1天前'
|
||||
// }
|
||||
// if (option) {
|
||||
// return parseTime(time, option)
|
||||
// } else {
|
||||
return (
|
||||
d.getMonth() +
|
||||
1 +
|
||||
@@ -495,30 +332,6 @@ export default {
|
||||
)
|
||||
// }
|
||||
},
|
||||
// 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);
|
||||
},
|
||||
@@ -618,20 +431,11 @@ export default {
|
||||
let index = 0
|
||||
for (let i in this.funWsData.data.annealFanInfo) {
|
||||
index++,
|
||||
// let index = 1,
|
||||
// index++
|
||||
// arr.push({
|
||||
// equipmentName: i,
|
||||
// status: this.funWsData.data.annealFanInfo[i]
|
||||
// })
|
||||
arr.push([
|
||||
// console.log(item)
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${index || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${i || ''}
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${i || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.funWsData.data.annealFanInfo[i] || ''}</span>`,
|
||||
])
|
||||
@@ -644,23 +448,14 @@ export default {
|
||||
let index = 0
|
||||
for (let i in this.funWsData.data.fanInfo) {
|
||||
index++,
|
||||
// arr.push({
|
||||
// equipmentName: i,
|
||||
// status: this.funWsData.data.fanInfo[i]
|
||||
// })
|
||||
arr.push([
|
||||
// console.log(item)
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${index || ''}</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${i || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${index || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${i || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.funWsData.data.fanInfo[i] || ''}</span>`,
|
||||
])
|
||||
}
|
||||
this.funConfig.data = arr
|
||||
this.$refs['funScrollBoard'].updateRows(arr)
|
||||
// this.funList = arr
|
||||
}
|
||||
},
|
||||
cutWebsocketOnOpen() {
|
||||
@@ -683,27 +478,10 @@ export default {
|
||||
cutWebsocketOnMessage(e) {
|
||||
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) {
|
||||
// return {
|
||||
// id: ele.id,
|
||||
// lineName: ele.lineName,
|
||||
// time: ele.time,
|
||||
// size: this.getSize(ele.size),
|
||||
// productArea: ele.productArea + '㎡',
|
||||
// wasteArea: ele.wasteArea + '㎡',
|
||||
// product: (ele.product * 100).toFixed(2)
|
||||
// }
|
||||
// // }
|
||||
// });
|
||||
let cutArr = this.cutWsData.productHourData.map((item, index) => [
|
||||
// console.log(item)
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
|
||||
`<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
|
||||
`<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.formatTime(item.time) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.getSize(item.size) || ''}</span>`,
|
||||
@@ -746,23 +524,9 @@ export default {
|
||||
},
|
||||
// 数据接收
|
||||
SJGWebsocketOnMessage(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)
|
||||
this.SJGWsData = e?.data ? JSON.parse(e?.data) : {}
|
||||
if (this.SJGWsData.type === 'isra') {
|
||||
console.log('222222', this.SJGWsData.detData);
|
||||
// this.ISRAList = this.SJGWsData.detData.map((ele, index) => {
|
||||
// // if (ele.progressRate != 1) {
|
||||
// return {
|
||||
// id: ele.id,
|
||||
// linename: ele.linename,
|
||||
// type: ele.type,
|
||||
// num: ele.num,
|
||||
// time:ele.time,
|
||||
// percent: ele.percent
|
||||
// }
|
||||
// // }
|
||||
// });
|
||||
console.log('222222', this.SJGWsData.detData)
|
||||
console.log(this.SJGWsData.detData);
|
||||
let chartData = this.SJGWsData.detData.map((item, index) => {
|
||||
return {
|
||||
@@ -770,33 +534,14 @@ export default {
|
||||
num:item.num
|
||||
}
|
||||
})
|
||||
// let ISRAArr = this.SJGWsData.detData.map((item, index) => [
|
||||
// // console.log(item)
|
||||
// `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
// </span>`,
|
||||
// // formatDate(item.planStartTime) || '',
|
||||
// `
|
||||
// <span style="color:rgba(255,255,255,0.5)" >${item.linename || ''}
|
||||
// </span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.time || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.type || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.num || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${(item.percent * 100).toFixed(2) || ''}</span>`,
|
||||
// ])
|
||||
// this.ISRAConfig.data = ISRAArr
|
||||
this.$refs['ISRAChart'].updateChart(chartData)
|
||||
} else if (this.SJGWsData.type === 'equipment') {
|
||||
this.realEqList = this.SJGWsData.detData.map((ele, index) =>[
|
||||
// console.log(item)
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
// `<span style="color:rgba(255,255,255,0.5)" >${item.line || ''}
|
||||
// </span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${ele.name || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${ele.run || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.error || ''}</span>`,
|
||||
])
|
||||
}
|
||||
this.realEqConfig.data = this.realEqList
|
||||
@@ -806,31 +551,6 @@ export default {
|
||||
this.clientWidth = value
|
||||
this.beilv2 = this.clientWidth / 1920
|
||||
},
|
||||
// fetchList(type) {
|
||||
// switch (type) {
|
||||
// case 'order-process':
|
||||
// return axios({
|
||||
// url: '/analysis/factory-monitor/order',
|
||||
// method: 'post'
|
||||
// }).then(res => {
|
||||
// if (res.data) {
|
||||
// this.orderProcessList = res.data
|
||||
// // this.orderProcessList = [
|
||||
// // { id: 1, name: '订单1', outRate: 0.5 },
|
||||
// // { id: 2, name: '订单2', outRate: 0.54 },
|
||||
// // { id: 3, name: '订单3', outRate: 0.45 },
|
||||
// // { id: 4, name: '订单4', outRate: 0.65 },
|
||||
// // { id: 5, name: '订单5', outRate: 0.35 },
|
||||
// // { id: 6, name: '订单6', outRate: 0.15 },
|
||||
// // { id: 7, name: '订单7', outRate: 0.5 },
|
||||
// // { id: 8, name: '订单8', outRate: 0.5 }
|
||||
// // ]
|
||||
// } else {
|
||||
// this.orderProcessList.splice(0)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
change() {
|
||||
this.isFullScreen = screenfull.isFullscreen
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user