From b4d4c892a6f79034a92a7286035afb107b070692 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 1 Sep 2023 10:35:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]linksplan=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 124 +++++------ .../external-links-plan.component.html | 82 +++++++- .../external-links-plan.component.ts | 84 ++++---- src/app/key-unit/key-unit.module.ts | 14 +- .../entry-plan-look/AddPlanone.html | 193 +++++++++--------- .../entry-plan-look.component.ts | 31 ++- 6 files changed, 303 insertions(+), 225 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 338921c..e0d9402 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,63 +1,67 @@ -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: [ - AppComponent, - HomeComponent, - MTokenK1Component, - TestComponent, - ExternalLinksPlanComponent, - SearchDownList, - ExportExcelComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - BrowserAnimationsModule, - MatButtonModule, - MatCheckboxModule, - MatSidenavModule, - NavigationModule, - MatIconModule, - PagesModule, - FormsModule, - HttpClientModule, - CountdownModule, - GISManagementModule, - DataCollectionModule, - MatProgressSpinnerModule, - UiModule - ], - providers: [httpInterceptorProviders, CacheTokenService, TreeService], - bootstrap: [AppComponent] + declarations: [ + AppComponent, + HomeComponent, + MTokenK1Component, + TestComponent, + ExternalLinksPlanComponent, + SearchDownList, + ExportExcelComponent, + ], + imports: [ + BrowserModule, + AppRoutingModule, + BrowserAnimationsModule, + MatButtonModule, + MatCheckboxModule, + MatSidenavModule, + NavigationModule, + MatIconModule, + PagesModule, + FormsModule, + HttpClientModule, + CountdownModule, + GISManagementModule, + DataCollectionModule, + MatProgressSpinnerModule, + UiModule, + KeyUnitModule, + MatTabsModule + ], + providers: [httpInterceptorProviders, CacheTokenService, TreeService], + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/external-links-plan/external-links-plan.component.html b/src/app/external-links-plan/external-links-plan.component.html index 4b768c3..6551685 100644 --- a/src/app/external-links-plan/external-links-plan.component.html +++ b/src/app/external-links-plan/external-links-plan.component.html @@ -1,11 +1,71 @@ - -
- -
-
-
- -
-
- -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/src/app/external-links-plan/external-links-plan.component.ts b/src/app/external-links-plan/external-links-plan.component.ts index 8f59198..19cc2e7 100644 --- a/src/app/external-links-plan/external-links-plan.component.ts +++ b/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 { 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.showType = 3; + // 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.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 - // }) + //网页地址 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`; } } diff --git a/src/app/key-unit/key-unit.module.ts b/src/app/key-unit/key-unit.module.ts index 03baead..0a2306e 100644 --- a/src/app/key-unit/key-unit.module.ts +++ b/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, diff --git a/src/app/plan-management/entry-plan-look/AddPlanone.html b/src/app/plan-management/entry-plan-look/AddPlanone.html index 45e896c..84dc7f0 100644 --- a/src/app/plan-management/entry-plan-look/AddPlanone.html +++ b/src/app/plan-management/entry-plan-look/AddPlanone.html @@ -7,105 +7,108 @@ * @LastEditTime: 2021-07-27 10:44:51 -->
-
- 新建预案 -
-
- - - - 填写名称与类型 - - - - -
- - - - 文本预案 - 二维预案 - 三维预案 - 其他预案 - - -
-
- - - Ⅲ级预案 - Ⅳ级预案 - Ⅴ级预案 - - -
-
- - -
- -
- -
- 上传预案完成创建 -
-
- 预案形式: -
- - -
- 本地上传 - - (已上传) -
-
- 模板在线编制 -
-
- 自定义在线编制 -
+
+ 新建预案 +
+
+ + + + 填写名称与类型 + + + - + + + 文本预案 + 二维预案 + 三维预案 + 其他预案 + + +
+
+ + + Ⅲ级预案 + Ⅳ级预案 + Ⅴ级预案 + + +
+
+ + +
+ + + +
+ 上传预案完成创建 +
+
+ 预案形式: +
+ + +
+ 本地上传 + + (已上传) +
+
+ 模板在线编制 +
+
+ 自定义在线编制 +
+ + -
- - 是否为全景图 -
-
- 在线编辑 -
-
- 网页地址 - -
- -
- -
- -
- - 上传中... - - -
-
- - - -
-
+ 是否为全景图 +
+
+ 在线编辑 +
+
+ 网页地址 + +
+ + +
+ +
- - - -
- - + + + + \ No newline at end of file diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts index 206ade4..e8f49b5 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts +++ b/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") { @@ -2100,7 +2097,7 @@ export class editUpload { ) {} planName: any; //预案名称 ngOnInit(): void { - //console.log(this.data) + // console.log(this.data) } onNoClick(): void { this.dialogRef.close();