|
|
|
|
@ -0,0 +1,334 @@
|
|
|
|
|
import html2canvas from "html2canvas";
|
|
|
|
|
import { jsPDF } from "jspdf";
|
|
|
|
|
import { saveAs } from "file-saver";
|
|
|
|
|
|
|
|
|
|
const PAGE = { width: 210, height: 297, marginX: 12, marginY: 14 };
|
|
|
|
|
|
|
|
|
|
function escapeHtml(value) {
|
|
|
|
|
return String(value ?? "")
|
|
|
|
|
.replace(/&/g, "&")
|
|
|
|
|
.replace(/</g, "<")
|
|
|
|
|
.replace(/>/g, ">")
|
|
|
|
|
.replace(/\"/g, """)
|
|
|
|
|
.replace(/'/g, "'");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function normalizeText(value) {
|
|
|
|
|
return String(value ?? "").trim();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function normalizeList(value) {
|
|
|
|
|
if (Array.isArray(value)) return value.map(normalizeText).filter(Boolean);
|
|
|
|
|
const text = normalizeText(value);
|
|
|
|
|
if (!text) return [];
|
|
|
|
|
try {
|
|
|
|
|
const parsed = JSON.parse(text);
|
|
|
|
|
if (Array.isArray(parsed)) return parsed.map((item) => normalizeText(item?.name ?? item?.title ?? item)).filter(Boolean);
|
|
|
|
|
} catch {
|
|
|
|
|
// 兼容历史任务中使用换行保存的步骤或目标。
|
|
|
|
|
}
|
|
|
|
|
return text.split(/\r?\n/).map((item) => item.replace(/^\s*(?:\d+[、..]|[-•])\s*/, "").trim()).filter(Boolean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function safeFileName(value) {
|
|
|
|
|
return normalizeText(value || "实训成果").replace(/[\\/:*?\"<>|]/g, "_").slice(0, 80);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sectionMarkup(title, body) {
|
|
|
|
|
return `<section class="training-outcome-pdf__section"><h2>${escapeHtml(title)}</h2>${body}</section>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function paragraphMarkup(value) {
|
|
|
|
|
const content = escapeHtml(normalizeText(value) || "未配置").replace(/\r?\n/g, "<br>");
|
|
|
|
|
return `<p>${content}</p>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function listMarkup(items, itemClass) {
|
|
|
|
|
if (!items.length) return "<p>未配置</p>";
|
|
|
|
|
return `<ol class="${itemClass}">${items.map((item) => `<li>${escapeHtml(item)}</li>`).join("")}</ol>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function compactText(value) {
|
|
|
|
|
return normalizeText(value).replace(/\s+/g, " ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function topLevelNodes(nodes) {
|
|
|
|
|
return nodes.filter((node) => !nodes.some((candidate) => candidate !== node && candidate.contains(node)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function findStepNodes(scope) {
|
|
|
|
|
for (const selector of [".step-content", "[data-training-step]", ".training-step", ".step-panel"]) {
|
|
|
|
|
const nodes = topLevelNodes(Array.from(scope.querySelectorAll(selector)));
|
|
|
|
|
if (nodes.length) return nodes;
|
|
|
|
|
}
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function printableCopy(node) {
|
|
|
|
|
if (!node) return null;
|
|
|
|
|
const copy = node.cloneNode(true);
|
|
|
|
|
copy.querySelectorAll("input, textarea, select, button, .training-task-toolbar, .training-ai-sidebar, .step-actions, .step-navigation, .el-input__suffix, script, style")
|
|
|
|
|
.forEach((element) => element.remove());
|
|
|
|
|
return copy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tableData(table) {
|
|
|
|
|
const rows = Array.from(table.querySelectorAll("tr"))
|
|
|
|
|
.map((row) => ({
|
|
|
|
|
header: Boolean(row.querySelector("th")),
|
|
|
|
|
cells: Array.from(row.querySelectorAll(":scope > th, :scope > td")).map((cell) => compactText(cell.textContent)),
|
|
|
|
|
}))
|
|
|
|
|
.filter((row) => row.cells.some(Boolean));
|
|
|
|
|
if (!rows.length) return null;
|
|
|
|
|
const headerIndex = rows.findIndex((row) => row.header);
|
|
|
|
|
const firstRowIndex = headerIndex >= 0 ? headerIndex : 0;
|
|
|
|
|
return {
|
|
|
|
|
headers: rows[firstRowIndex].cells,
|
|
|
|
|
rows: rows.filter((_, index) => index !== firstRowIndex).map((row) => row.cells),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function readableContent(node) {
|
|
|
|
|
const copy = printableCopy(node);
|
|
|
|
|
if (!copy) return { text: "", tables: [] };
|
|
|
|
|
const tables = Array.from(copy.querySelectorAll("table")).map(tableData).filter(Boolean);
|
|
|
|
|
copy.querySelectorAll("table").forEach((table) => table.remove());
|
|
|
|
|
return { text: compactText(copy.textContent), tables };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function tableHeaderLabel(control) {
|
|
|
|
|
const cell = control.closest("td, th");
|
|
|
|
|
const table = control.closest("table");
|
|
|
|
|
if (!cell || !table) return "";
|
|
|
|
|
const index = Array.from(cell.parentElement?.children || []).indexOf(cell);
|
|
|
|
|
const headerRows = Array.from(table.querySelectorAll("thead tr"));
|
|
|
|
|
const headers = headerRows.length ? Array.from(headerRows[headerRows.length - 1].children) : [];
|
|
|
|
|
return compactText(headers[index]?.textContent || "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function controlLabel(control, index) {
|
|
|
|
|
const formItem = control.closest(".el-form-item");
|
|
|
|
|
const formLabel = formItem?.querySelector("label, .el-form-item__label");
|
|
|
|
|
const tableLabel = tableHeaderLabel(control);
|
|
|
|
|
return compactText(control.getAttribute("aria-label") || formLabel?.textContent || tableLabel || control.getAttribute("placeholder") || `填写项 ${index + 1}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function controlValue(control) {
|
|
|
|
|
const type = String(control.type || "").toLowerCase();
|
|
|
|
|
if ((type === "checkbox" || type === "radio") && !control.checked) return "";
|
|
|
|
|
if (control.tagName === "SELECT") return Array.from(control.selectedOptions || []).map((option) => compactText(option.textContent)).filter(Boolean).join("、");
|
|
|
|
|
return normalizeText(control.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function collectDomAnswers(stepNodes) {
|
|
|
|
|
return stepNodes.map((node) => {
|
|
|
|
|
const seen = new Set();
|
|
|
|
|
return Array.from(node.querySelectorAll("input, textarea, select"))
|
|
|
|
|
.filter((control) => !control.closest(".training-task-toolbar, .training-ai-sidebar") && control.type !== "file" && !control.closest(".el-select__input"))
|
|
|
|
|
.map((control, index) => ({ label: controlLabel(control, index), value: controlValue(control) }))
|
|
|
|
|
.filter(({ value }) => value)
|
|
|
|
|
.filter(({ label, value }) => {
|
|
|
|
|
const key = `${label}:${value}`;
|
|
|
|
|
if (seen.has(key)) return false;
|
|
|
|
|
seen.add(key);
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseAnswer(value) {
|
|
|
|
|
if (typeof value !== "string") return value;
|
|
|
|
|
try { return JSON.parse(value); } catch { return value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ANSWER_LABELS = {
|
|
|
|
|
summary: "总结", conclusion: "结论", recommendation: "建议", currentStep: "当前步骤", rows: "填写数据",
|
|
|
|
|
selected: "选择结果", analysis: "分析", strategy: "策略", imageName: "上传图片", imageUrl: "上传图片地址",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function answerLabel(key) {
|
|
|
|
|
return ANSWER_LABELS[key] || String(key || "填写内容").replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function flattenAnswer(value, prefix = "") {
|
|
|
|
|
const parsed = parseAnswer(value);
|
|
|
|
|
if (parsed == null || parsed === "") return [];
|
|
|
|
|
if (typeof parsed !== "object") return [{ label: prefix || "填写内容", value: normalizeText(parsed) }].filter((item) => item.value);
|
|
|
|
|
if (Array.isArray(parsed)) {
|
|
|
|
|
if (parsed.every((item) => typeof item !== "object" || item == null)) {
|
|
|
|
|
return [{ label: prefix || "填写内容", value: parsed.map((item) => normalizeText(item)).filter(Boolean).join("、") }].filter((item) => item.value);
|
|
|
|
|
}
|
|
|
|
|
return parsed.flatMap((item, index) => flattenAnswer(item, `${prefix || "填写内容"} ${index + 1}`));
|
|
|
|
|
}
|
|
|
|
|
return Object.entries(parsed)
|
|
|
|
|
.filter(([key]) => !["saveAction", "submitted", "taskKey", "taskId", "currentStep"].includes(key))
|
|
|
|
|
.flatMap(([key, item]) => flattenAnswer(item, prefix ? `${prefix} · ${answerLabel(key)}` : answerLabel(key)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function savedStepAnswers(answer, count) {
|
|
|
|
|
const source = answer || {};
|
|
|
|
|
const dynamic = parseAnswer(source.dynamicStepAnswers) || {};
|
|
|
|
|
return Array.from({ length: count }, (_, index) => {
|
|
|
|
|
const step = index + 1;
|
|
|
|
|
const value = source[`step${step}Answer`] ?? dynamic[`step${step}`] ?? dynamic[`step${step}Answer`];
|
|
|
|
|
return flattenAnswer(value);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Collect task-page instructions and student values before rendering the PDF. */
|
|
|
|
|
export function collectTrainingOutcomeDetails(task, studentAnswer) {
|
|
|
|
|
const steps = normalizeList(task?.steps);
|
|
|
|
|
const scope = document.querySelector(".student-training-shell") || document.querySelector(".training-step-area") || document.body;
|
|
|
|
|
const nodes = findStepNodes(scope);
|
|
|
|
|
const savedAnswers = savedStepAnswers(studentAnswer, steps.length);
|
|
|
|
|
const domAnswers = collectDomAnswers(nodes);
|
|
|
|
|
return steps.map((name, index) => {
|
|
|
|
|
const content = readableContent(nodes[index]);
|
|
|
|
|
return {
|
|
|
|
|
name,
|
|
|
|
|
content: content.text || (content.tables.length ? "" : "当前步骤内容以页面实训说明为准。"),
|
|
|
|
|
tables: content.tables,
|
|
|
|
|
answers: domAnswers[index]?.length ? domAnswers[index] : savedAnswers[index],
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function stepTablesMarkup(tables) {
|
|
|
|
|
if (!tables?.length) return "";
|
|
|
|
|
return tables.map((table, index) => `
|
|
|
|
|
<div class="training-outcome-pdf__table-wrap">
|
|
|
|
|
<p class="training-outcome-pdf__table-caption">表 ${index + 1}</p>
|
|
|
|
|
<table class="training-outcome-pdf__table">
|
|
|
|
|
<thead><tr>${table.headers.map((header) => `<th>${escapeHtml(header || "-")}</th>`).join("")}</tr></thead>
|
|
|
|
|
<tbody>${table.rows.map((row) => `<tr>${table.headers.map((_, cellIndex) => `<td>${escapeHtml(row[cellIndex] || "-")}</td>`).join("")}</tr>`).join("")}</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>`).join("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function stepDetailsMarkup(items) {
|
|
|
|
|
if (!items.length) return "<p>未配置</p>";
|
|
|
|
|
return `<div class="training-outcome-pdf__step-details">${items.map((step, index) => `
|
|
|
|
|
<article class="training-outcome-pdf__step-detail">
|
|
|
|
|
<h3><span>${String(index + 1).padStart(2, "0")}</span>${escapeHtml(step.name)}</h3>
|
|
|
|
|
<h4>步骤内容</h4>
|
|
|
|
|
${step.content ? paragraphMarkup(step.content) : ""}
|
|
|
|
|
${stepTablesMarkup(step.tables)}
|
|
|
|
|
<h4>学生作答</h4>
|
|
|
|
|
${step.answers?.length
|
|
|
|
|
? `<ul class="training-outcome-pdf__answers">${step.answers.map((answer) => `<li><b>${escapeHtml(answer.label)}:</b>${escapeHtml(answer.value)}</li>`).join("")}</ul>`
|
|
|
|
|
: "<p class=\"training-outcome-pdf__empty-answer\">该步骤暂未填写作答。</p>"}
|
|
|
|
|
</article>`).join("")}</div>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createPrintDocument(task) {
|
|
|
|
|
const title = normalizeText(task?.taskName || task?.title || "实训成果");
|
|
|
|
|
const objectives = normalizeList(task?.objectives);
|
|
|
|
|
const steps = normalizeList(task?.steps);
|
|
|
|
|
const stepDetails = Array.isArray(task?.stepDetails) && task.stepDetails.length
|
|
|
|
|
? task.stepDetails
|
|
|
|
|
: steps.map((name) => ({ name, content: "当前步骤内容以页面实训说明为准。", tables: [], answers: [] }));
|
|
|
|
|
const generatedAt = new Intl.DateTimeFormat("zh-CN", {
|
|
|
|
|
year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit",
|
|
|
|
|
hour12: false,
|
|
|
|
|
}).format(new Date());
|
|
|
|
|
const element = document.createElement("article");
|
|
|
|
|
element.className = "training-outcome-pdf";
|
|
|
|
|
element.setAttribute("aria-hidden", "true");
|
|
|
|
|
element.innerHTML = `
|
|
|
|
|
<style>
|
|
|
|
|
.training-outcome-pdf__header { padding: 0 0 24px; border-bottom: 3px solid #149dcc; }
|
|
|
|
|
.training-outcome-pdf__header p { margin: 0 0 8px; color: #1185b4; font-size: 15px; font-weight: 800; letter-spacing: 1px; }
|
|
|
|
|
.training-outcome-pdf__header h1 { margin: 0; color: #082641; font-size: 30px; line-height: 1.35; }
|
|
|
|
|
.training-outcome-pdf__header span { display: block; margin-top: 10px; color: #617083; font-size: 13px; }
|
|
|
|
|
.training-outcome-pdf__section { margin-top: 26px; break-inside: avoid; }
|
|
|
|
|
.training-outcome-pdf__section h2 { margin: 0 0 10px; padding-left: 12px; border-left: 5px solid #149dcc; color: #0c4e73; font-size: 20px; line-height: 1.45; }
|
|
|
|
|
.training-outcome-pdf__section p { margin: 0; padding: 15px 17px; border-radius: 8px; color: #263c4f; background: #f3f8fb; font-size: 15px; }
|
|
|
|
|
.training-outcome-pdf__section ol { margin: 0; padding: 5px 0 5px 30px; }
|
|
|
|
|
.training-outcome-pdf__section li { margin: 8px 0; padding: 5px 10px; color: #263c4f; font-size: 15px; }
|
|
|
|
|
.training-outcome-pdf__goals li { background: #f3f8fb; }
|
|
|
|
|
.training-outcome-pdf__steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
|
|
|
|
|
.training-outcome-pdf__steps li { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border: 1px solid #d3e6ef; border-radius: 8px; background: #fbfdfe; }
|
|
|
|
|
.training-outcome-pdf__steps li::before { content: counter(step, decimal-leading-zero); counter-increment: step; flex: 0 0 auto; color: #0f91bd; font-weight: 800; }
|
|
|
|
|
.training-outcome-pdf__step-detail { margin: 18px 0 26px; padding: 17px; border: 1px solid #d3e6ef; border-radius: 10px; background: #fbfdfe; break-inside: avoid; }
|
|
|
|
|
.training-outcome-pdf__step-detail h3 { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; color: #0c4e73; font-size: 18px; }
|
|
|
|
|
.training-outcome-pdf__step-detail h3 span { display: inline-grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: #fff; background: #149dcc; font-size: 13px; }
|
|
|
|
|
.training-outcome-pdf__step-detail h4 { margin: 15px 0 7px; color: #31718f; font-size: 14px; }
|
|
|
|
|
.training-outcome-pdf__step-detail p { padding: 11px 13px; font-size: 14px; }
|
|
|
|
|
.training-outcome-pdf__table-wrap { margin: 11px 0 15px; overflow: hidden; border: 1px solid #c7e1ec; border-radius: 7px; }
|
|
|
|
|
.training-outcome-pdf__table-caption { margin: 0 !important; padding: 7px 10px !important; color: #0d638b; background: #eaf6fb !important; font-size: 12px !important; font-weight: 800; }
|
|
|
|
|
.training-outcome-pdf__table { width: 100% !important; min-width: 0 !important; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
|
|
|
|
|
.training-outcome-pdf__table th, .training-outcome-pdf__table td { box-sizing: border-box; padding: 7px 6px; color: #263c4f; word-break: break-word; border: 1px solid #c7e1ec; vertical-align: top; }
|
|
|
|
|
.training-outcome-pdf__table th { color: #0c4e73; background: #edf8fc; font-weight: 800; }
|
|
|
|
|
.training-outcome-pdf__answers { margin: 0; padding: 10px 14px; border-radius: 7px; background: #eef8fc; list-style: none; }
|
|
|
|
|
.training-outcome-pdf__answers li { margin: 6px 0; padding: 0; color: #234255; font-size: 13px; word-break: break-word; }
|
|
|
|
|
.training-outcome-pdf__answers b { color: #0d638b; }
|
|
|
|
|
.training-outcome-pdf__empty-answer { color: #778899; font-style: italic; }
|
|
|
|
|
.training-outcome-pdf footer { margin-top: 34px; padding-top: 12px; border-top: 1px solid #d9e8ef; color: #7c8b99; font-size: 12px; text-align: center; }
|
|
|
|
|
</style>
|
|
|
|
|
<header class="training-outcome-pdf__header">
|
|
|
|
|
<p>电商互联网产品开发实训系统</p>
|
|
|
|
|
<h1>${escapeHtml(title)}</h1>
|
|
|
|
|
<span>实训任务说明 · 导出时间:${escapeHtml(generatedAt)}</span>
|
|
|
|
|
</header>
|
|
|
|
|
${sectionMarkup("实训背景", paragraphMarkup(task?.background))}
|
|
|
|
|
${sectionMarkup("实训目标", listMarkup(objectives, "training-outcome-pdf__goals"))}
|
|
|
|
|
${sectionMarkup("实训要求", paragraphMarkup(task?.requirements))}
|
|
|
|
|
${sectionMarkup("实训步骤与学生作答", stepDetailsMarkup(stepDetails))}
|
|
|
|
|
<footer>电商互联网产品开发实训系统 · ${escapeHtml(title)}</footer>
|
|
|
|
|
`;
|
|
|
|
|
Object.assign(element.style, {
|
|
|
|
|
position: "fixed", left: "-10000px", top: "0", width: "794px", padding: "54px 58px 48px",
|
|
|
|
|
boxSizing: "border-box", color: "#11243b", background: "#ffffff", fontFamily: "Microsoft YaHei, PingFang SC, Arial, sans-serif",
|
|
|
|
|
lineHeight: "1.75", zIndex: "-1",
|
|
|
|
|
});
|
|
|
|
|
return element;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function appendPdfPages(pdf, canvas) {
|
|
|
|
|
const contentWidthMm = PAGE.width - PAGE.marginX * 2;
|
|
|
|
|
const contentHeightMm = PAGE.height - PAGE.marginY * 2;
|
|
|
|
|
const sourceHeight = Math.floor(canvas.width * contentHeightMm / contentWidthMm);
|
|
|
|
|
let sourceY = 0;
|
|
|
|
|
let page = 0;
|
|
|
|
|
|
|
|
|
|
while (sourceY < canvas.height) {
|
|
|
|
|
const currentHeight = Math.min(sourceHeight, canvas.height - sourceY);
|
|
|
|
|
const slice = document.createElement("canvas");
|
|
|
|
|
slice.width = canvas.width;
|
|
|
|
|
slice.height = currentHeight;
|
|
|
|
|
slice.getContext("2d").drawImage(canvas, 0, sourceY, canvas.width, currentHeight, 0, 0, canvas.width, currentHeight);
|
|
|
|
|
if (page > 0) pdf.addPage();
|
|
|
|
|
pdf.addImage(slice.toDataURL("image/jpeg", 0.96), "JPEG", PAGE.marginX, PAGE.marginY, contentWidthMm, currentHeight * contentWidthMm / canvas.width, undefined, "FAST");
|
|
|
|
|
sourceY += currentHeight;
|
|
|
|
|
page += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Export the configured training brief as a Chinese PDF. Browser rendering keeps
|
|
|
|
|
* Chinese characters reliable without requiring a separately embedded font file.
|
|
|
|
|
*/
|
|
|
|
|
export async function exportTrainingOutcomePdf(task) {
|
|
|
|
|
if (!normalizeText(task?.taskName || task?.title)) throw new Error("当前实训任务未加载完成,无法导出 PDF。");
|
|
|
|
|
const documentNode = createPrintDocument(task);
|
|
|
|
|
document.body.appendChild(documentNode);
|
|
|
|
|
try {
|
|
|
|
|
const canvas = await html2canvas(documentNode, {
|
|
|
|
|
backgroundColor: "#ffffff",
|
|
|
|
|
scale: 2,
|
|
|
|
|
useCORS: true,
|
|
|
|
|
logging: false,
|
|
|
|
|
});
|
|
|
|
|
const pdf = new jsPDF({ orientation: "p", unit: "mm", format: "a4", compress: true });
|
|
|
|
|
appendPdfPages(pdf, canvas);
|
|
|
|
|
// jsPDF 的 save 在异步渲染结束后可能被浏览器当作非用户触发下载而拦截。
|
|
|
|
|
// 先生成 Blob,再通过项目已使用的 file-saver 发起下载,兼容性更稳定。
|
|
|
|
|
const pdfBlob = pdf.output("blob");
|
|
|
|
|
if (!(pdfBlob instanceof Blob) || pdfBlob.size === 0) {
|
|
|
|
|
throw new Error("PDF 文件生成失败,请重新尝试导出。");
|
|
|
|
|
}
|
|
|
|
|
saveAs(pdfBlob, `${safeFileName(task.taskName || task.title)}-实训成果.pdf`);
|
|
|
|
|
} finally {
|
|
|
|
|
documentNode.remove();
|
|
|
|
|
}
|
|
|
|
|
}
|