From 711829036a35ce9e55cb3d703dfc52554223559f Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 30 Sep 2021 17:45:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/account/login/index.vue | 4 +- src/pages/achievement/list/index.vue | 48 ++++++------ src/pages/achievement/teach/index.vue | 21 +----- src/pages/achievement/vir/index.vue | 21 +----- src/pages/assessment/add/index.vue | 2 +- src/pages/assessment/list/index.vue | 73 ++++++++++--------- .../courseManagement/contentSettings.vue | 35 ++++----- src/pages/match/manage/matchSignup.vue | 4 +- 8 files changed, 93 insertions(+), 115 deletions(-) diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index 0ad3c3c..e1edded 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -79,12 +79,12 @@ export default { isHh: Setting.isHh, tabName: "1", param: { - account: "admin", + account: "zh", password: "111aaa", code: "", // 验证码 random: "", // 随机数 distinguish: null, // 区分手机号账号登录,1为账号登录,2为手机号或邮箱登录 - platform: 3 // 平台标识,1职站,2数据平台,3中台 + platform: 1 // 平台标识,1职站,2数据平台,3中台 }, rules: { account: [{ required: true, message: "请输入账号", trigger: "blur" }], diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index 2b5b058..73143a3 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -18,7 +18,7 @@
  • - +
    • - - + +
    • @@ -98,8 +98,8 @@ export default { return { classId: "", classList: [], - systemId: "", - systemList: Setting.systemList, + curriculumId: "", + curriculumList: [], projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0, keyword: "", searchTimer: null, @@ -139,11 +139,6 @@ export default { loadIns: null, }; }, - computed: { - ...mapState("project", [ - "lastSystemId" - ]) - }, watch: { month: function(val) { if (val) { @@ -171,15 +166,21 @@ export default { } }, mounted() { - // 如果systemId有历史记录,就取历史记录里的systemId,否则就取默认的systemId - this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId; - this.getData(); + this.getschoolCourse(); this.getClassData(); }, methods: { - ...mapActions("project", [ - "setSystemId" - ]), + getschoolCourse() { // 获取课程下拉框数据 + this.$get(this.api.schoolCourse).then(res => { + if (res.data && res.data.length) { + this.curriculumList = res.data; + this.curriculumId = this.curriculumList[0].cid; + this.getData(); + } + }).catch(err => { + console.log(err); + }); + }, getClassData() { // 获取班级下拉框数据 this.$post(this.api.myClass).then(res => { this.classList = res.list; @@ -192,7 +193,7 @@ export default { let data = { classId: this.classId, permissions: this.projectPermissions, - systemId: this.systemId, + curriculumId: this.curriculumId, keyWord: this.keyword, startTime: this.startingtime, endTime: this.endTime, @@ -221,14 +222,13 @@ export default { return true; }, entry(row) { // 成绩管理 - this.setSystemId(this.systemId); if (this.projectPermissions === 1) { let list = row.classList.map(i => { return {id: i.id.toString(), name: i.className} }) - this.$router.push(`teach?assessmentId=${row.assessmentId}&projectName=${row.projectName}&permissions=${row.permissions}&systemId=${this.systemId}&classList=${JSON.stringify(list)}`); + this.$router.push(`teach?assessmentId=${row.assessmentId}&projectName=${row.projectName}&permissions=${row.permissions}&classList=${JSON.stringify(list)}`); } else { - this.$router.push(`vir?projectId=${row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}&systemId=${this.systemId}`); + this.$router.push(`vir?projectId=${row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`); } }, handleDelete(row) { // 删除 diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/teach/index.vue index ae81a6c..3942b74 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/teach/index.vue @@ -63,7 +63,6 @@ @@ -88,7 +87,6 @@ export default { activeName: "", // 当前标签页 classId: "", // 当前班级id classList: [], // 班级标签页列表 - systemId: this.$route.query.systemId, permissions: this.$route.query.permissions, experimentalName: this.$route.query.projectName, assessmentId: this.$route.query.assessmentId, @@ -136,24 +134,11 @@ export default { }).catch(err => { }); }, - edit(row) { - if (this.systemId == 2 || this.systemId == 3) { - this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); - } else { - this.$router.push(`addexperiment?id=${row.reportId}`); - } - }, show(row) { // 查看成绩报告 - if (this.systemId == 2) { - this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); - } else if (this.systemId == 3) { - this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); + if (this.permissions) { + this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`); } else { - if (this.permissions) { - this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`); - } else { - this.$router.push(`show?id=${row.recordId}&type=1`); - } + this.$router.push(`show?id=${row.recordId}&type=1`); } }, exportData() { // 导出(有勾选:就导勾选中的;没有勾选:就导全部) diff --git a/src/pages/achievement/vir/index.vue b/src/pages/achievement/vir/index.vue index a971592..9f88bbb 100644 --- a/src/pages/achievement/vir/index.vue +++ b/src/pages/achievement/vir/index.vue @@ -48,7 +48,6 @@ @@ -70,7 +69,6 @@ import echarts from "echarts"; export default { data() { return { - systemId: this.$route.query.systemId, permissions: this.$route.query.permissions, experimentName: this.$route.query.projectName, projectId: this.$route.query.projectId, @@ -112,24 +110,11 @@ export default { }).catch(res => { }); }, - edit(row) { - if (this.systemId == 2 || this.systemId == 3) { - this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); - } else { - this.$router.push(`addexperiment?id=${row.reportId}`); - } - }, show(row) { - if (this.systemId == 2) { - this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); - } else if (this.systemId == 3) { - this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`); + if (this.permissions) { + this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`); } else { - if (this.permissions) { - this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`); - } else { - this.$router.push(`show?id=${row.recordId}&type=1`); - } + this.$router.push(`show?id=${row.recordId}&type=1`); } }, exportData() { diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index 318cbbb..3e22d0f 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -68,7 +68,7 @@

      课程

      - +
    • - - + +
    • @@ -85,7 +85,7 @@ @@ -175,8 +175,8 @@ export default { } ], date: [], - systemList: Setting.systemList, - systemId: "", + curriculumList: [], + curriculumId: "", keyWord: "", // 搜索框筛选条件 searchTimer: null, form: { @@ -191,7 +191,7 @@ export default { total: 0, // 总数 listData: [], // 表格数据 multipleSelection: [], // 多选 - ticker: null + ticker: null // 倒计时定时器 }; }, watch: { @@ -221,12 +221,24 @@ export default { } }, mounted() { + // 页面离开的时候销毁手机和邮箱验证码定时器 + this.$once("hook:beforeDestroy", function() { + clearInterval(this.ticker); + this.ticker = null; + }); this.getData(); - this.beginTimer(); + this.getschoolCourse(); }, - created() { - if (this.ticker) { - clearInterval(this.ticker); + filters: { + timeFilter(countDown) { + if (countDown > 0) { + let h = Math.floor(countDown / (60 * 60)); + let m = Math.floor(countDown % (60 * 60) / 60); + let s = Math.floor(countDown % (60 * 60) % 60); + return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`; + } else { + return "00:00:00"; + } } }, methods: { @@ -241,30 +253,19 @@ export default { } }, 1000); }, - changeTime(countDown) { - let that = this; - if (countDown < 0) { - clearInterval(setInterval(this.changeTime(countDown), 1000)); - } - let hh = that.fillNumber(countDown / (60 * 60)); - let mm = that.fillNumber(countDown % (60 * 60) / 60); - let ss = that.fillNumber(countDown % (60 * 60) % 60); - return `${hh}:${mm}:${ss}`; - }, - fillNumber(num) { - let number = Math.floor(num); - return number > 9 ? number : `0${number}`; - }, getData() { + if (this.ticker) { + clearInterval(this.ticker); + } let data = { ...this.form, keyWord: this.keyWord, pageNum: this.pageNum, pageSize: this.pageSize, - systemId: this.systemId + curriculumId: this.curriculumId }; this.$post(this.api.pageByCondition, data).then(res => { - if (res.status === 200) { + if (res.status === 200 && res.list && res.list.length) { this.listData = res.list; this.total = res.total; this.listData.forEach(i => { @@ -290,8 +291,7 @@ export default { } } }); - } else { - util.errorMsg(res.message); + this.beginTimer(); } }).catch(err => { console.log(err); @@ -302,6 +302,13 @@ export default { this.pageNum = 1; this.getData(); }, + getschoolCourse() { // 获取课程下拉框数据 + this.$get(this.api.schoolCourse).then(res => { + this.curriculumList = res.data; + }).catch(err => { + console.log(err); + }); + }, add() { this.$router.push("add"); }, @@ -309,7 +316,7 @@ export default { this.$router.push(`add?id=${row.id}`); }, show(row) { - this.$router.push(`/achievement/ass?systemId=${this.systemId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); + this.$router.push(`/achievement/ass?curriculumId=${this.curriculumId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); }, start(row) { let data = { diff --git a/src/pages/course/courseManagement/contentSettings.vue b/src/pages/course/courseManagement/contentSettings.vue index d0ae458..3c2f5dd 100644 --- a/src/pages/course/courseManagement/contentSettings.vue +++ b/src/pages/course/courseManagement/contentSettings.vue @@ -12,12 +12,12 @@
      内容设置
      @@ -28,9 +28,9 @@
      {{ chapter.name }}