(content: string, filename: string, mimeType: string)
| 278 | |
| 279 | // 下载文件到本地 |
| 280 | function downloadFile(content: string, filename: string, mimeType: string): void { |
| 281 | const blob = new Blob([content], { type: mimeType }) |
| 282 | const url = URL.createObjectURL(blob) |
| 283 | const link = document.createElement('a') |
| 284 | link.href = url |
| 285 | link.download = filename |
| 286 | document.body.appendChild(link) |
| 287 | link.click() |
| 288 | document.body.removeChild(link) |
| 289 | URL.revokeObjectURL(url) |
| 290 | } |
| 291 | |
| 292 | // 获取日期字符串(格式:YYYY-MM-DD) |
| 293 | function getDateString(): string { |
no outgoing calls
no test coverage detected