<template>
|
<div class="list-container w-full h-full">
|
<div class="list-content w-full overflow-x-hidden">
|
<el-row :gutter="20">
|
<el-col :span="6" v-for="item in tableData" class="margin-col">
|
<el-card shadow="hover" class="list-card cursor-pointer" :body-style="{ padding: 0 }">
|
<div class="img-container w-full">
|
<img src="@/assets/list-card-bg.jpg" class="width-img">
|
</div>
|
<div class="item-info p-3">
|
<div class="info-title">{{ item.meetName }}</div>
|
<div class="info-teacherName">
|
<div class="info-label">主讲:</div>
|
<div class="info-text">{{ item.teacherName }}</div>
|
</div>
|
<div class="info-time">
|
<div class="info-label">状态:</div>
|
<div class="info-text">{{ translateStatus(item.status) }}</div>
|
</div>
|
<div class="info-time">
|
<div class="info-label">开始时间:</div>
|
<div class="info-text">{{ item.startTime }}</div>
|
</div>
|
<div class="info-time">
|
<div class="info-label">结束时间:</div>
|
<div class="info-text">{{ item.endTime }}</div>
|
</div>
|
<div class="button-container">
|
<el-button v-if="item.status!==2" @click="start(item)">开始上课</el-button>
|
<el-button @click="handleUpdate(item)">编辑</el-button>
|
<el-button @click="remove(item)">删除</el-button>
|
</div>
|
</div>
|
</el-card>
|
</el-col>
|
</el-row>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
|
export default {
|
props: {
|
tableData: []
|
},
|
methods: {
|
handleUpdate (item) {
|
this.$emit('handleUpdate', item)
|
},
|
remove (item) {
|
this.$emit('remove', item)
|
},
|
start (item) {
|
this.$emit('start', item)
|
},
|
translateStatus (status) {
|
if (status === 0) {
|
return '待开始'
|
} else if (status === 1) {
|
return '进行中'
|
} else {
|
return '已结束'
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.item {
|
width: 100%;
|
min-height: 120px;
|
}
|
|
.bottom-item {
|
margin-right: 30px;
|
}
|
|
.img-container {
|
object-fit: cover;
|
object-position: center;
|
width: 100%;
|
max-height: 160px;
|
overflow: hidden;
|
}
|
|
.list-card {
|
border-radius: 10px;
|
}
|
|
.item-info {
|
padding: 12px;
|
color: #8a8a8a;
|
}
|
|
.info-title {
|
font-weight: bold;
|
}
|
|
.info-teacherName {
|
display: flex;
|
font-size: 14px;
|
}
|
|
.info-time {
|
display: flex;
|
}
|
|
.margin-col {
|
margin-bottom: 20px;
|
}
|
|
.width-img {
|
width: 100%;
|
}
|
|
.button-container {
|
display: flex;
|
margin-top: 10px;
|
}
|
</style>
|