|
|
|
@ -9,6 +9,9 @@ import { PageEvent } from '@angular/material/paginator';
|
|
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
|
import { MatSort } from '@angular/material/sort'; |
|
|
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-key-unit-management', |
|
|
|
|
templateUrl: './key-unit-management.component.html', |
|
|
|
@ -34,6 +37,7 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
myControl = new FormControl(); |
|
|
|
|
hasChild = (_: number, node: any) => node.expandable; |
|
|
|
|
|
|
|
|
|
@ViewChild(MatSort) sort: MatSort; |
|
|
|
|
|
|
|
|
|
allunittype:any //获取所有的单位类型
|
|
|
|
|
|
|
|
|
@ -49,7 +53,34 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
displayedColumns: string[] = ['checked','Follow','unitname','integrity','jurisdictionsquadron', 'unittype','scc', 'time','operation']; |
|
|
|
|
tabledataSource:any |
|
|
|
|
allorganizations:any |
|
|
|
|
|
|
|
|
|
oldDataSource:any; //原始表格数据
|
|
|
|
|
//表头排序
|
|
|
|
|
sortData (e) { |
|
|
|
|
let data = this.tabledataSource.filteredData; |
|
|
|
|
console.log(data.filteredData) |
|
|
|
|
// data.filteredData.forEach(element => {
|
|
|
|
|
// if(element.key.indexOf(".") != -1){
|
|
|
|
|
// let typeArr = element.key.split('.')
|
|
|
|
|
// element.type = typeArr[typeArr.length - 1]
|
|
|
|
|
// element.newTime = new Date(element.lastModified).getTime()
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
if( e.direction=='asc' ) { //从小到大排序
|
|
|
|
|
data.sort( function(a,b) { |
|
|
|
|
return a.newTime - b.newTime |
|
|
|
|
} ) |
|
|
|
|
this.tabledataSource = new MatTableDataSource(data); |
|
|
|
|
} else if ( e.direction=='desc' ) {//从大到小排序
|
|
|
|
|
data.sort( function(a,b) { |
|
|
|
|
return b.newTime - a.newTime |
|
|
|
|
} ) |
|
|
|
|
this.tabledataSource = new MatTableDataSource(data); |
|
|
|
|
} else { //原始数据
|
|
|
|
|
this.tabledataSource = new MatTableDataSource(this.oldDataSource); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
colorRgb(sColor){ |
|
|
|
|
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; |
|
|
|
@ -133,27 +164,27 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
let _this = this |
|
|
|
|
|
|
|
|
|
let style:any = {} |
|
|
|
|
style.width = width*10 +'%'; |
|
|
|
|
if(width < 3){ |
|
|
|
|
style.width = width +'%'; |
|
|
|
|
if(width < 30){ |
|
|
|
|
let colorArr = this.gradientColor('#D50000', '#E53935', 30);
|
|
|
|
|
for(let i = 0; i < 30; i++){ |
|
|
|
|
if( i == width*10){ |
|
|
|
|
if( i == width){ |
|
|
|
|
style.background = colorArr[i] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(width >= 3 && width < 6){ |
|
|
|
|
if(width >= 30 && width < 60){ |
|
|
|
|
let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
|
|
|
|
|
for(let i = 30; i < 60; i++){ |
|
|
|
|
if( i == width*10){ |
|
|
|
|
if( i == width){ |
|
|
|
|
style.background = colorArr[i-30] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(width >= 6){ |
|
|
|
|
if(width >= 60){ |
|
|
|
|
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
|
|
|
|
|
for(let i = 60; i <= 100; i++){ |
|
|
|
|
if( i == width*10){ |
|
|
|
|
if( i == width){ |
|
|
|
|
style.background = colorArr[i-60] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -177,6 +208,120 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
this.getAllKeyUnit(); |
|
|
|
|
} |
|
|
|
|
//获得所有重点单位
|
|
|
|
|
|
|
|
|
|
wanzhengduArr = [ |
|
|
|
|
{id:0,zong:94,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:8,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:25,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:10,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:10,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:8,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:10,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:10,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:1,zong:82,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:8,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:8,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:25,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:8,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:8,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:6,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:8,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:2,zong:72,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:5,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:8,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:22,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:7,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:7,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:6,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:8,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:3,zong:61,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:5,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:7,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:18,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:3,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:8,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:4,zong:60,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:5,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:6,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:18,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:3,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:8,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:5,zong:53,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:5,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:5,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:10,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:5,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:5,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:7,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:6,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:6,zong:45,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:5,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:5,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:15,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:5,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:3,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:5,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:4,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:7,zong:30,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:0,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:4,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:2,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:5,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:5,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:2,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:6,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:3,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:8,zong:20,details:[ |
|
|
|
|
{name:'单位信息',score:3,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:2,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:0,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:3,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:3,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:3,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:3,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:2,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:1,totalpoints:10}, |
|
|
|
|
]}, |
|
|
|
|
{id:9,zong:13,details:[ |
|
|
|
|
{name:'单位信息',score:5,totalpoints:5}, |
|
|
|
|
{name:'建筑信息',score:3,totalpoints:10}, |
|
|
|
|
{name:'平面图',score:0,totalpoints:10}, |
|
|
|
|
{name:'四周毗邻',score:2,totalpoints:25}, |
|
|
|
|
{name:'消防设施',score:0,totalpoints:10}, |
|
|
|
|
{name:'重点部位',score:3,totalpoints:10}, |
|
|
|
|
{name:'功能分区',score:0,totalpoints:10}, |
|
|
|
|
{name:'实景图',score:0,totalpoints:10}, |
|
|
|
|
{name:'CAD上传',score:0,totalpoints:10}, |
|
|
|
|
]} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
allKeyUnitInfo:any //所有的重点单位
|
|
|
|
|
getAllKeyUnit(){ |
|
|
|
|
// console.log(Boolean(Number(this.follow)))
|
|
|
|
@ -190,7 +335,7 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
if(this.follow == '1'){ |
|
|
|
|
follow = true |
|
|
|
|
} |
|
|
|
|
// console.log(222,follow)
|
|
|
|
|
|
|
|
|
|
let paramsdata:any = { |
|
|
|
|
Name: this.companyName || '', |
|
|
|
|
OrganizationId: this.jsId || '', |
|
|
|
@ -206,8 +351,14 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
this.length = data.totalCount |
|
|
|
|
this.allKeyUnitInfo = data |
|
|
|
|
// console.log(data)
|
|
|
|
|
this.tabledataSource = data.items |
|
|
|
|
// data.items.sort( (a,b) => {
|
|
|
|
|
// return a.usci - b.usci
|
|
|
|
|
// })
|
|
|
|
|
data.items.forEach( (item,index) => { |
|
|
|
|
item.integrity = this.wanzhengduArr[index] |
|
|
|
|
}) |
|
|
|
|
console.log(789,data.items) |
|
|
|
|
this.tabledataSource = new MatTableDataSource(data.items); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//得到当前单位信息
|
|
|
|
@ -392,12 +543,12 @@ export class KeyUnitManagementComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//跳转查看基本信息页面
|
|
|
|
|
unitdetails(element){ |
|
|
|
|
// console.log(element)
|
|
|
|
|
// this.router.navigate(['/keyUnit/viewunitinfo'])
|
|
|
|
|
console.log(element) |
|
|
|
|
sessionStorage.setItem("editable","0") |
|
|
|
|
sessionStorage.setItem("companyName",element.name) |
|
|
|
|
sessionStorage.setItem("companyId",element.id) |
|
|
|
|
window.open(`/keyUnit/viewunitinfo?id=${element.id}&grade=46`,'_blank'); |
|
|
|
|
sessionStorage.setItem(element.id,JSON.stringify(element.integrity)) |
|
|
|
|
window.open(`/keyUnit/viewunitinfo?id=${element.id}`,'_blank'); |
|
|
|
|
} |
|
|
|
|
//提交查询表单
|
|
|
|
|
onSubmit(value){ |
|
|
|
|