Browse Source

[合并] 合并代码

develop
陈鹏飞 4 years ago
parent
commit
ce54ee63f1
  1. 2
      proxy.config.json
  2. 3
      src/app/app.component.html
  3. 12
      src/app/app.component.scss
  4. 9
      src/app/app.component.ts
  5. 4
      src/app/app.module.ts
  6. 18
      src/app/mask-layer.service.ts
  7. 13
      src/app/ui/basicinfo/basicinfo.component.ts
  8. 2
      src/app/ui/collection-tools/collection-tools.component.html
  9. 17
      src/app/ui/collection-tools/collection-tools.component.ts
  10. 1
      src/app/ui/ui.component.html

2
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://39.106.78.171:8000",
"target": "http://121.37.20.190:8000/",
"secure": false,
"changeOrigin": true
}

3
src/app/app.component.html

@ -1 +1,4 @@
<router-outlet></router-outlet>
<div class="maskLayer" *ngIf="isMaskLayerShow">
<mat-spinner [diameter]='50'></mat-spinner>
</div>

12
src/app/app.component.scss

@ -0,0 +1,12 @@
.maskLayer{
position: absolute;
left: 0;
top: 0;
z-index: 2000;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.2);
display: flex;
justify-content: center;
align-items: center;
}

9
src/app/app.component.ts

@ -4,6 +4,7 @@ import { Data } from './interface'
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from './http-interceptors/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';
import { MaskLayerService } from './mask-layer.service';
@ -14,9 +15,15 @@ import { CookieService } from 'ngx-cookie-service';
})
export class AppComponent {
constructor(private http:HttpClient,private router:Router,public token:CacheTokenService,private cookieService: CookieService) { }
constructor(private maskLayerService:MaskLayerService, private http:HttpClient,private router:Router,public token:CacheTokenService,private cookieService: CookieService) { }
isMaskLayerShow:boolean = false
ngOnInit(): void {
//监听遮罩层
this.maskLayerService.getMessage().subscribe((message: any)=>{
this.isMaskLayerShow = message
});
var token = this.cookieService.get("token")
var refreshToken = this.cookieService.get("refreshToken");
if(token && refreshToken) {

4
src/app/app.module.ts

@ -20,6 +20,7 @@ import { TreeService } from'./http-interceptors/tree.service'
import { CookieService } from 'ngx-cookie-service';//cookie插件
import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { MTokenK1Component } from './m-token-k1/m-token-k1.component';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@NgModule({
declarations: [
@ -39,7 +40,8 @@ import { MTokenK1Component } from './m-token-k1/m-token-k1.component';
PagesModule,
FormsModule,
HttpClientModule,
CountdownModule
CountdownModule,
MatProgressSpinnerModule
],
providers: [httpInterceptorProviders, CacheTokenService,TreeService,CookieService],
bootstrap: [AppComponent]

18
src/app/mask-layer.service.ts

@ -0,0 +1,18 @@
import { Injectable } from '@angular/core';
import {ReplaySubject} from "rxjs";
import { Observable } from "rxjs";
@Injectable({
providedIn: 'root'
})
export class MaskLayerService {
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
/** * *
* @param message * @returns {Observavle<any>} */
public sendMessage(message: any) {
this._sendMessage.next(message);
}
public getMessage(): Observable <any> {
return this._sendMessage.asObservable();
}
constructor() { }
}

13
src/app/ui/basicinfo/basicinfo.component.ts

@ -148,8 +148,8 @@ export class BasicinfoComponent implements OnInit {
var auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on("select", (e)=>{
console.log(e)
console.log( this.newPositionMarker)
// 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]); //设置地图中心点
@ -158,7 +158,7 @@ export class BasicinfoComponent implements OnInit {
});
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
this.oldPositionMarker = new AMap.Marker({
position: [this.unitinfo.location.x,this.unitinfo.location.y],
@ -168,7 +168,7 @@ export class BasicinfoComponent implements OnInit {
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
}else{
console.log('未标注单位位置')
// console.log('未标注单位位置')
this.map.setCity('广西');
}
}
@ -178,7 +178,7 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = false
this.isGisTopBoxTwo = true
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
// console.log('已标注单位位置')
if(this.oldPositionMarker){
this.oldPositionMarker.setContent(this.oldPositionMarkerContent)
@ -232,7 +232,7 @@ export class BasicinfoComponent implements OnInit {
})
}else{
console.log('未标注单位位置')
// console.log('未标注单位位置')
if(this.newPositionMarker){
this.newPositionMarker.setContent(this.oldPositionMarkerContent)
}
@ -364,7 +364,6 @@ export class BasicinfoComponent implements OnInit {
this.unitinfo = data
resolve(this.unitinfo)
console.log(456789,this.unitinfo)
this.selectedorganizationid = data.organizationId
if(data.imageUrl){
this.imgsrc = data.imageUrl

2
src/app/ui/collection-tools/collection-tools.component.html

@ -332,5 +332,7 @@
</div>
</div>
<!--功能区 -->
</div>
</div>

17
src/app/ui/collection-tools/collection-tools.component.ts

@ -10,6 +10,7 @@ import {WorkingAreaComponent} from '../../working-area/working-area.component'
import {CanvasShareDataService} from '../../canvas-share-data.service' //引入服务
import Viewer from 'viewerjs';
import * as ObjectID from 'bson-objectid';
import { MaskLayerService } from 'src/app/mask-layer.service';
@Component({
selector: 'app-collection-tools',
@ -20,7 +21,7 @@ export class CollectionToolsComponent implements OnInit {
@ViewChild('canvas') canvas:WorkingAreaComponent; //父组件中获得子组件的引用
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { }
constructor(private maskLayerService:MaskLayerService, private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { }
// tree配置
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
return {
@ -296,7 +297,7 @@ export class CollectionToolsComponent implements OnInit {
formData.append("file",file)
await new Promise((resolve,reject)=>{
this.http.delete(`/api/Objects/WebPlan2D/${companyId}/${file.name}?x-oss-process=image/resize,m_fixed,h_100,w_100`).subscribe(data=>{
console.log('删除缩略图成功')
// console.log('删除缩略图成功')
resolve('删除缩略图成功')
})
})
@ -520,7 +521,7 @@ export class CollectionToolsComponent implements OnInit {
//更新用于统计的数据
this.canvasData.updateBuildingData()
this.maskLayerService.sendMessage(true)
if (this.selectingSitePlan && this.selectingSitePlan.id) {
this.saveNum = []
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData));
@ -555,6 +556,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/SitePlanData",SitePlanData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -573,6 +575,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyData",CompanyData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -592,6 +595,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyAdjoins/Batch",CompanyAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -611,6 +615,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyImportantLocations/Batch",CompanyImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -630,6 +635,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyFacilityAssets/Batch",CompanyFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -650,6 +656,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/BuildingAreaData",SitePlanData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -668,6 +675,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/BuildingData",CompanyData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -687,6 +695,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingAdjoins/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -706,6 +715,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingImportantLocations/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -725,6 +735,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';

1
src/app/ui/ui.component.html

@ -1 +0,0 @@
<p>ui works!</p>
Loading…
Cancel
Save