Browse Source

[修改]三维预案非审核编辑弹窗

tangshan
陈敬瑜 3 years ago
parent
commit
affc0c4378
  1. 4
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 7
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  3. 288
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  4. 40
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  5. 4
      src/app/ui/plan-template/plan-template.component.ts

4
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -721,6 +721,7 @@
opacity: 1;
height: 40px;
line-height: 40px;">{{itemunit.name}}</span>
<img src="../../../assets/images/update.png" *ngIf="haveNew!=undefined" (click)='unitZdyaaa()'>
</div>
<div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%;
width: 100%;
@ -738,7 +739,8 @@
color: #ffffff;">{{element.surveyName}}</span>
<!-- <img src="../../../assets/images/deletered.png" > -->
<img src="../../../assets/images/addbai.png"
(click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'&&element.surveyName!='进攻通道'">
(click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'">
<img src="../../../assets/images/delyello.png" *ngIf="haveNew!=undefined">
</div>
<div class="body">
<!-- 进攻通道 -->

7
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -744,6 +744,13 @@
height: 40px;
line-height: 40px;
}
img{
cursor: pointer;
float: right;
position: relative;
top: 10px;
right: 10px;
}
}
.unitbody {
height: 100%;

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

@ -20,6 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service'
import Viewer from 'viewerjs';
import { async } from 'rxjs/internal/scheduler/async';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { adddwsurvey, addGroup } from '@src/app/ui/plan-template/plan-template.component';
declare var $: any
@Component({
selector: 'app-create-plan-online-five',
@ -57,7 +58,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planLevel: string//预案级别
blockyl = true
zaixianDr=false
haveNew=false
ngOnInit(): void {
this.haveNew=this.route.snapshot.queryParams.haveNew
console.log(this.route.snapshot.queryParams.wordChange)
this.planLevel = this.route.snapshot.queryParams.planCategory
if (this.route.snapshot.queryParams.pattern == 'false') {
@ -357,13 +360,29 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
let index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.planTemplateData[index].building.forEach(element => {
if(element.body[0].completed){
element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci
element.body[0].attinf.forEach((arrval,atti,attarr) => {
if(arrval.propertyName=='统一社会信用代码'){
arrval.value=arrval.olddata=this.unitData.usci
}else if(arrval.propertyName=='单位类型'){
arrval.value=arrval.olddata=this.unitData.buildingTypes[0].name
}else if(arrval.propertyName=='联系人'){
arrval.value=arrval.olddata=this.unitData.contacts
}else if(arrval.propertyName=='联系电话'){
arrval.value=arrval.olddata=this.unitData.phone
}else if(arrval.propertyName=='辖区中队'){
arrval.value=arrval.olddata=this.unitData.organizationName
}else if(arrval.propertyName=='单位地址'){
arrval.value=arrval.olddata=this.unitData.address
}
});
/* element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci
element.body[0].attinf[1].value = element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name
element.body[0].attinf[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts
element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone
element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address
if (element.body[1].attinf != undefined) {
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address */
if (element.body.length>1&&element.body[1].attinf != undefined) {
element.body[1].attinf.forEach(eBuild => {
this.buildZong.forEach(oldBuild => {
if (oldBuild.buildingBasicGroups.length > 0) {
@ -378,8 +397,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
});
console.log(this.planTemplateData)
} else if (this.selectedItem == '预案附件') {
this.getTwoDPlanList()
@ -567,127 +584,125 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
groupName: "单位概况"
}
getTemplateData() {
if(this.route.snapshot.queryParams.haveNew!=undefined){
this.planTemplateData=[]
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)
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 != '封面') {
if(this.route.snapshot.queryParams.haveNew!=undefined&&data.webTextData==null){
this.planTemplateData=[]
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: ''
}
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)
}
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 if(data.webTextData!=null){
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
@ -1430,6 +1445,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
console.log(bodyi)
if(arr[bodyi].zdy==undefined){
if (surveyName == '进攻通道') {
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) {
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr = []
}
@ -1452,11 +1470,17 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] })
}
else if(surveyName == '单位基本信息'||surveyName == '建筑信息'){
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true })
} else if(surveyName == '四周毗邻'){
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:false })
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true })
}else if(surveyName == '消防设施'){
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
if(fileNum==0){
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true})
}else{
@ -1844,6 +1868,47 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
console.log(this.planTemplateData)
});
}
//单位概况自定义新增数据
unitZdyaaa(){
let list=[]
let index = this.getArrayIndex(this.planTemplateData,'单位概况')
const dialogRef = this.dialog.open(adddwsurvey, {//调用open方法打开对话框并且携带参数过去
width: '240px',
height:'420px',
disableClose:true,
data:this.planTemplateData
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result!=undefined){
if(result.length>this.planTemplateData.length){
result.forEach((valuer,i,rarr) => {
let temp=0
this.planTemplateData[index].attribute.forEach((group,gi,garr) => {
if(valuer.surveyName==group.surveyName){
temp++
}
})
if(temp==0){
//将缺少的填上
this.planTemplateData[index].attribute.push(valuer)
}
});
}
result.forEach((valuer,i,rarr) => {
this.planTemplateData[index].attribute.forEach((group,gi,garr) => {
if(garr[gi].surveyName==rarr[i].surveyName){
garr[gi].completed=rarr[i].completed
}
});
})
this.planTemplateData[index].building[this.clicki].body=this.planTemplateData[index].attribute
}
console.log(this.planTemplateData)
})
}
}
@ -2056,4 +2121,5 @@ export class updataHl{
}
this.dialogRef.close(result);
}
}
}

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

@ -187,7 +187,12 @@ export class EntryPlanLookComponent implements OnInit {
}
else if (e.planType == 16) {
if (e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`)
if(e.planMode==4){
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`)
}else{
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`)
}
}
else {
let body = {};
@ -208,7 +213,22 @@ export class EntryPlanLookComponent implements OnInit {
}
else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) {
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()
}
}
);
/* if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
@ -217,7 +237,7 @@ export class EntryPlanLookComponent implements OnInit {
} else {
window.open(`/planManagement/webLook`)
}
}
} */
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
@ -279,6 +299,7 @@ export class EntryPlanLookComponent implements OnInit {
config.duration = 3000
this.snackBar.open('修改成功!', '确定', config);
this.getAllPlanComponents()
}
}
);
@ -950,7 +971,7 @@ export class AddPlanone {
this.inputword = true
this.onlineedit = false
this.website = false
this.inputNew=false
this.inputNew=true
}
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4'
this.localup = true
@ -1038,7 +1059,7 @@ export class AddPlanone {
id: "",
name: this.selectedPLanName,
planType: Number(this.selectedPLanType),
planMode: 2,
planMode: Number(this.defaultisshow),
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
@ -1451,6 +1472,7 @@ export class ImgDetails {
export class ChangeUrl{
constructor(private http: HttpClient, public dialogRef: MatDialogRef<ChangeUrl>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
planUrl: any//预案路径
updata//修改后的data
ngOnInit(): void {
this.planUrl = this.data.element.url
}
@ -1469,7 +1491,15 @@ export class ChangeUrl{
auditStatus:8
}
this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => {
console.log(data)
this.updata=data
this.dialogRef.close("success");
sessionStorage.setItem("url", this.updata.url)
if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
})
}

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

@ -1245,10 +1245,10 @@ export class adddwsurvey{
addwsurvey=[
{surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},
{surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]},
{surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false},
{surveyName:'消防设施',completed:false},
{surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]},
{surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]}
]
]//{surveyName:'进攻通道',completed:false},
ngOnInit(): void{
console.log(this.data)
this.data=JSON.parse(JSON.stringify(this.data))

Loading…
Cancel
Save