From 7aa71a93fd5d97506077ea0f894d98a777ccd7aa Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期四, 10 七月 2025 13:43:20 +0800
Subject: [PATCH] 修改

---
 src/views/work/onlineEducation/people/components/trainRecord.vue |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/views/work/onlineEducation/people/components/trainRecord.vue b/src/views/work/onlineEducation/people/components/trainRecord.vue
index e868866..a976d68 100644
--- a/src/views/work/onlineEducation/people/components/trainRecord.vue
+++ b/src/views/work/onlineEducation/people/components/trainRecord.vue
@@ -22,6 +22,11 @@
           </template>
         </el-table-column>
         <el-table-column label="所在公司" prop="companyName" align="center"/>
+        <el-table-column label="证书"  align="center" >
+          <template #default="scope">
+            <el-button v-if="scope.row.passed == 1" type="primary" @click="downloadCert(scope.row)" link>下载</el-button>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
   </div>
@@ -39,7 +44,8 @@
 import Cookies from "js-cookie";
 import {addQuestionBank, checkQuestionBankName, editQuestionBank} from "@/api/onlineEducation/questionBank";
 import {getStudent, getStuTrainRecord} from "@/api/onlineEducation/student";
-
+import {useRouter} from "vue-router";
+const router = useRouter();
 const dialogVisible = ref(false);
 const title = ref("");
 const busRef = ref();
@@ -77,6 +83,14 @@
   emit("getList")
 
 }
+const downloadCert = (info) => {
+  const routePath = '/certPdf'
+  const resolvedRoute = router.resolve(routePath)
+  const queryString = new URLSearchParams(info).toString()
+  const fullPath = `${resolvedRoute.href}?${queryString}`
+  window.open(fullPath, '_blank')
+
+}
 
 defineExpose({
   openDialog

--
Gitblit v1.9.2