다운받은 엑셀 파일 내부적으로 수정하는 부분 완료.

(테스트용 데이터로 처리)
This commit is contained in:
truthwing
2025-04-24 19:56:21 +09:00
parent 9769ab785a
commit a1818301c9
@@ -7,7 +7,7 @@ import { tableData } from "@/components/lib/func/commom";
import HeadChModal from "@/components/ui/modal/headChModal/headChModal";
import {
ContentsDiv,
filePickedPath,
filePickedBlob,
SearchBaseForm,
Title,
UiModal,
@@ -147,12 +147,18 @@ export default function RainSttn() {
}}
excelClick={function (returnType: ReturnType): void {
//내부적인 파일 샘플 받아서 처리하는 부분 추가.
fetch('/sample_rainy.xlsx', {})
.then(async (response) => {
if (!response.ok) {
throw Error(response.statusText)
}
const ret =await filePickedPath(await (await response.blob()).arrayBuffer())
// 받은 파일 바인너리 처리
const blobRet = await response.blob()
// 받은 파일을 버퍼에 넣는 작업
const arrBuffer = await blobRet.arrayBuffer()
// 버퍼에 있는 엑셀데이터 전달 후 json으로 변환
const ret =await filePickedBlob(arrBuffer)
console.log('ret', ret);
console.log(returnType);
})