Browse Source

[新增]linksplan完善

master
邵佳豪 2 years ago
parent
commit
b4d4c892a6
  1. 70
      src/app/app.module.ts
  2. 66
      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. 17
      src/app/plan-management/entry-plan-look/AddPlanone.html
  6. 29
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

70
src/app/app.module.ts

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

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

@ -1,11 +1,71 @@
<!-- 株洲项目:传入预案id显示相应预案 -->
<mat-tab-group selectedIndex="10" style="height: 99%;">
<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>
</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>
</div>
</div> -->
<div *ngIf="showType == 3">
<app-collection-tools></app-collection-tools>
</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 { 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 { Viewer } from "photo-sphere-viewer";
import { DomSanitizer } from "@angular/platform-browser";
declare var CryptoJS;
@Component({
selector: "app-external-links-plan",
templateUrl: "./external-links-plan.component.html",
@ -16,13 +15,16 @@ export class ExternalLinksPlanComponent implements OnInit {
private http: HttpClient,
private token: CacheTokenService,
public route: ActivatedRoute,
private sanitizer: DomSanitizer
private sanitizer: DomSanitizer,
private router: Router
) {}
planId: any; //预案id
viewer; //全景图对象
fetchUrl; //预案文件地址
showType; //预案类型 1:全景图
planData; //预案信息
async ngOnInit(): Promise<void> {
await this.login(); //登录存储token
this.route.queryParams.subscribe((paramsData) => {
@ -31,10 +33,29 @@ export class ExternalLinksPlanComponent implements OnInit {
.get(`/api/PlanComponents/${this.planId}`)
.subscribe((data: any) => {
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;
//如果是查看文件类型
if (data.planType != 1 && data.planType != 2) {
this.fetchUrl = data.attachmentUrls[0];
var index = this.fetchUrl.indexOf("/");
//图片
if (this.fetchUrl.substr(0, index) == "psw") {
this.showType = 1;
var obj = document.getElementById("viewer");
@ -48,11 +69,11 @@ export class ExternalLinksPlanComponent implements OnInit {
});
});
} else {
//毕生
//word文档
this.lookWord();
}
} else {
// 二三维预案
// 如果是二三维预案
this.handleData();
}
});
@ -76,8 +97,7 @@ export class ExternalLinksPlanComponent implements OnInit {
});
});
}
iframeSrc; //毕生服务器链接
src; //文件存储地址
iframeSrc; //word服务器链接
lookWord() {
this.showType = 0;
let src;
@ -101,50 +121,32 @@ export class ExternalLinksPlanComponent implements OnInit {
let data = this.planData;
if (this.planData.planMode == 1 || this.planData.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.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) => {
// data && data.company ? this.companyData = data.company : null
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(data.url)
// this.showType = 2
// })
// 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);
// });
} else if (this.planData.planMode == 3) {
//网页地址
let localhostPath = window.document.location.href.substring(
0,
window.document.location.href.indexOf(window.document.location.pathname)
);
//localhostPath : http://39.106.78.171:8000/
let url = data.url;
if (url.indexOf(localhostPath) != -1) {
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`;
} 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`;
}
}

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

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

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

@ -16,9 +16,8 @@
<form [formGroup]="firstFormGroup">
<ng-template matStepLabel>填写名称与类型</ng-template>
<mat-form-field>
<input matInput id="name" name="name" type='text'
required autocomplete="off"
placeholder="请输入预案名称" formControlName="firstCtrlone">
<input matInput id="name" name="name" type='text' required autocomplete="off" placeholder="请输入预案名称"
formControlName="firstCtrlone">
</mat-form-field>
<div>
@ -55,10 +54,12 @@
<span class="pigepadding">预案形式:</span>
</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">
<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>
</div>
<div *ngIf="inputword">
@ -83,7 +84,8 @@
</div>
<div *ngIf="website">
<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>
</mat-radio-group>
@ -93,7 +95,8 @@
<div class="progressBox" *ngIf="uploadisLoading">
<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>
</div>
<div>

29
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`,
},
});
//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 {
const dialogRef = this.dialog.open(DownloadFile, {
width: "435px",
@ -1241,6 +1240,19 @@ export class AddPlanone {
} else {
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) {
this.http
.post(
@ -1654,21 +1666,6 @@ export class AddPlanone {
//如果是本地上传并且有文件
//先上传成功
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") {

Loading…
Cancel
Save