diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss
index b9e1ac0..52ab7a7 100644
--- a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss
+++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss
@@ -42,4 +42,8 @@
display: inline-block;
box-sizing: border-box;
padding: 20px;
+}
+.selectedBtn{
+ background-color: #2196f3;
+ color: white;
}
\ No newline at end of file
diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
index cd4ade9..92e2b58 100644
--- a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
+++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
@@ -16,12 +16,23 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
reverse(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'])
}
+ url = "/statisticanalysis/addUnit_one/addUnit_two_type" //当前路由地址
+ setTimeoutObj//延时器需要清除
ngOnInit(): void {
- window.setTimeout(()=>{
+ this.setTimeoutObj = window.setTimeout(()=>{
this.initCharts()
this.barEcharts()
},0)
}
+ ngOnDestroy(){
+ window.clearTimeout(this.setTimeoutObj);
+ this.indexBzt.clear()
+ this.indexBzt.dispose()
+ this.forArr.forEach(item => {
+ item.echart.clear()
+ item.echart.dispose()
+ })
+ }
axisLabel = {
interval: 0,
@@ -94,26 +105,26 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ]
zhiNameData = ["浦东支队","黄埔支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
- forArr = [{id:'gaoceng',name:'高层'},
- {id:'dixia',name:'地下'},
- {id:'guidao',name:'轨道交通'},
- {id:'huagong',name:'化工生产'},
- {id:'chuguan',name:'储罐类'},
- {id:'changfang',name:'厂房'},
- {id:'gujianzhu',name:'古建筑'},
- {id:'shichang',name:'商市场'},
- {id:'yiyuan',name:'医院'},
- {id:'xuexiao',name:'学校'},
- {id:'binguan',name:'宾馆'},
- {id:'yule',name:'娱乐场所'},
- {id:'canyin',name:'餐饮业'},
- {id:'yingyuan',name:'影剧院'},
- {id:'zhanlan',name:'展览建筑'},
- {id:'suidao',name:'隧道'}]
-
+ forArr = [{id:'gaoceng',name:'高层',echart:null},
+ {id:'dixia',name:'地下',echart:null},
+ {id:'guidao',name:'轨道交通',echart:null},
+ {id:'huagong',name:'化工生产',echart:null},
+ {id:'chuguan',name:'储罐类',echart:null},
+ {id:'changfang',name:'厂房',echart:null},
+ {id:'gujianzhu',name:'古建筑',echart:null},
+ {id:'shichang',name:'商市场',echart:null},
+ {id:'yiyuan',name:'医院',echart:null},
+ {id:'xuexiao',name:'学校',echart:null},
+ {id:'binguan',name:'宾馆',echart:null},
+ {id:'yule',name:'娱乐场所',echart:null},
+ {id:'canyin',name:'餐饮业',echart:null},
+ {id:'yingyuan',name:'影剧院',echart:null},
+ {id:'zhanlan',name:'展览建筑',echart:null},
+ {id:'suidao',name:'隧道',echart:null}]
+ indexBzt //顶部饼状图
/* 顶部饼状图 */
initCharts(){
- let indexBzt = echarts.init(document.getElementById('pie'));
+ this.indexBzt = echarts.init(document.getElementById('pie'));
let options={
title: {
text: '新增单位统计(8900家)',
@@ -216,16 +227,16 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}
]
};
- indexBzt.on('click', (params) => {
+ this.indexBzt.on('click', (params) => {
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
});
- indexBzt.setOption(options);
+ this.indexBzt.setOption(options);
}
//柱状图
barEcharts(){
this.forArr.forEach(item=>{
let _this = this
- let addEchart = echarts.init(document.getElementById(item.id));
+ item.echart = echarts.init(document.getElementById(item.id));
let option = {
title: {
text: item.name,
@@ -263,8 +274,8 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
label: this.topTextlabel
}]
};
- addEchart.setOption(option);
- addEchart.on('click', (params) => {
+ item.echart.setOption(option);
+ item.echart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':params.name,'buildingTypeName':item.name}})
});
})
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 867d366..15595a2 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
@@ -15,9 +15,14 @@ export class BuildingTypeOneComponent implements OnInit {
this.initCharts()
},0)
}
+ ngOnDestroy(): void {
+ this.indexBzt.clear()
+ this.indexBzt.dispose()
+ }
/* 首页饼状图 */
+ indexBzt
initCharts(){
- let indexBzt = echarts.init(document.getElementById('indexBzt'));
+ this.indexBzt = echarts.init(document.getElementById('indexBzt'));
let options={
title: {
text: '建筑类型统计(8900家)',
@@ -86,10 +91,10 @@ export class BuildingTypeOneComponent implements OnInit {
}
]
};
- indexBzt.on('click', (params) => {
+ this.indexBzt.on('click', (params) => {
this.router.navigateByUrl('/statisticanalysis/buildingType_one/buildingType_two_forward');
});
- indexBzt.setOption(options);
+ this.indexBzt.setOption(options);
}
biaogeTishi(biaotou:string){
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄埔支队","number":"144","zhanbi":"2.8%"},'
diff --git a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts
index e180a13..6a22850 100644
--- a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts
+++ b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts
@@ -29,6 +29,10 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
this.detailEcharts()
})
}
+ ngOnDestroy(): void {
+ this.detailPlanEchart.clear()
+ this.detailPlanEchart.dispose()
+ }
topTextlabel = {
show: true, // 开启显示
position: 'top', // 在上方显示
@@ -41,8 +45,9 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
}//柱状图数值顶部显示
zhongNameData = ["浦东中队","黄埔中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"]
zhongNumData = [200,190,180,170,160,150,140,130,120,110,100]
+ detailPlanEchart
detailEcharts(){
- var detailPlanEchart = echarts.init(document.getElementById('barEchart'));
+ this.detailPlanEchart = echarts.init(document.getElementById('barEchart'));
var option = {
title: {
text: this.buildingTypeName + '(' +this.organizationName + ')',
@@ -79,7 +84,7 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
label: this.topTextlabel
}]
};
- detailPlanEchart.setOption(option);
+ this.detailPlanEchart.setOption(option);
}
diff --git a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.html b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.html
index ab41180..1d84921 100644
--- a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.html
+++ b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.html
@@ -1,7 +1,7 @@
diff --git a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.ts b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.ts
index aaed0aa..c55884c 100644
--- a/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.ts
+++ b/src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.ts
@@ -21,6 +21,14 @@ export class BuildingTypeTwoForwardComponent implements OnInit {
this.barEcharts()
},0)
}
+ ngOnDestroy(): void {
+ this.indexBzt.clear()
+ this.indexBzt.dispose()
+ this.forArr.forEach(item => {
+ item.echart.clear()
+ item.echart.dispose()
+ })
+ }
axisLabel = {
interval: 0,
formatter:function(value)
@@ -112,26 +120,27 @@ export class BuildingTypeTwoForwardComponent implements OnInit {
]
buildingTypeName = ['高层','地下','轨道交通','化工生产','储罐类','厂房','古建筑','商市场','医院','学校','宾馆','娱乐场所','餐饮业','影剧院','展览建筑','隧道']
buildingTypeNum = [200,190,180,170,160,150,140,130,120,110,100,90,80,70,60,50]
- forArr = [{id:'gaoceng',name:'浦东支队'},
- {id:'dixia',name:'黄埔支队'},
- {id:'guidao',name:'徐汇支队'},
- {id:'huagong',name:'长宁支队'},
- {id:'chuguan',name:'静安支队'},
- {id:'changfang',name:'普陀支队'},
- {id:'gujianzhu',name:'虹口支队'},
- {id:'shichang',name:'杨浦支队'},
- {id:'yiyuan',name:'闵行支队'},
- {id:'xuexiao',name:'宝山支队'},
- {id:'binguan',name:'嘉定支队'},
- {id:'yule',name:'松江支队'},
- {id:'canyin',name:'金山支队'},
- {id:'yingyuan',name:'崇明支队'},
- {id:'zhanlan',name:'青浦支队'},
+ forArr = [{id:'gaoceng',name:'浦东支队',echart:null},
+ {id:'dixia',name:'黄埔支队',echart:null},
+ {id:'guidao',name:'徐汇支队',echart:null},
+ {id:'huagong',name:'长宁支队',echart:null},
+ {id:'chuguan',name:'静安支队',echart:null},
+ {id:'changfang',name:'普陀支队',echart:null},
+ {id:'gujianzhu',name:'虹口支队',echart:null},
+ {id:'shichang',name:'杨浦支队',echart:null},
+ {id:'yiyuan',name:'闵行支队',echart:null},
+ {id:'xuexiao',name:'宝山支队',echart:null},
+ {id:'binguan',name:'嘉定支队',echart:null},
+ {id:'yule',name:'松江支队',echart:null},
+ {id:'canyin',name:'金山支队',echart:null},
+ {id:'yingyuan',name:'崇明支队',echart:null},
+ {id:'zhanlan',name:'青浦支队',echart:null},
]
/* 顶部饼状图 */
+ indexBzt
initCharts(){
- let indexBzt = echarts.init(document.getElementById('pie'));
+ this.indexBzt = echarts.init(document.getElementById('pie'));
let options={
title: {
text: '组织机构统计(5500家)',
@@ -217,16 +226,16 @@ export class BuildingTypeTwoForwardComponent implements OnInit {
}
]
};
- indexBzt.on('click', (params) => {
+ this.indexBzt.on('click', (params) => {
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
});
- indexBzt.setOption(options);
+ this.indexBzt.setOption(options);
}
//柱状图
barEcharts(){
this.forArr.forEach(item=>{
let _this = this
- let Echart = echarts.init(document.getElementById(item.id));
+ item.echart = echarts.init(document.getElementById(item.id));
let option = {
color: ['#3398DB'],
title: {
@@ -265,8 +274,8 @@ export class BuildingTypeTwoForwardComponent implements OnInit {
label: this.topTextlabel
}]
};
- Echart.setOption(option);
- Echart.on('click', (params) => {
+ item.echart.setOption(option);
+ item.echart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':item.name,'buildingTypeName':params.name}})
});
})
diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.html b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.html
index bdb66e9..d8a4ac7 100644
--- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.html
+++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.html
@@ -2,7 +2,7 @@
diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts
index 22efeb3..15b3f06 100644
--- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts
+++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts
@@ -22,7 +22,14 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
this.barEcharts()
},0)
}
-
+ ngOnDestroy(): void {
+ this.indexBzt.clear()
+ this.indexBzt.dispose()
+ this.forArr.forEach(item => {
+ item.echart.clear()
+ item.echart.dispose()
+ })
+ }
axisLabel = {
interval: 0,
formatter:function(value)
@@ -94,26 +101,27 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ]
zhiNameData = ["浦东支队","黄埔支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
- forArr = [{id:'gaoceng',name:'高层'},
- {id:'dixia',name:'地下'},
- {id:'guidao',name:'轨道交通'},
- {id:'huagong',name:'化工生产'},
- {id:'chuguan',name:'储罐类'},
- {id:'changfang',name:'厂房'},
- {id:'gujianzhu',name:'古建筑'},
- {id:'shichang',name:'商市场'},
- {id:'yiyuan',name:'医院'},
- {id:'xuexiao',name:'学校'},
- {id:'binguan',name:'宾馆'},
- {id:'yule',name:'娱乐场所'},
- {id:'canyin',name:'餐饮业'},
- {id:'yingyuan',name:'影剧院'},
- {id:'zhanlan',name:'展览建筑'},
- {id:'suidao',name:'隧道'}]
+ forArr = [{id:'gaoceng',name:'高层',echart:null},
+ {id:'dixia',name:'地下',echart:null},
+ {id:'guidao',name:'轨道交通',echart:null},
+ {id:'huagong',name:'化工生产',echart:null},
+ {id:'chuguan',name:'储罐类',echart:null},
+ {id:'changfang',name:'厂房',echart:null},
+ {id:'gujianzhu',name:'古建筑',echart:null},
+ {id:'shichang',name:'商市场',echart:null},
+ {id:'yiyuan',name:'医院',echart:null},
+ {id:'xuexiao',name:'学校',echart:null},
+ {id:'binguan',name:'宾馆',echart:null},
+ {id:'yule',name:'娱乐场所',echart:null},
+ {id:'canyin',name:'餐饮业',echart:null},
+ {id:'yingyuan',name:'影剧院',echart:null},
+ {id:'zhanlan',name:'展览建筑',echart:null},
+ {id:'suidao',name:'隧道',echart:null}]
/* 顶部饼状图 */
+ indexBzt
initCharts(){
- let indexBzt = echarts.init(document.getElementById('pie'));
+ this.indexBzt = echarts.init(document.getElementById('pie'));
let options={
title: {
text: '建筑类型统计(8900家)',
@@ -216,16 +224,16 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
}
]
};
- indexBzt.on('click', (params) => {
+ this.indexBzt.on('click', (params) => {
// this.router.navigateByUrl('/statisticanalysis/buildingType_two_forward');
});
- indexBzt.setOption(options);
+ this.indexBzt.setOption(options);
}
//柱状图
barEcharts(){
this.forArr.forEach(item=>{
let _this = this
- let addEchart = echarts.init(document.getElementById(item.id));
+ item.echart = echarts.init(document.getElementById(item.id));
let option = {
title: {
text: item.name,
@@ -263,12 +271,11 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
label: this.topTextlabel
}]
};
- addEchart.setOption(option);
- addEchart.on('click', (params) => {
+ item.echart.setOption(option);
+ item.echart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':params.name,'buildingTypeName':item.name}})
});
})
-
}
//提示框表格
tableTooltip(dataArr,title:string){
diff --git a/src/app/statistic-analysis/echarts-data.service.ts b/src/app/statistic-analysis/echarts-data.service.ts
index 3fe81f8..1bb95a5 100644
--- a/src/app/statistic-analysis/echarts-data.service.ts
+++ b/src/app/statistic-analysis/echarts-data.service.ts
@@ -18,6 +18,7 @@ export class EchartsDataService {
+ //echarts 悬停 显示表格假数据
//支队提示框
tableDataZhi = [
{name:"浦东支队",number:"156",zhanbi:"3%"},
@@ -94,6 +95,16 @@ export class EchartsDataService {
{name:"十二月",number:"122",zhanbi:"1.6%"},
{name:"总计",number:"984",zhanbi:"20%"}
]
+ //预案提示框
+ planData = [
+ {name:"预案新增",number:"156",zhanbi:"19%"},
+ {name:"预案审核通过",number:"144",zhanbi:"21%"},
+ {name:"预案编制",number:"133",zhanbi:"20%"},
+ {name:"预案审核退回",number:"122",zhanbi:"17%"},
+ {name:"预案审核中",number:"120",zhanbi:"23%"},
+ {name:"总计",number:"561",zhanbi:"100%"},
+ ]
+
//提示框表格
tableTooltip(dataArr,title:string){
let data = dataArr
@@ -113,10 +124,10 @@ export class EchartsDataService {
}
res+=''
- // res+='
总计 | 1356 | 19% | '
res+=' '
return res
}
+
//如果提示框显示不开
tableTooltipNoShow(point, params, dom, rect, size) {
// 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
@@ -152,11 +163,48 @@ export class EchartsDataService {
return [pointX, pointY];
}
+
+ tableTooltipNoShow2(point, params, dom, rect, size) {
+ // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
+ // 提示框位置
+ var x = 0; // x坐标位置
+ var y = 0; // y坐标位置
+
+ // 当前鼠标位置
+ var pointX = point[0];
+ var pointY = point[1];
+
+ // 外层div大小
+ var viewWidth = size.viewSize[0];
+ // var viewHeight = size.viewSize[1];
+
+ // 提示框大小
+ var boxWidth = size.contentSize[0];
+ var boxHeight = size.contentSize[1];
+
+ // boxWidth > pointX 说明鼠标左边放不下提示框
+ if (boxWidth > pointX) {
+ x = 35;
+ } else { // 左边放的下
+ x = pointX + 80;
+ }
+ // 说明鼠标右边放不下提示框
+ if(viewWidth - 100 - pointX < boxWidth){
+ x = pointX - boxWidth;
+ }
-
- //用法:
+ // boxHeight > pointY 说明鼠标上边放不下提示框
+ if (boxHeight > pointY) {
+ y = 65;
+ } else { // 上边放得下
+ y = pointY - boxHeight;
+ }
+
+ return [x, y];
+ }
+ //用法:
// tooltip: {
// trigger: 'axis',
// backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
@@ -167,4 +215,7 @@ export class EchartsDataService {
// },
// position:this.serviceData.tableTooltipNoShow
// }
+
+
+
}
diff --git a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.ts b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.ts
index a3d8ed9..c57aa84 100644
--- a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.ts
+++ b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.ts
@@ -11,7 +11,7 @@ declare var echarts: any;
})
export class ScheduledUpdatesComponent implements OnInit {
- constructor(private router: Router) { }
+ constructor(private router: Router,public echartsData:EchartsDataService) { }
ngOnInit(): void {
window.setTimeout(()=>{
@@ -19,9 +19,15 @@ export class ScheduledUpdatesComponent implements OnInit {
})
}
+ ngOnDestroy () {
+ this.example.clear()
+ this.example.dispose()
+ }
+
+ example:any;
/* 首页饼状图 */
initCharts(){
- var indexBzt = echarts.init(document.getElementById('center'));
+ this.example= echarts.init(document.getElementById('center'));
var options={
title: {
text: '计划更新统计(7100家)',
@@ -33,12 +39,13 @@ export class ScheduledUpdatesComponent implements OnInit {
},
tooltip: {
trigger: 'item',
- formatter: (params)=>{
- // return this.biaogeTishi(params.name)
- } ,
backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
borderWidth:'1',
- borderRadius :'0'
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,params.name)
+ },
+ position:this.echartsData.tableTooltipNoShow
},
legend: {
orient: 'vertical',
@@ -78,8 +85,8 @@ export class ScheduledUpdatesComponent implements OnInit {
}]
};
- indexBzt.setOption(options);
- indexBzt.on('click', (params) => {
+ this.example.setOption(options);
+ this.example.on('click', (params) => {
this.router.navigateByUrl('/statisticanalysis/scheduledUpdates/PublicEcharts');
});
}
@@ -98,7 +105,7 @@ export class publicEchartsComponent implements OnInit {
constructor(private router: Router,public echartsData:EchartsDataService,public dialog: MatDialog,) { }
ngOnInit(): void {
-
+ this.echartsData.scheduledUpdatesToggle = true
}
isToggle:boolean = true; // 已核查/未核查
@@ -149,8 +156,10 @@ export class verifiedComponent implements OnInit {
}
ngOnDestroy () {
+ this.oneEcharts.dispose()
this.oneEcharts.clear()
this.items.forEach((element,index) => {
+ element.echart.dispose()
element.echart.clear()
});
}
@@ -179,6 +188,13 @@ export class verifiedComponent implements OnInit {
//提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,params[0].name)
+ },
+ position:this.echartsData.tableTooltipNoShow
},
// x轴
xAxis: {
@@ -363,6 +379,7 @@ export class notVerifiedComponent implements OnInit {
}
ngOnDestroy () {
+ this.oneEcharts.dispose()
this.oneEcharts.clear()
}
@@ -382,9 +399,13 @@ export class notVerifiedComponent implements OnInit {
},
tooltip: {
trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'未核查')
+ },
+ position:this.echartsData.tableTooltipNoShow
},
legend: {
data: ['剩余未核查','总数'],
@@ -470,8 +491,14 @@ export class detailedInformationComponent implements OnInit {
},0)
}
+ ngOnDestroy () {
+ this.example.dispose()
+ this.example.clear()
+ }
+
+ example:any;
oneInit () {
- let echart = echarts.init(document.getElementById('center'), 'skinUpp');
+ this.example = echarts.init(document.getElementById('center'), 'skinUpp');
if (this.echartsData.scheduledUpdatesType ===0) { //已核查
var option = {
title: {
@@ -560,7 +587,7 @@ export class detailedInformationComponent implements OnInit {
},
]
};
- echart.setOption(option);
+ this.example.setOption(option);
} else { //未核查
var options = {
title: {
@@ -631,7 +658,7 @@ export class detailedInformationComponent implements OnInit {
},
]
};
- echart.setOption(options);
+ this.example.setOption(options);
}
}
diff --git a/src/app/statistic-analysis/state/page-one/page-one.component.ts b/src/app/statistic-analysis/state/page-one/page-one.component.ts
index 88063a7..781f3f7 100644
--- a/src/app/statistic-analysis/state/page-one/page-one.component.ts
+++ b/src/app/statistic-analysis/state/page-one/page-one.component.ts
@@ -25,12 +25,17 @@ export class PageOneComponent implements OnInit {
this.initCharts()
},0)
}
+ ngOnDestroy(): void {
+ this.indexBzt.clear()
+ this.indexBzt.dispose()
+ }
/* 饼状图跳转 */
/* 首页饼状图 */
+ indexBzt
initCharts(){
var ec = echarts as any;
- var indexBzt = ec.init(document.getElementById('indexBzt'));
+ this.indexBzt = ec.init(document.getElementById('indexBzt'));
var options={
title: {
text: '预案状态统计(7005家)',
@@ -96,10 +101,10 @@ export class PageOneComponent implements OnInit {
}
]
};
- indexBzt.on('click', (params) => {
+ this.indexBzt.on('click', (params) => {
this.router.navigateByUrl('/statisticanalysis/statePageTwo_time');
});
- indexBzt.setOption(options);
+ this.indexBzt.setOption(options);
}
/**
* @name: 表格提示框封装
diff --git a/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts b/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
index ac56a0b..12d64cd 100644
--- a/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
+++ b/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
@@ -15,7 +15,6 @@ export class PageTwoNameComponent implements OnInit {
@ViewChild('zhongDuiChild') zhongDuiChild:PageZhongDuiDetailsComponent; //父组件中获得子组件的引用
ngOnInit(): void {
-
setTimeout(() => {
this.planState()
this.planAdd()
@@ -24,7 +23,27 @@ export class PageTwoNameComponent implements OnInit {
this.planBack()
this.planAudit()
}, 0);
-
+ }
+
+ ngOnDestroy(): void {
+ this.addEchart.clear()
+ this.addEchart.dispose()
+
+ this.passPlanEchartObj.clear()
+ this.passPlanEchartObj.dispose()
+
+ this.passMakeEchart.clear()
+ this.passMakeEchart.dispose()
+
+ this.passBackEchart.clear()
+ this.passBackEchart.dispose()
+
+ this.planAuditEchart.clear()
+ this.planAuditEchart.dispose()
+
+ this.topEchart.clear()
+ this.topEchart.dispose()
+
}
axisLabel = {
interval: 0,
@@ -65,10 +84,11 @@ export class PageTwoNameComponent implements OnInit {
zhiNameData = ["浦东支队","黄埔支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
+ addEchart
//预案新增统计
planAdd () {
let _this = this
- var addEchart = echarts.init(document.getElementById('addEchart'));
+ this.addEchart = echarts.init(document.getElementById('addEchart'));
var option = {
title: {
text: "预案新增",
@@ -107,16 +127,17 @@ export class PageTwoNameComponent implements OnInit {
label: this.topTextlabel
}]
};
- addEchart.setOption(option);
- addEchart.on('click', function (params) {
+ this.addEchart.setOption(option);
+ this.addEchart.on('click', function (params) {
_this.data.statefulInspectionName = '预案新增'
_this.data.statefulInspectionToggle = false
});
}
+ passPlanEchartObj
//预案审核通过
passPlanEchart (){
let _this = this
- var passPlanEchart = echarts.init(document.getElementById('passPlanEchart'));
+ this.passPlanEchartObj = echarts.init(document.getElementById('passPlanEchart'));
var option = {
title: {
text: "预案审核通过",
@@ -154,17 +175,17 @@ export class PageTwoNameComponent implements OnInit {
label: this.topTextlabel
}]
};
- passPlanEchart.setOption(option);
- passPlanEchart.on('click', function (params) {
+ this.passPlanEchartObj.setOption(option);
+ this.passPlanEchartObj.on('click', function (params) {
_this.data.statefulInspectionName = '预案审核通过'
_this.data.statefulInspectionToggle = false
});
}
-
+ passMakeEchart
//预案编制
planMake (){
let _this = this
- var passMakeEchart = echarts.init(document.getElementById('planMake'));
+ this.passMakeEchart = echarts.init(document.getElementById('planMake'));
var option = {
title: {
text: "预案编制",
@@ -202,17 +223,17 @@ export class PageTwoNameComponent implements OnInit {
label: this.topTextlabel
}]
};
- passMakeEchart.setOption(option);
- passMakeEchart.on('click', function (params) {
+ this.passMakeEchart.setOption(option);
+ this.passMakeEchart.on('click', function (params) {
_this.data.statefulInspectionName = '预案编制'
_this.data.statefulInspectionToggle = false
});
}
-
+ passBackEchart
//预案审核退回
planBack (){
let _this = this
- var passBackEchart = echarts.init(document.getElementById('planBack'));
+ this.passBackEchart = echarts.init(document.getElementById('planBack'));
var option = {
title: {
text: "预案审核退回",
@@ -250,17 +271,17 @@ export class PageTwoNameComponent implements OnInit {
label: this.topTextlabel
}]
};
- passBackEchart.setOption(option);
- passBackEchart.on('click', function (params) {
+ this.passBackEchart.setOption(option);
+ this.passBackEchart.on('click', function (params) {
_this.data.statefulInspectionName = '预案审核退回'
_this.data.statefulInspectionToggle = false
});
}
-
+ planAuditEchart
//预案审核中
planAudit (){
let _this = this
- var planAuditEchart = echarts.init(document.getElementById('planAudit'));
+ this.planAuditEchart = echarts.init(document.getElementById('planAudit'));
var option = {
title: {
text: "预案审核中",
@@ -298,16 +319,16 @@ export class PageTwoNameComponent implements OnInit {
label: this.topTextlabel
}]
};
- planAuditEchart.setOption(option);
- planAuditEchart.on('click', function (params) {
+ this.planAuditEchart.setOption(option);
+ this.planAuditEchart.on('click', function (params) {
_this.data.statefulInspectionName = '预案审核中'
_this.data.statefulInspectionToggle = false
});
}
-
+ topEchart
//预案状态统计
planState(){
- var passPlanEchart = echarts.init(document.getElementById('pie'));
+ this.topEchart = echarts.init(document.getElementById('pie'));
var option = {
title: {
text: '预案状态统计(7005份)',
@@ -397,7 +418,7 @@ export class PageTwoNameComponent implements OnInit {
}
]
}
- passPlanEchart.setOption(option);
+ this.topEchart.setOption(option);
}
tableTooltip(biaotou:string){
diff --git a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts
index 1f875e2..8426b44 100644
--- a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts
+++ b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts
@@ -20,6 +20,7 @@ export class PageTwoTimeComponent implements OnInit {
@ViewChild('pageTwoName')pageTwoName :PageTwoNameComponent; //父组件中获得子组件的引用
ngOnInit(): void {
+ this.echartsData.statefulInspectionToggle = true
this.dateInit()
}
@@ -129,11 +130,25 @@ export class echartsComponent implements OnInit {
this.sixInit()
},0)
}
+
+ ngOnDestroy () {
+ this.oneExample.clear()
+ this.oneExample.dispose()
+ this.twoExample.clear()
+ this.twoExample.dispose()
+ this.threeExample.clear()
+ this.threeExample.dispose()
+ this.fourExample.clear()
+ this.fourExample.dispose()
+ this.fiveExample.clear()
+ this.fiveExample.dispose()
+ this.sixExample.clear()
+ this.sixExample.dispose()
+ }
-
-
+ oneExample:any;
oneInit () {
- var chartQusj = echarts.init(document.getElementById('one'), 'skinUpp');
+ this.oneExample = echarts.init(document.getElementById('one'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -141,6 +156,15 @@ export class echartsComponent implements OnInit {
right: 20,
bottom: 20,
},
+ tooltip: {
+ trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.planData,params[0].name)
+ },
+ },
// 标题
title: {
text: '预案统计状态',
@@ -158,10 +182,6 @@ export class echartsComponent implements OnInit {
fontSize: 22,
}
},
- //提示框
- tooltip: {
- trigger: 'axis',
- },
// x轴
xAxis: {
type: 'category',
@@ -205,12 +225,13 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
+ this.oneExample.setOption(option);
}
+ twoExample:any;
twoInit () {
let that = this
- var chartQusj = echarts.init(document.getElementById('two'), 'skinUpp');
+ this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -228,9 +249,14 @@ export class echartsComponent implements OnInit {
color:'#000',
}
},
- //提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案新增')
+ }
},
// x轴
xAxis: {
@@ -275,16 +301,17 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
- chartQusj.on('click', function (params) {
+ this.twoExample.setOption(option);
+ this.twoExample.on('click', function (params) {
that.echartsData.statefulInspectionName = '预案新增'
that.echartsData.statefulInspectionToggle = false
});
}
+ threeExample:any;
threeInit () {
let that = this
- var chartQusj = echarts.init(document.getElementById('three'), 'skinUpp');
+ this.threeExample = echarts.init(document.getElementById('three'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -305,6 +332,12 @@ export class echartsComponent implements OnInit {
//提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核通过')
+ }
},
// x轴
xAxis: {
@@ -349,16 +382,17 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
- chartQusj.on('click', function (params) {
+ this.threeExample.setOption(option);
+ this.threeExample.on('click', function (params) {
that.echartsData.statefulInspectionName = '预案审核通过'
that.echartsData.statefulInspectionToggle = false
});
}
+ fourExample:any;
fourInit () {
let that = this
- var chartQusj = echarts.init(document.getElementById('four'), 'skinUpp');
+ this.fourExample = echarts.init(document.getElementById('four'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -379,6 +413,12 @@ export class echartsComponent implements OnInit {
//提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案编制')
+ }
},
// x轴
xAxis: {
@@ -423,16 +463,17 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
- chartQusj.on('click', function (params) {
+ this.fourExample.setOption(option);
+ this.fourExample.on('click', function (params) {
that.echartsData.statefulInspectionName = '预案编制'
that.echartsData.statefulInspectionToggle = false
});
}
+ fiveExample:any;
fiveInit () {
let that = this
- var chartQusj = echarts.init(document.getElementById('five'), 'skinUpp');
+ this.fiveExample = echarts.init(document.getElementById('five'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -453,6 +494,12 @@ export class echartsComponent implements OnInit {
//提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核退回')
+ }
},
// x轴
xAxis: {
@@ -497,16 +544,17 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
- chartQusj.on('click', function (params) {
+ this.fiveExample.setOption(option);
+ this.fiveExample.on('click', function (params) {
that.echartsData.statefulInspectionName = '预案审核退回'
that.echartsData.statefulInspectionToggle = false
});
}
+ sixExample:any;
sixInit () {
let that = this
- var chartQusj = echarts.init(document.getElementById('six'), 'skinUpp');
+ this.sixExample = echarts.init(document.getElementById('six'), 'skinUpp');
var option = {
grid: {
top: 50,
@@ -527,6 +575,12 @@ export class echartsComponent implements OnInit {
//提示框
tooltip: {
trigger: 'axis',
+ backgroundColor:'rgba(255,255,255,1)',//通过设置rgba调节背景颜色与透明度
+ borderWidth:'1',
+ borderRadius :'0',
+ formatter: (params)=>{
+ return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核中')
+ }
},
// x轴
xAxis: {
@@ -571,8 +625,8 @@ export class echartsComponent implements OnInit {
}
],
};
- chartQusj.setOption(option);
- chartQusj.on('click', function (params) {
+ this.sixExample.setOption(option);
+ this.sixExample.on('click', function (params) {
that.echartsData.statefulInspectionName = '预案审核中'
that.echartsData.statefulInspectionToggle = false
});
diff --git a/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts b/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts
index 11ad4ac..9ee875a 100644
--- a/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts
+++ b/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts
@@ -19,9 +19,13 @@ export class PageZhongDuiDetailsComponent implements OnInit {
this.detailEcharts()
})
}
-
+ ngOnDestroy(): void {
+ this.detailPlanEchart.clear()
+ this.detailPlanEchart.dispose()
+ }
+ detailPlanEchart
detailEcharts(){
- var detailPlanEchart = echarts.init(document.getElementById('detailBox'));
+ this.detailPlanEchart = echarts.init(document.getElementById('detailBox'));
var option = {
title: {
text: this.data.statefulInspectionName,
@@ -53,10 +57,11 @@ export class PageZhongDuiDetailsComponent implements OnInit {
showBackground: true,
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
- }
+ },
+ barWidth :'58'
}]
};
- detailPlanEchart.setOption(option);
+ this.detailPlanEchart.setOption(option);
}
diff --git a/src/app/statistic-analysis/statistic-analysis-routing.module.ts b/src/app/statistic-analysis/statistic-analysis-routing.module.ts
index e894f6c..98e7898 100644
--- a/src/app/statistic-analysis/statistic-analysis-routing.module.ts
+++ b/src/app/statistic-analysis/statistic-analysis-routing.module.ts
@@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-09-02 16:57:00
* @LastEditors: sueRimn
- * @LastEditTime: 2020-09-05 11:37:39
+ * @LastEditTime: 2020-09-05 13:51:54
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@@ -26,6 +26,8 @@ import { AddUnitOneComponent } from './addUnit/add-unit-one/add-unit-one.compone
import { AddUnitTwoTypeStatisticsComponent } from './addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component';
import { AddUnitTwoTypeDetailsComponent } from './addUnit/add-unit-two-type-details/add-unit-two-type-details.component';
import { AddUnitTwoTimeComponent } from './addUnit/add-unit-two-time/add-unit-two-time.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';
const routes: Routes = [
{ path: 'statePageOne', component: PageOneComponent},
@@ -47,6 +49,9 @@ const routes: Routes = [
{ path: 'addUnit_one/addUnit_two_type', component: AddUnitTwoTypeStatisticsComponent},
{ path: 'addUnit_one/addUnit_two_typeDetails', component: AddUnitTwoTypeDetailsComponent},
{ 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_barDetails', component: AddUnitThreeBarDetailsComponent},
+ { path: 'scheduledUpdates', component: ScheduledUpdatesComponent},
{ path: 'scheduledUpdates', component: ScheduledUpdatesComponent},
{ path: 'scheduledUpdates/PublicEcharts', component: publicEchartsComponent}
];
diff --git a/src/app/statistic-analysis/statistic-analysis.module.ts b/src/app/statistic-analysis/statistic-analysis.module.ts
index 89ad034..2e37fef 100644
--- a/src/app/statistic-analysis/statistic-analysis.module.ts
+++ b/src/app/statistic-analysis/statistic-analysis.module.ts
@@ -60,11 +60,13 @@ import { AddUnitOneComponent } from './addUnit/add-unit-one/add-unit-one.compone
import { AddUnitTwoTypeStatisticsComponent } from './addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component';
import { AddUnitTwoTypeDetailsComponent } from './addUnit/add-unit-two-type-details/add-unit-two-type-details.component';
import { AddUnitTwoTimeComponent } from './addUnit/add-unit-two-time/add-unit-two-time.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';
@NgModule({
- declarations: [PageOneComponent, PageTwoTimeComponent, PageTwoNameComponent, PageZhongDuiDetailsComponent,echartsComponent, DeleteOneComponent, DeleteTwoComponent, DeleteThereComponent, DeleteFourComponent, BuildingTypeOneComponent, ScheduledUpdatesComponent,publicEchartsComponent,verifiedComponent,notVerifiedComponent,detailedInformationComponent,moreTableComponent, BuildingTypeTwoForwardComponent, BuildingTypeTwoReverseComponent, BuildingTypeThreeDetailsComponent, AddUnitOneComponent, AddUnitTwoTypeStatisticsComponent, AddUnitTwoTypeDetailsComponent, AddUnitTwoTimeComponent],
+ declarations: [PageOneComponent, PageTwoTimeComponent, PageTwoNameComponent, PageZhongDuiDetailsComponent,echartsComponent, DeleteOneComponent, DeleteTwoComponent, DeleteThereComponent, DeleteFourComponent, BuildingTypeOneComponent, ScheduledUpdatesComponent,publicEchartsComponent,verifiedComponent,notVerifiedComponent,detailedInformationComponent,moreTableComponent, BuildingTypeTwoForwardComponent, BuildingTypeTwoReverseComponent, BuildingTypeThreeDetailsComponent, AddUnitOneComponent, AddUnitTwoTypeStatisticsComponent, AddUnitTwoTypeDetailsComponent, AddUnitTwoTimeComponent,AddUnitThreeLineDetailsComponent,AddUnitThreeBarDetailsComponent],
imports: [
CommonModule,
StatisticAnalysisRoutingModule,