From ddeb2aabc7e95b0967a01e0c9548c5e59d4eb04f Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Sat, 26 Dec 2020 17:28:25 +0800
Subject: [PATCH 01/11] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=8D=95=E4=BD=8D?=
=?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../basicinfo/basicinfo.component.html | 9 +++
.../basicinfo/basicinfo.component.scss | 25 ++++++-
.../key-unit/basicinfo/basicinfo.component.ts | 73 +++++++++++++++----
3 files changed, 92 insertions(+), 15 deletions(-)
diff --git a/src/app/key-unit/basicinfo/basicinfo.component.html b/src/app/key-unit/basicinfo/basicinfo.component.html
index 0927268..5e9f5f9 100644
--- a/src/app/key-unit/basicinfo/basicinfo.component.html
+++ b/src/app/key-unit/basicinfo/basicinfo.component.html
@@ -144,6 +144,15 @@
place 位置
+
diff --git a/src/app/key-unit/basicinfo/basicinfo.component.scss b/src/app/key-unit/basicinfo/basicinfo.component.scss
index cb6cf21..7ffed03 100644
--- a/src/app/key-unit/basicinfo/basicinfo.component.scss
+++ b/src/app/key-unit/basicinfo/basicinfo.component.scss
@@ -86,7 +86,6 @@
}
.gistopbox{
position: absolute;
-
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
border-radius: 4px;
left: 5%;
@@ -125,9 +124,31 @@
align-items: center;
justify-content: center;
}
-
+ .inputBox{
+ width: 63%;
+ display: flex;
+ align-items: center;
+ .positionInput{
+ border: 0;
+ border-radius: 6px;
+ width: 90%;
+ height: 34px;
+ background: #F2F2F2;
+ margin-left: 8px;
+ box-sizing: border-box;
+ padding-left: 10px;
+ }
+ }
}
+ .hidden{
+ opacity: 0;
+ z-index: -1;
+ }
+ .show{
+ opacity: 1;
+ z-index: 1;
+ }
}
}
diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts
index 1fd8443..550178f 100644
--- a/src/app/key-unit/basicinfo/basicinfo.component.ts
+++ b/src/app/key-unit/basicinfo/basicinfo.component.ts
@@ -104,6 +104,7 @@ export class BasicinfoComponent implements OnInit {
markerPosition:any = {x: 0, y: 0}//单位坐标
map:any //地图实例
isGisTopBox:boolean = false//点击位置按钮
+ isGisTopBoxTwo:boolean = false//点击位置按钮
oldPositionMarker:any //旧位置marker实例
newPositionMarker:any //新位置marker实例
@@ -121,13 +122,48 @@ export class BasicinfoComponent implements OnInit {
'
' +
''
//初始化地图
+ searchTitle:any//搜索内容
+ placeSearch:any//地址搜索类
+ search(){
+ this.placeSearch.search(this.searchTitle, (status, result) => {
+ // 搜索成功时,result即是对应的匹配数据
+ console.log(146,this.searchTitle)
+ console.log(147,result)
+ if(result.info == "OK"){
+ this.newPositionMarker.setPosition([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat])
+ this.markerPosition2 = {x: result.poiList.pois[0].location.lng, y: result.poiList.pois[0].location.lat}
+ this.map.setCenter([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]); //设置地图中心点
+ }
+
+ })
+
+ }
labelGis(){
this.map = new AMap.Map('container', {
zoom:12
})
+
+
this.map.on('complete', () => {
this.isGisTopBox = true
});
+ //输入提示
+ var autoOptions = {
+ input: "tipinput"
+ };
+ AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{
+ var auto = new AMap.AutoComplete(autoOptions);
+ this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
+ auto.on("select", (e)=>{
+ console.log(e)
+ console.log( this.newPositionMarker)
+ this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
+ this.markerPosition2 = {x: e.poi.location.lng, y: e.poi.location.lat}
+ this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
+ });//注册监听,当选中某条记录时会触发
+
+ });
+
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
@@ -143,9 +179,15 @@ export class BasicinfoComponent implements OnInit {
this.map.setCity('上海市');
}
}
+
+
+ markerPosition2
//点击位置按钮
setPosition(){
+
+
this.isGisTopBox = false
+ this.isGisTopBoxTwo = true
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
@@ -165,36 +207,38 @@ export class BasicinfoComponent implements OnInit {
this.map.add(this.newPositionMarker);
- let markerPosition
if(this.markerPosition.x && this.markerPosition.x != 0){
- markerPosition = {x: this.markerPosition.x,y: this.markerPosition.y}
+ this.markerPosition2 = {x: this.markerPosition.x,y: this.markerPosition.y}
}else{
- markerPosition = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置
+ this.markerPosition2 = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e)=>{
- markerPosition = {x: e.lnglat.lng, y: e.lnglat.lat}
+ this.markerPosition2 = {x: e.lnglat.lng, y: e.lnglat.lat}
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{
this.map.clearMap();
this.isGisTopBox = true
+ this.isGisTopBoxTwo = false
this.newPositionMarker = new AMap.Marker({
- position: [markerPosition.x,markerPosition.y],
+ position: [this.markerPosition2.x,this.markerPosition2.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-15, -18)
});
- this.markerPosition = markerPosition
+ this.markerPosition = this.markerPosition2
this.map.add(this.newPositionMarker);
})
//点击取消
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{
this.isGisTopBox = true
+ this.isGisTopBoxTwo = false
this.map.clearMap();
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x,this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-15, -18)
});
+ this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
})
@@ -219,19 +263,20 @@ export class BasicinfoComponent implements OnInit {
});
this.map.add(this.newPositionMarker);
- let markerPosition
+ // let markerPosition
if(this.markerPosition.x && this.markerPosition.x != 0){
- markerPosition = {x: this.markerPosition.x,y: this.markerPosition.y}
+ this.markerPosition2 = {x: this.markerPosition.x,y: this.markerPosition.y}
}else{
- markerPosition = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置
+ this.markerPosition2 = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e)=>{
- markerPosition = {x: e.lnglat.lng, y: e.lnglat.lat}
+ this.markerPosition2 = {x: e.lnglat.lng, y: e.lnglat.lat}
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{
this.isGisTopBox = true
- this.markerPosition = markerPosition
+ this.isGisTopBoxTwo = false
+ this.markerPosition = this.markerPosition2
this.map.clearMap();
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x,this.markerPosition.y],
@@ -243,19 +288,19 @@ export class BasicinfoComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{
this.map.clearMap();
this.isGisTopBox = true
+ this.isGisTopBoxTwo = false
if(this.markerPosition.x && this.markerPosition.x != 0){//说明之前标过点
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x,this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-15, -18)
});
+ this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
}
})//取消
}
-
-
}
//获得所有单位类型
@@ -278,7 +323,9 @@ export class BasicinfoComponent implements OnInit {
}else{//未标注
_this.isMapLabel = false
}
+
this.labelGis()
+
})
}
)
From 64d9fce2681fb4a81d8fc0e6cabd35268a88f53b Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Mon, 28 Dec 2020 10:48:48 +0800
Subject: [PATCH 02/11] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=8D=95=E4=BD=8D?=
=?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=A0=87=E6=B3=A8=E5=A2=9E=E5=8A=A0=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/key-unit/basicinfo/basicinfo.component.ts | 6 +++---
.../key-unit-management/key-unit-management.component.html | 4 ++--
src/app/pages/login/login.component.scss | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts
index 550178f..8485907 100644
--- a/src/app/key-unit/basicinfo/basicinfo.component.ts
+++ b/src/app/key-unit/basicinfo/basicinfo.component.ts
@@ -127,12 +127,12 @@ export class BasicinfoComponent implements OnInit {
search(){
this.placeSearch.search(this.searchTitle, (status, result) => {
// 搜索成功时,result即是对应的匹配数据
- console.log(146,this.searchTitle)
- console.log(147,result)
if(result.info == "OK"){
this.newPositionMarker.setPosition([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat])
this.markerPosition2 = {x: result.poiList.pois[0].location.lng, y: result.poiList.pois[0].location.lat}
this.map.setCenter([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]); //设置地图中心点
+ }else{
+ alert('查询不到输入地址信息')
}
})
@@ -1219,7 +1219,7 @@ export class BasicinfoComponent implements OnInit {
if(invalid){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
- config.duration = 3000
+ config.duration = 3000
this.snackBar.open('请填写必填项','确定',config);
}else{
sessionStorage.setItem('buildingTypeId',value.unittype)
diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.html b/src/app/key-unit/key-unit-management/key-unit-management.component.html
index f821dd9..9b78ece 100644
--- a/src/app/key-unit/key-unit-management/key-unit-management.component.html
+++ b/src/app/key-unit/key-unit-management/key-unit-management.component.html
@@ -15,7 +15,7 @@
- 包含下级
+ 包含下级
clear
@@ -94,7 +94,7 @@
|
-
+
|
diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss
index 5e378b0..030269b 100644
--- a/src/app/pages/login/login.component.scss
+++ b/src/app/pages/login/login.component.scss
@@ -12,7 +12,7 @@
-moz-background-size:100% 100%;
.text {
padding-top: 3%;
- margin-left: 8%;
+ margin-left: 6%;
width: 53%;
}
}
From 30012d2de272e025a1c67402b4cfd6b0610fdb20 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Mon, 28 Dec 2020 10:51:05 +0800
Subject: [PATCH 03/11] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=8F=8D=E5=90=91=E4=BB=A3=E7=90=86=E7=AB=AF=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
proxy.config.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proxy.config.json b/proxy.config.json
index b28a11f..1898eac 100644
--- a/proxy.config.json
+++ b/proxy.config.json
@@ -1,6 +1,6 @@
{
"/api": {
- "target": "http://121.37.20.190:8000",
+ "target": "http://39.106.78.171:8000",
"secure": false,
"changeOrigin": true
}
From 96eae73e9ddd41071b4e196f4955d664afc6f381 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Mon, 28 Dec 2020 12:35:03 +0800
Subject: [PATCH 04/11] =?UTF-8?q?[=E5=AE=8C=E5=96=84]1.=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8C=89=E9=92=AE=E8=B7=AF=E7=BA=BF=E8=A7=84?=
=?UTF-8?q?=E5=88=92=E8=B5=8B=E9=BB=98=E8=AE=A4=E5=80=BC=202.=E5=9F=BA?=
=?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E6=96=87=E4=BB=B6=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E5=8C=96=E5=B7=A5=E7=94=9F=E4=BA=A7=E7=B1=BB=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../gis-labeling/gis-labeling.component.ts | 59 ++++++++++++++-----
.../key-unit/basicinfo/basicinfo.component.ts | 10 ++--
2 files changed, 48 insertions(+), 21 deletions(-)
diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts
index 9c0b704..a567a28 100644
--- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts
+++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts
@@ -166,7 +166,7 @@ export class GisLabelingComponent implements OnInit {
config.duration = 3000
this.snackBar.open('请切换2D模式使用此功能','确定',config);
}else{
- console.log('提交',this.selectedUnit)
+ // console.log('提交',this.selectedUnit)
this.circle.setRadius(Number(this.unitAreaDefault))
this.circle.setCenter(this.markers[0]._position)
this.circle.setMap(this.map)
@@ -185,7 +185,7 @@ export class GisLabelingComponent implements OnInit {
Distance : Distance,
BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123']
}
- console.log(666,paramsdata)
+ // console.log(666,paramsdata)
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => {
data.items.forEach((i,index) => {
if(i.id == this.selectedUnit.id){
@@ -280,7 +280,7 @@ export class GisLabelingComponent implements OnInit {
text: text,
});
labelMarker.on('click', (e)=>{
- console.log(item)
+ // console.log(item)
let markerContent =
`