(fileName)
| 2443 | |
| 2444 | // 显示上传成功提示 |
| 2445 | function showUploadNotification(fileName) { |
| 2446 | // 移除已存在的提示框 |
| 2447 | const existingNotification = document.querySelector('.nsn-upload-notification'); |
| 2448 | if (existingNotification) { |
| 2449 | existingNotification.remove(); |
| 2450 | } |
| 2451 | |
| 2452 | // 创建提示框 |
| 2453 | const notification = createElement('div', { |
| 2454 | className: 'nsn-upload-notification', |
| 2455 | style: { |
| 2456 | position: 'absolute', |
| 2457 | bottom: '60px', |
| 2458 | right: '20px', |
| 2459 | background: 'linear-gradient(135deg, #10b981, #059669)', |
| 2460 | color: 'white', |
| 2461 | padding: '8px 16px', |
| 2462 | borderRadius: '6px', |
| 2463 | fontSize: '12px', |
| 2464 | fontWeight: '500', |
| 2465 | boxShadow: '0 4px 20px rgba(16, 185, 129, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1)', |
| 2466 | zIndex: '1000000001', |
| 2467 | pointerEvents: 'none', |
| 2468 | opacity: '0', |
| 2469 | transform: 'translateY(20px)', |
| 2470 | transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)', |
| 2471 | backdropFilter: 'blur(10px)', |
| 2472 | border: '1px solid rgba(255, 255, 255, 0.2)' |
| 2473 | } |
| 2474 | }, [`✓ 文件"${fileName}"上传成功`]); |
| 2475 | |
| 2476 | // 确保提示框显示在弹窗内部 |
| 2477 | dialog.appendChild(notification); |
| 2478 | |
| 2479 | // 触发入场动画 |
| 2480 | requestAnimationFrame(() => { |
| 2481 | notification.style.opacity = '1'; |
| 2482 | notification.style.transform = 'translateY(0)'; |
| 2483 | }); |
| 2484 | |
| 2485 | // 5秒后自动消失 |
| 2486 | setTimeout(() => { |
| 2487 | if (notification && notification.parentNode) { |
| 2488 | notification.style.opacity = '0'; |
| 2489 | notification.style.transform = 'translateY(20px)'; |
| 2490 | |
| 2491 | setTimeout(() => { |
| 2492 | if (notification && notification.parentNode) { |
| 2493 | notification.remove(); |
| 2494 | } |
| 2495 | }, 300); |
| 2496 | } |
| 2497 | }, 5000); |
| 2498 | } |
| 2499 | |
| 2500 | |
| 2501 |
nothing calls this directly
no test coverage detected