Commit 27406560 authored by xiexingan's avatar xiexingan

tj

parent 5537fbfc
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
div(slot='header' ref="sprtDom" ) div(slot='header' ref="sprtDom" )
el-row(:span="24") el-row(:span="24")
el-col(:md='12' :sm="5" class='tier-btn') el-col(:md='12' :sm="5" class='tier-btn')
el-button(type="primary" size='mini' plain :class="[checkedData.tierId===item.id?'active-tier':'']" style="float:left;margin:6px 10px 0 0; " v-for="item in mapList" :key='item.id' @click="changeMap(item)") {{item.name}} el-button(type="primary" size='mini' plain :class="[checkedData.tierId===item.id?'active-tier':'']" style="float:left;margin:6px 10px 0 0; " v-for="item in currentMap" :key='item.id' @click="changeMap(item)") {{item.name}}
//- el-col(:md='12' :sm="5") //- el-col(:md='12' :sm="5")
//- div(style="float:right;") //- div(style="float:right;")
//- div( :class="item.value" :title="item.name" style="margin:5px 5px 0 0;" v-for="item in iconNameListBottom" @click="iconClick(item)") //- div( :class="item.value" :title="item.name" style="margin:5px 5px 0 0;" v-for="item in iconNameListBottom" @click="iconClick(item)")
...@@ -131,6 +131,7 @@ export default { ...@@ -131,6 +131,7 @@ export default {
nodeKey: 'id', nodeKey: 'id',
station: {}, //当前选择的站点 station: {}, //当前选择的站点
mapList: [], //当前站点的所有层 mapList: [], //当前站点的所有层
currentMap: [],
stationMap: {}, //当前选择的层 stationMap: {}, //当前选择的层
resource: {}, //当前选择的资源点 resource: {}, //当前选择的资源点
typeList: [], typeList: [],
...@@ -220,7 +221,7 @@ export default { ...@@ -220,7 +221,7 @@ export default {
this.addInteraction() this.addInteraction()
}, },
// 初始化地图 // 初始化地图
initMap(url) { initMap() {
let mapList = this.mapList let mapList = this.mapList
// 计算静态地图映射到地图上的范围 // 计算静态地图映射到地图上的范围
let extent = [-1100, 110, 1460, 820] let extent = [-1100, 110, 1460, 820]
...@@ -922,15 +923,16 @@ export default { ...@@ -922,15 +923,16 @@ export default {
initStation(id, res, subId) { initStation(id, res, subId) {
// console.log('初始化站点id:', id) // console.log('初始化站点id:', id)
this.$http({ this.$http({
url: this.$http.adornUrl(`/liStation/getId/${id}`), url: this.$http.adornUrl(`/liStation/list`),
method: 'get', method: 'post',
params: this.$http.adornParams() data: {}
}) })
.then((data) => { .then((data) => {
if (data && data.code === 0) { if (data && data.code === 0) {
if (data.bean) { // this.station = data.bean
this.station = data.bean this.station = data.list[0]
this.mapList = data.bean.mapList
this.mapList = data.mapList
this.mapList.forEach((element) => { this.mapList.forEach((element) => {
element.readPath = this.urlPath + element.filePath element.readPath = this.urlPath + element.filePath
}) })
...@@ -938,10 +940,16 @@ export default { ...@@ -938,10 +940,16 @@ export default {
this.checkedData.lineName = this.station.lineName 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.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.checkedData.tierId = this.mapList[0].id
// this.isFlag(this.treeData, this.checkedData.tierId)
// this.$refs.tree.setCurrentNode(this.treeData[0].children[0])
// this.defaultExpandedKeys = [this.checkedData.tierId] // this.defaultExpandedKeys = [this.checkedData.tierId]
if (res) { if (res) {
this.mapList.forEach((e) => { this.mapList.forEach((e) => {
...@@ -1045,9 +1053,12 @@ export default { ...@@ -1045,9 +1053,12 @@ export default {
this.checkedData.lineName = name this.checkedData.lineName = name
} else if (level === 3) { } else if (level === 3) {
//站点 //站点
this.checkedData.stationId = id // this.checkedData.stationId = id
this.checkedData.stationName = name // this.checkedData.stationName = name
// this.initTreeStationMap(node) // this.initTreeStationMap(node)
//切换根节点
this.currentMap = this.mapList.filter(e => e.stationId === id)
this.changeMap(this.currentMap[0])
} else if (level === 4) { } else if (level === 4) {
this.tierMap = node this.tierMap = node
//层级 //层级
...@@ -1091,13 +1102,13 @@ export default { ...@@ -1091,13 +1102,13 @@ export default {
sysId = element.id sysId = element.id
} }
}) })
// 资源点 // // 资源点
let subNode = this.$refs.tree.getNode(node.tierId + sysId).data // let subNode = this.$refs.tree.getNode(node.tierId + sysId).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
......
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