luohairen
2024-10-30 e0840398a505c912bd35c92cb1d0d6c40c35620c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
  <div class="list-container w-full h-full">
    <div class="list-content w-full overflow-x-hidden">
      <el-row :gutter="10">
        <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" style="position: relative">
              <div class="info-text" style="position: absolute; top: 2px; right: 2px">
                <el-tag type="info" effect="dark" v-if="item.status === 0">
                  待开始
                </el-tag>
                <el-tag type="danger" effect="dark" v-else-if="item.status === 1">
                  进行中
                </el-tag>
                <el-tag type="warning" effect="dark" v-else-if="item.status === 2">
                  已结束
                </el-tag>
              </div>
              <div class="info-title">{{ item.meetName }}</div>
              <div class="info-teacherName" style="margin-top: 5px">
                <div class="info-label" style="flex: 1">主讲:</div>
                <div class="info-text" style="flex:6">{{ item.teacherNamesStr }}</div>
              </div>
              <div class="info-time" style="margin-top: 10px">
                <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)" type="primary" size="small">开始上课</el-button>
                <el-button @click="handleUpdate(item)" type="warning" size="small">编辑</el-button>
                <el-popconfirm
                  style="margin: 0 5px"
                  title="确定要删除该培训吗?"
                  @confirm="remove(item)"
                >
                  <el-button slot="reference" type="danger" size="small" >删除</el-button>
                </el-popconfirm>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
 
<script>
 
import examPaperApi from "@/api/examPaper";
 
export default {
  props: {
    tableData: []
  },
  methods: {
    handleUpdate (item) {
      this.$emit('handleUpdate', item)
    },
    remove (item) {
      this.$confirm('此操作将永久删除该成员, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        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;
  height: 330px;
}
 
.item-info {
  padding: 12px;
  color: #8a8a8a;
}
.info-teacherName {
  display: flex;
  flex-direction: row;
  font-size: 14px;
}
.info-label {
  display: flex;
  flex-wrap: nowrap;
}
.info-text {
  display: flex;
  flex-wrap: wrap;
}
 
.info-title {
  font-weight: bold;
}
 
.info-time {
  display: flex;
}
 
.margin-col {
  margin-bottom: 20px;
}
 
.width-img {
  width: 100%;
}
 
.button-container {
  display: flex;
  margin-top: 10px;
}
</style>