|
@@ -103,7 +103,7 @@ import VueDragResize from 'vue-drag-resize'
|
|
|
import { getSbPositionTree, fetchSbPosition, querySbPosition } from '@/api/sb/position'
|
|
|
import {
|
|
|
updateRemoteOpc,
|
|
|
- fetchRemoteOpc, queryRemoteOpcFromRedis
|
|
|
+ fetchRemoteOpc, queryRemoteOpc, queryRemoteOpcFromRedis
|
|
|
} from '@/api/remote/opc'
|
|
|
import Detail from '@/views/remote/opc/modules/Detail.vue'
|
|
|
import DetailLog from '@/views/remote/opc-log/modules/Detail.vue'
|
|
@@ -151,7 +151,7 @@ export default {
|
|
|
this.treeData = res.data
|
|
|
})
|
|
|
this.timer = setInterval(() => {
|
|
|
- this.getOpcInfo(this.positionId)
|
|
|
+ this.getOpcInfoFromRedis(this.positionId)
|
|
|
}, 5000)
|
|
|
},
|
|
|
destroyed () {
|
|
@@ -186,7 +186,7 @@ export default {
|
|
|
},
|
|
|
getOpcInfo (positionId) {
|
|
|
this.positionId = positionId
|
|
|
- queryRemoteOpcFromRedis({ line: this.positionId })
|
|
|
+ queryRemoteOpc({ line: this.positionId })
|
|
|
.then((res) => {
|
|
|
this.dotList = res.data
|
|
|
this.dotList.forEach(item => {
|
|
@@ -198,6 +198,22 @@ export default {
|
|
|
})
|
|
|
this.getImg()
|
|
|
},
|
|
|
+ getOpcInfoFromRedis (positionId) {
|
|
|
+ this.positionId = positionId
|
|
|
+ queryRemoteOpcFromRedis({ line: this.positionId })
|
|
|
+ .then((res) => {
|
|
|
+ this.dotList = res.data
|
|
|
+ this.dotList.forEach(item => {
|
|
|
+ item.isActive = false
|
|
|
+ res.data.forEach(data => {
|
|
|
+ if (item.positionNum === data.positionNum) {
|
|
|
+ item.result = data.result
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.getImg()
|
|
|
+ },
|
|
|
getImg () {
|
|
|
fetchSbPosition({ id: this.positionId }).then(res => {
|
|
|
this.imgUrl = res.data.opcImg
|