Commit 566e6760 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent ce75b3d7
......@@ -156,7 +156,7 @@ export default {
stationMap: {}, //当前选择的层
resource: {}, //当前选择的资源点
clickItem: {},
systemList: [],
resourceTypeList: [],
stationId: localStorage.getItem('stationId'),
checkedData: {
stationId: '',
......@@ -219,7 +219,6 @@ export default {
that = this
this.initTreeStationMap()
this.initResourceTypeDicList()
this.initSubSystemDicList()
},
methods: {
// 初始化地图
......@@ -732,17 +731,6 @@ export default {
this.initStation(this.checkedData.sId)
})
},
initSubSystemDicList() {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getSubSystemDicList'),
method: 'get',
params: {}
}).then((data) => {
if (data && data.code === 0) {
this.systemList = data.list
}
})
},
initResourceTypeDicList() {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getResourceTypeDicList'),
......@@ -750,6 +738,7 @@ export default {
params: {}
}).then((data) => {
if (data && data.code === 0) {
this.resourceTypeList = data.list
this.iconNameListBottom = JSON.parse(JSON.stringify(data.list))
this.iconNameListBottom.forEach((res) => {
res.value += '3'
......@@ -774,10 +763,7 @@ export default {
}
})
if (
this.currentNode.level == 5 ||
(this.currentNode.level == 6 && this.currentNode.isDefence)
) {
if (this.currentNode.level == 5) {
this.list = []
this.currentNode.children.forEach((el) => {
if (item === null || (item != null && item.id === el.type)) {
......@@ -823,11 +809,11 @@ export default {
this.isFlag(this.treeData, this.checkedData.tierId)
if (this.treeData) {
this.$refs.tree.setCurrentNode(this.treeData[0].children[0])
this.currentMap = this.mapList.filter(e => {
if (this.treeData[0].children[0].stationId == e.stationId) {
return e
}
})
this.currentMap = this.mapList.filter((e) => {
if (this.treeData[0].children[0].stationId == e.stationId) {
return e
}
})
this.defaultExpandedKeys = [this.checkedData.tierId]
this.checkedData.tierName = this.mapList[0].name
this.stationMap = this.mapList[0]
......@@ -847,18 +833,18 @@ export default {
this.changeVectorLayer(this.list)
}
console.log('tierName:', this.checkedData.tierName)
if (
this.checkedData.tierId &&
this.checkedData.tierName &&
(this.checkedData.tierName.indexOf('站台') != -1 ||
this.checkedData.tierName.indexOf('站厅') != -1)
) {
if (this.checkedData.tierName.indexOf('站台') != -1) {
this.sendMessage(this.lineId, this.stationId, null, 2)
} else if (this.checkedData.tierName.indexOf('站厅') != -1) {
this.sendMessage(this.lineId, this.stationId, null, 3)
}
}
// if (
// this.checkedData.tierId &&
// this.checkedData.tierName &&
// (this.checkedData.tierName.indexOf('站台') != -1 ||
// this.checkedData.tierName.indexOf('站厅') != -1)
// ) {
// if (this.checkedData.tierName.indexOf('站台') != -1) {
// this.sendMessage(this.lineId, this.stationId, null, 2)
// } else if (this.checkedData.tierName.indexOf('站厅') != -1) {
// this.sendMessage(this.lineId, this.stationId, null, 3)
// }
// }
})
},
isFlag(data, id) {
......@@ -962,7 +948,7 @@ export default {
console.log('选中节点的层级', node)
if (node.level === 3) {
//切换根节点
this.currentMap = this.mapList.filter(e => e.stationId === id)
this.currentMap = this.mapList.filter((e) => e.stationId === id)
this.changeMap(this.currentMap[0])
} else if (node.level === 4) {
this.map.removeLayer(this.boxVectorLayer)
......@@ -983,19 +969,11 @@ export default {
this.boxBean = []
//子系统
//设备类型
this.list = []
if (node.children) {
node.children.forEach((res) => {
if (res.level === 6 && res.isDefence) {
if (res.children) {
res.children.forEach((element) => {
this.list.push(element)
})
}
} else {
this.list = node.children
}
this.list.push(res)
})
}
......@@ -1016,20 +994,13 @@ export default {
this.boxBean = []
//资源点1
var sysId = ''
this.systemList.forEach((element) => {
if (node.subCode === element.value) {
sysId = element.id
}
})
//资源点
// let subNode = this.$refs.tree.getNode(node.tierId + sysId).data
let subNode = this.$refs.tree.getNode(node.tierId + node.type).data
// console.log('当前要选中的层级节点', subNode)
// this.list = []
// subNode.children.forEach((res) => {
// this.list.push(res)
// })
this.list = []
subNode.children.forEach((res) => {
this.list.push(res)
})
this.list.forEach((res) => {
Vue.set(res, 'active', false)
})
......@@ -1097,18 +1068,18 @@ export default {
},
//切换层级
changeMap(map) {
if (
this.checkedData.tierId &&
this.checkedData.tierName &&
(this.checkedData.tierName.indexOf('站台') != -1 ||
this.checkedData.tierName.indexOf('站厅') != -1)
) {
if (this.checkedData.tierName.indexOf('站台') != -1) {
this.sendMessage(this.lineId, this.stationId, null, 2)
} else if (this.checkedData.tierName.indexOf('站厅') != -1) {
this.sendMessage(this.lineId, this.stationId, null, 3)
}
}
// if (
// this.checkedData.tierId &&
// this.checkedData.tierName &&
// (this.checkedData.tierName.indexOf('站台') != -1 ||
// this.checkedData.tierName.indexOf('站厅') != -1)
// ) {
// if (this.checkedData.tierName.indexOf('站台') != -1) {
// this.sendMessage(this.lineId, this.stationId, null, 2)
// } else if (this.checkedData.tierName.indexOf('站厅') != -1) {
// this.sendMessage(this.lineId, this.stationId, null, 3)
// }
// }
this.map.removeLayer(this.boxVectorLayer)
......@@ -1153,23 +1124,10 @@ export default {
//this.list = tierNode.children[0].children || []
if (tierNode && tierNode.children) {
tierNode.children.forEach((subSystem) => {
subSystem.children.forEach((res) => {
if (res.level === 6 && res.isDefence) {
if (res.children) {
res.children.forEach((element) => {
if (
item === null ||
(item != null && item.id === element.type)
) {
this.list.push(element)
}
})
}
} else {
if (item === null || (item != null && item.id === res.type)) {
this.list.push(res)
}
tierNode.children.forEach((type) => {
type.children.forEach((res) => {
if (item === null || (item != null && item.id === res.type)) {
this.list.push(res)
}
})
})
......
......@@ -930,7 +930,7 @@ export default {
})
.then((data) => {
if (data && data.code === 0) {
// this.station = data.bean
// this.station = data.bean
this.station = data.list[0]
this.mapList = data.mapList
......@@ -945,11 +945,11 @@ export default {
this.isFlag(this.treeData, this.checkedData.tierId)
if (this.treeData) {
this.$refs.tree.setCurrentNode(this.treeData[0].children[0])
this.currentMap = this.mapList.filter(e => {
if (this.treeData[0].children[0].stationId === e.stationId) {
return e
}
})
this.currentMap = this.mapList.filter((e) => {
if (this.treeData[0].children[0].stationId === e.stationId) {
return e
}
})
}
// this.defaultExpandedKeys = [this.checkedData.tierId]
if (res) {
......@@ -1058,7 +1058,7 @@ export default {
// this.checkedData.stationName = name
// this.initTreeStationMap(node)
//切换根节点
this.currentMap = this.mapList.filter(e => e.stationId === id)
this.currentMap = this.mapList.filter((e) => e.stationId === id)
this.changeMap(this.currentMap[0])
} else if (level === 4) {
this.tierMap = node
......@@ -1073,7 +1073,7 @@ export default {
this.changeImgControl(id)
} else if (level === 5) {
this.tierMap = node
//子系统
//设备类型
this.checkedData.subCode = code
this.checkedData.subSystem = name
this.checkedData.stationId = node.stationId
......@@ -1097,19 +1097,14 @@ export default {
this.changeImgControl(node.tierId)
} else if (level === 6) {
this.tierMap = node
var sysId = ''
this.systemList.forEach((element) => {
if (node.subCode === element.value) {
sysId = element.id
}
})
// // 资源点
// let subNode = this.$refs.tree.getNode(node.tierId + sysId).data
// // console.log('当前要选中的层级节点', subNode)
// this.list = []
// subNode.children.forEach((res) => {
// this.list.push(res)
// })
let subNode = this.$refs.tree.getNode(node.tierId + node.type).data
// console.log('当前要选中的层级节点', subNode)
this.list = []
subNode.children.forEach((res) => {
this.list.push(res)
})
this.checkedData.resourceId = id
this.checkedData.tierId = node.tierId
......@@ -1192,8 +1187,8 @@ export default {
let tierNode = this.$refs.tree.getNode(this.checkedData.tierId).data
// console.log('当前要选中的层级节点', tierNode.children)
this.list = []
tierNode.children.forEach((subSystem) => {
subSystem.children.forEach((res) => {
tierNode.children.forEach((type) => {
type.children.forEach((res) => {
if (item === null || (item != null && item.id === res.type)) {
this.list.push(res)
}
......@@ -1205,13 +1200,13 @@ export default {
})
// console.log(this.list, '++++++')
},
//根据子系统id展示子系统id所有的资源点
//根据资源点类型id展示下面所有的资源点
showResourceByParentId(id) {
let node = this.$refs.tree.getNode(id).data
this.list = []
if (node.level === 4) {
node.children.forEach((subSystem) => {
subSystem.children.forEach((res) => {
node.children.forEach((type) => {
type.children.forEach((res) => {
this.list.push(res)
})
})
......@@ -1281,20 +1276,13 @@ export default {
//console.log('初始化线路树:', this.treeData)
//console.log(res, '++++++++++')
var sysId = ''
this.systemList.forEach((element) => {
if (res.subCode === element.value) {
sysId = element.id
}
})
var subId = ''
this.treeData.forEach((e) => {
if (res.stationId === e.id) {
e.children.forEach((el) => {
if (el.id === res.tierId) {
el.children.forEach((element) => {
if (element.id === res.tierId + sysId) {
if (element.id === res.tierId + res.type) {
subId = element.id
Vue.set(element, 'iconB', true)
this.$refs.tree.setCurrentNode(element)
......
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