|
@@ -13,7 +13,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import echarts from 'echarts'
|
|
import echarts from 'echarts'
|
|
- import { hiddenCountByType, collegCheckHiddenCountByType,isSCollege } from '@/apiDemo/safetyCheck/index'
|
|
|
|
|
|
+ import { hiddenCountByType, collegCheckHiddenCountByType,isSCollege } from '@/api/safetyCheck/index'
|
|
export default {
|
|
export default {
|
|
name: 'hiddenDangerStatisticsEcharts',
|
|
name: 'hiddenDangerStatisticsEcharts',
|
|
data(){
|
|
data(){
|
|
@@ -68,13 +68,13 @@
|
|
}else{
|
|
}else{
|
|
this.$set(this,'nullType',false);
|
|
this.$set(this,'nullType',false);
|
|
}
|
|
}
|
|
- response.rows.sort(this.compare('sumTotal', true))
|
|
|
|
- for(let i=0;i<response.rows.length;i++){
|
|
|
|
- data.name.push(response.rows[i].subjectName.length>8?response.rows[i].subjectName.substring(0,8)+'..':response.rows[i].subjectName)
|
|
|
|
- data.nameText.push(response.rows[i].subjectName)
|
|
|
|
- data.text.push(response.rows[i].hazardCheckName)
|
|
|
|
- data.num.push(response.rows[i].sumTotal)
|
|
|
|
- data.percent.push(response.rows[i].percent)
|
|
|
|
|
|
+ response.data.sort(this.compare('sumTotal', true))
|
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
|
|
+ data.name.push(response.data[i].subjectName.length>8?response.data[i].subjectName.substring(0,8)+'..':response.data[i].subjectName)
|
|
|
|
+ data.nameText.push(response.data[i].subjectName)
|
|
|
|
+ data.text.push(response.data[i].hazardCheckName)
|
|
|
|
+ data.num.push(response.data[i].sumTotal)
|
|
|
|
+ data.percent.push(response.data[i].percent)
|
|
}
|
|
}
|
|
let option = {
|
|
let option = {
|
|
grid: {
|
|
grid: {
|
|
@@ -197,18 +197,18 @@
|
|
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'));
|
|
let data = [];
|
|
let data = [];
|
|
- if(!response.rows[0]){
|
|
|
|
|
|
+ if(!response.data[0]){
|
|
this.$set(this,'nullType',true);
|
|
this.$set(this,'nullType',true);
|
|
return
|
|
return
|
|
}else{
|
|
}else{
|
|
this.$set(this,'nullType',false);
|
|
this.$set(this,'nullType',false);
|
|
}
|
|
}
|
|
- for(let i=0;i<response.rows.length;i++){
|
|
|
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
// substring
|
|
// substring
|
|
let obj = {
|
|
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,
|
|
|
|
|
|
+ name:response.data[i].collegeName.length>8?response.data[i].collegeName.substring(0,8)+'..':response.data[i].collegeName,
|
|
|
|
+ nameText:response.data[i].collegeName,
|
|
|
|
+ value:response.data[i].sumTotal,
|
|
}
|
|
}
|
|
data.push(obj);
|
|
data.push(obj);
|
|
}
|
|
}
|