Revert "Revert "rev:系统配置,设备监控""

This reverts commit ff22772908.
This commit is contained in:
jiaoliming
2023-09-01 10:25:31 +08:00
parent ff22772908
commit 53c8103546
19 changed files with 1184 additions and 548 deletions

View File

@@ -166,7 +166,7 @@ import deviceCrud from '@/api/acs/device/device'
import { getDeviceByCodes } from '@/api/acs/device/deviceStageMonitor'
import '@logicflow/core/dist/style/index.css'
import '@logicflow/extension/lib/style/index.css'
import {isEqual} from "lodash"
import { isEqual } from 'lodash'
import { LogicFlow } from '@logicflow/core'
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
@@ -726,58 +726,58 @@ export default {
} else if (val === 'barcodeArr') {
const obj = { name: '码垛条码', value: data[val] }
this.arr.push(obj)
}else if (val==='robotCode'){
} else if (val === 'robotCode') {
const obj = { name: '编码', value: data[val] }
this.arr.push(obj)
}else if (val==='robotTypeCode'){
} else if (val === 'robotTypeCode') {
const obj = { name: '型号', value: data[val] }
this.arr.push(obj)
}else if (val==='pointCode'){
} else if (val === 'pointCode') {
const obj = { name: '节点编码', value: data[val] }
this.arr.push(obj)
}else if (val==='positionX'){
} else if (val === 'positionX') {
const obj = { name: '坐标x', value: data[val] }
this.arr.push(obj)
}else if (val==='positionY'){
} else if (val === 'positionY') {
const obj = { name: '坐标y', value: data[val] }
this.arr.push(obj)
}else if (val==='theta'){
} else if (val === 'theta') {
const obj = { name: '⻆度', value: data[val] }
this.arr.push(obj)
}else if (val==='forkHeight'){
} else if (val === 'forkHeight') {
const obj = { name: '货叉⾼度', value: data[val] }
this.arr.push(obj)
}else if (val==='forkLength'){
} else if (val === 'forkLength') {
const obj = { name: '货叉⻓度', value: data[val] }
this.arr.push(obj)
}else if (val==='forkTheta'){
} else if (val === 'forkTheta') {
const obj = { name: '货叉相对机器⼈⻆度', value: data[val] }
this.arr.push(obj)
}else if (val==='stationCode'){
} else if (val === 'stationCode') {
const obj = { name: '⼯作站编码', value: data[val] }
this.arr.push(obj)
}else if (val==='locationCode'){
} else if (val === 'locationCode') {
const obj = { name: '⼯作位编码', value: data[val] }
this.arr.push(obj)
}else if (val==='state'){
} else if (val === 'state') {
const obj = { name: '机器⼈状态', value: data[val] }
this.arr.push(obj)
}else if (val==='hardwareState'){
} else if (val === 'hardwareState') {
const obj = { name: '机器⼈硬件状态', value: data[val] }
this.arr.push(obj)
}else if (val==='trays'){
} else if (val === 'trays') {
const obj = { name: '背篓描述', value: data[val] }
this.arr.push(obj)
}else if (val==='trayLevel'){
} else if (val === 'trayLevel') {
const obj = { name: '背篓序号', value: data[val] }
this.arr.push(obj)
}else if (val==='containerCode'){
} else if (val === 'containerCode') {
const obj = { name: '容器编码', value: data[val] }
this.arr.push(obj)
}else if (val==='taskCodes'){
} else if (val === 'taskCodes') {
const obj = { name: '业务任务', value: data[val] }
this.arr.push(obj)
}else if (val==='positionCode'){
} else if (val === 'positionCode') {
const obj = { name: '位置编码', value: data[val] }
this.arr.push(obj)
}
@@ -789,17 +789,17 @@ export default {
let resion = {}
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, device_code: item.properties.device }))
getDeviceByCodes(resion).then(res => {
let startTime=new Date().getTime();
let arr=[];
let obj={};
if(window.lastArr){
res.forEach(i=>{
obj[i.id]=i
const startTime = new Date().getTime()
const arr = []
const obj = {}
if (window.lastArr) {
res.forEach(i => {
obj[i.id] = i
})
window.lastArr.forEach(old=>{
let _new=obj[old.id];
if(!isEqual(old,_new)){
window.lastArr.forEach(old => {
const _new = obj[old.id]
if (!isEqual(old, _new)) {
arr.push(_new)
}
})
@@ -809,8 +809,7 @@ export default {
// console.log('initStatus-res', res)
// 实时设置状态信息
for (var item of arr) { // 循环并且设置属性值
let temp={}
const temp = {}
if (item.data !== undefined) {
if (item.data.isOnline !== undefined) {
temp.isOnline = item.data.isOnline
@@ -830,7 +829,7 @@ export default {
// isError: item.data.isError
// })
}
lf.setProperties(item.id , temp)
lf.setProperties(item.id, temp)
}
}
window.lastArr = res
@@ -840,9 +839,9 @@ export default {
if (nodes.length === 1) { // 因为是定时器,没有选中则不用实时更新显示数据
this.moveShow(nodes[0]) // 监控模式下不可能托选,因此就只有一个数据
}
let endTime=new Date().getTime();
const endTime = new Date().getTime()
console.log("time:",endTime - startTime)
console.log('time:', endTime - startTime)
})
},
dialogSave() {