diff --git a/src/views/screenAdaptation/pages/monitorCenter/schoolDaily/teacherStudents/teacherInfo.vue b/src/views/screenAdaptation/pages/monitorCenter/schoolDaily/teacherStudents/teacherInfo.vue index dd203ff..0d24ac9 100644 --- a/src/views/screenAdaptation/pages/monitorCenter/schoolDaily/teacherStudents/teacherInfo.vue +++ b/src/views/screenAdaptation/pages/monitorCenter/schoolDaily/teacherStudents/teacherInfo.vue @@ -22,55 +22,16 @@ - -
{{'小学部 / ' + 500}}
+ +
{{item.stage_name + ' / ' + item.total}}
- {{'男/' + 10}} + {{'男/' + item.nan_total}} - {{'女/' + 10}} - -
- -
{{'初中部 / ' + 500}}
- - {{'男/' + 10}} - - {{'女/' + 10}} - -
- -
{{'高中部 / ' + 500}}
- - {{'男/' + 10}} - - {{'女/' + 10}} + {{'女/' + item.nv_total}}
- - - - - - - - - - - - - - - - - - - - - - - -
@@ -79,11 +40,6 @@ {{ item.value }} - - - - -
@@ -108,53 +64,45 @@ middleSchoolDept: 0, highSchoolDept: 0, otherDept: 0, + teacherGenderData: [], stageList: [{id: 1, value: '小学部'}, {id: 2, value: '初中部'}, {id: 3, value: '高中部'}], stageId: 1, - // gradeList: [{id: 1, value: '一年级'}, {id: 2, value: '二年级'}, {id: 3, value: '三年级'}, { - // id: 4, - // value: '四年级' - // }, {id: 5, value: '五年级'}, {id: 6, value: '六年级'}], gradeId: 1, columns: [ { title: '学科', - dataIndex: 'dep', - key: 'dep', + dataIndex: 'subject_name', + key: 'subject_name', align: "center", }, { title: '教师总数', - dataIndex: 'teacherNum', - key: 'teacherNum', + dataIndex: 'total', + key: 'total', align: "center", }, { title: '男教师数', - dataIndex: 'nanTeacherNum', - key: 'nanTeacherNum', + dataIndex: 'nan_total', + key: 'nan_total', align: "center", }, { title: '女教师数', - dataIndex: 'nvTeacherNum', - key: 'nvTeacherNum', + dataIndex: 'nv_total', + key: 'nv_total', align: "center", }, ], - tableData: [ - {dep: "语文组", teacherNum: 8, nanTeacherNum: 8, nvTeacherNum: 9}, - {dep: "英语组", teacherNum: 10, nanTeacherNum: 8, nvTeacherNum: 9}, - {dep: "数学组", teacherNum: 12, nanTeacherNum: 8, nvTeacherNum: 9}, - {dep: "美术组", teacherNum: 4, nanTeacherNum: 8, nvTeacherNum: 9}, - {dep: "音乐组", teacherNum: 6, nanTeacherNum: 8, nvTeacherNum: 9}, - ] + tableData: [] } }, mounted() { this.getTeacherOverview() - // this.getGenderInfo() + this.getGenderInfo() + this.getTeacherTableData() }, methods: { - //教师概览教师总数-数据 + //教师概览-教师总数-数据 getTeacherOverview: function () { let param = { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", @@ -175,7 +123,7 @@ }], (result) => { if (result[0].data.success) { let res = result[0].data.result; - console.log('师生概览-教师人数数据', JSON.parse(res)) + //console.log('师生概览-教师人数数据', JSON.parse(res)) if (res !== "") { let dataList = JSON.parse(res); if (dataList && dataList.length > 0) { @@ -184,16 +132,16 @@ this.otherTeacherNum = dataList[0].rkjs_total; } } - this.getTeacherOverviewDept() + //this.getTeacherOverviewDept() } }) }, - //获取教师概览男女比例 - getGenderInfo: function () { + //教师概览-按学部-男女教师比例 + getGenderInfo() { let param = { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { - "query_id": "query_jiaoshi_gailan3", + "query_id": "query_jiaoshi_gailan2", "query_param": [ this.BaseConfig.person_info_my.bureau_id + "" ] @@ -207,26 +155,36 @@ params: param, method: "post", }], (result) => { - console.log('男女教师性别比例', result) if (result[0].data.success) { - let res = result[0].data.result; + let res = JSON.parse(result[0].data.result); + //console.log('教师概览-按学部-男女教师比例', res) if (res !== "") { - let dataList = JSON.parse(res); - if (dataList && dataList.length > 0) { - - } + this.teacherGenderData = res } } }) }, - //获取小学部初中部--教师人数 - getTeacherOverviewDept: function () { + //教师概览-教师-按学部-表格数据 + getTeacherTableData() { + let stageName = ""; + switch (this.stageId) { + case 1: + stageName = '小学部' + break; + case 2: + stageName = '初中部' + break; + case 3: + stageName = '高中部' + break; + } let param = { "access_token": "system_01##20200102030405##a6ce11eab94df48a6ce11eab", "query": { - "query_id": "query_jiaoshi_gailan2", + "query_id": "query_jiaoshi_duiwu", "query_param": [ - this.BaseConfig.person_info_my.bureau_id + "" + this.BaseConfig.person_info_my.bureau_id + "", + stageName + "" ] }, "query_cache": 0, @@ -240,37 +198,20 @@ }], (result) => { if (result[0].data.success) { let res = result[0].data.result; - //console.log('获取学部信息教师人数', JSON.parse(res)) if (res !== "") { let dataList = JSON.parse(res); - dataList.forEach(item => { - if (item.stage_name === '小学部') { - this.smallSchoolDept = item.total - } else if (item.stage_name === '初中部') { - this.middleSchoolDept = item.total - } else if (item.stage_name === '高中部') { - this.highSchoolDept = item.total - } - }) - this.getOtherDeptNum() + this.tableData = dataList + //console.log('教师表格数据', dataList) } } }) }, - // 计算其他部门教师人数 - getOtherDeptNum() { - this.otherDept = this.teacherTotalNum - this.smallSchoolDept - this.middleSchoolDept - this.highSchoolDept - }, stageChange: function (stageId) { if (this.stageId !== stageId) { this.stageId = stageId; } + this.getTeacherTableData() }, - // gradeChange: function (gradeId) { - // if (this.gradeId !== gradeId) { - // this.gradeId = gradeId; - // } - // }, getCustomRow: function () { let obj = {style: {}}; obj['style']['color'] = '#00ffff';