|
|
|
@ -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'; |
|
|
|
@ -19,7 +19,7 @@ declare var CryptoJS
|
|
|
|
|
}) |
|
|
|
|
export class PlanAnalysisBySynthesisComponent 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 { |
|
|
|
@ -36,239 +36,239 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); |
|
|
|
|
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; //第几页
|
|
|
|
|
PageNumber: any; //第几页
|
|
|
|
|
|
|
|
|
|
displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; |
|
|
|
|
allorganizations:any //所有组织机构
|
|
|
|
|
allunittype:any //所有单位类型
|
|
|
|
|
tabledataSource:any //表格数据
|
|
|
|
|
displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation']; |
|
|
|
|
allorganizations: any //所有组织机构
|
|
|
|
|
allunittype: any //所有单位类型
|
|
|
|
|
tabledataSource: any //表格数据
|
|
|
|
|
url |
|
|
|
|
|
|
|
|
|
preparelevels:any |
|
|
|
|
preparelevels: any |
|
|
|
|
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(); |
|
|
|
|
let level = sessionStorage.getItem("level"); |
|
|
|
|
if(level == "0"){//如果是总队
|
|
|
|
|
if (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(level == "1"){//如果是支队
|
|
|
|
|
if (level == "1") {//如果是支队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"支队",value:"2"}, |
|
|
|
|
{name:"大队",value:"4"}, |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "支队", value: "2" }, |
|
|
|
|
{ name: "大队", value: "4" }, |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
if(level == "2"){//如果是大队
|
|
|
|
|
if (level == "2") {//如果是大队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"大队",value:"4"}, |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "大队", value: "4" }, |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
if(level == "3"){//如果是中队
|
|
|
|
|
if (level == "3") {//如果是中队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) |
|
|
|
|
this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) |
|
|
|
|
//console.log(this.url)
|
|
|
|
|
} |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
allPlanInfo:any //存储所有预案信息
|
|
|
|
|
allPlanInfo: any //存储所有预案信息
|
|
|
|
|
//获得所有预案信息
|
|
|
|
|
getAllPlanInfo(){ |
|
|
|
|
getAllPlanInfo() { |
|
|
|
|
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: this.reservePlanType || '', |
|
|
|
|
AuditStatus:'', //审核状态
|
|
|
|
|
PlanLevel: this.preparelevel || '', |
|
|
|
|
AuditStatus: '', //审核状态
|
|
|
|
|
PlanLevel: this.preparelevel || '', |
|
|
|
|
HasChildrenPlanLevel: this.plcheck || '', |
|
|
|
|
CreationTimeRangeStart:this.addtime||'', |
|
|
|
|
CreationTimeRangeEnd:this.endtime||'', |
|
|
|
|
AduitTimeRangeStart: this.addtime || '', |
|
|
|
|
AduitTimeRangeEnd: this.endtime || '', |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
Sort: '', |
|
|
|
|
PlanCategories:this.planCategory |
|
|
|
|
PlanCategories: this.planCategory |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/ApprovedPlans",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => { |
|
|
|
|
this.length = data.totalCount |
|
|
|
|
this.allPlanInfo = data |
|
|
|
|
this.tabledataSource = data.items |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
//处理六位的颜色值
|
|
|
|
|
var sColorChange = []; |
|
|
|
|
for (var i = 1; i < 7; i += 2) { |
|
|
|
|
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); |
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
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 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){ |
|
|
|
|
for (let i = 0; i < 30; i++) { |
|
|
|
|
if (i == width) { |
|
|
|
|
style.background = colorArr[i] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(width >= 30 && width < 60){ |
|
|
|
|
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] |
|
|
|
|
for (let i = 30; i < 60; i++) { |
|
|
|
|
if (i == width) { |
|
|
|
|
style.background = colorArr[i - 30] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(width >= 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] |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//得到当前单位信息
|
|
|
|
|
getunitdata(){ |
|
|
|
|
getunitdata() { |
|
|
|
|
this.http.get("/api/Account/Profiles").subscribe( |
|
|
|
|
(data:any)=>{ |
|
|
|
|
this.organizationName = data.organizationName |
|
|
|
|
(data: any) => { |
|
|
|
|
this.organizationName = data.organizationName |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
@ -276,31 +276,31 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
endtime//结束时间
|
|
|
|
|
integrityScoreMin//完整度最小值
|
|
|
|
|
integrityScoreMax//完整度最大值
|
|
|
|
|
organizationName:any //当前单位组织机构名称
|
|
|
|
|
treedata:any //组织机构树型数据
|
|
|
|
|
newArr:any = [] |
|
|
|
|
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
|
|
|
|
|
organizationName: any //当前单位组织机构名称
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -308,9 +308,9 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//获得所有组织机构
|
|
|
|
|
getOrganizations(){ |
|
|
|
|
getOrganizations() { |
|
|
|
|
this.http.get('/api/Organizations').subscribe( |
|
|
|
|
(data:any)=>{ |
|
|
|
|
(data: any) => { |
|
|
|
|
this.allorganizations = data |
|
|
|
|
this.treedata = this.tree.toTree(data); |
|
|
|
|
this.getpresentOrganization(); |
|
|
|
@ -319,120 +319,120 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获得所有单位类型
|
|
|
|
|
getUnittype(){ |
|
|
|
|
getUnittype() { |
|
|
|
|
this.http.get('/api/BuildingTypes/Simple').subscribe( |
|
|
|
|
data=>{ |
|
|
|
|
data => { |
|
|
|
|
this.allunittype = data |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
//查看单位信息
|
|
|
|
|
lookUnitInfo(element){ |
|
|
|
|
lookUnitInfo(element) { |
|
|
|
|
// console.log(element)
|
|
|
|
|
// const dialogRef = this.dialog.open(UnitInfo, {
|
|
|
|
|
// width: '1500px',
|
|
|
|
|
// height:'800px'
|
|
|
|
|
// });
|
|
|
|
|
sessionStorage.setItem("editable","0") |
|
|
|
|
sessionStorage.setItem("companyName",element.company.name) |
|
|
|
|
sessionStorage.setItem("companyId",element.company.id) |
|
|
|
|
sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore)) |
|
|
|
|
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank'); |
|
|
|
|
sessionStorage.setItem("editable", "0") |
|
|
|
|
sessionStorage.setItem("companyName", element.company.name) |
|
|
|
|
sessionStorage.setItem("companyId", element.company.id) |
|
|
|
|
sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore)) |
|
|
|
|
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//跳转查看预案页面 审核通过预案
|
|
|
|
|
routerTo(e){ |
|
|
|
|
routerTo(e) { |
|
|
|
|
// console.log(e)
|
|
|
|
|
if(e.planMode == 0||e.planMode == 1){
|
|
|
|
|
if (e.planMode == 0 || e.planMode == 1) { |
|
|
|
|
//console.log(e.attachmentUrls)
|
|
|
|
|
var index=e.attachmentUrls[0].indexOf("\/") |
|
|
|
|
if(e.attachmentUrls[0].substr(0,index)=='psw'){ |
|
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
|
const dialogRef = this.dialog.open(GkPsViewer2, { |
|
|
|
|
width: '1500px', |
|
|
|
|
height:'800px', |
|
|
|
|
height: '800px', |
|
|
|
|
data: e.attachmentUrls[0] |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' |
|
|
|
|
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' |
|
|
|
|
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ |
|
|
|
|
let filename:string |
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); |
|
|
|
|
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); |
|
|
|
|
let jwt = sessionStorage.getItem("token"); |
|
|
|
|
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
|
|
|
|
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
|
|
|
|
let identityJsonparse=JSON.parse(identityJson) |
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ |
|
|
|
|
filename=data.fileName
|
|
|
|
|
let json={ |
|
|
|
|
doc: { |
|
|
|
|
docId: docId, |
|
|
|
|
title: filename, |
|
|
|
|
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl, |
|
|
|
|
}, |
|
|
|
|
user: { |
|
|
|
|
uid: identityJsonparse.sub, |
|
|
|
|
nickName: identityJsonparse.name, |
|
|
|
|
avatar: "", |
|
|
|
|
privilege: [ |
|
|
|
|
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
var stringjson=JSON.stringify(json) |
|
|
|
|
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); |
|
|
|
|
var base64 = CryptoJS.enc.Base64.stringify(wordArray); |
|
|
|
|
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */ { |
|
|
|
|
let filename: string |
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); |
|
|
|
|
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); |
|
|
|
|
let jwt = sessionStorage.getItem("token"); |
|
|
|
|
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
|
|
|
|
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
|
|
|
|
let identityJsonparse = JSON.parse(identityJson) |
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => { |
|
|
|
|
filename = data.fileName |
|
|
|
|
let json = { |
|
|
|
|
doc: { |
|
|
|
|
docId: docId, |
|
|
|
|
title: filename, |
|
|
|
|
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/` + fetchUrl, |
|
|
|
|
}, |
|
|
|
|
user: { |
|
|
|
|
uid: identityJsonparse.sub, |
|
|
|
|
nickName: identityJsonparse.name, |
|
|
|
|
avatar: "", |
|
|
|
|
privilege: [ |
|
|
|
|
'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT' |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
var stringjson = JSON.stringify(json) |
|
|
|
|
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); |
|
|
|
|
var base64 = CryptoJS.enc.Base64.stringify(wordArray); |
|
|
|
|
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(e.planMode == 2){ //如果是在线编辑
|
|
|
|
|
if (e.planMode == 2) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId",id) |
|
|
|
|
sessionStorage.setItem("companyId",e.companyId) |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", e.companyId) |
|
|
|
|
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
|
|
|
|
|
sessionStorage.setItem("editable","0") |
|
|
|
|
sessionStorage.setItem("planName",e.name) |
|
|
|
|
sessionStorage.setItem("editable", "0") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); |
|
|
|
|
} |
|
|
|
|
if(e.planMode == 3){ //如果是跳转网页
|
|
|
|
|
sessionStorage.setItem("url",e.url) |
|
|
|
|
if (e.planMode == 3) { //如果是跳转网页
|
|
|
|
|
sessionStorage.setItem("url", e.url) |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//预案公开
|
|
|
|
|
openReserve (e) { |
|
|
|
|
this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{ |
|
|
|
|
openReserve(e) { |
|
|
|
|
this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('预案已公开','确定',config); |
|
|
|
|
this.snackBar.open('预案已公开', '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//预案取消公开
|
|
|
|
|
closeReserve (e) { |
|
|
|
|
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{ |
|
|
|
|
closeReserve(e) { |
|
|
|
|
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('预案已取消公开','确定',config); |
|
|
|
|
this.snackBar.open('预案已取消公开', '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//分页事件
|
|
|
|
|
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 |
|
|
|
@ -448,26 +448,26 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
this.isorganizationbox = true |
|
|
|
|
} |
|
|
|
|
//关闭出现的组织机构div
|
|
|
|
|
closediv(){ |
|
|
|
|
closediv() { |
|
|
|
|
this.isorganizationbox = false |
|
|
|
|
} |
|
|
|
|
//查询
|
|
|
|
|
onSubmit (e) { |
|
|
|
|
onSubmit(e) { |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
this.getAllPlanInfo(); |
|
|
|
|
} |
|
|
|
|
companyName:any //单位名称
|
|
|
|
|
js:any //所选组织机构
|
|
|
|
|
jsId:any //所选组织机构的id
|
|
|
|
|
jscheck:boolean //所选组织机构勾选框
|
|
|
|
|
unittype:any //单位类型
|
|
|
|
|
reservePlanType:any //预案类型
|
|
|
|
|
preparelevel:any //编制级别
|
|
|
|
|
plcheck:boolean //编制级别勾选框
|
|
|
|
|
planCategory=[]//预案级别
|
|
|
|
|
companyName: any //单位名称
|
|
|
|
|
js: any //所选组织机构
|
|
|
|
|
jsId: any //所选组织机构的id
|
|
|
|
|
jscheck: boolean //所选组织机构勾选框
|
|
|
|
|
unittype: any //单位类型
|
|
|
|
|
reservePlanType: any //预案类型
|
|
|
|
|
preparelevel: any //编制级别
|
|
|
|
|
plcheck: boolean //编制级别勾选框
|
|
|
|
|
planCategory = []//预案级别
|
|
|
|
|
//重置
|
|
|
|
|
reset(){ |
|
|
|
|
reset() { |
|
|
|
|
this.companyName = '' |
|
|
|
|
this.js = '' |
|
|
|
|
this.jsId = '' |
|
|
|
@ -475,13 +475,13 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
this.unittype = '' |
|
|
|
|
this.reservePlanType = '' |
|
|
|
|
this.preparelevel = '' |
|
|
|
|
this.addtime='' |
|
|
|
|
this.endtime='' |
|
|
|
|
this.addtime = '' |
|
|
|
|
this.endtime = '' |
|
|
|
|
this.plcheck = false |
|
|
|
|
//重新获取初始化列表
|
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.planCategory=[] |
|
|
|
|
this.planCategory = [] |
|
|
|
|
this.getAllPlanInfo(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -491,13 +491,13 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
|
|
|
|
|
templateUrl: './PsvShow.html', |
|
|
|
|
styleUrls: ['./plan-analysis-by-synthesis.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class GkPsViewer2{ |
|
|
|
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<GkPsViewer2>,@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
|
|
|
export class GkPsViewer2 { |
|
|
|
|
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<GkPsViewer2>, @Inject(MAT_DIALOG_DATA) public data: any) { } |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
// console.log(this.data)
|
|
|
|
|
const viewer = new Viewer({ |
|
|
|
|
container: document.querySelector('#viewer'), |
|
|
|
|
panorama:'/api/Objects/PlanPlatform/'+ this.data, |
|
|
|
|
panorama: '/api/Objects/PlanPlatform/' + this.data, |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|