Commit 566e6760 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

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