<template>
  <a-card :bordered="false" title="终端培训详情">
    <template slot="extra">
      <a-button size="small" @click="close">返回</a-button>
    </template>
    <a-descriptions title="集中培训详情" layout="horizontal" bordered size="small" :column="1">
      <a-descriptions-item label="培训名称">{{detailData.name}}</a-descriptions-item>
      <a-descriptions-item label="培训时间">{{detailData.time}}</a-descriptions-item>
      <a-descriptions-item label="主持人">{{detailData.host}}</a-descriptions-item>
      <a-descriptions-item label="会议人数">{{detailData.personSize}}</a-descriptions-item>
      <a-descriptions-item label="学习内容">{{detailData.studyContent}}</a-descriptions-item>
      <a-descriptions-item label="联系人">{{detailData.contact}}</a-descriptions-item>
      <a-descriptions-item label="备注">{{detailData.remark}}</a-descriptions-item>
    </a-descriptions>
    <br />
    <a-descriptions title="签到时间" layout="horizontal" bordered size="small" :column="1">
      <a-descriptions-item label="时间">{{detailData.signInTime}}</a-descriptions-item>
    </a-descriptions>
    <br />
    <a-descriptions title="培训状态" layout="horizontal" bordered size="small" :column="1">
      <a-descriptions-item label="状态">{{detailData.state}}</a-descriptions-item>
    </a-descriptions>
  </a-card>
</template>

<script>
import { getArchivesUserTerminalTrainDetail } from '@/api/archives/user'

export default {
  data() {
    return {
      queryParam: { userId: this.$route.query.userId, projectId: this.$route.query.projectId },
      detailData: {}
    }
  },
  created: function () {
    let parameter = {};
    getArchivesUserTerminalTrainDetail(Object.assign(parameter, this.queryParam)).then(res => { this.detailData = res.data });
  },
  methods: {
    close() {
      this.$router.push({
        path: '/archives/user/Project', query: {
          id: this.$route.query.userId,
          archivesUserName: this.$route.query.archivesUserName,
          archivesUserOrgId: this.$route.query.archivesUserOrgId,
          archivesUserPageNum: this.$route.query.archivesUserPageNum,
          archivesUserProjectTable2projectName: this.$route.query.archivesUserProjectTable2projectName,
          archivesUserProjectTable2PageNum: this.$route.query.archivesUserProjectTable2PageNum,
          defaultActiveKey: this.$route.query.defaultActiveKey
        }
      });
    }
  }
}
</script>

<style>
.ant-descriptions-item-label {
  width: 100px;
  text-align: center;
}
</style>