|
@@ -5,8 +5,8 @@
|
|
<p :class="hdLevel==2?'check-p':''" @click="titleButtonClick(2)">二级指标</p>
|
|
<p :class="hdLevel==2?'check-p':''" @click="titleButtonClick(2)">二级指标</p>
|
|
<p :class="hdLevel==3?'check-p':''" @click="titleButtonClick(3)">三级指标</p>
|
|
<p :class="hdLevel==3?'check-p':''" @click="titleButtonClick(3)">三级指标</p>
|
|
</div>
|
|
</div>
|
|
|
|
+ <p v-if="nullType" style="line-height:100px;text-align: center;color:#999;">暂无数据</p>
|
|
<div class="hiddenDangerStatisticsEcharts-box" id="hiddenDangerStatisticsEcharts-box">
|
|
<div class="hiddenDangerStatisticsEcharts-box" id="hiddenDangerStatisticsEcharts-box">
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -20,6 +20,7 @@
|
|
return{
|
|
return{
|
|
hdLevel:1,
|
|
hdLevel:1,
|
|
userFlg:true,
|
|
userFlg:true,
|
|
|
|
+ nullType:false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
@@ -49,6 +50,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //校级
|
|
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'));
|
|
@@ -117,6 +119,7 @@
|
|
myChart.setOption(option);
|
|
myChart.setOption(option);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //院系
|
|
departmentEcharts(){
|
|
departmentEcharts(){
|
|
collegCheckHiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
collegCheckHiddenCountByType({hdLevel:this.hdLevel}).then(response => {
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
let myChart = this.$echarts.init(document.getElementById('hiddenDangerStatisticsEcharts-box'));
|
|
@@ -126,6 +129,13 @@
|
|
text:[],
|
|
text:[],
|
|
num: [],
|
|
num: [],
|
|
}
|
|
}
|
|
|
|
+ if(!response.rows[0]){
|
|
|
|
+ this.$set(this,'nullType',true);
|
|
|
|
+ return
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this,'nullType',false);
|
|
|
|
+ }
|
|
|
|
+ response.rows.sort(this.compare('sumTotal', true))
|
|
for(let i=0;i<response.rows.length;i++){
|
|
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.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.nameText.push(response.rows[i].subjectName)
|
|
@@ -211,11 +221,7 @@
|
|
},
|
|
},
|
|
normal: {
|
|
normal: {
|
|
barBorderRadius: [0, 20, 20, 0],
|
|
barBorderRadius: [0, 20, 20, 0],
|
|
- color: new echarts.graphic.LinearGradient(
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- 1,
|
|
|
|
- 0,
|
|
|
|
|
|
+ color: new echarts.graphic.LinearGradient(0, 0, 1, 0,
|
|
[
|
|
[
|
|
{
|
|
{
|
|
offset: 0,
|
|
offset: 0,
|
|
@@ -251,6 +257,25 @@
|
|
myChart.setOption(option);
|
|
myChart.setOption(option);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ compare (attr,rev) {
|
|
|
|
+ // console.log(attr, rev)
|
|
|
|
+ if(rev == undefined){
|
|
|
|
+ rev = 1;
|
|
|
|
+ }else{
|
|
|
|
+ rev = (rev) ? 1 : -1;
|
|
|
|
+ }
|
|
|
|
+ return (a,b) => {
|
|
|
|
+ a = a[attr];
|
|
|
|
+ b = b[attr];
|
|
|
|
+ if(a < b){
|
|
|
|
+ return rev * -1;
|
|
|
|
+ }
|
|
|
|
+ if(a > b){
|
|
|
|
+ return rev * 1;
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|