|
@@ -141,10 +141,9 @@ const handleUpload = (file) => {
|
|
|
console.log(file);
|
|
|
addMessage(`已上传文件:${file.name}`, false)
|
|
|
const fileExtension = file.name.split('.').pop().toLowerCase();
|
|
|
- console.log('文件后缀:', fileExtension);
|
|
|
+ formInfo = response.data
|
|
|
if (fileExtension === 'xlsx') {
|
|
|
|
|
|
- formInfo = response.data
|
|
|
const reader = new FileReader();
|
|
|
reader.readAsArrayBuffer(file);
|
|
|
reader.onload = async (e) => {
|
|
@@ -181,6 +180,12 @@ const handleUpload = (file) => {
|
|
|
let formData = new FormData();
|
|
|
formData.append("file", file);
|
|
|
const res = await upload(formData)
|
|
|
+ const keys = Object.keys(res)
|
|
|
+ const values = Object.values(res)
|
|
|
+ readData[0].forEach((header, i) => {
|
|
|
+ if (!xlsxData.value[header]) xlsxData.value[header] = []
|
|
|
+ xlsxData.value[header].push(readData[1][i])
|
|
|
+ })
|
|
|
console.log(res);
|
|
|
}
|
|
|
}
|
|
@@ -195,16 +200,15 @@ async function fetchDataAndProcess(input, obj) {
|
|
|
const pageInfo = await getPageInfo()
|
|
|
console.log(pageInfo);
|
|
|
|
|
|
- // 发起请求获取数据
|
|
|
- // const res = await hepl({
|
|
|
- // input_data: input,
|
|
|
- // body:pageInfo.content.mainContent
|
|
|
- // })
|
|
|
- const res = await new Promise((resolve, reject) => {
|
|
|
- setTimeout(() => {
|
|
|
- resolve({ data: mockData[indexTemp.value] })
|
|
|
- }, 1000)
|
|
|
+ const res = await hepl({
|
|
|
+ input_data: input,
|
|
|
+ body:pageInfo.content.mainContent
|
|
|
})
|
|
|
+ // const res = await new Promise((resolve, reject) => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // resolve({ data: mockData[indexTemp.value] })
|
|
|
+ // }, 1000)
|
|
|
+ // })
|
|
|
await handleClick(res.data, obj);
|
|
|
}
|
|
|
|