|
@@ -51,81 +51,6 @@
|
|
|
}
|
|
|
},
|
|
|
//校级
|
|
|
- schoolEcharts(){
|
|
|
- hiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
|
- let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
|
- let data = [];
|
|
|
- if(!response.rows[0]){
|
|
|
- this.$set(this,'nullType',true);
|
|
|
- return
|
|
|
- }else{
|
|
|
- this.$set(this,'nullType',false);
|
|
|
- }
|
|
|
- for(let i=0;i<response.rows.length;i++){
|
|
|
- // substring
|
|
|
- console.log(response.rows[i].collegeName.length)
|
|
|
- let obj = {
|
|
|
- name:response.rows[i].collegeName.length>8?response.rows[i].collegeName.substring(0,8)+'..':response.rows[i].collegeName,
|
|
|
- nameText:response.rows[i].collegeName,
|
|
|
- value:response.rows[i].sumTotal,
|
|
|
- }
|
|
|
- data.push(obj);
|
|
|
- }
|
|
|
- let option = {
|
|
|
- legend: {
|
|
|
- show:false,
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- confine: true,
|
|
|
- trigger: 'item',
|
|
|
- // formatter: '{b} : {c}'
|
|
|
-
|
|
|
- formatter: params => {
|
|
|
- console.log('params',params)
|
|
|
- return `${params.data.nameText} 隐患:${params.data.value} 占比:${params.percent}%`
|
|
|
- },
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- avoidLabelOverlap: false,
|
|
|
- type: 'pie',
|
|
|
- left:20,
|
|
|
- right:20,
|
|
|
- roseType: 'area', // 玫瑰图
|
|
|
- center: ['50%', '50%'],
|
|
|
- radius: ['0%', '40%'],
|
|
|
- label: {
|
|
|
- normal: {
|
|
|
- formatter: '{b}\n隐患{c}\t占比{d}%',
|
|
|
- textStyle: {
|
|
|
- fontSize: 12,
|
|
|
- color:'#333'
|
|
|
- },
|
|
|
- padding: [0, -110, 26, -110],
|
|
|
- }
|
|
|
- },
|
|
|
- labelLine: {
|
|
|
- normal: {
|
|
|
- length: 30,
|
|
|
- length2: 110,
|
|
|
- }
|
|
|
- },
|
|
|
- data: data,
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: function (colors) {
|
|
|
- var colorList = ['#0183FA', '#A069FF', '#80C459', '#FFA200', '#39DBED', '#FF2A00', '#009DFF', '#41BE26', '#2758E0', '#FFE019', '#FF5E86'];
|
|
|
- return colorList[colors.dataIndex];
|
|
|
- }
|
|
|
- },
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- myChart.setOption(option);
|
|
|
- });
|
|
|
- },
|
|
|
- //院系
|
|
|
departmentEcharts(){
|
|
|
collegCheckHiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
@@ -264,6 +189,81 @@
|
|
|
myChart.setOption(option);
|
|
|
})
|
|
|
},
|
|
|
+ //院系
|
|
|
+ schoolEcharts(){
|
|
|
+ hiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
|
+ let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
|
+ let data = [];
|
|
|
+ if(!response.rows[0]){
|
|
|
+ this.$set(this,'nullType',true);
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ this.$set(this,'nullType',false);
|
|
|
+ }
|
|
|
+ for(let i=0;i<response.rows.length;i++){
|
|
|
+ // substring
|
|
|
+ console.log(response.rows[i].collegeName.length)
|
|
|
+ let obj = {
|
|
|
+ name:response.rows[i].collegeName.length>8?response.rows[i].collegeName.substring(0,8)+'..':response.rows[i].collegeName,
|
|
|
+ nameText:response.rows[i].collegeName,
|
|
|
+ value:response.rows[i].sumTotal,
|
|
|
+ }
|
|
|
+ data.push(obj);
|
|
|
+ }
|
|
|
+ let option = {
|
|
|
+ legend: {
|
|
|
+ show:false,
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ confine: true,
|
|
|
+ trigger: 'item',
|
|
|
+ // formatter: '{b} : {c}'
|
|
|
+
|
|
|
+ formatter: params => {
|
|
|
+ console.log('params',params)
|
|
|
+ return `${params.data.nameText} 隐患:${params.data.value} 占比:${params.percent}%`
|
|
|
+ },
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ type: 'pie',
|
|
|
+ left:20,
|
|
|
+ right:20,
|
|
|
+ roseType: 'area', // 玫瑰图
|
|
|
+ center: ['50%', '50%'],
|
|
|
+ radius: ['0%', '40%'],
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ formatter: '{b}\n隐患{c}\t占比{d}%',
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 12,
|
|
|
+ color:'#333'
|
|
|
+ },
|
|
|
+ padding: [0, -110, 26, -110],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ length: 30,
|
|
|
+ length2: 110,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ color: function (colors) {
|
|
|
+ var colorList = ['#0183FA', '#A069FF', '#80C459', '#FFA200', '#39DBED', '#FF2A00', '#009DFF', '#41BE26', '#2758E0', '#FFE019', '#FF5E86'];
|
|
|
+ return colorList[colors.dataIndex];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ myChart.setOption(option);
|
|
|
+ });
|
|
|
+ },
|
|
|
compare (attr,rev) {
|
|
|
// console.log(attr, rev)
|
|
|
if(rev == undefined){
|