[fix][V]:完善课表组件

master
Romesum 5 years ago
parent ab93e1823f
commit df5131bfe7

@ -6,51 +6,72 @@
<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">
{{scope.row.Monday.name}} &nbsp;<br>
{{scope.row.Monday.classes}} &nbsp; {{scope.row.Monday.population}}<br>
{{scope.row.Monday.software}}
<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">
{{scope.row.Tuesday.name}} &nbsp;<br>
{{scope.row.Tuesday.classes}} &nbsp; {{scope.row.Tuesday.population}}<br>
{{scope.row.Tuesday.software}}
<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">
{{scope.row.Wednesday.name}} &nbsp;<br>
{{scope.row.Wednesday.classes}} &nbsp; {{scope.row.Wednesday.population}}<br>
{{scope.row.Wednesday.software}}
<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">
{{scope.row.Thursday.name}} &nbsp;<br>
{{scope.row.Thursday.classes}} &nbsp; {{scope.row.Thursday.population}}<br>
{{scope.row.Thursday.software}}
<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">
{{scope.row.Friday.name}} &nbsp;<br>
{{scope.row.Friday.classes}} &nbsp; {{scope.row.Friday.population}}<br>
{{scope.row.Friday.software}}
<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">
{{scope.row.Saturday.name}} &nbsp;<br>
{{scope.row.Saturday.classes}} &nbsp; {{scope.row.Saturday.population}}<br>
{{scope.row.Saturday.software}}
<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">
{{scope.row.Sunday.name}} &nbsp;<br>
{{scope.row.Sunday.classes}} &nbsp; {{scope.row.Sunday.population}}<br>
{{scope.row.Sunday.software}}
<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>
@ -65,12 +86,17 @@
export default {
name: "tb_course",
components: {navBar},
props: ['tableLabel', 'cClick', 'cStyle',],
props: {
tableLabel: {},
cClick: {},
cStyle: {},
custom: {default: false},
data: {default: () => []}
},
data() {
return {
item: '',
courseDialog: false,
data: [],
tableData: [
{
index: 1, daytime: '上午', time: '第一节', Monday: '', Tuesday: '', Wednesday: '', Thursday: '',
@ -113,7 +139,6 @@
}
},
mounted() {
console.log('aaaaaaaaaaaaaaa')
// this.data = [
// [
// {
@ -202,15 +227,15 @@
// }
// ]
// ]
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]
}
// 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>

Loading…
Cancel
Save