综述: 优化账号权限分配页面样式和功能实现
This commit is contained in:
		
							parent
							
								
									e9c3c224b2
								
							
						
					
					
						commit
						b834e68c83
					
				|  | @ -4,6 +4,7 @@ | |||
|     <meta charset="UTF-8"> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||
|     <title>账号权限分配</title> | ||||
|     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> | ||||
|     <style> | ||||
|         * { | ||||
|             margin: 0; | ||||
|  | @ -12,8 +13,8 @@ | |||
|         } | ||||
| 
 | ||||
|         body { | ||||
|             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||||
|             background-color: #f5f7fa; | ||||
|             font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 微软雅黑, Arial, sans-serif; | ||||
|             background-color: #f5f5f5; | ||||
|             color: #333; | ||||
|             height: 100vh; | ||||
|             margin: 0; | ||||
|  | @ -31,7 +32,7 @@ | |||
|         } | ||||
| 
 | ||||
|         .header { | ||||
|             background: linear-gradient(135deg, #2c3e50, #3498db); | ||||
|             background-color: rgb(9, 84, 43); | ||||
|             color: #fff; | ||||
|             padding: 20px 30px; | ||||
|             display: flex; | ||||
|  | @ -63,31 +64,31 @@ | |||
|         } | ||||
| 
 | ||||
|         .btn-primary { | ||||
|             background-color: #3498db; | ||||
|             background-color: #1890ff; | ||||
|             color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary:hover { | ||||
|             background-color: #2980b9; | ||||
|             background-color: #40a9ff; | ||||
|             transform: translateY(-2px); | ||||
|         } | ||||
| 
 | ||||
|         .btn-success { | ||||
|             background-color: #27ae60; | ||||
|             background-color: #52c41a; | ||||
|             color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success:hover { | ||||
|             background-color: #229954; | ||||
|             background-color: #73d13d; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning { | ||||
|             background-color: #f39c12; | ||||
|             background-color: #faad14; | ||||
|             color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning:hover { | ||||
|             background-color: #e67e22; | ||||
|             background-color: #ffc53d; | ||||
|         } | ||||
| 
 | ||||
|         /* 内容区域 */ | ||||
|  | @ -102,18 +103,18 @@ | |||
|         .section-title { | ||||
|             font-size: 1.4rem; | ||||
|             font-weight: 600; | ||||
|             color: #2c3e50; | ||||
|             color: #333; | ||||
|             margin-bottom: 20px; | ||||
|             padding-bottom: 10px; | ||||
|             border-bottom: 2px solid #ecf0f1; | ||||
|             border-bottom: 2px solid #f0f0f0; | ||||
|         } | ||||
| 
 | ||||
|         /* 账号创建区域 */ | ||||
|         .account-form { | ||||
|             background-color: #f8f9fa; | ||||
|             background-color: #fafafa; | ||||
|             padding: 25px; | ||||
|             border-radius: 8px; | ||||
|             border: 1px solid #dee2e6; | ||||
|             border: 1px solid #e8e8e8; | ||||
|         } | ||||
| 
 | ||||
|         .form-row { | ||||
|  | @ -131,32 +132,33 @@ | |||
|             display: block; | ||||
|             margin-bottom: 8px; | ||||
|             font-weight: 500; | ||||
|             color: #2c3e50; | ||||
|             color: #333; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input, | ||||
|         .form-group select { | ||||
|             width: 100%; | ||||
|             padding: 12px 15px; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 5px; | ||||
|             border: 1px solid #d9d9d9; | ||||
|             border-radius: 4px; | ||||
|             font-size: 14px; | ||||
|             transition: border-color 0.3s ease; | ||||
|             background-color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input:focus, | ||||
|         .form-group select:focus { | ||||
|             outline: none; | ||||
|             border-color: #3498db; | ||||
|             box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); | ||||
|             border-color: #1890ff; | ||||
|             box-shadow: 0 0 5px rgba(24, 144, 255, 0.3); | ||||
|         } | ||||
| 
 | ||||
|         /* 权限分配区域 */ | ||||
|         .permissions-container { | ||||
|             background-color: #f8f9fa; | ||||
|             background-color: #fafafa; | ||||
|             padding: 25px; | ||||
|             border-radius: 8px; | ||||
|             border: 1px solid #dee2e6; | ||||
|             border: 1px solid #e8e8e8; | ||||
|             max-height: 500px; | ||||
|             overflow-y: auto; | ||||
|         } | ||||
|  | @ -173,23 +175,23 @@ | |||
|             display: flex; | ||||
|             align-items: center; | ||||
|             padding: 12px 15px; | ||||
|             border-radius: 6px; | ||||
|             border-radius: 4px; | ||||
|             transition: all 0.3s ease; | ||||
|             cursor: pointer; | ||||
|             background-color: #fff; | ||||
|             border: 1px solid #e9ecef; | ||||
|             border: 1px solid #e8e8e8; | ||||
|             margin-bottom: 5px; | ||||
|         } | ||||
| 
 | ||||
|         .permission-node:hover { | ||||
|             background-color: #f8f9fa; | ||||
|             border-color: #3498db; | ||||
|             box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15); | ||||
|             background-color: #f5f5f5; | ||||
|             border-color: #1890ff; | ||||
|             box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15); | ||||
|         } | ||||
|          | ||||
|         .permission-node.selected { | ||||
|             background-color: #e3f2fd; | ||||
|             border-color: #3498db; | ||||
|             background-color: #e6f7ff; | ||||
|             border-color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .permission-checkbox { | ||||
|  | @ -197,11 +199,11 @@ | |||
|             width: 18px; | ||||
|             height: 18px; | ||||
|             cursor: pointer; | ||||
|             accent-color: #3498db; | ||||
|             accent-color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn { | ||||
|             background: #3498db; | ||||
|             background: #1890ff; | ||||
|             border: none; | ||||
|             cursor: pointer; | ||||
|             padding: 2px 8px; | ||||
|  | @ -222,7 +224,7 @@ | |||
| 
 | ||||
|         .permission-label { | ||||
|             font-size: 14px; | ||||
|             color: #2c3e50; | ||||
|             color: #333; | ||||
|             user-select: none; | ||||
|             flex: 1; | ||||
|             font-weight: 500; | ||||
|  | @ -231,7 +233,7 @@ | |||
|         .permission-children { | ||||
|             margin-left: 35px; | ||||
|             margin-top: 8px; | ||||
|             border-left: 2px solid #3498db; | ||||
|             border-left: 2px solid #1890ff; | ||||
|             padding-left: 20px; | ||||
|             display: none; | ||||
|             position: relative; | ||||
|  | @ -244,7 +246,7 @@ | |||
|             top: -8px; | ||||
|             height: calc(100% + 16px); | ||||
|             width: 2px; | ||||
|             background-color: #3498db; | ||||
|             background-color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .permission-children.expanded { | ||||
|  | @ -258,14 +260,14 @@ | |||
|         } | ||||
| 
 | ||||
|         .permission-item.parent > .permission-node { | ||||
|             background-color: #edf7ff; | ||||
|             border-color: #bbdefb; | ||||
|             background-color: #f0f9ff; | ||||
|             border-color: #d9f3ff; | ||||
|             font-weight: 600; | ||||
|         } | ||||
| 
 | ||||
|         .permission-item.child .permission-node { | ||||
|             margin-left: 15px; | ||||
|             background-color: #f8f9fa; | ||||
|             background-color: #fafafa; | ||||
|         } | ||||
| 
 | ||||
|         /* 操作区域 */ | ||||
|  | @ -274,7 +276,7 @@ | |||
|             justify-content: flex-end; | ||||
|             gap: 10px; | ||||
|             padding-top: 20px; | ||||
|             border-top: 1px solid #dee2e6; | ||||
|             border-top: 1px solid #e8e8e8; | ||||
|             margin-top: 30px; | ||||
|         } | ||||
| 
 | ||||
|  | @ -309,7 +311,7 @@ | |||
|             <h1>账号权限分配</h1> | ||||
|             <div class="header-actions"> | ||||
|                 <button class="btn btn-warning" onclick="resetForm()"> | ||||
|                     🔄 重置 | ||||
|                     <i class="fas fa-sync-alt"></i> 重置 | ||||
|                 </button> | ||||
|             </div> | ||||
|         </div> | ||||
|  | @ -349,8 +351,12 @@ | |||
| 
 | ||||
|             <!-- 操作按钮 --> | ||||
|             <div class="actions"> | ||||
|                 <button class="btn btn-warning" onclick="cancelAssignment()">取消</button> | ||||
|                 <button class="btn btn-success" onclick="saveAssignment()">💾 保存分配</button> | ||||
|                 <button class="btn btn-warning" onclick="cancelAssignment()"> | ||||
|                     <i class="fas fa-times"></i> 取消 | ||||
|                 </button> | ||||
|                 <button class="btn btn-success" onclick="saveAssignment()"> | ||||
|                     <i class="fas fa-save"></i> 保存分配 | ||||
|                 </button> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  | @ -706,7 +712,8 @@ | |||
|         // 取消分配 | ||||
|         function cancelAssignment() { | ||||
|             if (confirm('确定要取消权限分配吗?未保存的更改将丢失。')) { | ||||
|                 window.history.back(); | ||||
|                 // 在实际应用中,这可能需要重定向到其他页面 | ||||
|                 window.location.reload(); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -280,6 +280,24 @@ | |||
|                 </a> | ||||
|             </li> | ||||
|              | ||||
|             <li class="menu-item"> | ||||
|                 <div class="menu-link" onclick="toggleSubmenu(this)"> | ||||
|                     <span class="menu-icon"> | ||||
|                         <i class="fas fa-user-cog"></i> | ||||
|                     </span> | ||||
|                     <span class="menu-text">账号权限管理</span> | ||||
|                     <span class="menu-arrow"> | ||||
|                         <i class="fas fa-chevron-right"></i> | ||||
|                     </span> | ||||
|                 </div> | ||||
|                 <div class="submenu"> | ||||
|                     <a href="#" class="submenu-link"> | ||||
|                         <span class="submenu-icon"></span> | ||||
|                         账号权限分配 | ||||
|                     </a> | ||||
|                 </div> | ||||
|             </li> | ||||
|              | ||||
|             <li class="menu-item"> | ||||
|                 <div class="menu-link" onclick="toggleSubmenu(this)"> | ||||
|                     <span class="menu-icon"> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue