Browse Source

[修改]iframe毕升报错路由安全问题修复

上海一张图
chenjingyu 4 years ago
parent
commit
91a4ad57ff
  1. 4
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  2. 40
      src/app/ui/plan-template/Disaster.html
  3. 46
      src/app/ui/plan-template/plan-template.component.html
  4. 17
      src/app/ui/plan-template/plan-template.component.scss
  5. 159
      src/app/ui/plan-template/plan-template.component.ts
  6. 3
      src/app/ui/ui.module.ts

4
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-26 15:09:38
* @LastEditTime: 2021-06-04 10:14:51
*/
import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@ -61,7 +61,7 @@ export class WaitExamineerComponent implements OnInit {
]
}
this.getAlltabledate()
// this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
}
planTypeIndex //平面图类型 选择是总平面图还是层平面图

40
src/app/ui/plan-template/Disaster.html

@ -0,0 +1,40 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-06-02 15:15:15
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-03 15:26:18
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">新增内容</span>
</div>
<div class="queryField">
<label style="margin-right: 10px;">类型:</label>
<mat-form-field>
<mat-select placeholder='请选择类型' name="level" [(ngModel)]="level" required>
<mat-option value=1>表格</mat-option>
<mat-option value=2>输入框</mat-option>
<mat-option value=3>文本区域</mat-option>
<mat-option value=5>树状图</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入表头名称" [(ngModel)]="headName" autocomplete="off" required>
</mat-form-field>
</div>
<!-- <div class="queryField" *ngIf="level==1||level==2">
<label style="margin-right: 10px;">列数:</label>
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="lieNumber" name="companyNumber" autocomplete="off" required min="1">
</mat-form-field>
</div> -->
<div class="bottom">
<button mat-raised-button color="primary" (click)='newdisaster()'>确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)='close()'>取消</button>
</div>
</div>

46
src/app/ui/plan-template/plan-template.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-01 16:43:14
* @LastEditTime: 2021-06-03 17:15:15
-->
<div class="box">
<div class="boxleft">
@ -41,14 +41,15 @@
</div>
</div>
<div class="rightbody">
<mat-accordion *ngFor="let item of group" multi>
<mat-accordion *ngFor="let item of group;let zi=index;TrackBy:trackByFn" multi>
<!-- 基本信息 -->
<mat-expansion-panel [expanded]='groupPanle==true' *ngIf="item.completed" expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel [expanded]='groupPanle==true' (opened)='groupPanle=true' *ngIf="item.completed" hideToggle style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title class="paneltitle">
<div class="groupName">
<span>{{item.groupName}}</span>
</div>
<div class="addinfo" (click)='addAttribute(item.groupName)'>
<img src="../../../assets/images/update.png" style="height: 15px;margin-top: 4px;">
<span style="margin-left: 2px;">编辑</span>
@ -60,7 +61,8 @@
</mat-panel-title>
</mat-expansion-panel-header>
<div class="accordingin">
<!--单位概况-->
<div class="accordingin" *ngIf="item.groupName=='单位概况'">
<mat-accordion *ngFor="let element of item.attribute">
<mat-expansion-panel [expanded]='attPanle' *ngIf="element.completed" expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;height: 100%;">
<mat-expansion-panel-header collapsedHeight='50px' expandedHeight='50px' class="panelhead" style="background-color: #FFFFFF;">
@ -138,7 +140,7 @@
<span style="float: right;color: #B99A00;">{{attinf.name}}</span>
</div>
<div class="caozuo">
<button mat-raised-button color="#ECF6FF" ><img src="../../../assets/images/deletehui.png"> 删除</button>
<button mat-raised-button color="#ECF6FF" (click)='delattAndfileOne(item.groupName,element.surveyName,i)'><img src="../../../assets/images/deletehui.png"> 删除</button>
<button mat-raised-button color="primary" style="margin-right: 10px;" (click)='fileAdd(attinf.facilityItems,i)'><img src="../../../assets/images/addbai.png"> 编辑</button>
</div>
</div>
@ -165,23 +167,23 @@
</div>
<!--进攻通道-->
<div *ngIf="item.groupName=='单位概况'&&(element.surveyName=='进攻通道')">
<div class="attack" *ngFor="let item of attack">
<div class="attack" *ngFor="let attackitem of element.attinf;let i=index">
<div class="attackLeft">
<div class="attackleftHead">
<input type="text" [value]='item.head'>
<input type="text" [(ngModel)]='attackitem.head' placeholder="请输入内容" >
</div>
<div class="attackleftTable">
<table>
<thead>
<th><input type="text" [value]='item.tableth'></th>
<th *ngFor="let item of attackitem.tableth;let tablethi=index;TrackBy:trackByFn"><input type="text" [(ngModel)]='attackitem.tableth[tablethi]' placeholder="请输入内容"></th>
</thead>
</table>
</div>
</div>
<div class="attackRight">
<div class="rightButton">
<button mat-raised-button color="primary" (click)='attackAdd()'><img src="../../../assets/images/addbai.png"> 新增</button>
<button mat-raised-button color="#ECF6FF" style="margin-left: 10px;"><img src="../../../assets/images/deletehui.png"> 删除</button>
<button mat-raised-button color="primary" (click)='attackAdd(element.surveyName,i)'><img src="../../../assets/images/addbai.png"> 新增</button>
<button mat-raised-button color="#ECF6FF" style="margin-left: 10px;" (click)='delattAndfileOne(item.groupName,element.surveyName,i)'><img src="../../../assets/images/deletehui.png" > 删除</button>
</div>
</div>
</div>
@ -190,6 +192,30 @@
</mat-expansion-panel>
</mat-accordion>
</div>
<!--灾情设定-->
<div class="disaster" *ngIf="item.groupName=='灾情设定'">
<div class="attack" *ngFor="let element of item.attribute;let attributei=index">
<div class="attackLeft">
<div class="attackleftHead">
<input type="text" placeholder="请输入内容" [(ngModel)]="element.headName">
</div>
<div class="attackleftTable">
<table *ngIf="element.level==1||element.level==2">
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"><input type="text" placeholder="请输入内容" [(ngModel)]="element.tableth[tablethi]"></th>
</thead>
</table>
<textarea *ngIf="element.level==3"></textarea>
</div>
</div>
<div class="attackRight">
<div class="rightButton">
<button mat-raised-button color="primary"(click)='attackAdd(item.groupName,attributei)'*ngIf="element.level==1||element.level==2" ><img src="../../../assets/images/addbai.png"> 新增</button>
<button mat-raised-button color="#ECF6FF" style="margin-left: 10px;" ><img src="../../../assets/images/deletehui.png" (click)='delDisaster(attributei)'> 删除</button>
</div>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>

17
src/app/ui/plan-template/plan-template.component.scss

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-01 16:46:43
* @LastEditTime: 2021-06-03 16:57:21
*/
.box{
height: 97%;
@ -245,12 +245,12 @@
}
th{
background-color: #F9F9F9;
background-color: #E8E9E9;
height: 40px;
font-size: 16px;
text-align: center;
input{
background-color: #FFFFFF;
//background-color: #FFFFFF;
text-align: center;
height: 100%;
width: 100%;
@ -259,6 +259,9 @@
outline: none;
}
}
textarea{
width: 100%;
}
}
}
.attackRight{
@ -271,4 +274,12 @@
}
}
}
}
//滚动条样式
::-webkit-scrollbar {
width: 6px;
background-color: white;
}
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}

159
src/app/ui/plan-template/plan-template.component.ts

@ -1,10 +1,26 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-03 17:08:37
*/
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-02 09:22:24
*/
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-01 16:39:49
* @LastEditTime: 2021-06-02 09:18:05
*/
import { Component, Inject, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -144,11 +160,11 @@ export class PlanTemplateComponent implements OnInit {
if(this.unitName==undefined){
this.snackBar.open('请选择预案模板!','确定',config);
}else{
this.newleftTabledata.forEach((value,index,array)=>{
/* this.newleftTabledata.forEach((value,index,array)=>{
if(array[index].buildingTypeId==this.buildingTypeId){
this.group=array[index].data
}
})
}) */
const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去
width: '240px',
height:'590px',
@ -172,7 +188,7 @@ export class PlanTemplateComponent implements OnInit {
})
});
}
//console.log(this.newleftTabledata)
console.log(this.newleftTabledata)
}
//删除分组
@ -189,8 +205,10 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[this.leftclicki].data=this.group
}
//新增属性
groupName
addAttribute(groupName){
this.groupPanle=true
this.groupName=groupName
if(groupName=='单位概况'){
const dialogRef = this.dialog.open(adddwsurvey, {//调用open方法打开对话框并且携带参数过去
width: '240px',
@ -199,7 +217,7 @@ export class PlanTemplateComponent implements OnInit {
data:this.group
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
//console.log(result)
if(result!=undefined){
this.group.forEach((value,index,array)=>{
if(array[index].groupName=='单位概况'){
@ -209,6 +227,30 @@ export class PlanTemplateComponent implements OnInit {
}
//console.log(this.newleftTabledata)
});
}else if(groupName=='灾情设定'){
const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去
width: '340px',
height:'400px',
disableClose:true,
data:this.group
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result!=undefined){
this.group.forEach((value,index,array)=>{
if(array[index].groupName=='灾情设定'){
if(array[index].attribute==undefined){
array[index].attribute=[]
array[index].attribute.push(result)
}else{
array[index].attribute.push(result)
}
}
})
}
console.log(this.newleftTabledata)
});
}
}
//删除具体属性
@ -232,7 +274,13 @@ export class PlanTemplateComponent implements OnInit {
danweiInfTable=[]
addAttInfo(surveyName){
if(surveyName=='进攻通道'){
this.attack.push({head:'进出口',tableth:[]})
if(this.group[0].attribute[4].attinf==undefined){
this.group[0].attribute[4].attinf=[]
this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
}else{
this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
}
}else{
this.attPanle=true
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
@ -273,7 +321,7 @@ export class PlanTemplateComponent implements OnInit {
//array[index].attribute[i].completed=false
attarr[i].attinf.forEach((attinfValue,attinfi,attinfarr) => {
if(attinfValue.propertyName==propertyName){
attinfarr[attinfi].completed=false
attinfarr[attinfi].splice(attinfi,i)
}
});
}
@ -284,7 +332,7 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[this.leftclicki].data=this.group
console.log(this.newleftTabledata)
}
//消防设施具体属性编辑
//消防设施表格具体属性编辑
fileAdd(facilityItems,filei){
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
width: '240px',
@ -309,7 +357,7 @@ export class PlanTemplateComponent implements OnInit {
console.log(this.newleftTabledata)
});
}
//消防设施具体属性删除
//消防设施表格具体属性删除
fileDel(i,f){
let isTrue = confirm('您确定要删除该条信息吗')
if(isTrue){
@ -318,9 +366,50 @@ export class PlanTemplateComponent implements OnInit {
}
//进攻通道
attack=[]
attackAdd(){
this.attack.length+1
//进攻通道,灾情设定增加表格数据
attackAdd(name,i){
//console.log(name,i)
if(name=='进攻通道'){
this.group[0].attribute[4].attinf[i].tableth.push('')
}else if(name=='灾情设定'){
this.group[1].attribute[i].tableth.push('')
}
console.log(this.newleftTabledata)
}
//进攻通道,消防设施一级菜单删除
delattAndfileOne(groupName,surveyName,indexOne){
let isTrue = confirm('您确定要删除该条信息吗')
if(isTrue){
this.group.forEach((value,index,array)=>{
if (array[index].groupName==groupName) {
array[index].attribute.forEach((element,i,attarr) => {
if(element.surveyName==surveyName){
if(surveyName=='消防设施'){
element.attinf[indexOne].completed=false
}
else{
element.attinf.splice(indexOne,1)
}
}
});
}
})
}
this.newleftTabledata[this.leftclicki].data=this.group
console.log(this.newleftTabledata)
}
//input key值,一个字符焦点消失问题
trackByFn(index){
return index
}
//灾情设定删除一条
delDisaster(i){
let isTrue = confirm('您确定要删除该条信息吗')
if(isTrue){
this.group[1].attribute.splice(i,1)
}
}
//保存
save(){
@ -501,8 +590,8 @@ export class addGroup{
]
groupName=[]
ngOnInit(): void{
//console.log(this.data)
if(this.data.length!=0||this.data!=null){
console.log(this.data)
if(this.data!=null){
this.addgtoup=this.data
}
@ -656,4 +745,44 @@ defineClick(){
this.dialogRef.close(this.data.surveyName=='单位基本信息'?this.addAttinf:this.data.surveyName=='建筑信息'?
this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems)
}
}
}
//灾情设定弹窗
@Component({
selector: 'disaster',
templateUrl: './Disaster.html',
styleUrls: ['./addKeyname.scss']
})
export class disaster{
constructor(private http: HttpClient,public dialogRef: MatDialogRef<disaster>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
ngOnInit(): void{
console.log(this.data)
}
level//类型
headName//表头名称
lieNumber//列数
//取消按钮
close(){
this.dialogRef.close();
}
//确定按钮
newdisaster(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.level==undefined||this.level==''){
this.snackBar.open('请选择类型!','确定',config);
}else if(this.headName==undefined||this.headName==''){
this.snackBar.open('请输入表头名称!','确定',config);
}else{
let attrubute={
headName:this.headName,
level:this.level,
tableth:[]
//lieNumber:this.lieNumber,
}
this.dialogRef.close(attrubute);
}
}
}

3
src/app/ui/ui.module.ts

@ -90,6 +90,7 @@ import { upPlanname } from './plan-template/plan-template.component'
import { addGroup } from './plan-template/plan-template.component'
import { adddwsurvey } from './plan-template/plan-template.component'
import { addattinf } from './plan-template/plan-template.component'
import { disaster } from './plan-template/plan-template.component'
@NgModule({
declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,
@ -101,7 +102,7 @@ import { addattinf } from './plan-template/plan-template.component'
addBuiltInAttributeComponent, addOptionalComponent, addOptionalAttributeComponent, editBuiltInAttributeComponent, editOptionalAttributeComponent, CollectionToolsComponent, WorkingAreaComponent,
CreateBuilding, EditBuilding, leftFunctionalDomainComponent, editPlaneFigureComponent, saveOneDialog, saveTwoDialog, addDisposalNodeComponent, editDisposalNodeComponent, CollectionToolsPlanComponent,
CreateBuildingPlan, EditBuildingPlan, leftFunctionalDomainComponentPlan, editPlaneFigureComponentPlan, addOffices, editOffices, addBGCDisposalNodeComponent, CollectionToolsBuildingComponent, CreateBuildingBuilding,
EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf],
EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster],
imports: [
CommonModule,

Loading…
Cancel
Save