From dd5150c54ca378ceea77984dea0b5259c8eb13f5 Mon Sep 17 00:00:00 2001 From: 阿宝 Date: Mon, 19 Dec 2022 12:35:48 +0800 Subject: [PATCH] 数据同步 --- src/components/setAnswer.vue | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------- src/store/index.js | 5 ----- src/views/dataSync/index.vue | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- src/views/device/index.vue | 4 ++-- src/views/login/index.vue | 6 ++++-- src/views/setUp/school.vue | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- src/views/setUp/student.vue | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------ src/views/setUp/teacher.vue | 47 ++++++++++++++++++++++++++++++++++++++++++++--- src/views/test/index.vue | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 582 insertions(+), 106 deletions(-) diff --git a/src/components/setAnswer.vue b/src/components/setAnswer.vue index bdea248..806c32a 100644 --- a/src/components/setAnswer.vue +++ b/src/components/setAnswer.vue @@ -1,63 +1,67 @@ \ No newline at end of file diff --git a/src/views/device/index.vue b/src/views/device/index.vue index ebd6756..9372cb3 100644 --- a/src/views/device/index.vue +++ b/src/views/device/index.vue @@ -606,7 +606,7 @@ export default { if (this.loadingUpDate) return; this.loadingUpDate = true; let data = await this.$request.modifyUpgradeFlag({ - deviceId: id ? id : this.selectionTabIds, + deviceIds: id ? [id] : this.selectionTabIds, upgradeFlag: 1, }); this.loadingUpDate = false; @@ -625,7 +625,7 @@ export default { if (this.loadingUpDate) return; this.loadingUpDate = true; let data = await this.$request.modifyUpgradeFlag({ - deviceId: id ? id : this.selectionTabIds, + deviceIds: id ? [id] : this.selectionTabIds, upgradeFlag: 0, }); this.loadingUpDate = false; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 17ae6c8..7bb4a2e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -90,8 +90,10 @@ export default { disableClick: true, passwordType: "password", loginForm: { - username: "13610050254", - password: "Pw050254#", + // username: "13610050254", + // password: "Pw050254#", + username: "18946034886", + password: "Pw034886#", }, loginRules: { username: [ diff --git a/src/views/setUp/school.vue b/src/views/setUp/school.vue index 9e6d4e7..e59c9e8 100644 --- a/src/views/setUp/school.vue +++ b/src/views/setUp/school.vue @@ -91,6 +91,41 @@ 取 消 + + + + + {{ item }} + + + + + + + + + {{ + `${item.className}${ + index == formGrade.classList.length - 1 ? "" : "、" + }` + }} + + + + \ No newline at end of file diff --git a/src/views/setUp/student.vue b/src/views/setUp/student.vue index a98ef2b..a87451d 100644 --- a/src/views/setUp/student.vue +++ b/src/views/setUp/student.vue @@ -12,6 +12,7 @@ size="mini" plain circle + @click="openAddDia" > @@ -41,7 +42,7 @@ v-for="item in classList" :key="item.classCode" :class="query.classId == item.id ? 'active' : ''" - @click="classDetail(item.id)" + @click="classDetail(item)" > {{ item.className }}({{ item.studentCount }}) @@ -78,11 +79,14 @@
    -
  • - +
  • +

    {{ item.studentName }}

    - 答题器:{{ (item.clickerList.length && item.clickerList[0].clickerSn) || "--" }} + 答题器:{{ + (item.clickerList.length && item.clickerList[0].clickerSn) || + "--" + }}

    长学号:{{ item.studentCode }}

    短学号:{{ item.shortNumber || "--" }}

    @@ -96,15 +100,46 @@ - - -

    - 通过Excel名单导入教师名单,点击 - 模板下载 。 -

    -
    + + + + {{ formStu.className }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -116,13 +151,29 @@ export default { data() { return { url: "", - diaUp: false, + diaStu: false, query: { gradeName: "", classId: "", studentCode: "", studentName: "", }, + formStu: { + className: "", + studentName: "", + studentCode: "", + shortNumber: "", + sex: 1, + clickerSn: "", + }, + rulesStu: { + studentName: [ + { required: true, message: "请输入学生名称", trigger: "blur" }, + ], + studentCode: [ + { required: true, message: "请输入学生长学号", trigger: "blur" }, + ], + }, gradeName: "", gradeList: [], classList: [], @@ -144,15 +195,57 @@ export default { this._QueryData(3); }, methods: { - changeGrade(val) { - this.query.classId = ""; - this._QueryClass(val); + openAddDia() { + this.formStu.studentName = ""; + this.formStu.studentCode = ""; + this.formStu.shortNumber = ""; + this.formStu.sex = 1; + this.formStu.clickerSn = ""; + this.diaStu = true; + }, + classDetail(obj) { + this.query.classId = obj.id; + this.formStu.className = obj.className; this._QueryData(3); }, - classDetail(id) { - this.query.classId = id; + async removeStu(obj,index) { + const { data, status, info } = await this.$request.delStudent({ + studentId: obj.id, + }); + if (status === 0) { + this.$message.success("删除成功"); + this.studentList.splice(index,1) + } else { + this.$message.error(info); + } + }, + async changeGrade(val) { + this.query.classId = ""; + await this._QueryClass(val); this._QueryData(3); }, + async addStu() { + let query = {}; + for (let key in this.formStu) { + if (key != "className" && this.formStu[key]) { + query[key] = this.formStu[key]; + } + } + this.loading = true; + const { data, status, info } = await this.$request.addStudent({ + classId: this.query.classId, + ...query, + }); + this.loading = false; + console.log(status); + if (status === 0) { + this.$message.success(info); + this.diaStu = false; + this._QueryData(); + } else { + this.$message.error(info); + } + }, async _QueryData(type) { let query = {}; query.gradeName = this.query.gradeName; @@ -202,6 +295,7 @@ export default { if (status === 0) { this.classList = [...data.list] || []; this.query.classId = this.classList[0]?.id; + this.formStu.className = this.classList[0]?.className; } else { this.$message.error(info); } diff --git a/src/views/setUp/teacher.vue b/src/views/setUp/teacher.vue index dbac872..af0e893 100644 --- a/src/views/setUp/teacher.vue +++ b/src/views/setUp/teacher.vue @@ -192,7 +192,7 @@ - +

    通过Excel名单导入教师名单,点击 @@ -203,6 +203,38 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + +

    +
    @@ -211,16 +243,17 @@ import { downloadFile } from "@/utils"; export default { data() { return { - loading:false, + loading: false, url: "", diaUp: false, + diaTeacher:false, query: { gradeName: "", teacherName: "", phone: "", }, gradeList: [], - teacherList: [ ], + teacherList: [], teacherDetail: { teacherName: "", loginName: "", @@ -231,6 +264,13 @@ export default { teacherGradeList: [], }, showTId: "", //显示详情 教师ID + formTeacher:{ + teacherName:"", + loginName:"", + sex:1, + managerList:[] + }, + rulesTeacher:{}, }; }, async created() { @@ -249,6 +289,7 @@ export default { this.showTId = obj.id; this.teacherDetail = { ...obj }; }, + addTeacher(){}, async _QueryData(type) { let query = {}; if (type == 1) { diff --git a/src/views/test/index.vue b/src/views/test/index.vue index 3f37020..4e8fa64 100644 --- a/src/views/test/index.vue +++ b/src/views/test/index.vue @@ -297,6 +297,59 @@ export default { lianghao: 40, jige: 30, bujige: 20, + questionList: [ + { + questionTitle: "f", + score: 1, + subQuestions: [ + { + questionIndex: 1, + questionType: 2, + score: 1, + partScore: 0, + selectNum: 4, + answerOptions: ["A", "B", "C", "D"], + correctAnswer: "B", + }, + { + questionIndex: 2, + questionType: 2, + score: 1, + partScore: 0, + selectNum: 4, + answerOptions: ["A", "B", "C", "D", "E", "F"], + correctAnswer: "A", + }, + { + questionIndex: 2, + questionType: 3, + score: 1, + partScore: 0, + selectNum: 4, + answerOptions: ["A", "B", "C", "D", "E", "F"], + correctAnswer: "AB", + }, + { + questionIndex: 2, + questionType: 3, + score: 1, + partScore: 0, + selectNum: 4, + answerOptions: ["A", "B", "C", "D", "E", "F"], + correctAnswer: "AB", + }, + { + questionIndex: 3, + questionType: 4, + score: 1, + partScore: 0, + selectNum: 0, + answerOptions: [], + correctAnswer: "1", + }, + ], + }, + ], }, { title: "试卷二", -- libgit2 0.21.4