|
@@ -50,15 +50,17 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //校级
|
|
|
|
|
|
+ //院系
|
|
departmentEcharts(){
|
|
departmentEcharts(){
|
|
collegCheckHiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
collegCheckHiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
|
|
+ console.log('院系',response)
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
let data = {
|
|
let data = {
|
|
name:[],
|
|
name:[],
|
|
nameText:[],
|
|
nameText:[],
|
|
text:[],
|
|
text:[],
|
|
num: [],
|
|
num: [],
|
|
|
|
+ percent: [],
|
|
}
|
|
}
|
|
if(!response.rows[0]){
|
|
if(!response.rows[0]){
|
|
this.$set(this,'nullType',true);
|
|
this.$set(this,'nullType',true);
|
|
@@ -72,6 +74,7 @@
|
|
data.nameText.push(response.rows[i].subjectName)
|
|
data.nameText.push(response.rows[i].subjectName)
|
|
data.text.push(response.rows[i].hazardCheckName)
|
|
data.text.push(response.rows[i].hazardCheckName)
|
|
data.num.push(response.rows[i].sumTotal)
|
|
data.num.push(response.rows[i].sumTotal)
|
|
|
|
+ data.percent.push(response.rows[i].percent)
|
|
}
|
|
}
|
|
let option = {
|
|
let option = {
|
|
grid: {
|
|
grid: {
|
|
@@ -83,7 +86,7 @@
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
formatter: params => {
|
|
formatter: params => {
|
|
- return data.nameText[params[0].dataIndex] +' 隐患:'+ data.num[params[0].dataIndex]
|
|
|
|
|
|
+ return data.nameText[params[0].dataIndex] +' 隐患:'+ data.num[params[0].dataIndex]+' 占比:'+data.percent[params[0].dataIndex]
|
|
// return `${params.data.nameText} 隐患:${params.data.value} 占比:${params.percent}%`
|
|
// return `${params.data.nameText} 隐患:${params.data.value} 占比:${params.percent}%`
|
|
},
|
|
},
|
|
backgroundColor: 'rgba(0, 0, 0, 0.6)', // 提示框背景色
|
|
backgroundColor: 'rgba(0, 0, 0, 0.6)', // 提示框背景色
|
|
@@ -189,7 +192,7 @@
|
|
myChart.setOption(option);
|
|
myChart.setOption(option);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //院系
|
|
|
|
|
|
+ //校级
|
|
schoolEcharts(){
|
|
schoolEcharts(){
|
|
hiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
hiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
@@ -202,7 +205,6 @@
|
|
}
|
|
}
|
|
for(let i=0;i<response.rows.length;i++){
|
|
for(let i=0;i<response.rows.length;i++){
|
|
// substring
|
|
// substring
|
|
- console.log(response.rows[i].collegeName.length)
|
|
|
|
let obj = {
|
|
let obj = {
|
|
name:response.rows[i].collegeName.length>8?response.rows[i].collegeName.substring(0,8)+'..':response.rows[i].collegeName,
|
|
name:response.rows[i].collegeName.length>8?response.rows[i].collegeName.substring(0,8)+'..':response.rows[i].collegeName,
|
|
nameText:response.rows[i].collegeName,
|
|
nameText:response.rows[i].collegeName,
|