diff --git a/src/views/standard/analysis/index.vue b/src/views/standard/analysis/index.vue index 6a06f39..3ed8e1b 100644 --- a/src/views/standard/analysis/index.vue +++ b/src/views/standard/analysis/index.vue @@ -59,10 +59,12 @@ 对比项{{ setBigNum(index) }}:
添加对比项 import barChart from "@/components/charts/barChart"; -import { formatDate, downloadFile } from "@/utils"; +import { formatDate } from "@/utils"; export default { components: { barChart, @@ -114,6 +116,7 @@ export default { endDay: "", day: "", secGraClaSub: [], + secGraClaSubName: [], }, props: { multiple: false, @@ -181,6 +184,33 @@ export default { this._QueryData(); }, methods: { + addQuery() { + this.query.secGraClaSub.push([]); + this.query.secGraClaSubName.push(""); + }, + filterObj(arr, value) { + return arr.filter((item) => { + return value == item.value; + })[0]; + }, + secGraClaSubChange(event, index) { + console.log(event) + let txt = ""; + let xx = this.filterObj(this.gradeList, event[0]); + txt += xx.label; + if (event.length > 1) { + let grade = this.filterObj(xx.children, event[1]); + txt += "/" + grade.label; + if (event.length > 2) { + let clazz = this.filterObj(grade.children, event[2]); + txt += "/" + clazz.label; + if (event.length > 3) { + txt += "/" + event[3]; + } + } + } + this.query.secGraClaSubName[index] = txt; + }, setBigNum(num) { let txt = ""; let bigNum = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十"]; @@ -238,16 +268,17 @@ export default { removeQuery(index) { let secGraClaSubLen = this.query.secGraClaSub.length; let xAxisLen = this.xAxis.length; + this.query.secGraClaSub.splice(index, 1); + this.query.secGraClaSubName.splice(index, 1); + this.xAxis.splice(index, 1); if ( secGraClaSubLen == xAxisLen || (secGraClaSubLen > xAxisLen && index < xAxisLen) ) { - this.xAxis.pop(); this.chartData[0].value.splice(index, 1); this.chartData[1].value.splice(index, 1); this.$refs.barChart.initData(this.xAxis, this.chartData); } - this.query.secGraClaSub.splice(index, 1); }, handleChangeTimeStart(val) { this.query.day = ""; @@ -287,6 +318,7 @@ export default { ); return; } + this.xAxis = [...this.query.secGraClaSubName]; this._QueryData(); }, setQuery() { @@ -296,7 +328,7 @@ export default { query.params = this.query.secGraClaSub.map((item) => { let jsons = {}; jsons.section = item[0]; - item.length > 1 ? (jsons.grade = item[1]) : ""; + item.length > 1 ? (jsons.clazz = item[1]) : ""; item.length > 2 ? (jsons.classId = item[2]) : ""; item.length == 4 ? (jsons.subjectName = item[3]) : ""; return jsons; @@ -327,9 +359,8 @@ export default { if (status === 0) { this.chartData[0].value = []; this.chartData[1].value = []; - this.xAxis = []; + this.xAxis = [...this.query.secGraClaSubName]; data?.list.map((item, index) => { - this.xAxis.push("对比项" + this.setBigNum(index)); this.chartData[0].value.push(item.periodCount); this.chartData[1].value.push(item.examCount); }); @@ -349,6 +380,7 @@ export default { if (status === 0) { if (!!data.list) { this.query.secGraClaSub = []; + this.query.secGraClaSubName = []; if (this.role != "ROLE_JITUAN") { this.gradeList = data.list?.map((item) => { @@ -382,8 +414,9 @@ export default { }; }); this.gradeList = this.schoolList.map((item) => { - if (this.query.secGraClaSub.length < 10) { + if (this.query.secGraClaSub.length < 6) { this.query.secGraClaSub.push([item.id]); + this.query.secGraClaSubName.push(item.schoolName); } return { value: item.id, @@ -404,6 +437,7 @@ export default { if (!!data.list) { if (this.role == "ROLE_XUEXIAO") { this.query.secGraClaSub = []; + this.query.secGraClaSubName = []; data.list?.map((item) => { let subList = item.subjectNames?.map((items) => { return { @@ -428,9 +462,12 @@ export default { }); }) || []; this.gradeList.map((sec) => { - sec.gradeIds.map((items) => { - if (this.query.secGraClaSub.length < 10) { - this.query.secGraClaSub.push([sec.value, items]); + sec.children.map((items) => { + if (this.query.secGraClaSub.length < 6) { + this.query.secGraClaSub.push([sec.value, items.value]); + this.query.secGraClaSubName.push( + `${sec.label}/${items.label}` + ); } }); }); @@ -553,6 +590,6 @@ div::-webkit-scrollbar-thumb { } } .chart-box { - height: 600px; + height: 400px; } \ No newline at end of file diff --git a/src/views/standard/setUp/clazz.vue b/src/views/standard/setUp/clazz.vue index 738b8c1..0335830 100644 --- a/src/views/standard/setUp/clazz.vue +++ b/src/views/standard/setUp/clazz.vue @@ -66,12 +66,12 @@ >
  • -

    + +

    {{ clazz.className }} -

    学生:{{ clazz.studentCount }}个

    @@ -566,11 +566,17 @@ export default { } .clazz-item { - min-width: 100px; - box-sizing: border-box; + width: 96px; padding: 14px 18px 14px 14px; border-radius: 10px; box-shadow: 1px 1px 3px #888; + box-sizing: content-box; + position: relative; + } + .el-icon-edit { + position: absolute; + right: 5px; + top: 5px; } .clazz-name { font-size: 16px; @@ -578,11 +584,6 @@ export default { line-height: 18px; padding-bottom: 6px; position: relative; - .el-icon-edit { - position: absolute; - right: -16px; - top: -10px; - } } .clazz-class { // display: flex; diff --git a/src/views/standard/setUp/teacher.vue b/src/views/standard/setUp/teacher.vue index cdd4c2d..aa16912 100644 --- a/src/views/standard/setUp/teacher.vue +++ b/src/views/standard/setUp/teacher.vue @@ -61,8 +61,8 @@ placeholder="选择类型" > - - + +
    - + 取 消
  • - items.value == item.classId[0]) - ?.label || "", - subjectName: item.classId[1], + item.classId.map((clazz) => { + teacherCourseList.push({ + classId: clazz[2], + className: + this.classList.find((items) => items.value == clazz[2]) + ?.label || "", + subjectName: clazz[1], + }); }); } else { gradeGroupList.push({ @@ -645,20 +654,25 @@ export default { ], }); }); + let teacherClassId = []; this.formTeacher.teacherCourseList?.map((item) => { + teacherClassId.push([ + item.grade, + item.subjectName, + this.classList.find( + (items) => + items.value == item.classId || + items.label.includes(item.className) + ).value, + ]); + }); + if (teacherClassId.length) { this.formTeacher.roleList.push({ id: randomWord(true, 16, 20), roleId: 7, - classId: [ - this.classList.find( - (items) => - items.value == item.classId || - items.label.includes(item.className) - ).value, - item.subjectName, - ], + classId: [...teacherClassId], }); - }); + } this.formTeacher.gradeGroupList?.map((item) => { this.formTeacher.roleList.push({ id: randomWord(true, 16, 20), @@ -865,6 +879,23 @@ export default { }; }), }); + this.gradeSubListClass.push({ + value: item.grade, + label: item.gradeName, + id: item.grade, + children: item.subjectNames.map((items) => { + return { + value: items, + label: items, + children: item.classList.map((clazz) => { + return { + value: clazz.id, + label: clazz.className, + }; + }), + }; + }), + }); return { value: item.grade, label: item.gradeName,