|
|
@@ -203,22 +203,15 @@
|
|
|
}
|
|
|
|
|
|
const download = () => {
|
|
|
- const ws = XLSX.utils.json_to_sheet(changeRecordList)
|
|
|
- const wb = XLSX.utils.book_new()
|
|
|
- XLSX.utils.book_append_sheet(wb, ws, 'result')
|
|
|
-
|
|
|
- const wbout = XLSX.write(wb, {
|
|
|
- bookType: 'xlsx',
|
|
|
- bookSST: true,
|
|
|
- type: 'array'
|
|
|
- })
|
|
|
+ // 将changeRecordList转换为JSON字符串
|
|
|
+ const jsonData = JSON.stringify(changeRecordList)
|
|
|
|
|
|
- // 创建 Blob 对象(使用正确的 MIME 类型)
|
|
|
- const blob = new Blob([wbout], {
|
|
|
- type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
+ // 创建包含JSON数据的Blob对象
|
|
|
+ const blob = new Blob([jsonData], {
|
|
|
+ type: 'application/json'
|
|
|
})
|
|
|
|
|
|
- const filename = `行为记录.xlsx`
|
|
|
+ const filename = `行为记录.json`
|
|
|
const file = new File([blob], filename, { type: blob.type })
|
|
|
if(assignmentId != null){
|
|
|
apis.addBehaviorRecord(assignmentId, file)
|