| 
									
										
										
										
											2025-10-28 15:16:58 +08:00
										 |  |  | import { ArrowLeftOutlined } from "@ant-design/icons"; | 
					
						
							|  |  |  | import { Divider } from "antd"; | 
					
						
							|  |  |  | import "./index.less"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * 头部返回组件 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | function HeaderBack(props) { | 
					
						
							| 
									
										
										
										
											2025-10-28 16:13:50 +08:00
										 |  |  |   const { title, history, previous = true, style = {} } = props; | 
					
						
							| 
									
										
										
										
											2025-10-28 15:16:58 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   return ( | 
					
						
							| 
									
										
										
										
											2025-10-28 16:13:50 +08:00
										 |  |  |     <div className="header-back" style={style}> | 
					
						
							| 
									
										
										
										
											2025-10-28 15:16:58 +08:00
										 |  |  |       <div className="action"> | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           previous | 
					
						
							|  |  |  |           && ( | 
					
						
							|  |  |  |             <> | 
					
						
							|  |  |  |               <div | 
					
						
							|  |  |  |                 className="back" | 
					
						
							|  |  |  |                 onClick={() => history?.goBack?.() || window.history.back()} | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 <ArrowLeftOutlined style={{ fontSize: 14 }} /> | 
					
						
							|  |  |  |                 <span>返回</span> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               <Divider type="vertical" style={{ backgroundColor: "#dcdfe6", marginLeft: 15, marginRight: 15 }} /> | 
					
						
							|  |  |  |             </> | 
					
						
							|  |  |  |           ) | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         <div className="title">{title}</div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   ); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default HeaderBack; |