projects/mesxc-zjl #167

Merged
juzi merged 2 commits from projects/mesxc-zjl into projects/mesxc-test 2024-01-03 14:13:12 +08:00
10 changed files with 232 additions and 265 deletions
Showing only changes of commit da2999e67c - Show all commits

View File

@ -13,7 +13,11 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.49:48082'
@ -26,7 +30,7 @@ VUE_APP_TITLE = MES系统
VUE_APP_BASE_API = 'http://100.64.0.23:48082' VUE_APP_BASE_API = 'http://100.64.0.23:48082'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' VUE_APP_JIMU_API = 'http://10.70.2.22:8080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -15,11 +15,11 @@ VUE_APP_TITLE = MES系统
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://10.70.2.22:8080' VUE_APP_JIMU_API = 'http://10.70.2.2:8080'
# 根据服务器或域名修改 # 根据服务器或域名修改
PUBLIC_PATH = 'http://10.70.2.32' PUBLIC_PATH = ''
# 二级部署路径 # 二级部署路径
# VUE_APP_APP_NAME ='yudao-admin' # VUE_APP_APP_NAME ='yudao-admin'

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-28 11:52:08 * @LastEditTime: 2023-12-29 16:41:18
* @Description: * @Description:
--> -->
<template> <template>
@ -83,10 +83,14 @@
<top-radio-group /> <top-radio-group />
</div> --> </div> -->
<!-- 像下面这样表格里的limit值也许可以用js动态计算出来 --> <!-- 像下面这样表格里的limit值也许可以用js动态计算出来 -->
<el-col :span="12"> <el-col :span="6">
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringProps" <base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringPropsFun"
:table-data="funList" /> :table-data="funList" />
</el-col> </el-col>
<el-col :span="6">
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringPropsFun"
:table-data="annealFunList" />
</el-col>
<el-col :span="12" style="float: right;"> <el-col :span="12" style="float: right;">
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringProps" <base-table1 :page="1" :limit="9" :show-index="false" :table-config="EqMonitoringProps"
:table-data="realEqList" /> :table-data="realEqList" />
@ -132,9 +136,15 @@ 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= []
const EqMonitoringPropsFun = [
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'status', label: '运行状态', width: 80}
]
const EqMonitoringProps = [ const EqMonitoringProps = [
{ prop: 'productLine', label: '产线' }, { prop: 'productLine', label: '产线' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
@ -152,12 +162,15 @@ const EqMonitoringProps = [
}, },
] ]
const cutProps = [ const cutProps = [
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线', width: 50 },
{ prop: 'time', label: '时间' }, {
prop: 'time', label: '时间',
filter: parseTime
},
{ prop: 'size', label: '规格' }, { prop: 'size', label: '规格' },
{ prop: 'productArea', label: '良品面积' }, { prop: 'productArea', label: '良品面积', width: 80 },
{ prop: 'wasteArea', label: '废片面积' }, { prop: 'wasteArea', label: '废片面积', width: 80 },
{ prop: 'product', label: '良品率' }, { prop: 'product', label: '良品率', width: 80 },
] ]
const cxNameList = ['周一', '周二', '周三', '周四', '周五'] const cxNameList = ['周一', '周二', '周三', '周四', '周五']
@ -241,6 +254,7 @@ export default {
beilv: 1, beilv: 1,
value: 100, value: 100,
EqMonitoringProps, EqMonitoringProps,
EqMonitoringPropsFun,
realEqList:[], realEqList:[],
qualityYearTableProps, qualityYearTableProps,
ISRATableProps, ISRATableProps,
@ -258,9 +272,13 @@ export default {
clientWidth: 0, clientWidth: 0,
containerWidth: 111111, containerWidth: 111111,
isFullScreen: false, isFullScreen: false,
cutWsData: {},
funWsData: {},
SJGWsData: {},
// orderProcessList: [], // orderProcessList: [],
dateType: '0', dateType: '0',
funList:[], funList:[],
annealFunList: [],
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -303,7 +321,10 @@ export default {
this.init() this.init()
}, },
mounted() { mounted() {
this.initWebSocket() this.funInitWebSocket()
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
@ -326,7 +347,6 @@ export default {
// this.beilv2 = window.innerWidth / 1920 // this.beilv2 = window.innerWidth / 1920
// }) // })
// erd.listenTo(document, (element) => { // erd.listenTo(document, (element) => {
// console.log(element.offsetWidth)
// this.beilv2 = element.offsetWidth / 1920 // this.beilv2 = element.offsetWidth / 1920
// // var width = element.offsetWidth; // // var width = element.offsetWidth;
@ -344,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 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) // let obj = JSON.parse(data)
// console.log('data', obj.data.FanFrequencyInfo)
// // for() // // for()
// let arr = [] // let arr = []
// for (let i in obj.data.FanFrequencyInfo) { // for (let i in obj.data.FanFrequencyInfo) {
@ -353,13 +372,12 @@ 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(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;
@ -389,15 +407,14 @@ export default {
// //
this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
}, },
initWebSocket() { SJGInitWebSocket() {
if (typeof (WebSocket) === 'undefined') { if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket') alert('您的浏览器不支持WebSocket')
} else { } else {
// const wsUrl = 'ws://192.168.1.74:48080/websocket/message?userId=EN111' // const wsUrl = 'ws://192.168.1.74:48080/websocket/message?userId=EN111'
// 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://10.70.2.2:8080/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
@ -407,7 +424,16 @@ 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()
const cutWsUrl = `ws://10.70.2.2:8080/websocket/message?userId=CUTTING${date}`
this.cutWebsocket = new WebSocket(cutWsUrl) this.cutWebsocket = new WebSocket(cutWsUrl)
// WebSocket // WebSocket
@ -418,6 +444,15 @@ export default {
this.cutWebsocket.onmessage = this.cutWebsocketOnMessage this.cutWebsocket.onmessage = this.cutWebsocketOnMessage
// webSocket // webSocket
this.cutWebsocket.onclose = this.cutWebsocketClose this.cutWebsocket.onclose = this.cutWebsocketClose
}
},
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.180.10:8081/xc-screen/websocket/${date}` const funWsUrl = `ws://10.70.180.10:8081/xc-screen/websocket/${date}`
this.funWebsocket = new WebSocket(funWsUrl) this.funWebsocket = new WebSocket(funWsUrl)
// WebSocket // WebSocket
@ -428,64 +463,54 @@ export default {
this.funWebsocket.onmessage = this.funWebsocketOnMessage this.funWebsocket.onmessage = this.funWebsocketOnMessage
// webSocket // webSocket
this.funWebsocket.onclose = this.funWebsocketClose this.funWebsocket.onclose = this.funWebsocketClose
// const wsUrl = 'ws://192.168.0.33:48082/websocket/message?userId=EN111'
// WebSocket
// this.websocket = new WebSocket(wsUrl)
// // WebSocket
// this.websocket.onopen = this.websocketOnOpen
// // WebSocket
// this.websocket.onerror = this.websocketOnError
// // WebSocket
// this.websocket.onmessage = this.websocketOnMessage
// // webSocket
// this.websocket.onclose = this.websocketClose
} }
}, },
funWebsocketOnOpen() { funWebsocketOnOpen() {
console.log('socket连接成功') console.log('socket连接成功')
// console.log(this.SJGWebsocket.onmessage);
this.SJGWebsocket.onmessage() this.SJGWebsocket.onmessage()
}, },
// //
funWebsocketOnError(e) { funWebsocketOnError(e) {
console.log('222222', e) this.funInitWebSocket()
this.initWebSocket()
}, },
// //
funWebsocketOnMessage(e) { funWebsocketOnMessage(e) {
// console.log(1111, e) this.funWsData = e?.data ? JSON.parse(e?.data) : {}
// console.log(this.wsData) // FanInfo
// console.log('22222', this.wsData.data) if (this.funWsData.type === 'AnnealFanInfo') {
this.wsData = JSON.parse(e.data) let arr = []
if (this.wsData.type === 'FanFrequencyInfo') { for (let i in this.funWsData.data.annealFanInfo) {
// let arr = [] arr.push({
// for (let i in this.wsData.FanFrequencyInfo) { equipmentName: i,
// arr.push({ status: this.funWsData.data.annealFanInfo[i]
// equipmentName: i, })
// status: obj.data.FanFrequencyInfo[i] }
// }) this.annealFunList = arr
// } }
// this.funList = arr if (this.funWsData.type === 'FanInfo') {
let arr = []
for (let i in this.funWsData.data.fanInfo) {
arr.push({
equipmentName: i,
status: this.funWsData.data.fanInfo[i]
})
}
this.funList = arr
} }
}, },
cutWebsocketOnOpen() { cutWebsocketOnOpen() {
console.log('socket连接成功') console.log('socket连接成功')
// console.log(this.SJGWebsocket.onmessage);
this.SJGWebsocket.onmessage() this.SJGWebsocket.onmessage()
}, },
// //
cutWebsocketOnError(e) { cutWebsocketOnError(e) {
console.log('11111', e) this.CutInitWebSocket()
this.initWebSocket()
}, },
// //
cutWebsocketOnMessage(e) { cutWebsocketOnMessage(e) {
// console.log(1111, e) this.cutWsData = e?.data ? JSON.parse(e?.data) : {}
this.wsData = JSON.parse(e.data) if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') {
console.log(this.wsData) this.cutTableDataList = this.cutWsData.productHourData.map((ele, index) => {
// console.log('22222', this.wsData.data)
if (this.wsData.type === 'cutting' && this.wsData.name === 'table' ) {
this.cutTableDataList = this.wsData.productHourData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -494,13 +519,12 @@ export default {
size: ele.size, size: ele.size,
productArea: ele.productArea + '㎡', productArea: ele.productArea + '㎡',
wasteArea: ele.wasteArea + '㎡', 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') {
} else if (this.wsData.type === 'cutting' && this.wsData.name === 'chart') {
let nameList = [] let nameList = []
let nameWasteList = [] let nameWasteList = []
let topNameList = [] let topNameList = []
@ -508,41 +532,35 @@ export default {
let wasteList = [] let wasteList = []
let sumAreaList = [] let sumAreaList = []
let yieldList = [] let yieldList = []
this.cutTableDataList = this.wsData.detData.forEach((ele, index) => { // this.cutTableDataList =
this.cutWsData.coldDetData.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 *100).toFixed(3))
}) })
this.$refs.pileChart.initChart(nameList, topNameList, nameWasteList, productList, wasteList) this.$refs.pileChart.initChart(nameList, topNameList, nameWasteList, productList, wasteList)
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList) this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
// this.$refs.pileChart.initWebSocket
// console.log(this.orderList)
} }
}, },
SJGWebsocketOnOpen() { SJGWebsocketOnOpen() {
console.log('socket连接成功') console.log('socket连接成功')
// console.log(this.SJGWebsocket.onmessage);
this.SJGWebsocket.onmessage() this.SJGWebsocket.onmessage()
}, },
// //
SJGWebsocketOnError(e) { SJGWebsocketOnError(e) {
console.log('11111', e) this.SJGInitWebSocket()
this.initWebSocket()
}, },
// //
SJGWebsocketOnMessage(e) { 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 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); this.SJGWsData = e?.data ? JSON.parse(e?.data) : {}
this.wsData = JSON.parse(e.data) if (this.SJGWsData.type === 'isra') {
console.log(this.wsData) this.ISRAList = this.SJGWsData.detData.map((ele, index) => {
// console.log('22222', this.wsData.data)
if (this.wsData.type === 'isra') {
this.ISRAList = this.wsData.detData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -554,66 +572,8 @@ export default {
} }
// } // }
}); });
// 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

@ -18,7 +18,7 @@
<el-table-column <el-table-column
prop="_pageIndex" prop="_pageIndex"
label="序号" label="序号"
:width="70" :width="50"
align="center" align="center"
/> />
<el-table-column <el-table-column

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-27 18:28:45 * @LastEditTime: 2023-12-29 16:18:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -60,7 +60,6 @@ export default {
data() { data() {
return { return {
chart: null, chart: null,
nameList: [],
series: [{ series: [{
type: 'bar', type: 'bar',
data: [], data: [],
@ -138,7 +137,7 @@ export default {
} }
}, },
grid: { grid: {
left: "3%", left: "4%",
right: "4%", right: "4%",
bottom: "3%", bottom: "3%",
width: 'auto', width: 'auto',
@ -227,7 +226,7 @@ export default {
}, },
scale: true, scale: true,
type: 'value', type: 'value',
name: '产量/', // y name: '产量/', // y
nameTextStyle: {// y nameTextStyle: {// y
color: '#fff' color: '#fff'
}, },

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-27 19:47:27 * @LastEditTime: 2023-12-29 16:28:26
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -93,54 +93,50 @@ 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: '成品面积', {
type: 'bar', //
stack: 'total', name: '良品',
// label: { type: 'bar',
// show: true stack: 'total',
// }, // silent: true,
emphasis: { // itemStyle: {
focus: 'series' color: '#0fdedb',
// },
barWidth: 10,
data: passRateList
}, },
data: passRateList, {
itemStyle: { type: 'bar',
normal: { color: '#2359ec' } stack: 'total',
name: '废品',
data: wasteList,
barWidth: 10,
// barWidth: 15,
// label: {
// position: [10, 10],
// normal: {
// position: [800, -24],
// show: true,
// textStyle: {
// color: '#2359ec',
// fontSize: 16,
// },
// },
// },
} }
}, ]
{
name: '废片面积',
type: 'bar',
stack: 'total',
// label: {
// show: true
// },
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({
tooltip: { legend: {
trigger: 'axis', textStyle: {
axisPointer: { color: '#ffffff'
// 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%',
@ -149,73 +145,38 @@ 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,
data: yAxisDataLeft, splitLine: {
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,
}
} }
}, },
//offset: 30, data: topNameList
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
}
}, },
{ {
inverse: false, type: 'category',
data: yAxisDataRight, inverse: true,
axisLabel: {
inside: true,
textStyle: {
color: '#ffffff',
fontSize: 12,
align: 'right',
},
formatter: '{value}\n{a|占位}\n{a|占位}',
rich: {
a: {
color: 'transparent',
lineHeight: 24,
fontFamily: 'digital'
}
}
},
offset: 0,
splitLine: { splitLine: {
show: false show: false
}, },
@ -224,10 +185,29 @@ export default {
}, },
axisLine: { axisLine: {
show: false show: false
} },
axisLabel: {
show: true,
inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: {
color: '#ffffff',
verticalAlign: 'bottom',
fontSize: 12,
align: 'right',
padding: [0, 0, 15, -5]
}
},
data: nameWasteList
} }
], ],
series: series xAxis: {
// 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-28 10:22:06 * @LastEditTime: 2023-12-29 15:15:50
* @Description: * @Description:
--> -->
<template> <template>
@ -557,6 +557,7 @@ 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
@ -597,14 +598,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
}) })
}, },
@ -636,21 +637,10 @@ export default {
if (typeof (WebSocket) === 'undefined') { if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket') alert('您的浏览器不支持WebSocket')
} else { } else {
const wsUrl = `ws://192.168.0.33:48082/websocket/message?userId=EN${date}` const wsUrl = `ws://10.70.2.2:8080/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 wsUrl = 'ws://10.70.2.2:8080/websocket/message?userId=EN111'
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'
// WebSocket // WebSocket
this.websocket = new WebSocket(wsUrl) this.websocket = new WebSocket(wsUrl)
// WebSocket // WebSocket
@ -663,6 +653,26 @@ export default {
this.websocket.onclose = this.websocketClose this.websocket.onclose = this.websocketClose
} }
}, },
SJGInitWebSocket() {
if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持WebSocket')
} else {
// const wsUrl = `ws://10.70.2.2:8080/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://10.70.2.2:8080/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);
@ -671,16 +681,16 @@ export default {
// //
SJGWebsocketOnError(e) { SJGWebsocketOnError(e) {
// console.log('11111', e) // console.log('11111', e)
this.initWebSocket() this.SJGInitWebSocket()
}, },
// //
SJGWebsocketOnMessage(e) { SJGWebsocketOnMessage(e) {
// console.log(1111, e) // console.log(1111, e)
this.wsData = JSON.parse(e.data) this.SJGWsData = 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.wsData.type === 'order') { if (this.SJGWsData.type === 'order') {
this.orderList = this.wsData.detData.map((ele, index) => { this.orderList = this.SJGWsData.detData.map((ele, index) => {
if (ele.progressRate != 1) { if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -690,8 +700,8 @@ export default {
} }
}); });
console.log(this.orderList) console.log(this.orderList)
} else if (this.wsData.type === 'equipment') { } else if (this.SJGWsData.type === 'equipment') {
this.equipmentList = this.wsData.detData.map((ele, index) => { this.equipmentList = this.SJGWsData.detData.map((ele, index) => {
// if (ele.progressRate != 1) { // if (ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
@ -702,16 +712,16 @@ export default {
} }
// } // }
}); });
// console.log(this.orderList) // console.log(SJGWsData.orderList)
} else if (this.wsData.type === 'productline') { } else if (this.SJGWsData.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.wsData.detData.forEach((ele) => { this.SJGWsData.detData.forEach((ele) => {
if (item.id == ele.productionLineId) { if (item.id == ele.productionLineId) {
nameList.push(item.name) nameList.push(item.name)
} }
@ -720,11 +730,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.wsData.detData.forEach((ele) => { this.SJGWsData.detData.forEach((ele) => {
passRateList.push(ele.passRate *100 passRateList.push(ele.passRate *100
) )
}) })
this.wsData.detData.forEach((ele) => { this.SJGWsData.detData.forEach((ele) => {
outputNumList.push(ele.outputNum outputNumList.push(ele.outputNum
) )
}) })

View File

@ -47,7 +47,7 @@
向世界先进水平挑战为人类社会文明做贡献 向世界先进水平挑战为人类社会文明做贡献
</p> </p>
</div> </div>
<video <!-- <video
src="/static/videos/login.webm" src="/static/videos/login.webm"
muted muted
autoplay autoplay
@ -58,7 +58,7 @@
top: 28%; top: 28%;
width: 100%; width: 100%;
height: 70%; height: 70%;
"></video> "></video> -->
</div> </div>
<!-- 表单 --> <!-- 表单 -->
<div class="field"> <div class="field">

View File

@ -170,7 +170,12 @@ export default {
{ width: 256, prop: 'code', label: '设备编码' }, { width: 256, prop: 'code', label: '设备编码' },
{ prop: 'location', label: '位置' }, { prop: 'location', label: '位置' },
{ prop: 'responsiblePeopleName', label: '负责人' }, { prop: 'responsiblePeopleName', label: '负责人' },
{ prop: 'dueTime', label: '有效期至' }, {
prop: 'dueDate',
label: '有效期至',
filter: (val) =>
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '--',
},
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -250,8 +255,8 @@ export default {
[ [
{ {
datetime: true, datetime: true,
label: '有效期', label: '有效期',
prop: 'dueTime', prop: 'dueDate',
bind: { clearable: true }, bind: { clearable: true },
}, },
{}, {},

View File

@ -195,18 +195,21 @@ export default {
{ id: 3, name: '特种设备' }, { id: 3, name: '特种设备' },
], ],
filterable: true, filterable: true,
defaultSelect: null
}, },
{ {
type: 'select', type: 'select',
label: '设备', label: '设备',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
defaultSelect: null
}, },
{ {
type: 'select', type: 'select',
label: '计划名称', label: '计划名称',
placeholder: '请选择计划名称', placeholder: '请选择计划名称',
param: 'maintainPlanId', param: 'maintainPlanId',
defaultSelect: null
}, },
// //
{ {
@ -220,6 +223,7 @@ export default {
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'startTime', param: 'startTime',
defaultSelect: null
// width: 350, // width: 350,
}, },
{ {
@ -229,6 +233,7 @@ export default {
{ name: '是', id: 1 }, { name: '是', id: 1 },
{ name: '否', id: 2 }, { name: '否', id: 2 },
], ],
defaultSelect: null,
param: 'relatePlan', param: 'relatePlan',
}, },
{ {
@ -434,12 +439,16 @@ export default {
created() { created() {
this.initSearchBar(); this.initSearchBar();
if (this.$route.query) { if (this.$route.query) {
this.queryParams.specialType =
this.$route.query?.specialType ?? undefined;
this.queryParams.equipmentId = this.queryParams.equipmentId =
this.$route.query?.equipmentId ?? undefined; this.$route.query?.equipmentId ?? undefined;
this.queryParams.maintainPlanId = this.queryParams.maintainPlanId =
this.$route.query?.maintainPlanId ?? undefined; this.$route.query?.maintainPlanId ?? undefined;
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined; this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
this.queryParams.startTime = this.$route.query?.createTime ?? undefined; this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[0].defaultSelect =
this.$route.query.specialType ?? undefined;
this.searchBarFormConfig[1].defaultSelect = this.searchBarFormConfig[1].defaultSelect =
this.$route.query.equipmentId ?? undefined; this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[2].defaultSelect = this.searchBarFormConfig[2].defaultSelect =