zhouwx
2025-07-10 7aa71a93fd5d97506077ea0f894d98a777ccd7aa
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