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

master
Romesum 5 years ago
parent 1657b2cb9f
commit 678cc27dc5

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

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

@ -1,5 +1,6 @@
<template> <template>
<div> <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 :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle">
<el-table-column :label="tableLabel" align="center "> <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="daytime" label="" fixed align="center" width="60"></el-table-column>
@ -55,6 +56,7 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-dialog>
</div> </div>
</template> </template>
@ -69,6 +71,11 @@
data() { data() {
return { return {
item: '', item: '',
lab: {
name: '',
position: ''
},
courseDialog:false,
data: [], data: [],
tableData: [ tableData: [
{ {

@ -148,6 +148,7 @@
}, },
// //
async cellClick(row, column, cell, event) { async cellClick(row, column, cell, event) {
this.form.weeks = null
this.form.day = column.index this.form.day = column.index
this.form.time = row.index this.form.time = row.index
this.form.year = this.$refs.timeSelection.year this.form.year = this.$refs.timeSelection.year
@ -240,22 +241,22 @@
// console.log(this.allWeeksValue) // console.log(this.allWeeksValue)
}, },
// //
async cancelSelection() { // async cancelSelection() {
for (let i = 0; i < this.allWeeksValue.length; i++) { // for (let i = 0; i < this.allWeeksValue.length; i++) {
if (this.aWeekValue[0] === this.allWeeksValue[i][0] && this.aWeekValue[1] === this.allWeeksValue[i][1]) { // if (this.aWeekValue[0] === this.allWeeksValue[i][0] && this.aWeekValue[1] === this.allWeeksValue[i][1]) {
this.allWeeksValue.splice(i, 1) // this.allWeeksValue.splice(i, 1)
console.log(this.allWeeksValue) // console.log(this.allWeeksValue)
}
}
this.aWeekValue = []
this.perTargetValue.style.backgroundColor = ''
this.perTargetValue.textContent = ''
//allWeeksValue
// if (this.perTargetValue!=''){
// this.allWeeksValue.pop()
// } // }
this.weekDialog = false // }
}, // this.aWeekValue = []
// this.perTargetValue.style.backgroundColor = ''
// this.perTargetValue.textContent = ''
// //allWeeksValue
// // if (this.perTargetValue!=''){
// // this.allWeeksValue.pop()
// // }
// this.weekDialog = false
// },
// //
// async setWeeks() { // async setWeeks() {
// console.log(this.allWeeksValue) // console.log(this.allWeeksValue)
@ -280,14 +281,14 @@
// //
// }, // },
// //
cancelSetWeeks: function () { // cancelSetWeeks: function () {
this.allWeeksValue = [] // this.allWeeksValue = []
this.form.schedule = "" // this.form.schedule = ""
this.courseDialog = false // this.courseDialog = false
this.formDialog = true // this.formDialog = true
console.log(this.allWeeksValue) // console.log(this.allWeeksValue)
this.tableAlive = false // // this.tableAlive = false //
}, // },
setTime: function () { setTime: function () {
this.tableAlive = true this.tableAlive = true
// alert('便') // alert('便')

Loading…
Cancel
Save