Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform-ui
Commits
a8cd38c6
Commit
a8cd38c6
authored
May 16, 2019
by
youjj
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a6d108e1
6f7d6c8e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
169 additions
and
228 deletions
+169
-228
index.js
src/api/base_info/campsite/index.js
+16
-0
main.js
src/main.js
+1
-1
campsite.vue
src/views/baseInfo/campsite/campsite.vue
+5
-4
companyMap.vue
src/views/baseInfo/companyInfo/companyMap.vue
+78
-44
index.vue
src/views/baseInfo/companyInfo/index.vue
+69
-179
No files found.
src/api/base_info/campsite/index.js
View file @
a8cd38c6
...
@@ -10,6 +10,22 @@ export function page(query) {
...
@@ -10,6 +10,22 @@ export function page(query) {
});
});
}
}
export
function
allPage
(
query
)
{
return
fetch
({
url
:
'/vehicle/campsite/allPage'
,
method
:
'get'
,
params
:
query
});
}
export
function
campsiteAllPage
(
query
)
{
return
fetch
({
url
:
'/vehicle/campsite/allPage'
,
method
:
'get'
,
params
:
query
});
}
export
function
getObj
(
id
)
{
export
function
getObj
(
id
)
{
return
fetch
({
return
fetch
({
url
:
'/vehicle/campsite/'
+
id
,
url
:
'/vehicle/campsite/'
+
id
,
...
...
src/main.js
View file @
a8cd38c6
...
@@ -79,7 +79,7 @@ Object.keys(filters).forEach(key => {
...
@@ -79,7 +79,7 @@ Object.keys(filters).forEach(key => {
});
});
// register global progress.
// register global progress.
const
whiteList
=
[
'/login'
,
'/authredirect'
,
'/map'
,
'/stockCrowd'
,
'/stockCrowdDetail'
,
'/companyInfo'
,
'/provinceMap'
];
// 不重定向白名单
const
whiteList
=
[
'/login'
,
'/authredirect'
,
'/map'
,
'/stockCrowd'
,
'/stockCrowdDetail'
,
'/companyInfo'
,
'/provinceMap'
,
'/campsite'
];
// 不重定向白名单
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
();
// 开启Progress
NProgress
.
start
();
// 开启Progress
if
(
getToken
())
{
// 判断是否有token
if
(
getToken
())
{
// 判断是否有token
...
...
src/views/baseInfo/campsite/campsite.vue
View file @
a8cd38c6
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</div>
</div>
</div>
</div>
<!--营地分布图-->
<!--营地分布图-->
<company-map
v-on:headCallBack=
"headCall"
v-if=
"toList"
:toSonData=
"
list
"
:provinceName=
"provinceName"
></company-map>
<company-map
v-on:headCallBack=
"headCall"
v-if=
"toList"
:toSonData=
"
type
"
:provinceName=
"provinceName"
></company-map>
<!--营地数据-->
<!--营地数据-->
<div
v-infinite-scroll=
"loadMore"
infinite-scroll-disabled=
"busy"
infinite-scroll-distance=
"0"
>
<div
v-infinite-scroll=
"loadMore"
infinite-scroll-disabled=
"busy"
infinite-scroll-distance=
"0"
>
<div
class=
"shoppings company-list"
<div
class=
"shoppings company-list"
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
/*引入postcss-px2rem 通过require的形式*/
/*引入postcss-px2rem 通过require的形式*/
// var px2rem = require('postcss-px2rem');
// var px2rem = require('postcss-px2rem');
import
{
import
{
p
age
allP
age
}
from
'api/base_info/campsite'
;
}
from
'api/base_info/campsite'
;
import
chinaMap
from
'../companyInfo/chinaMap'
;
import
chinaMap
from
'../companyInfo/chinaMap'
;
import
companyMap
from
"../companyInfo/companyMap"
;
import
companyMap
from
"../companyInfo/companyMap"
;
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
companyMap
},
companyMap
},
data
()
{
data
()
{
return
{
return
{
type
:
"campsite"
,
toList
:
false
,
toList
:
false
,
nodata
:
false
,
nodata
:
false
,
nomore
:
false
,
nomore
:
false
,
...
@@ -339,7 +340,7 @@
...
@@ -339,7 +340,7 @@
let
params
=
this
.
objDeepCopy
(
this
.
listQuery
);
//深拷贝
let
params
=
this
.
objDeepCopy
(
this
.
listQuery
);
//深拷贝
params
.
page
=
this
.
page
++
;
params
.
page
=
this
.
page
++
;
this
.
send
=
!
0
;
this
.
send
=
!
0
;
p
age
(
params
)
allP
age
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
let
allList
=
[];
let
allList
=
[];
...
@@ -358,7 +359,7 @@
...
@@ -358,7 +359,7 @@
}
}
res
.
data
.
data
.
forEach
(
function
(
item
)
{
res
.
data
.
data
.
forEach
(
function
(
item
)
{
allList
.
push
(
item
);
allList
.
push
(
item
);
});
debugger
});
if
(
res
.
data
.
data
.
length
<
this
.
listQuery
.
limit
&&
this
.
list
.
length
>
0
){
if
(
res
.
data
.
data
.
length
<
this
.
listQuery
.
limit
&&
this
.
list
.
length
>
0
){
//已加载全部
//已加载全部
this
.
nomore
=
true
;
this
.
nomore
=
true
;
...
...
src/views/baseInfo/companyInfo/companyMap.vue
View file @
a8cd38c6
...
@@ -13,11 +13,10 @@
...
@@ -13,11 +13,10 @@
getRegionByCodes
,
getRegionByCodes
,
}
from
'api/base_info/region/'
;
}
from
'api/base_info/region/'
;
import
{
import
{
page
,
campsiteAllPage
,
addObj
,
}
from
'api/base_info/campsite'
;
getObj
,
import
{
delObj
,
allPage
,
putObj
}
from
'api/base_info/branch_company'
;
}
from
'api/base_info/branch_company'
;
export
default
{
export
default
{
props
:
[
"toSonData"
,
"provinceName"
],
props
:
[
"toSonData"
,
"provinceName"
],
...
@@ -41,9 +40,17 @@
...
@@ -41,9 +40,17 @@
}
}
},
},
mounted
()
{
mounted
()
{
// let that = this;
// if(this.map){
// this.map.addEventListener("zoomend", function(e){
// var ZoomNum = that.map.getZoom();
// this.addMarker(map);
// });
// }
},
},
watch
:
{
watch
:
{
provinceName
(
newValue
,
oldValue
)
{
provinceName
(
newValue
,
oldValue
)
{
let
that
=
this
;
console
.
log
(
this
.
provinceName
);
console
.
log
(
this
.
provinceName
);
if
(
this
.
map
){
if
(
this
.
map
){
if
(
this
.
provinceName
==
"兰州"
){
if
(
this
.
provinceName
==
"兰州"
){
...
@@ -52,50 +59,68 @@
...
@@ -52,50 +59,68 @@
this
.
map
.
centerAndZoom
(
this
.
provinceName
,
6
);
this
.
map
.
centerAndZoom
(
this
.
provinceName
,
6
);
}
}
}
}
// this.map.addEventListener("zoomend", function(e){
// var ZoomNum = that.map.getZoom();
// that.map.clearOverlays();//清空地图上标注点
// that.addMarker(this,map);
// });
},
},
},
},
methods
:
{
methods
:
{
getList
()
{
page
(
this
.
listQuery
)
.
then
(
response
=>
{
let
listTemp
=
response
.
data
.
data
;
//一次读入所有涉及地区,防止多次读取
if
(
!
this
.
$utils
.
isEmpty
(
listTemp
))
{
let
allRegions
=
new
Set
();
for
(
let
index
in
listTemp
)
{
allRegions
.
add
(
listTemp
[
index
].
addrProvince
);
allRegions
.
add
(
listTemp
[
index
].
addrCity
);
allRegions
.
add
(
listTemp
[
index
].
addrTown
);
let
regions
=
getRegionByCodes
([
listTemp
[
index
].
addrProvince
,
listTemp
[
index
].
addrCity
,
listTemp
[
index
].
addrTown
]);
listTemp
[
index
].
address
=
regions
[
0
].
name
+
' '
+
regions
[
1
].
name
+
' '
+
regions
[
2
].
name
+
' '
;
}
getRegionByCodes
([...
allRegions
]);
}
let
arr
=
this
.
list
;
listTemp
.
map
(
function
(
item
){
arr
.
push
(
item
);
});
this
.
list
=
arr
;
})
},
handler
({
map
})
{
handler
({
map
})
{
this
.
map
=
map
;
this
.
map
=
map
;
let
list
=
this
.
toSonData
;
if
(
this
.
toSonData
==
"campsite"
){
// 定位
campsiteAllPage
(
this
.
listQuery
)
this
.
geolocation
(
map
);
.
then
(
response
=>
{
// 产生随机点
let
listTemp
=
response
.
data
.
data
;
const
bounds
=
map
.
getBounds
();
let
arr
=
[];
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
listTemp
.
map
(
function
(
item
){
const
point
=
{
arr
.
push
(
item
);
title
:
""
,
//list[i].name
});
point
:
{
this
.
list
=
arr
;
lng
:
list
[
i
].
longitude
,
// 定位
lat
:
list
[
i
].
latitude
this
.
geolocation
(
map
);
}
// 产生随机点
};
const
bounds
=
map
.
getBounds
();
this
.
pointList
.
push
(
point
);
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
const
point
=
{
title
:
""
,
//list[i].name
point
:
{
lng
:
arr
[
i
].
longitude
,
lat
:
arr
[
i
].
latitude
}
};
this
.
pointList
.
push
(
point
);
}
this
.
addMarker
(
map
);
})
}
else
{
allPage
(
this
.
listQuery
)
.
then
(
response
=>
{
let
listTemp
=
response
.
data
.
data
;
let
arr
=
[];
listTemp
.
map
(
function
(
item
){
arr
.
push
(
item
);
});
this
.
list
=
arr
;
// 定位
this
.
geolocation
(
map
);
// 产生随机点
const
bounds
=
map
.
getBounds
();
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
const
point
=
{
title
:
""
,
//list[i].name
point
:
{
lng
:
arr
[
i
].
longitude
,
lat
:
arr
[
i
].
latitude
}
};
this
.
pointList
.
push
(
point
);
}
this
.
addMarker
(
map
);
})
}
}
this
.
addMarker
(
map
);
},
},
mapClick
(
map
,
e
)
{
mapClick
(
map
,
e
)
{
const
point
=
e
.
point
;
const
point
=
e
.
point
;
...
@@ -108,6 +133,7 @@
...
@@ -108,6 +133,7 @@
const
p
=
new
BMap
.
Point
(
point
.
lng
,
point
.
lat
);
const
p
=
new
BMap
.
Point
(
point
.
lng
,
point
.
lat
);
this
.
pickPoint
=
new
BMap
.
Marker
(
p
);
this
.
pickPoint
=
new
BMap
.
Marker
(
p
);
this
.
addressDetail
(
point
);
//根据经纬度获取省市信息
this
.
addressDetail
(
point
);
//根据经纬度获取省市信息
// this.addMarker(map);
},
},
addressDetail
(
point
){
//获取地理位置
addressDetail
(
point
){
//获取地理位置
let
mydata
=
getSonRegionByCodes
(
1
);
let
mydata
=
getSonRegionByCodes
(
1
);
...
@@ -130,9 +156,17 @@
...
@@ -130,9 +156,17 @@
});
});
},
},
addMarker
(
map
)
{
addMarker
(
map
)
{
let
zoom
=
map
.
getZoom
();
var
myIcon
=
new
BMap
.
Icon
(
'https://cwmp.upyuns.com/attachment/images/4/2019/05/HnFr78H280dv972KuNZku70297rz7z.png'
,
new
BMap
.
Size
(
16
,
16
));
//这里先不用第三个参数IconOptions;
// if(zoom
<
6
){
// myIcon = new BMap.Icon('https://cwmp.upyuns.com/attachment/images/4/2019/05/HnFr78H280dv972KuNZku70297rz7z.png',new BMap.Size(16,16));//这里先不用第三个参数IconOptions
// }
for
(
const
item
of
this
.
pointList
)
{
for
(
const
item
of
this
.
pointList
)
{
const
point
=
new
BMap
.
Point
(
item
.
point
.
lng
,
item
.
point
.
lat
);
const
point
=
new
BMap
.
Point
(
item
.
point
.
lng
,
item
.
point
.
lat
);
const
mk
=
new
BMap
.
Marker
(
point
);
var
mk
=
new
BMap
.
Marker
(
point
,
{
icon
:
myIcon
});
// if(zoom > 6){
// mk = new BMap.Marker(point);
// }
const
label
=
new
BMap
.
Label
(
item
.
title
);
const
label
=
new
BMap
.
Label
(
item
.
title
);
label
.
setOffset
(
new
BMap
.
Size
(
15
,
-
15
));
label
.
setOffset
(
new
BMap
.
Size
(
15
,
-
15
));
label
.
setStyle
({
label
.
setStyle
({
...
...
src/views/baseInfo/companyInfo/index.vue
View file @
a8cd38c6
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