[feat][V]:添加实验室修改时间段时Dialog的title

master
Romesum 5 years ago
parent 1657b2cb9f
commit 678cc27dc5

@ -108,7 +108,7 @@
<!-- icon="el-icon-delete">删除-->
<!-- </el-button>-->
<el-button @click="schedulePreview(scope.row.lab_id)" size="mini" plain>查看课表</el-button>
<el-button @click="editSchedule(scope.row.lab_id)" type="primary" size="mini" icon="el-icon-edit"
<el-button @click="editSchedule(scope.row)" type="primary" size="mini" icon="el-icon-edit"
plain>修改可预约时间段
</el-button>
</template>
@ -214,9 +214,9 @@
async schedulePreview() {
await showFail('尚未开发', this)
},
async editSchedule(lab_id) {
console.log(this.$refs.setLabTime)
this.$refs.setLabTime.form.labId = lab_id
async editSchedule(item) {
this.$refs.setLabTime.lab = item
this.$refs.setLabTime.form.labId = item.lab_id
this.$refs.setLabTime.setLabTimeDialog = true
}
},

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog :visible="setLabTimeDialog" @close="setLabTimeDialog=false">
<el-dialog :visible="setLabTimeDialog" @close="setLabTimeDialog=false" :title="lab.position+' '+lab.name">
<el-form :model="form">
<el-form-item label="学年:">
<el-select v-model="form.year" size="small">
@ -26,20 +26,14 @@
</el-form-item>
<el-form-item label="星期:">
<el-input v-model="form.time" @focus="showCourseDialog" placeholder="点我设置" style="width: 200px">
</el-input>
<el-button type="primary" style="width: 200px" @click="showCourseDialog"></el-button>
</el-form-item>
</el-form>
</el-dialog>
<!-- 表格节数选择-->
<el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false" v-if="tableAlive">
<tb_course :cClick="cellClick" :cStyle="cellStyle" table-label="" ref="times"></tb_course>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelSetWeeks"> </el-button>
<el-button type="primary" @click="setWeeks"> </el-button>
</span>
</el-dialog>
<!-- checkbox:周次选择-->
<el-dialog :visible.sync="weekDialog" title="请选择周数" width="400px" :close-on-click-modal="false" append-to-body>
<week-selection @add="addWeek" @cancel="cancelSelection" ref="weekSelection"
@ -59,6 +53,10 @@
components: {weekSelection, tb_course},
data() {
return {
lab: {
name: '',
position: ''
},
form: {
year: '2019',
semester: 2
@ -104,8 +102,9 @@
methods: {
//
async showCourseDialog() {
this.$refs.times.lab = this.lab
this.tableAlive = true
this.courseDialog = true
this.$refs.times.courseDialog = true
},
//
cellStyle: function ({row, column, rowIndex, columnIndex}) {
@ -187,7 +186,7 @@
console.log(this.$refs.times)
console.log(this.allWeeksValue)
// this.form.schedule=this.allWeeksValue.toString()
this.courseDialog = false
this.$refs.times.courseDialog = false
// console.log(this.$refs.times)
this.tableAlive = false
if (this.allWeeksValue.length !== 0) {
@ -199,7 +198,7 @@
cancelSetWeeks: function () {
this.allWeeksValue = []
this.form.schedule = ""
this.courseDialog = false
this.$refs.times.courseDialog = false
this.formDialog = true
console.log(this.allWeeksValue)
this.tableAlive = false //

@ -1,5 +1,6 @@
<template>
<div>
<el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false" :title="lab.position+' '+lab.name">
<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>
@ -55,6 +56,7 @@
</el-table-column>
</el-table-column>
</el-table>
</el-dialog>
</div>
</template>
@ -69,6 +71,11 @@
data() {
return {
item: '',
lab: {
name: '',
position: ''
},
courseDialog:false,
data: [],
tableData: [
{

@ -148,6 +148,7 @@
},
//
async cellClick(row, column, cell, event) {
this.form.weeks = null
this.form.day = column.index
this.form.time = row.index
this.form.year = this.$refs.timeSelection.year
@ -240,22 +241,22 @@
// 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()
// 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.weekDialog = false
},
// }
// 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)
@ -280,14 +281,14 @@
//
// },
//
cancelSetWeeks: function () {
this.allWeeksValue = []
this.form.schedule = ""
this.courseDialog = false
this.formDialog = true
console.log(this.allWeeksValue)
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 () {
this.tableAlive = true
// alert('便')

Loading…
Cancel
Save