This commit is contained in:
2025-06-09 15:55:07 +08:00
parent 8c4701c2e6
commit 19c672b3c7
9 changed files with 220 additions and 137 deletions

View File

@@ -1128,9 +1128,23 @@ export default {
},
handleFileChange(event) {
var that = this;
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// 处理文件上传并传递回调函数
this.$commonJS.handleFileUpload(event, function (tables) {
console.log('tables at line 1138:', tables)
if(tables.length == 0){
loading.close()
that.$message({
type: 'warning',
message: 'No table found!'
});
return false
}
// 使用 Promise.all 等待所有表格解析完成
Promise.all(
@@ -1148,9 +1162,11 @@ export default {
.then((result) => {
// 所有表格的解析完成后,处理结果
that.uploadWordTables = result;
loading.close()
that.tablesHtmlVisible = true;
})
.catch((error) => {
loading.close()
console.error('Error processing tables:', error);
});
});