|
|
@@ -0,0 +1,429 @@
|
|
|
+<template>
|
|
|
+ <div class="training-detail">
|
|
|
+ <!-- 1. 头部:标题与签到状态 -->
|
|
|
+ <div class="td-header">
|
|
|
+ <div class="td-header__left">
|
|
|
+ <el-tag size="small" effect="plain" class="td-tag">{{ dialogInfoPropsData.categoryName }}</el-tag>
|
|
|
+ <h2 class="td-title">{{ dialogInfoPropsData.trainingName }}</h2>
|
|
|
+ <span class="td-status-text">{{ dialogInfoPropsData.status==1?'未开始':(dialogInfoPropsData.status==2?'进行中':(dialogInfoPropsData.status==3?'已结束':'')) }}</span>
|
|
|
+ </div>
|
|
|
+ <!--<div class="td-header__right">-->
|
|
|
+ <!--<template v-if="detail.isSignIn">-->
|
|
|
+ <!--<i class="el-icon-circle-check td-sign-icon"></i>-->
|
|
|
+ <!--<span class="td-sign-text">已签到 {{ detail.signInTime }}</span>-->
|
|
|
+ <!--</template>-->
|
|
|
+ <!--<template v-else>-->
|
|
|
+ <!--<el-button type="primary" size="small" plain @click="handleSignIn">-->
|
|
|
+ <!--现场扫码签到-->
|
|
|
+ <!--</el-button>-->
|
|
|
+ <!--</template>-->
|
|
|
+ <!--</div>-->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 2. 基本信息 -->
|
|
|
+ <div class="td-section">
|
|
|
+ <div class="td-section__title">基本信息</div>
|
|
|
+ <el-descriptions :column="1" border class="td-desc" label-class-name="td-desc-label">
|
|
|
+ <el-descriptions-item label="培训时间">{{ newData.startDate }} 至 {{ newData.startDate }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训地点">{{ newData.locationText }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="组织单位">{{ newData.orgDeptName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训导师">{{ newData.speakerName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训时长">{{ newData.trainingDurationMinutes }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="可得学时">
|
|
|
+ <span class="text-orange">+ {{ newData.creditHours }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="可得积分">
|
|
|
+ <span class="text-orange-2">+ {{ newData.points }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 3. 培训说明 -->
|
|
|
+ <div class="td-section">
|
|
|
+ <div class="td-section__title">培训说明</div>
|
|
|
+ <div class="td-description">
|
|
|
+ <p class="td-desc-p">{{ detail.description }}</p>
|
|
|
+
|
|
|
+ <div class="td-notice-title">培训须知</div>
|
|
|
+ <ul class="td-notice-list">
|
|
|
+ <li v-for="(notice, index) in detail.notices" :key="index">{{ notice }}</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 4. 培训附件 -->
|
|
|
+ <div class="td-section">
|
|
|
+ <div class="td-section__title">培训附件</div>
|
|
|
+ <div class="td-file-list">
|
|
|
+ <div v-for="file in detail.attachments" :key="file.id" class="td-file-item">
|
|
|
+ <div class="td-file-icon">
|
|
|
+ <i class="el-icon-document"></i>
|
|
|
+ </div>
|
|
|
+ <div class="td-file-info">
|
|
|
+ <div class="td-file-name">{{ file.name }}</div>
|
|
|
+ <div class="td-file-meta">{{ file.type }} · {{ file.size }} · 上传于 {{ file.date }}</div>
|
|
|
+ </div>
|
|
|
+ <el-button size="small" plain class="td-file-btn" @click="handleViewFile(file)">查看</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="td-file-total">共 {{ detail.attachments.length }} 个附件</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 5. 培训证明(图片) -->
|
|
|
+ <div class="td-section">
|
|
|
+ <div class="td-section__title">培训证明</div>
|
|
|
+ <div class="td-image-list">
|
|
|
+ <div v-for="(img, index) in detail.proofs" :key="index" class="td-image-item">
|
|
|
+ <!-- 先用占位图,真实环境替换 :src -->
|
|
|
+ <el-image
|
|
|
+ :src="img.url"
|
|
|
+ fit="contain"
|
|
|
+ class="td-img"
|
|
|
+ :preview-src-list="[img.url]">
|
|
|
+ <div slot="error" class="image-slot">
|
|
|
+ <i class="el-icon-picture-outline"></i>
|
|
|
+ </div>
|
|
|
+ </el-image>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 6. 培训证书 -->
|
|
|
+ <div class="td-section">
|
|
|
+ <div class="td-section__title">培训证书</div>
|
|
|
+ <div class="td-file-item td-file-item--cert">
|
|
|
+ <div class="td-file-icon">
|
|
|
+ <i class="el-icon-document"></i>
|
|
|
+ </div>
|
|
|
+ <div class="td-file-info">
|
|
|
+ <div class="td-file-name">{{ detail.certificate.name }}</div>
|
|
|
+ </div>
|
|
|
+ <el-button size="small" plain class="td-file-btn" @click="handleViewFile(detail.certificate)">查看</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script> import {
|
|
|
+ examUserTrainingDetail
|
|
|
+} from "@/api/safetyEducationExaminationNew/index";
|
|
|
+ export default {
|
|
|
+ name: 'TrainingDetailContent',
|
|
|
+ props:{
|
|
|
+ dialogInfoPropsData: {},
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ newData: {},
|
|
|
+ total:0,
|
|
|
+ count:0,
|
|
|
+ percentage:0,
|
|
|
+ // 根据截图填充的占位数据
|
|
|
+ detail: {
|
|
|
+ type: '知识讲座',
|
|
|
+ title: '实验室生物安全操作规范培训',
|
|
|
+ status: '已结束',
|
|
|
+ isSignIn: true, // 控制右上角签到状态
|
|
|
+ signInTime: '2026-08-01 10:00:11',
|
|
|
+ basicInfo: {
|
|
|
+ time: '2026-08-01 10:00 - 12:00',
|
|
|
+ location: 'A101-理科大楼3层',
|
|
|
+ organizer: '生命科学学院',
|
|
|
+ mentor: '李教授',
|
|
|
+ duration: '120 分钟',
|
|
|
+ credit: '+ 2',
|
|
|
+ points: '+ 10'
|
|
|
+ },
|
|
|
+ description: '本次培训旨在提高实验室人员的生物安全意识与操作规范,内容涵盖实验室生物安全基本知识、个人防护装备的正确使用、生物废弃物处置规程及突发事件应急处置流程。',
|
|
|
+ notices: [
|
|
|
+ '请携带学生证或工作证参加培训,迟到 30 分钟以上将无法获得学时。',
|
|
|
+ '培训结束后请完成签到,未签到将不计入培训记录。',
|
|
|
+ '如有疑问请联系组织单位:生命科学学院教学办公室。'
|
|
|
+ ],
|
|
|
+ attachments: [
|
|
|
+ { id: 1, name: '实验室生物安全操作规范培训课件.pdf', type: 'PDF', size: '3.2 MB', date: '2026-07-25' },
|
|
|
+ { id: 2, name: '培训签到表模板.docx', type: 'Word', size: '128 KB', date: '2026-07-25' },
|
|
|
+ { id: 3, name: '培训场地平面图.png', type: 'PNG', size: '856 KB', date: '2026-07-26' }
|
|
|
+ ],
|
|
|
+ proofs: [
|
|
|
+ { id: 1, url: 'https://via.placeholder.com/300x200/0088cc/ffffff?text=Proof+Image+1' },
|
|
|
+ { id: 2, url: 'https://via.placeholder.com/300x200/0088cc/ffffff?text=Proof+Image+2' }
|
|
|
+ ],
|
|
|
+ certificate: {
|
|
|
+ id: 1,
|
|
|
+ name: '证书名称证书名称证书名称',
|
|
|
+ url: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.examUserTrainingDetail();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ examUserTrainingDetail(){
|
|
|
+ examUserTrainingDetail({id:this.dialogInfoPropsData.id}).then(response => {
|
|
|
+ this.$set(this,'newData',response.data);
|
|
|
+ if(response.data.trainingMode == 1 && response.data.coursewares){
|
|
|
+ const total = response.data.coursewares.length;
|
|
|
+ const count = response.data.coursewares.reduce((acc, cur) => acc + (cur.learnStatus === 1 ? 1 : 0), 0);
|
|
|
+ const percentage = total > 0 ? parseFloat(((count / total) * 100).toFixed(2)) : 0;
|
|
|
+ this.$set(this,'total ',total);
|
|
|
+ this.$set(this,'count ',count);
|
|
|
+ this.$set(this,'percentage',percentage);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSignIn() {
|
|
|
+ this.$message.info('请使用现场二维码完成签到')
|
|
|
+ },
|
|
|
+ handleViewFile(file) {
|
|
|
+ // TODO: 预览或下载逻辑
|
|
|
+ this.$message.info(`查看:${file.name}`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .training-detail {
|
|
|
+ height:700px;
|
|
|
+ overflow-y: scroll;
|
|
|
+ background-color: #f5f7fa; // 页面浅灰背景
|
|
|
+ padding: 16px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #303133;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 头部 */
|
|
|
+ .td-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding: 16px 20px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+
|
|
|
+ &__left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__right {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-tag {
|
|
|
+ color: #409eff;
|
|
|
+ border-color: #b3d8ff;
|
|
|
+ background-color: #ecf5ff;
|
|
|
+ margin-right: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 600;
|
|
|
+ margin: 0 12px 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-status-text {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #909399;
|
|
|
+ margin-right: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-sign-icon {
|
|
|
+ color: #67c23a;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-sign-text {
|
|
|
+ color: #67c23a;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 卡片通用 */
|
|
|
+ .td-section {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 20px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+
|
|
|
+ &__title {
|
|
|
+ position: relative;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ padding-left: 10px;
|
|
|
+ line-height: 1;
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 2px;
|
|
|
+ bottom: 2px;
|
|
|
+ width: 3px;
|
|
|
+ background-color: #409eff;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 基本信息 */
|
|
|
+ ::v-deep .td-desc .el-descriptions-item__label {
|
|
|
+ width: 140px;
|
|
|
+ background-color: #fafafa;
|
|
|
+ color: #606266;
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text-orange {
|
|
|
+ color: #1D55C2;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ .text-orange-2 {
|
|
|
+ color: #e6a23c;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 培训说明 */
|
|
|
+ .td-description {
|
|
|
+ color: #606266;
|
|
|
+ line-height: 1.6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-desc-p {
|
|
|
+ margin: 0 0 16px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-notice-title {
|
|
|
+ font-weight: 600;
|
|
|
+ color: #303133;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-notice-list {
|
|
|
+ margin: 0;
|
|
|
+ padding-left: 20px;
|
|
|
+
|
|
|
+ li {
|
|
|
+ margin-bottom: 6px;
|
|
|
+ &::marker {
|
|
|
+ color: #909399;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 附件列表 */
|
|
|
+ .td-file-list {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 12px 16px;
|
|
|
+ border: 1px solid #ebeef5;
|
|
|
+ border-radius: 4px;
|
|
|
+ background-color: #f9fafc;
|
|
|
+ transition: all 0.2s;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ border-color: #c0c4cc;
|
|
|
+ }
|
|
|
+
|
|
|
+ &--cert {
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-icon {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-right: 12px;
|
|
|
+ box-shadow: 0 1px 4px rgba(0,0,0,0.05);
|
|
|
+
|
|
|
+ i {
|
|
|
+ font-size: 20px;
|
|
|
+ color: #909399;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-info {
|
|
|
+ flex: 1;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-name {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #303133;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-meta {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #909399;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-btn {
|
|
|
+ margin-left: 16px;
|
|
|
+ color: #409eff;
|
|
|
+ border-color: #b3d8ff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-file-total {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #909399;
|
|
|
+ margin-top: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 培训证明图片 */
|
|
|
+ .td-image-list {
|
|
|
+ display: flex;
|
|
|
+ gap: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-image-item {
|
|
|
+ width: calc(50% - 8px);
|
|
|
+ border: 1px solid #ebeef5;
|
|
|
+ border-radius: 4px;
|
|
|
+ overflow: hidden;
|
|
|
+ background: #f5f7fa;
|
|
|
+ aspect-ratio: 4 / 3; // 保持比例
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .td-img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .image-slot {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ color: #909399;
|
|
|
+ font-size: 24px;
|
|
|
+ background: #f5f7fa;
|
|
|
+ }
|
|
|
+</style>
|