|
|
@ -136,6 +136,22 @@ export default function MeasureDetail() { |
|
|
|
handleUpload(Ids) |
|
|
|
setIsModaUploadlOpen(true) |
|
|
|
} |
|
|
|
|
|
|
|
const onDownloadData = async () =>{ |
|
|
|
setIdList([]) |
|
|
|
let list = [...selectRows] |
|
|
|
let Ids:number[] = [] |
|
|
|
list.map(item => { |
|
|
|
Ids.push(item.id) |
|
|
|
}) |
|
|
|
setIdList(Ids) |
|
|
|
const response = await fetch(`/api/measurement-task/downloads/${Ids.join(',')}`); |
|
|
|
const blob = await response.blob(); // 先获取 Blob
|
|
|
|
const arrayBuffer = await blob.arrayBuffer(); // 将 Blob 转换为 ArrayBuffer
|
|
|
|
exportFile(arrayBuffer, `坐标数据.xls`); // 传递 ArrayBuffer 给函数
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const [percent, setPercent] = useState(0) |
|
|
|
const [failRecordNames, setFailRecordName] = useState<string[]>([]) |
|
|
|
const [successRecordNames, setSuccessRecordName] = useState<string[]>([]) |
|
|
@ -536,6 +552,13 @@ export default function MeasureDetail() { |
|
|
|
onClick={onUploadData}> |
|
|
|
上传 |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
className='ml-[2rem]' |
|
|
|
disabled={!selectRows.length} |
|
|
|
type="primary" |
|
|
|
onClick={onDownloadData}> |
|
|
|
批量导出 |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Input className='ml-[2rem]' allowClear placeholder="测量名称" onChange={(e)=>setName(e.target.value)} style={{ width: 200 }}/> |
|
|
|
<Select |
|
|
|