Browse Source

[修改]三维预案审核状态可修改url

tangshan
陈敬瑜 3 years ago
parent
commit
f49e55cce0
  1. 145
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  2. 16
      src/app/plan-management/entry-plan-look/changeUrl.html
  3. 2
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  4. 51
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  5. 3
      src/app/plan-management/plan-management.module.ts

145
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -460,7 +460,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//console.log(this.buildingsData)
if (this.planTemplateData[index].building == undefined) {
this.planTemplateData[index].building = []
if (this.planTemplateData[index].attribute[1].attinf != undefined) {
/* if (this.planTemplateData[index].attribute[1].attinf != undefined) {
this.planTemplateData[index].attribute[1].attinf.forEach(pData => {
this.buildingsData.forEach((bDara, bi, bArr) => {
if (bDara.buildingBasicGroups.length > 0) {
@ -470,7 +470,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
})
});
}
} */
for (var i = 0; i < this.buildDataName.length; i++) {
if (i == 0) {
@ -567,20 +567,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
groupName: "单位概况"
}
getTemplateData() {
console.log(this.planTemplateData)
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data)
/* if(this.route.snapshot.queryParams.haveNew==true){
this.planTemplateData=[]
this.planTemplateData.push(this.danweInfo)
} */
/* this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true
) */
this.planTemplateData=JSON.parse(data.webTextData)
console.log(this.planTemplateData)
if (this.planTemplateData[0].groupName != '封面') {
if(this.route.snapshot.queryParams.haveNew!=undefined){
this.planTemplateData=[]
let obj = {
completed: true,
groupName: "封面",
@ -606,59 +595,99 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
this.planTemplateData.unshift(obj)
}
else if (this.planTemplateData[0].groupName == '封面') {
this.planTemplateData[0].attribute.objName = this.unitData.name
}
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
this.planTemplateData.push(this.danweInfo)
this.planTemplateData.push({completed: true,groupName: '新建'})
console.log(this.planTemplateData)
}else{
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data)
this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true
)
//this.planTemplateData=JSON.parse(data.webTextData)
console.log(this.planTemplateData)
if (this.planTemplateData[0].groupName != '封面') {
let obj = {
completed: true,
groupName: "封面",
attribute: {
planNumber: '',
planName: this.route.snapshot.queryParams.planName,
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '火灾',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
producer: {
name: '',
duty: ''
},
verifier: {
name: '',
duty: ''
},
auditTime: ''
}
}
this.planTemplateData.unshift(obj)
}
if (element.groupName == '交通水源') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
else if (this.planTemplateData[0].groupName == '封面') {
this.planTemplateData[0].attribute.objName = this.unitData.name
}
if (element.groupName == '预案附件') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
}
if (element.groupName == '处置要点') {
if (!element.attribute) {
element.attribute = [{ name: '', content: '' }]
if (element.groupName == '交通水源') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
}
if (element.groupName == '特别警示') {
if (!element.attribute) {
element.attribute = [{ name: '特别警示', content: '' }]
if (element.groupName == '预案附件') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
}
if(element.groupName=='单位概况'){
this.clickTitleItem(this.planTemplateData[1])
}
});
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){
this.planTemplateData.push({completed: true,groupName: '新建'})
}
this.planTemplateData.forEach(element => {
if(element.attribute!=undefined){
/* element.attribute.forEach((item,index,value) => {
if(value[index].level!=undefined&&value[index].level==1){
value[index].lieNumber=value[index].tableth.length
if (element.groupName == '处置要点') {
if (!element.attribute) {
element.attribute = [{ name: '', content: '' }]
}
}); */
for(let i=0;i<element.attribute.length;i++){
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){
element.attribute[i].lieNumber=element.attribute[i].tableth.length
}
if (element.groupName == '特别警示') {
if (!element.attribute) {
element.attribute = [{ name: '特别警示', content: '' }]
}
}
if(element.groupName=='单位概况'){
this.clickTitleItem(this.planTemplateData[1])
}
});
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){
this.planTemplateData.push({completed: true,groupName: '新建'})
}
});
console.log(this.planTemplateData)
})
this.planTemplateData.forEach(element => {
if(element.attribute!=undefined){
/* element.attribute.forEach((item,index,value) => {
if(value[index].level!=undefined&&value[index].level==1){
value[index].lieNumber=value[index].tableth.length
}
}); */
for(let i=0;i<element.attribute.length;i++){
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){
element.attribute[i].lieNumber=element.attribute[i].tableth.length
}
}
}
});
console.log(this.planTemplateData)
})
}
}
//引入数据json

16
src/app/plan-management/entry-plan-look/changeUrl.html

@ -0,0 +1,16 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="topbox" style="text-align: center;">
<span mat-dialog-title>更改三维预案路径</span>
</div>
<div class="mainbox">
<mat-form-field>
<input matInput placeholder="更改三维预案路径" [(ngModel)]="planUrl"
name='name' required>
</mat-form-field>
</div>
<div class="btn" style="margin-top:10px;">
<button mat-raised-button color="primary" >确定</button>
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button>
</div>
</form>

2
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -90,7 +90,7 @@
<span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16">查看</span>
<span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8||element.planType==2">删除</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)"
*ngIf="element.auditStatus==8">提交审核</span>

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

@ -258,7 +258,7 @@ export class EntryPlanLookComponent implements OnInit {
}
else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) {
/* if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
@ -267,7 +267,21 @@ export class EntryPlanLookComponent implements OnInit {
} else {
window.open(`/planManagement/webLook`)
}
}
} */
const dialogRef = this.dialog.open(ChangeUrl, {
data: { element: e }
});
dialogRef.afterClosed().subscribe(
data => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功!', '确定', config);
this.getAllPlanComponents()
}
}
);
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
@ -1427,3 +1441,36 @@ export class ImgDetails {
if (this.rotationAngle === 360) { this.rotationAngle = 0 }
}
}
//修改三维预案地址
@Component({
selector: 'changename',
templateUrl: './changeurl.html',
styleUrls: ['./entry-plan-look.component.scss']
})
export class ChangeUrl{
constructor(private http: HttpClient, public dialogRef: MatDialogRef<ChangeUrl>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
planUrl: any//预案路径
ngOnInit(): void {
this.planUrl = this.data.element.url
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(value) {
let headers = new HttpHeaders({
'Content-Type': 'text/json'
});
let options = {
headers
};
let body = {
url: value.url,
auditStatus:8
}
this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => {
this.dialogRef.close("success");
})
}
}

3
src/app/plan-management/plan-management.module.ts

@ -73,12 +73,13 @@ import { yinYong } from './create-plan-online-five/create-plan-online-five.compo
import { newTitle } from './create-plan-online-five/create-plan-online-five.component'
import { disaster } from './create-plan-online-five/create-plan-online-five.component'
import { updataHl } from './create-plan-online-five/create-plan-online-five.component'
import {ChangeUrl} from './entry-plan-look/entry-plan-look.component'
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent,
OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl],
OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl,ChangeUrl],
imports: [
CommonModule,
PlanManagementRoutingModule,

Loading…
Cancel
Save