Browse Source

[新增]linksplan完善

master
邵佳豪 2 years ago
parent
commit
b4d4c892a6
  1. 72
      src/app/app.module.ts
  2. 76
      src/app/external-links-plan/external-links-plan.component.html
  3. 84
      src/app/external-links-plan/external-links-plan.component.ts
  4. 14
      src/app/key-unit/key-unit.module.ts
  5. 19
      src/app/plan-management/entry-plan-look/AddPlanone.html
  6. 31
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

72
src/app/app.module.ts

@ -1,33 +1,35 @@
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from '@angular/core'; import { NgModule } from "@angular/core";
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from './app.component'; import { AppComponent } from "./app.component";
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from "@angular/material/button";
import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from "@angular/material/icon";
import { MatSidenavModule } from '@angular/material/sidenav'; import { MatSidenavModule } from "@angular/material/sidenav";
import { NavigationModule } from './navigation/navigation.module'; import { NavigationModule } from "./navigation/navigation.module";
import { HomeComponent } from './home/home.component'; import { HomeComponent } from "./home/home.component";
import { TabbarComponent } from './tabbar/tabbar.component'; import { TabbarComponent } from "./tabbar/tabbar.component";
import { PagesModule } from './pages/pages.module'; import { PagesModule } from "./pages/pages.module";
import { FormsModule } from '@angular/forms'; import { FormsModule } from "@angular/forms";
import { UiModule } from './ui/ui.module'; import { UiModule } from "./ui/ui.module";
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from "@angular/common/http";
import { httpInterceptorProviders } from './http-interceptors/index' import { httpInterceptorProviders } from "./http-interceptors/index";
import { CacheTokenService } from './http-interceptors/cache-token.service' import { CacheTokenService } from "./http-interceptors/cache-token.service";
import { TreeService } from './http-interceptors/tree.service'; import { TreeService } from "./http-interceptors/tree.service";
import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥 import { MTokenK1Component } from "./m-token-k1/m-token-k1.component"; //K1秘钥
import { CountdownModule } from 'ngx-countdown'; //倒计时插件 import { CountdownModule } from "ngx-countdown"; //倒计时插件
import { GISManagementModule } from './gis-management/gis-management.module'; import { GISManagementModule } from "./gis-management/gis-management.module";
import { DataCollectionModule } from './data-collection/data-collection.module'; import { DataCollectionModule } from "./data-collection/data-collection.module";
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { TestComponent } from './test/test.component'; import { TestComponent } from "./test/test.component";
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; import { ExternalLinksPlanComponent } from "./external-links-plan/external-links-plan.component";
import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList'; import { SearchDownList } from "../modules/map/declare/component/SearchDownListPlugins/SearchDownList";
import { ExportExcelComponent } from './export-excel/export-excel.component'; import { ExportExcelComponent } from "./export-excel/export-excel.component";
import { registerLocaleData } from '@angular/common'; import { registerLocaleData } from "@angular/common";
import zh from '@angular/common/locales/zh'; import zh from "@angular/common/locales/zh";
import { KeyUnitModule } from "./key-unit/key-unit.module";
import { MatTabsModule } from "@angular/material/tabs";
registerLocaleData(zh); registerLocaleData(zh);
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -37,7 +39,7 @@ registerLocaleData(zh);
TestComponent, TestComponent,
ExternalLinksPlanComponent, ExternalLinksPlanComponent,
SearchDownList, SearchDownList,
ExportExcelComponent ExportExcelComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
@ -55,9 +57,11 @@ registerLocaleData(zh);
GISManagementModule, GISManagementModule,
DataCollectionModule, DataCollectionModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
UiModule UiModule,
KeyUnitModule,
MatTabsModule
], ],
providers: [httpInterceptorProviders, CacheTokenService, TreeService], providers: [httpInterceptorProviders, CacheTokenService, TreeService],
bootstrap: [AppComponent] bootstrap: [AppComponent],
}) })
export class AppModule { } export class AppModule {}

76
src/app/external-links-plan/external-links-plan.component.html

@ -1,11 +1,71 @@
<!-- 株洲项目:传入预案id显示相应预案 --> <mat-tab-group selectedIndex="10" style="height: 99%;">
<div *ngIf="showType == 0"> <mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
</ng-template>
</mat-tab>
<mat-tab label="2.四周毗邻">
<ng-template matTabContent>
<app-allaround></app-allaround>
</ng-template>
</mat-tab>
<mat-tab label="3.消防设施">
<ng-template matTabContent>
<app-fire-fighting-device-look></app-fire-fighting-device-look>
</ng-template>
</mat-tab>
<mat-tab label="4.重点部位">
<ng-template matTabContent>
<app-key-site-look></app-key-site-look>
</ng-template>
</mat-tab>
<mat-tab label="5.功能分区">
<ng-template matTabContent>
<app-function-division-look></app-function-division-look>
</ng-template>
</mat-tab>
<mat-tab label="6.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="7.周边水源及力量">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="8.实景图">
<ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look>
</ng-template>
</mat-tab>
<mat-tab label="9.上传CAD">
<ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="10.特别警示">
<ng-template matTabContent>
<app-special-warning></app-special-warning>
</ng-template>
</mat-tab>
<mat-tab label="11.作战部署">
<ng-template matTabContent>
<div *ngIf="showType == 0">
<iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe> <iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div> </div>
<div *ngIf="showType == 1" id="viewer"></div> <div *ngIf="showType == 1" id="viewer"></div>
<div *ngIf="showType == 2"> <!-- <div *ngIf="showType == 2">
<iframe id="inneriframe2" [src]='threedUrl' frameborder="0" style="width: 100%;height: 100%;"></iframe> <iframe id="inneriframe2" [src]='threedUrl' frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div> </div> -->
<div *ngIf="showType == 3"> <div *ngIf="showType == 3">
<app-collection-tools></app-collection-tools> <app-collection-tools></app-collection-tools>
</div> </div>
</ng-template>
</mat-tab>
</mat-tab-group>
<!-- 株洲项目:传入预案id显示相应预案 -->

84
src/app/external-links-plan/external-links-plan.component.ts

@ -1,11 +1,10 @@
import { HttpClient } from "@angular/common/http"; import { HttpClient } from "@angular/common/http";
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { CacheTokenService } from "../http-interceptors/cache-token.service"; import { CacheTokenService } from "../http-interceptors/cache-token.service";
import { Viewer } from "photo-sphere-viewer"; import { Viewer } from "photo-sphere-viewer";
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
declare var CryptoJS;
@Component({ @Component({
selector: "app-external-links-plan", selector: "app-external-links-plan",
templateUrl: "./external-links-plan.component.html", templateUrl: "./external-links-plan.component.html",
@ -16,13 +15,16 @@ export class ExternalLinksPlanComponent implements OnInit {
private http: HttpClient, private http: HttpClient,
private token: CacheTokenService, private token: CacheTokenService,
public route: ActivatedRoute, public route: ActivatedRoute,
private sanitizer: DomSanitizer private sanitizer: DomSanitizer,
private router: Router
) {} ) {}
planId: any; //预案id planId: any; //预案id
viewer; //全景图对象 viewer; //全景图对象
fetchUrl; //预案文件地址 fetchUrl; //预案文件地址
showType; //预案类型 1:全景图 showType; //预案类型 1:全景图
planData; //预案信息 planData; //预案信息
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
await this.login(); //登录存储token await this.login(); //登录存储token
this.route.queryParams.subscribe((paramsData) => { this.route.queryParams.subscribe((paramsData) => {
@ -31,10 +33,29 @@ export class ExternalLinksPlanComponent implements OnInit {
.get(`/api/PlanComponents/${this.planId}`) .get(`/api/PlanComponents/${this.planId}`)
.subscribe((data: any) => { .subscribe((data: any) => {
console.log("单个预案详细信息", data); console.log("单个预案详细信息", data);
sessionStorage.setItem("planId", data.id);
sessionStorage.setItem("companyId", data.companyId);
sessionStorage.setItem(
"buildingTypeId",
data.company.buildingTypes[0].id
);
sessionStorage.setItem("editable", "0");
sessionStorage.setItem("planName", data.name);
this.router.navigate([`/linksPlan`], {
queryParams: {
id: data.companyId,
planId: data.id,
orName: data.company.organizationName,
orId: data.company.organizationId,
},
});
this.planData = data; this.planData = data;
//如果是查看文件类型
if (data.planType != 1 && data.planType != 2) { if (data.planType != 1 && data.planType != 2) {
this.fetchUrl = data.attachmentUrls[0]; this.fetchUrl = data.attachmentUrls[0];
var index = this.fetchUrl.indexOf("/"); var index = this.fetchUrl.indexOf("/");
//图片
if (this.fetchUrl.substr(0, index) == "psw") { if (this.fetchUrl.substr(0, index) == "psw") {
this.showType = 1; this.showType = 1;
var obj = document.getElementById("viewer"); var obj = document.getElementById("viewer");
@ -48,11 +69,11 @@ export class ExternalLinksPlanComponent implements OnInit {
}); });
}); });
} else { } else {
//毕生 //word文档
this.lookWord(); this.lookWord();
} }
} else { } else {
// 二三维预案 // 如果是二三维预案
this.handleData(); this.handleData();
} }
}); });
@ -76,8 +97,7 @@ export class ExternalLinksPlanComponent implements OnInit {
}); });
}); });
} }
iframeSrc; //毕生服务器链接 iframeSrc; //word服务器链接
src; //文件存储地址
lookWord() { lookWord() {
this.showType = 0; this.showType = 0;
let src; let src;
@ -101,50 +121,32 @@ export class ExternalLinksPlanComponent implements OnInit {
let data = this.planData; let data = this.planData;
if (this.planData.planMode == 1 || this.planData.planMode == 2) { if (this.planData.planMode == 1 || this.planData.planMode == 2) {
//预案planMode=2时, 跳查看页面组件 //预案planMode=2时, 跳查看页面组件
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
console.log(data);
data && data.company ? (this.companyData = data.company) : null;
sessionStorage.setItem(
"buildingTypeId",
this.companyData.buildingTypes.length
? this.companyData.buildingTypes[0].id
: undefined
);
sessionStorage.setItem("companyId", data.companyId);
sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem("editable", "0");
sessionStorage.setItem("planName", this.planData.name);
this.showType = 3; this.showType = 3;
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${data.companyId}`)
});
} else if (this.planData.planMode == 3) {
//预案planMode=3时, 第三方网址'
// this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => { // this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
// data && data.company ? this.companyData = data.company : null // console.log(data);
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(data.url) // data && data.company ? (this.companyData = data.company) : null;
// this.showType = 2 // sessionStorage.setItem(
// }) // "buildingTypeId",
// this.companyData.buildingTypes.length
// ? this.companyData.buildingTypes[0].id
// : undefined
// );
// sessionStorage.setItem("companyId", data.companyId);
// sessionStorage.setItem("planId", this.planId);
// sessionStorage.setItem("editable", "0");
// sessionStorage.setItem("planName", this.planData.name);
// });
} else if (this.planData.planMode == 3) {
//网页地址
let localhostPath = window.document.location.href.substring( let localhostPath = window.document.location.href.substring(
0, 0,
window.document.location.href.indexOf(window.document.location.pathname) window.document.location.href.indexOf(window.document.location.pathname)
); );
//localhostPath : http://39.106.78.171:8000/
let url = data.url; let url = data.url;
if (url.indexOf(localhostPath) != -1) { if (url.indexOf(localhostPath) != -1) {
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`; window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`;
} else { } else {
// let substr = url.split('/').splice(3,url.split('/').length)
// let port = url.split(':')[2]
// if(port.indexOf('/') != -1){
// port = port.split('/')[0]
// }
// let ip = localhostPath.split(':')
// ip.pop()
// let newurl = ip.join(':') + ":" + port + "/" + substr.join('/');
// // console.log('xxx',newurl)
// window.location.href = `${newurl}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`; window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`;
} }
} }

14
src/app/key-unit/key-unit.module.ts

@ -185,7 +185,19 @@ import { NzButtonModule } from "ng-zorro-antd/button";
SpecialWarningComponent, SpecialWarningComponent,
UploadDrillComponent, UploadDrillComponent,
], ],
exports: [ViewUnitDetailsPlanComponent, WaterRoadComponent], exports: [
ViewUnitDetailsPlanComponent,
WaterRoadComponent,
BasicinfoLookComponent,
AllaroundComponent,
FireFightingDeviceLookComponent,
KeySiteLookComponent,
FunctionDivisionLookComponent,
RouterGISComponent,
RealisticPictureLookComponent,
UploadingCADLookComponent,
SpecialWarningComponent,
],
imports: [ imports: [
CommonModule, CommonModule,
KeyUnitRoutingModule, KeyUnitRoutingModule,

19
src/app/plan-management/entry-plan-look/AddPlanone.html

@ -16,9 +16,8 @@
<form [formGroup]="firstFormGroup"> <form [formGroup]="firstFormGroup">
<ng-template matStepLabel>填写名称与类型</ng-template> <ng-template matStepLabel>填写名称与类型</ng-template>
<mat-form-field> <mat-form-field>
<input matInput id="name" name="name" type='text' <input matInput id="name" name="name" type='text' required autocomplete="off" placeholder="请输入预案名称"
required autocomplete="off" formControlName="firstCtrlone">
placeholder="请输入预案名称" formControlName="firstCtrlone">
</mat-form-field> </mat-form-field>
<div> <div>
@ -49,16 +48,18 @@
</mat-step> </mat-step>
<mat-step [stepControl]="secondFormGroup"> <mat-step [stepControl]="secondFormGroup">
<form (ngSubmit)="onSubmit(form)" #form="ngForm"> <form (ngSubmit)="onSubmit(form)" #form="ngForm">
<ng-template matStepLabel >上传预案完成创建</ng-template> <ng-template matStepLabel>上传预案完成创建</ng-template>
<div class="upbox"> <div class="upbox">
<div style="float: left;margin-top: 10px;"> <div style="float: left;margin-top: 10px;">
<span class="pigepadding">预案形式:</span> <span class="pigepadding">预案形式:</span>
</div> </div>
<mat-radio-group required name="planup" [(ngModel)]="defaultisshow" style="float: left;" (change)="selectradio($event)"> <mat-radio-group required name="planup" [(ngModel)]="defaultisshow" style="float: left;"
(change)="selectradio($event)">
<div *ngIf="localup"> <div *ngIf="localup">
<mat-radio-button value="1" style="margin-right: 10px;">本地上传</mat-radio-button> <mat-radio-button value="1" style="margin-right: 10px;">本地上传</mat-radio-button>
<input style="width: 175px;" type="file" name="" id="uploadFile" *ngIf="isup" (change)="filechange($event)"> <input style="width: 175px;" type="file" name="" id="uploadFile" *ngIf="isup"
(change)="filechange($event)">
<span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span> <span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span>
</div> </div>
<div *ngIf="inputword"> <div *ngIf="inputword">
@ -83,7 +84,8 @@
</div> </div>
<div *ngIf="website"> <div *ngIf="website">
<mat-radio-button value="3">网页地址</mat-radio-button> <mat-radio-button value="3">网页地址</mat-radio-button>
<input type="text" *ngIf="isweb" name="webaddress" [(ngModel)]="webaddress" style="width: 175px;height: 20px;margin-left:10px;"> <input type="text" *ngIf="isweb" name="webaddress" [(ngModel)]="webaddress"
style="width: 175px;height: 20px;margin-left:10px;">
</div> </div>
</mat-radio-group> </mat-radio-group>
@ -93,7 +95,8 @@
<div class="progressBox" *ngIf="uploadisLoading"> <div class="progressBox" *ngIf="uploadisLoading">
<span style="font-size: 13px;">上传中...</span> <span style="font-size: 13px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 320px;left: 64px;"></mat-progress-bar> <mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"
style="width: 320px;left: 64px;"></mat-progress-bar>
<button type="button" mat-raised-button (click)="cancel()">取消上传</button> <button type="button" mat-raised-button (click)="cancel()">取消上传</button>
</div> </div>
<div> <div>

31
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -813,7 +813,6 @@ export class EntryPlanLookComponent implements OnInit {
src: `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`, src: `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`,
}, },
}); });
//window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`)
} else { } else {
const dialogRef = this.dialog.open(DownloadFile, { const dialogRef = this.dialog.open(DownloadFile, {
width: "435px", width: "435px",
@ -1241,6 +1240,19 @@ export class AddPlanone {
} else { } else {
uploadUrl = "/api/PlanComponents2D"; uploadUrl = "/api/PlanComponents2D";
} }
console.log("params", this.data.companyId);
console.log("body", {
id: "",
name: this.selectedPLanName,
planType: Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
attachmentUrls: [`${this.objectName}`],
});
// return;
if (this.uploadover) { if (this.uploadover) {
this.http this.http
.post( .post(
@ -1654,21 +1666,6 @@ export class AddPlanone {
//如果是本地上传并且有文件 //如果是本地上传并且有文件
//先上传成功 //先上传成功
this.startUploading("非二维"); this.startUploading("非二维");
//再创建预案
// this.http.post("/api/PlanComponents",{
// id: "",
// name: this.selectedPLanName,
// planType:Number(this.selectedPLanType),
// planMode: Number(this.defaultisshow),
// planLevel: PlanLevel,
// url: "",
// attachmentUrls: [`${this.objectName}`]
// },{params:{
// companyId : this.data.companyId
// }}).subscribe(data=>{
// this.dialogRef.close(data);
// })
} }
if (this.defaultisshow == "2") { if (this.defaultisshow == "2") {
@ -2100,7 +2097,7 @@ export class editUpload {
) {} ) {}
planName: any; //预案名称 planName: any; //预案名称
ngOnInit(): void { ngOnInit(): void {
//console.log(this.data) // console.log(this.data)
} }
onNoClick(): void { onNoClick(): void {
this.dialogRef.close(); this.dialogRef.close();

Loading…
Cancel
Save