【修改】生成笔试试卷按钮 加载状态
This commit is contained in:
@@ -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}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user