| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  | import { Tag, Tooltip } from "antd"; | 
					
						
							|  |  |  | import PreviewImg from "~/components/PreviewImg"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-28 15:16:58 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * 在表格组件中图片查看组件 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  | const TooltipPreviewImg = (props) => { | 
					
						
							|  |  |  |   const { files = [], fileUrlKey = "filePath" } = props; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const renderContent = () => { | 
					
						
							|  |  |  |     return ( | 
					
						
							|  |  |  |       files.length > 0 | 
					
						
							|  |  |  |         ? <PreviewImg files={files} fileUrlKey={fileUrlKey} /> | 
					
						
							|  |  |  |         : <span>暂无图片</span> | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <Tooltip placement="top" title={renderContent()}> | 
					
						
							|  |  |  |       <Tag>预览</Tag> | 
					
						
							|  |  |  |     </Tooltip> | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default TooltipPreviewImg; |