zhangwencui
8 天以前 03e1f933ce9771a7cdacddbff5be7186ba1d4718
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<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>