train.vue
874 Bytes
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
<template>
<div>
<el-row>
<el-col v-for="l in list" :key="l.id" :span="24">
<train-card :data="l" :h="false" @click="goTrainDetail(l.id)">
<span class="roundLabel bg-primary" @click.stop="downloadCert(l.id)">下载证书</span>
</train-card>
</el-col>
</el-row>
<el-empty v-if="list.length==0" />
</div>
</template>
<script setup>
import { ref } from 'vue'
import { getMyTrain } from '@/apiPc/train'
import TrainCard from '@/viewsPc/components/trainCard'
const emit = defineEmits(['showTrain', 'showSign'])
const list = ref([])
function init() {
getMyTrain().then(res => {
list.value = res.rows
})
}
function goTrainDetail(id) {
emit('showTrain', id)
}
function showSignInfo(id) {
emit('showSign', { id })
}
function downloadCert(id) {
}
defineExpose({
init
})
</script>
<style scoped>
</style>