Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
Z
zhxf_vue
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
葛齐林
zhxf_vue
Commits
435ba9ff
Commit
435ba9ff
authored
May 13, 2021
by
xiexingan
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
ec0ade93
b925dddc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
147 deletions
+65
-147
index.vue
src/pages/ol/demo/index.vue
+44
-86
index.vue
src/pages/sys/point/index.vue
+21
-61
No files found.
src/pages/ol/demo/index.vue
View file @
435ba9ff
...
...
@@ -156,7 +156,7 @@ export default {
stationMap
:
{},
//当前选择的层
resource
:
{},
//当前选择的资源点
clickItem
:
{},
system
List
:
[],
resourceType
List
:
[],
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,7 +809,7 @@ 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
=>
{
this
.
currentMap
=
this
.
mapList
.
filter
(
(
e
)
=>
{
if
(
this
.
treeData
[
0
].
children
[
0
].
stationId
==
e
.
stationId
)
{
return
e
}
...
...
@@ -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,24 +1124,11 @@ 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
{
tierNode
.
children
.
forEach
((
type
)
=>
{
type
.
children
.
forEach
((
res
)
=>
{
if
(
item
===
null
||
(
item
!=
null
&&
item
.
id
===
res
.
type
))
{
this
.
list
.
push
(
res
)
}
}
})
})
}
...
...
src/pages/sys/point/index.vue
View file @
435ba9ff
...
...
@@ -121,7 +121,6 @@ export default {
queryDetailVisible
:
false
,
urlPath
:
window
.
CONFIG
.
urlPath
,
treeData
:
[],
systemList
:
[],
defaultExpandedKeys
:
[],
defaultProps
:
{
children
:
'children'
,
...
...
@@ -140,8 +139,6 @@ export default {
lineName
:
''
,
stationId
:
''
,
stationName
:
''
,
subCode
:
''
,
subSystem
:
''
,
tierId
:
''
,
tierName
:
''
,
resourceId
:
''
,
...
...
@@ -188,7 +185,6 @@ export default {
that
=
this
this
.
initTree
()
this
.
initResourceTypeDicList
()
this
.
initSubSystemDicList
()
// this.getDataList()
},
mounted
()
{
...
...
@@ -778,8 +774,6 @@ export default {
remark
:
''
,
stationId
:
this
.
checkedData
.
stationId
,
stationName
:
this
.
checkedData
.
stationName
,
subCode
:
this
.
checkedData
.
subCode
,
subSystem
:
this
.
checkedData
.
subSystem
,
tierId
:
this
.
checkedData
.
tierId
,
tierName
:
this
.
checkedData
.
tierName
,
type
:
item
.
id
,
...
...
@@ -852,18 +846,13 @@ export default {
if
(
this
.
tierMap
.
level
===
6
)
{
this
.
currentNode
=
this
.
$refs
.
tree
.
getNode
(
this
.
tierMap
.
id
).
data
let
sysId
=
''
this
.
systemList
.
forEach
((
element
)
=>
{
if
(
this
.
tierMap
.
subCode
===
element
.
value
)
{
sysId
=
element
.
id
}
})
let
res
=
this
.
$refs
.
tree
.
getNode
(
this
.
tierMap
.
tierId
+
sysId
)
.
data
let
res
=
this
.
$refs
.
tree
.
getNode
(
this
.
tierMap
.
tierId
+
this
.
tierMap
.
type
).
data
this
.
initStation
(
this
.
tierMap
.
stationId
,
res
.
children
,
this
.
tierMap
.
tierId
+
sysId
this
.
tierMap
.
tierId
+
this
.
tierMap
.
type
)
}
//将选中的层级树节点设置为选中
...
...
@@ -904,10 +893,8 @@ export default {
// },
initTreeResource
(
node
)
{
let
data
=
{
lineId
:
this
.
checkedData
.
lineId
,
stationId
:
this
.
checkedData
.
stationId
,
tierId
:
this
.
checkedData
.
tierId
,
subCode
:
this
.
checkedData
.
subCode
tierId
:
this
.
checkedData
.
tierId
}
// console.log('初始化线路树请求参数:', data)
this
.
$http
({
...
...
@@ -1069,7 +1056,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
...
...
@@ -1084,9 +1071,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
this
.
checkedData
.
tierId
=
node
.
tierId
...
...
@@ -1108,19 +1093,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
...
...
@@ -1203,8 +1183,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
)
}
...
...
@@ -1216,13 +1196,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
)
})
})
...
...
@@ -1292,20 +1272,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
)
...
...
@@ -1790,19 +1763,6 @@ export default {
this
.
clickItem
=
item
this
.
changeVectorLayer
(
this
.
list
)
},
initSubSystemDicList
()
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/sysDictionary/getSubSystemDicList'
),
method
:
'get'
,
params
:
this
.
$http
.
adornParams
({
stationId
:
localStorage
.
getItem
(
'stationId'
)
})
}).
then
((
data
)
=>
{
if
(
data
&&
data
.
code
===
0
)
{
this
.
systemList
=
data
.
list
}
})
},
initResourceTypeDicList
()
{
this
.
$http
({
url
:
this
.
$http
.
adornUrl
(
'/sysDictionary/getResourceTypeDicList'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment