[feat][V]:新增用户课表

master
Romesum 5 years ago
parent 339e89e964
commit c1e972249f

@ -1,5 +1,21 @@
<template>
<div style="margin: 20px">
<el-form :model="time" :inline="true" style="width: 100%">
<el-form-item label="学年" style="width: 20% ;">
<el-select v-model="time.year" style="">
<el-option label="2017-2018" value="2017"></el-option>
<el-option label="2018-2019" value="2018"></el-option>
<el-option label="2019-2020" value="2019"></el-option>
<el-option label="2020-2021" value="2020"></el-option>
</el-select>
</el-form-item>
<el-form-item label="学期" style="width: 20%">
<el-select v-model="time.semester" style="">
<el-option label="第一学期" :value="1"></el-option>
<el-option label="第二学期" :value="2"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-row :gutter="20">
<el-col :span="8">
<el-input v-model="search" placeholder="输入关键字搜索" suffix-icon="el-icon-search"/>
@ -42,7 +58,8 @@
<el-button @click="deleteUser(scope.row)" type="danger" size="mini" plain icon="el-icon-delete"
v-if="scope.row.position!==3">删除
</el-button>
<el-button @click="handleClick(scope.row)" size="mini" plain v-if="scope.row.position === 1">
<el-button @click="schedulePreview(scope.row)" size="mini" plain v-if="scope.row.position === 1">
查看课表
</el-button>
</template>
</el-table-column>
@ -54,6 +71,8 @@
@cancel="cancel"
@confirm="confirm"
></user-edit-form>
<tb_courseDialog :cClick="cellClick" :cStyle="tableStyle" table-label="" ref="schedule" :custom="true"
c-click=""></tb_courseDialog>
</div>
</template>
@ -62,9 +81,11 @@
import {get, post} from "~/utils";
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
import userEditForm from "~/components/supManager/userEditForm";
import tb_courseDialog from "~/components/tb_courseDialog";
import {item2html} from "~/utils/converter";
export default {
components: {userEditForm},
components: {userEditForm, tb_courseDialog},
data() {
return {
search: '',
@ -72,7 +93,11 @@
tableData: [],
dialogFormVisible: false,
edit: false,
userForm: {}
userForm: {},
time: {
year: '2019',
semester: 2
},
}
}
,
@ -80,9 +105,6 @@
async load() {
this.tableData = await get('lb/user/getUserList')
},
handleClick(row) {
console.log(row);
},
handleSelectionChange(val) {
this.items = val;
},
@ -116,6 +138,33 @@
}
//
this.dialogFormVisible = true
},
async schedulePreview(event) {
console.log(event)
await this.loadSchedule(event.uid)
this.$refs.schedule.courseDialog = true
},
async loadSchedule(u_id) {
const schedule = await get('lb/labrecord/getUserSchedule', {
u_id,
year: this.time.year,
semester: this.time.semester
}) //
for (let i = 0; i < schedule.length; i++) {
this.$refs.schedule.tableData[i].Monday = item2html(schedule[i][0])
this.$refs.schedule.tableData[i].Tuesday = item2html(schedule[i][1])
this.$refs.schedule.tableData[i].Wednesday = item2html(schedule[i][2])
this.$refs.schedule.tableData[i].Thursday = item2html(schedule[i][3])
this.$refs.schedule.tableData[i].Friday = item2html(schedule[i][4])
this.$refs.schedule.tableData[i].Saturday = item2html(schedule[i][5])
this.$refs.schedule.tableData[i].Sunday = item2html(schedule[i][6])
}
},
cellClick() {
},
tableStyle() {
},
cancel() {
this.load()

Loading…
Cancel
Save