From b8827a72eba2f703cd243dbfb8956b8d6c14ef3d Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Wed, 31 May 2023 14:30:51 +0800 Subject: [PATCH] 测试bug --- src/components/charts/barChart.vue | 2 +- src/views/standard/analysis/index.vue | 25 ++++++++++--------------- src/views/standard/device/error.vue | 1 + src/views/standard/down/client.vue | 2 +- src/views/standard/down/index.vue | 2 +- src/views/standard/setUp/archived.vue | 4 +--- src/views/standard/setUp/clazz.vue | 7 +++---- src/views/standard/setUp/student.vue | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------ src/views/standard/setUp/teacher.vue | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++--------- 9 files changed, 125 insertions(+), 64 deletions(-) diff --git a/src/components/charts/barChart.vue b/src/components/charts/barChart.vue index 15e8068..b37e7be 100644 --- a/src/components/charts/barChart.vue +++ b/src/components/charts/barChart.vue @@ -50,7 +50,7 @@ export default { right: "6", top: "10", feature: { - magicType: { show: true, type: ["line", "bar", "stack"] }, + magicType: { show: true, type: ["line", "bar"] }, saveAsImage: { show: true }, }, }, diff --git a/src/views/standard/analysis/index.vue b/src/views/standard/analysis/index.vue index afa50a7..e6ebbbe 100644 --- a/src/views/standard/analysis/index.vue +++ b/src/views/standard/analysis/index.vue @@ -119,20 +119,7 @@ export default { multiple: false, checkStrictly: true, }, - params: [ - { - index: 1, - sections: "小学", - grades: "二年级", - classIds: "2班", - subjectNames: "语文", - }, - { - index: 2, - sections: "小学", - grades: "二年级", - }, - ], + params: [], gradeList: [], chartData: [ { @@ -185,12 +172,13 @@ export default { if (this.role == "ROLE_XUEXIAO") { await this._QueryClassList(); } - let startDay = this.query?.startDay; if (!startDay) { this.query.startDay = formatDate(new Date(), "yyyy-MM-dd"); this.query.endDay = formatDate(new Date(), "yyyy-MM-dd"); } + this.setDate(4) + this._QueryData(); }, methods: { setBigNum(num) { @@ -353,12 +341,16 @@ export default { const { data, status, info } = await gradeList(); if (status === 0) { if (!!data.list) { + this.query.secGraClaSub = []; if (this.role != "ROLE_JITUAN") { this.gradeList = data.list?.map((item) => { let gradeIds = []; let children = item.gradeList.map((items) => { gradeIds.push(items.grade); + if (this.query.secGraClaSub.length < 10) { + this.query.secGraClaSub.push([item.section, items.grade]); + } return { value: items.grade, label: items.gradeName, @@ -386,6 +378,9 @@ export default { }; }); this.gradeList = this.schoolList.map((item) => { + if (this.query.secGraClaSub.length < 10) { + this.query.secGraClaSub.push([item.id]); + } return { value: item.id, label: item.schoolName, diff --git a/src/views/standard/device/error.vue b/src/views/standard/device/error.vue index 93e1093..cde51c6 100644 --- a/src/views/standard/device/error.vue +++ b/src/views/standard/device/error.vue @@ -62,6 +62,7 @@ width="200" > 授课端下载 -
+

配合发卡器硬件,方便学校管理员进行发卡补卡操作的软件。

diff --git a/src/views/standard/setUp/archived.vue b/src/views/standard/setUp/archived.vue index 249602a..bbf8392 100644 --- a/src/views/standard/setUp/archived.vue +++ b/src/views/standard/setUp/archived.vue @@ -29,8 +29,6 @@ :value="item.value" > - -
@@ -154,7 +152,7 @@ export default { loading: false, loadingClass: false, loadingDown: false, - step: 1, + step: 0, grade: "", gradeList: [], classIds: [], diff --git a/src/views/standard/setUp/clazz.vue b/src/views/standard/setUp/clazz.vue index 03b3178..88bd813 100644 --- a/src/views/standard/setUp/clazz.vue +++ b/src/views/standard/setUp/clazz.vue @@ -77,7 +77,6 @@
- - + + + + +
-
+
班级列表
-
+

共筛选出{{ studentList.length }}名学生。

-
+

基站SN:{{ clazzDetail.stationSn }}

配对码:{{ clazzDetail.pairingCode }}

频点:{{ clazzDetail.frequency }}

- -
    +
    • {{ formClassTrack.studentName }} + {{ formClassTrack.className }} + +

      - {{ `${item.gradeName}-${item.className}(${item.createdTime})` }} + {{ `${item.gradeName}-${item.className}:${item.createdTime}` }}

      @@ -300,12 +310,14 @@ export default { diaChangeClassTrack: false, formClassTrack: { studentName: "", + className: "", classList: [], }, clazzDetail: { stationSn: "", pairingCode: "", frequency: "" }, query: { grade: "", classId: "", + status: 0, studentCode: "", studentName: "", }, @@ -387,7 +399,6 @@ export default { this.clazzDetail.frequency = obj.frequency; this.query.classId = obj.id; this.formStu.className = obj.className; - this.formStuCla.className = obj.className; this._QueryData(3); }, @@ -431,7 +442,6 @@ export default { if (status === 0) { this.$message.success(info); this.diaStu = false; - this._QueryClass(); this._QueryData(); } else { this.$message.error(info); @@ -449,6 +459,7 @@ export default { //学生调班弹窗 openChangeClazz(obj) { this.formStuCla.studentId = obj.id; + this.formStuCla.className = obj.className this.formStuCla.studentName = obj.studentName; this.formStuCla.studentCode = obj.studentCode; this.formStuCla.classId = obj.classId; @@ -470,7 +481,6 @@ export default { if (status == 0) { this.diaChangeClass = false; this.$message.success(info); - this._QueryClass(); this._QueryData(); } else { this.$message.error(info); @@ -492,6 +502,7 @@ export default { }); this.loadingClassLogs = false; if (status == 0) { + this.formClassTrack.className = obj.className; this.formClassTrack.studentName = obj.studentName; this.formClassTrack.classList = (data.list && [...data.list]) || []; } else { @@ -505,7 +516,7 @@ export default { if (status === 0) { this.$message.success("删除成功"); this.studentList.splice(index, 1); - this._QueryClass(); + this._QueryData(); } else { this.$message.error(info); } @@ -515,10 +526,12 @@ export default { this.query.classId = ""; this.query.studentName = ""; this.query.studentCode = ""; + this.classList = []; + this.studentList = []; await this._QueryClass(val); this._QueryData(3); }, - async _QueryData(type) { + serQuery(type) { let query = {}; if (type == 1) { if (!this.query.studentName) { @@ -526,35 +539,47 @@ export default { return; } this.query.classId = ""; + query.status = this.query.status; query.studentName = this.query.studentName; this.query.studentCode = ""; this.query.grade = ""; } else if (type == 2) { - if (!this.query.studentName) { + if (!this.query.studentCode) { this.$message.warning("输入学生学号~"); return; } this.query.classId = ""; + query.status = this.query.status; query.studentCode = this.query.studentCode; this.query.studentName = ""; this.query.grade = ""; } else if (type == 3) { this.query.studentName = ""; this.query.studentCode = ""; + this.query.status = 0; query.grade = this.query.grade; query.classId = this.query.classId; + } else if (type == 4) { + this.clazzDetail.stationSn = ""; + if (this.query.status) { + this.query.grade = ""; + this.query.classId = ""; + } else { + this.query.studentName = ""; + this.query.studentCode = ""; + this.query.grade = this.gradeList[0]?.value; + this.query.classId = this.classList[0]?.id; + query.grade = this.query.grade; + query.classId = this.query.classId; + } + query.status = this.query.status; } else { query = this.query; } - if (query.grade == 80) { - query.status = 1; - delete query.grade; - } else if (query.grade == 81) { - query.status = 2; - delete query.grade; - } else { - query.status = 0; - } + return query; + }, + async _QueryData(type) { + let query = this.serQuery(type); this.loading = true; const { data, status, info } = await this.$request.studentList({ ...query, @@ -562,7 +587,7 @@ export default { this.loading = false; console.log(status); if (status === 0) { - this.studentList = data.list || []; + this.studentList = (data.list && [...data?.list]) || []; } else { this.$message.error(info); } @@ -583,14 +608,14 @@ export default { } }, async _QueryClass(value) { + this.loading = true; const { data, status, info } = await this.$request.schoolClassList({ grade: value || this.query.grade, }); if (status === 0) { - this.classList = [...data.list] || []; + this.classList = (data.list && [...data?.list]) || []; this.query.classId = this.classList[0]?.id; this.formStu.className = this.classList[0]?.className; - this.formStuCla.className = this.classList[0]?.className; this.clazzDetail.stationSn = this.classList[0]?.stationSn; this.clazzDetail.pairingCode = this.classList[0]?.pairingCode; this.clazzDetail.frequency = this.classList[0]?.frequency; @@ -702,7 +727,8 @@ export default { .stu-detail { flex: 1; border-left: 0.5px solid #eee; - &-tit{ + min-height: 200px; + &-tit { display: flex; justify-content: space-between; } diff --git a/src/views/standard/setUp/teacher.vue b/src/views/standard/setUp/teacher.vue index 3e7774f..1106931 100644 --- a/src/views/standard/setUp/teacher.vue +++ b/src/views/standard/setUp/teacher.vue @@ -54,7 +54,13 @@ collapse-tags :show-all-levels="false" > - + + @@ -109,7 +115,7 @@ :class="showTId == item.id ? 'active' : ''" @click="showTeacher(item)" > - {{ item.realName }}({{ setClass(item) }}) + {{ item.realName }}
@@ -452,9 +458,9 @@ export default { }, async created() { this.code = localStorage.getItem("csCode") || ""; + this._QueryData(4); await this._QuerySubject(); await this._QueryDataGrade(); - this._QueryData(1); this._RoleList(); await this._QueryClass(); }, @@ -702,12 +708,44 @@ export default { }, setQuery(type) { let query = {}; + if (type == 1) { + query.grades = []; + query.classIds = []; + query.subjectNames = []; + this.query.gradeClassSub?.map((item) => { + if (item.length == 1) { + if (!query.grades.includes(item[0])) { + query.grades.push(item[0]); + } + } else if (item.length == 2) { + if (!query.classIds.includes(item[1])) { + query.classIds.push(item[1]); + } + query.grades.includes(item[0]) && query.grades.remove(item[0]); + } else if (item.length == 3) { + if (!query.subjectNames.includes(item[2])) { + query.subjectNames.push(item[2]); + } + query.grades.includes(item[0]) && query.grades.remove(item[0]); + query.classIds.includes(item[0]) && query.classIds.remove(item[0]); + } + }); + + delete query.gradeClassSub; + query.grades.length ? "" : delete query.grades; + query.classIds.length ? "" : delete query.classIds; + query.subjectNames.length ? "" : delete query.subjectNames; + this.query.teacherName = ""; + this.query.phone = ""; + this.query.type = ""; + } if (type == 2) { if (this.query.teacherName == "") { this.$message.warning("请输入老师姓名"); return; } query.teacherName = this.query.teacherName; + this.query.type = ""; this.query.phone = ""; this.query.gradeClassSub = []; } else if (type == 3) { @@ -715,9 +753,15 @@ export default { this.$message.warning("请输入老师手机"); return; } + this.query.type = ""; query.phone = this.query.phone; this.query.teacherName = ""; this.query.gradeClassSub = []; + } else if (type == 4) { + this.query.teacherName = ""; + this.query.phone = ""; + this.query.gradeClassSub = []; + query.type = this.query.type; } else { query = { ...this.query }; query.grades = []; @@ -732,14 +776,12 @@ export default { if (!query.classIds.includes(item[1])) { query.classIds.push(item[1]); } - query.grades.includes(item[0]) && - query.grades.remove(item[0]); + query.grades.includes(item[0]) && query.grades.remove(item[0]); } else if (item.length == 3) { if (!query.subjectNames.includes(item[2])) { query.subjectNames.push(item[2]); } - query.grades.includes(item[0]) && - query.grades.remove(item[0]); + query.grades.includes(item[0]) && query.grades.remove(item[0]); query.classIds.includes(item[0]) && query.classIds.remove(item[0]); } }); @@ -757,7 +799,7 @@ export default { async _QueryData(type) { if (this.loading) return; this.loading = true; - let query = this.setQuery(); + let query = this.setQuery(type); this.teacherList = []; const { data, status, info } = await this.$request.teacherList({ ...query, @@ -830,7 +872,7 @@ export default { if (status === 0) { let gradeSubList = {}; this.gradeList.map((item) => { - gradeSubList[item.value] = [...item.children]; + gradeSubList[item.label] = [...item.children]; }); this.classList = data.list.map((item) => { -- libgit2 0.21.4