|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<div class="main" @click.ctrl="handleClickAdd">
|
|
<div class="main" @click.ctrl="handleClickAdd">
|
|
<img :src="imgUrl" width="1920px" alt="">
|
|
<img :src="imgUrl" width="1920px" alt="">
|
|
- <div class="icon" style="right:20px">
|
|
|
|
|
|
+ <!-- <div class="icon" style="right:20px">
|
|
<a-button type="primary" icon="appstore" size="large" @click="visibleRight=true" />
|
|
<a-button type="primary" icon="appstore" size="large" @click="visibleRight=true" />
|
|
- </div>
|
|
|
|
|
|
+ </div>-->
|
|
<div v-if="dotList !=null && dotList.length>0">
|
|
<div v-if="dotList !=null && dotList.length>0">
|
|
<div v-for="item in dotList" :key="item.id">
|
|
<div v-for="item in dotList" :key="item.id">
|
|
<VueDragResize
|
|
<VueDragResize
|
|
@@ -50,7 +50,7 @@
|
|
</VueDragResize>
|
|
</VueDragResize>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <a-drawer
|
|
|
|
|
|
+ <!-- <a-drawer
|
|
title="点位配置"
|
|
title="点位配置"
|
|
placement="right"
|
|
placement="right"
|
|
:closable="false"
|
|
:closable="false"
|
|
@@ -85,7 +85,12 @@
|
|
<a-button v-show="!record.positionFlag" type="link" icon="eye" @click="handleShow(record,1)" />
|
|
<a-button v-show="!record.positionFlag" type="link" icon="eye" @click="handleShow(record,1)" />
|
|
</span>
|
|
</span>
|
|
</a-table>
|
|
</a-table>
|
|
- </a-drawer>
|
|
|
|
|
|
+ </a-drawer>-->
|
|
|
|
+ <div>
|
|
|
|
+ <a-button-group>
|
|
|
|
+ <a-button v-for="item in list" :key="item.id" :disabled="positionId===item.id" @click="getOpcInfo(item.id)">{{ item.name }}</a-button>
|
|
|
|
+ </a-button-group>
|
|
|
|
+ </div>
|
|
<BaseChartInfo ref="baseChartInfo" @ok="handleOk"/>
|
|
<BaseChartInfo ref="baseChartInfo" @ok="handleOk"/>
|
|
<BaseForm ref="baseForm" @ok="handleOk"/>
|
|
<BaseForm ref="baseForm" @ok="handleOk"/>
|
|
|
|
|
|
@@ -94,7 +99,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import VueDragResize from 'vue-drag-resize'
|
|
import VueDragResize from 'vue-drag-resize'
|
|
-import { getSbPositionTree, fetchSbPosition } from '@/api/sb/position'
|
|
|
|
|
|
+import { getSbPositionTree, fetchSbPosition, querySbPosition } from '@/api/sb/position'
|
|
import { queryRemoteOpc, updateRemoteOpc } from '@/api/remote/opc'
|
|
import { queryRemoteOpc, updateRemoteOpc } from '@/api/remote/opc'
|
|
import BaseChartInfo from './modules/BaseChartInfo.vue'
|
|
import BaseChartInfo from './modules/BaseChartInfo.vue'
|
|
import BaseForm from '@/views/remote/opc/modules/BaseForm.vue'
|
|
import BaseForm from '@/views/remote/opc/modules/BaseForm.vue'
|
|
@@ -104,14 +109,17 @@ export default {
|
|
VueDragResize,
|
|
VueDragResize,
|
|
BaseChartInfo,
|
|
BaseChartInfo,
|
|
BaseForm
|
|
BaseForm
|
|
-
|
|
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
visibleRight: false,
|
|
visibleRight: false,
|
|
|
|
+ parentId: '',
|
|
positionId: '',
|
|
positionId: '',
|
|
treeData: [],
|
|
treeData: [],
|
|
|
|
+ list: [],
|
|
|
|
+ visible: false,
|
|
optDot: null,
|
|
optDot: null,
|
|
|
|
+ positionName: '',
|
|
imgUrl: '',
|
|
imgUrl: '',
|
|
dotList: [],
|
|
dotList: [],
|
|
columns: [
|
|
columns: [
|
|
@@ -129,11 +137,10 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
|
|
+ this.parentId = this.$route.query.parentId
|
|
this.positionId = this.$route.query.line
|
|
this.positionId = this.$route.query.line
|
|
this.setTree()
|
|
this.setTree()
|
|
- if (this.positionId || this.positionId !== '') {
|
|
|
|
- this.getOpcInfo()
|
|
|
|
- }
|
|
|
|
|
|
+ this.getOpcInfo(this.positionId)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
resize (newRect) {
|
|
resize (newRect) {
|
|
@@ -181,9 +188,11 @@ export default {
|
|
handleShow (val, key) {
|
|
handleShow (val, key) {
|
|
val.positionFlag = key
|
|
val.positionFlag = key
|
|
},
|
|
},
|
|
- getOpcInfo () {
|
|
|
|
|
|
+ getOpcInfo (positionId) {
|
|
|
|
+ this.positionId = positionId
|
|
fetchSbPosition({ id: this.positionId }).then(res => {
|
|
fetchSbPosition({ id: this.positionId }).then(res => {
|
|
this.imgUrl = res.data.opcImg
|
|
this.imgUrl = res.data.opcImg
|
|
|
|
+ this.positionName = res.data.name
|
|
console.log(this.imgUrl)
|
|
console.log(this.imgUrl)
|
|
})
|
|
})
|
|
queryRemoteOpc({ line: this.positionId })
|
|
queryRemoteOpc({ line: this.positionId })
|
|
@@ -195,6 +204,9 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
setTree (record = {}) {
|
|
setTree (record = {}) {
|
|
|
|
+ querySbPosition({ parentId: this.parentId }).then(res => {
|
|
|
|
+ this.list = res.data
|
|
|
|
+ })
|
|
getSbPositionTree({ opcFlag: 1 }).then(res => {
|
|
getSbPositionTree({ opcFlag: 1 }).then(res => {
|
|
this.treeData = res.data
|
|
this.treeData = res.data
|
|
})
|
|
})
|
|
@@ -222,8 +234,17 @@ export default {
|
|
imgYposition: e.y + 50
|
|
imgYposition: e.y + 50
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ afterVisibleChange (val) {
|
|
|
|
+ console.log('visible', val)
|
|
|
|
+ },
|
|
|
|
+ showDrawer () {
|
|
|
|
+ this.visible = true
|
|
|
|
+ },
|
|
|
|
+ onClose () {
|
|
|
|
+ this.visible = false
|
|
|
|
+ },
|
|
handleOk () {
|
|
handleOk () {
|
|
- this.getOpcInfo()
|
|
|
|
|
|
+ this.getOpcInfo(this.positionId)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|