From 5a2e75d9c111fda08be803ccf41722592ddc26be Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Thu, 5 Aug 2021 16:51:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=A2=84=E6=A1=88=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=BC=96=E5=88=B6=E5=8D=95=E4=BD=8D=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../key-unit-management.component.ts | 1 + .../create-plan-online-five.component.html | 145 +++++++++--- .../create-plan-online-five.component.scss | 129 +++++++++++ .../create-plan-online-five.component.ts | 211 +++++++++++++----- .../plan-template.component.scss | 2 +- .../plan-template/plan-template.component.ts | 40 ++-- src/assets/images/search.png | Bin 0 -> 612 bytes src/assets/images/路径 323@2x.png | Bin 0 -> 854 bytes 8 files changed, 420 insertions(+), 108 deletions(-) create mode 100644 src/assets/images/search.png create mode 100644 src/assets/images/路径 323@2x.png diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.ts b/src/app/key-unit/key-unit-management/key-unit-management.component.ts index 8d4ffff..15f23fd 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.ts +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.ts @@ -763,6 +763,7 @@ export class KeyUnitManagementComponent implements OnInit { } //撤销审核 cancelAudit(element){ + this.deleteAll=[] this.http.delete(`/api/ContentVerifies/${element.contentVerify.id}`).subscribe(data=>{ this.getAllKeyUnit() }, diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index 428438f..4ad8d73 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -181,6 +181,54 @@ +
+
+ 模板列表 +
+
+ +
+
@@ -395,8 +443,9 @@ + text-align: center;" > {{element.tableth[tablethi]}} + @@ -414,7 +463,7 @@ + text-align: center;"> {{itemtr.tabletd[tabletdi]}} @@ -435,16 +484,21 @@ [(ngModel)]="itemthj.head" *ngIf="pattern == 'edit'"> + + text-align: center; white-space:pre-wrap; width: 185px;"> + {{itemthj.head}} + + text-align: center;white-space:pre-wrap;width: 185px;"> + {{itemthj.body}} +
{{itemthj.head}} {{itemthj.body}}
@@ -846,12 +900,13 @@ height: 40px; background-color: #ffd91d; text-align: center;"> - - + +
@@ -862,15 +917,18 @@ + text-align: center;height: 40px;width: 185px;"> + {{parts.body[0].name}} + + + text-align: center;"> + {{parts.body[0].value}} + +
{{parts.body[0].name}} {{parts.body[0].value}}
@@ -880,15 +938,20 @@ + text-align: center;"> + {{parts.body[1].name}} + + + text-align: center;"> + {{parts.body[1].value}} + +
{{parts.body[1].name}} {{parts.body[1].value}}
@@ -900,15 +963,19 @@ + text-align: center;"> + {{parts.body[2].name}} + + + text-align: center;"> + {{parts.body[2].value}} + +
{{parts.body[2].name}} {{parts.body[2].value}}
@@ -918,15 +985,19 @@ + text-align: center;"> + {{parts.body[3].name}} + + + text-align: center;"> + {{parts.body[3].value}} + +
{{parts.body[3].name}} {{parts.body[3].value}}
@@ -937,15 +1008,19 @@ + text-align: center;"> + {{parts.body[4].name}} + + + text-align: center;"> + {{parts.body[4].value}} + +
{{parts.body[4].name}} {{parts.body[4].value}}
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss index aa4a66e..dc5c5aa 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss @@ -220,6 +220,135 @@ } } } + .leftnew{ + position: fixed; + width: 14%; + height: 85%; + background-color: white; + top: 66px; + min-width: 300px; + overflow-y: auto; + display: flex; + flex-direction: column; + .newHead{ + width: 100%; + height: 40px; + text-align: center; + background-color: #e1f1ff; + span{ + text-align: center; + font-size: 16px; + color: #2196F3; + height: 40px; + line-height: 40px; + } + } + .newBody{ + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + .search{ + margin: 10px; + width: 280px; + height: 32px; + background-color: #E8E9E9; + border-radius: 20px; + display: flex; + .searchChoose{ + width: 30%; + height: 70%; + margin-top: 2%; + border-right: 1px solid #9EAAB4; + //text-align: center; + select{ + background-color: transparent; + border: 0; + outline: none; + margin-left: 5px; + //height: 22px; + width: 85%; + font-size: 14px; + position: relative; + bottom: 3px; + } + } + .searchText{ + width: 65%; + height: 100%; + input { + margin-left: 2%; + width: 90%; + height: 100%; + border: none; + outline: none; + background-color: #E8E9E9; + //line-height: 32px; + //border-radius: 3px; + } + .queryField { + height: 32px; + //margin: 0 10px; + + } + .ordiv{ + position: relative; + .organizationbox{ + width:280px; + height: 600px; + background: white; + position: absolute; + top: 38px; + right: -40px; + z-index: 999; + border: 1px solid grey; + overflow-y: auto; + li{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + mat-tree-node{ + cursor: pointer; + white-space:pre; + } + mat-tree-node:hover{ + background: rgba(225, 225, 225, 0.8); + } + .closediv{ + z-index: 100; + position: absolute; + right: 0; + top: 0; + width: 30px; + height: 30px; + cursor: pointer; + line-height: 30px; + text-align: center; + } + .closediv:hover{ + background:rgba(225, 225, 225, 0.8); + } + } + + } + .zdy{ + width: 100%; + height: 100%; + } + } + .searImg{ + width: 15%; + height: 100%; + img{ + position: relative; + top: 20%; + left: 10%; + } + } + } + } + } .mainbox { background-color: white; width: 745px; diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts index b1906fa..16b32bf 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts @@ -4,14 +4,21 @@ * @Author: sueRimn * @Date: 2021-06-16 13:56:54 * @LastEditors: sueRimn - * @LastEditTime: 2021-07-30 14:56:55 + * @LastEditTime: 2021-08-05 16:24:21 */ import { HttpClient } from '@angular/common/http'; import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { MatPaginator } from '@angular/material/paginator'; +import { FlatTreeControl } from '@angular/cdk/tree'; +import { FormControl } from '@angular/forms'; +import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; +import { PageEvent } from '@angular/material/paginator'; +import { TreeService } from '../../http-interceptors/tree.service' import Viewer from 'viewerjs'; +import { async } from 'rxjs/internal/scheduler/async'; declare var $: any @Component({ selector: 'app-create-plan-online-five', @@ -20,8 +27,31 @@ declare var $: any }) export class CreatePlanOnlineFiveComponent implements OnInit { - constructor(private http: HttpClient, private route: ActivatedRoute, public snackBar: MatSnackBar, public dialog: MatDialog) { } + constructor(private http: HttpClient, private route: ActivatedRoute, public snackBar: MatSnackBar, public dialog: MatDialog, private tree: TreeService) { } + private _transformer = (node, level: number) => { //初始化tree + return { + expandable: !!node.children && node.children.length > 0, + name: node.name, + level: level, + id: node.id, + parentId: node.parentId, + children: node.children + }; + } + treeControl = new FlatTreeControl(node => node.level, node => node.expandable); + treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); + dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); + myControl = new FormControl(); + hasChild = (_: number, node: any) => node.expandable; + //分页 + @ViewChild(MatPaginator, { static: true }) + pageEvent: PageEvent; + paginator: MatPaginator; + length: any; //共多少条数据 + pageSize: any; //每页条数 + pageSizeOptions: number[] = [10] //设置每页条数 + PageNumber: any; //第几页 planLevel: string//预案级别 blockyl=true @@ -34,29 +64,82 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.pattern='edit' } this.getUnitData() + this.getOrganizations(); //this.getAllBuildings() - this.tree = { - json: this.treedate, - config: this.treeConfig - }; } - //树形结构数据 - treedate = [ - { - "guid": "bc4c7a02-5379-4046-92be-12c67af4295a", - "displayName": "Elentrix", - "children": [ - /* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2", - "28aac445-83b1-464d-9695-a4157dab6eac" */ - ] - } + zdysearch + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 + pcMore//pc更多 + pcput = false//pc收起 + pcfind//pc查询 + padjt = false + + //辖区中队div是否显示 + isorganizationbox: boolean = false + js: any //所选组织机构 + jsId: any //所选组织机构的id + jscheck: boolean //所选组织机构勾选框 + //点击辖区中队树,将选择的辖区中队添加到变量 + add(node) { + this.isorganizationbox = false + this.js = node.name + this.jsId = node.id + } + //关闭辖区中队隐藏框 + closeorganizationbox() { + this.isorganizationbox = false + } + //打开辖区中队隐藏框 + openorganizationbox() { + this.isorganizationbox = true + } + //关闭出现的组织机构div + closediv() { + this.isorganizationbox = false + } + //得到当前单位所在组织机构的tree型数据 + allorganizations: any //所有组织机构 + getpresentOrganization() { + this.newallorganizations = this.allorganizations + this.newallorganizations.forEach(item => { + item.children = [] + this.newallorganizations.forEach(element => { + if (element.parentId == item.id) { + item.children.push(element) + } + }); + }); + this.http.get("/api/Account/Profiles").subscribe( + (data: any) => { + this.organizationName = data.organizationName + if (this.organizationName) { + this.newallorganizations.forEach(item => { + if (item.name == this.organizationName) { + this.dataSource.data = [item] + } + }); + } else { + this.dataSource.data = this.tree.toTree(this.treedata); + } + } + ) - ] - tree - treeConfig = { - nodeWidth: 90, - nodeHeight: 60 - }; + } + //获得所有组织机构 + getOrganizations() { + this.http.get('/api/Organizations').subscribe( + (data: any) => { + this.allorganizations = data + this.treedata = this.tree.toTree(data); + this.getpresentOrganization(); + } + ) + } + + //获得单位信息 unitData: any @@ -68,7 +151,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { data.items.forEach(element => { if (element.id == this.route.snapshot.queryParams.companyId) { this.unitData = element - // console.log('单位列表信息', this.unitData) + console.log('单位列表信息', this.unitData) this.getTemplateData() } }); @@ -76,7 +159,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { } selectedItem: string = '封面' - clickTitleItem(item) { + async clickTitleItem(item) { this.addNumber = -1 this.selectedItem = item.groupName if (this.selectedItem == '重点图示') { @@ -84,7 +167,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit { this.getSitePlan() this.getRealPicture() } else if (this.selectedItem == '单位概况') { - this.getAllBuildings() + await this.getAllBuildings() + this.planTemplateData[1].building.forEach(element => { + element.body[0].attinf[0].olddata = this.unitData.usci + element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name + element.body[0].attinf[2].olddata = this.unitData.contacts + element.body[0].attinf[3].olddata = this.unitData.phone + element.body[0].attinf[4].olddata = this.unitData.organizationName + element.body[0].attinf[5].olddata = this.unitData.address + }); this.planTemplateData[1].attribute[0].attinf[0].value=this.planTemplateData[1].attribute[0].attinf[0].olddata = this.unitData.usci this.planTemplateData[1].attribute[0].attinf[1].value=this.planTemplateData[1].attribute[0].attinf[1].olddata = this.unitData.buildingTypes[0].name @@ -161,11 +252,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //获得模板信息 getTemplateData() { this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { - // console.log('预案内容', data) + console.log('预案内容', data) this.planTemplateData = JSON.parse(data.webTextData).filter(item => item.completed == true ) - // console.log(this.planTemplateData) + //console.log(this.planTemplateData) if (this.planTemplateData[0].groupName != '封面') { let obj = { completed: true, @@ -193,6 +284,9 @@ 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) { @@ -309,38 +403,42 @@ export class CreatePlanOnlineFiveComponent implements OnInit { unitId: any = this.route.snapshot.queryParams.companyId //获得所有的建筑物 allBuildings: any - getAllBuildings() { - this.http.get("/api/Buildings", { - params: { - companyId: this.unitId - } - }).subscribe((data: any) => { - data.forEach((item, index) => { - let params = { buildingId: item.id } - item.plandata = [] - this.http.get('/api/BuildingAreas', { params }).subscribe(data => { - item.plandata = data + async getAllBuildings() { + let result = await new Promise((resolve, reject) => { + this.http.get("/api/Buildings", { + params: { + companyId: this.unitId + } + }).subscribe((data: any) => { + data.forEach((item, index) => { + let params = { buildingId: item.id } + item.plandata = [] + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + item.plandata = data + resolve(data) + }) }) - }) - this.allBuildings = data - if (this.planTemplateData[1].building == undefined) { - this.planTemplateData[1].building = [] - for (var i = 0; i < this.allBuildings.length; i++) { - if (i == 0) { - this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: true }) - } else { - this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: false }) + this.allBuildings = data + if (this.planTemplateData[1].building == undefined) { + this.planTemplateData[1].building = [] + for (var i = 0; i < this.allBuildings.length; i++) { + if (i == 0) { + this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: true }) + } else { + this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: false }) + } + } - } - } - - console.log(this.planTemplateData) - //this.buildingName=this.planTemplateData[1].building[0].name - this.group = this.planTemplateData[1].building - //delete this.planTemplateData[0].attribute - + + //console.log(this.planTemplateData) + //this.buildingName=this.planTemplateData[1].building[0].name + this.group = this.planTemplateData[1].building + //delete this.planTemplateData[0].attribute + + }) }) + } //获取总平面图 sitePlanItems: any @@ -599,7 +697,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit { oldData=false clickoldData(){ this.oldData=!this.oldData + } + //新增功能(社会联动等引用) + searchType='0' } diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss index ac1e15d..1181a0d 100644 --- a/src/app/ui/plan-template/plan-template.component.scss +++ b/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-15 10:44:55 + * @LastEditTime: 2021-08-02 09:47:06 */ .box { height: 100%; diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index bfc4330..2125b63 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-05-31 10:40:01 * @LastEditors: sueRimn - * @LastEditTime: 2021-07-28 14:37:50 + * @LastEditTime: 2021-08-04 15:30:24 */ import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core'; @@ -131,7 +131,7 @@ export class PlanTemplateComponent implements OnInit { } //修改模板 - upPlan(item,i,operation){ + async upPlan(item,i,operation){ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -141,7 +141,7 @@ export class PlanTemplateComponent implements OnInit { disableClose:true, data:{item:item,plandata:this.newleftTabledata} }); - dialogRef.afterClosed().subscribe(result => { + dialogRef.afterClosed().subscribe(async result => { console.log(result) if(result!=undefined){ //this.newleftTabledata[i].name=result.name @@ -176,22 +176,28 @@ export class PlanTemplateComponent implements OnInit { planCategory:Number(result.planCategory), data:null } - this.http.post("/api/PlanTemplate",savaData).subscribe((data:any)=>{ - this.newleftTabledata[this.newleftTabledata.length-1].id='' - this.newleftTabledata[this.newleftTabledata.length-1].id=data.id - let body={ - id:data.id, - basicCategoryId:result.basicCategoryId, - buildingTypeId:result.buildingTypeId, - planCategory:Number(result.planCategory), - data:JSON.stringify(this.newleftTabledata[this.leftclicki].data) - } - this.http.put(`/api/PlanTemplate/${data.id}`,body).subscribe((data:any)=>{ - this.snackBar.open('复制成功!','确定',config); - console.log(data) + let aaa = await new Promise((resolve, reject)=>{ + delete this.newleftTabledata[this.leftclicki].data[0].attribute[1].attinf + delete this.newleftTabledata[this.leftclicki].data[0].attribute[3].attinf + this.http.post("/api/PlanTemplate",savaData).subscribe((data:any)=>{ + this.newleftTabledata[this.newleftTabledata.length-1].id='' + this.newleftTabledata[this.newleftTabledata.length-1].id=data.id + let body={ + id:data.id, + basicCategoryId:result.basicCategoryId, + buildingTypeId:result.buildingTypeId, + planCategory:Number(result.planCategory), + data:JSON.stringify(this.newleftTabledata[this.leftclicki].data) + } + this.http.put(`/api/PlanTemplate/${data.id}`,body).subscribe((data:any)=>{ + resolve(data) + this.snackBar.open('复制成功!','确定',config); + }) + //this.getLeftdata() }) - this.getLeftdata() }) + + this.getLeftdata() } } diff --git a/src/assets/images/search.png b/src/assets/images/search.png new file mode 100644 index 0000000000000000000000000000000000000000..87813c6d06650cddf2686dbee45f3e20905aa4c1 GIT binary patch literal 612 zcmV-q0-ODbP)Px%9!W$&R5(wKlD}(HQ546&-h1@_2VunVOI3#)R$V;1=v}kju%f07(&iBjt z5+f&^t4>Q`?x7OIK#4+l0T2zc3`M(|Fu#n}dv^{W!uId0q_YiT0fIUdJ_^{Ti_3s4 zfiPTwU2B+6kYj(?Hvo9eP)?aZTU=yy#wv~}Tip-ijIm1KmH1@~6Y))~(4FOkM)5tMY=y8S=EVc2$rc&}3jwSypq@~t&RWJK^v zH_Ys4(ngaCIwcbGJ#jD9(=)q&qnr~X9O!Hk5`)ODK-n(2BmG`e8BPx&5J^NqR9Hv7S3y?WFcAHd7HD7XG~7TrL34w`37{t^EO8cu6A(^7x^P&Mo}l3b zq$eOZh&TaBoW3@p&GgA8j_lZ${7TVQqtTz4ubD4`#S)iX!_JQbfDZxGz}z6B8Z(bU zGz2gPsE_%(8+k@!3zxA86&Z`Gp90Irb0Rvjb;`^=RJJbU$y;f2CKrI{2A2f1Y@B4- zFwl{nduBSn0U%8G_Ux7jjpSjTFwh4oLlCR9M{9{a01YDE1L(behJgX*&ZnZXBmhLU z4(TxrRs(=$aQ{Gd(5Egc9mhFCcJc_5Mi{NPTHoEbM*I7elO6$LTt6Yy~b zSY<+b?tWGPF#zEQ9U`2r5Aj#&RjtXFb}qWp9)Ui`{umds>9*5$Appg8;@>09_(nEe z_2m9(iEc1RWP)DT)2|}}kU+~5p1Yz<+VfDVa?nm7SDavMW|bnN*~2<|I<_I4ZE7N7 z;ym_0cXsvQNcgiOBEF6ccrx;;HCyL4cBTMH_(7it2jTS@DYCi5WK(np=|o}Bne?2F z$zj=jy$lR|m!7MdSGY*{(+4$J!VD1h<%v5edx6Pbbf<>|`u3D%DZOev22k$?924Y! z0k{hGh;h5RXXLqY|Dk$!szzzp!(So;V7?zUt8uGOav-N$nNn=pH*i3E1&n9ufN4O* zuR!YqO5w<6b=MS8nSFB~NO!_#eu~CUsG`wlL8$W4DY3jrnb%={6XjqbWHx1>;VbKpn{` zB_ck=-BEF(LLK~az7+8ylwxmYr&w}pRdd~Uo;J)@#VJh}gHfuOFvK4oqC#UVxrSHN z0HZ;GQ9)&a$p06lghW{`sG4KpbT%`ZRLSO_5kIzdacKggGzDm@z0!V9DmhiwHHbn0 zF*&3Ef|}unYJ#i(VaOBadnS?qt8Z8zb9a!%lOhmS08CNa>}P@i)c@h-Ru+gC1rRp8 gs895i4rQj}zoE*|_?2{X0000007*qoM6N<$g1B0LE&u=k literal 0 HcmV?d00001