<template>
|
<view class="danger-investigation-view">
|
<PageHeader title="培训详情"
|
@back="goBack" />
|
<!-- 内容容器 -->
|
<view class="detail-content">
|
<!-- 培训信息 -->
|
<view class="info-section">
|
<!-- <view class="section-title">培训信息</view> -->
|
<view class="info-grid">
|
<view class="info-item">
|
<text class="info-label">课程编号</text>
|
<text class="info-value">{{ form.courseCode || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训日期</text>
|
<text class="info-value">{{ form.trainingDate || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">开始时间</text>
|
<text class="info-value">{{ form.openingTime || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">结束时间</text>
|
<text class="info-value">{{ form.endTime || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训目标</text>
|
<text class="info-value">{{ form.trainingObjectives || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">参加对象</text>
|
<text class="info-value">{{ form.participants || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训内容</text>
|
<text class="info-value">{{ form.trainingContent || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训讲师</text>
|
<text class="info-value">{{ form.trainingLecturer || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">项目学分</text>
|
<text class="info-value">{{ form.projectCredits || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训方式</text>
|
<text class="info-value">{{ getTrainingModeLabel(form.trainingMode) || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">培训地点</text>
|
<text class="info-value">{{ form.placeTraining || '-' }}</text>
|
</view>
|
<view class="info-item">
|
<text class="info-label">课时</text>
|
<text class="info-value">{{ form.classHour || '-' }}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script setup>
|
import { ref, onMounted } from "vue";
|
import PageHeader from "@/components/PageHeader.vue";
|
import { onLoad } from "@dcloudio/uni-app";
|
import { useDict } from "@/utils/dict";
|
// 替换 toast 方法
|
defineOptions({ name: "safety-training-view" });
|
const showToast = message => {
|
uni.showToast({ title: message, icon: "none" });
|
};
|
|
// 获取字典数据
|
const { safe_training_methods } = useDict("safe_training_methods");
|
|
// 获取培训方式标签
|
const getTrainingModeLabel = val => {
|
if (!safe_training_methods || !Array.isArray(safe_training_methods.value)) {
|
return val;
|
}
|
const item = safe_training_methods.value.find(
|
i => String(i.value) === String(val)
|
);
|
return item ? item.label : val;
|
};
|
|
// 培训信息
|
const form = ref({});
|
|
// 返回上一页
|
const goBack = () => {
|
uni.navigateBack();
|
};
|
|
onLoad(() => {
|
// 从本地存储获取培训信息
|
const safetyTraining = uni.getStorageSync("safetyTraining");
|
if (safetyTraining) {
|
form.value = safetyTraining;
|
}
|
});
|
</script>
|
|
<style scoped lang="scss">
|
@import "../../../styles/sales-common.scss";
|
|
.danger-investigation-view {
|
min-height: 100vh;
|
background: #f8f9fa;
|
padding-bottom: 2rem;
|
}
|
|
.detail-content {
|
padding: 20px;
|
}
|
|
.info-section {
|
background: #ffffff;
|
border-radius: 12px;
|
padding: 24px;
|
margin-bottom: 24px;
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
}
|
|
.section-title {
|
padding: 1rem;
|
font-size: 1rem;
|
font-weight: 500;
|
color: #303133;
|
background: #f5f5f5;
|
border-bottom: 1px solid #e4e7ed;
|
}
|
|
.info-content {
|
padding: 1rem;
|
}
|
.info-grid {
|
display: grid;
|
grid-template-columns: 1fr 1fr;
|
gap: 20px;
|
}
|
.info-item {
|
display: flex;
|
flex-direction: column;
|
gap: 8px;
|
}
|
.info-item:last-child {
|
margin-bottom: 0;
|
}
|
|
.info-label {
|
font-size: 14px;
|
color: #909399;
|
}
|
|
.info-value {
|
font-size: 14px;
|
color: #303133;
|
word-break: break-all;
|
}
|
|
.description-content {
|
padding: 1rem;
|
font-size: 0.875rem;
|
color: #303133;
|
line-height: 1.5;
|
}
|
</style>
|