diff --git a/src/app/plan-management/entry-plan/entry-plan.component.html b/src/app/plan-management/entry-plan/entry-plan.component.html index 0326b12..9ac17a9 100644 --- a/src/app/plan-management/entry-plan/entry-plan.component.html +++ b/src/app/plan-management/entry-plan/entry-plan.component.html @@ -1,161 +1,176 @@
-
+
-
- -
- - - - -
-
- - - - - {{unit.name}} - - - - 更多筛选条件 - 收起 -
-
- - -
-
- - - - - 包含下级 - -
-
clear
- - - -
  • {{node.name}}
  • -
    - - -
  • {{node.name}}
  • -
    -
    -
    -
    -
    - - - - 文本预案 - 二维预案 - 三维预案 - 其他预案 - - - 更多筛选条件 - 收起 -
    -
    - - -
    -
    - - - - Ⅲ级预案 - Ⅳ级预案 - Ⅴ级预案 - - -
    -
    - - - - - {{item.name}} - - - 包含下级 + {{item.name}} + + + + 包含下级 +
    +
    + + + + 未提交审核 + 审核中 + 审核通过 + 审核退回 + + +
    +
    + + + + 从高到低 + 从低到高 + + +
    +
    + + + + 有预案 + 无预案 + + +
    +
    + + + + 新增 + 维护更新 + + +
    +
    + + + + 新增 + 维护更新 + + +
    +
    + 模板录入预案 +
    +
    + 自定义预案
    -
    - - - - 未提交审核 - 审核中 - 审核通过 - 审核退回 - - -
    - - -
    - - - - 从高到低 - 从低到高 - -
    -
    - - - - 有预案 - 无预案 - - -
    -
    - - - - 新增 - 维护更新 - - -
    -
    - - - - 新增 - 维护更新 - - -
    -
    - + @@ -169,7 +184,8 @@ {{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}% -
    +
    @@ -178,96 +194,123 @@ 总占比
    -
      +
      • 单位信息
        -
        +
        +
        - {{(element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}% + {{(element.company.companyIntegrityScore.basicInfoScore * + 5).toFixed(1)}}%
        -
        5%
        +
        5%
      • 建筑信息
        -
        +
        +
        - {{(element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.buildingInfoScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • 平面图
        -
        +
        +
        - {{(element.company.companyIntegrityScore.planImageScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.planImageScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • 四周毗邻
        -
        +
        +
        - {{(element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.adjoinScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • 消防设施
        -
        +
        +
        - {{(element.company.companyIntegrityScore.facilityScore * 25).toFixed(1)}}% + {{(element.company.companyIntegrityScore.facilityScore * + 25).toFixed(1)}}%
        -
        25%
        +
        25%
      • 重点部位
        -
        +
        +
        - {{(element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.importantLocationScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • 功能分区
        -
        +
        +
        - {{(element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.functionalDivisionScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • 实景图
        -
        +
        +
        - {{(element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.realityImageScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
      • CAD上传
        -
        +
        +
        - {{(element.company.companyIntegrityScore.cadScore * 10).toFixed(1)}}% + {{(element.company.companyIntegrityScore.cadScore * + 10).toFixed(1)}}%
        -
        10%
        +
        10%
    @@ -286,40 +329,38 @@
    - + - + - - + + - - + + - - + +
    单位状态 - 新增 - 维护更新 + 新增 + 维护更新 消防救援站 {{element.company.organizationName}} 单位类型{{element.company.buildingTypes[0] ? element.company.buildingTypes[0].name : ''}}{{element.company.buildingTypes[0] ? + element.company.buildingTypes[0].name : ''}} 预案类型{{element.planType}}预案类型{{element.planType}} 审核状态{{element.auditStatus}}审核状态{{element.auditStatus}} 编制级别{{element.planLevel}}编制级别{{element.planLevel}} 操作 - 查看预案 + 查看预案
    - - + + - +
    diff --git a/src/app/plan-management/entry-plan/entry-plan.component.spec.ts b/src/app/plan-management/entry-plan/entry-plan.component.spec.ts deleted file mode 100644 index 8b4ef5a..0000000 --- a/src/app/plan-management/entry-plan/entry-plan.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EntryPlanComponent } from './entry-plan.component'; - -describe('EntryPlanComponent', () => { - let component: EntryPlanComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EntryPlanComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(EntryPlanComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/entry-plan/entry-plan.component.ts b/src/app/plan-management/entry-plan/entry-plan.component.ts index 58cb926..21d745e 100644 --- a/src/app/plan-management/entry-plan/entry-plan.component.ts +++ b/src/app/plan-management/entry-plan/entry-plan.component.ts @@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -17,8 +17,8 @@ import { ConstantPool } from '@angular/compiler'; }) export class EntryPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } - + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -35,247 +35,247 @@ export class EntryPlanComponent implements OnInit { myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 - IsNewData='' //预案维护更新或者新增 - IsNewCompanyData=''//单位维护更新或者新增 + PageNumber: any; //第几页 + IsNewData = '' //预案维护更新或者新增 + IsNewCompanyData = ''//单位维护更新或者新增 - displayedColumns: string[] = ['state','unitname','integrity','level','jurisdictionsquadron', 'unittype','plantype', 'passstate','projectlevel','operation']; - allorganizations:any //所有组织机构 - allunittype:any //所有单位类型 - tabledataSource:any //表格数据 + displayedColumns: string[] = ['state', 'unitname', 'integrity', 'level', 'jurisdictionsquadron', 'unittype', 'plantype', 'passstate', 'projectlevel', 'operation']; + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource: any //表格数据 - organizationName:any //当前单位组织机构名称 - preparelevels:any - integritySort:any //完整度排序 + organizationName: any //当前单位组织机构名称 + preparelevels: any + integritySort: any //完整度排序 haveyuan//有无预案 - colorRgb(sColor){ + colorRgb(sColor) { var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var sColor = sColor.toLowerCase(); if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - var sColorNew = "#"; - for (var i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); } - //处理六位的颜色值 - var sColorChange = []; - for (var i = 1; i < 7; i += 2) { - sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); - } - return sColorChange; + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return sColorChange; } else { - return sColor; + return sColor; } } - colorHex(rgb){ + colorHex(rgb) { var _this = rgb; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; if (/^(rgb|RGB)/.test(_this)) { - var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); - var strHex = "#"; - for (var i = 0; i < aColor.length; i++) { - var hex:any = Number(aColor[i]).toString(16); - hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 - if (hex === "0") { - hex += hex; - } - strHex += hex; - } - if (strHex.length !== 7) { - strHex = _this; + var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); + var strHex = "#"; + for (var i = 0; i < aColor.length; i++) { + var hex: any = Number(aColor[i]).toString(16); + hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 + if (hex === "0") { + hex += hex; } - return strHex; + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; } else if (reg.test(_this)) { - var aNum = _this.replace(/#/, "").split(""); - if (aNum.length === 6) { - return _this; - } else if (aNum.length === 3) { - var numHex = "#"; - for (var i = 0; i < aNum.length; i += 1) { - numHex += (aNum[i] + aNum[i]); - } - return numHex; + var aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } else if (aNum.length === 3) { + var numHex = "#"; + for (var i = 0; i < aNum.length; i += 1) { + numHex += (aNum[i] + aNum[i]); } + return numHex; + } } else { - return _this; + return _this; } } gradientColor(startColor, endColor, step) { let _this = this - let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 - let startR = startRGB[0]; - let startG = startRGB[1]; - let startB = startRGB[2]; + let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 + let startR = startRGB[0]; + let startG = startRGB[1]; + let startB = startRGB[2]; - let endRGB = _this.colorRgb(endColor); - let endR = endRGB[0]; - let endG = endRGB[1]; - let endB = endRGB[2]; + let endRGB = _this.colorRgb(endColor); + let endR = endRGB[0]; + let endG = endRGB[1]; + let endB = endRGB[2]; - let sR = (endR - startR) / step;//总差值 - let sG = (endG - startG) / step; - let sB = (endB - startB) / step; + let sR = (endR - startR) / step;//总差值 + let sG = (endG - startG) / step; + let sB = (endB - startB) / step; var colorArr = []; for (var i = 0; i < step; i++) { - //计算每一步的hex值 - var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); - colorArr.push(hex); + //计算每一步的hex值 + var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')'); + colorArr.push(hex); } return colorArr; -} - integrity(width){ + } + integrity(width) { let _this = this - - let style:any = {} - style.width = width +'%'; - if(width < 30){ - let colorArr = this.gradientColor('#D50000', '#E53935', 30); - for(let i = 0; i < 30; i++){ - if( i == width){ + + let style: any = {} + style.width = width + '%'; + if (width < 30) { + let colorArr = this.gradientColor('#D50000', '#E53935', 30); + for (let i = 0; i < 30; i++) { + if (i == width) { style.background = colorArr[i] } } } - if(width >= 30 && width < 60){ - let colorArr = this.gradientColor('#FF9800', '#E65100', 30); - for(let i = 30; i < 60; i++){ - if( i == width){ - style.background = colorArr[i-30] + if (width >= 30 && width < 60) { + let colorArr = this.gradientColor('#FF9800', '#E65100', 30); + for (let i = 30; i < 60; i++) { + if (i == width) { + style.background = colorArr[i - 30] } } } - if(width >= 60){ - let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); - for(let i = 60; i <= 100; i++){ - if( i == width){ - style.background = colorArr[i-60] + if (width >= 60) { + let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); + for (let i = 60; i <= 100; i++) { + if (i == width) { + style.background = colorArr[i - 60] } } } return style } - integrityDetails(width,zong){ - let style:any = {} - style.width = (width/zong)*100 +'%'; + integrityDetails(width, zong) { + let style: any = {} + style.width = (width / zong) * 100 + '%'; return style } level - + ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllPlanInfo(); this.level = sessionStorage.getItem("level"); - if(this.level == "0"){//如果是总队 + if (this.level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.level == "1"){//如果是支队 + if (this.level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.level == "2"){//如果是大队 + if (this.level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.level == "3"){//如果是中队 + if (this.level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } //得到当前单位信息 - getunitdata(){ + getunitdata() { this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations - + this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ + (data: any) => { this.organizationName = data.organizationName - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] } }); - }else{ + } else { this.dataSource.data = this.tree.toTree(this.treedata); } } ) - - + + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -283,21 +283,21 @@ export class EntryPlanComponent implements OnInit { ) } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanInfo(); } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -309,72 +309,78 @@ export class EntryPlanComponent implements OnInit { this.isorganizationbox = true } //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } - allPlanInfo:any //存储所有预案信息 + allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - getAllPlanInfo(){ + templatePlan: boolean = false//模板录入预案checkbox + customPlan: boolean = false//自定义预案 + getAllPlanInfo() { + let planmode = [] + this.templatePlan ? planmode.push(2) : null + this.customPlan ? planmode.push(4) : null let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' - if(this.reservePlanType && this.reservePlanType.length != 0){ + if (this.reservePlanType && this.reservePlanType.length != 0) { reservePlanType = eval(this.reservePlanType.join("|")) - } - let paramsdata:any = { + } + let paramsdata: any = { CompanyName: this.companyName || '', OrganizationId: this.jsId || '', - HasChildrenOrganization:this.jscheck || '', - BuildingTypeId: this.unittype || '', + HasChildrenOrganization: this.jscheck || '', + BuildingTypeId: this.unittype || '', PlanType: reservePlanType || '', AuditStatus: this.toExamine || '', - PlanLevel: this.preparelevel || '', + PlanLevel: this.preparelevel || '', HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: this.integritySort ? 'integrityscore' : '', SortType: this.integritySort || '', - HasPlanComponents:this.haveyuan||'', - PlanCategories:this.planCategory, - IsNewData:this.IsNewData, - IsNewCompanyData:this.IsNewCompanyData + HasPlanComponents: this.haveyuan || '', + PlanCategories: this.planCategory, + IsNewData: this.IsNewData, + IsNewCompanyData: this.IsNewCompanyData, + PlanModes: planmode } - this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/Plans", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.allPlanInfo = data - + this.tabledataSource = data.items }) } - operation=true + operation = true //查看预案按钮跳转 - routerTo(element){ - this.level=='0'?this.operation=false:true - sessionStorage.setItem("companyName",element.company.name) - window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=${this.operation}&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&orId=${element.company.organizationId}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}&usci=${element.company.usci}`); + routerTo(element) { + this.level == '0' ? this.operation = false : true + sessionStorage.setItem("companyName", element.company.name) + window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].id}&operation=${this.operation}&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&orId=${element.company.organizationId}&unitType=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].name}&unitAdd=${element.company.address}&usci=${element.company.usci}`); } //查询 - onSubmit (value) { + onSubmit(value) { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAllPlanInfo() } - companyName:any //单位名称 - js:any //所选组织机构 - jsId:any //所选组织机构的id - jscheck:boolean //所选组织机构勾选框 - unittype:any //单位类型 - reservePlanType:any //预案类型 - toExamine:any //审核状态 - preparelevel:any //编制级别 - plcheck:boolean //编制级别勾选框 - planCategory=[] //预案级别 + companyName: any //单位名称 + js: any //所选组织机构 + jsId: any //所选组织机构的id + jscheck: boolean //所选组织机构勾选框 + unittype: any //单位类型 + reservePlanType: any //预案类型 + toExamine: any //审核状态 + preparelevel: any //编制级别 + plcheck: boolean //编制级别勾选框 + planCategory = [] //预案级别 //重置 - reset(){ - this.IsNewCompanyData='' - this.IsNewData='' + reset() { + this.IsNewCompanyData = '' + this.IsNewData = '' this.companyName = '' this.js = '' this.jsId = '' @@ -385,12 +391,15 @@ export class EntryPlanComponent implements OnInit { this.preparelevel = '' this.integritySort = '' this.plcheck = false - this.haveyuan='' - this.planCategory=[] + this.haveyuan = '' + this.planCategory = [] //重新获取初始化列表 // console.log(this.pageEvent) this.pageEvent.pageIndex = 0 this.PageNumber = 1 + + this.templatePlan = false + this.customPlan = false this.getAllPlanInfo(); } } diff --git a/src/app/plan-management/open-plan/open-plan.component.html b/src/app/plan-management/open-plan/open-plan.component.html index a1ddae2..41cefa1 100644 --- a/src/app/plan-management/open-plan/open-plan.component.html +++ b/src/app/plan-management/open-plan/open-plan.component.html @@ -8,7 +8,7 @@
    -
    +
    @@ -16,77 +16,84 @@ 包含下级 - 更多筛选条件 - 收起 + 更多筛选条件 + 收起
    - -
    - - -
    -
    - - + +
    + + +
    +
    + + - - {{unit.name}} - + + {{unit.name}} + - - -
    -
    - - - - 文本预案 - 二维预案 - 三维预案 - 其他预案 - - -
    -
    - - - - 新增 - 维护更新 - - -
    -
    - - - - 新增 - 维护更新 - - -
    - -
    - - -
    +
    + +
    +
    + + + + 文本预案 + 二维预案 + 三维预案 + 其他预案 + + +
    +
    + + + + 新增 + 维护更新 + + +
    +
    + + + + 新增 + 维护更新 + + +
    +
    + 模板录入预案 +
    +
    + 自定义预案 +
    +
    + + +
    - + - - -
    +
    + +
    - - - - +
    预案状态 - 新增 - 维护更新 -
    + + + - - - + + + @@ -114,30 +121,26 @@ - - + + - - - - - - -
    预案状态 + 新增 + 维护更新 + 单位名称{{element.companyName}}单位名称{{element.companyName}} 预案名称 是否公开{{element.openRange}}是否公开{{element.openRange}} 编制级别 {{element.planLevel | planlevel}} 操作 - 查看预案 -
    - - - -
    -
    - - + + 操作 + + 查看预案 + + + + + + + + + + \ No newline at end of file diff --git a/src/app/plan-management/open-plan/open-plan.component.spec.ts b/src/app/plan-management/open-plan/open-plan.component.spec.ts deleted file mode 100644 index 9a257ca..0000000 --- a/src/app/plan-management/open-plan/open-plan.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { OpenPlanComponent } from './open-plan.component'; - -describe('OpenPlanComponent', () => { - let component: OpenPlanComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ OpenPlanComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(OpenPlanComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts index facb3cb..4cf33ca 100644 --- a/src/app/plan-management/open-plan/open-plan.component.ts +++ b/src/app/plan-management/open-plan/open-plan.component.ts @@ -43,9 +43,9 @@ export class OpenPlanComponent implements OnInit { pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 PageNumber: any; //第几页 - IsNewData='' //维护更新活新增 + IsNewData = '' //维护更新活新增 - displayedColumns: string[] = ['state','unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'weihuStatus','openRange', 'projectlevel', 'operation']; + displayedColumns: string[] = ['state', 'unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'weihuStatus', 'openRange', 'projectlevel', 'operation']; allorganizations: any //所有组织机构 allunittype: any //所有单位类型 @@ -115,8 +115,13 @@ export class OpenPlanComponent implements OnInit { allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - IsNewCompanyData='' + IsNewCompanyData = '' + templatePlan: boolean = false//模板录入预案checkbox + customPlan: boolean = false//自定义预案 getAllPlanInfo() { + let planmode = [] + this.templatePlan ? planmode.push(2) : null + this.customPlan ? planmode.push(4) : null let paramsdata: any = { CompanyName: this.companyName || '', OrganizationId: '', @@ -129,8 +134,9 @@ export class OpenPlanComponent implements OnInit { PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], Sort: '', - IsNewData:this.IsNewData, - IsNewCompanyData:this.IsNewCompanyData + IsNewData: this.IsNewData, + IsNewCompanyData: this.IsNewCompanyData, + PlanModes: planmode } this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => { // console.log(111,data) @@ -292,9 +298,11 @@ export class OpenPlanComponent implements OnInit { //重新获取初始化列表 this.pageEvent.pageIndex = 0 this.PageNumber = 1 + this.templatePlan = false + this.customPlan = false this.getAllPlanInfo(); - this.IsNewCompanyData='' - this.IsNewData='' + this.IsNewCompanyData = '' + this.IsNewData = '' } } diff --git a/src/app/plan-management/pass-plan/pass-plan.component.html b/src/app/plan-management/pass-plan/pass-plan.component.html index 38fadfd..af8e821 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.html +++ b/src/app/plan-management/pass-plan/pass-plan.component.html @@ -2,47 +2,49 @@
    - +
    - +
    - + 包含下级 - 更多筛选条件 - 收起 + 更多筛选条件 + 收起
    -
    clear
    - - - -
  • {{node.name}}
  • -
    - - -
  • {{node.name}}
  • -
    -
    +
    + clear +
    + + + +
  • {{node.name}}
  • +
    + + +
  • {{node.name}}
  • +
    +
    - +
    @@ -54,23 +56,25 @@ 其他预案 - +
    - - - - - {{unit.name}} - - - - 更多筛选条件 - 收起 + + + + + {{unit.name}} + + + + 更多筛选条件 + 收起
    -
    +
    - +
    @@ -81,127 +85,133 @@ 包含下级
    - +
    - - 应急预案(国家级) - 应急预案(市级) - 类型预案 - Ⅰ级预案 - Ⅱ级预案 - Ⅲ级预案 - Ⅳ级预案 - Ⅴ级预案 - + + 应急预案(国家级) + 应急预案(市级) + 类型预案 + Ⅰ级预案 + Ⅱ级预案 + Ⅲ级预案 + Ⅳ级预案 + Ⅴ级预案 + -
    - +
    +
    - + 🠊 - +
    - - + + 新增 维护更新 - - + +
    - - + + 新增 维护更新 - - + + +
    +
    + 模板录入预案 +
    +
    + 自定义预案
    -
    - +
    -
    - -
    +
    + +
    - - - - +
    预案状态 - 新增 - 维护更新 -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
    预案状态 + 新增 + 维护更新 + 预案名称{{element.name}}添加人{{element.creatorName}}预案级别{{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案': + element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}} + 添加时间{{element.creationTime | date:'yyyy-MM-dd'}}预案类型{{element.planType | plantype}}新增审核{{element.newVerifyState}}维护审核{{element.maintenanceVerifyState}}是否公开{{element.openRange}}编制级别{{element.planLevel | planlevel}}操作 + 查看单位信息 + {{url=='1'?'审核预案':'查看预案'}} + + + 预案名称{{element.name}}添加人{{element.creatorName}}预案级别{{element.planCategory==1?'Ⅰ级预案':element.planCategory==2?'Ⅱ级预案': - element.planCategory==3?'Ⅲ级预案':element.planCategory==4?'Ⅳ级预案':element.planCategory==5?'Ⅴ级预案':element.planCategory==8?'类型预案':'应急预案'}}添加时间{{element.creationTime | date:'yyyy-MM-dd'}}预案类型{{element.planType | plantype}}新增审核{{element.newVerifyState}}维护审核{{element.maintenanceVerifyState}}
    + + - - 是否公开 - {{element.openRange}} - - - 编制级别 - {{element.planLevel | planlevel}} - - - 操作 - - 查看单位信息 - {{url=='1'?'审核预案':'查看预案'}} - - - - - - - - - -
    -
    - + + \ No newline at end of file diff --git a/src/app/plan-management/pass-plan/pass-plan.component.spec.ts b/src/app/plan-management/pass-plan/pass-plan.component.spec.ts deleted file mode 100644 index 7ee8878..0000000 --- a/src/app/plan-management/pass-plan/pass-plan.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PassPlanComponent } from './pass-plan.component'; - -describe('PassPlanComponent', () => { - let component: PassPlanComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PassPlanComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PassPlanComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts index 60cde6c..284bfd2 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.ts +++ b/src/app/plan-management/pass-plan/pass-plan.component.ts @@ -44,11 +44,11 @@ export class PassPlanComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber: any; //第几页 - displayedColumns: string[] = ['state','planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus','weihuState', 'openRange', 'projectlevel', 'operation']; + displayedColumns: string[] = ['state', 'planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'weihuState', 'openRange', 'projectlevel', 'operation']; allorganizations: any //所有组织机构 allunittype: any //所有单位类型 tabledataSource: any //表格数据 - IsNewData='' //维护更新活新增 + IsNewData = '' //维护更新活新增 url preparelevels: any @@ -116,9 +116,14 @@ export class PassPlanComponent implements OnInit { } allPlanInfo: any //存储所有预案信息 - IsNewCompanyData='' //单位是新增还是维护更新 + IsNewCompanyData = '' //单位是新增还是维护更新 + templatePlan: boolean = false//模板录入预案checkbox + customPlan: boolean = false//自定义预案 //获得所有预案信息 getAllPlanInfo() { + let planmode = [] + this.templatePlan ? planmode.push(2) : null + this.customPlan ? planmode.push(4) : null let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' if (this.reservePlanType && this.reservePlanType.length != 0) { @@ -139,8 +144,9 @@ export class PassPlanComponent implements OnInit { PageSize: this.pageSizeOptions[0], Sort: '', PlanCategories: this.planCategory, - IsNewData:this.IsNewData, - IsNewCompanyData:this.IsNewCompanyData + IsNewData: this.IsNewData, + IsNewCompanyData: this.IsNewCompanyData, + PlanModes: planmode } this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount @@ -453,8 +459,8 @@ export class PassPlanComponent implements OnInit { planCategory = []//预案级别 //重置 reset() { - this.IsNewData='' - this.IsNewCompanyData='' + this.IsNewData = '' + this.IsNewCompanyData = '' this.companyName = '' this.js = '' this.jsId = '' @@ -469,6 +475,10 @@ export class PassPlanComponent implements OnInit { this.pageEvent.pageIndex = 0 this.PageNumber = 1 this.planCategory = [] + + + this.templatePlan = false + this.customPlan = false this.getAllPlanInfo(); } } diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.html b/src/app/statistic-analysis/combined-query/combined-query.component.html index 6fe91fa..d6c29be 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.html +++ b/src/app/statistic-analysis/combined-query/combined-query.component.html @@ -3,7 +3,7 @@ - +
    @@ -86,8 +86,8 @@ - 新增 - 维护更新 + 新增 + 维护更新
    @@ -134,22 +134,32 @@
    - + - +
    {{item}}{{item}}undo + +
    {{eletd}}{{eletd}}
    - + - +
    {{item}}{{item}}undo + +
    {{eletd}}{{eletd}}
    diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.scss b/src/app/statistic-analysis/combined-query/combined-query.component.scss index b51bc0c..92ebd5e 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.scss +++ b/src/app/statistic-analysis/combined-query/combined-query.component.scss @@ -176,6 +176,9 @@ mat-paginator { width: 100%; } + .pointer{ + cursor: pointer; + } } } diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.ts b/src/app/statistic-analysis/combined-query/combined-query.component.ts index 449ab69..91add9e 100644 --- a/src/app/statistic-analysis/combined-query/combined-query.component.ts +++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts @@ -59,10 +59,30 @@ export class CombinedQueryComponent implements OnInit { selected = new FormControl(0); //选项卡实例 //判断选了哪一个 selectedIndexChange(e) { - - + this.orRecord = [] this.selected.setValue(e) this.preparelevels = Number(e) + + if (this.preparelevels == 0) { + this.js = this.organizationName + this.jsId = this.organizationId + this.jscheck = true + this.unittype = [] + this.allunittype.forEach(element => { + this.unittype.push(element.id) + }); + this.preparelevel = [1] + this.dwaddtime = '2020-01-01'//单位查询开始时间 + this.dwendtime = this.getNowFormatDate()//单位结束时间 + } else if (this.preparelevels == 1) { + this.yuanjs = this.organizationName + this.yuanjsId = this.organizationId + this.yuanaddtime = '2020-01-01'//预案查询开始时间 + this.yuanendtime = this.getNowFormatDate()//预案查询结束时间 + this.yuanjscheck = true + this.reservePlanType = ['1', '2', '4', '16'] + this.planCategory = ['1', '2', '3', '4', '5'] + } this.getAllPlanInfo() } @@ -203,6 +223,7 @@ export class CombinedQueryComponent implements OnInit { yuanintegritySort = 1 //预案排序字段 isMasklayer = false async getAllPlanInfo() { + console.log(this.preparelevel) let paramsdata: any = { QueryMode: this.preparelevels, OrganizationId: this.jsId || '', @@ -413,6 +434,7 @@ export class CombinedQueryComponent implements OnInit { //重置 reset() { + this.orRecord = [] if (this.preparelevels == 0) { this.js = this.organizationName this.jsId = this.organizationId @@ -437,27 +459,66 @@ export class CombinedQueryComponent implements OnInit { this.getAllPlanInfo(); } - + orRecord = [] //进入下一层 clicktd(key, element) { - // console.log(key) - // console.log(element) - // console.log(this.allorganizations) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 if (key == 0) { + let clickOr this.allorganizations.forEach(item => { if (element === item.name) { - if (this.preparelevels == 0) { - this.js = element - this.jsId = item.id - } else if (this.preparelevels == 1) { - this.yuanjs = element - this.yuanjsId = item.id - } - this.getAllPlanInfo(); + clickOr = item } }); + // console.log(clickOr) + if (this.preparelevels == 0) { + if (element == this.js) { + this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); + return + } + } else if (this.preparelevels == 1) { + if (element == this.yuanjs) { + this.snackBar.open('已在当前查询的消防救援站下,无法下钻', '确定', config); + return + } + } + if (clickOr.children.length == 0 && this.excelData.length == 1) { + this.snackBar.open('无下级消防救援站,无法下钻', '确定', config); + return + } + + //记录点击过的消防救援站 + this.orRecord.push({ name: this.js, id: this.jsId }) + + + if (this.preparelevels == 0) { + this.js = element + this.jsId = clickOr.id + } else if (this.preparelevels == 1) { + this.yuanjs = element + this.yuanjsId = clickOr.id + } + console.log(this.orRecord) + this.getAllPlanInfo(); } + + + } + + goBack() { + if (this.preparelevels == 0) { + this.js = this.orRecord[this.orRecord.length - 1].name + this.jsId = this.orRecord[this.orRecord.length - 1].id + } else if (this.preparelevels == 1) { + this.yuanjs = this.orRecord[this.orRecord.length - 1].name + this.yuanjsId = this.orRecord[this.orRecord.length - 1].id + } + this.orRecord.pop(); + console.log(this.orRecord) + this.getAllPlanInfo(); } exal() {