'页面代码优化'

master
aiyadc 5 years ago
parent 1742c010d9
commit 1d2e8ecbbd

@ -1,19 +0,0 @@
<template>
<div>
<nav-bar></nav-bar>
<router-view></router-view>
</div>
</template>
<script>
import navBar from "~/components/manager/navBar";
export default {
components:{navBar},
name: "empty"
}
</script>
<style scoped>
</style>

@ -11,7 +11,7 @@
router>
<el-menu-item index="1" route="../">首页</el-menu-item>
<el-menu-item index="2" route="managerCheck">审核</el-menu-item>
<el-menu-item index="3" route="labManager">实验室管理</el-menu-item>
<el-menu-item index="3" route="labManage">实验室管理</el-menu-item>
<drop-down-user :user="nickname" @back="backLogin" @goPersonal="goPersonal"></drop-down-user>
</el-menu>
</div>
@ -34,14 +34,14 @@
console.log(key, keyPath);
},
async backLogin() {
await get('lb/manager/logout')
await get('lb/user/logout')
await showSuccess("退出成功", this)
setTimeout(() => {
this.$router.push('/login')
}, 1000)
},
goPersonal: function () {
this.$router.push('/manager/index/personal')
this.$router.push('/manager/personal')
}
},
components: {

@ -1,19 +0,0 @@
<template>
<div>
<nav-bar></nav-bar>
<router-view></router-view>
</div>
</template>
<script>
import navBar from "~/components/supManager/navBar";
export default {
components:{navBar},
name: "empty"
}
</script>
<style scoped>
</style>

@ -7,11 +7,11 @@
</el-header>
<!-- body部分-->
<el-main class="main" >
<el-row>
<el-col :span="8" :offset="8">
<el-card shadow="always" style="margin-bottom: 30%" ><h1>Hi{{user}},欢迎您</h1></el-card>
</el-col>
</el-row>
<div style="margin-bottom: 10%">
<span style="font-size: 60px;font-family: 'Adobe 黑体 Std R';color: yellow">Hi{{user}},欢迎您</span>
</div>
<!-- 用一个循环把所有的功能模块加载出来 -->
<div id="block">
<block v-for="item in names" :key="item.name" :name="item.name" @click.native="item.func" class="block" ></block>
@ -26,8 +26,7 @@
<script>
import dropDownUser from "~/components/dropDownUser";
import block from "~/components/block";
import {get} from "~/utils";
import {showSuccess} from "~/utils/dialog";
export default {
name: "home",
props:[
@ -62,7 +61,7 @@
justify-content: space-around;
}
.block{
background: deepskyblue;
background: aquamarine;
display:inline
}
#block :hover{

@ -62,6 +62,7 @@
account: '',
psw: '',
},
character: [{
label: '超级管理员',
value: '3'
@ -91,6 +92,7 @@
}
},
methods: {
submitForm(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
@ -117,16 +119,21 @@
},
},
mounted() {
var height =(document.documentElement.clientHeight || window.innerHeight)-5 ;
console.log(document.documentElement.clientHeight,window.innerHeight)
this.imgSty='opacity: 100%;width:100%;height: '+height+'px'
// var height =(document.documentElement.clientHeight || window.innerHeight)-5
// console.log(document.documentElement.clientHeight,window.innerHeight)
this.imgSty='opacity: 100%;width:100%;height: 100%;'
}
}
</script>
<style scoped>
#demo1 {
position: absolute;
background-color: aquamarine;
margin: 0;
padding: 0;
height:100%;
overflow: hidden;
}
#login {

@ -3,7 +3,7 @@
<home
:names="homeParams"
:user="nickname"
@goPersonal="$router.push('/manager/index/personal')"
@goPersonal="$router.push('/manager/personal')"
@back="logout"
></home>
</div>
@ -24,17 +24,17 @@
homeParams: [
{
name: '审核', func: () => {
this.$router.push('/manager/index/labApply')
this.$router.push('/manager/managerCheck')
}
},
{
name: '实验室管理', func: () => {
this.$router.push('/manager/index/labManager')
this.$router.push('/manager/labManage')
}
},
{
name: '个人中心', func: () => {
this.$router.push('/manager/index/personal')
this.$router.push('/manager/personal')
}
}
]

@ -1,13 +1,16 @@
<template>
<div>
<nav-bar v-if="$route.path!=='/manager'"></nav-bar>
<router-view></router-view>
</div>
</template>
<script>
import navBar from "~/components/manager/navBar";
export default {
name: "empty"
name: "empty",
components:{navBar}
}
</script>

@ -0,0 +1,233 @@
<template>
<div style="width: 100%;padding: 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"/>
</el-col>
<!-- <el-col :span="16" style="text-align: left" v-if="">-->
<!-- <el-button type="success" style="width: 120px;text-align: center" icon="el-icon-circle-plus-outline"-->
<!-- @click="editLab()">新增-->
<!-- </el-button>-->
<!-- </el-col>-->
</el-row>
<el-table :data="tableDataComputed" border style="margin-top: 20px">
<el-table-column prop="name" label="实验室名称"></el-table-column>
<el-table-column prop="position" label="实验室地点"></el-table-column>
<el-table-column prop="software" label="软件"></el-table-column>
<el-table-column prop="nickname" label="管理员"></el-table-column>
<el-table-column prop="tel" label="管理员联系电话"></el-table-column>
<el-table-column label="操作" width="370px">
<template slot-scope="scope">
<el-button @click="editLab(scope.row)" type="primary" size="mini" plain icon="el-icon-edit">编辑
</el-button>
<el-button @click="schedulePreview(scope.row)" size="mini" plain>查看课表</el-button>
<el-button @click="editSchedule(scope.row)" type="primary" size="mini" icon="el-icon-edit"
plain>修改可预约时间段
</el-button>
</template>
</el-table-column>
</el-table>
<add-lab ref="addLab" @confirm="submit"></add-lab>
<set-lab-time ref="setLabTime"></set-lab-time>
<tb_courseDialog :cClick="cellClick" :cStyle="tableStyle" table-label="" ref="schedule" :custom="true" c-click=""></tb_courseDialog>
</div>
</template>
<script>
import addLab from "~/components/supManager/addLab" ;
import tb_courseDialog from "~/components/tb_courseDialog";
import {get, post} from "~/utils";
import {closeLoading, showDialog, showDialogWithReject, showFail, showLoading, showSuccess} from "~/utils/dialog";
import setLabTime from "~/components/supManager/setLabTime";
import {item2html} from "~/utils/converter";
import config from "~/config";
export default {
components: {addLab, setLabTime, tb_courseDialog},
data() {
return {
edit: false,
setLabTimeDialog: false,
form: {},
time: {
year: config.defyear,
semester: 2
},
search: '',
tableData: [
{
name: "小姚",
position: "509",
software:"window",
nickname:"小姚",
tel:"123456789"
},
{
name: "我是",
position: "lp",
software:"window",
nickname:"小姚",
tel:"123456789"
}
],
currenttableData:[
{
name: "",
position: "",
software:"",
nickname:"",
tel:""
}
],
}
},
computed: {
tableDataComputed() {
return this.currenttableData=this.tableData.filter(data => !this.search
|| data.name.toLowerCase().includes(this.search.toLowerCase())
|| data.position.toLowerCase().includes(this.search.toLowerCase())
|| data.software.toLowerCase().includes(this.search.toLowerCase())
|| data.nickname.toLowerCase().includes(this.search.toLowerCase())
|| data.tel.toLowerCase().includes(this.search.toLowerCase())
)
}
},
methods: {
async load() {
this.tableData = await get('/lb/lab/getLabList')
},
//
async editLab(item) {
//
this.edit = !!item
this.$refs.addLab.form = item ? item : {
position: '',
name: '',
capacity: '',
manager_id: ''
}
this.$refs.addLab.addLabDialog = true
console.log(this.$refs.addLab)
//
this.dialogFormVisible = true
},
async submit() {
this.$refs.addLab.$refs.form.validate(async (valid)=> {
if (valid) {
this.$refs.addLab.form.capacity = parseInt(this.$refs.addLab.form.capacity)
this.$refs.addLab.form.managerId = this.$refs.addLab.form.manager_id
if (this.$refs.addLab.form.lab_id) {
//
await showDialog('确认要编辑吗?', this)
this.$refs.addLab.form.labId = this.$refs.addLab.form.lab_id
await post('lb/lab/updateLab', this.$refs.addLab.form).then(async () => {
await this.load()
showSuccess('编辑成功', this)
}).catch(() => {
showFail('编辑失败', this)
}
)
} else {
//
await showDialog('确认要新增吗?', this)
await showDialogWithReject('是否需要为该实验室添加' + parseInt(this.time.year) + '-' + (parseInt(this.time.year) + 1) + '学年第' + this.time.semester + '学期16周的所有时间段', this).then(async () => {
this.$refs.addLab.form.fastInsert = true
this.$refs.addLab.form.year = this.time.year
this.$refs.addLab.form.semester = this.time.semester
console.log(this.$refs.addLab.form)
await this.addLab()
}).catch(async () => {
this.$refs.addLab.form.fastInsert = false
await this.addLab()
})
}
this.$refs.addLab.addLabDialog = false
}
})
},
async addLab() {
const loading = showLoading('正在新增...', this)
const newLab = await post('lb/lab/addLab', this.$refs.addLab.form).then(async () => {
await this.load()
showSuccess('新增成功', this)
closeLoading(loading)
}).catch(() => {
closeLoading(loading)
showFail('新增失败', this)
})
},
async schedulePreview(event) {
await this.loadSchedule(event.lab_id)
this.$refs.schedule.lab = {
name: event.name,
position: event.position
}
this.$refs.schedule.courseDialog = true
},
async editSchedule(item) {
this.$refs.setLabTime.lab = item
this.$refs.setLabTime.form.labId = item.lab_id
this.$refs.setLabTime.setLabTimeDialog = true
},
async loadSchedule(labId) {
const schedule = await get('lb/labrecord/getLabSchedule', {
labId,
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() {
}
},
async mounted() {
await this.load()
// this.tableData=get('/url')
}
}
</script>
<style>
</style>

@ -3,7 +3,7 @@
<home
:names="homeParams"
:user="nickname"
@goPersonal="$router.push('/supManager/index/personal')"
@goPersonal="$router.push('/supManager/personal')"
@back="logout"
></home>
</div>
@ -24,22 +24,22 @@
homeParams: [
{
name: '实验室管理', func: () => {
this.$router.push('/supManager/index/labManager')
this.$router.push('/supManager/labManager')
}
},
{
name: '用户管理', func: () => {
this.$router.push('/supManager/index/userManage')
this.$router.push('/supManager/userManage')
}
},
{
name: '个人中心', func: () => {
this.$router.push('/supManager/index/personal')
this.$router.push('/supManager/personal')
}
},
{
name: '审核', func: () => {
this.$router.push('/supManager/index/supCheck')
this.$router.push('/supManager/supCheck')
}
}
]

@ -1,13 +1,19 @@
<template>
<div>
<nav-bar v-if="$route.path!=='/supManager'"></nav-bar>
<router-view> </router-view>
</div>
</template>
<script>
import navBar from "~/components/supManager/navBar";
export default {
name: "empty"
name: "empty",
components:{
navBar
}
}
</script>

@ -1,8 +1,6 @@
<template>
<div style="width: 100%;padding: 20px">
<el-form :model="time" :inline="true" style="width: 100%">
<!-- <span style="width: 10% ;:-20px">可预约时间段:-->
<!-- </span>-->
<el-form-item label="学年" style="width: 20% ;">
<el-select v-model="time.year" style="">
<el-option label="2017-2018" value="2017"></el-option>
@ -17,86 +15,23 @@
<el-option label="第二学期" :value="2"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="周次" style="width: 5%">-->
<!-- </el-form-item >-->
<!-- <el-select v-model="time.day1" style=";width:5%" >-->
<!-- <el-option label="1" value="0"></el-option>-->
<!-- <el-option label="2" value="1"></el-option>-->
<!-- <el-option label="3" value="0"></el-option>-->
<!-- <el-option label="4" value="1"></el-option>-->
<!-- <el-option label="5" value="0"></el-option>-->
<!-- <el-option label="6" value="1"></el-option>-->
<!-- <el-option label="7" value="0"></el-option>-->
<!-- </el-select>-->
<!-- <span></span>-->
<!-- <el-select v-model="time.day2" style=";width: 5%" >-->
<!-- <el-option label="1" value="0"></el-option>-->
<!-- <el-option label="2" value="1"></el-option>-->
<!-- <el-option label="3" value="0"></el-option>-->
<!-- <el-option label="4" value="1"></el-option>-->
<!-- <el-option label="5" value="0"></el-option>-->
<!-- <el-option label="6" value="1"></el-option>-->
<!-- <el-option label="7" value="0"></el-option>-->
<!-- </el-select>-->
<!-- <el-form-item label="星期几" style="width: 5%">-->
<!-- </el-form-item >-->
<!-- <el-select v-model="time.day1" style=";width: 10%" >-->
<!-- <el-option label="星期一" value="0"></el-option>-->
<!-- <el-option label="星期二" value="1"></el-option>-->
<!-- <el-option label="星期三" value="0"></el-option>-->
<!-- <el-option label="星期四" value="1"></el-option>-->
<!-- <el-option label="星期五" value="0"></el-option>-->
<!-- <el-option label="星期六" value="1"></el-option>-->
<!-- <el-option label="星期七" value="0"></el-option>-->
<!-- </el-select>-->
<!-- <el-button type="success" style="width: 6%;text-align: left" icon="el-icon-circle-plus-outline"-->
<!-- @click="showAddLab" >检索-->
<!-- </el-button>-->
</el-form>
<el-row :gutter="20">
<el-col :span="8">
<el-input v-model="search" placeholder="输入关键字搜索" suffix-icon="el-icon-search"/>
</el-col>
<el-col :span="16" style="text-align: left">
<el-col :span="16" style="text-align: left" v-if="">
<el-button type="success" style="width: 120px;text-align: center" icon="el-icon-circle-plus-outline"
@click="editLab()">新增
</el-button>
</el-col>
</el-row>
<!-- <el-form :model="form">-->
<!-- <el-form-item label="类型" style="width: 20% ">-->
<!-- <el-select v-model="form.type" style="" >-->
<!-- <el-option label="安卓实验室" value="0"></el-option>-->
<!-- <el-option label="window实验室" value="1"></el-option>-->
<!-- <el-option label="ios实验室" value="2"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="位置" style="width: 20% ;">-->
<!-- <el-select v-model="form.position" style="" >-->
<!-- <el-option label="旭日楼" value="0"></el-option>-->
<!-- <el-option label="电子楼" value="1"></el-option>-->
<!-- <el-option label="实训楼" value="2"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-input v-model="search" placeholder="输入关键字搜索" suffix-icon="el-icon-search" style="width: 20%;"/>-->
<!-- </el-form>-->
<el-table :data="tableDataComputed" border style="margin-top: 20px">
<el-table-column prop="name" label="实验室名称"></el-table-column>
<el-table-column prop="position" label="实验室地点"></el-table-column>
<!--<el-table-column prop="name" label="实验室名称"></el-table-column>-->
<el-table-column prop="software" label="软件"></el-table-column>
<el-table-column prop="nickname" label="管理员"></el-table-column>
<el-table-column prop="tel" label="管理员联系电话"></el-table-column>
@ -104,9 +39,6 @@
<template slot-scope="scope">
<el-button @click="editLab(scope.row)" type="primary" size="mini" plain icon="el-icon-edit">编辑
</el-button>
<!-- <el-button @click="deleteLab(scope.row.lab_id)" type="danger" size="mini" plain-->
<!-- icon="el-icon-delete">删除-->
<!-- </el-button>-->
<el-button @click="schedulePreview(scope.row)" size="mini" plain>查看课表</el-button>
<el-button @click="editSchedule(scope.row)" type="primary" size="mini" icon="el-icon-edit"
plain>修改可预约时间段
@ -250,15 +182,6 @@
showFail('新增失败', this)
})
},
// async deleteLab(labId) {
// await showDialog("", this)
// await post('lb/lab/deleteLab', {labId}).then(async () => {
// await this.load()
// await showSuccess('', this)
// }).catch(err => {
// showFail(',', this)
// })
// },
async schedulePreview(event) {
await this.loadSchedule(event.lab_id)
this.$refs.schedule.lab = {

@ -0,0 +1,245 @@
<template>
<div>
<el-table :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle">
<el-table-column :label="tableLabel" align="center ">
<el-table-column prop="daytime" label="" fixed align="center" width="60"></el-table-column>
<el-table-column prop="time" label="" fixed align="center" width="100"></el-table-column>
<el-table-column :index="1" prop="Monday" label="星期一" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Monday.name}} &nbsp;<br>
{{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br>
{{scope.row.Monday.software}}
</div>
<div v-if="custom" v-html="scope.row.Monday"></div>
</template>
</el-table-column>
<el-table-column :index="2" prop="Tuesday" label="星期二" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
</div>
<div v-if="custom" v-html="scope.row.Tuesday"></div>
</template>
</el-table-column>
<el-table-column :index="3" prop="Wednesday" label="星期三" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
</div>
<div v-if="custom" v-html="scope.row.Wednesday"></div>
</template>
</el-table-column>
<el-table-column :index="4" prop="Thursday" label="星期四" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
</div>
<div v-if="custom" v-html="scope.row.Thursday"></div>
</template>
</el-table-column>
<el-table-column :index="5" prop="Friday" label="星期五" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
</div>
<div v-if="custom" v-html="scope.row.Friday"></div>
</template>
</el-table-column>
<el-table-column :index="6" prop="Saturday" label="星期六" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
</div>
<div v-if="custom" v-html="scope.row.Saturday"></div>
</template>
</el-table-column>
<el-table-column :index="7" prop="Sunday" label="星期日" align="center">
<template slot-scope="scope">
<div v-if="!custom">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
</div>
<div v-if="custom" v-html="scope.row.Sunday"></div>
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
</template>
<script>
import navBar from "~/components/teacher/navBar";
import {get, post} from "~/utils";
export default {
name: "tb_course",
components: {navBar},
props: {
tableLabel: {},
cClick: {},
cStyle: {},
custom: {default: false},
data: {default: () => []}
},
data() {
return {
item: '',
courseDialog: false,
tableData: [
{
index: 1, daytime: '上午', time: '第一节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
Friday: '', Saturday: '', Sunday: ''
},
{
index: 2, daytime: '上午', time: '第二节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
Friday: '', Saturday: '', Sunday: ''
},
{
index: 3, daytime: '下午', time: '第三节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
Friday: '', Saturday: '', Sunday: ''
},
{
index: 4, daytime: '下午', time: '第四节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
Friday: '', Saturday: '', Sunday: ''
},
{
index: 5, daytime: '晚上', time: '第五节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
Friday: '', Saturday: '', Sunday: ''
}
]
}
},
methods: {
objectSpanMethod({row, column, rowIndex, columnIndex}) {
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
};
}
}
}
},
mounted() {
// this.data = [
// [
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "Web",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// },
// {
// "ucId": 1,
// "name": "",
// "software": "IDEA",
// "year": "2019",
// "semester": 2,
// "population": 50,
// "classes": "176",
// "remind": "",
// "ishavedocuments": 1,
// "uid": 1
// }
// ]
// ]
// for (let i = 0; i < this.data.length; i++) {
// this.tableData[i].Monday = this.data[i][0]
// this.tableData[i].Tuesday = this.data[i][1]
// this.tableData[i].Wednesday = this.data[i][2]
// this.tableData[i].Thursday = this.data[i][3]
// this.tableData[i].Friday = this.data[i][4]
// this.tableData[i].Saturday = this.data[i][5]
// this.tableData[i].Sunday = this.data[i][6]
// }
}
}
</script>
<style scoped>
</style>

@ -2,23 +2,19 @@
<div>
<el-container>
<!-- 标题栏-->
<el-header style="padding: 0">
<nav-bar></nav-bar>
</el-header>
<el-main>
<!-- /和学期-->
<time-select ref="timeSelection"></time-select>
<!-- 表格查询申请记录-->
<el-header>
<div>
<el-input type="text" style="max-width: 400px;float: left" placeholder="请输入查询关键字">
<el-input type="text" v-model="search" style="max-width: 400px;float: left" placeholder="请输入查询关键字">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
<el-button style="float: right" class="el-button--danger" @click="toMyRecord"></el-button>
</div>
</el-header>
<el-table :data="tableData" border ref="detailtb" height="500px">
<el-table :data="tableDataFilter" border ref="detailtb" height="500px">
<el-table-column prop="position" label="实验室地点"></el-table-column>
<el-table-column prop="name" label="实验室名称"></el-table-column>
<el-table-column prop="capacity" label="可容纳人数"></el-table-column>
@ -95,7 +91,6 @@
<script>
import tb_course from "~/components/tb_courseDialog";
import tb_courseDialog from "~/components/tb_courseDialog";
import navBar from "~/components/teacher/navBar";
import weekSelection from "~/components/weekSelection";
import timeSelect from "~/components/timeSelect";
import {get, post, stop} from "~/utils";
@ -105,11 +100,11 @@
export default {
name: "applyLab",
components: {
tb_courseDialog,
tb_course, navBar, weekSelection, timeSelect
tb_courseDialog, tb_course,weekSelection, timeSelect
},
data() {
return {
search:'',
user: {},
lab: {},
ableList: [],
@ -153,14 +148,6 @@
},
//
async cellClick(row, column, cell, event) {
//()使disable
// let position = this.lab.position
// let rowIndex = row.index
// let columIndex = column.index
// var weeks=get('',{position,rowIndex,columIndex}) //rowIndexcolumIndex:
// var weeks=[6,7,8]
//()使disablevar
if (column.label != '') {
this.form.weeks = null
this.form.day = column.index
@ -181,15 +168,7 @@
this.aWeekValue.push(row.index, column.index)
this.perTargetValue = event.target //targettarget
this.aWeekValue.push(row.index, column.index)
// console.log(this.$refs.weekSelection)
// var position = this.form.position
// var rowIndex = row.index
// var columnIndex = column.index
// var selectedWeeks = get('', {position, rowIndex, columnIndex}) //rowIndexcolumIndex:
// selectedWeeks = [1, 2, 3]
// this.$refs.weekSelection.disableList = selectedWeeks
// console.log('aa', this.$refs.weekSelection.singleVal)
})
}
},
@ -237,75 +216,6 @@
await showSuccess("预约成功,管理员正在审核", this)
this.form.weeks = []
// if (targetValue.length !== 0) {
// this.perTargetValue.textContent = '' + targetValue + ''
// this.aWeekValue.push(targetValue) //[rowIndex,column,targetValue]
// this.allWeeksValue.push(this.aWeekValue) //allWeeksValue
// this.perTargetValue.style.backgroundColor = 'lightyellow'
// for (let i = 0; i < this.allWeeksValue.length; i++) {
// for (let j = i + 1; j < this.allWeeksValue.length; j++) {
// if (this.allWeeksValue[i][0] === this.allWeeksValue[j][0] && this.allWeeksValue[i][1] === this.allWeeksValue[j][1]) {
// this.allWeeksValue.splice(i, 1)
// }
// }
// }
// }
// this.aWeekValue = []
// this.$refs.weekSelection.checkedValue = [] //
// console.log(this.allWeeksValue)
},
//
// async cancelSelection() {
// for (let i = 0; i < this.allWeeksValue.length; i++) {
// if (this.aWeekValue[0] === this.allWeeksValue[i][0] && this.aWeekValue[1] === this.allWeeksValue[i][1]) {
// this.allWeeksValue.splice(i, 1)
// console.log(this.allWeeksValue)
// }
// }
// this.aWeekValue = []
// this.perTargetValue.style.backgroundColor = ''
// this.perTargetValue.textContent = ''
// //allWeeksValue
// // if (this.perTargetValue!=''){
// // this.allWeeksValue.pop()
// // }
// this.weekDialog = false
// },
//
// async setWeeks() {
// console.log(this.allWeeksValue)
// await post('/lb_teacher_applyLab', {
// weeks: this.allWeeksValue,
// year: this.$refs.timeSelection.year,
// semester: this.$refs.timeSelection.semester,
// position: this.form.position,
// name: this.form.name,
// date: this.form.date,
// nickname: this.form.nickname,
// tel: this.form.tel,
// course_name: this.form.course_name,
// class: this.form.class,
// population: this.form.population,
// remind: this.form.remind
// })
// // this.form.schedule=this.allWeeksValue.toString()
// this.courseDialog = false
// // console.log(this.$refs.times)
// this.tableAlive = false
//
// },
//
// cancelSetWeeks: function () {
// this.allWeeksValue = []
// this.form.schedule = ""
// this.courseDialog = false
// this.formDialog = true
// console.log(this.allWeeksValue)
// this.tableAlive = false //
// },
setTime: function () {
// alert('便')
// this.courseDialog = true
this.$refs.courseForm.validate(async (valid) => {
if (valid) {
console.log(this)
@ -316,6 +226,16 @@
}
})
},
setTime:function(){
this.$refs.courseForm.validate(async (valid)=>{
if (valid){
await this.getScheduleAble()
this.$refs.times.lab = this.lab
this.$refs.times.courseDialog = true
this.formDialog = false
}
})
},
cancelAppy: function () {
this.formDialog = false
},
@ -341,7 +261,7 @@
const schedule = await get('lb/labTime/getLabScheduleAbleBook', params)
const booked = await get('lb/labrecord/getWeekBooked', params)
this.booked = booked
console.log(this.booked)
// console.log(this.booked)
for (let i = 0; i < schedule.length; i++) {
this.$refs.times.tableData[i].Monday = arr2shortString(schedule[i][0]) ? '<span style="color:#1989fa">' + arr2shortString(schedule[i][0]) + '周可预约' + '</span>' : ''
this.$refs.times.tableData[i].Tuesday = arr2shortString(schedule[i][1]) ? '<span style="color:#1989fa">' + arr2shortString(schedule[i][1]) + '周可预约' + '</span>' : ''
@ -378,21 +298,32 @@
}
}
},
computed:{
tableDataFilter(){
return this.tableData.filter(data=>{
if (this.search==="")
{
return data!==""
}else {
return
{
data.position.toLowerCase().includes(this.search.toLowerCase()) ||
data.name.toLowerCase().includes(this.search.toLowerCase()) ||
data.date.toLowerCase().includes(this.search.toLowerCase()) ||
data.nickname.toLowerCase().includes(this.search.toLowerCase()) ||
data.tel.toLowerCase().includes(this.search.toLowerCase()) ||
data.course_name.toLowerCase().includes(this.search.toLowerCase()) ||
data.class.toLowerCase().includes(this.search.toLowerCase()) ||
data.population.toLowerCase().includes(this.search.toLowerCase()) ||
data.schedule.toLowerCase().includes(this.search.toLowerCase()) ||
data.remind.toLowerCase().includes(this.search.toLowerCase())
}
}
})
}
},
//mouted
async mounted() {
// this.courseOption = get('',this.u_id) //id
//
// this.courseOption = [{
// year: '1819',
// semester: '2',
// uc_id: '12345677',
// name: '',
// software: 'Webstorm',
// classes: '6',
// population: '41',
// isHaveDocuments: '1',
// remind: '',
// }]
this.tableData = await get('/lb/lab/getLabList')
this.user = await get('lb/user/getUserInfo')
await this.loadCourse()

@ -1,6 +1,5 @@
<template>
<div>
<nav-bar></nav-bar>
<time-select style="margin-top: 20px" ref="timeSelect" @selectYear="load" @selectSemester="load"></time-select>
<div style="margin-bottom: 10px">
<el-row :gutter="20">
@ -118,7 +117,6 @@
</template>
<script>
import navBar from "~/components/teacher/navBar";
import timeSelect from "~/components/timeSelect";
import {get, post} from "~/utils";
import {showDialog, showFail, showSuccess} from "~/utils/dialog";
@ -126,7 +124,7 @@
export default {
name: "courseManagement",
components: {navBar, timeSelect},
components: {timeSelect},
data() {
return {
search: '',

@ -1,19 +0,0 @@
<template>
<div>
<router-view> </router-view>
</div>
</template>
<script>
import navBar from "~/components/teacher/navBar";
export default {
name: "empty",
components:{
navBar
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,64 @@
<template>
<div>
<home :names="homeParams" :user="nickname" @back="backLogin" @goPersonal="goPersonal" style="float: top"></home>
</div>
</template>
<script>
import home from "~/components/teacher/home";
import {get} from "~/utils";
import {showSuccess} from "~/utils/dialog";
export default {
components: {
home
},
data() {
return {
nickname: '未登录',
homeParams: [
{
name: '个人中心', func: () => {
console.log(this.$router)
this.$router.push('/teacher/personal')
}
},
{
name: '申请实验室', func: () => {
this.$router.push('/teacher/applyLab')
}
},
{
name: '我的课表', func: () => {
this.$router.push('/teacher/myCourse')
}
},
{
name:'课程管理',func:()=>{
this.$router.push('/teacher/courseManagement')
}
}
]
}
},
methods: {
async backLogin() {
await get('lb/user/logout')
await showSuccess("退出成功",this)
setTimeout(()=>{
this.$router.push('/login')
},1000)
},
goPersonal:function () {
this.$router.push('/teacher/personal')
}
},
async mounted() {
this.nickname = await get('lb/user/getUserName')
console.log(this.homeParams)
}
}
</script>
<style scoped>
</style>

@ -1,65 +1,20 @@
<template>
<div>
<!-- <img src='../../assets/images/59f28bee84ab0.jpg' style="width: 100%;height: 100%;opacity: 100%;">-->
<home :names="homeParams" :user="nickname" @back="backLogin" @goPersonal="goPersonal" style="float: top"></home>
<nav-bar v-if="$route.path!=='/teacher'"></nav-bar>
<router-view></router-view>
</div>
</template>
<script>
import home from "~/components/teacher/home";
import {get} from "~/utils";
import {showSuccess} from "~/utils/dialog";
import navBar from "~/components/teacher/navBar";
export default {
components: {
home
},
data() {
return {
nickname: '未登录',
homeParams: [
{
name: '个人中心', func: () => {
console.log(this.$router)
this.$router.push('/teacher/personal')
}
},
{
name: '申请实验室', func: () => {
this.$router.push('/teacher/applyLab')
}
},
{
name: '我的课表', func: () => {
this.$router.push('/teacher/myCourse')
}
},
{
name:'课程管理',func:()=>{
this.$router.push('/teacher/courseManagement')
}
}
]
}
},
methods: {
async backLogin() {
await get('lb/user/logout')
await showSuccess("退出成功",this)
setTimeout(()=>{
this.$router.push('/login')
},1000)
},
goPersonal:function () {
this.$router.push('/teacher/personal')
}
},
async mounted() {
this.nickname = await get('lb/user/getUserName')
console.log(this.homeParams)
name: "index",
components:{
navBar
}
}
</script>
<style scoped>
</style>

@ -1,9 +1,6 @@
<template>
<div>
<el-container>
<el-header style="padding: 0">
<nav-bar></nav-bar>
</el-header>
<el-main>
<el-header>
<div>
@ -45,12 +42,11 @@
<script>
import tb_course from "~/components/tb_course";
import navBar from "~/components/teacher/navBar";
import {get} from "~/utils";
export default {
components: {
tb_course,
navBar
tb_course
},
data() {
return {

@ -1,7 +1,5 @@
<template>
<div>
<!-- 导航栏-->
<nav-bar></nav-bar>
<!-- 学年/学期-->
<time-select ref="timeSelect" @selectYear="load" @selectSemester="load" ></time-select>
<!-- 课程表-->
@ -12,7 +10,6 @@
<script>
import tb_course from "~/components/tb_course";
import navBar from "~/components/teacher/navBar";
import timeSelect from "~/components/timeSelect";
import {get} from "~/utils";
import {item2html} from "~/utils/converter";
@ -21,7 +18,6 @@
name: "myCourse1",
components: {
tb_course,
navBar,
timeSelect
},
data() {

@ -1,8 +1,5 @@
<template>
<div>
<el-container>
<el-header style="padding: 0"><nav-bar ></nav-bar></el-header>
</el-container>
<el-container>
<el-aside width="300px">
<personal-aside></personal-aside>
@ -15,12 +12,11 @@
</template>
<script>
import navBar from "~/components/teacher/navBar";
import personalMessage from "~/components/personalMessage";
import personalAside from "~/components/personalAside";
export default {
components: {personalMessage,navBar, personalAside},
components: {personalMessage, personalAside},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath);

Loading…
Cancel
Save