Commit d05988c2 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 9d873711
...@@ -135,8 +135,6 @@ export default { ...@@ -135,8 +135,6 @@ export default {
resource: {}, //当前选择的资源点 resource: {}, //当前选择的资源点
typeList: [], typeList: [],
checkedData: { checkedData: {
lineId: '',
lineName: '',
stationId: '', stationId: '',
stationName: '', stationName: '',
tierId: '', tierId: '',
...@@ -798,6 +796,7 @@ export default { ...@@ -798,6 +796,7 @@ export default {
return data.name.indexOf(value) !== -1 return data.name.indexOf(value) !== -1
}, },
initTree() { initTree() {
this.treeData = []
// console.log('stationId:', this.checkedData.sId) // console.log('stationId:', this.checkedData.sId)
this.$http({ this.$http({
url: this.$http.adornUrl('/liResource/getTreeList'), url: this.$http.adornUrl('/liResource/getTreeList'),
...@@ -831,35 +830,28 @@ export default { ...@@ -831,35 +830,28 @@ export default {
this.initStation(this.treeData[0].id, null, 1) this.initStation(this.treeData[0].id, null, 1)
} else { } else {
//层级 //层级
let mapid = this.tierMap.tierId
if (this.tierMap.level === 4) { if (this.tierMap.level === 4) {
this.currentNode = this.$refs.tree.getNode(this.tierMap.id).data this.showResourceByParentId(this.tierMap.id)
this.initStation(this.tierMap.stationId, null, this.tierMap.id) mapid = this.tierMap.id
} }
if (this.tierMap.level === 5) { if (this.tierMap.level === 5) {
this.currentNode = this.$refs.tree.getNode(this.tierMap.id).data this.showResourceByParentId(this.tierMap.id)
this.initStation(
this.tierMap.stationId,
this.tierMap.children,
this.tierMap.id
)
} }
if (this.tierMap.level === 6) { if (this.tierMap.level === 6) {
this.currentNode = this.$refs.tree.getNode(this.tierMap.id).data this.showResourceByParentId(
let res = this.$refs.tree.getNode(
this.tierMap.tierId + this.tierMap.type
).data
this.initStation(
this.tierMap.stationId,
res.children,
this.tierMap.tierId + this.tierMap.type this.tierMap.tierId + this.tierMap.type
) )
} }
this.changeVectorLayer(this.list)
//将选中的层级树节点设置为选中 //将选中的层级树节点设置为选中
this.$refs.tree.setCurrentNode(this.treeData[0].children[0]) console.log('tierMap:---', this.tierMap)
Vue.set(this.tierMap, 'iconB', true) let curNode = this.$refs.tree.getNode(mapid).data
this.defaultExpandedKeys = [this.currentNode.id] this.$refs.tree.setCurrentNode(curNode)
this.isFlag(this.treeData, this.currentNode.id) this.defaultExpandedKeys = [curNode.id]
this.isFlag(this.treeData, curNode.id)
this.changeImgControl(curNode.id)
} }
}) })
} }
...@@ -924,19 +916,17 @@ export default { ...@@ -924,19 +916,17 @@ 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.mapList[0].id this.checkedData.tierId = !this.mapList[0] ? '' : this.mapList[0].id
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
} }
}) })
} }
// this.defaultExpandedKeys = [this.checkedData.tierId] // this.defaultExpandedKeys = [this.checkedData.tierId]
if (res) { if (res) {
...@@ -969,22 +959,6 @@ export default { ...@@ -969,22 +959,6 @@ export default {
} else { } else {
this.changeVectorLayer(this.list) this.changeVectorLayer(this.list)
} }
//将选中的层级树节点设置为选中
this.$refs.tree.setCurrentNode(this.currentNode)
Vue.set(this.currentNode, 'iconB', true)
this.defaultExpandedKeys = [this.currentNode.id]
this.isFlag(this.treeData, this.currentNode.id)
if (this.currentNode.level === 4) {
this.currentMap = this.mapList.filter(e => e.stationId === this.currentNode.stationId)
this.checkedData.tierId = this.currentNode.id
} else if (this.currentNode.level === 5) {
this.currentMap = this.mapList.filter(e => e.stationId === this.currentNode.stationId)
this.checkedData.tierId = this.currentNode.tierId
} else if (this.currentNode.level === 6) {
console.log(this.mapList)
this.currentMap = this.mapList.filter(e => e.stationId === this.currentNode.stationId)
this.checkedData.tierId = this.currentNode.tierId
}
}) })
}, },
...@@ -1051,11 +1025,7 @@ export default { ...@@ -1051,11 +1025,7 @@ export default {
// this.list = [] // this.list = []
this.listItem = '' //控制编辑按钮 this.listItem = '' //控制编辑按钮
} }
if (level === 2) { if (level === 3) {
//线路
this.checkedData.lineId = id
this.checkedData.lineName = name
} else if (level === 3) {
//站点 //站点
// this.checkedData.stationId = id // this.checkedData.stationId = id
// this.checkedData.stationName = name // this.checkedData.stationName = name
......
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