fix(file): 优化文件上传及预览逻辑,完善当前用户信息设置

This commit is contained in:
Rue Ji
2026-04-05 22:36:07 +08:00
parent b9d6a7458f
commit 6d5c8bfd65
4 changed files with 33 additions and 13 deletions

View File

@ -116,8 +116,11 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
tbName: tbName,
bucketName: bucketName
}, function (data) {
// 清空数组而不是重新赋值,这样可以保持引用不变
previews.length = 0;
previewConfigs.length = 0;
if (data.length > 0) {
previews = new Array();
$('#maintenancefile').show();
for (var i = 0; i < data.length; i++) {
var previewConfig = new Object();
@ -133,10 +136,9 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
}
previewConfigs.push(previewConfig);
}
showFileInput_new(divId, previews, previewConfigs);
} else {
$('#' + divId).hide();
}
// 无论是否有数据都重新初始化控件
showFileInput_new(divId, previews, previewConfigs);
}, 'json');
};