train.vue 874 Bytes
<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>