11 changed files with 1610 additions and 1281 deletions
File diff suppressed because it is too large
Load Diff
@ -1,187 +1,230 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
import { Component, OnInit } from "@angular/core"; |
||||||
import { Router } from '@angular/router'; |
import { Router } from "@angular/router"; |
||||||
import { HttpClient } from '@angular/common/http' |
import { HttpClient } from "@angular/common/http"; |
||||||
import {EchartsDataService,} from '../../echarts-data.service' |
import { EchartsDataService } from "../../echarts-data.service"; |
||||||
import { map } from 'rxjs/operators'; |
import { map } from "rxjs/operators"; |
||||||
declare var echarts: any; |
declare var echarts: any; |
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-building-type-one', |
selector: "app-building-type-one", |
||||||
templateUrl: './building-type-one.component.html', |
templateUrl: "./building-type-one.component.html", |
||||||
styleUrls: ['./building-type-one.component.scss'] |
styleUrls: ["./building-type-one.component.scss"], |
||||||
}) |
}) |
||||||
export class BuildingTypeOneComponent implements OnInit { |
export class BuildingTypeOneComponent implements OnInit { |
||||||
|
constructor( |
||||||
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } |
private http: HttpClient, |
||||||
|
private router: Router, |
||||||
|
public echartsData: EchartsDataService |
||||||
|
) {} |
||||||
|
|
||||||
ngOnInit(): void { |
ngOnInit(): void { |
||||||
if(window.matchMedia("(max-width: 1400px)").matches){ |
if (window.matchMedia("(max-width: 1400px)").matches) { |
||||||
this.padHw=true |
this.padHw = true; |
||||||
//this.padjt=
|
//this.padjt=
|
||||||
}else{ |
} else { |
||||||
this.padHw=false |
this.padHw = false; |
||||||
} |
} |
||||||
|
|
||||||
window.setTimeout(()=>{ |
window.setTimeout(() => { |
||||||
this.getechartsdata() |
this.getechartsdata(); |
||||||
}) |
}); |
||||||
} |
} |
||||||
ngOnDestroy(): void { |
ngOnDestroy(): void { |
||||||
this.indexBzt.clear() |
this.indexBzt.clear(); |
||||||
this.indexBzt.dispose() |
this.indexBzt.dispose(); |
||||||
} |
} |
||||||
async getechartsdata(){ |
async getechartsdata() { |
||||||
await this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`) |
await this.echartsData.getData( |
||||||
this.initCharts() |
null, |
||||||
|
`/api/StatisticsAnalysis/BuildingTypes` |
||||||
|
); |
||||||
|
this.initCharts(); |
||||||
} |
} |
||||||
/* 首页饼状图 */ |
/* 首页饼状图 */ |
||||||
indexBzt |
indexBzt; |
||||||
padHw |
padHw; |
||||||
lengthdata=[]//提示数据
|
lengthdata = []; //提示数据
|
||||||
count=0//总数
|
count = 0; //总数
|
||||||
indexData=[]//所有数据
|
indexData = []; //所有数据
|
||||||
tabledata |
tabledata; |
||||||
initCharts(){ |
initCharts() { |
||||||
if(sessionStorage.getItem('refresh') === 'true') { |
if (sessionStorage.getItem("refresh") === "true") { |
||||||
sessionStorage.removeItem('refresh'); |
sessionStorage.removeItem("refresh"); |
||||||
location.reload(); |
location.reload(); |
||||||
} |
} |
||||||
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
this.tabledata = JSON.parse(JSON.stringify(this.echartsData.allDate)); |
||||||
// console.log(this.tabledata)
|
// console.log(this.tabledata)
|
||||||
//console.log(this.echartsData.orid)
|
//console.log(this.echartsData.orid)
|
||||||
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ |
for (var i = 0; i < this.tabledata[0].buildingTypes.length; i++) { |
||||||
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName) |
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName); |
||||||
this.count=this.count+this.tabledata[0].buildingTypes[i].count |
this.count = this.count + this.tabledata[0].buildingTypes[i].count; |
||||||
this.indexData.push(this.tabledata[0].buildingTypes[i]) |
this.indexData.push(this.tabledata[0].buildingTypes[i]); |
||||||
} |
} |
||||||
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
||||||
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) |
this.indexData = this.indexData.map((v) => { |
||||||
//console.log(this.indexData)
|
return { name: v.buildingTypeName, value: v.count, id: v.buildingTypeId }; |
||||||
this.indexBzt = echarts.init(document.getElementById('indexBzt'),'walden'); |
}); |
||||||
let options={ |
//console.log(this.indexData)
|
||||||
|
this.indexBzt = echarts.init(document.getElementById("indexBzt"), "walden"); |
||||||
|
let options = { |
||||||
title: { |
title: { |
||||||
text: `建筑类型统计(${this.count}家)`, |
text: `建筑类型统计(${this.count}家)`, |
||||||
left: 'center', |
left: "center", |
||||||
top: "7%", |
top: "7%", |
||||||
textStyle: { |
textStyle: { |
||||||
fontSize:31 |
fontSize: 31, |
||||||
} |
}, |
||||||
}, |
}, |
||||||
tooltip: { |
tooltip: { |
||||||
trigger: 'item', |
trigger: "item", |
||||||
position: this.echartsData.tableTooltipNoShow2, |
position: this.echartsData.tableTooltipNoShow2, |
||||||
formatter: (params)=>{ |
formatter: (params) => { |
||||||
this.echartsData.biaogeTishiZhi(params.data) |
this.echartsData.biaogeTishiZhi(params.data); |
||||||
return this.echartsData.res |
return this.echartsData.res; |
||||||
} |
}, |
||||||
}, |
}, |
||||||
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:60, |
top: 60, |
||||||
textStyle:{ |
textStyle: { |
||||||
fontSize:18, |
fontSize: 18, |
||||||
color:"#000000" |
color: "#000000", |
||||||
}, |
}, |
||||||
data: this.lengthdata |
data: this.lengthdata, |
||||||
}, |
}, |
||||||
series: [ |
series: [ |
||||||
{ |
{ |
||||||
top:this.padHw?'15%':'0', |
top: this.padHw ? "15%" : "0", |
||||||
name: '访问来源', |
name: "访问来源", |
||||||
type: 'pie', |
type: "pie", |
||||||
radius: '60%', |
radius: "60%", |
||||||
center: ['50%', '53%'], |
center: ["50%", "53%"], |
||||||
label:{ |
label: { |
||||||
show:true, |
show: true, |
||||||
fontSize:18, |
fontSize: 18, |
||||||
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:this.indexData, |
data: this.indexData, |
||||||
emphasis: { |
emphasis: { |
||||||
itemStyle: { |
itemStyle: { |
||||||
shadowBlur: 10, |
shadowBlur: 10, |
||||||
shadowOffsetX: 0, |
shadowOffsetX: 0, |
||||||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
shadowColor: "rgba(0, 0, 0, 0.5)", |
||||||
} |
}, |
||||||
} |
}, |
||||||
} |
}, |
||||||
] |
], |
||||||
}; |
}; |
||||||
this.indexBzt.on('click', (params) => { |
this.indexBzt.on("click", (params) => { |
||||||
var index=0 |
var index = 0; |
||||||
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ |
for (var i = 0; i < this.tabledata[0].buildingTypes.length; i++) { |
||||||
if(this.tabledata[0].buildingTypes[i].buildingTypeName==params.name){ |
if ( |
||||||
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].buildingTypes[i].organizations.length>0){ |
this.tabledata[0].buildingTypes[i].buildingTypeName == params.name |
||||||
|
) { |
||||||
|
if ( |
||||||
|
(this.echartsData.level == "0" || |
||||||
|
this.echartsData.level == "1" || |
||||||
|
this.echartsData.level == "2") && |
||||||
|
this.tabledata[0].buildingTypes[i].organizations.length > 0 |
||||||
|
) { |
||||||
|
|
||||||
|
console.log(111) |
||||||
//总队,支队,大队跳转
|
//总队,支队,大队跳转
|
||||||
this.tabledata[0].buildingTypes[i].organizations.forEach((value,index,array) => { |
this.tabledata[0].buildingTypes[i].organizations.forEach( |
||||||
if(array[index].organizationId==this.echartsData.orid){ |
(value, index, array) => { |
||||||
array.splice(index,1) |
if (array[index].organizationId == this.echartsData.orid) { |
||||||
} |
array.splice(index, 1); |
||||||
if(array.length>0){ |
} |
||||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name,'id':params.data.id}}); |
if (array.length > 0) { |
||||||
}else{ |
this.router.navigate( |
||||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); |
[ |
||||||
|
"/statisticanalysis/buildingType_one/buildingType_two_reverse", |
||||||
|
], |
||||||
|
{ queryParams: { level: params.name, id: params.data.id } } |
||||||
|
); |
||||||
|
} else { |
||||||
|
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||||
|
queryParams: { |
||||||
|
name: params.name, |
||||||
|
type: 1, |
||||||
|
buildid: params.data.id, |
||||||
|
}, |
||||||
|
}); |
||||||
|
} |
||||||
} |
} |
||||||
}); |
); |
||||||
|
} else { |
||||||
}else { |
console.log(222) |
||||||
//中队跳转
|
//中队跳转
|
||||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); |
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||||
|
queryParams: { |
||||||
|
name: params.name, |
||||||
|
type: 1, |
||||||
|
buildid: params.data.id, |
||||||
|
}, |
||||||
|
}); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}); |
}); |
||||||
this.indexBzt.setOption(options); |
this.indexBzt.setOption(options); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
tishiData |
tishiData; |
||||||
res:string |
res: string; |
||||||
biaogeTishiZhi(datas){ |
biaogeTishiZhi(datas) { |
||||||
for(var a in this.tabledata.buildingTypes){ |
for (var a in this.tabledata.buildingTypes) { |
||||||
if(this.tabledata.buildingTypes[a].buildingTypeId==datas.id){ |
if (this.tabledata.buildingTypes[a].buildingTypeId == datas.id) { |
||||||
this.tishiData=this.tabledata.buildingTypes[a].organizations |
this.tishiData = this.tabledata.buildingTypes[a].organizations; |
||||||
} |
} |
||||||
} |
} |
||||||
var countall=0//总计
|
var countall = 0; //总计
|
||||||
var countbi=0//站比
|
var countbi = 0; //站比
|
||||||
var allCountbi=0//总站比
|
var allCountbi = 0; //总站比
|
||||||
for(var i=0;i<this.tishiData.length;i++){ |
for (var i = 0; i < this.tishiData.length; i++) { |
||||||
countall+=this.tishiData[i].count |
countall += this.tishiData[i].count; |
||||||
} |
} |
||||||
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' |
this.res = |
||||||
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">' + |
||||||
this.res+='<thead style="font-size:18px;"><tr>'; |
datas.name + |
||||||
this.res+='<td style="text-align:center;width:30%;">名称</td>'; |
"</span></div>"; |
||||||
this.res+='<td style="text-align:center;width:30%;">数量</td>' |
this.res += |
||||||
this.res+='<td style="text-align:center;width:30%;">总占比</td>' |
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||||
this.res+='</tr></thead>' |
this.res += '<thead style="font-size:18px;"><tr>'; |
||||||
this.res+='<tbody>'; |
this.res += '<td style="text-align:center;width:30%;">名称</td>'; |
||||||
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
|
this.res += '<td style="text-align:center;width:30%;">数量</td>'; |
||||||
for(var i=0;i<this.tishiData.length;i++){ |
this.res += '<td style="text-align:center;width:30%;">总占比</td>'; |
||||||
countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00 |
this.res += "</tr></thead>"; |
||||||
allCountbi=allCountbi+countbi |
this.res += "<tbody>"; |
||||||
this.res+='<tr>' |
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
|
||||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>' |
for (var i = 0; i < this.tishiData.length; i++) { |
||||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>' |
countbi = |
||||||
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>' |
Math.round((this.tishiData[i].count / countall) * 10000) / 100.0; |
||||||
} |
allCountbi = allCountbi + countbi; |
||||||
|
this.res += "<tr>"; |
||||||
this.res+='</tbody>' |
this.res += |
||||||
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">'+allCountbi.toFixed(2)+'%</td></tfoot>' |
'<td style="text-align:center;">' + |
||||||
this.res+='</table></div></div>' |
this.tishiData[i].organizationName + |
||||||
return this.res |
"</td>"; |
||||||
|
this.res += |
||||||
|
'<td style="text-align:center;">' + this.tishiData[i].count + "</td>"; |
||||||
|
this.res += '<td style="text-align:center;">' + countbi + "%</td></tr>"; |
||||||
|
} |
||||||
|
|
||||||
} |
this.res += "</tbody>"; |
||||||
|
this.res += |
||||||
|
'<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">' + |
||||||
|
countall + |
||||||
|
'</td><td style="text-align:center;">' + |
||||||
|
allCountbi.toFixed(2) + |
||||||
|
"%</td></tfoot>"; |
||||||
|
this.res += "</table></div></div>"; |
||||||
|
return this.res; |
||||||
|
} |
||||||
} |
} |
||||||
|
@ -1,393 +1,477 @@ |
|||||||
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 {EchartsDataService} from '../../echarts-data.service'; |
import { EchartsDataService } from "../../echarts-data.service"; |
||||||
import { HttpClient } from '@angular/common/http' |
import { HttpClient } from "@angular/common/http"; |
||||||
declare var echarts: any; |
declare var echarts: any; |
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-building-type-two-reverse', |
selector: "app-building-type-two-reverse", |
||||||
templateUrl: './building-type-two-reverse.component.html', |
templateUrl: "./building-type-two-reverse.component.html", |
||||||
styleUrls: ['./building-type-two-reverse.component.scss'] |
styleUrls: ["./building-type-two-reverse.component.scss"], |
||||||
}) |
}) |
||||||
export class BuildingTypeTwoReverseComponent implements OnInit { |
export class BuildingTypeTwoReverseComponent implements OnInit { |
||||||
|
constructor( |
||||||
|
private http: HttpClient, |
||||||
|
private router: Router, |
||||||
|
public data: EchartsDataService, |
||||||
|
private route: ActivatedRoute |
||||||
|
) {} |
||||||
|
|
||||||
constructor(private http:HttpClient,private router: Router,public data:EchartsDataService,private route:ActivatedRoute) { } |
forward() { |
||||||
|
this.router.navigate([ |
||||||
forward(){ |
"/statisticanalysis/buildingType_one/buildingType_two_forward", |
||||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_forward']) |
]); |
||||||
} |
} |
||||||
reverse(){ |
reverse() { |
||||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse']) |
this.router.navigate([ |
||||||
|
"/statisticanalysis/buildingType_one/buildingType_two_reverse", |
||||||
|
]); |
||||||
} |
} |
||||||
headname//标题
|
headname; //标题
|
||||||
buildId//建筑id
|
buildId; //建筑id
|
||||||
padHw//是否是华为pad
|
padHw; //是否是华为pad
|
||||||
ngOnInit(): void { |
ngOnInit(): void { |
||||||
if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ |
if ( |
||||||
this.padHw=true |
window.matchMedia("(max-width: 1300px)").matches && |
||||||
|
window.matchMedia("(max-height: 700px)").matches |
||||||
|
) { |
||||||
|
this.padHw = true; |
||||||
//this.padjt=
|
//this.padjt=
|
||||||
}else{ |
} else { |
||||||
this.padHw=false |
this.padHw = false; |
||||||
} |
} |
||||||
if(sessionStorage.getItem('refresh') === 'true') { |
if (sessionStorage.getItem("refresh") === "true") { |
||||||
sessionStorage.removeItem('refresh'); |
sessionStorage.removeItem("refresh"); |
||||||
location.reload(); |
location.reload(); |
||||||
} |
} |
||||||
this.route.queryParams.subscribe(param=>{ |
this.route.queryParams.subscribe((param) => { |
||||||
this.headname=param.level |
this.headname = param.level; |
||||||
this.buildId=param.id |
this.buildId = param.id; |
||||||
}); |
}); |
||||||
let paramsdata:any = { |
let paramsdata: any = { |
||||||
id:this.buildId, |
id: this.buildId, |
||||||
//organizationId:'1'
|
//organizationId:'1'
|
||||||
} |
}; |
||||||
|
|
||||||
window.setTimeout(()=>{ |
window.setTimeout(() => { |
||||||
this.getechartsdata() |
this.getechartsdata(); |
||||||
}); |
}); |
||||||
|
|
||||||
} |
} |
||||||
ngOnDestroy(): void { |
ngOnDestroy(): void { |
||||||
/* this.indexBzt.clear() |
this.forArr.forEach((item) => { |
||||||
this.indexBzt.dispose() */ |
if (item.echart) { |
||||||
this.forArr.forEach(item => { |
item.echart.clear(); |
||||||
item.echart.clear() |
item.echart.dispose(); |
||||||
item.echart.dispose() |
|
||||||
}) |
|
||||||
} |
|
||||||
async getechartsdata(){ |
|
||||||
await this.data.getData(null,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`) |
|
||||||
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) |
|
||||||
for(var i=0;i<this.tabledata[0].organizations.length;i++){ |
|
||||||
this.zhiNameData.push(this.tabledata[0].organizations[i].organizationName) |
|
||||||
this.zhiNumData.push(this.tabledata[0].organizations[i].count) |
|
||||||
this.organizationId.push(this.tabledata[0].organizations[i].organizationId) |
|
||||||
} |
} |
||||||
this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) |
}); |
||||||
this.barEcharts() |
} |
||||||
|
async getechartsdata() { |
||||||
|
await this.data.getData( |
||||||
|
null, |
||||||
|
`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}` |
||||||
|
); |
||||||
|
this.tabledata = JSON.parse(JSON.stringify(this.data.allDate)); |
||||||
|
for (var i = 0; i < this.tabledata[0].organizations.length; i++) { |
||||||
|
this.zhiNameData.push( |
||||||
|
this.tabledata[0].organizations[i].organizationName |
||||||
|
); |
||||||
|
this.zhiNumData.push(this.tabledata[0].organizations[i].count); |
||||||
|
this.organizationId.push( |
||||||
|
this.tabledata[0].organizations[i].organizationId |
||||||
|
); |
||||||
|
} |
||||||
|
this.tiaoshiPao = this.data.qipao( |
||||||
|
this.tiaoshiPao, |
||||||
|
this.zhiNumData, |
||||||
|
this.zhiNameData |
||||||
|
); |
||||||
|
this.barEcharts(); |
||||||
} |
} |
||||||
axisLabel = { |
axisLabel = { |
||||||
interval: 0, |
interval: 0, |
||||||
rotate:38, |
rotate: 38, |
||||||
textStyle:{ |
textStyle: { |
||||||
fontSize :16, |
fontSize: 16, |
||||||
color:'#000000' |
color: "#000000", |
||||||
}, |
}, |
||||||
formatter:function(value)
|
formatter: function (value) { |
||||||
{
|
var ret = ""; //拼接加\n返回的类目项
|
||||||
var ret = "";//拼接加\n返回的类目项
|
var maxLength = 2; //每项显示文字个数
|
||||||
var maxLength = 2;//每项显示文字个数
|
var valLength = value.length; //X轴类目项的文字个数
|
||||||
var valLength = value.length;//X轴类目项的文字个数
|
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
|
||||||
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
|
if (rowN > 1) { |
||||||
if (rowN > 1)//如果类目项的文字大于3,
|
//如果类目项的文字大于3,
|
||||||
{
|
for (var i = 0; i < rowN; i++) { |
||||||
for (var i = 0; i < rowN; i++) {
|
var temp = ""; //每次截取的字符串
|
||||||
var temp = "";//每次截取的字符串
|
var start = i * maxLength; //开始截取的位置
|
||||||
var start = i * maxLength;//开始截取的位置
|
var end = start + maxLength; //结束截取的位置
|
||||||
var end = start + maxLength;//结束截取的位置
|
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
|
||||||
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
|
temp = value.substring(start, end) + "\n"; |
||||||
temp = value.substring(start, end) + "\n";
|
ret += temp; //凭借最终的字符串
|
||||||
ret += temp; //凭借最终的字符串
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return value;
|
|
||||||
} |
} |
||||||
|
return ret; |
||||||
|
} else { |
||||||
|
return value; |
||||||
} |
} |
||||||
}//echarts两个字换行
|
}, |
||||||
|
}; //echarts两个字换行
|
||||||
|
|
||||||
topTextlabel = { |
topTextlabel = { |
||||||
show: true, // 开启显示
|
show: true, // 开启显示
|
||||||
position: 'top', // 在上方显示
|
position: "top", // 在上方显示
|
||||||
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
distance: 10, // 距离图形元素的距离。当 position 为字符描述值(如 'top'、'insideRight')时候有效。
|
||||||
verticalAlign: 'middle', |
verticalAlign: "middle", |
||||||
textStyle: { // 数值样式
|
textStyle: { |
||||||
color: 'black', |
// 数值样式
|
||||||
fontSize: 12 |
color: "black", |
||||||
} |
fontSize: 12, |
||||||
}//柱状图数值顶部显示
|
}, |
||||||
|
}; //柱状图数值顶部显示
|
||||||
|
|
||||||
tableDataZhi = [ {name:"浦东支队",number:"156",zhanbi:"3%"}, |
tableDataZhi = [ |
||||||
{name:"黄浦支队",number:"144",zhanbi:"2.8%"}, |
{ name: "浦东支队", number: "156", zhanbi: "3%" }, |
||||||
{name:"徐汇支队",number:"133",zhanbi:"2.1%"}, |
{ name: "黄浦支队", number: "144", zhanbi: "2.8%" }, |
||||||
{name:"长宁支队",number:"122",zhanbi:"1.6%"}, |
{ name: "徐汇支队", number: "133", zhanbi: "2.1%" }, |
||||||
{name:"静安支队",number:"120",zhanbi:"1.3%"}, |
{ name: "长宁支队", number: "122", zhanbi: "1.6%" }, |
||||||
{name:"普陀支队",number:"100",zhanbi:"1.1%"}, |
{ name: "静安支队", number: "120", zhanbi: "1.3%" }, |
||||||
{name:"虹口支队",number:"95",zhanbi:"1%"}, |
{ name: "普陀支队", number: "100", zhanbi: "1.1%" }, |
||||||
{name:"杨浦支队",number:"90",zhanbi:"0.9%"}, |
{ name: "虹口支队", number: "95", zhanbi: "1%" }, |
||||||
{name:"闵行支队",number:"88",zhanbi:"0.8%"}, |
{ name: "杨浦支队", number: "90", zhanbi: "0.9%" }, |
||||||
{name:"宝山支队",number:"83",zhanbi:"0.7%"}, |
{ name: "闵行支队", number: "88", zhanbi: "0.8%" }, |
||||||
{name:"徐汇支队",number:"133",zhanbi:"2.1%"}, |
{ name: "宝山支队", number: "83", zhanbi: "0.7%" }, |
||||||
{name:"长宁支队",number:"122",zhanbi:"1.6%"}, |
{ name: "徐汇支队", number: "133", zhanbi: "2.1%" }, |
||||||
{name:"嘉定支队",number:"78",zhanbi:"0.6%"}, |
{ name: "长宁支队", number: "122", zhanbi: "1.6%" }, |
||||||
{name:"松江支队",number:"75",zhanbi:"0.5%"}, |
{ name: "嘉定支队", number: "78", zhanbi: "0.6%" }, |
||||||
{name:"金山支队",number:"65",zhanbi:"0.4%"}, |
{ name: "松江支队", number: "75", zhanbi: "0.5%" }, |
||||||
{name:"崇明支队",number:"55",zhanbi:"0.3%"} ] |
{ name: "金山支队", number: "65", zhanbi: "0.4%" }, |
||||||
tableDataZhong = [ {name:"浦东中队",number:"156",zhanbi:"3%"}, |
{ name: "崇明支队", number: "55", zhanbi: "0.3%" }, |
||||||
{name:"黄浦中队",number:"144",zhanbi:"2.8%"}, |
]; |
||||||
{name:"徐汇中队",number:"133",zhanbi:"2.1%"}, |
tableDataZhong = [ |
||||||
{name:"长宁中队",number:"122",zhanbi:"1.6%"}, |
{ name: "浦东中队", number: "156", zhanbi: "3%" }, |
||||||
{name:"静安中队",number:"120",zhanbi:"1.3%"}, |
{ name: "黄浦中队", number: "144", zhanbi: "2.8%" }, |
||||||
{name:"普陀中队",number:"100",zhanbi:"1.1%"}, |
{ name: "徐汇中队", number: "133", zhanbi: "2.1%" }, |
||||||
{name:"虹口中队",number:"95",zhanbi:"1%"}, |
{ name: "长宁中队", number: "122", zhanbi: "1.6%" }, |
||||||
{name:"杨浦中队",number:"90",zhanbi:"0.9%"}, |
{ name: "静安中队", number: "120", zhanbi: "1.3%" }, |
||||||
{name:"闵行中队",number:"88",zhanbi:"0.8%"}, |
{ name: "普陀中队", number: "100", zhanbi: "1.1%" }, |
||||||
{name:"宝山中队",number:"83",zhanbi:"0.7%"}, |
{ name: "虹口中队", number: "95", zhanbi: "1%" }, |
||||||
{name:"徐汇中队",number:"133",zhanbi:"2.1%"}, |
{ name: "杨浦中队", number: "90", zhanbi: "0.9%" }, |
||||||
{name:"长宁中队",number:"122",zhanbi:"1.6%"}, |
{ name: "闵行中队", number: "88", zhanbi: "0.8%" }, |
||||||
{name:"嘉定中队",number:"78",zhanbi:"0.6%"}, |
{ name: "宝山中队", number: "83", zhanbi: "0.7%" }, |
||||||
{name:"松江中队",number:"75",zhanbi:"0.5%"}, |
{ name: "徐汇中队", number: "133", zhanbi: "2.1%" }, |
||||||
{name:"金山中队",number:"65",zhanbi:"0.4%"}, |
{ name: "长宁中队", number: "122", zhanbi: "1.6%" }, |
||||||
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ] |
{ name: "嘉定中队", number: "78", zhanbi: "0.6%" }, |
||||||
zhiNameData = [] |
{ name: "松江中队", number: "75", zhanbi: "0.5%" }, |
||||||
zhiNumData = [] |
{ name: "金山中队", number: "65", zhanbi: "0.4%" }, |
||||||
tiaoshiPao:any |
{ name: "崇明中队", number: "55", zhanbi: "0.3%" }, |
||||||
|
]; |
||||||
|
zhiNameData = []; |
||||||
|
zhiNumData = []; |
||||||
|
tiaoshiPao: any; |
||||||
//气泡提示数据获取
|
//气泡提示数据获取
|
||||||
bianli(){ |
bianli() { |
||||||
if(this.zhiNumData.length>=1){ |
if (this.zhiNumData.length >= 1) { |
||||||
var arrshuzu='['; |
var arrshuzu = "["; |
||||||
for(var i=0;i<this.zhiNumData.length;i++){ |
for (var i = 0; i < this.zhiNumData.length; i++) { |
||||||
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},' |
arrshuzu += |
||||||
} |
'{"value":' + |
||||||
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
this.zhiNumData[i] + |
||||||
arrshuzu+=']' |
',"coord":[' + |
||||||
this.tiaoshiPao=JSON.parse(arrshuzu) |
i + |
||||||
|
"," + |
||||||
|
this.zhiNumData[i] + |
||||||
|
'],"name":' + |
||||||
|
'"' + |
||||||
|
this.zhiNameData[i] + |
||||||
|
'"' + |
||||||
|
"},"; |
||||||
|
} |
||||||
|
arrshuzu = arrshuzu.substring(0, arrshuzu.length - 1); |
||||||
|
arrshuzu += "]"; |
||||||
|
this.tiaoshiPao = JSON.parse(arrshuzu); |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
forArr = [{id:'gaoceng',name:'高层',echart:null}, |
forArr = [ |
||||||
{id:'dixia',name:'地下',echart:null}, |
{ id: "gaoceng", name: "高层", echart: null }, |
||||||
{id:'guidao',name:'轨道交通',echart:null}, |
{ id: "dixia", name: "地下", echart: null }, |
||||||
{id:'huagong',name:'化工生产',echart:null}, |
{ id: "guidao", name: "轨道交通", echart: null }, |
||||||
{id:'chuguan',name:'储罐类',echart:null}, |
{ id: "huagong", name: "化工生产", echart: null }, |
||||||
{id:'changfang',name:'厂房',echart:null}, |
{ id: "chuguan", name: "储罐类", echart: null }, |
||||||
{id:'gujianzhu',name:'古建筑',echart:null}, |
{ id: "changfang", name: "厂房", echart: null }, |
||||||
{id:'shichang',name:'商市场',echart:null}, |
{ id: "gujianzhu", name: "古建筑", echart: null }, |
||||||
{id:'yiyuan',name:'医院',echart:null}, |
{ id: "shichang", name: "商市场", echart: null }, |
||||||
{id:'xuexiao',name:'学校',echart:null}, |
{ id: "yiyuan", name: "医院", echart: null }, |
||||||
{id:'binguan',name:'宾馆',echart:null}, |
{ id: "xuexiao", name: "学校", echart: null }, |
||||||
{id:'yule',name:'娱乐场所',echart:null}, |
{ id: "binguan", name: "宾馆", echart: null }, |
||||||
{id:'canyin',name:'餐饮业',echart:null}, |
{ id: "yule", name: "娱乐场所", echart: null }, |
||||||
{id:'yingyuan',name:'影剧院',echart:null}, |
{ id: "canyin", name: "餐饮业", echart: null }, |
||||||
{id:'zhanlan',name:'展览建筑',echart:null}, |
{ id: "yingyuan", name: "影剧院", echart: null }, |
||||||
{id:'suidao',name:'隧道',echart:null}] |
{ id: "zhanlan", name: "展览建筑", echart: null }, |
||||||
|
{ id: "suidao", name: "隧道", echart: null }, |
||||||
|
]; |
||||||
|
|
||||||
//返回
|
//返回
|
||||||
goback(){ |
goback() { |
||||||
sessionStorage.setItem('refresh', 'true'); |
sessionStorage.setItem("refresh", "true"); |
||||||
history.go(-1); |
history.go(-1); |
||||||
} |
} |
||||||
/* 顶部饼状图 */ |
/* 顶部饼状图 */ |
||||||
indexBzt |
indexBzt; |
||||||
initCharts(){ |
initCharts() { |
||||||
|
this.indexBzt = echarts.init(document.getElementById("pie"), "walden"); |
||||||
this.indexBzt = echarts.init(document.getElementById('pie'),'walden'); |
let options = { |
||||||
let options={ |
|
||||||
title: { |
title: { |
||||||
text: '建筑类型统计(8900家)', |
text: "建筑类型统计(8900家)", |
||||||
left: 'center', |
left: "center", |
||||||
top: "7%", |
top: "7%", |
||||||
textStyle: { |
textStyle: { |
||||||
fontSize:26 |
fontSize: 26, |
||||||
} |
}, |
||||||
}, |
}, |
||||||
tooltip: { |
tooltip: { |
||||||
trigger: 'item', |
trigger: "item", |
||||||
formatter: (params)=>{ |
formatter: (params) => { |
||||||
return this.data.tableTooltip(this.tableDataZhi,params.name) |
return this.data.tableTooltip(this.tableDataZhi, params.name); |
||||||
}, |
}, |
||||||
position: this.data.tableTooltipNoShow2 |
position: this.data.tableTooltipNoShow2, |
||||||
}, |
}, |
||||||
legend: { |
legend: { |
||||||
orient: 'vertical', |
orient: "vertical", |
||||||
right: 150, |
right: 150, |
||||||
top:80, |
top: 80, |
||||||
textStyle:{ |
textStyle: { |
||||||
fontSize:18, |
fontSize: 18, |
||||||
color:"#000000" |
color: "#000000", |
||||||
}, |
}, |
||||||
data: ['高层', '地下', '轨道交通', '化工生产', '储罐类' , '厂房','古建筑', '商市场', '医院', '学校', '宾馆' , '娱乐场所','餐饮业', '影剧院', '展览建筑' , '隧道'] |
data: [ |
||||||
|
"高层", |
||||||
|
"地下", |
||||||
|
"轨道交通", |
||||||
|
"化工生产", |
||||||
|
"储罐类", |
||||||
|
"厂房", |
||||||
|
"古建筑", |
||||||
|
"商市场", |
||||||
|
"医院", |
||||||
|
"学校", |
||||||
|
"宾馆", |
||||||
|
"娱乐场所", |
||||||
|
"餐饮业", |
||||||
|
"影剧院", |
||||||
|
"展览建筑", |
||||||
|
"隧道", |
||||||
|
], |
||||||
}, |
}, |
||||||
series: [ |
series: [ |
||||||
{ |
{ |
||||||
name: '访问来源', |
name: "访问来源", |
||||||
type: 'pie', |
type: "pie", |
||||||
radius: '70%', |
radius: "70%", |
||||||
center: ['50%', '60%'], |
center: ["50%", "60%"], |
||||||
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:16 |
fontSize: 16, |
||||||
} |
}, |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
data: [ |
data: [ |
||||||
{value: 500, name: '高层'}, |
{ value: 500, name: "高层" }, |
||||||
{value: 800, name: '地下'}, |
{ value: 800, name: "地下" }, |
||||||
{value: 900, name: '轨道交通'}, |
{ value: 900, name: "轨道交通" }, |
||||||
{value: 800, name: '化工生产'}, |
{ value: 800, name: "化工生产" }, |
||||||
{value: 1200, name: '储罐类'}, |
{ value: 1200, name: "储罐类" }, |
||||||
{value: 1500, name: '厂房'}, |
{ value: 1500, name: "厂房" }, |
||||||
{value: 1400, name: '古建筑'}, |
{ value: 1400, name: "古建筑" }, |
||||||
{value: 600, name: '商市场'}, |
{ value: 600, name: "商市场" }, |
||||||
{value: 568, name: '医院'}, |
{ value: 568, name: "医院" }, |
||||||
{value: 888, name: '学校'}, |
{ value: 888, name: "学校" }, |
||||||
{value: 485, name: '宾馆'}, |
{ value: 485, name: "宾馆" }, |
||||||
{value: 966, name: '娱乐场所'}, |
{ value: 966, name: "娱乐场所" }, |
||||||
{value: 789, name: '餐饮业'}, |
{ value: 789, name: "餐饮业" }, |
||||||
{value: 500, name: '影剧院'}, |
{ value: 500, name: "影剧院" }, |
||||||
{value: 1025, name: '展览建筑'}, |
{ value: 1025, name: "展览建筑" }, |
||||||
{value: 600, name: '隧道'} |
{ value: 600, name: "隧道" }, |
||||||
], |
], |
||||||
emphasis: { |
emphasis: { |
||||||
itemStyle: { |
itemStyle: { |
||||||
shadowBlur: 10, |
shadowBlur: 10, |
||||||
shadowOffsetX: 0, |
shadowOffsetX: 0, |
||||||
shadowColor: 'rgba(0, 0, 0, 0.5)' |
shadowColor: "rgba(0, 0, 0, 0.5)", |
||||||
} |
}, |
||||||
} |
}, |
||||||
} |
}, |
||||||
] |
], |
||||||
}; |
}; |
||||||
this.indexBzt.on('click', (params) => { |
this.indexBzt.on("click", (params) => { |
||||||
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
|
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
|
||||||
}); |
}); |
||||||
this.indexBzt.setOption(options); |
this.indexBzt.setOption(options); |
||||||
} |
} |
||||||
//柱状图
|
//柱状图
|
||||||
lengthdata=[]//提示数据
|
lengthdata = []; //提示数据
|
||||||
count=0//总数
|
count = 0; //总数
|
||||||
indexData=[]//所有数据
|
indexData = []; //所有数据
|
||||||
organizationId=[] |
organizationId = []; |
||||||
tabledata |
tabledata; |
||||||
barEcharts(){ |
|
||||||
this.forArr.forEach(item=>{ |
barEcharts() { |
||||||
let _this = this |
let item = this.forArr.find((v) => this.headname.indexOf(v.name) !== -1); |
||||||
item.echart = echarts.init(document.getElementById('gaoceng'),'walden'); |
item.echart = echarts.init( |
||||||
let option = { |
document.getElementById("buildingTypeEcharts"), |
||||||
title: { |
"walden" |
||||||
text: this.headname+this.tabledata[0].totalCount, |
); |
||||||
left: "center", |
let option = { |
||||||
top:this.padHw?"18":"0", |
title: { |
||||||
bottom:this.padHw?"0":'510', |
text: this.headname + this.tabledata[0].totalCount, |
||||||
textStyle: { |
left: "center", |
||||||
fontSize: 30 |
top: this.padHw ? "18" : "0", |
||||||
} |
bottom: this.padHw ? "0" : "600", |
||||||
|
textStyle: { |
||||||
|
fontSize: 18, |
||||||
|
}, |
||||||
|
}, |
||||||
|
grid: { |
||||||
|
bottom: "15%", |
||||||
|
}, |
||||||
|
xAxis: { |
||||||
|
id: this.organizationId, |
||||||
|
type: "category", |
||||||
|
data: this.zhiNameData, |
||||||
|
axisLabel: { |
||||||
|
interval: 0, |
||||||
|
rotate: 28, |
||||||
|
textStyle: { |
||||||
|
fontSize: 16, |
||||||
|
color: "#000000", |
||||||
}, |
}, |
||||||
grid: { |
|
||||||
//top: 90,
|
|
||||||
bottom: '18%', |
|
||||||
}, |
}, |
||||||
xAxis: { |
}, |
||||||
id:this.organizationId, |
yAxis: { |
||||||
type: 'category', |
type: "value", |
||||||
data: this.zhiNameData, |
axisLabel: { |
||||||
axisLabel:{ |
textStyle: { |
||||||
//this.axisLabel,
|
fontSize: 16, |
||||||
interval: 0, |
color: "#000000", |
||||||
rotate:28, |
|
||||||
textStyle:{ |
|
||||||
fontSize :16, |
|
||||||
color:'#000000' |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
}, |
}, |
||||||
yAxis: { |
}, |
||||||
type: 'value', |
}, |
||||||
axisLabel:{ |
tooltip: { |
||||||
//this.axisLabel,
|
trigger: "item", |
||||||
textStyle:{ |
formatter: (params) => { |
||||||
fontSize :16, |
return this.tableTooltip(params); |
||||||
color:'#000000' |
}, |
||||||
} |
position: this.data.tableTooltipNoShow2, |
||||||
|
}, |
||||||
} |
series: [ |
||||||
|
{ |
||||||
|
data: this.zhiNumData, |
||||||
|
type: "bar", |
||||||
|
markPoint: { |
||||||
|
data: this.tiaoshiPao, |
||||||
}, |
}, |
||||||
tooltip: { |
backgroundStyle: { |
||||||
trigger: 'item', |
color: "rgba(220, 220, 220, 0.8)", |
||||||
formatter: (params)=>{ |
|
||||||
return this.tableTooltip(params) |
|
||||||
}, |
|
||||||
position: this.data.tableTooltipNoShow2 |
|
||||||
}, |
}, |
||||||
series: [{ |
barWidth: "38", |
||||||
data: this.zhiNumData, |
}, |
||||||
type: 'bar', |
], |
||||||
markPoint: { |
}; |
||||||
data:this.tiaoshiPao |
item.echart.setOption(option); |
||||||
}, |
item.echart.getZr().on("click", (params) => { |
||||||
//showBackground: true,
|
const pointInPixel = [params.offsetX, params.offsetY]; |
||||||
backgroundStyle: { |
// console.log("点击图表", pointInPixel);
|
||||||
color: 'rgba(220, 220, 220, 0.8)' |
if (item.echart.containPixel("grid", pointInPixel)) { |
||||||
|
let xIndex = item.echart.convertFromPixel({ seriesIndex: 0 }, [ |
||||||
|
params.offsetX, |
||||||
|
params.offsetY, |
||||||
|
])[0]; |
||||||
|
// console.log("点击柱状图index", xIndex);
|
||||||
|
// console.log("this.data", this.data);
|
||||||
|
// console.log("this.tabledata", this.tabledata);
|
||||||
|
if ( |
||||||
|
(this.data.level == "0" || this.data.level == "1") && |
||||||
|
this.tabledata[0].organizations[xIndex].subOrganizations.length !== 0 |
||||||
|
) { |
||||||
|
// 总队,支队跳转
|
||||||
|
this.router.navigate( |
||||||
|
["/statisticanalysis/buildingType_one/buildingType_three_details"], |
||||||
|
{ |
||||||
|
queryParams: { |
||||||
|
organizationName: option.xAxis.data[xIndex], |
||||||
|
buildingTypeName: this.headname, |
||||||
|
buildId: this.buildId, |
||||||
|
organizationId: option.xAxis.id[xIndex], |
||||||
}, |
}, |
||||||
barWidth :'38', |
} |
||||||
//label: this.topTextlabel
|
); |
||||||
}] |
return; |
||||||
}; |
} else { |
||||||
item.echart.setOption(option); |
this.router.navigate(["/statisticanalysis/CompangInfo"], { |
||||||
item.echart.getZr().on('click', (params) => { |
queryParams: { |
||||||
const pointInPixel= [params.offsetX, params.offsetY]; |
name: option.xAxis.data[xIndex], |
||||||
if (item.echart.containPixel('grid',pointInPixel)) { |
type: 1, |
||||||
let xIndex=item.echart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
jsid: option.xAxis.id[xIndex], |
||||||
/*事件处理代码书写位置*/ |
buildid: this.buildId, |
||||||
if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ |
}, |
||||||
//总队,支队跳转
|
}); |
||||||
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'buildId':this.buildId,'organizationId':option.xAxis.id[xIndex]}}) |
|
||||||
} |
|
||||||
else{ |
|
||||||
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex],'buildid':this.buildId}}); |
|
||||||
} |
} |
||||||
//this.router.navigate(['/statisticanalysis/delete_one/delete_four'],{queryParams:{'level':this.option.xAxis.data[xIndex]+headName}});
|
|
||||||
} |
} |
||||||
|
return; |
||||||
}); |
}); |
||||||
}) |
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
//提示框表格
|
//提示框表格
|
||||||
res |
res; |
||||||
tishiData |
tishiData; |
||||||
tableTooltip(datas){ |
tableTooltip(datas) { |
||||||
for(var a in this.data.obdata[0].organizations){ |
for (var a in this.data.obdata[0].organizations) { |
||||||
if(this.data.obdata[0].organizations[a].organizationName==datas.name){ |
if (this.data.obdata[0].organizations[a].organizationName == datas.name) { |
||||||
this.tishiData=this.data.obdata[0].organizations[a].subOrganizations |
this.tishiData = this.data.obdata[0].organizations[a].subOrganizations; |
||||||
} |
} |
||||||
} |
} |
||||||
var countall=0//总计
|
var countall = 0; //总计
|
||||||
var countbi=0//站比
|
var countbi = 0; //站比
|
||||||
var allCountbi=0//总站比
|
var allCountbi = 0; //总站比
|
||||||
for(var i=0;i<this.tishiData.length;i++){ |
for (var i = 0; i < this.tishiData.length; i++) { |
||||||
countall+=this.tishiData[i].count |
countall += this.tishiData[i].count; |
||||||
} |
} |
||||||
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' |
this.res = |
||||||
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
'<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">' + |
||||||
this.res+='<thead style="font-size:18px;"><tr>'; |
datas.name + |
||||||
this.res+='<td style="text-align:center;width:30%;">名称</td>'; |
"</span></div>"; |
||||||
this.res+='<td style="text-align:center;width:30%;">数量</td>' |
this.res += |
||||||
this.res+='<td style="text-align:center;width:30%;">总占比</td>' |
'</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; |
||||||
this.res+='</tr></thead>' |
this.res += '<thead style="font-size:18px;"><tr>'; |
||||||
this.res+='<tbody>'; |
this.res += '<td style="text-align:center;width:30%;">名称</td>'; |
||||||
for(var i=0;i<this.tishiData.length;i++){ |
this.res += '<td style="text-align:center;width:30%;">数量</td>'; |
||||||
countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00 |
this.res += '<td style="text-align:center;width:30%;">总占比</td>'; |
||||||
allCountbi=allCountbi+countbi |
this.res += "</tr></thead>"; |
||||||
this.res+='<tr>' |
this.res += "<tbody>"; |
||||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>' |
for (var i = 0; i < this.tishiData.length; i++) { |
||||||
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>' |
countbi = |
||||||
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>' |
Math.round((this.tishiData[i].count / countall) * 10000) / 100.0; |
||||||
} |
allCountbi = allCountbi + countbi; |
||||||
|
this.res += "<tr>"; |
||||||
|
this.res += |
||||||
|
'<td style="text-align:center;">' + |
||||||
|
this.tishiData[i].organizationName + |
||||||
|
"</td>"; |
||||||
|
this.res += |
||||||
|
'<td style="text-align:center;">' + this.tishiData[i].count + "</td>"; |
||||||
|
this.res += '<td style="text-align:center;">' + countbi + "%</td></tr>"; |
||||||
|
} |
||||||
|
|
||||||
this.res+='</tbody>' |
this.res += "</tbody>"; |
||||||
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">'+allCountbi.toFixed(2)+'%</td></tfoot>' |
this.res += |
||||||
this.res+='</table></div></div>' |
'<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">' + |
||||||
return this.res |
countall + |
||||||
|
'</td><td style="text-align:center;">' + |
||||||
|
allCountbi.toFixed(2) + |
||||||
|
"%</td></tfoot>"; |
||||||
|
this.res += "</table></div></div>"; |
||||||
|
return this.res; |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue