From ab93e1823f84b007a2866d3a59fdfef641bf0c01 Mon Sep 17 00:00:00 2001 From: Romesum Date: Tue, 26 May 2020 16:28:19 +0800 Subject: [PATCH] =?UTF-8?q?[fix][V]:=E5=AE=8C=E5=96=84=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/supManager/labManage.vue | 2 +- .../src/components/supManager/navBar.vue | 2 +- .../src/components/supManager/setLabTime.vue | 35 ++++++++++++++----- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/element-vue/src/components/supManager/labManage.vue b/element-vue/src/components/supManager/labManage.vue index 8376bd7..0d5f153 100644 --- a/element-vue/src/components/supManager/labManage.vue +++ b/element-vue/src/components/supManager/labManage.vue @@ -97,7 +97,7 @@ - + diff --git a/element-vue/src/components/supManager/navBar.vue b/element-vue/src/components/supManager/navBar.vue index 0439ed4..f5a3e78 100644 --- a/element-vue/src/components/supManager/navBar.vue +++ b/element-vue/src/components/supManager/navBar.vue @@ -10,7 +10,7 @@ router active-text-color="#ffd04b"> 首页 - 实验室管理 + 实验室管理 用户管理 diff --git a/element-vue/src/components/supManager/setLabTime.vue b/element-vue/src/components/supManager/setLabTime.vue index 4bdf5b0..02f1db4 100644 --- a/element-vue/src/components/supManager/setLabTime.vue +++ b/element-vue/src/components/supManager/setLabTime.vue @@ -32,11 +32,8 @@ - - - - + import weekSelection from "~/components/weekSelection"; - import tb_course from "~/components/tb_course"; - import {get, post, stop} from "~/utils"; - import {showDialog, showFail, showSuccess} from "~/utils/dialog"; + import tb_course from "~/components/tb_courseDialog"; + import {get, post} from "~/utils"; + import {showDialog, showSuccess} from "~/utils/dialog"; + import {arr2shortString} from "~/utils/converter"; export default { components: {weekSelection, tb_course}, @@ -105,8 +103,10 @@ methods: { //设置周次与节次 async showCourseDialog() { + await this.getScheduleAll() this.tableAlive = true - this.courseDialog = true + this.$refs.times.courseDialog = true + this.setLabTimeDialog = false }, //表格中每个格子的风格 cellStyle: function ({row, column, rowIndex, columnIndex}) { @@ -146,6 +146,7 @@ } console.log(this.form) await post('lb/labTime/updateLabTime', this.form) + await this.getScheduleAll() await showSuccess("设置成功", this) // if (targetValue.length !== 0) { // this.perTargetValue.textContent = '【' + targetValue + '】周' @@ -204,6 +205,22 @@ this.formDialog = true console.log(this.allWeeksValue) this.tableAlive = false //表格失活 + }, + async getScheduleAll() { + const schedule = await get('lb/labTime/getLabScheduleAll', { + labId: this.form.labId, + year: this.form.year, + semester: this.form.semester + }) + for (let i = 0; i < schedule.length; i++) { + this.$refs.times.tableData[i].Monday = arr2shortString(schedule[i][0])?arr2shortString(schedule[i][0])+'周':'' + this.$refs.times.tableData[i].Tuesday = arr2shortString(schedule[i][1])?arr2shortString(schedule[i][1])+'周':'' + this.$refs.times.tableData[i].Wednesday = arr2shortString(schedule[i][2])?arr2shortString(schedule[i][2])+'周':'' + this.$refs.times.tableData[i].Thursday =arr2shortString(schedule[i][3])?arr2shortString(schedule[i][3])+'周':'' + this.$refs.times.tableData[i].Friday = arr2shortString(schedule[i][4])?arr2shortString(schedule[i][4])+'周':'' + this.$refs.times.tableData[i].Saturday = arr2shortString(schedule[i][5])?arr2shortString(schedule[i][5])+'周':'' + this.$refs.times.tableData[i].Sunday = arr2shortString(schedule[i][6])?arr2shortString(schedule[i][6])+'周':'' + } } } }