Commit 82fda444 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 1f6fb9fa
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
</div> </div>
<div class="map_right"> <div class="map_right">
<div> <div>
<iframe :src="src" ref="iframe"></iframe> //- <iframe :src="src" ref="iframe"></iframe>
<iframe src="http://10.20.174.62:8088/map/index.html" ref="iframe1"></iframe>
</div> </div>
</div> </div>
</el-card> </el-card>
...@@ -157,10 +158,7 @@ export default { ...@@ -157,10 +158,7 @@ export default {
clickItem: {}, clickItem: {},
systemList: [], systemList: [],
stationId: localStorage.getItem('stationId'), stationId: localStorage.getItem('stationId'),
lineId: localStorage.getItem('lineId'),
checkedData: { checkedData: {
lineId: '',
lineName: '',
stationId: '', stationId: '',
stationName: '', stationName: '',
subSystem: '', subSystem: '',
...@@ -280,6 +278,7 @@ export default { ...@@ -280,6 +278,7 @@ export default {
this.resolutions.push(resolutionItem) this.resolutions.push(resolutionItem)
} }
} }
let zoomControl = new Zoom({ let zoomControl = new Zoom({
delta: 0.2, delta: 0.2,
zoomInTipLabel: '', zoomInTipLabel: '',
...@@ -297,7 +296,10 @@ export default { ...@@ -297,7 +296,10 @@ export default {
zoom: 2.5, zoom: 2.5,
maxZoom: 5.0, maxZoom: 5.0,
minZoom: 1.5, minZoom: 1.5,
// extent: [-1100, -200, 1500, 1000] //[minX, minY, maxX, maxY] 控制拖动
extent: [-1100, -100, 2000, 1000] //[minX, minY, maxX, maxY] 控制拖动 extent: [-1100, -100, 2000, 1000] //[minX, minY, maxX, maxY] 控制拖动
//   extent: extent//[minX, minY, maxX, maxY] 控制拖动
}) })
}) })
// 删除默认的双击事件 // 删除默认的双击事件
...@@ -312,6 +314,7 @@ export default { ...@@ -312,6 +314,7 @@ export default {
this.map.addControl(this.controlList[0]) this.map.addControl(this.controlList[0])
//点击事件 //点击事件
this.changeVectorLayer(this.list) this.changeVectorLayer(this.list)
this.map.on('click', function(evt) { this.map.on('click', function(evt) {
...@@ -446,6 +449,7 @@ export default { ...@@ -446,6 +449,7 @@ export default {
this.clearLayer() this.clearLayer()
} }
if (this.clearLayer()) return if (this.clearLayer()) return
this.lineVectorLayer = new OlLayerVector({ this.lineVectorLayer = new OlLayerVector({
source: new OlSourceVector({ source: new OlSourceVector({
features: [] features: []
...@@ -671,18 +675,22 @@ export default { ...@@ -671,18 +675,22 @@ export default {
pointListClick(item) { pointListClick(item) {
//监视器列表点击 //监视器列表点击
//关闭其他窗口 //关闭其他窗口
// this.closeNoQueryDetailVisible()
if (this.transformationSta === 1) { if (this.transformationSta === 1) {
if ( if (
item.type === 'b6af764f2a6e454490a6b1b3c9057e57' || item.type === 'b6af764f2a6e454490a6b1b3c9057e57' ||
item.type === 'ece0b8b2db27411886254e81134988a3' item.type === 'ece0b8b2db27411886254e81134988a3'
) { ) {
// console.log('1')
this.queryDetail(item.id) this.queryDetail(item.id)
} else { } else {
// console.log('2')
this.noQueryDetail(item.id) this.noQueryDetail(item.id)
} }
} }
this.activeChooseResourceBox(item.id) this.activeChooseResourceBox(item.id)
this.defaultExpandedKeys = [item.id] this.defaultExpandedKeys = [item.id]
// this.$refs.tree.setCurrentKey(item.id)
}, },
//初始化站点下的资源点 //初始化站点下的资源点
initTreeStationMap(save) { initTreeStationMap(save) {
...@@ -691,7 +699,6 @@ export default { ...@@ -691,7 +699,6 @@ export default {
if (!save) { if (!save) {
// 摄像头列表接口路径 // 摄像头列表接口路径
url = this.$http.adornUrl('/liResource/getTreeList') url = this.$http.adornUrl('/liResource/getTreeList')
// url = this.$http.adornUrlEq('/liResource/getStationMapCodeTreeList')
} else { } else {
// 收藏夹接口路径 // 收藏夹接口路径
url = this.$http.adornUrlEq('/liEnshrine/getEnshrineStationMapTreeList') url = this.$http.adornUrlEq('/liEnshrine/getEnshrineStationMapTreeList')
...@@ -700,13 +707,13 @@ export default { ...@@ -700,13 +707,13 @@ export default {
url: url, url: url,
method: 'post', method: 'post',
data: { data: {
// stationId: this.checkedData.sId,
name: this.searchInput name: this.searchInput
} }
}) })
.then((data) => { .then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.treeData = data.nodes this.treeData = data.nodes
// this.$refs.tree.updateKeyChildren(this.checkedData.sId, data.nodes)
if (this.treeData && this.treeData.length > 0) { if (this.treeData && this.treeData.length > 0) {
Vue.set(this.treeData[0], 'iconB', true) Vue.set(this.treeData[0], 'iconB', true)
} }
...@@ -720,6 +727,10 @@ export default { ...@@ -720,6 +727,10 @@ export default {
this.treeData.length > 0 this.treeData.length > 0
) { ) {
this.defaultExpandedKeys = [data.nodes[0].id] this.defaultExpandedKeys = [data.nodes[0].id]
//设置选中的节点
// console.log('默认选中节点', this.treeData[0].children[0])
// this.$refs.tree.setCurrentNode(this.treeData[0])
// console.log('this', this)
} }
this.initStation(this.checkedData.sId) this.initStation(this.checkedData.sId)
}) })
...@@ -787,6 +798,7 @@ export default { ...@@ -787,6 +798,7 @@ export default {
this.changeVectorLayer(this.list) this.changeVectorLayer(this.list)
}, },
initStation(id) { initStation(id) {
console.log('22222222222222')
this.$http({ this.$http({
url: this.$http.adornUrl(`/liStation/getId/${id}`), url: this.$http.adornUrl(`/liStation/getId/${id}`),
method: 'get', method: 'get',
...@@ -800,8 +812,6 @@ export default { ...@@ -800,8 +812,6 @@ export default {
this.mapList.forEach((element) => { this.mapList.forEach((element) => {
element.readPath = this.urlPath + element.filePath element.readPath = this.urlPath + element.filePath
}) })
this.checkedData.lineId = this.station.lineId
this.checkedData.lineName = this.station.lineName
this.checkedData.stationId = this.station.id this.checkedData.stationId = this.station.id
this.checkedData.stationName = this.station.stationName this.checkedData.stationName = this.station.stationName
this.checkedData.tierId = !this.mapList[0] this.checkedData.tierId = !this.mapList[0]
...@@ -902,6 +912,27 @@ export default { ...@@ -902,6 +912,27 @@ export default {
}) })
boxFeature.setId(obj.id + 'box') boxFeature.setId(obj.id + 'box')
this.boxVectorLayer.getSource().addFeature(boxFeature) this.boxVectorLayer.getSource().addFeature(boxFeature)
if (this.boxBean) {
let itemList = this.boxBean.children
if (itemList) {
for (let i in itemList) {
// this.setStyle(this.list[parseInt(i)])
}
}
//修改在防区内资源点样式
// if (this.boxBean.resourceIds) {
// let resourceList = this.boxBean.resourceIds.split(',')
// this.addList = resourceList
// for (let i in resourceList) {
// for (let j in this.list) {
// if (resourceList[i] === this.list[j].id) {
// this.setStyle(this.list[j])
// }
// }
// }
// }
}
}, },
//线路资源点树节点点击事件 //线路资源点树节点点击事件
handleNodeClick(node) { handleNodeClick(node) {
...@@ -919,6 +950,9 @@ export default { ...@@ -919,6 +950,9 @@ export default {
status: false status: false
} }
} }
// if (this.activeName == 1) {
// this.isFlag(this.treeData, id)
// }
//每次选择节点都先清空资源位 //每次选择节点都先清空资源位
console.log('选中节点的层级', node) console.log('选中节点的层级', node)
...@@ -982,7 +1016,7 @@ export default { ...@@ -982,7 +1016,7 @@ export default {
}) })
this.changeImgControl(node.tierId) this.changeImgControl(node.tierId)
this.changeVectorLayer(this.list) this.changeVectorLayer(this.list)
} else if (node.level === 6 && !node.isDefence) { } else if (node.level === 6) {
this.map.removeLayer(this.boxVectorLayer) this.map.removeLayer(this.boxVectorLayer)
this.boxBean = [] this.boxBean = []
...@@ -1017,7 +1051,7 @@ export default { ...@@ -1017,7 +1051,7 @@ export default {
this.mapClick(feature, that.list[i], false) this.mapClick(feature, that.list[i], false)
} }
} }
this.checkedData.resourceId = id this.checkedData.resourceId == id
this.checkedData.tierId = node.tierId this.checkedData.tierId = node.tierId
this.activeChooseResourceBox(id) this.activeChooseResourceBox(id)
...@@ -1030,80 +1064,6 @@ export default { ...@@ -1030,80 +1064,6 @@ export default {
// } // }
// console.log('资源点列表:', this.list) // console.log('资源点列表:', this.list)
} else if (node.level === 6 && node.isDefence) {
//防区
//资源点1
var sId = ''
this.systemList.forEach((element) => {
if (node.subCode === element.value) {
sId = element.id
}
})
//资源点
let subNode = this.$refs.tree.getNode(node.tierId + sId).data
// console.log('当前要选中的层级节点', subNode)
this.list = []
subNode.children.forEach((res) => {
this.list.push(res)
})
//资源点1
if (node.children) {
this.list = node.children
}
this.mapList.forEach((res) => {
if (res.id === node.id) {
this.stationMap = res
}
})
this.regionMouse.x = node.xpoint
this.regionMouse.y = node.ypoint
this.regionMouse.w = node.width
this.regionMouse.h = node.height
this.regionMouse.status = true
this.checkedData.tierId = node.tierId
this.changeImgControl(node.tierId)
this.boxBean = node
this.map.removeLayer(this.boxVectorLayer)
this.addBox(node)
this.changeVectorLayer(this.list)
for (let i in this.list) {
that.setStyle(this.list[i])
}
// console.log('资源点列表:', this.list)
} else if (node.level === 7) {
//资源点1
this.checkedData.resourceId = id
this.checkedData.tierId = node.tierId
this.activeChooseResourceBox(id)
this.pointListClick(node)
this.changeImgControl(node.tierId)
this.boxBean = []
let pNode = {
xpoint: node.p_xpoint,
ypoint: node.p_ypoint,
xlongit: node.p_xlongit,
ylat: node.p_ylat
}
this.map.removeLayer(this.boxVectorLayer)
this.addBox(pNode)
let list = this.$refs.tree.getNode(node.pid).data
this.changeVectorLayer(list.children)
let feature = this.vectorLayer.getSource().getFeatureById(id)
if (feature) {
for (let i in this.list) {
if (feature.id_ == that.list[i].id) {
this.listItem = that.list[i]
}
//flag为ture打开详情或者编辑页面
this.mapClick(feature, that.list[i], false)
}
}
// console.log('资源点列表:', this.list)
// if (this.transformationSta == 2) {
this.sendMessage(node.lineId, node.stationId, node.code)
// }
} }
this.iconNameListBottom.forEach((res) => { this.iconNameListBottom.forEach((res) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment