From 6ba30bed9eb241a76897ad04c01ac7c80be9add9 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 15 六月 2026 20:19:37 +0800
Subject: [PATCH] 提交山西比特维科技有限公司/山西金福恒远商贸有限公司配置文件

---
 src/views/safeProduction/safetyTrainingAssessment/index.vue | 1299 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1,299 insertions(+), 0 deletions(-)

diff --git a/src/views/safeProduction/safetyTrainingAssessment/index.vue b/src/views/safeProduction/safetyTrainingAssessment/index.vue
new file mode 100644
index 0000000..38c2172
--- /dev/null
+++ b/src/views/safeProduction/safetyTrainingAssessment/index.vue
@@ -0,0 +1,1299 @@
+<template>
+  <div class="app-container">
+    <div class="search_form">
+      <div>
+        <span class="search_title">鍩硅鏃ユ湡锛�</span>
+        <el-date-picker v-model="searchForm.trainingDate"
+                        value-format="YYYY-MM-DD"
+                        format="YYYY-MM-DD"
+                        @change="handleQuery"
+                        type="date"
+                        placeholder="璇烽�夋嫨"
+                        clearable />
+        <el-button type="primary"
+                   @click="handleQuery"
+                   style="margin-left: 10px">
+          鎼滅储
+        </el-button>
+      </div>
+      <div>
+        <el-button type="primary"
+                   @click="openForm('add')">鏂板鍩硅</el-button>
+        <el-button type="primary"
+                   @click="opendetail">鍩硅璁板綍</el-button>
+        <el-button type="danger"
+                   plain
+                   @click="handleDelete">鍒犻櫎</el-button>
+      </div>
+    </div>
+    <div class="table_list">
+      <el-tabs v-model="searchForm.state"
+               @tab-click="tabhandleQuery">
+        <el-tab-pane label="鏈紑濮�"
+                     :name="0"></el-tab-pane>
+        <el-tab-pane label="杩涜涓�"
+                     :name="1"></el-tab-pane>
+        <el-tab-pane label="宸茬粨鏉�"
+                     :name="2"></el-tab-pane>
+      </el-tabs>
+      <!-- state	鐘舵��(0锛氭湭寮�濮�1锛氳繘琛屼腑锛�2锛氬凡缁撴潫)	 -->
+      <PIMTable rowKey="id"
+                :column="tableColumn"
+                :tableData="tableData"
+                :page="page"
+                :isSelection="true"
+                @selection-change="handleSelectionChange"
+                :tableLoading="tableLoading"
+                @pagination="pagination"
+                :total="page.total"
+                :rowClassName="getRowClass"></PIMTable>
+    </div>
+    <!-- 鏂板/缂栬緫鐭ヨ瘑寮圭獥 -->
+    <el-dialog v-model="dialogVisible"
+               :title="dialogTitle"
+               width="800px"
+               :close-on-click-modal="false">
+      <el-form ref="formRef"
+               :model="form"
+               :rules="rules"
+               label-position="top"
+               label-width="150px">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩硅鏃ユ湡"
+                          prop="trainingDate">
+              <el-date-picker style="width: 100%"
+                              v-model="form.trainingDate"
+                              value-format="YYYY-MM-DD"
+                              format="YYYY-MM-DD"
+                              type="date"
+                              placeholder="璇烽�夋嫨"
+                              clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="璇剧▼缂栧彿"
+                          prop="courseCode">
+              <el-input v-model="form.courseCode"
+                        disabled
+                        placeholder="淇濆瓨鍚庤嚜鍔ㄧ敓鎴�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍒涘缓鏃堕棿"
+                          prop="createTime">
+              <el-date-picker style="width: 100%"
+                              v-model="formCreateTimeDate"
+                              value-format="YYYY-MM-DD"
+                              format="YYYY-MM-DD"
+                              type="date"
+                              placeholder="璇烽�夋嫨"
+                              clearable />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="寮�濮嬫椂闂�"
+                          prop="openingTime">
+              <el-time-picker v-model="form.openingTime"
+                              placeholder="璇烽�夋嫨"
+                              style="width: 100%"
+                              value-format="HH:mm:ss"
+                              format="HH:mm:ss"
+                              clearable />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="缁撴潫鏃堕棿"
+                          prop="endTime">
+              <el-time-picker v-model="form.endTime"
+                              placeholder="璇烽�夋嫨"
+                              style="width: 100%"
+                              value-format="HH:mm:ss"
+                              format="HH:mm:ss"
+                              clearable />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩硅鐩爣"
+                          prop="trainingObjectives">
+              <el-input v-model="form.trainingObjectives"
+                        placeholder="璇疯緭鍏ュ煿璁洰鏍�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鍙傚姞瀵硅薄"
+                          prop="participants">
+              <el-input v-model="form.participants"
+                        placeholder="璇疯緭鍏ュ弬鍔犲璞�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩硅鍐呭"
+                          prop="trainingContent">
+              <el-input v-model="form.trainingContent"
+                        placeholder="璇疯緭鍏ュ煿璁唴瀹�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鍩硅璁插笀"
+                          prop="trainingLecturer">
+              <el-input v-model="form.trainingLecturer"
+                        placeholder="璇疯緭鍏ュ煿璁甯�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="璇剧▼瀛﹀垎"
+                          prop="projectCredits">
+              <el-input v-model="form.projectCredits"
+                        type="number"
+                        min="0"
+                        placeholder="璇疯緭鍏ヨ绋嬪鍒�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="鍩硅鏂瑰紡"
+                          prop="trainingMode">
+              <el-select v-model="form.trainingMode"
+                         placeholder="璇烽�夋嫨鍩硅鏂瑰紡"
+                         clearable>
+                <el-option v-for="item in trainingModeOptions"
+                           :key="item.value"
+                           :label="item.label"
+                           :value="item.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍩硅鍦扮偣"
+                          prop="placeTraining">
+              <el-input v-model="form.placeTraining"
+                        placeholder="璇疯緭鍏ュ煿璁湴鐐�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="璇炬椂"
+                          prop="classHour">
+              <el-input v-model="form.classHour"
+                        type="number"
+                        min="0"
+                        placeholder="璇疯緭鍏ヨ鏃�" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button type="primary"
+                     @click="submitForm">纭畾</el-button>
+          <el-button @click="dialogVisible = false">鍙栨秷</el-button>
+        </span>
+      </template>
+    </el-dialog>
+    <!-- 鏌ョ湅鐭ヨ瘑璇︽儏寮圭獥 -->
+    <el-dialog v-model="viewDialogVisible"
+               title="缁撴灉鏄庣粏"
+               width="900px"
+               :close-on-click-modal="false">
+      <div class="knowledge-detail">
+        <div class="classtitle">璇剧▼璇︽儏</div>
+        <el-descriptions size="mini"
+                         border
+                         :column="3">
+          <el-descriptions-item label="璇剧▼缂栧彿:">{{ currentKnowledge.courseCode }}</el-descriptions-item>
+          <el-descriptions-item label="鍩硅鍐呭:">{{ currentKnowledge.trainingContent }}</el-descriptions-item>
+          <el-descriptions-item label="鐘舵��:">
+            <el-tag :type="currentKnowledge.status === 0 ? 'success' : (currentKnowledge.status === 1 ? 'success' : 'info')">
+              {{ currentKnowledge.status === 0 ? '鏈紑濮�' : (currentKnowledge.status === 1 ? '杩涜涓�' : '宸茬粨鏉�') }}
+            </el-tag>
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅璁插笀:">
+            {{ currentKnowledge.trainingLecturer }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅寮�濮嬫椂闂�:">
+            {{ currentKnowledge.trainingDate + ' ' + currentKnowledge.openingTime }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅缁撴潫鏃堕棿:">
+            {{ currentKnowledge.trainingDate + ' ' + currentKnowledge.endTime }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅鐩爣:">
+            {{ currentKnowledge.trainingObjectives }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鍙傚姞瀵硅薄:">
+            {{ currentKnowledge.participants }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅鏂瑰紡:">
+            <el-tag type="primary">
+              {{ getTrainingModeLabel(currentKnowledge.trainingMode) }}
+            </el-tag>
+          </el-descriptions-item>
+          <el-descriptions-item label="鍩硅鍦扮偣:">
+            {{ currentKnowledge.placeTraining }}
+          </el-descriptions-item>
+          <el-descriptions-item label="璇炬椂:">
+            {{ currentKnowledge.classHour }}
+          </el-descriptions-item>
+          <el-descriptions-item label="璇剧▼瀛﹀垎:">
+            {{ currentKnowledge.projectCredits }}
+          </el-descriptions-item>
+          <el-descriptions-item label="鎶ュ悕浜烘暟:">
+            {{ currentKnowledge.nums }}
+          </el-descriptions-item>
+          <el-descriptions-item label="闄勪欢鍒楄〃:">
+            <el-button type="primary"
+                       size="small"
+                       @click="openFileDialog(endform)">闄勪欢鍒楄〃</el-button>
+          </el-descriptions-item>
+        </el-descriptions>
+        <!-- <el-divider style="margin: 20px 0;" /> -->
+        <div class="classtitle"
+             style="margin-top: 40px;margin-bottom: 30px;">璇剧▼璇勪环</div>
+        <el-form ref="formRef"
+                 :model="form"
+                 :rules="rules"
+                 label-position="top"
+                 label-width="150px">
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="璇勪环浜�:"
+                            prop="courseCode">
+                <el-input v-model="endform.assessmentUserName"
+                          disabled
+                          placeholder="璇烽�夋嫨璇勪环浜�" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="璇勪环鏃堕棿:"
+                            prop="trainingDate">
+                <el-date-picker style="width: 100%"
+                                disabled
+                                v-model="endform.assessmentDate"
+                                value-format="YYYY-MM-DD"
+                                format="YYYY-MM-DD"
+                                type="date"
+                                placeholder="璇烽�夋嫨"
+                                clearable />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="鑰冩牳鏂瑰紡:"
+                            prop="assessmentMethod">
+                <el-input v-model="endform.assessmentMethod"
+                          placeholder="璇烽�夋嫨鑰冩牳鏂瑰紡" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="鏈璇剧▼缁煎悎璇勪环:"
+                            prop="comprehensiveAssessment">
+                <el-input v-model="endform.comprehensiveAssessment"
+                          placeholder="璇疯緭鍏ユ湰娆¤绋嬬患鍚堣瘎浠�" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-form-item label="鍩硅鎽樿:"
+                        prop="trainingAbstract">
+            <el-input v-model="endform.trainingAbstract"
+                      type="textarea"
+                      :rows="2"
+                      placeholder="璇疯緭鍏ュ煿璁憳瑕�" />
+          </el-form-item>
+          <!-- <el-row :gutter="30">
+            <el-col :span="24">
+              <el-form-item label="闄勪欢鏉愭枡锛�"
+                            prop="remark">
+                <el-upload v-model:file-list="fileList"
+                           :action="upload.url"
+                           multiple
+                           ref="fileUpload"
+                           auto-upload
+                           :headers="upload.headers"
+                           :before-upload="handleBeforeUpload"
+                           :on-error="handleUploadError"
+                           :on-success="handleUploadSuccess"
+                           :on-remove="handleRemove">
+                  <el-button type="primary"
+                             v-if="operationType !== 'view'">涓婁紶</el-button>
+                  <template #tip
+                            v-if="operationType !== 'view'">
+                    <div class="el-upload__tip">
+                      鏂囦欢鏍煎紡鏀寔
+                      doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z
+                    </div>
+                  </template>
+                </el-upload>
+              </el-form-item>
+            </el-col>
+          </el-row> -->
+        </el-form>
+        <div class="classtitle"
+             style="margin-top: 40px;">鑰冩牳鍒楄〃</div>
+        <el-table style="margin-top: 20px;"
+                  :data="endform.safeTrainingDetailsDtoList"
+                  border
+                  fit
+                  stripe
+                  highlight-current-row>
+          <el-table-column prop="nickName"
+                           label="濮撳悕" />
+          <el-table-column prop="phonenumber"
+                           label="鐢佃瘽鍙风爜" />
+          <el-table-column prop="examinationResults"
+                           label="鑰冩牳缁撴灉">
+            <template #default="scope">
+              <el-select v-model="scope.row.examinationResults"
+                         placeholder="璇烽�夋嫨鑰冩牳缁撴灉">
+                <el-option label="鍚堟牸"
+                           value="鍚堟牸" />
+                <el-option label="涓嶅悎鏍�"
+                           value="涓嶅悎鏍�" />
+              </el-select>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button type="primary"
+                     @click="submitForm2">鎻愪氦</el-button>
+          <el-button @click="viewDialogVisible = false">鍏抽棴</el-button>
+        </span>
+      </template>
+    </el-dialog>
+    <!--  todo 闄勪欢棰勮鐩稿叧 -->
+    <FileList v-if="fileDialogVisible"  v-model:visible="fileDialogVisible" record-type="safe_training" :record-id="recordId"  />
+  </div>
+</template>
+
+<script setup>
+  import { Search } from "@element-plus/icons-vue";
+  import {
+    onMounted,
+    ref,
+    reactive,
+    toRefs,
+    getCurrentInstance,
+    computed,
+  } from "vue";
+  import request from "@/utils/request";
+  import { getToken } from "@/utils/auth";
+  import { ElMessage, ElMessageBox } from "element-plus";
+  import PIMTable from "@/components/PIMTable/PIMTable.vue";
+  import { userListNoPage } from "@/api/system/user.js";
+  import {
+    safeTrainingListPage,
+    safeTrainingAdd,
+    safeTrainingExport,
+    safeTrainingDel,
+    safeTrainingFileListPage,
+    safeTrainingFileAdd,
+    safeTrainingFileDel,
+    safeTrainingSign,
+    safeTrainingGet,
+    safeTrainingSave,
+  } from "@/api/safeProduction/safetyTrainingAssessment.js";
+  import useUserStore from "@/store/modules/user";
+  import dayjs from "dayjs";
+  const userStore = useUserStore();
+  const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
+
+  // 琛ㄥ崟楠岃瘉瑙勫垯
+  const rules = {
+    trainingDate: [
+      { required: true, message: "璇烽�夋嫨鍩硅鏃ユ湡", trigger: "change" },
+    ],
+    openingTime: [
+      { required: true, message: "璇烽�夋嫨寮�濮嬫椂闂�", trigger: "change" },
+    ],
+    endTime: [{ required: true, message: "璇烽�夋嫨缁撴潫鏃堕棿", trigger: "change" }],
+    trainingContent: [
+      { required: true, message: "璇疯緭鍏ュ煿璁唴瀹�", trigger: "blur" },
+    ],
+    trainingLecturer: [
+      { required: true, message: "璇疯緭鍏ュ煿璁甯�", trigger: "blur" },
+    ],
+    classHour: [{ required: true, message: "璇疯緭鍏ヨ鏃�", trigger: "blur" }],
+  };
+  const upload = reactive({
+    // 涓婁紶鐨勫湴鍧�
+    url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
+    // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+    headers: { Authorization: "Bearer " + getToken() },
+  });
+  // 鍝嶅簲寮忔暟鎹�
+  const data = reactive({
+    searchForm: {
+      trainingDate: "",
+      state: 0,
+    },
+    tableLoading: false,
+    page: {
+      current: 1,
+      size: 20,
+      total: 0,
+    },
+    tableData: [],
+    selectedIds: [],
+    form: {
+      courseCode: "", // 璇剧▼缂栧彿
+      trainingDate: "", // 鍩硅鏃ユ湡
+      openingTime: "", // 寮�濮嬫椂闂�
+      endTime: "", // 缁撴潫鏃堕棿
+      trainingObjectives: "", // 鍩硅鐩爣
+      participants: "", // 鍙傚姞瀵硅薄
+      trainingContent: "", // 鍩硅鍐呭
+      trainingLecturer: "", // 鍩硅璁插笀
+      projectCredits: "", // 椤圭洰瀛﹀垎
+      trainingMode: "", // 鍩硅鏂瑰紡
+      placeTraining: "", // 鍩硅鍦扮偣
+      classHour: "", // 璇炬椂
+      createTime: "", // 鍒涘缓鏃堕棿
+    },
+    dialogVisible: false,
+    dialogTitle: "",
+    dialogType: "add",
+    viewDialogVisible: false,
+    currentKnowledge: {},
+  });
+  const formCreateTimeDate = computed({
+    get: () => (form.value.createTime ? String(form.value.createTime).split(" ")[0] : ""),
+    set: (value) => {
+      form.value.createTime = value ? `${value} ${dayjs().format("HH:mm:ss")}` : "";
+    },
+  });
+
+  const {
+    searchForm,
+    tableLoading,
+    page,
+    tableData,
+    selectedIds,
+    form,
+    dialogVisible,
+    dialogTitle,
+    dialogType,
+    viewDialogVisible,
+    currentKnowledge,
+  } = toRefs(data);
+  const { proxy } = getCurrentInstance();
+  const { safe_training_methods } = proxy.useDict("safe_training_methods");
+  const trainingModeOptions = computed(() => safe_training_methods?.value || []);
+  const getTrainingModeLabel = val => {
+    const item = trainingModeOptions.value.find(
+      i => String(i.value) === String(val)
+    );
+    return item ? item.label : val;
+  };
+  // 鍒囨崲tab鏌ヨ
+  const tabhandleQuery = val => {
+    searchForm.value.state = val.paneName;
+    console.log(searchForm.value.state, "searchForm.value.state");
+
+    handleQuery();
+  };
+  // 琛ㄥ崟寮曠敤
+  const formRef = ref();
+  const riskLevelOptions = ref([
+    { value: "浣庨闄�", label: "浣庨闄�" },
+    { value: "涓�鑸闄�", label: "涓�鑸闄�" },
+    { value: "杈冨ぇ椋庨櫓", label: "杈冨ぇ椋庨櫓" },
+    { value: "閲嶅ぇ椋庨櫓", label: "閲嶅ぇ椋庨櫓" },
+  ]);
+
+  const fileList = ref([]);
+
+  // 琛ㄦ牸鍒楅厤缃�
+  const tableColumn = ref([
+    {
+      label: "璇剧▼缂栧彿",
+      prop: "courseCode",
+      width: 150,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍩硅鏃ユ湡",
+      prop: "trainingDate",
+      width: 120,
+
+      showOverflowTooltip: true,
+    },
+    {
+      label: "寮�濮嬫椂闂�",
+      prop: "openingTime",
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "缁撴潫鏃堕棿",
+      prop: "endTime",
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍩硅鐩爣",
+      prop: "trainingObjectives",
+      width: 200,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍙傚姞瀵硅薄",
+      prop: "participants",
+      width: 200,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍩硅鍐呭",
+      prop: "trainingContent",
+      width: 200,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍩硅璁插笀",
+      prop: "trainingLecturer",
+      width: 200,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "椤圭洰瀛﹀垎",
+      prop: "projectCredits",
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鍩硅鏂瑰紡",
+      prop: "trainingMode",
+      width: 120,
+      showOverflowTooltip: true,
+      formatData: params => {
+        return getTrainingModeLabel(params);
+      },
+    },
+    {
+      label: "鍩硅鍦扮偣",
+      prop: "placeTraining",
+      width: 200,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "璇炬椂",
+      prop: "classHour",
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      label: "鎶ュ悕浜烘暟",
+      prop: "nums",
+      width: 120,
+      showOverflowTooltip: true,
+    },
+    {
+      dataType: "action",
+      label: "鎿嶄綔",
+      align: "center",
+      fixed: "right",
+      width: 300,
+      operation: [
+        {
+          name: "绛惧埌",
+          type: "text",
+          disabled: row => row.state !== 1,
+          clickFun: row => {
+            signIn(row);
+          },
+        },
+        {
+          name: "缂栬緫",
+          type: "text",
+          disabled: row => row.state !== 0,
+          clickFun: row => {
+            openForm("edit", row);
+          },
+        },
+        {
+          name: "瀵煎嚭",
+          type: "text",
+          clickFun: row => {
+            exportKnowledge(row);
+          },
+          color: "#C49000",
+        },
+        {
+          name: "闄勪欢",
+          type: "text",
+          clickFun: row => {
+            openFileDialog(row);
+          },
+          color: "#007AFF",
+        },
+
+        {
+          name: "缁撴灉鏄庣粏",
+          type: "text",
+          disabled: row => row.state == 0,
+          clickFun: row => {
+            viewResultDetail(row);
+          },
+        },
+        // {
+        //   name: "鏌ョ湅",
+        //   type: "text",
+        //   clickFun: row => {
+        //     viewKnowledge(row);
+        //   },
+        // },
+      ],
+    },
+  ]);
+  const userList = ref([]);
+  // 鐢熷懡鍛ㄦ湡
+  onMounted(() => {
+    getCurrentFactoryName();
+    getList();
+    startAutoRefresh();
+    userListNoPage().then(res => {
+      userList.value = res.data;
+    });
+  });
+  const endform = ref({
+    assessmentUserId: "", //璇勪环浜�
+    assessmentUserName: "", //璇勪环浜哄鍚�
+    assessmentMethod: "", //鑰冩牳鏂瑰紡
+    assessmentDate: "", //璇勪环鏃堕棿
+    comprehensiveAssessment: "", //缁煎悎璇勪环
+    trainingAbstract: "", //鍩硅鎽樿
+    safeTrainingFileList: [], //鍩硅闄勪欢
+    safeTrainingDetailsDtoList: [], //鑰冩牳缁撴灉璇︽儏
+  });
+  const operationType = ref("edit");
+  const viewResultDetail = row => {
+    // fileList.value = [];
+    operationType.value = "edit";
+    safeTrainingGet({ id: row.id }).then(res => {
+      if (res.code === 200) {
+        console.log(res.data, "res.data");
+        currentKnowledge.value = JSON.parse(JSON.stringify(res.data));
+        currentKnowledge.value.nums = row.nums;
+        viewDialogVisible.value = true;
+        endform.value = { ...res.data };
+        endform.value.assessmentUserName = endform.value.assessmentUserName
+          ? endform.value.assessmentUserName
+          : currentUserName.value;
+        endform.value.assessmentUserId = endform.value.assessmentUserId
+          ? endform.value.assessmentUserId
+          : currentUserId.value;
+        endform.value.assessmentDate = dayjs().format("YYYY-MM-DD");
+      } else {
+        proxy.$modal.msgError(res.msg || "鏌ヨ璇︽儏澶辫触");
+      }
+    });
+  };
+
+  // 涓婁紶鍓嶆牎妫�
+  function handleBeforeUpload(file) {
+    proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
+    return true;
+  }
+  // 涓婁紶澶辫触
+  function handleUploadError(err) {
+    proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
+    proxy.$modal.closeLoading();
+  }
+  // 涓婁紶鎴愬姛鍥炶皟
+  function handleUploadSuccess(res, file, uploadFiles) {
+    proxy.$modal.closeLoading();
+    if (res.code === 200) {
+      // 纭繚 tempFileIds 瀛樺湪涓斾负鏁扮粍
+      if (!endform.value.safeTrainingFileList) {
+        endform.value.safeTrainingFileList = [];
+      }
+      endform.value.safeTrainingFileList.push({
+        id: res.data.tempId,
+        fileName: res.data.originalName,
+        url: res.data.tempPath,
+        safeTrainingId: currentKnowledge.value.id,
+      });
+      proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
+    } else {
+      proxy.$modal.msgError(res.msg);
+      proxy.$refs.fileUpload.handleRemove(file);
+    }
+  }
+  // 绉婚櫎鏂囦欢
+  function handleRemove(file) {
+    if (operationType.value === "edit") {
+      let index = endform.value.safeTrainingFileList.findIndex(
+        item => item.fileName === file.name
+      );
+      if (index !== -1) {
+        endform.value.safeTrainingFileList.splice(index, 1);
+      }
+    }
+  }
+  const submitForm2 = () => {
+    endform.value.safeTrainingDetailsDtoList.forEach((item, index) => {
+      if (!item.examinationResults) {
+        proxy.$modal.msgError(`璇烽�夋嫨${item.nickName}鐨勮�冩牳缁撴灉`);
+        return;
+      }
+    });
+    console.log(endform.value, "endform.value");
+    proxy.$modal.loading("姝e湪鎻愪氦锛岃绋嶅��...");
+    safeTrainingSave(endform.value).then(res => {
+      proxy.$modal.closeLoading();
+      if (res.code === 200) {
+        proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+        getList();
+        viewDialogVisible.value = false;
+      } else {
+        proxy.$modal.msgError(res.msg || "鎻愪氦澶辫触");
+      }
+    });
+  };
+  const opendetail = row => {
+    proxy.$router.push({
+      path: "/safeProduction/safetyTrainingAssessmentDetail",
+    });
+  };
+
+  const signIn = row => {
+    ElMessageBox.confirm("纭绛惧埌鍚楋紵", "鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }).then(() => {
+      safeTrainingSign({
+        safeTrainingId: row.id,
+        userId: currentUserId.value,
+      }).then(res => {
+        if (res.code === 200) {
+          proxy.$modal.msgSuccess("绛惧埌鎴愬姛");
+          getList();
+        } else {
+          proxy.$modal.msgError(res.msg || "绛惧埌澶辫触");
+        }
+      });
+    });
+  };
+
+  // 澶勭悊鐢ㄦ埛閫夋嫨鍙樺寲
+  const handleUserChange = userId => {
+    const selectedUser = userList.value.find(user => user.userId === userId);
+    if (selectedUser) {
+      form.value.principalUser = selectedUser.nickName;
+      form.value.principalMobile = selectedUser.phonenumber;
+    }
+  };
+
+  // 鎵撳紑闄勪欢寮圭獥
+  const recordId =ref(0)
+  const fileDialogVisible = ref(false)
+
+  // 鎵撳紑闄勪欢寮规
+  const openFileDialog = async (row) => {
+    recordId.value = row.id
+    fileDialogVisible.value = true
+  }
+  
+  // 涓婁紶闄勪欢
+  const handleUpload = async () => {
+    if (!currentFileRow.value) {
+      proxy.$modal.msgWarning("璇峰厛閫夋嫨鏁版嵁");
+      return null;
+    }
+
+    return new Promise(resolve => {
+      // 鍒涘缓涓�涓殣钘忕殑鏂囦欢杈撳叆鍏冪礌
+      const input = document.createElement("input");
+      input.type = "file";
+      input.style.display = "none";
+      input.onchange = async e => {
+        const file = e.target.files[0];
+        if (!file) {
+          resolve(null);
+          return;
+        }
+
+        try {
+          // 浣跨敤 FormData 涓婁紶鏂囦欢
+          const formData = new FormData();
+          formData.append("file", file);
+
+          const uploadRes = await request({
+            url: "/file/upload",
+            method: "post",
+            data: formData,
+            headers: {
+              "Content-Type": "multipart/form-data",
+              Authorization: `Bearer ${getToken()}`,
+            },
+          });
+
+          if (uploadRes.code === 200) {
+            // 淇濆瓨闄勪欢淇℃伅
+            const fileData = {
+              safeTrainingId: currentFileRow.value.id,
+              name: uploadRes.data.originalName || file.name,
+              url: uploadRes.data.tempPath || uploadRes.data.url,
+            };
+
+            const saveRes = await safeTrainingFileAdd(fileData);
+            if (saveRes.code === 200) {
+              proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+              // 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
+              const listRes = await safeTrainingFileListPage({
+                safeTrainingId: currentFileRow.value.id,
+                current: filePagination.value.current,
+                size: filePagination.value.size,
+              });
+              if (listRes.code === 200 && fileListRef.value) {
+                const fileList = (listRes.data?.records || []).map(item => ({
+                  name: item.name,
+                  url: item.url,
+                  id: item.id,
+                  ...item,
+                }));
+                fileListRef.value.setList(fileList);
+                filePagination.value.total = listRes.data?.total || 0;
+              }
+              // 杩斿洖鏂版枃浠朵俊鎭�
+              resolve({
+                name: fileData.name,
+                url: fileData.url,
+                id: saveRes.data?.id,
+              });
+            } else {
+              proxy.$modal.msgError(saveRes.msg || "鏂囦欢淇濆瓨澶辫触");
+              resolve(null);
+            }
+          } else {
+            proxy.$modal.msgError(uploadRes.msg || "鏂囦欢涓婁紶澶辫触");
+            resolve(null);
+          }
+        } catch (error) {
+          proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+          resolve(null);
+        } finally {
+          document.body.removeChild(input);
+        }
+      };
+
+      document.body.appendChild(input);
+      input.click();
+    });
+  };
+  const filePagination = ref({
+    current: 1,
+    size: 10,
+    total: 0,
+  });
+  const paginationSearch = async (page, size) => {
+    filePagination.value.current = page;
+    filePagination.value.size = size;
+    const listRes = await safeTrainingFileListPage({
+      safeTrainingId: currentFileRow.value.id,
+      current: filePagination.value.current,
+      size: filePagination.value.size,
+    });
+    if (listRes.code === 200) {
+      const fileList = (listRes.data?.records || []).map(item => ({
+        name: item.name,
+        url: item.url,
+        id: item.id,
+        ...item,
+      }));
+
+      fileListRef.value.setList(fileList);
+      filePagination.value.total = listRes.data?.total || 0;
+    }
+  };
+  // 鍒犻櫎闄勪欢
+  const handleFileDelete = async row => {
+    try {
+      const res = await safeTrainingFileDel([row.id]);
+      if (res.code === 200) {
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        // 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
+        if (currentFileRow.value && fileListRef.value) {
+          const listRes = await safeTrainingFileListPage({
+            safeTrainingId: currentFileRow.value.id,
+            current: filePagination.value.current,
+            size: filePagination.value.size,
+          });
+          if (listRes.code === 200) {
+            const fileList = (listRes.data?.records || []).map(item => ({
+              name: item.name,
+              url: item.url,
+              id: item.id,
+              ...item,
+            }));
+            fileListRef.value.setList(fileList);
+            filePagination.value.total = listRes.data?.total || 0;
+          }
+        }
+        return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃
+      } else {
+        proxy.$modal.msgError(res.msg || "鍒犻櫎澶辫触");
+        return false;
+      }
+    } catch (error) {
+      proxy.$modal.msgError("鍒犻櫎澶辫触");
+      return false;
+    }
+  };
+
+  // 寮�濮嬭嚜鍔ㄥ埛鏂�
+  const startAutoRefresh = () => {
+    setInterval(() => {
+      getList();
+    }, 600000); // 10鍒嗛挓鍒锋柊涓�娆� (10 * 60 * 1000 = 600000ms)
+  };
+
+  // 鏌ヨ鏁版嵁
+  const handleQuery = () => {
+    page.value.current = 1;
+    getList();
+  };
+  const exportKnowledge = row => {
+    safeTrainingExport(row)
+      .then(res => {
+        // 鍒涘缓Blob瀵硅薄
+        const blob = new Blob([res], {
+          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+        });
+        // 鍒涘缓涓嬭浇閾炬帴
+        const url = window.URL.createObjectURL(blob);
+        const link = document.createElement("a");
+        link.href = url;
+        link.download = `鍩硅璁板綍_${row.courseCode}.docx`;
+
+        // 妯℃嫙鐐瑰嚮涓嬭浇
+        document.body.appendChild(link);
+        link.click();
+
+        // 娓呯悊涓存椂瀵硅薄
+        setTimeout(() => {
+          document.body.removeChild(link);
+          window.URL.revokeObjectURL(url);
+        }, 100);
+
+        ElMessage.success("瀵煎嚭鎴愬姛");
+      })
+      .catch(err => {
+        console.error("瀵煎嚭澶辫触:", err);
+        ElMessage.error("瀵煎嚭澶辫触锛岃閲嶈瘯");
+      });
+  };
+  const getList = () => {
+    tableLoading.value = true;
+    safeTrainingListPage({ ...page.value, ...searchForm.value })
+      .then(res => {
+        tableLoading.value = false;
+        tableData.value = res.data.records;
+        page.value.total = res.data.total;
+      })
+      .catch(err => {
+        tableLoading.value = false;
+      });
+  };
+
+  // 鍒嗛〉澶勭悊
+  const pagination = obj => {
+    page.value.current = obj.page;
+    page.value.size = obj.limit;
+    getList();
+  };
+
+  // 閫夋嫨鍙樺寲澶勭悊
+  const handleSelectionChange = selection => {
+    selectedIds.value = selection.map(item => item.id);
+  };
+  const currentUserId = ref("");
+  const currentUserName = ref("");
+  const getCurrentFactoryName = async () => {
+    let res = await userStore.getInfo();
+    currentUserId.value = res.user.userId;
+    currentUserName.value = res.user.nickName;
+  };
+
+  // 鎵撳紑琛ㄥ崟
+  const openForm = (type, row = null) => {
+    dialogType.value = type;
+    if (type === "add") {
+      dialogTitle.value = "鏂板鍩硅";
+      // 閲嶇疆琛ㄥ崟
+      Object.assign(form.value, {
+        courseCode: "", // 璇剧▼缂栧彿
+        trainingDate: "", // 鍩硅鏃ユ湡
+        openingTime: "", // 寮�濮嬫椂闂�
+        endTime: "", // 缁撴潫鏃堕棿
+        trainingObjectives: "", // 鍩硅鐩爣
+        participants: "", // 鍙傚姞瀵硅薄
+        trainingContent: "", // 鍩硅鍐呭
+        trainingLecturer: "", // 鍩硅璁插笀
+        projectCredits: "", // 椤圭洰瀛﹀垎
+        trainingMode: "", // 鍩硅鏂瑰紡
+        placeTraining: "", // 鍩硅鍦扮偣
+        classHour: "", // 璇炬椂
+        createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // 鍒涘缓鏃堕棿
+      });
+    } else if (type === "edit" && row) {
+      dialogTitle.value = "缂栬緫鍩硅";
+      Object.assign(form.value, {
+        id: row.id,
+        courseCode: row.courseCode, // 璇剧▼缂栧彿
+        trainingDate: row.trainingDate, // 鍩硅鏃ユ湡
+        openingTime: row.openingTime, // 寮�濮嬫椂闂�
+        endTime: row.endTime, // 缁撴潫鏃堕棿
+        trainingObjectives: row.trainingObjectives, // 鍩硅鐩爣
+        participants: row.participants, // 鍙傚姞瀵硅薄
+        trainingContent: row.trainingContent, // 鍩硅鍐呭
+        trainingLecturer: row.trainingLecturer, // 鍩硅璁插笀
+        projectCredits: row.projectCredits, // 椤圭洰瀛﹀垎
+        trainingMode: row.trainingMode, // 鍩硅鏂瑰紡
+        placeTraining: row.placeTraining, // 鍩硅鍦扮偣
+        classHour: row.classHour, // 璇炬椂
+        createTime: row.createTime || "", // 鍒涘缓鏃堕棿
+      });
+    }
+    dialogVisible.value = true;
+  };
+
+  // 鑾峰彇绫诲瀷鏍囩绫诲瀷
+  const getTypeTagType = type => {
+    const typeMap = {
+      杈冨ぇ椋庨櫓: "warning",
+      浣庨闄�: "info",
+      涓�鑸闄�: "info",
+      閲嶅ぇ椋庨櫓: "danger",
+    };
+    return typeMap[type] || "info";
+  };
+
+  // 鑾峰彇鏁堢巼鏍囩绫诲瀷
+  const getEfficiencyTagType = efficiency => {
+    const typeMap = {
+      high: "success",
+      medium: "warning",
+      low: "info",
+    };
+    return typeMap[efficiency] || "info";
+  };
+
+  // 鑾峰彇鏁堢巼鏍囩鏂囨湰
+  const getEfficiencyLabel = efficiency => {
+    const efficiencyMap = {
+      high: "鏄捐憲鎻愬崌",
+      medium: "涓�鑸彁鍗�",
+      low: "杞诲井鎻愬崌",
+    };
+    return efficiencyMap[efficiency] || efficiency;
+  };
+
+  // 鑾峰彇鏁堢巼鎻愬崌鐧惧垎姣�
+  const getEfficiencyScore = efficiency => {
+    const scoreMap = {
+      high: 40,
+      medium: 25,
+      low: 15,
+    };
+    return scoreMap[efficiency] || 0;
+  };
+
+  // 鑾峰彇骞冲潎鑺傜渷鏃堕棿
+  const getTimeSaved = efficiency => {
+    const timeMap = {
+      high: "2-3澶�",
+      medium: "1-2澶�",
+      low: "0.5-1澶�",
+    };
+    return timeMap[efficiency] || "鏈煡";
+  };
+
+  /**
+   * 鑾峰彇琛岀被鍚嶏紝鐢ㄤ簬鍒ゆ柇椋庨櫓绛夌骇鏄惁涓洪噸澶ч闄�
+   * @param row 琛屾暟鎹�
+   * @returns 绫诲悕
+   */
+  const getRowClass = ({ row }) => {
+    if (row.riskLevel === "閲嶅ぇ椋庨櫓") {
+      return "danger-row";
+    }
+    return "";
+  };
+
+  // 鎻愪氦鍩硅琛ㄥ崟
+  const submitForm = async () => {
+    try {
+      await formRef.value.validate();
+      if (dialogType.value === "add") {
+        // 鏂板鍩硅鍙拌处
+        safeTrainingAdd({ ...form.value })
+          .then(res => {
+            if (res.code == 200) {
+              ElMessage.success("娣诲姞鎴愬姛");
+              dialogVisible.value = false;
+              getList();
+            }
+          })
+          .catch(err => {
+            ElMessage.error(err.msg);
+          });
+      } else {
+        // 鏇存柊鍩硅鍙拌处
+        safeTrainingAdd({ ...form.value })
+          .then(res => {
+            if (res.code == 200) {
+              ElMessage.success("鏇存柊鎴愬姛");
+              dialogVisible.value = false;
+              getList();
+            }
+          })
+          .catch(err => {
+            ElMessage.error(err.msg);
+          });
+      }
+    } catch (error) {
+      console.error("琛ㄥ崟楠岃瘉澶辫触:", error);
+    }
+  };
+
+  // 鍒犻櫎鍩硅
+  const handleDelete = () => {
+    if (selectedIds.value.length === 0) {
+      ElMessage.warning("璇烽�夋嫨瑕佸垹闄ょ殑鍩硅");
+      return;
+    }
+
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        // console.log(selectedIds.value);
+        safeTrainingDel(selectedIds.value).then(res => {
+          if (res.code == 200) {
+            ElMessage.success("鍒犻櫎鎴愬姛");
+            selectedIds.value = [];
+            getList();
+          }
+        });
+      })
+      .catch(() => {
+        // 鐢ㄦ埛鍙栨秷
+      });
+  };
+
+  const getKnowledgeTypeTagType = val => {
+    const item = knowledgeTypeOptions.value.find(
+      i => String(i.value) === String(val)
+    );
+    return item?.elTagType || "info";
+  };
+  const handleExport = () => {
+    proxy.download(
+      "/knowledgeBase/export",
+      { ...searchForm.value },
+      "鐭ヨ瘑搴�.xlsx"
+    );
+  };
+</script>
+
+<style scoped>
+  .auto-refresh-info {
+    margin-bottom: 15px;
+  }
+
+  .auto-refresh-info .el-alert {
+    border-radius: 8px;
+  }
+
+  .dialog-footer {
+    text-align: right;
+  }
+
+  .knowledge-detail {
+    padding: 20px 0;
+  }
+
+  .detail-title {
+    font-size: 18px;
+    font-weight: bold;
+    color: #303133;
+  }
+
+  .detail-section {
+    margin-top: 24px;
+  }
+
+  .detail-section h4 {
+    margin: 0 0 12px 0;
+    font-size: 16px;
+    font-weight: 600;
+    color: #303133;
+    border-left: 4px solid #409eff;
+    padding-left: 12px;
+  }
+
+  .detail-content {
+    background: #f8f9fa;
+    padding: 16px;
+    border-radius: 6px;
+    line-height: 1.6;
+    color: #606266;
+    white-space: pre-wrap;
+  }
+
+  .key-points {
+    display: flex;
+    flex-wrap: wrap;
+    gap: 8px;
+  }
+
+  .usage-stats {
+    margin-top: 16px;
+  }
+
+  .stat-item {
+    text-align: center;
+    padding: 20px;
+    background: #f8f9fa;
+    border-radius: 8px;
+  }
+
+  .stat-number {
+    font-size: 24px;
+    font-weight: bold;
+    color: #409eff;
+    margin-bottom: 8px;
+  }
+
+  .stat-label {
+    font-size: 14px;
+    color: #909399;
+  }
+
+  :deep(.danger-row td) {
+    color: #e95a66 !important;
+  }
+  .classtitle {
+    font-size: 16px;
+    font-weight: 600;
+    color: #303133;
+    border-left: 4px solid #409eff;
+    padding-left: 12px;
+    margin-bottom: 12px;
+  }
+</style>

--
Gitblit v1.9.3