chenjingyu 4 years ago
parent
commit
0cd58d774d
  1. 77
      src/app/external-links-plan/external-links-plan.component.ts
  2. 2
      src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.html
  3. 452
      src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts
  4. 266
      src/app/statistic-analysis/real-monitoring/real-monitoring.component.ts
  5. 79
      src/app/statistic-analysis/statistic-analysis-routing.module.ts
  6. 1503
      src/app/ui/collection-tools/collection-tools.component.ts

77
src/app/external-links-plan/external-links-plan.component.ts

@ -13,40 +13,40 @@ declare var CryptoJS
}) })
export class ExternalLinksPlanComponent implements OnInit { export class ExternalLinksPlanComponent implements OnInit {
constructor(private http:HttpClient,private token:CacheTokenService,public route: ActivatedRoute,private sanitizer: DomSanitizer) { } constructor(private http: HttpClient, private token: CacheTokenService, public route: ActivatedRoute, private sanitizer: DomSanitizer) { }
planId:any//预案id planId: any//预案id
viewer//全景图对象 viewer//全景图对象
fetchUrl//预案文件地址 fetchUrl//预案文件地址
showType//预案类型 1:全景图 showType//预案类型 1:全景图
planData//预案信息 planData//预案信息
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
await this.login()//登录存储token await this.login()//登录存储token
this.route.queryParams.subscribe(paramsData=>{ this.route.queryParams.subscribe(paramsData => {
this.planId = paramsData.planId this.planId = paramsData.planId
let planId = paramsData.planId let planId = paramsData.planId
this.http.get(`/api/PlanComponents/${planId}`).subscribe((data:any)=>{ this.http.get(`/api/PlanComponents/${planId}`).subscribe((data: any) => {
console.log('单个预案详细信息',data) console.log('单个预案详细信息', data)
this.planData = data this.planData = data
if(data.planType != 1 && data.planType != 2){ if (data.planType != 1 && data.planType != 2) {
this.fetchUrl = data.attachmentUrls[0] this.fetchUrl = data.attachmentUrls[0]
var index = this.fetchUrl.indexOf("\/") var index = this.fetchUrl.indexOf("\/")
if(this.fetchUrl.substr(0,index) == 'psw'){ if (this.fetchUrl.substr(0, index) == 'psw') {
this.showType = 1 this.showType = 1
var obj = document.getElementById('viewer') var obj = document.getElementById('viewer')
if(obj != null){ if (obj != null) {
obj.innerHTML='' obj.innerHTML = ''
} }
window.setTimeout(()=>{ window.setTimeout(() => {
this.viewer = new Viewer({ this.viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl, panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl,
}); });
}) })
}else{ } else {
//毕生 //毕生
this.lookWord() this.lookWord()
} }
}else{ } else {
// 二维三维预案 // 二维三维预案
this.handleData() this.handleData()
} }
@ -54,46 +54,47 @@ export class ExternalLinksPlanComponent implements OnInit {
}) })
} }
async login(){ async login() {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.http.post('/api/Account/SignIn',{ this.http.post('/api/Account/SignIn', {
name: 'zhuzhouyuanchakan', name: 'zhuzhouyuanchakan',
password: '12345678'}).subscribe((data:any)=>{ password: '12345678'
sessionStorage.setItem("level",data.level); }).subscribe((data: any) => {
sessionStorage.setItem("token",data.token); sessionStorage.setItem("level", data.level);
sessionStorage.setItem("refreshToken",data.refreshToken); sessionStorage.setItem("token", data.token);
console.log('登录成功',data) sessionStorage.setItem("refreshToken", data.refreshToken);
resolve(data) console.log('登录成功', data)
this.token.startUp() resolve(data)
this.token.startUp()
}) })
}) })
} }
iframeSrc//毕生服务器链接 iframeSrc//毕生服务器链接
src//文件存储地址 src//文件存储地址
lookWord(){ lookWord() {
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl);
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let docId = CryptoJS.enc.Base64.stringify(docIdWordArray);
let jwt = sessionStorage.getItem("token"); let jwt = sessionStorage.getItem("token");
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]);
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt);
let identityJsonparse = JSON.parse(identityJson) let identityJsonparse = JSON.parse(identityJson)
let filename:string let filename: string
this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data:any)=>{ this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data: any) => {
filename = data.fileName filename = data.fileName
let json = { let json = {
doc: { doc: {
docId: docId, docId: docId,
title: filename, title: filename,
//title: filename, //title: filename,
fetchUrl: `http://${location.host}/api/Objects/PlanPlatform/`+this.fetchUrl fetchUrl: `http://${location.host}/api/Objects/PlanPlatform/` + this.fetchUrl
}, },
user: { user: {
uid: identityJsonparse.sub, uid: identityJsonparse.sub,
nickName: identityJsonparse.name, nickName: identityJsonparse.name,
avatar: "", avatar: "",
privilege: [ privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' 'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT'
], ],
}, },
} }
@ -108,25 +109,25 @@ export class ExternalLinksPlanComponent implements OnInit {
companyData//当前公司信息 companyData//当前公司信息
thirdPartyURL thirdPartyURL
threedUrl:any threedUrl: any
handleData () { handleData() {
let data = this.planData let data = this.planData
if (this.planData.planMode == 2) { //预案planMode=2时, 跳查看页面组件 if (this.planData.planMode == 2) { //预案planMode=2时, 跳查看页面组件
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
console.log(data) console.log(data)
data && data.company? this.companyData = data.company : null data && data.company ? this.companyData = data.company : null
sessionStorage.setItem("buildingTypeId", this.companyData.buildingTypes.length? this.companyData.buildingTypes[0].id: undefined); sessionStorage.setItem("buildingTypeId", this.companyData.buildingTypes.length ? this.companyData.buildingTypes[0].id : undefined);
sessionStorage.setItem("companyId",data.companyId); sessionStorage.setItem("companyId", data.companyId);
sessionStorage.setItem("planId",this.planId); sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem("editable",'0'); sessionStorage.setItem("editable", '0');
sessionStorage.setItem("planName",this.planData.name) sessionStorage.setItem("planName", this.planData.name)
this.showType = 3 this.showType = 3
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${data.companyId}`) // this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${data.companyId}`)
}) })
} else if (this.planData.planMode == 3) { //预案planMode=3时, 第三方网址' } else if (this.planData.planMode == 3) { //预案planMode=3时, 第三方网址'
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
data && data.company? this.companyData = data.company : null data && data.company ? this.companyData = data.company : null
this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(data.url) this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(data.url)
this.showType = 2 this.showType = 2
}) })

2
src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.html

@ -140,7 +140,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="addtime"> <ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>审核时间</th> <th mat-header-cell *matHeaderCellDef>审核时间</th>
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td> <td mat-cell *matCellDef="let element">{{element.audittedTime | date:'yyyy-MM-dd'}}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="plantype"> <ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th> <th mat-header-cell *matHeaderCellDef>预案类型</th>

452
src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts

@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -19,7 +19,7 @@ declare var CryptoJS
}) })
export class PlanAnalysisBySynthesisComponent implements OnInit { 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 private _transformer = (node, level: number) => { //初始化tree
return { return {
@ -36,239 +36,239 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl(); myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'];
allorganizations:any //所有组织机构 allorganizations: any //所有组织机构
allunittype:any //所有单位类型 allunittype: any //所有单位类型
tabledataSource:any //表格数据 tabledataSource: any //表格数据
url url
preparelevels:any preparelevels: any
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.getunitdata(); this.getunitdata();
this.getOrganizations(); this.getOrganizations();
this.getUnittype(); this.getUnittype();
this.getAllPlanInfo(); this.getAllPlanInfo();
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队 if (level == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "1"){//如果是支队 if (level == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "2"){//如果是大队 if (level == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "3"){//如果是中队 if (level == "3") {//如果是中队
this.preparelevels = [ 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) //console.log(this.url)
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
allPlanInfo:any //存储所有预案信息 allPlanInfo: any //存储所有预案信息
//获得所有预案信息 //获得所有预案信息
getAllPlanInfo(){ getAllPlanInfo() {
let reservePlanType let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : 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("|")) reservePlanType = eval(this.reservePlanType.join("|"))
} }
let paramsdata:any = { let paramsdata: any = {
CompanyName: this.companyName || '', CompanyName: this.companyName || '',
OrganizationId: this.jsId || '', OrganizationId: this.jsId || '',
HasChildrenOrganization:this.jscheck || '', HasChildrenOrganization: this.jscheck || '',
BuildingTypeId: this.unittype || '', BuildingTypeId: this.unittype || '',
PlanType: this.reservePlanType || '', PlanType: this.reservePlanType || '',
AuditStatus:'', //审核状态 AuditStatus: '', //审核状态
PlanLevel: this.preparelevel || '', PlanLevel: this.preparelevel || '',
HasChildrenPlanLevel: this.plcheck || '', HasChildrenPlanLevel: this.plcheck || '',
CreationTimeRangeStart:this.addtime||'', AduitTimeRangeStart: this.addtime || '',
CreationTimeRangeEnd:this.endtime||'', AduitTimeRangeEnd: this.endtime || '',
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: '', 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.length = data.totalCount
this.allPlanInfo = data this.allPlanInfo = data
this.tabledataSource = data.items this.tabledataSource = data.items
}) })
} }
colorRgb(sColor){ colorRgb(sColor) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase(); var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) { if (sColor && reg.test(sColor)) {
if (sColor.length === 4) { if (sColor.length === 4) {
var sColorNew = "#"; var sColorNew = "#";
for (var i = 1; i < 4; i += 1) { for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, 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)));
} }
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 { } else {
return sColor; return sColor;
} }
} }
colorHex(rgb){ colorHex(rgb) {
var _this = rgb; var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) { if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#"; var strHex = "#";
for (var i = 0; i < aColor.length; i++) { for (var i = 0; i < aColor.length; i++) {
var hex:any = Number(aColor[i]).toString(16); var hex: any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") { if (hex === "0") {
hex += hex; hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
} }
return strHex; strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) { } else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split(""); var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) { if (aNum.length === 6) {
return _this; return _this;
} else if (aNum.length === 3) { } else if (aNum.length === 3) {
var numHex = "#"; var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) { for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]); numHex += (aNum[i] + aNum[i]);
}
return numHex;
} }
return numHex;
}
} else { } else {
return _this; return _this;
} }
} }
gradientColor(startColor, endColor, step) { gradientColor(startColor, endColor, step) {
let _this = this let _this = this
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0]; let startR = startRGB[0];
let startG = startRGB[1]; let startG = startRGB[1];
let startB = startRGB[2]; let startB = startRGB[2];
let endRGB = _this.colorRgb(endColor); let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0]; let endR = endRGB[0];
let endG = endRGB[1]; let endG = endRGB[1];
let endB = endRGB[2]; let endB = endRGB[2];
let sR = (endR - startR) / step;//总差值 let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step; let sG = (endG - startG) / step;
let sB = (endB - startB) / step; let sB = (endB - startB) / step;
var colorArr = []; var colorArr = [];
for (var i = 0; i < step; i++) { for (var i = 0; i < step; i++) {
//计算每一步的hex值 //计算每一步的hex值
var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex); colorArr.push(hex);
} }
return colorArr; return colorArr;
} }
integrity(width){ integrity(width) {
let _this = this let _this = this
let style:any = {} let style: any = {}
style.width = width +'%'; style.width = width + '%';
if(width < 30){ if (width < 30) {
let colorArr = this.gradientColor('#D50000', '#E53935', 30); let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){ for (let i = 0; i < 30; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i] style.background = colorArr[i]
} }
} }
} }
if(width >= 30 && width < 60){ if (width >= 30 && width < 60) {
let colorArr = this.gradientColor('#FF9800', '#E65100', 30); let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){ for (let i = 30; i < 60; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-30] style.background = colorArr[i - 30]
} }
} }
} }
if(width >= 60){ if (width >= 60) {
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){ for (let i = 60; i <= 100; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-60] style.background = colorArr[i - 60]
} }
} }
} }
return style return style
} }
integrityDetails(width,zong){ integrityDetails(width, zong) {
let style:any = {} let style: any = {}
style.width = (width/zong)*100 +'%'; style.width = (width / zong) * 100 + '%';
return style return style
} }
//得到当前单位信息 //得到当前单位信息
getunitdata(){ getunitdata() {
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
} }
) )
} }
@ -276,31 +276,31 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
endtime//结束时间 endtime//结束时间
integrityScoreMin//完整度最小值 integrityScoreMin//完整度最小值
integrityScoreMax//完整度最大值 integrityScoreMax//完整度最大值
organizationName:any //当前单位组织机构名称 organizationName: any //当前单位组织机构名称
treedata:any //组织机构树型数据 treedata: any //组织机构树型数据
newArr:any = [] newArr: any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据 //得到当前单位所在组织机构的tree型数据
getpresentOrganization(){ getpresentOrganization() {
this.newallorganizations = this.allorganizations this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
item.children = [] item.children = []
this.newallorganizations.forEach(element => { this.newallorganizations.forEach(element => {
if(element.parentId == item.id){ if (element.parentId == item.id) {
item.children.push(element) item.children.push(element)
} }
}); });
}); });
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
if(this.organizationName){ if (this.organizationName) {
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){ if (item.name == this.organizationName) {
this.dataSource.data = [item] this.dataSource.data = [item]
} }
}); });
}else{ } else {
this.dataSource.data = this.tree.toTree(this.treedata); 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( this.http.get('/api/Organizations').subscribe(
(data:any)=>{ (data: any) => {
this.allorganizations = data this.allorganizations = data
this.treedata = this.tree.toTree(data); this.treedata = this.tree.toTree(data);
this.getpresentOrganization(); this.getpresentOrganization();
@ -319,120 +319,120 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
} }
//获得所有单位类型 //获得所有单位类型
getUnittype(){ getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe( this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{ data => {
this.allunittype = data this.allunittype = data
} }
) )
} }
//查看单位信息 //查看单位信息
lookUnitInfo(element){ lookUnitInfo(element) {
// console.log(element) // console.log(element)
// const dialogRef = this.dialog.open(UnitInfo, { // const dialogRef = this.dialog.open(UnitInfo, {
// width: '1500px', // width: '1500px',
// height:'800px' // height:'800px'
// }); // });
sessionStorage.setItem("editable","0") sessionStorage.setItem("editable", "0")
sessionStorage.setItem("companyName",element.company.name) sessionStorage.setItem("companyName", element.company.name)
sessionStorage.setItem("companyId",element.company.id) sessionStorage.setItem("companyId", element.company.id)
sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore)) sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank'); window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank');
} }
//跳转查看预案页面 审核通过预案 //跳转查看预案页面 审核通过预案
routerTo(e){ routerTo(e) {
// console.log(e) // console.log(e)
if(e.planMode == 0||e.planMode == 1){ if (e.planMode == 0 || e.planMode == 1) {
//console.log(e.attachmentUrls) //console.log(e.attachmentUrls)
var index=e.attachmentUrls[0].indexOf("\/") var index = e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){ if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkPsViewer2, { const dialogRef = this.dialog.open(GkPsViewer2, {
width: '1500px', width: '1500px',
height:'800px', height: '800px',
data: e.attachmentUrls[0] 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' 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)=='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') */{ ||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 filename: string
let fetchUrl = e.attachmentUrls[0] let fetchUrl = e.attachmentUrls[0]
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl);
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let docId = CryptoJS.enc.Base64.stringify(docIdWordArray);
let jwt = sessionStorage.getItem("token"); let jwt = sessionStorage.getItem("token");
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]);
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt);
let identityJsonparse=JSON.parse(identityJson) let identityJsonparse = JSON.parse(identityJson)
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => {
filename=data.fileName filename = data.fileName
let json={ let json = {
doc: { doc: {
docId: docId, docId: docId,
title: filename, title: filename,
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl, fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/` + fetchUrl,
}, },
user: { user: {
uid: identityJsonparse.sub, uid: identityJsonparse.sub,
nickName: identityJsonparse.name, nickName: identityJsonparse.name,
avatar: "", avatar: "",
privilege: [ privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' 'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT'
], ],
}, },
} }
var stringjson=JSON.stringify(json) var stringjson = JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray); var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`) 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 let id = e.id
sessionStorage.setItem("planId",id) sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId",e.companyId) sessionStorage.setItem("companyId", e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId) //sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable","0") sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName",e.name) sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
} }
if(e.planMode == 3){ //如果是跳转网页 if (e.planMode == 3) { //如果是跳转网页
sessionStorage.setItem("url",e.url) sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`) window.open(`/planManagement/webLook`)
} }
} }
//预案公开 //预案公开
openReserve (e) { openReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{ this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('预案已公开','确定',config); this.snackBar.open('预案已公开', '确定', config);
}) })
} }
//预案取消公开 //预案取消公开
closeReserve (e) { closeReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{ this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('预案已取消公开','确定',config); this.snackBar.open('预案已取消公开', '确定', config);
}) })
} }
//分页事件 //分页事件
chagePage(e){ chagePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//辖区中队div是否显示 //辖区中队div是否显示
isorganizationbox:boolean = false isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量 //点击辖区中队树,将选择的辖区中队添加到变量
add(node) { add(node) {
this.isorganizationbox = false this.isorganizationbox = false
@ -448,26 +448,26 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
this.isorganizationbox = true this.isorganizationbox = true
} }
//关闭出现的组织机构div //关闭出现的组织机构div
closediv(){ closediv() {
this.isorganizationbox = false this.isorganizationbox = false
} }
//查询 //查询
onSubmit (e) { onSubmit(e) {
this.PageNumber = 1 this.PageNumber = 1
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
companyName:any //单位名称 companyName: any //单位名称
js:any //所选组织机构 js: any //所选组织机构
jsId:any //所选组织机构的id jsId: any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框 jscheck: boolean //所选组织机构勾选框
unittype:any //单位类型 unittype: any //单位类型
reservePlanType:any //预案类型 reservePlanType: any //预案类型
preparelevel:any //编制级别 preparelevel: any //编制级别
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
planCategory=[]//预案级别 planCategory = []//预案级别
//重置 //重置
reset(){ reset() {
this.companyName = '' this.companyName = ''
this.js = '' this.js = ''
this.jsId = '' this.jsId = ''
@ -475,13 +475,13 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
this.unittype = '' this.unittype = ''
this.reservePlanType = '' this.reservePlanType = ''
this.preparelevel = '' this.preparelevel = ''
this.addtime='' this.addtime = ''
this.endtime='' this.endtime = ''
this.plcheck = false this.plcheck = false
//重新获取初始化列表 //重新获取初始化列表
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.planCategory=[] this.planCategory = []
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
} }
@ -491,13 +491,13 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
templateUrl: './PsvShow.html', templateUrl: './PsvShow.html',
styleUrls: ['./plan-analysis-by-synthesis.component.scss'] styleUrls: ['./plan-analysis-by-synthesis.component.scss']
}) })
export class GkPsViewer2{ 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) {} 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 { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
const viewer = new Viewer({ const viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data, panorama: '/api/Objects/PlanPlatform/' + this.data,
}); });
} }

266
src/app/statistic-analysis/real-monitoring/real-monitoring.component.ts

@ -4,14 +4,14 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2021-05-08 09:42:43 * @Date: 2021-05-08 09:42:43
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-05-13 14:04:20 * @LastEditTime: 2021-05-13 14:24:42
*/ */
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import {FormGroup, FormControl} from '@angular/forms'; //import {Foimport { FormGroup, FormControl } from '@angular/forms';
import {EchartsDataService} from '../echarts-data.service'; import { EchartsDataService } from '../echarts-data.service';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
declare var echarts: any; declare var echarts: any;
@Component({ @Component({
@ -24,19 +24,19 @@ export class RealMonitoringComponent implements OnInit {
/* campaignOne: FormGroup; /* campaignOne: FormGroup;
campaignTwo: FormGroup; */ campaignTwo: FormGroup; */
constructor(private router: Router,public EchartsData:EchartsDataService,private route:ActivatedRoute,public snackBar: MatSnackBar) { } constructor(private router: Router, public EchartsData: EchartsDataService, private route: ActivatedRoute, public snackBar: MatSnackBar) { }
addtime= String(new Date().getFullYear())+'-01'//添加时间 addtime = String(new Date().getFullYear()) + '-01'//添加时间
endtime= String(new Date().getFullYear())+'-0'+String(new Date().getMonth()+1) endtime = String(new Date().getFullYear()) + '-0' + String(new Date().getMonth() + 1)
/* addtime=String(new Date().getFullYear()+new Date().getMonth()) /* addtime=String(new Date().getFullYear()+new Date().getMonth())
endtime=String(new Date().getFullYear()+new Date().getMonth()) */ endtime=String(new Date().getFullYear()+new Date().getMonth()) */
ngOnInit(): void { ngOnInit(): void {
window.setTimeout(()=>{ window.setTimeout(() => {
this.getechartsdata(true) this.getechartsdata(true)
},0) }, 0)
} }
//获取echarts数据 //获取echarts数据
async getechartsdata(chushi:boolean){ async getechartsdata(chushi: boolean) {
/* var date=new Date() /* var date=new Date()
var year=date.getFullYear(); var year=date.getFullYear();
var month=date.getMonth()+1 var month=date.getMonth()+1
@ -60,89 +60,89 @@ export class RealMonitoringComponent implements OnInit {
}); });
} */ } */
for(var i=Number(this.addtime.split('-')[0]);i<=Number(this.endtime.split('-')[0]);i++){ for (var i = Number(this.addtime.split('-')[0]); i <= Number(this.endtime.split('-')[0]); i++) {
let paramdataleft={ let paramdataleft = {
objectType:3, objectType: 3,
TrendYear:i TrendYear: i
} }
//获取左侧柱状图的数据 //获取左侧柱状图的数据
await this.EchartsData.getData(paramdataleft,'/api/StatisticsAnalysis/Trends') await this.EchartsData.getData(paramdataleft, '/api/StatisticsAnalysis/Trends')
this.leftzhuTable=JSON.parse(JSON.stringify(this.EchartsData.allDate)) this.leftzhuTable = JSON.parse(JSON.stringify(this.EchartsData.allDate))
//console.log(this.leftzhuTable) //console.log(this.leftzhuTable)
this.leftzhuTable[0].forEach((value,index,array) => { this.leftzhuTable[0].forEach((value, index, array) => {
if(this.addtime.split('-')[0]!=this.endtime.split('-')[0]){ if (this.addtime.split('-')[0] != this.endtime.split('-')[0]) {
if((array[index].year==Number(this.addtime.split('-')[0])&&array[index].month>=Number(this.addtime.split('-')[1]))||(array[index].year==Number(this.endtime.split('-')[0])&&array[index].month<=Number(this.endtime.split('-')[1]))){ if ((array[index].year == Number(this.addtime.split('-')[0]) && array[index].month >= Number(this.addtime.split('-')[1])) || (array[index].year == Number(this.endtime.split('-')[0]) && array[index].month <= Number(this.endtime.split('-')[1]))) {
this.dateNum.push(array[index].count) this.dateNum.push(array[index].count)
this.dateyue.push(array[index].year+'-'+array[index].month) this.dateyue.push(array[index].year + '-' + array[index].month)
} }
}else{ } else {
if(array[index].month>=this.addtime.split('-')[1]&&array[index].month<=this.endtime.split('-')[1]){ if (array[index].month >= this.addtime.split('-')[1] && array[index].month <= this.endtime.split('-')[1]) {
this.dateNum.push(array[index].count) this.dateNum.push(array[index].count)
this.dateyue.push(array[index].year+'-'+array[index].month) this.dateyue.push(array[index].year + '-' + array[index].month)
} }
} }
}); });
} }
//获取底端柱状图数据 //获取底端柱状图数据
let paramBottom={ let paramBottom = {
TimeIntervalStart:this.addtime=='0'?'':this.endtime, TimeIntervalStart: this.addtime == '0' ? '' : this.endtime,
TimeIntervalEnd:this.endtime=='0'?'':this.endtime TimeIntervalEnd: this.endtime == '0' ? '' : this.endtime
} }
if(chushi){ if (chushi) {
await this.EchartsData.getData(paramBottom,'/api/StatisticsAnalysis/Plans/AuditApproved/Organizations') await this.EchartsData.getData(paramBottom, '/api/StatisticsAnalysis/Plans/AuditApproved/Organizations')
this.bottomTable=JSON.parse(JSON.stringify(this.EchartsData.allDate)) this.bottomTable = JSON.parse(JSON.stringify(this.EchartsData.allDate))
this.addNum= this.bottomTable[0].totalCount this.addNum = this.bottomTable[0].totalCount
this.bottomTable[0].organizations.forEach((value,index,array) => { this.bottomTable[0].organizations.forEach((value, index, array) => {
this.zhiNameData.push(array[index].organizationName) this.zhiNameData.push(array[index].organizationName)
this.zhiNumData.push(array[index].count) this.zhiNumData.push(array[index].count)
if(index>0&&index<4){ if (index > 0 && index < 4) {
this.addyuan.push(array[index].organizationName) this.addyuan.push(array[index].organizationName)
} }
}); });
this.bottomzhutu() this.bottomzhutu()
} }
//右侧饼状图数据 //右侧饼状图数据
let param={ let param = {
TimeIntervalStart:this.addtime=='0'?'':this.addtime, TimeIntervalStart: this.addtime == '0' ? '' : this.addtime,
TimeIntervalEnd:this.endtime=='0'?'':this.endtime TimeIntervalEnd: this.endtime == '0' ? '' : this.endtime
} }
await this.EchartsData.getData(param,'/api/StatisticsAnalysis/Plans/AuditApproved/PlanTypes') await this.EchartsData.getData(param, '/api/StatisticsAnalysis/Plans/AuditApproved/PlanTypes')
this.rightbTable=JSON.parse(JSON.stringify(this.EchartsData.allDate)) this.rightbTable = JSON.parse(JSON.stringify(this.EchartsData.allDate))
this.leftzhuzhuangtu() this.leftzhuzhuangtu()
this.rightbingtu() this.rightbingtu()
} }
//查询按钮 //查询按钮
findClick(){ findClick() {
console.log(this.addtime,this.endtime) console.log(this.addtime, this.endtime)
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if(this.addtime=='0'||this.endtime=='0'){ if (this.addtime == '0' || this.endtime == '0') {
this.snackBar.open('结束时间或者开始时间不能为空!','确定',config); this.snackBar.open('结束时间或者开始时间不能为空!', '确定', config);
}else{ } else {
if(this.endtime<this.addtime){ if (this.endtime < this.addtime) {
this.snackBar.open('结束时间不能大于开始时间!','确定',config); this.snackBar.open('结束时间不能大于开始时间!', '确定', config);
}else{ } else {
this.leftzhutu.clear() this.leftzhutu.clear()
this.leftzhutu.dispose() this.leftzhutu.dispose()
this.dateyue=[] this.dateyue = []
this.dateNum = [] this.dateNum = []
this.zhiNameData = [] //this.zhiNameData = []
this.zhiNumData = [] //this.zhiNumData = []
this.addyuan=[] //this.addyuan = []
this.getechartsdata(false) this.getechartsdata(false)
} }
} }
} }
addNum=0//新增预案个数 addNum = 0//新增预案个数
addyuan=[] addyuan = []
leftzhuTable//左侧柱状图数据 leftzhuTable//左侧柱状图数据
rightbTable//右侧饼图数据 rightbTable//右侧饼图数据
bottomTable//最低端柱状图数据 bottomTable//最低端柱状图数据
@ -156,24 +156,24 @@ export class RealMonitoringComponent implements OnInit {
optionRightbing//中间右侧柱状图 optionRightbing//中间右侧柱状图
bottomzhu//底部柱状图实例 bottomzhu//底部柱状图实例
bottomZhuoption bottomZhuoption
tiaoshiPao:any tiaoshiPao: any
//中间左侧柱状图 //中间左侧柱状图
async leftzhuzhuangtu(){ async leftzhuzhuangtu() {
var ec = echarts as any; var ec = echarts as any;
this.leftzhutu = ec.init(document.getElementById(`leftecharts`),'walden'); this.leftzhutu = ec.init(document.getElementById(`leftecharts`), 'walden');
this.optionLeftzhu = { this.optionLeftzhu = {
grid: { grid: {
//top: 10, //top: 10,
containLabel:true, containLabel: true,
bottom:10, bottom: 10,
left:50 left: 50
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'none' type: 'none'
} }
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.dateyue, data: this.dateyue,
@ -186,6 +186,8 @@ export class RealMonitoringComponent implements OnInit {
} }
} }
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
@ -196,6 +198,8 @@ export class RealMonitoringComponent implements OnInit {
} }
} }
}, },
/* tooltip: { /* tooltip: {
trigger: 'item', trigger: 'item',
@ -204,25 +208,25 @@ export class RealMonitoringComponent implements OnInit {
}, },
position: this.echartsData.tableTooltipNoShowq position: this.echartsData.tableTooltipNoShowq
}, */ }, */
dataZoom:[ dataZoom: [
{ {
type: 'slider', type: 'slider',
bottom:2 bottom:2
} }
], ],
series: [{ series: [{
name: '数量', name: '数量',
data: this.dateNum, data: this.dateNum,
type: 'bar', type: 'bar',
markPoint: { markPoint: {
symbolSize:[65, 65], symbolSize: [65, 65],
data: this.EchartsData.qipao(this.tiaoshiPao,this.dateNum,this.dateyue) data: this.EchartsData.qipao(this.tiaoshiPao, this.dateNum, this.dateyue)
}, },
backgroundStyle: { backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)' color: 'rgba(220, 220, 220, 0.8)'
}, },
barWidth :'38', barWidth: '38',
//label: this.topTextlabel //label: this.topTextlabel
}] }]
}; };
this.leftzhutu.setOption(this.optionLeftzhu); this.leftzhutu.setOption(this.optionLeftzhu);
@ -266,11 +270,11 @@ export class RealMonitoringComponent implements OnInit {
} }
//中间右侧饼图 //中间右侧饼图
indexData=[{name:'二维预案','value':1},{name:'三维预案','value':1}]//所有数据 indexData = [{ name: '二维预案', 'value': 1 }, { name: '三维预案', 'value': 1 }]//所有数据
lengthdata=['二维预案','三维预案','文本预案','其他预案'] lengthdata = ['二维预案', '三维预案', '文本预案', '其他预案']
rightbingtu(){ rightbingtu() {
this.rightbing = echarts.init(document.getElementById('rightecharts'),'walden'); this.rightbing = echarts.init(document.getElementById('rightecharts'), 'walden');
this.optionRightbing={ this.optionRightbing = {
/* title: { /* title: {
text: `建筑类型统计(${this.count}家)`, text: `建筑类型统计(${this.count}家)`,
left: 'center', left: 'center',
@ -290,45 +294,45 @@ export class RealMonitoringComponent implements OnInit {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow'
} }
}, },
legend: { legend: {
orient: 'vertical', orient: 'vertical',
//left:this.padHw?50:0, //left:this.padHw?50:0,
//right:this.padHw?20:250, //right:this.padHw?20:250,
top:20, top: 20,
right:30, right: 30,
textStyle:{ textStyle: {
fontSize:16, fontSize: 16,
color:"#000000" color: "#000000"
}, },
data: this.lengthdata data: this.lengthdata
}, },
series: [ series: [
{ {
top:'0', top: '0',
name: '预案类型', name: '预案类型',
type: 'pie', type: 'pie',
radius: '60%', radius: '60%',
center: ['50%', '53%'], center: ['50%', '53%'],
label:{ label: {
show:true, show: true,
fontSize:16, fontSize: 16,
formatter:'{b}{c}家\n{d|({d}%)}', formatter: '{b}{c}家\n{d|({d}%)}',
rich: { rich: {
d: { d: {
align: 'center', align: 'center',
fontSize:18 fontSize: 18
} }
}, },
}, },
data:[ data: [
{value:this.rightbTable[0].planTypeStatistics.planTypes[0]!=undefined? this.rightbTable[0].planTypeStatistics.planTypes[0].count:0, name: '二维预案'}, { value: this.rightbTable[0].planTypeStatistics.planTypes[0] != undefined ? this.rightbTable[0].planTypeStatistics.planTypes[0].count : 0, name: '二维预案' },
{value:this.rightbTable[0].planTypeStatistics.planTypes[1]!=undefined? this.rightbTable[0].planTypeStatistics.planTypes[1].count:0, name: '三维预案'}, { value: this.rightbTable[0].planTypeStatistics.planTypes[1] != undefined ? this.rightbTable[0].planTypeStatistics.planTypes[1].count : 0, name: '三维预案' },
{value:this.rightbTable[0].planTypeStatistics.planTypes[2]!=undefined? this.rightbTable[0].planTypeStatistics.planTypes[2].count:0, name: '其他预案'}, { value: this.rightbTable[0].planTypeStatistics.planTypes[2] != undefined ? this.rightbTable[0].planTypeStatistics.planTypes[2].count : 0, name: '其他预案' },
{value:this.rightbTable[0].planTypeStatistics.planTypes[3]!=undefined? this.rightbTable[0].planTypeStatistics.planTypes[3].count:0, name: '文本预案'} { value: this.rightbTable[0].planTypeStatistics.planTypes[3] != undefined ? this.rightbTable[0].planTypeStatistics.planTypes[3].count : 0, name: '文本预案' }
], ],
emphasis: { emphasis: {
itemStyle: { itemStyle: {
shadowBlur: 10, shadowBlur: 10,
@ -342,9 +346,9 @@ export class RealMonitoringComponent implements OnInit {
this.rightbing.setOption(this.optionRightbing) this.rightbing.setOption(this.optionRightbing)
} }
//最底部柱状图 //最底部柱状图
bottomzhutu(){ bottomzhutu() {
var ec = echarts as any; var ec = echarts as any;
this.bottomzhu = ec.init(document.getElementById(`bottomEcharts`),'walden'); this.bottomzhu = ec.init(document.getElementById(`bottomEcharts`), 'walden');
this.bottomZhuoption = { this.bottomZhuoption = {
grid: { grid: {
//top: 10, //top: 10,
@ -356,8 +360,8 @@ export class RealMonitoringComponent implements OnInit {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'none' type: 'none'
} }
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.zhiNameData, data: this.zhiNameData,
@ -390,6 +394,8 @@ export class RealMonitoringComponent implements OnInit {
} }
} //function } //function
} }
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
@ -401,11 +407,11 @@ export class RealMonitoringComponent implements OnInit {
} }
}, },
dataZoom:[ dataZoom: [
{ {
type: 'slider', type: 'slider',
bottom:90, bottom:90,
backgroundColor:'rgba(47,69,84,-0.2)', //backgroundColor:'rgba(47,69,84,-0.2)',
dataBackground:{ dataBackground:{
areaStyle:{ areaStyle:{
opacity:0 opacity:0
@ -414,24 +420,22 @@ export class RealMonitoringComponent implements OnInit {
} }
], ],
series: [{ series: [{
name: '数量', name: '数量',
data: this.zhiNumData, data: this.zhiNumData,
type: 'bar', type: 'bar',
markPoint: { markPoint: {
symbolSize:[65, 65], symbolSize: [65, 65],
data: this.EchartsData.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) data: this.EchartsData.qipao(this.tiaoshiPao, this.zhiNumData, this.zhiNameData)
}, },
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
//barWidth :'38', //barWidth :'38',
//label: this.topTextlabel //label: this.topTextlabel
}] }]
}; };
this.bottomzhu.setOption(this.bottomZhuoption); this.bottomzhu.setOption(this.bottomZhuoption);
/* this.bottomzhu.getZr().on('click',(params)=>{ /* this.bottomzhu.getZr().on('click',(params)=>{
console.log(params) console.log(params)
}) */ }) */
} }
} }

79
src/app/statistic-analysis/statistic-analysis-routing.module.ts

@ -12,16 +12,16 @@ import { PageOneComponent } from './state/page-one/page-one.component';
import { PageTwoNameComponent } from './state/page-two-name/page-two-name.component'; import { PageTwoNameComponent } from './state/page-two-name/page-two-name.component';
import { PageTwoTimeComponent } from './state/page-two-time/page-two-time.component'; import { PageTwoTimeComponent } from './state/page-two-time/page-two-time.component';
import { PageZhongDuiDetailsComponent } from './state/page-zhong-dui-details/page-zhong-dui-details.component'; import { PageZhongDuiDetailsComponent } from './state/page-zhong-dui-details/page-zhong-dui-details.component';
import { PageThereComponent} from './state/page-there/page-there.component'; import { PageThereComponent } from './state/page-there/page-there.component';
import { PageThereYearComponent} from './state/page-there-year/page-there-year.component' import { PageThereYearComponent } from './state/page-there-year/page-there-year.component'
import { DeleteOneComponent } from './deleteUnit/delete-one/delete-one.component'; import { DeleteOneComponent } from './deleteUnit/delete-one/delete-one.component';
import { DeleteTwoComponent } from './deleteUnit/delete-two/delete-two.component'; import { DeleteTwoComponent } from './deleteUnit/delete-two/delete-two.component';
import {DeleteTwoNewaddComponent}from './deleteUnit/delete-two-newadd/delete-two-newadd.component' import { DeleteTwoNewaddComponent } from './deleteUnit/delete-two-newadd/delete-two-newadd.component'
import { DeleteThereComponent } from './deleteUnit/delete-there/delete-there.component'; import { DeleteThereComponent } from './deleteUnit/delete-there/delete-there.component';
import { DeleteThereLineDetailsComponent } from './deleteUnit/delete-there-line-details/delete-there-line-details.component'; import { DeleteThereLineDetailsComponent } from './deleteUnit/delete-there-line-details/delete-there-line-details.component';
import { DeleteFourComponent } from './deleteUnit/delete-four/delete-four.component'; import { DeleteFourComponent } from './deleteUnit/delete-four/delete-four.component';
import { BuildingTypeOneComponent } from './buildingType/building-type-one/building-type-one.component'; import { BuildingTypeOneComponent } from './buildingType/building-type-one/building-type-one.component';
import {ScheduledUpdatesComponent,publicEchartsComponent} from './scheduled-updates/scheduled-updates.component' import { ScheduledUpdatesComponent, publicEchartsComponent } from './scheduled-updates/scheduled-updates.component'
import { BuildingTypeTwoForwardComponent } from './buildingType/building-type-two-forward/building-type-two-forward.component'; import { BuildingTypeTwoForwardComponent } from './buildingType/building-type-two-forward/building-type-two-forward.component';
import { BuildingTypeTwoReverseComponent } from './buildingType/building-type-two-reverse/building-type-two-reverse.component'; import { BuildingTypeTwoReverseComponent } from './buildingType/building-type-two-reverse/building-type-two-reverse.component';
import { BuildingTypeThreeDetailsComponent } from './buildingType/building-type-three-details/building-type-three-details.component'; import { BuildingTypeThreeDetailsComponent } from './buildingType/building-type-three-details/building-type-three-details.component';
@ -32,47 +32,46 @@ import { AddUnitTwoTimeComponent } from './addUnit/add-unit-two-time/add-unit-tw
import { AddUnitThreeLineDetailsComponent } from './addUnit/add-unit-three-line-details/add-unit-three-line-details.component'; import { AddUnitThreeLineDetailsComponent } from './addUnit/add-unit-three-line-details/add-unit-three-line-details.component';
import { AddUnitThreeBarDetailsComponent } from './addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component'; import { AddUnitThreeBarDetailsComponent } from './addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import { yueDateComponent }from './scheduled-updates/scheduled-updates.component' import { yueDateComponent } from './scheduled-updates/scheduled-updates.component'
import { CompangInfoComponent }from './compang-info/compang-info.component' import { CompangInfoComponent } from './compang-info/compang-info.component'
import { AllPlanComponent } from './all-plan/all-plan.component' import { AllPlanComponent } from './all-plan/all-plan.component'
import { PlanAnalysisBySynthesisComponent } from './plan-analysis-by-synthesis/plan-analysis-by-synthesis.component'; import { PlanAnalysisBySynthesisComponent } from './plan-analysis-by-synthesis/plan-analysis-by-synthesis.component';
import { RealMonitoringComponent } from './real-monitoring/real-monitoring.component' import { RealMonitoringComponent } from './real-monitoring/real-monitoring.component'
const routes: Routes = [ const routes: Routes = [
{ path: 'statePageOne', component: PageOneComponent}, { path: 'statePageOne', component: PageOneComponent },
{ path: 'statePageOne/time', component: PageTwoTimeComponent}, { path: 'statePageOne/time', component: PageTwoTimeComponent },
{ path: 'statePageOne/name', component: PageTwoNameComponent}, { path: 'statePageOne/name', component: PageTwoNameComponent },
{ path: 'stataPageThere',component:PageThereComponent}, { path: 'stataPageThere', component: PageThereComponent },
{ path: 'stataPageThereYearComponent',component:PageThereYearComponent}, { path: 'stataPageThereYearComponent', component: PageThereYearComponent },
{ path: 'PageZhongDuiDetails',component:PageZhongDuiDetailsComponent}, { path: 'PageZhongDuiDetails', component: PageZhongDuiDetailsComponent },
{ path: 'delete_one', component: DeleteOneComponent}, { path: 'delete_one', component: DeleteOneComponent },
{ path: 'delete_one/delete_two', component: DeleteTwoComponent}, { path: 'delete_one/delete_two', component: DeleteTwoComponent },
{ path: 'delete_one/delete_there', component: DeleteThereComponent}, { path: 'delete_one/delete_there', component: DeleteThereComponent },
{ path: 'delete_one/delete_four', component: DeleteFourComponent}, { path: 'delete_one/delete_four', component: DeleteFourComponent },
{ path: 'buildingType_one', component: BuildingTypeOneComponent}, { path: 'delete_two', component: DeleteTwoComponent },
{ path: 'delete_two', component: DeleteTwoComponent}, { path: 'delete_two_newadd', component: DeleteTwoNewaddComponent },
{ path: 'delete_two_newadd', component: DeleteTwoNewaddComponent}, { path: 'delete_there', component: DeleteThereComponent },
{ path: 'delete_there', component: DeleteThereComponent}, { path: 'delete_thereLineDetails', component: DeleteThereLineDetailsComponent },
{ path: 'delete_thereLineDetails', component: DeleteThereLineDetailsComponent}, { path: 'delete_four', component: DeleteFourComponent },
{ path: 'delete_four', component: DeleteFourComponent}, { path: 'buildingType_one', component: BuildingTypeOneComponent },
{ path: 'buildingType_one', component: BuildingTypeOneComponent}, { path: 'buildingType_one/buildingType_two_forward', component: BuildingTypeTwoForwardComponent },
{ path: 'buildingType_one/buildingType_two_forward', component: BuildingTypeTwoForwardComponent}, { path: 'buildingType_one/buildingType_two_reverse', component: BuildingTypeTwoReverseComponent },
{ path: 'buildingType_one/buildingType_two_reverse', component: BuildingTypeTwoReverseComponent}, { path: 'buildingType_one/buildingType_three_details', component: BuildingTypeThreeDetailsComponent },
{ path: 'buildingType_one/buildingType_three_details', component: BuildingTypeThreeDetailsComponent}, { path: 'addUnit_one', component: AddUnitOneComponent },
{ path: 'addUnit_one', component: AddUnitOneComponent}, { path: 'addUnit_one/addUnit_two_type', component: AddUnitTwoTypeStatisticsComponent },
{ path: 'addUnit_one/addUnit_two_type', component: AddUnitTwoTypeStatisticsComponent}, { path: 'addUnit_one/addUnit_two_typeDetails', component: AddUnitTwoTypeDetailsComponent },
{ path: 'addUnit_one/addUnit_two_typeDetails', component: AddUnitTwoTypeDetailsComponent}, { path: 'addUnit_one/addUnit_two_time', component: AddUnitTwoTimeComponent },
{ path: 'addUnit_one/addUnit_two_time', component: AddUnitTwoTimeComponent}, { path: 'addUnit_one/addUnit_two_time/three_lineDetails', component: AddUnitThreeLineDetailsComponent },
{ path: 'addUnit_one/addUnit_two_time/three_lineDetails', component: AddUnitThreeLineDetailsComponent}, { path: 'addUnit_one/addUnit_two_time/three_barDetails', component: AddUnitThreeBarDetailsComponent },
{ path: 'addUnit_one/addUnit_two_time/three_barDetails', component: AddUnitThreeBarDetailsComponent}, { path: 'scheduledUpdates', component: ScheduledUpdatesComponent },
{ path: 'scheduledUpdates', component: ScheduledUpdatesComponent}, { path: 'scheduledUpdates/yueDate', component: yueDateComponent },
{ path: 'scheduledUpdates/yueDate', component: yueDateComponent}, { path: 'scheduledUpdates/PublicEcharts', component: publicEchartsComponent },
{ path: 'scheduledUpdates/PublicEcharts', component: publicEchartsComponent}, { path: 'home', component: HomeComponent },
{ path: 'home', component: HomeComponent}, { path: 'CompangInfo', component: CompangInfoComponent },
{ path: 'CompangInfo',component:CompangInfoComponent}, { path: 'AllPlan', component: AllPlanComponent },
{ path:'AllPlan',component:AllPlanComponent}, { path: 'PlanAnalysisBySynthesis', component: PlanAnalysisBySynthesisComponent },
{ path:'PlanAnalysisBySynthesis',component:PlanAnalysisBySynthesisComponent}, { path: 'RealMonitoring', component: RealMonitoringComponent }
{ path: 'RealMonitoring',component:RealMonitoringComponent}
]; ];
@NgModule({ @NgModule({

1503
src/app/ui/collection-tools/collection-tools.component.ts

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save