[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,13 +53,17 @@
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
}, },
setLabTimeDialog: false, setLabTimeDialog: false,
ableList: [], ableList: [],
weekDisable:[], weekDisable: [],
allWeeksValue: [], allWeeksValue: [],
aWeekValue: [], aWeekValue: [],
courseDialog: false, courseDialog: false,
@ -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}) {
@ -123,7 +122,7 @@
const weekAll = await get('lb/labTime/getWeeks', this.form) const weekAll = await get('lb/labTime/getWeeks', this.form)
const weekAble = await get("lb/labTime/getWeeksAbleBook", this.form) const weekAble = await get("lb/labTime/getWeeksAbleBook", this.form)
this.weekDisable = weekAll.filter(elem => !(weekAble.indexOf(elem) > -1)) this.weekDisable = weekAll.filter(elem => !(weekAble.indexOf(elem) > -1))
this.ableList = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18].filter(elem=> !(this.weekDisable.indexOf(elem) > -1)) this.ableList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18].filter(elem => !(this.weekDisable.indexOf(elem) > -1))
this.weekDialog = true this.weekDialog = true
// if (column.label != '') { // if (column.label != '') {
// this.weekDialog = true // this.weekDialog = true
@ -140,12 +139,12 @@
this.form.weeks = targetValue this.form.weeks = targetValue
// //
await showDialog("确认设置此时间段可预约吗?", this) await showDialog("确认设置此时间段可预约吗?", this)
for(let i in this.weekDisable){ for (let i in this.weekDisable) {
this.form.weeks.push(this.weekDisable[i]) this.form.weeks.push(this.weekDisable[i])
} }
console.log(this.form) console.log(this.form)
await post('lb/labTime/updateLabTime', this.form) await post('lb/labTime/updateLabTime', this.form)
await showSuccess("设置成功",this) await showSuccess("设置成功", this)
// if (targetValue.length !== 0) { // if (targetValue.length !== 0) {
// this.perTargetValue.textContent = '' + targetValue + '' // this.perTargetValue.textContent = '' + targetValue + ''
// this.aWeekValue.push(targetValue) //[rowIndex,column,targetValue] // this.aWeekValue.push(targetValue) //[rowIndex,column,targetValue]
@ -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,60 +1,62 @@
<template> <template>
<div> <div>
<el-table :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle"> <el-dialog :visible.sync="courseDialog" append-to-body :close-on-click-modal="false" :title="lab.position+' '+lab.name">
<el-table-column :label="tableLabel" align="center "> <el-table :data="tableData" :span-method="objectSpanMethod" @cell-click="cClick" :cell-style="cStyle">
<el-table-column prop="daytime" label="" fixed align="center" width="60"></el-table-column> <el-table-column :label="tableLabel" align="center ">
<el-table-column prop="time" label="" fixed align="center" width="100"></el-table-column> <el-table-column prop="daytime" label="" fixed align="center" width="60"></el-table-column>
<el-table-column :index="1" prop="Monday" label="星期一" align="center"> <el-table-column prop="time" label="" fixed align="center" width="100"></el-table-column>
<template slot-scope="scope"> <el-table-column :index="1" prop="Monday" label="星期一" align="center">
{{scope.row.Monday.name}} &nbsp;<br> <template slot-scope="scope">
{{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br> {{scope.row.Monday.name}} &nbsp;<br>
{{scope.row.Monday.software}} {{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br>
</template> {{scope.row.Monday.software}}
</template>
</el-table-column>
<el-table-column :index="2" prop="Tuesday" label="星期二" align="center">
<template slot-scope="scope">
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
</template>
</el-table-column>
<el-table-column :index="3" prop="Wednesday" label="星期三" align="center">
<template slot-scope="scope">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
</template>
</el-table-column>
<el-table-column :index="4" prop="Thursday" label="星期四" align="center">
<template slot-scope="scope">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
</template>
</el-table-column>
<el-table-column :index="5" prop="Friday" label="星期五" align="center">
<template slot-scope="scope">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
</template>
</el-table-column>
<el-table-column :index="6" prop="Saturday" label="星期六" align="center">
<template slot-scope="scope">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
</template>
</el-table-column>
<el-table-column :index="7" prop="Sunday" label="星期日" align="center">
<template slot-scope="scope">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
</template>
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column :index="2" prop="Tuesday" label="星期二" align="center"> </el-table>
<template slot-scope="scope"> </el-dialog>
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
</template>
</el-table-column>
<el-table-column :index="3" prop="Wednesday" label="星期三" align="center">
<template slot-scope="scope">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
</template>
</el-table-column>
<el-table-column :index="4" prop="Thursday" label="星期四" align="center">
<template slot-scope="scope">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
</template>
</el-table-column>
<el-table-column :index="5" prop="Friday" label="星期五" align="center">
<template slot-scope="scope">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
</template>
</el-table-column>
<el-table-column :index="6" prop="Saturday" label="星期六" align="center">
<template slot-scope="scope">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
</template>
</el-table-column>
<el-table-column :index="7" prop="Sunday" label="星期日" align="center">
<template slot-scope="scope">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
</template>
</el-table-column>
</el-table-column>
</el-table>
</div> </div>
</template> </template>
@ -65,10 +67,15 @@
export default { export default {
name: "tb_course", name: "tb_course",
components: {navBar}, components: {navBar},
props: ['tableLabel','cClick', 'cStyle',], props: ['tableLabel', 'cClick', 'cStyle',],
data() { data() {
return { return {
item: '', item: '',
lab: {
name: '',
position: ''
},
courseDialog:false,
data: [], data: [],
tableData: [ tableData: [
{ {
@ -113,94 +120,94 @@
}, },
mounted() { mounted() {
console.log('aaaaaaaaaaaaaaa') console.log('aaaaaaaaaaaaaaa')
// this.data = [ // this.data = [
// [ // [
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "Web", // "name": "Web",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// }, // },
// { // {
// "ucId": 1, // "ucId": 1,
// "name": "", // "name": "",
// "software": "IDEA", // "software": "IDEA",
// "year": "2019", // "year": "2019",
// "semester": 2, // "semester": 2,
// "population": 50, // "population": 50,
// "classes": "176", // "classes": "176",
// "remind": "", // "remind": "",
// "ishavedocuments": 1, // "ishavedocuments": 1,
// "uid": 1 // "uid": 1
// } // }
// ] // ]
// ] // ]
for (let i = 0; i < this.data.length; i++) { for (let i = 0; i < this.data.length; i++) {
this.tableData[i].Monday = this.data[i][0] this.tableData[i].Monday = this.data[i][0]
this.tableData[i].Tuesday = this.data[i][1] this.tableData[i].Tuesday = this.data[i][1]

@ -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.aWeekValue = []
this.perTargetValue.style.backgroundColor = '' // this.perTargetValue.style.backgroundColor = ''
this.perTargetValue.textContent = '' // this.perTargetValue.textContent = ''
//allWeeksValue // //allWeeksValue
// if (this.perTargetValue!=''){ // // if (this.perTargetValue!=''){
// this.allWeeksValue.pop() // // this.allWeeksValue.pop()
// } // // }
this.weekDialog = false // 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