|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
<!--选科统计-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="chooseStatisticsSmall">
|
|
|
|
|
<a-tabs default-active-key="1" @change="callback">
|
|
|
|
|
<div v-if="this.BaseConfig.person_info_my.cur_role.role_id.toString()!=='174'">
|
|
|
|
|
<a-tabs default-active-key="1" @change="callback">
|
|
|
|
|
<a-tab-pane key="1" tab="单科情况">
|
|
|
|
|
<div class="titleStyle">各年级选科情况一览表</div>
|
|
|
|
|
<div class="content1">
|
|
|
|
@ -32,25 +33,61 @@
|
|
|
|
|
></bar-echarts>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<div style="width:100%;overflow: hidden">
|
|
|
|
|
<a-select style="width:8rem;float: right;margin-top:1rem;" v-if="classFlag" value-key="item.CLASS_ID" :default-value=this.classList[0].CLASS_ID
|
|
|
|
|
@change="handleSelectClass">
|
|
|
|
|
<a-select-option v-for="item in this.classList" :key="item.CLASS_ID" :value="item.CLASS_ID" >
|
|
|
|
|
{{ item.CLASS_NAME }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</div>
|
|
|
|
|
<a-spin :spinning="is_loading_formData" >
|
|
|
|
|
<div v-if="this.classList[0].CLASS_ID!==''&& this.subjectPieData.e.length!==0">
|
|
|
|
|
<div style="margin: 1rem 0">
|
|
|
|
|
<div class="titleStyle">班级选科分布一览表</div>
|
|
|
|
|
<div class="content1">
|
|
|
|
|
<m-echarts
|
|
|
|
|
v-if="pieFlag"
|
|
|
|
|
:echartStyle="subjectPieData.style"
|
|
|
|
|
:opinion="subjectPieData.c"
|
|
|
|
|
:opinionData="subjectPieData.e"
|
|
|
|
|
v-on:currentEchartData="getStudentApplyCount('1')"
|
|
|
|
|
></m-echarts>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else style="margin-top: 5rem;text-align: center">暂无数据</div>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {Tabs} from 'ant-design-vue';
|
|
|
|
|
import { Tabs,Select,Spin } from 'ant-design-vue'
|
|
|
|
|
import barEcharts from './utils/BarEcharts';
|
|
|
|
|
import mEcharts from './utils/PieEcharts'
|
|
|
|
|
import InterfaceConfig from './utils/interfaceConfig';
|
|
|
|
|
export default {
|
|
|
|
|
name: "chooseStatisticsSmall",
|
|
|
|
|
components: {
|
|
|
|
|
ATabs: Tabs,
|
|
|
|
|
ASpin:Spin,
|
|
|
|
|
ATabPane: Tabs.TabPane,
|
|
|
|
|
barEcharts
|
|
|
|
|
ASelect:Select,
|
|
|
|
|
ASelectOption:Select.Option,
|
|
|
|
|
barEcharts,
|
|
|
|
|
mEcharts
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
data:function() {
|
|
|
|
|
return {
|
|
|
|
|
lineFlag:false,
|
|
|
|
|
barFlag:false,
|
|
|
|
|
pieFlag:false,
|
|
|
|
|
classFlag:false,
|
|
|
|
|
is_loading_formData:true,
|
|
|
|
|
type:1,
|
|
|
|
|
singleSubject:{
|
|
|
|
|
xAxisData:[],
|
|
|
|
@ -73,7 +110,16 @@
|
|
|
|
|
seriesData:[],
|
|
|
|
|
xAxisName:"志愿组合",
|
|
|
|
|
yAxisName:"人数"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
classList:[{CLASS_NAME:'暂无数据',CLASS_ID:''}],
|
|
|
|
|
class_id:'',
|
|
|
|
|
subjectPieData:{
|
|
|
|
|
style:{
|
|
|
|
|
height:''
|
|
|
|
|
},
|
|
|
|
|
c: [],
|
|
|
|
|
e: [],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
@ -81,11 +127,21 @@
|
|
|
|
|
// 获取屏幕高度
|
|
|
|
|
this.singleSubject.style.height = '370px';
|
|
|
|
|
this.volunteerCombination.style.height = '370px';
|
|
|
|
|
this.subjectPieData.style.height = '370px';
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.getStudentApplyCount();
|
|
|
|
|
if(this.BaseConfig.person_info_my.cur_role.role_id.toString()!=='174'){
|
|
|
|
|
this.getStudentApplyCount();
|
|
|
|
|
}else {
|
|
|
|
|
this.getCurrentTerm();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleSelectClass(key){
|
|
|
|
|
this.class_id=key;
|
|
|
|
|
this.getStudentApplyCount('1');
|
|
|
|
|
},
|
|
|
|
|
callback(key) {
|
|
|
|
|
this.type=key;
|
|
|
|
|
if(key==="1"){
|
|
|
|
@ -96,10 +152,64 @@
|
|
|
|
|
this.getStudentThreeApplyCount();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getStudentApplyCount:function () {
|
|
|
|
|
getCurrentTerm:function () {
|
|
|
|
|
let params={};
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url:InterfaceConfig.getCurrentTerm.url,
|
|
|
|
|
params:params,
|
|
|
|
|
method:InterfaceConfig.getCurrentTerm.method,
|
|
|
|
|
isTestLogin:InterfaceConfig.getCurrentTerm.isTestLogin,
|
|
|
|
|
isOfficeInterface:false
|
|
|
|
|
}],(result)=> {
|
|
|
|
|
if(result[0].data.success){
|
|
|
|
|
this.getTeachPlanByTeacherId(result[0].data.XQ_ID);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getTeachPlanByTeacherId:function (id) {
|
|
|
|
|
let params={
|
|
|
|
|
bureauId:this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
teacher_id:this.BaseConfig.userInfo.person_id,
|
|
|
|
|
xq_id:id,
|
|
|
|
|
// xq_id:14,
|
|
|
|
|
pageNumber:1,
|
|
|
|
|
pageSize:100
|
|
|
|
|
};
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url:InterfaceConfig.getTeachPlanByTeacherId.url,
|
|
|
|
|
params:params,
|
|
|
|
|
method:InterfaceConfig.getTeachPlanByTeacherId.method,
|
|
|
|
|
isTestLogin:InterfaceConfig.getTeachPlanByTeacherId.isTestLogin,
|
|
|
|
|
isOfficeInterface:false
|
|
|
|
|
}],(result)=> {
|
|
|
|
|
if(result[0].data.success){
|
|
|
|
|
this.classFlag=true;
|
|
|
|
|
let dom=[];
|
|
|
|
|
if(result[0].data.table_List.length!==0){
|
|
|
|
|
result[0].data.table_List.forEach((item)=>{
|
|
|
|
|
dom.push({CLASS_NAME:item.CLASS_NAME,CLASS_ID:item.CLASS_ID})
|
|
|
|
|
});
|
|
|
|
|
this.classList=dom;
|
|
|
|
|
this.class_id=this.classList[0].CLASS_ID;
|
|
|
|
|
this.getStudentApplyCount('1');
|
|
|
|
|
}else {
|
|
|
|
|
this.classList=[{CLASS_NAME:'暂无数据',CLASS_ID:''}]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getStudentApplyCount:function (type) {
|
|
|
|
|
let params={};
|
|
|
|
|
if(type!=='1'){
|
|
|
|
|
params={
|
|
|
|
|
bureauId:this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
params={
|
|
|
|
|
bureauId:this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
classId:this.class_id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url:InterfaceConfig.getStudentApplyCount.url,
|
|
|
|
|
params:params,
|
|
|
|
@ -108,29 +218,73 @@
|
|
|
|
|
isOfficeInterface:false
|
|
|
|
|
}],(result)=> {
|
|
|
|
|
if(result[0].data.success){
|
|
|
|
|
this.lineFlag = true;
|
|
|
|
|
let data=result[0].data;
|
|
|
|
|
let yName=[];
|
|
|
|
|
let series=[];
|
|
|
|
|
let legendData=[];
|
|
|
|
|
if(data.returnList.length!==0){
|
|
|
|
|
data.returnList.forEach((item)=>{
|
|
|
|
|
yName.push(item.year);
|
|
|
|
|
legendData.push(item.year);
|
|
|
|
|
let count=[];
|
|
|
|
|
let xName=[];
|
|
|
|
|
item.xaxis.forEach((itemIn)=>{
|
|
|
|
|
xName.push(itemIn.course_name);
|
|
|
|
|
count.push(itemIn.count);
|
|
|
|
|
this.singleSubject.xAxisData=xName;
|
|
|
|
|
if(type!=='1'){
|
|
|
|
|
this.lineFlag = true;
|
|
|
|
|
let data=result[0].data;
|
|
|
|
|
let yName=[];
|
|
|
|
|
let series=[];
|
|
|
|
|
let legendData=[];
|
|
|
|
|
let physical=[];
|
|
|
|
|
let chemistry=[];
|
|
|
|
|
let biology=[];
|
|
|
|
|
let political=[];
|
|
|
|
|
let history=[];
|
|
|
|
|
let geography=[];
|
|
|
|
|
let imgArr=[Physical,Chemistry,Biology,Political,History,Geography];
|
|
|
|
|
if(data.returnList.length!==0){
|
|
|
|
|
data.returnList.forEach((item)=>{
|
|
|
|
|
yName.push(item.year);
|
|
|
|
|
legendData.push(item.year);
|
|
|
|
|
let count=[];
|
|
|
|
|
let xName=[];
|
|
|
|
|
let list=[];
|
|
|
|
|
item.xaxis.forEach((itemIn,index)=>{
|
|
|
|
|
xName.push(itemIn.course_name);
|
|
|
|
|
count.push(itemIn.count);
|
|
|
|
|
if(index===0){
|
|
|
|
|
physical.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
if(index===1){
|
|
|
|
|
chemistry.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
if(index===2){
|
|
|
|
|
biology.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
if(index===3){
|
|
|
|
|
political.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
if(index===4){
|
|
|
|
|
history.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
if(index===5){
|
|
|
|
|
geography.push(itemIn.count);
|
|
|
|
|
}
|
|
|
|
|
list.push({name:itemIn.course_name,value:index,src:imgArr[index],count:index===0?physical.toString():index===1?chemistry.toString():index===2?biology.toString():index===3?political.toString():index===4?history.toString():geography.toString()});
|
|
|
|
|
this.singleSubject.xAxisData=xName;
|
|
|
|
|
this.singleSubject.list=list;
|
|
|
|
|
});
|
|
|
|
|
series.push({name:item.year,type:"line",data:count});
|
|
|
|
|
});
|
|
|
|
|
series.push({name:item.year,type:"line",data:count});
|
|
|
|
|
});
|
|
|
|
|
this.singleSubject.legendData=legendData;
|
|
|
|
|
this.singleSubject.seriesData=series;
|
|
|
|
|
|
|
|
|
|
this.singleSubject.legendData=legendData;
|
|
|
|
|
this.singleSubject.seriesData=series;
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
console.log('111111')
|
|
|
|
|
this.pieFlag=true;
|
|
|
|
|
this.is_loading_formData=false;
|
|
|
|
|
if(result[0].data.returnList.length!==0){
|
|
|
|
|
let nameList=[];
|
|
|
|
|
let data=[];
|
|
|
|
|
result[0].data.returnList[0].xaxis.forEach((item,index)=>{
|
|
|
|
|
nameList.push(item.course_name);
|
|
|
|
|
data.push({value:item.count,name:item.course_name});
|
|
|
|
|
});
|
|
|
|
|
this.subjectPieData.e=data;
|
|
|
|
|
this.subjectPieData.c=nameList;
|
|
|
|
|
}else {
|
|
|
|
|
this.subjectPieData.e=[];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|