tijaio
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user