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
a2ace9c3
Commit
a2ace9c3
authored
Apr 28, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
4590423c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
38 deletions
+48
-38
main.js
src/main.js
+2
-1
common.js
src/util/common.js
+4
-5
main.vue
src/views/main.vue
+42
-32
No files found.
src/main.js
View file @
a2ace9c3
...
@@ -6,7 +6,7 @@ import App from './App'
...
@@ -6,7 +6,7 @@ import App from './App'
import
router
from
'./router'
import
router
from
'./router'
import
common
from
'./util/common'
import
common
from
'./util/common'
import
api
from
'./util/api'
import
api
from
'./util/api'
import
{
Button
,
Collapse
,
Panel
,
Modal
,
Table
,
Drawer
,
Tabs
,
TabPane
}
from
'view-design'
import
{
Button
,
Collapse
,
Panel
,
Modal
,
Table
,
Drawer
,
Tabs
,
TabPane
,
Spin
}
from
'view-design'
import
'view-design/dist/styles/iview.css'
import
'view-design/dist/styles/iview.css'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
...
@@ -20,6 +20,7 @@ Vue.component('Table', Table)
...
@@ -20,6 +20,7 @@ Vue.component('Table', Table)
Vue
.
component
(
'Drawer'
,
Drawer
)
Vue
.
component
(
'Drawer'
,
Drawer
)
Vue
.
component
(
'Tabs'
,
Tabs
)
Vue
.
component
(
'Tabs'
,
Tabs
)
Vue
.
component
(
'TabPane'
,
TabPane
)
Vue
.
component
(
'TabPane'
,
TabPane
)
Vue
.
component
(
'Spin'
,
Spin
)
/* eslint-disable no-new */
/* eslint-disable no-new */
new
Vue
({
new
Vue
({
el
:
'#app'
,
el
:
'#app'
,
...
...
src/util/common.js
View file @
a2ace9c3
...
@@ -30,11 +30,10 @@ export default{
...
@@ -30,11 +30,10 @@ export default{
if
(
color
.
indexOf
(
'黄'
)
>=
0
)
return
{
'background-color'
:
'gold'
}
if
(
color
.
indexOf
(
'黄'
)
>=
0
)
return
{
'background-color'
:
'gold'
}
if
(
color
.
indexOf
(
'红'
)
>=
0
)
return
{
'background-color'
:
'red'
}
if
(
color
.
indexOf
(
'红'
)
>=
0
)
return
{
'background-color'
:
'red'
}
},
},
switchStarNum
(
intention
)
{
switchStarNum
(
val
)
{
if
(
!
intention
)
return
0
if
(
!+
val
)
return
0
if
(
intention
.
indexOf
(
'一'
)
>=
0
)
return
1
if
(
+
val
>
3
)
return
3
if
(
intention
.
indexOf
(
'二'
)
>=
0
||
intention
.
indexOf
(
'两'
)
>=
0
)
return
2
return
+
val
if
(
intention
.
indexOf
(
'三'
)
>=
0
)
return
3
},
},
switchStatus
(
status
)
{
switchStatus
(
status
)
{
status
=
Number
(
status
)
status
=
Number
(
status
)
...
...
src/views/main.vue
View file @
a2ace9c3
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
<div>
<div>
<p
class=
"title"
>
居民意愿度
</p>
<p
class=
"title"
>
居民意愿度
</p>
<!-- <p class="title">加装可能性</p> -->
<!-- <p class="title">加装可能性</p> -->
<img
v-for=
"i in $com.switchStarNum(detailDrawerData.intention)"
:key=
"i"
class=
"star"
src=
"@/assets/images/star1.png"
/>
<img
v-for=
"i in $com.switchStarNum(detailDrawerData.intention
Star
)"
:key=
"i"
class=
"star"
src=
"@/assets/images/star1.png"
/>
</div>
</div>
<div
v-show=
"detailDrawerData.totUnit || detailDrawerData.ratio"
>
<div
v-show=
"detailDrawerData.totUnit || detailDrawerData.ratio"
>
<p
class=
"title"
>
加装意愿收集
</p>
<p
class=
"title"
>
加装意愿收集
</p>
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
<Modal
v-model=
"detailModal"
width=
"90%"
:footer-hide=
"true"
>
<Modal
v-model=
"detailModal"
width=
"90%"
:footer-hide=
"true"
>
<Table
v-if=
"detailModal"
:columns=
"columns"
:data=
"detailData"
size=
"small"
:max-height=
"tableHeight"
/>
<Table
v-if=
"detailModal"
:columns=
"columns"
:data=
"detailData"
size=
"small"
:max-height=
"tableHeight"
/>
</Modal>
</Modal>
<Spin
size=
"large"
fix
v-show=
"spinShow"
style=
"z-index:9999;"
/>
</div>
</div>
</template>
</template>
...
@@ -90,6 +91,7 @@ export default {
...
@@ -90,6 +91,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
map
:
null
,
map
:
null
,
spinShow
:
false
,
detailDrawer
:
false
,
detailDrawer
:
false
,
detailDrawerData
:
{},
detailDrawerData
:
{},
mapConfig
:
{
mapConfig
:
{
...
@@ -219,12 +221,12 @@ export default {
...
@@ -219,12 +221,12 @@ export default {
minWidth
:
100
,
minWidth
:
100
,
align
:
'center'
,
align
:
'center'
,
},
},
{
//
{
title
:
'居民意愿'
,
//
title: '居民意愿',
key
:
'intention'
,
//
key: 'intention',
minWidth
:
100
,
//
minWidth: 100,
align
:
'center'
,
//
align: 'center',
},
//
},
],
],
detailData
:
[],
detailData
:
[],
streetDic
:
{
streetDic
:
{
...
@@ -341,11 +343,15 @@ export default {
...
@@ -341,11 +343,15 @@ export default {
this
.
map
.
add
([
polygon
])
this
.
map
.
add
([
polygon
])
},
},
handleDetail
({
name
})
{
handleDetail
({
name
})
{
this
.
spinShow
=
true
setTimeout
(()
=>
{
this
.
detailData
=
this
.
buildingData
.
building
.
filter
(
item
=>
{
this
.
detailData
=
this
.
buildingData
.
building
.
filter
(
item
=>
{
const
buildingName
=
item
.
name
&&
(
item
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
const
buildingName
=
item
.
name
&&
(
item
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
return
buildingName
.
indexOf
(
name
)
>=
0
||
(
item
.
buildingNo
+
''
).
indexOf
(
name
)
>=
0
return
buildingName
.
indexOf
(
name
)
>=
0
||
(
item
.
buildingNo
+
''
).
indexOf
(
name
)
>=
0
})
})
this
.
detailModal
=
true
this
.
detailModal
=
true
this
.
spinShow
=
false
},
0
)
},
},
initLayers
()
{
// 配置地图图层信息
initLayers
()
{
// 配置地图图层信息
if
(
!
this
.
curStreetData
.
name
)
return
if
(
!
this
.
curStreetData
.
name
)
return
...
@@ -428,10 +434,10 @@ export default {
...
@@ -428,10 +434,10 @@ export default {
extData
:
{
extData
:
{
community
:
cur
.
name
,
community
:
cur
.
name
,
buildingNo
:
cur
.
buildingNo
,
buildingNo
:
cur
.
buildingNo
,
intention
:
cur
.
intention
,
lon
:
cur
.
lon
,
lon
:
cur
.
lon
,
lat
:
cur
.
lat
,
lat
:
cur
.
lat
,
color
:
cur
.
color
,
color
:
cur
.
color
,
intentionStar
:
2
,
// 意愿度为:两颗星
...
item
...
item
},
},
}).
on
(
'click'
,
e
=>
{
}).
on
(
'click'
,
e
=>
{
...
@@ -455,14 +461,15 @@ export default {
...
@@ -455,14 +461,15 @@ export default {
const
communityName
=
item
.
community
&&
(
item
.
community
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
const
communityName
=
item
.
community
&&
(
item
.
community
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
item
.
building
.
match
(
/
([
1-9
]
*
)
号/
)
item
.
building
.
match
(
/
([
1-9
]
*
)
号/
)
item
.
unitNo
=
RegExp
.
$1
item
.
unitNo
=
RegExp
.
$1
const
datasource
=
this
.
eleDataSource
.
filter
(
e
=>
(
e
.
sectName
&&
e
.
sectName
.
indexOf
(
communityName
)
>=
0
)
||
communityName
.
indexOf
(
e
.
sectName
)
>=
0
)
// 筛选出返回数据中的相关小区数据
/** 2021-04-28 已公告图标点击不用出侧边栏情况 */
const
curObj
=
datasource
.
find
(
e
=>
this
.
isSameUnit
(
e
.
unitNo
,
item
.
unitNo
))
// 查找出返回数据中的同一幢楼栋数据
// const datasource = this.eleDataSource.filter(e => (e.sectName && e.sectName.indexOf(communityName) >= 0) || communityName.indexOf(e.sectName) >= 0) // 筛选出返回数据中的相关小区数据
// const curObj = datasource.find(e => this.isSameUnit(e.unitNo, item.unitNo)) // 查找出返回数据中的同一幢楼栋数据
const
cur
=
this
.
buildingData
.
building
.
find
(
e
=>
{
const
cur
=
this
.
buildingData
.
building
.
find
(
e
=>
{
const
name
=
e
.
name
&&
(
e
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
const
name
=
e
.
name
&&
(
e
.
name
+
''
).
replace
(
'(补)'
,
''
).
replace
(
'(补)'
,
''
)
return
(
communityName
.
indexOf
(
name
)
>=
0
||
name
.
indexOf
(
communityName
)
>=
0
)
&&
this
.
isSameUnit
(
e
.
buildingNo
,
item
.
unitNo
)
&&
(
e
.
lon
&&
e
.
lat
)
return
(
communityName
.
indexOf
(
name
)
>=
0
||
name
.
indexOf
(
communityName
)
>=
0
)
&&
this
.
isSameUnit
(
e
.
buildingNo
,
item
.
unitNo
)
&&
(
e
.
lon
&&
e
.
lat
)
})
// 查找出返回数据中的同一幢楼栋数据
})
// 查找出返回数据中的同一幢楼栋数据
if
(
!
cur
)
return
if
(
!
cur
)
return
const
curInfo
=
this
.
announceSource
.
find
(
e
=>
e
.
address
===
item
.
building
)
//
const curInfo = this.announceSource.find(e => e.address === item.building)
const
marker
=
new
AMap
.
Marker
({
const
marker
=
new
AMap
.
Marker
({
position
:
[
cur
.
lon
,
cur
.
lat
],
position
:
[
cur
.
lon
,
cur
.
lat
],
offset
:
new
AMap
.
Pixel
(
-
10
,
-
65
),
offset
:
new
AMap
.
Pixel
(
-
10
,
-
65
),
...
@@ -470,22 +477,23 @@ export default {
...
@@ -470,22 +477,23 @@ export default {
size
:
[
20
,
30
],
size
:
[
20
,
30
],
image
:
require
(
'@/assets/images/notice.gif'
),
image
:
require
(
'@/assets/images/notice.gif'
),
}),
}),
extData
:
{
// extData: {
community
:
cur
.
name
,
// community: cur.name,
buildingNo
:
cur
.
buildingNo
,
// buildingNo: cur.buildingNo,
intention
:
cur
.
intention
,
// intention: cur.intention,
lon
:
cur
.
lon
,
// lon: cur.lon,
lat
:
cur
.
lat
,
// lat: cur.lat,
color
:
cur
.
color
,
// color: cur.color,
...
curObj
,
// ...curObj,
status
:
(
curInfo
&&
curInfo
.
status
)
||
1
,
// status: (curInfo && curInfo.status) || 1,
},
// },
}).
on
(
'click'
,
e
=>
{
this
.
detailDrawer
=
true
this
.
detailDrawerData
=
marker
.
getExtData
()
const
{
lon
,
lat
}
=
this
.
detailDrawerData
this
.
showInfoTips
(
e
,
[
e
.
lnglat
.
getLng
(),
e
.
lnglat
.
getLat
()],
marker
.
getExtData
(),
this
.
addPrism
(
lon
,
lat
))
})
})
// .on('click', e => {
// this.detailDrawer = true
// this.detailDrawerData = marker.getExtData()
// const {lon, lat} = this.detailDrawerData
// this.showInfoTips(e, [e.lnglat.getLng(), e.lnglat.getLat()], marker.getExtData(), this.addPrism(lon, lat))
// })
markers
.
push
(
marker
)
markers
.
push
(
marker
)
})
})
this
.
map
.
add
(
markers
)
this
.
map
.
add
(
markers
)
...
@@ -512,10 +520,10 @@ export default {
...
@@ -512,10 +520,10 @@ export default {
extData
:
{
extData
:
{
community
:
item
.
name
,
community
:
item
.
name
,
buildingNo
:
item
.
buildingNo
,
buildingNo
:
item
.
buildingNo
,
intention
:
item
.
intention
,
lon
:
item
.
lon
,
lon
:
item
.
lon
,
lat
:
item
.
lat
,
lat
:
item
.
lat
,
color
:
item
.
color
,
color
:
item
.
color
,
intentionStar
:
1
,
// 意愿度为:一颗星
...
curObj
...
curObj
},
},
}).
on
(
'click'
,
e
=>
{
}).
on
(
'click'
,
e
=>
{
...
@@ -712,6 +720,8 @@ export default {
...
@@ -712,6 +720,8 @@ export default {
top .1rem
top .1rem
left calc(18% + 0.2rem)
left calc(18% + 0.2rem)
z-index 100
z-index 100
backdrop-filter blur(.01rem)
-webkit-backdrop-filter blur(.01rem)
p
p
display flex
display flex
align-items center
align-items center
...
...
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