fix(Attachments): 修复拖拽上传遮罩显示问题 & fix(FilesCard): 修复预览图片原图、缩略图逻辑问题 - #491
fix(Attachments): 修复拖拽上传遮罩显示问题 & fix(FilesCard): 修复预览图片原图、缩略图逻辑问题#491ToWaitForTheWind wants to merge 1 commit into
Conversation
fix(FilesCard): 修复预览图片原图、缩略图逻辑问题
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAttachments component now guards drag-and-drop event handlers, listener wiring, and drop-area rendering behind a hideUpload prop check, refactoring listener add/remove into helper functions. FilesCard computes a unified _displayImgUrl and _previewSrcList replacing _previewImgUrl for image preview logic across mask hover, template bindings, and slot visibility. ChangesAttachments hideUpload support
FilesCard preview URL refactor
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AttachmentsComponent
participant DOMTarget
User->>AttachmentsComponent: drag enter/over/drop
AttachmentsComponent->>AttachmentsComponent: check props.hideUpload
alt hideUpload is true
AttachmentsComponent-->AttachmentsComponent: early return, no style/emit
else hideUpload is false
AttachmentsComponent->>DOMTarget: preventDefault, toggle drag style
AttachmentsComponent->>User: emit drop/upload event
end
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/core/src/components/Attachments/index.vueParsing error: Unexpected token < packages/core/src/components/FilesCard/index.vueParsing error: Unexpected token < Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix(Attachments): 修复拖拽上传遮罩显示问题 & fix(FilesCard): 修复预览图片原图、缩略图逻辑问题
🔗 相关 Issue
无
📝 变更类型
📋 变更说明
设置
hideUpload后,默认上传按钮会隐藏,但拖拽文件到组件区域(或dragTarget指定区域)时,仍会出现「在此处拖放文件上传」遮罩,并可能触发uploadDrop事件。在
FilesCard组件中,当同时传入thumbUrl(缩略图)和url(原图)时,点击预览查看大图仍显示缩略图,无法看到原图。🧪 测试计划
✅ Checklist
📦 Changeset
无
Changeset 类型
无
修改文档
hideUpload-drag-fix.md
thumbUrl-preview-fix.md
Summary by CodeRabbit