邵佳豪 3 years ago
parent
commit
00c9e34ba1
  1. 77
      src/app/gis-management/gis-labeling/gis-labeling.component.ts

77
src/app/gis-management/gis-labeling/gis-labeling.component.ts

@ -1161,15 +1161,46 @@ export class GisLabelingComponent implements OnInit {
//搜索
search() {
this.allCompany = []
let paramsdata: any = { Name: this.searchText || '' }
this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => {
this.allCompany = data.items
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(`搜索目标结果为${data.items.length}`, '确定', config);
})
let that = this
let placeSearch = MapFactory.PlaceSearchInstance(that); //构造地点查询类
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000;
this.allCompany = []
let paramsdata: any = { Name: this.searchText || '' }
this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => {
if (data.items.length) { //数据库api 搜索
this.allCompany = data.items
this.snackBar.open(`搜索目标结果为${data.items.length}`, '确定', config);
} else { //高德api 搜索
placeSearch.search(that.searchText, (status, result)=>{
if (status != "complete") {
this.snackBar.open(`搜索目标结果为0个`, '确定', config);
console.log(status,result)
return
}
if (result.poiList.pois.length) {
let resultList = []
result.poiList.pois.forEach((element: any) => {
let item = {
address: element.address,
buildingTypes: [],
id: null,
imageUrl: null,
location: {x: element.location.lng, y: element.location.lat},
name: element.name
}
resultList.push(item)
});
that.allCompany = resultList
that.snackBar.open(`搜索目标结果为${resultList.length}`, '确定', config);
} else {
that.snackBar.open(`搜索目标结果为0个`, '确定', config);
}
})
}
})
}
//清除
@ -1269,6 +1300,13 @@ export class GisLabelingComponent implements OnInit {
//基本信息
baseInformation(e) {
if (!e.id) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无单位数据', '确定', config);
return
}
this.leftDivState = true
this.showLeftDiv = true
this.appLeft.selectBaseInfo(e) //调用子组件方法
@ -1295,6 +1333,13 @@ export class GisLabelingComponent implements OnInit {
//查看预案
seePlan(e) {
if (!e.id) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无单位数据', '确定', config);
return
}
let data = e
let dialogRef = this.dialog.open(LookPlanDialog, {//调用open方法打开对话框并且携带参数过去
width: '1400px',
@ -1309,9 +1354,16 @@ export class GisLabelingComponent implements OnInit {
//分享
share(e) {
if (!e.id) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无单位数据', '确定', config);
return
}
let data = {
url: 'https://',
buildingType: e.buildingTypes[0].name,
buildingType: e.buildingTypes.length? e.buildingTypes[0].name : null,
address: e.address
}
let dialogRef = this.dialog.open(ShareUrlDialog, {//调用open方法打开对话框并且携带参数过去
@ -1503,7 +1555,7 @@ export class ShareUrlDialog {
qrCode
makeCode() {
this.qrCode = new QRCode(document.getElementById("qrcode"), {
text: this.data.url,
text: this.data.url || "",
width: 200,
height: 200,
colorDark: "#000000",
@ -1579,8 +1631,7 @@ export class LookPlanDialog {
ngOnInit() {
sessionStorage.setItem("companyId", this.data.id)
console.log(this.data)
sessionStorage.setItem("companyId", this.data.id || "")
this.getAllPlans()
}
//关闭弹窗

Loading…
Cancel
Save