Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pudong-elevator-map
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
郭铭瑶
pudong-elevator-map
Commits
487a0780
Commit
487a0780
authored
Oct 19, 2020
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加按小区检索(测试)
parent
809a74a0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25632 additions
and
8 deletions
+25632
-8
tangqiao.js
src/mock/tangqiao.js
+1
-1
yangjing.js
src/mock/yangjing.js
+25
-0
main.vue
src/views/main.vue
+22
-5
tangqiao-building.json
static/mock/tangqiao-building.json
+1
-1
yangjing-building.json
static/mock/yangjing-building.json
+25583
-1
No files found.
src/mock/tangqiao.js
View file @
487a0780
...
@@ -252,7 +252,7 @@ export default {
...
@@ -252,7 +252,7 @@ export default {
[
121.522611
,
31.213471
]
[
121.522611
,
31.213471
]
]
]
},
{
},
{
name
:
'
兰
高小区'
,
name
:
'
蓝
高小区'
,
address
:
'蓝村路60弄3-29号'
,
address
:
'蓝村路60弄3-29号'
,
level
:
3
,
level
:
3
,
location
:
[
121.531587
,
31.210669
],
location
:
[
121.531587
,
31.210669
],
...
...
src/mock/yangjing.js
View file @
487a0780
...
@@ -651,6 +651,31 @@ export default {
...
@@ -651,6 +651,31 @@ export default {
[
121.553082
,
31.246488
],
[
121.553082
,
31.246488
],
[
121.552659
,
31.246203
]
[
121.552659
,
31.246203
]
]
]
},
{
'name'
:
'阳光二村'
,
'address'
:
'栖山路400弄1-29号'
,
'level'
:
2
,
'location'
:
[
121.551121
,
31.24577
],
'path'
:
[
[
121.550387
,
31.244868
],
[
121.549787
,
31.245432
],
[
121.55088
,
31.246705
],
[
121.551085
,
31.246812
],
[
121.551153
,
31.24681
],
[
121.551467
,
31.246656
],
[
121.551594
,
31.246606
],
[
121.551804
,
31.246517
],
[
121.55214
,
31.246369
],
[
121.552242
,
31.246315
],
[
121.552396
,
31.246224
],
[
121.552286
,
31.246078
],
[
121.551841
,
31.245526
],
[
121.552029
,
31.245387
],
[
121.551896
,
31.24525
],
[
121.551481
,
31.244696
],
[
121.550675
,
31.245224
],
[
121.550387
,
31.244868
],
]
},
{
},
{
'name'
:
'桃林一小区'
,
'name'
:
'桃林一小区'
,
'address'
:
'灵山路600弄1-44号'
,
'address'
:
'灵山路600弄1-44号'
,
...
...
src/views/main.vue
View file @
487a0780
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<Panel
v-for=
"street in streetList"
:key=
"street"
:name=
"street"
>
<Panel
v-for=
"street in streetList"
:key=
"street"
:name=
"street"
>
{{
curStreetData
.
name
}}
小区列表
{{
curStreetData
.
name
}}
小区列表
<div
slot=
"content"
class=
"community-list"
>
<div
slot=
"content"
class=
"community-list"
>
<div
v-for=
"(item, i) in cur
StreetData.c
ommunity"
:key=
"item.name + i"
>
<div
v-for=
"(item, i) in cur
C
ommunity"
:key=
"item.name + i"
>
<Button
<Button
@
click=
"handleView(item)"
@
click=
"handleView(item)"
size=
"small"
size=
"small"
...
@@ -299,6 +299,7 @@ export default {
...
@@ -299,6 +299,7 @@ export default {
this
.
highlightArea
(
streetData
)
this
.
highlightArea
(
streetData
)
},
},
highlightArea
(
area
)
{
// 高亮区域
highlightArea
(
area
)
{
// 高亮区域
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
community
)
return
if
(
!
area
.
path
||
area
.
path
<=
0
)
return
if
(
!
area
.
path
||
area
.
path
<=
0
)
return
if
(
this
.
curStreetPolygon
)
{
// 先清除已存在的高亮区域
if
(
this
.
curStreetPolygon
)
{
// 先清除已存在的高亮区域
this
.
map
.
clearMap
()
this
.
map
.
clearMap
()
...
@@ -326,7 +327,7 @@ export default {
...
@@ -326,7 +327,7 @@ export default {
},
},
initLayers
()
{
// 配置地图图层信息
initLayers
()
{
// 配置地图图层信息
if
(
!
this
.
curStreetData
.
name
)
return
if
(
!
this
.
curStreetData
.
name
)
return
const
communityList
=
[...
this
.
cur
StreetData
.
community
,
...
this
.
buildingData
.
community
]
const
communityList
=
[...
this
.
cur
Community
,
...
this
.
curBuildingData
]
const
buildingOptions
=
{
const
buildingOptions
=
{
areas
:
communityList
.
map
(
community
=>
{
areas
:
communityList
.
map
(
community
=>
{
if
(
community
.
type
!=
'building'
)
{
if
(
community
.
type
!=
'building'
)
{
...
@@ -461,7 +462,7 @@ export default {
...
@@ -461,7 +462,7 @@ export default {
const
buildingName
=
item
.
name
&&
(
item
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
const
buildingName
=
item
.
name
&&
(
item
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
if
(
buildingName
.
indexOf
(
name
)
<
0
&&
(
item
.
buildingNo
+
''
).
indexOf
(
name
)
<
0
)
return
// (筛选出点击的小区的楼栋)楼栋的小区名和name一致则往下走
if
(
buildingName
.
indexOf
(
name
)
<
0
&&
(
item
.
buildingNo
+
''
).
indexOf
(
name
)
<
0
)
return
// (筛选出点击的小区的楼栋)楼栋的小区名和name一致则往下走
// const curObj = buildingDatas.find(e => e.unitAddr.indexOf(item.buildingNo) >= 0 || item.buildingNo.indexOf(e.unitAddr) >= 0) // 查找出返回数据中的同一幢楼栋数据
// const curObj = buildingDatas.find(e => e.unitAddr.indexOf(item.buildingNo) >= 0 || item.buildingNo.indexOf(e.unitAddr) >= 0) // 查找出返回数据中的同一幢楼栋数据
const
curObj
=
buildingDatas
.
find
(
e
=>
e
.
unitNo
.
indexOf
(
item
.
buildingNo
)
>=
0
||
item
.
buildingNo
.
indexOf
(
e
.
unitNo
)
>=
0
)
// 查找出返回数据中的同一幢楼栋数据
const
curObj
=
buildingDatas
.
find
(
e
=>
e
.
unitNo
.
indexOf
(
item
.
buildingNo
+
''
)
>=
0
||
(
item
.
buildingNo
+
''
)
.
indexOf
(
e
.
unitNo
)
>=
0
)
// 查找出返回数据中的同一幢楼栋数据
if
(
!
curObj
)
return
if
(
!
curObj
)
return
if
(
curObj
.
ratio
<
0.25
)
return
if
(
curObj
.
ratio
<
0.25
)
return
...
@@ -551,6 +552,20 @@ export default {
...
@@ -551,6 +552,20 @@ export default {
tableHeight
()
{
tableHeight
()
{
return
screen
.
height
/
2
return
screen
.
height
/
2
},
},
curCommunity
()
{
// 小区列表大致颜色
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
community
)
{
const
{
community
}
=
this
.
$route
.
query
return
[...
this
.
curStreetData
.
community
].
filter
(
item
=>
item
.
name
.
indexOf
(
community
)
>=
0
||
community
.
indexOf
(
item
.
name
)
>=
0
)
}
return
[...
this
.
curStreetData
.
community
]
},
curBuildingData
()
{
// 附加的自描的楼栋
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
community
)
{
const
{
community
}
=
this
.
$route
.
query
return
[...
this
.
buildingData
.
community
].
filter
(
item
=>
item
.
name
.
indexOf
(
community
)
>=
0
||
community
.
indexOf
(
item
.
name
)
>=
0
)
}
return
[...
this
.
buildingData
.
community
]
},
},
},
watch
:
{
watch
:
{
async
curStreet
(
cur
)
{
// 监控转换后的路由街镇名来获取匹配数据
async
curStreet
(
cur
)
{
// 监控转换后的路由街镇名来获取匹配数据
...
@@ -561,11 +576,13 @@ export default {
...
@@ -561,11 +576,13 @@ export default {
building
:
[],
building
:
[],
}
}
this
.
initLayers
()
this
.
initLayers
()
const
communityList
=
[...
this
.
curStreetData
.
community
]
this
.
curCommunity
.
forEach
(
item
=>
{
communityList
.
forEach
(
item
=>
{
this
.
addMarker
(
item
.
name
)
this
.
addMarker
(
item
.
name
)
})
})
this
.
addSpecialMarker
()
// TODO 是否先清除之前的?
this
.
addSpecialMarker
()
// TODO 是否先清除之前的?
if
(
this
.
$route
.
query
&&
this
.
$route
.
query
.
community
)
{
// 如果有输入小区名则直接聚焦该小区
this
.
handleView
(
this
.
curCommunity
[
0
])
}
}
}
}
}
}
}
...
...
static/mock/tangqiao-building.json
View file @
487a0780
This diff is collapsed.
Click to expand it.
static/mock/yangjing-building.json
View file @
487a0780
This diff is collapsed.
Click to expand it.
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