diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss
index 6904ade..83396d9 100644
--- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss
+++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss
@@ -11,18 +11,26 @@
overflow: auto;
}
#Line{
- width: 50%;
- height: 420px;
- margin: 50px auto;
+ //width: 50%;
+ height: 600px;
+ //margin: 50px auto;
}
}
.publicCss{
width: 80%;
- height: 550px;
+ //height: 550px;
position: absolute;
left: 50%;
- top: 55%;
+ //top: 55%;
transform: translate(-50%,-50%);
+ @media screen and (max-device-width:1400px){
+ height: 450px;
+ top: 60%;
+ }
+ @media screen and (min-device-width:1400px){
+ height: 550px;
+ top: 55%;
+ }
}
//头部搜索栏
@@ -34,31 +42,57 @@
// padding: 0 15px;
display: flex;
flex-direction: row;
- flex-wrap: wrap;
- align-items:center;
- justify-content:center;
+ flex-wrap: nowrap;
+ @media screen and (min-device-width:1200px){
+ align-items:center;
+ justify-content:center;
+ }
+
+ @media screen and (max-device-width:1200px){
+ justify-content: center;
+ align-items:center;
+ }
.queryField {
- margin: 0 10px;
- font-size: 14px;
- .mat-form-field {
- width: 130px;
- max-height: 50px;;
- margin: 0 15px 0 10px;
- }
+ @media screen and (max-device-width:1200px){
+ font-size: 14px;
+ .mat-form-field {
+ width: 100px;
+ max-height: 50px;;
+ margin: 0 5px 0 5px;
+ }
+ }
+ @media screen and (min-device-width:1200px){
+ margin: 0 10px;
+ font-size: 14px;
+ .mat-form-field {
+ width: 130px;
+ max-height: 50px;;
+ margin: 0 15px 0 10px;
+ }
+ }
+
}
.btnbox{
- display: flex;
- flex-direction:row-reverse;
- //float: right;
+ @media screen and (min-device-width:1200px){
justify-content: center;
- align-items: center;
- height: 100%;
+ align-items: center;
button{
width: 88px;
height: 36px;
}
- margin-right:4%;
-
+ margin-right:4%;
+ }
+ @media screen and (max-device-width:1200px){
+ justify-content: center;
+ align-items: center;
+ button{
+ width: 88px;
+ height: 36px;
+ }
+ }
+ display: flex;
+ flex-direction:nowrap;
+ height: 100%;
}
}
.selectedBtn{
diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
index f74a51e..74af655 100644
--- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
+++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
@@ -39,26 +39,28 @@ export class AddUnitTwoTimeComponent implements OnInit {
}
//获取数据
yeardatee
- getdata(){
+ async getdata(){
let parzhi={
+ objectType:0,
BuildingTypeId:this.lastId,
TrendType:this.serviceData.selectType,
TrendYear:this.yeardatee||''
}
let parbuild={
+ objectType:0,
OrganizationId:this.lastId,
TrendType:this.serviceData.selectType,
TrendYear:this.yeardatee||''
}
- this.serviceData.getData(this.serviceData.zuzhiorBuilding=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis`)
+ await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`)
this.setTimeoutObj = window.setTimeout(() => {
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate))
- //console.log(this.tabledata)
- for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){
- this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
- this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
- this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
+ console.log(this.tabledata[0])
+ for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){
+ this.date.push(this.tabledata[0][i].month)
+ this.dateNum.push(this.tabledata[0][i].count)
+ this.zongcount=this.zongcount+this.tabledata[0][i].count
}
}
@@ -66,7 +68,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
//this.oneInit (this.date,this.dateNum)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.twoInit (this.date,this.dateNum,'month')
- }, 1000);
+ });
}
forward(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId,'type':this.zhiorbuild=='zhi'?'zhi':'build'}})
@@ -102,11 +104,11 @@ export class AddUnitTwoTimeComponent implements OnInit {
if (e.selectEndMonth>=e.selectStartMonth) {
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
- for(var i=0;i=this.serviceData.selectStartMonth&&this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){
- this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
- this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
- this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
+ for(var i=0;i=this.serviceData.selectStartMonth&&this.tabledata[0][i].month<=this.serviceData.selectEndMonth){
+ this.date.push(this.tabledata[0][i].month)
+ this.dateNum.push(this.tabledata[0][i].count)
+ this.zongcount=this.zongcount+this.tabledata[0][i].count
}
}
//this.oneInit (this.date,this.dateNum)
@@ -123,20 +125,31 @@ export class AddUnitTwoTimeComponent implements OnInit {
selectEndYear:any = (new Date()).getFullYear() //结束年份
//按年查询
yearSubmit (e) {
+ this.zongcount=0
+ this.date2=[]
+ this.dateNum2=[]
if (e.selectEndYear >= e.selectStartYear) {
let startTime = e.selectStartYear + '-' + 1 + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectEndYear + '-' + 12 + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
- //console.log(startTime)
- //console.log(endTime)
+ for(var i=0;i=e.selectStartYear&&this.tabledata[0][i].year<=e.selectEndYear){
+ this.date2.push(this.tabledata[0][i].month)
+ this.dateNum2.push(this.tabledata[0][i].count)
+ this.zongcount=this.zongcount+this.tabledata[0][i].count
+ }
+ }
+ //this.oneInit (this.date,this.dateNum)
+ this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
+ this.twoInit (this.date2,this.dateNum2,'year')
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
- this.snackBar.open('请选择正确时间区段','确定',config);
+ this.snackBar.open('结束年份必须大于开始年份','确定',config);
}
}
//年或月点击
- dateChange(){
+ async dateChange(){
this.tiaoshiPao=null
this.forArr.forEach(item => {
item.echart.dispose()
@@ -145,22 +158,32 @@ export class AddUnitTwoTimeComponent implements OnInit {
if(this.selectType == "year"){
this.zongcount=0
this.serviceData.selectType=2
- let paramdata={
+ let parzhi={
+ objectType:0,
BuildingTypeId:this.lastId,
- TrendType:this.serviceData.selectType
+ TrendType:this.serviceData.selectType,
+ }
+ let parbuild={
+ objectType:0,
+ OrganizationId:this.lastId,
+ TrendType:this.serviceData.selectType,
}
- this.serviceData.getData(paramdata,`/api/StatisticsAnalysis`)
+ /* let paramdata={
+ BuildingTypeId:this.lastId,
+ TrendType:this.serviceData.selectType
+ } */
+ await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`)
this.setTimeoutObj = window.setTimeout(() => {
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate))
- //console.log(this.tabledata)
- for(var i=0;i{
+ this.getechartsData()
+ })
+ }
+ async getechartsData(){
let paramsdata:any = {
//id:this.zhiorbuild=='zhi'? this.canshuId:this.lastId,
organizationId:this.zhiorbuild=='zhi'?this.lastId:this.canshuId
}
- this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.zhiorbuild=='zhi'?this.canshuId:this.lastId}`)
- this.setTimeoutObj = window.setTimeout(()=>{
- this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
+ await this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.zhiorbuild=='zhi'?this.canshuId:this.lastId}`)
+ this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
//console.log(this.tabledata)
for(var i=0;i{
+ this.getechartsData()
+ })
+ }
+ ngOnDestroy(){
+ window.clearTimeout(this.setTimeoutObj);
+
+ this.forArr.forEach(item => {
+ item.echart.clear()
+ item.echart.dispose()
+ })
+ }
+ //获取服务层数据
+ async getechartsData(){
let paramsdata:any = {
id:this.lastId,
//organizationId:'1'
}
- this.data.getData(this.zhiorbuild=="zhi"?paramsdata:null,this.zhiorbuild=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`)
- this.setTimeoutObj = window.setTimeout(()=>{
- this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
+ await this.data.getData(this.zhiorbuild=="zhi"?paramsdata:null,this.zhiorbuild=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`)
+ this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
//console.log(this.tabledata)
if(this.zhiorbuild=="zhi"){
for(var i=0;i {
- item.echart.clear()
- item.echart.dispose()
- })
}
axisLabel = {
@@ -293,6 +305,64 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}
//柱状图
tabledata
+ asixLablehw={
+ interval: 0,
+ textStyle:{
+ fontSize :18,
+ color:'#000000'
+ },
+ formatter:function(value)
+ {
+ var ret = "";//拼接加\n返回的类目项
+ var maxLength =2;//每项显示文字个数
+ var valLength = value.length;//X轴类目项的文字个数
+ var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
+ if (rowN > 1)//如果类目项的文字大于3,
+ {
+ for (var i = 0; i < rowN; i++) {
+ var temp = "";//每次截取的字符串
+ var start = i * maxLength;//开始截取的位置
+ var end = start + maxLength;//结束截取的位置
+ //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
+ temp = value.substring(start, end) + "\n";
+ ret += temp; //凭借最终的字符串
+ }
+ return ret;
+ }
+ else {
+ return value;
+ }
+ }
+ }
+ asixLable={
+ interval: 0,
+ textStyle:{
+ fontSize :18,
+ color:'#000000'
+ },
+ formatter:function(value)
+ {
+ var ret = "";//拼接加\n返回的类目项
+ var maxLength =4;//每项显示文字个数
+ var valLength = value.length;//X轴类目项的文字个数
+ var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
+ if (rowN > 1)//如果类目项的文字大于3,
+ {
+ for (var i = 0; i < rowN; i++) {
+ var temp = "";//每次截取的字符串
+ var start = i * maxLength;//开始截取的位置
+ var end = start + maxLength;//结束截取的位置
+ //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
+ temp = value.substring(start, end) + "\n";
+ ret += temp; //凭借最终的字符串
+ }
+ return ret;
+ }
+ else {
+ return value;
+ }
+ }
+ }
barEcharts(){
this.forArr.forEach(item=>{
@@ -309,22 +379,15 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}
},
grid: {
- top: 90,
+ containLabel:true,
+ top:this.padHw?60:90,
bottom: 30
},
xAxis: {
id:this.zhiorbuild=="zhi"?this.buildingTypeId:this.organizationId,
type: 'category',
data:this.zhiorbuild=="zhi"?this.buildingData: this.zhiNameData,
- axisLabel:{
- //this.axisLabel,
- interval: 0,
- textStyle:{
- fontSize :18,
- color:'#000000'
- }
-
- }
+ axisLabel:this.padHw?this.asixLablehw:this.asixLable,
},
yAxis: {
type: 'value',
diff --git a/src/app/statistic-analysis/all-plan/all-plan.component.scss b/src/app/statistic-analysis/all-plan/all-plan.component.scss
index 01512e9..3900afd 100644
--- a/src/app/statistic-analysis/all-plan/all-plan.component.scss
+++ b/src/app/statistic-analysis/all-plan/all-plan.component.scss
@@ -1,4 +1,6 @@
.body{
+ height: 100%;
+ overflow-y: auto;
display: flex;
flex-direction: column;
.topbox{
diff --git a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
index 52828f6..4b321f8 100644
--- a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
+++ b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
@@ -14,21 +14,25 @@ export class BuildingTypeOneComponent implements OnInit {
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { }
ngOnInit(): void {
- if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){
+ if(window.matchMedia("(max-width: 1400px)").matches){
this.padHw=true
//this.padjt=
}else{
this.padHw=false
}
- this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)
+
window.setTimeout(()=>{
- this.initCharts()
- },500)
+ this.getechartsdata()
+ })
}
ngOnDestroy(): void {
this.indexBzt.clear()
this.indexBzt.dispose()
}
+ async getechartsdata(){
+ await this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)
+ this.initCharts()
+ }
/* 首页饼状图 */
indexBzt
padHw
@@ -42,7 +46,7 @@ export class BuildingTypeOneComponent implements OnInit {
location.reload();
}
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
- //console.log(this.tabledata)
+ console.log(this.tabledata)
for(var i=0;i{
+ this.getechartsdata()
+ })
+ }
+
+ ngOnDestroy(): void {
+ this.detailPlanEchart.clear()
+ this.detailPlanEchart.dispose()
+ }
+ async getechartsdata(){
let paramsdata={
//id:this.buildingTypeId,
organizationId:this.listorganizationId
}
- this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`)
- window.setTimeout(()=>{
- this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
+ await this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`)
+ this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
//console.log(this.tabledata)
for(var i=0;i{
- this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
- for(var i=0;i'+countbi+'%'
}
this.res+=''
- this.res+='总计 | '+countall+' | '+allCountbi.toFixed(2)+'% | '
+ this.res+='总计 | '+countall+' | 100% | '
this.res+='
'
return this.res
@@ -477,7 +479,7 @@ export class EchartsDataService {
}
this.res+=''
- this.res+='