【修改】生成笔试试卷按钮 加载状态

This commit is contained in:
YOHO\20373
2025-05-27 16:02:55 +08:00
committed by 陆光LG
parent 068f5c0401
commit fc77d77afc
4 changed files with 117 additions and 65 deletions

View File

@@ -104,7 +104,9 @@ export async function openDown(ids) {
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', '试卷.docx');
// 使用示例
const filename = `${getNowTimeString()}.zip`;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
link.remove();
@@ -115,4 +117,13 @@ export async function openDown(ids) {
}
}
function getNowTimeString() {
const now = new Date();
const Y = now.getFullYear();
const M = String(now.getMonth() + 1).padStart(2, '0');
const D = String(now.getDate()).padStart(2, '0');
const h = String(now.getHours()).padStart(2, '0');
const m = String(now.getMinutes()).padStart(2, '0');
const s = String(now.getSeconds()).padStart(2, '0');
return `${Y}${M}${D}${h}${m}${s}`;
}