综述: 优化平台端web界面样式和功能模块
- 在摊位列表和摊位创建页面中增加绑定已存在供货商账号的功能选项 - 优化平台端web整体界面样式,统一样式规范,改善用户界面体验 - 在菜市场列表页面中优化详情查看和创建表单,增加地图定位功能和营业时间配置交互 - 重构权限管理模块的界面样式,提升视觉效果和操作体验
This commit is contained in:
		
							parent
							
								
									f1df5b450b
								
							
						
					
					
						commit
						e2f5333831
					
				|  | @ -485,6 +485,7 @@ | |||
|                             <option value="">请选择操作类型</option> | ||||
|                             <option value="bind_market_manager">绑定收益人是市场经营者</option> | ||||
|                             <option value="create_supplier">创建新收益人(供货商)</option> | ||||
|                             <option value="bind_existing_supplier">绑定已存在的供货商账号</option> | ||||
|                         </select> | ||||
|                     </div> | ||||
| 
 | ||||
|  | @ -650,6 +651,10 @@ | |||
|                 // 创建新收益人(供货商) - 显示账号和密码 | ||||
|                 supplierAccountGroup.style.display = 'block'; | ||||
|                 supplierPasswordGroup.style.display = 'block'; | ||||
|             } else if (operationType === 'bind_existing_supplier') { | ||||
|                 // 绑定已存在的供货商账号 - 只显示账号,不显示密码 | ||||
|                 supplierAccountGroup.style.display = 'block'; | ||||
|                 supplierPasswordGroup.style.display = 'none'; | ||||
|             } else { | ||||
|                 // 绑定收益人是市场经营者 - 隐藏账号和密码 | ||||
|                 supplierAccountGroup.style.display = 'none'; | ||||
|  | @ -689,6 +694,17 @@ | |||
|                 beneficiaryData.supplierAccount = supplierAccount; | ||||
|                 beneficiaryData.password = password; | ||||
|             } | ||||
|             // 如果选择了"绑定已存在的供货商账号",只需要验证供货商账号 | ||||
|             else if (operationType === 'bind_existing_supplier') { | ||||
|                 const supplierAccount = document.getElementById('modalSupplierAccount').value; | ||||
| 
 | ||||
|                 if (!supplierAccount) { | ||||
|                     alert('请输入供货商账号'); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 beneficiaryData.supplierAccount = supplierAccount; | ||||
|             } | ||||
| 
 | ||||
|             console.log('保存收益人配置:', beneficiaryData); | ||||
| 
 | ||||
|  | @ -696,7 +712,7 @@ | |||
|             alert('收益人配置已保存!'); | ||||
| 
 | ||||
|             // 可选:更新表格中的收益人信息 | ||||
|             if (currentBoothRow && operationType === 'create_supplier') { | ||||
|             if (currentBoothRow && (operationType === 'create_supplier' || operationType === 'bind_existing_supplier')) { | ||||
|                 const cells = currentBoothRow.querySelectorAll('td'); | ||||
|                 // cells[2].textContent = '新收益人'; // 可以根据实际需求更新 | ||||
|                 // cells[3].textContent = beneficiaryData.supplierAccount; | ||||
|  |  | |||
|  | @ -405,6 +405,7 @@ | |||
|                             <option value="">请选择操作类型</option> | ||||
|                             <option value="bind_market_manager">绑定收益人是市场经营者</option> | ||||
|                             <option value="create_supplier">创建新收益人(供货商)</option> | ||||
|                             <option value="bind_existing_supplier">绑定已存在的供货商账号</option> | ||||
|                         </select> | ||||
|                     </div> | ||||
|                 </div> | ||||
|  | @ -732,6 +733,10 @@ | |||
|                 // 创建新收益人(供货商)- 显示账号和密码 | ||||
|                 supplierAccountGroup.style.display = 'flex'; | ||||
|                 supplierPasswordGroup.style.display = 'flex'; | ||||
|             } else if (operationType === 'bind_existing_supplier') { | ||||
|                 // 绑定已存在的供货商账号 - 只显示账号,不显示密码 | ||||
|                 supplierAccountGroup.style.display = 'flex'; | ||||
|                 supplierPasswordGroup.style.display = 'none'; | ||||
|             } else { | ||||
|                 // 绑定收益人是市场经营者 - 隐藏账号和密码 | ||||
|                 supplierAccountGroup.style.display = 'none'; | ||||
|  | @ -810,6 +815,17 @@ | |||
|                     formData.supplierAccount = supplierAccount; | ||||
|                     formData.password = password; | ||||
|                 } | ||||
|                 // 如果选择了"绑定已存在的供货商账号",只需要验证供货商账号 | ||||
|                 else if (operationType === 'bind_existing_supplier') { | ||||
|                     const supplierAccount = document.getElementById('supplierAccount').value; | ||||
| 
 | ||||
|                     if (!supplierAccount) { | ||||
|                         alert('请输入供货商账号'); | ||||
|                         return; | ||||
|                     } | ||||
| 
 | ||||
|                     formData.supplierAccount = supplierAccount; | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             if (!formData.boothName) { | ||||
|  |  | |||
|  | @ -17,6 +17,7 @@ | |||
|             color: #333; | ||||
|             height: 100vh; | ||||
|             overflow: hidden; | ||||
|             background: #f5f5f5; | ||||
|         } | ||||
| 
 | ||||
|         .admin-layout { | ||||
|  | @ -269,6 +270,7 @@ | |||
|             border-bottom-color: #fff; | ||||
|             z-index: 1; | ||||
|             margin-bottom: -1px; | ||||
|             color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .tab-item:hover { | ||||
|  | @ -384,32 +386,30 @@ | |||
|                             <a href="./权限管理/市场经营者创建.html" class="submenu-item" onclick="openTabWithIframe(this, '市场经营者创建')">市场经营者创建</a> | ||||
|                         </div> | ||||
|                     </li> | ||||
|                     <li class="menu-item"> | ||||
|                         <button class="menu-item-link" onclick="toggleSubmenu(this)"> | ||||
|                             <span class="menu-icon"> | ||||
|                                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"> | ||||
|                                     <path fill="currentColor" d="M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"></path> | ||||
|                                 </svg> | ||||
|                             </span> | ||||
|                             <span class="menu-text">菜市场管理</span> | ||||
|                             <span class="menu-arrow"> | ||||
|                                 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"> | ||||
|                                     <path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path> | ||||
|                                 </svg> | ||||
|                             </span> | ||||
|                         </button> | ||||
|                         <div class="submenu"> | ||||
|                             <a href="./菜市场管理/菜市场列表.html" class="submenu-item" onclick="openTabWithIframe(this, '菜市场列表')">菜市场列表</a> | ||||
|                         </div> | ||||
|                     </li> | ||||
|                 </ul> | ||||
|             </nav> | ||||
|         </aside> | ||||
| 
 | ||||
|         <!-- 右侧主内容区 --> | ||||
|         <main class="main-content"> | ||||
|             <!-- 顶部导航栏 --> | ||||
|             <header class="header"> | ||||
|                 <div class="header-left"> | ||||
|                     <div class="menu-trigger" onclick="toggleSidebar()"></div> | ||||
|                     <nav class="breadcrumb"> | ||||
|                         <a href="#/dashboard" class="breadcrumb-item">首页</a> | ||||
|                         <span class="breadcrumb-separator">/</span> | ||||
|                         <a href="#" class="breadcrumb-item">权限管理</a> | ||||
|                         <span class="breadcrumb-separator">/</span> | ||||
|                         <span class="breadcrumb-item">权限编辑</span> | ||||
|                     </nav> | ||||
|                 </div> | ||||
|                 <div class="header-right"> | ||||
|                     <div class="user-info"> | ||||
|                         <div class="user-avatar">A</div> | ||||
|                         <span>admin</span> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </header> | ||||
| 
 | ||||
|             <!-- 标签页区域 --> | ||||
|             <div class="tabs-container"> | ||||
|                 <div class="tab-item active" data-tab="home"> | ||||
|  |  | |||
|  | @ -12,178 +12,178 @@ | |||
|         } | ||||
| 
 | ||||
|         body { | ||||
|             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||||
|             background-color: #f5f7fa; | ||||
|             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||||
|             background-color: #f5f5f5; | ||||
|             color: #333; | ||||
|             height: 100vh; | ||||
|             margin: 0; | ||||
|             padding: 0; | ||||
|             min-height: 100vh; | ||||
|             padding: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .container { | ||||
|             width: 100%; | ||||
|             height: 100vh; | ||||
|             margin: 0; | ||||
|             background-color: #fff; | ||||
|             border-radius: 0; | ||||
|             box-shadow: none; | ||||
|             overflow: hidden; | ||||
|             max-width: 1600px; | ||||
|             margin: 0 auto; | ||||
|         } | ||||
| 
 | ||||
|         .header { | ||||
|             background: linear-gradient(135deg, #2c3e50, #3498db); | ||||
|             color: #fff; | ||||
|             padding: 20px 30px; | ||||
|         /* 页面头部 */ | ||||
|         .page-header { | ||||
|             background: white; | ||||
|             padding: 16px 24px; | ||||
|             margin-bottom: 16px; | ||||
|             border-radius: 8px; | ||||
|             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||||
|             display: flex; | ||||
|             justify-content: space-between; | ||||
|             align-items: center; | ||||
|         } | ||||
| 
 | ||||
|         .header h1 { | ||||
|             font-size: 1.8rem; | ||||
|         .page-title { | ||||
|             font-size: 24px; | ||||
|             font-weight: 600; | ||||
|             color: #262626; | ||||
|         } | ||||
| 
 | ||||
|         .header-actions { | ||||
|             display: flex; | ||||
|             gap: 10px; | ||||
|         } | ||||
| 
 | ||||
|         /* 按钮样式 */ | ||||
|         .btn { | ||||
|             padding: 10px 20px; | ||||
|             height: 40px; | ||||
|             padding: 0 16px; | ||||
|             border: none; | ||||
|             border-radius: 5px; | ||||
|             cursor: pointer; | ||||
|             border-radius: 6px; | ||||
|             font-size: 14px; | ||||
|             font-weight: 500; | ||||
|             transition: all 0.3s ease; | ||||
|             cursor: pointer; | ||||
|             display: inline-flex; | ||||
|             align-items: center; | ||||
|             justify-content: center; | ||||
|             transition: all 0.3s; | ||||
|             gap: 5px; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary { | ||||
|             background-color: #3498db; | ||||
|             color: #fff; | ||||
|             background: #1890ff; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary:hover { | ||||
|             background-color: #2980b9; | ||||
|             transform: translateY(-2px); | ||||
|             background: #40a9ff; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success { | ||||
|             background-color: #27ae60; | ||||
|             color: #fff; | ||||
|             background: #52c41a; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success:hover { | ||||
|             background-color: #229954; | ||||
|             background: #73d13d; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning { | ||||
|             background-color: #f39c12; | ||||
|             color: #fff; | ||||
|         .btn-default { | ||||
|             background: white; | ||||
|             color: #666; | ||||
|             border: 1px solid #ddd; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning:hover { | ||||
|             background-color: #e67e22; | ||||
|         .btn-default:hover { | ||||
|             border-color: #1890ff; | ||||
|             color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         /* 内容区域 */ | ||||
|         .content { | ||||
|             padding: 30px; | ||||
|         .button-group { | ||||
|             display: flex; | ||||
|             gap: 12px; | ||||
|         } | ||||
| 
 | ||||
|         .section { | ||||
|             margin-bottom: 40px; | ||||
|         /* 表单区域 */ | ||||
|         .form-section { | ||||
|             background: white; | ||||
|             padding: 24px; | ||||
|             margin-bottom: 16px; | ||||
|             border-radius: 8px; | ||||
|             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||||
|         } | ||||
| 
 | ||||
|         .section-title { | ||||
|             font-size: 1.4rem; | ||||
|             font-size: 18px; | ||||
|             font-weight: 600; | ||||
|             color: #2c3e50; | ||||
|             color: #262626; | ||||
|             margin-bottom: 20px; | ||||
|             padding-bottom: 10px; | ||||
|             border-bottom: 2px solid #ecf0f1; | ||||
|         } | ||||
| 
 | ||||
|         /* 账号创建区域 */ | ||||
|         .account-form { | ||||
|             background-color: #f8f9fa; | ||||
|             padding: 25px; | ||||
|             border-radius: 8px; | ||||
|             border: 1px solid #dee2e6; | ||||
|             padding-bottom: 12px; | ||||
|             border-bottom: 1px solid #f0f0f0; | ||||
|         } | ||||
| 
 | ||||
|         .form-row { | ||||
|             display: grid; | ||||
|             grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); | ||||
|             gap: 16px; | ||||
|             margin-bottom: 16px; | ||||
|         } | ||||
| 
 | ||||
|         .form-item { | ||||
|             display: flex; | ||||
|             gap: 20px; | ||||
|             align-items: end; | ||||
|             flex-direction: column; | ||||
|             gap: 8px; | ||||
|         } | ||||
| 
 | ||||
|         .form-group { | ||||
|             flex: 1; | ||||
|             margin-bottom: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .form-group label { | ||||
|             display: block; | ||||
|             margin-bottom: 8px; | ||||
|             font-weight: 500; | ||||
|             color: #2c3e50; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input, | ||||
|         .form-group select { | ||||
|             width: 100%; | ||||
|             padding: 12px 15px; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 5px; | ||||
|         .form-label { | ||||
|             font-size: 14px; | ||||
|             transition: border-color 0.3s ease; | ||||
|             color: #666; | ||||
|             font-weight: 500; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input:focus, | ||||
|         .form-group select:focus { | ||||
|         .form-input, | ||||
|         .form-select { | ||||
|             height: 40px; | ||||
|             padding: 0 12px; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 6px; | ||||
|             font-size: 14px; | ||||
|             transition: all 0.3s; | ||||
|         } | ||||
| 
 | ||||
|         .form-input:focus, | ||||
|         .form-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 0 2px rgba(24, 144, 255, 0.2); | ||||
|         } | ||||
| 
 | ||||
|         /* 菜市场选择框样式 */ | ||||
|         /* 菜市场选择下拉框 */ | ||||
|         .market-select-container { | ||||
|             position: relative; | ||||
|         } | ||||
| 
 | ||||
|         .market-select { | ||||
|             cursor: pointer; | ||||
|         } | ||||
| 
 | ||||
|         .market-dropdown { | ||||
|             position: absolute; | ||||
|             top: 100%; | ||||
|             left: 0; | ||||
|             right: 0; | ||||
|             background: #fff; | ||||
|             border: 1px solid #ddd; | ||||
|             border-top: none; | ||||
|             border-radius: 0 0 5px 5px; | ||||
|             max-height: 200px; | ||||
|             background: white; | ||||
|             border: 1px solid #f0f0f0; | ||||
|             border-radius: 6px; | ||||
|             max-height: 300px; | ||||
|             overflow-y: auto; | ||||
|             z-index: 1000; | ||||
|             display: none; | ||||
|             box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | ||||
|             margin-top: 4px; | ||||
|         } | ||||
| 
 | ||||
|         .market-dropdown.show { | ||||
|             display: block; | ||||
|         } | ||||
| 
 | ||||
|         .market-filter { | ||||
|             padding: 12px; | ||||
|             border: none; | ||||
|             border-bottom: 1px solid #f0f0f0; | ||||
|             width: 100%; | ||||
|             outline: none; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .market-option { | ||||
|             padding: 10px 15px; | ||||
|             padding: 10px 12px; | ||||
|             cursor: pointer; | ||||
|             transition: background-color 0.2s ease; | ||||
|             transition: background-color 0.2s; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .market-option:hover { | ||||
|  | @ -191,24 +191,12 @@ | |||
|         } | ||||
| 
 | ||||
|         .market-option.selected { | ||||
|             background-color: #3498db; | ||||
|             color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .market-filter { | ||||
|             padding: 10px 15px; | ||||
|             border: none; | ||||
|             border-bottom: 1px solid #eee; | ||||
|             width: 100%; | ||||
|             outline: none; | ||||
|             background-color: #e6f7ff; | ||||
|             color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         /* 权限分配区域 */ | ||||
|         .permissions-container { | ||||
|             background-color: #f8f9fa; | ||||
|             padding: 25px; | ||||
|             border-radius: 8px; | ||||
|             border: 1px solid #dee2e6; | ||||
|             max-height: 500px; | ||||
|             overflow-y: auto; | ||||
|         } | ||||
|  | @ -224,24 +212,22 @@ | |||
|         .permission-node { | ||||
|             display: flex; | ||||
|             align-items: center; | ||||
|             padding: 12px 15px; | ||||
|             padding: 12px 16px; | ||||
|             border-radius: 6px; | ||||
|             transition: all 0.3s ease; | ||||
|             transition: all 0.3s; | ||||
|             cursor: pointer; | ||||
|             background-color: #fff; | ||||
|             border: 1px solid #e9ecef; | ||||
|             margin-bottom: 5px; | ||||
|             background-color: white; | ||||
|             border: 1px solid #f0f0f0; | ||||
|         } | ||||
| 
 | ||||
|         .permission-node:hover { | ||||
|             background-color: #f8f9fa; | ||||
|             border-color: #3498db; | ||||
|             box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15); | ||||
|             border-color: #1890ff; | ||||
|         } | ||||
|          | ||||
| 
 | ||||
|         .permission-node.selected { | ||||
|             background-color: #e3f2fd; | ||||
|             border-color: #3498db; | ||||
|             background-color: #e6f7ff; | ||||
|             border-color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .permission-checkbox { | ||||
|  | @ -249,23 +235,24 @@ | |||
|             width: 18px; | ||||
|             height: 18px; | ||||
|             cursor: pointer; | ||||
|             accent-color: #3498db; | ||||
|             accent-color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn { | ||||
|             background: #3498db; | ||||
|             background: none; | ||||
|             border: none; | ||||
|             cursor: pointer; | ||||
|             padding: 2px 8px; | ||||
|             padding: 4px; | ||||
|             margin-right: 12px; | ||||
|             color: #fff; | ||||
|             color: #1890ff; | ||||
|             font-size: 14px; | ||||
|             transition: all 0.3s ease; | ||||
|             min-width: 28px; | ||||
|             transition: all 0.3s; | ||||
|             min-width: 24px; | ||||
|             border-radius: 4px; | ||||
|             display: flex; | ||||
|             align-items: center; | ||||
|             justify-content: center; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn:hover { | ||||
|             background: #e6f7ff; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn.collapsed { | ||||
|  | @ -274,140 +261,132 @@ | |||
| 
 | ||||
|         .permission-label { | ||||
|             font-size: 14px; | ||||
|             color: #2c3e50; | ||||
|             color: #333; | ||||
|             user-select: none; | ||||
|             flex: 1; | ||||
|             font-weight: 500; | ||||
|         } | ||||
| 
 | ||||
|         .permission-children { | ||||
|             margin-left: 35px; | ||||
|             margin-left: 40px; | ||||
|             margin-top: 8px; | ||||
|             border-left: 2px solid #3498db; | ||||
|             padding-left: 20px; | ||||
|             border-left: 2px solid #e6f7ff; | ||||
|             padding-left: 16px; | ||||
|             display: none; | ||||
|             position: relative; | ||||
|         } | ||||
|          | ||||
|         .permission-children::before { | ||||
|             content: ''; | ||||
|             position: absolute; | ||||
|             left: 0; | ||||
|             top: -8px; | ||||
|             height: calc(100% + 16px); | ||||
|             width: 2px; | ||||
|             background-color: #3498db; | ||||
|         } | ||||
| 
 | ||||
|         .permission-children.expanded { | ||||
|             display: block; | ||||
|             animation: fadeIn 0.3s ease-in-out; | ||||
|         } | ||||
|          | ||||
|         @keyframes fadeIn { | ||||
|             from { opacity: 0; transform: translateY(-5px); } | ||||
|             to { opacity: 1; transform: translateY(0); } | ||||
|         } | ||||
| 
 | ||||
|         .permission-item.parent > .permission-node { | ||||
|             background-color: #edf7ff; | ||||
|             border-color: #bbdefb; | ||||
|             background-color: #fafafa; | ||||
|             font-weight: 600; | ||||
|         } | ||||
| 
 | ||||
|         .permission-item.child .permission-node { | ||||
|             margin-left: 15px; | ||||
|             background-color: #f8f9fa; | ||||
|         } | ||||
| 
 | ||||
|         /* 操作区域 */ | ||||
|         .actions { | ||||
|             display: flex; | ||||
|             justify-content: flex-end; | ||||
|             gap: 10px; | ||||
|             gap: 12px; | ||||
|             padding-top: 20px; | ||||
|             border-top: 1px solid #dee2e6; | ||||
|             margin-top: 30px; | ||||
|         } | ||||
| 
 | ||||
|         /* 响应式设计 */ | ||||
|         @media (max-width: 768px) { | ||||
|             .container { | ||||
|                 margin: 0; | ||||
|                 border-radius: 0; | ||||
|             body { | ||||
|                 padding: 10px; | ||||
|             } | ||||
|              | ||||
|             .header { | ||||
|                 padding: 15px 20px; | ||||
| 
 | ||||
|             .page-header { | ||||
|                 padding: 12px 16px; | ||||
|                 flex-direction: column; | ||||
|                 gap: 15px; | ||||
|                 gap: 12px; | ||||
|                 align-items: flex-start; | ||||
|             } | ||||
|              | ||||
|             .content { | ||||
|                 padding: 20px; | ||||
| 
 | ||||
|             .form-section { | ||||
|                 padding: 16px; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             .form-row { | ||||
|                 flex-direction: column; | ||||
|                 gap: 0; | ||||
|                 grid-template-columns: 1fr; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         /* 滚动条样式 */ | ||||
|         .permissions-container::-webkit-scrollbar, | ||||
|         .market-dropdown::-webkit-scrollbar { | ||||
|             width: 6px; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-container::-webkit-scrollbar-track, | ||||
|         .market-dropdown::-webkit-scrollbar-track { | ||||
|             background: #f0f0f0; | ||||
|             border-radius: 3px; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-container::-webkit-scrollbar-thumb, | ||||
|         .market-dropdown::-webkit-scrollbar-thumb { | ||||
|             background: #ddd; | ||||
|             border-radius: 3px; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-container::-webkit-scrollbar-thumb:hover, | ||||
|         .market-dropdown::-webkit-scrollbar-thumb:hover { | ||||
|             background: #bbb; | ||||
|         } | ||||
|     </style> | ||||
| </head> | ||||
| <body> | ||||
|     <div class="container"> | ||||
|         <!-- 头部 --> | ||||
|         <div class="header"> | ||||
|             <h1>市场经营者创建</h1> | ||||
|             <div class="header-actions"> | ||||
|                 <button class="btn btn-warning" onclick="resetForm()"> | ||||
|                     🔄 重置 | ||||
|                 </button> | ||||
|         <!-- 页面头部 --> | ||||
|         <div class="page-header"> | ||||
|             <h1 class="page-title">市场经营者创建</h1> | ||||
|             <div class="button-group"> | ||||
|                 <button class="btn btn-default" onclick="resetForm()">重置</button> | ||||
|             </div> | ||||
|         </div> | ||||
| 
 | ||||
|         <!-- 内容区域 --> | ||||
|         <div class="content"> | ||||
|             <!-- 账号创建区域 --> | ||||
|             <div class="section"> | ||||
|                 <h2 class="section-title">账号信息</h2> | ||||
|                 <div class="account-form"> | ||||
|                     <div class="form-row"> | ||||
|                         <div class="form-group"> | ||||
|                             <label for="marketSelect">菜市场选择 *</label> | ||||
|                             <div class="market-select-container"> | ||||
|                                 <input type="text" id="marketSelect" class="market-select"  | ||||
|                                        placeholder="请选择菜市场" readonly onclick="toggleMarketDropdown()"> | ||||
|                                 <div id="marketDropdown" class="market-dropdown"> | ||||
|                                     <input type="text" id="marketFilter" class="market-filter"  | ||||
|                                            placeholder="输入菜市场名称搜索..."  | ||||
|                                            oninput="filterMarkets(this.value)"> | ||||
|                                     <div id="marketOptions"></div> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                         <div class="form-group"> | ||||
|                             <label for="phoneNumber">账号手机号 *</label> | ||||
|                             <input type="tel" id="phoneNumber" placeholder="请输入手机号" maxlength="11"> | ||||
|         <!-- 账号信息 --> | ||||
|         <div class="form-section"> | ||||
|             <h2 class="section-title">账号信息</h2> | ||||
|             <div class="form-row"> | ||||
|                 <div class="form-item"> | ||||
|                     <label class="form-label">菜市场选择 *</label> | ||||
|                     <div class="market-select-container"> | ||||
|                         <input type="text" id="marketSelect" class="form-input" | ||||
|                                placeholder="请选择菜市场" readonly onclick="toggleMarketDropdown()"> | ||||
|                         <div id="marketDropdown" class="market-dropdown"> | ||||
|                             <input type="text" id="marketFilter" class="market-filter" | ||||
|                                    placeholder="搜索菜市场..." | ||||
|                                    oninput="filterMarkets(this.value)"> | ||||
|                             <div id="marketOptions"></div> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
| 
 | ||||
|             <!-- 权限分配区域 --> | ||||
|             <div class="section"> | ||||
|                 <h2 class="section-title">权限分配</h2> | ||||
|                 <div class="permissions-container"> | ||||
|                     <ul id="permissionTree" class="permission-tree"> | ||||
|                         <!-- 权限树将通过JavaScript动态生成 --> | ||||
|                     </ul> | ||||
|                 <div class="form-item"> | ||||
|                     <label class="form-label">账号手机号 *</label> | ||||
|                     <input type="tel" id="phoneNumber" class="form-input" placeholder="请输入手机号" maxlength="11"> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
| 
 | ||||
|             <!-- 操作按钮 --> | ||||
|         <!-- 权限分配 --> | ||||
|         <div class="form-section"> | ||||
|             <h2 class="section-title">权限分配</h2> | ||||
|             <div class="permissions-container"> | ||||
|                 <ul id="permissionTree" class="permission-tree"> | ||||
|                     <!-- 权限树将通过JavaScript动态生成 --> | ||||
|                 </ul> | ||||
|             </div> | ||||
|         </div> | ||||
| 
 | ||||
|         <!-- 操作按钮 --> | ||||
|         <div class="form-section"> | ||||
|             <div class="actions"> | ||||
|                 <button class="btn btn-warning" onclick="cancelAssignment()">取消</button> | ||||
|                 <button class="btn btn-success" onclick="saveAssignment()">💾 保存分配</button> | ||||
|                 <button class="btn btn-default" onclick="cancelAssignment()">取消</button> | ||||
|                 <button class="btn btn-success" onclick="saveAssignment()">保存分配</button> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  | @ -425,7 +404,7 @@ | |||
|             { id: 8, name: '建设菜市场', code: 'JIANSHE_MARKET' } | ||||
|         ]; | ||||
| 
 | ||||
|         // 权限数据(从权限编辑页面获取的示例数据) | ||||
|         // 权限数据 | ||||
|         const permissions = [ | ||||
|             { | ||||
|                 id: 1, | ||||
|  | @ -491,7 +470,7 @@ | |||
|         function initMarketOptions() { | ||||
|             const optionsContainer = document.getElementById('marketOptions'); | ||||
|             optionsContainer.innerHTML = ''; | ||||
|              | ||||
| 
 | ||||
|             markets.forEach(market => { | ||||
|                 const option = document.createElement('div'); | ||||
|                 option.className = 'market-option'; | ||||
|  | @ -507,7 +486,7 @@ | |||
|             selectedMarket = market; | ||||
|             document.getElementById('marketSelect').value = market.name; | ||||
|             document.getElementById('marketDropdown').classList.remove('show'); | ||||
|              | ||||
| 
 | ||||
|             // 更新选中状态 | ||||
|             document.querySelectorAll('.market-option').forEach(option => { | ||||
|                 option.classList.toggle('selected', option.dataset.marketId == market.id); | ||||
|  | @ -518,7 +497,7 @@ | |||
|         function toggleMarketDropdown() { | ||||
|             const dropdown = document.getElementById('marketDropdown'); | ||||
|             dropdown.classList.toggle('show'); | ||||
|              | ||||
| 
 | ||||
|             if (dropdown.classList.contains('show')) { | ||||
|                 document.getElementById('marketFilter').focus(); | ||||
|             } | ||||
|  | @ -528,7 +507,7 @@ | |||
|         function filterMarkets(keyword) { | ||||
|             const options = document.querySelectorAll('.market-option'); | ||||
|             keyword = keyword.toLowerCase(); | ||||
|              | ||||
| 
 | ||||
|             options.forEach(option => { | ||||
|                 const marketName = option.textContent.toLowerCase(); | ||||
|                 option.style.display = marketName.includes(keyword) ? 'block' : 'none'; | ||||
|  | @ -540,7 +519,7 @@ | |||
|             const tree = buildPermissionTree(permissions); | ||||
|             const treeContainer = document.getElementById('permissionTree'); | ||||
|             treeContainer.innerHTML = ''; | ||||
|              | ||||
| 
 | ||||
|             tree.forEach(item => { | ||||
|                 treeContainer.appendChild(createPermissionNode(item)); | ||||
|             }); | ||||
|  | @ -550,12 +529,12 @@ | |||
|         function buildPermissionTree(data) { | ||||
|             const map = {}; | ||||
|             const roots = []; | ||||
|              | ||||
| 
 | ||||
|             // 创建映射 | ||||
|             data.forEach(item => { | ||||
|                 map[item.code] = { ...item, children: [] }; | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             // 构建树结构 | ||||
|             data.forEach(item => { | ||||
|                 if (item.parentCode && map[item.parentCode]) { | ||||
|  | @ -564,7 +543,7 @@ | |||
|                     roots.push(map[item.code]); | ||||
|                 } | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             return roots; | ||||
|         } | ||||
| 
 | ||||
|  | @ -572,10 +551,10 @@ | |||
|         function createPermissionNode(item) { | ||||
|             const li = document.createElement('li'); | ||||
|             li.className = 'permission-item ' + (item.children.length > 0 ? 'parent' : 'child'); | ||||
|              | ||||
| 
 | ||||
|             const nodeDiv = document.createElement('div'); | ||||
|             nodeDiv.className = 'permission-node'; | ||||
|              | ||||
| 
 | ||||
|             // 展开/收起按钮 | ||||
|             if (item.children.length > 0) { | ||||
|                 const expandBtn = document.createElement('button'); | ||||
|  | @ -589,11 +568,11 @@ | |||
|             } else { | ||||
|                 // 占位符保持对齐 | ||||
|                 const placeholder = document.createElement('span'); | ||||
|                 placeholder.style.width = '28px'; | ||||
|                 placeholder.style.width = '24px'; | ||||
|                 placeholder.style.display = 'inline-block'; | ||||
|                 nodeDiv.appendChild(placeholder); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 复选框 | ||||
|             const checkbox = document.createElement('input'); | ||||
|             checkbox.type = 'checkbox'; | ||||
|  | @ -601,28 +580,28 @@ | |||
|             checkbox.dataset.permissionCode = item.code; | ||||
|             checkbox.onchange = (e) => handlePermissionChange(e, item); | ||||
|             nodeDiv.appendChild(checkbox); | ||||
|              | ||||
| 
 | ||||
|             // 权限标签 | ||||
|             const label = document.createElement('span'); | ||||
|             label.className = 'permission-label'; | ||||
|             label.textContent = `${item.name}(${item.description || item.code})`; | ||||
|             label.textContent = `${item.name}(${item.description || item.code})`; | ||||
|             label.onclick = () => checkbox.click(); | ||||
|             nodeDiv.appendChild(label); | ||||
|              | ||||
| 
 | ||||
|             li.appendChild(nodeDiv); | ||||
|              | ||||
| 
 | ||||
|             // 子权限 | ||||
|             if (item.children.length > 0) { | ||||
|                 const childrenContainer = document.createElement('ul'); | ||||
|                 childrenContainer.className = 'permission-children'; | ||||
|                  | ||||
| 
 | ||||
|                 item.children.forEach(child => { | ||||
|                     childrenContainer.appendChild(createPermissionNode(child)); | ||||
|                 }); | ||||
|                  | ||||
| 
 | ||||
|                 li.appendChild(childrenContainer); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             return li; | ||||
|         } | ||||
| 
 | ||||
|  | @ -630,7 +609,7 @@ | |||
|         function togglePermissionChildren(btn, li) { | ||||
|             const children = li.querySelector('.permission-children'); | ||||
|             if (!children) return; | ||||
|              | ||||
| 
 | ||||
|             const isExpanded = children.classList.contains('expanded'); | ||||
|             children.classList.toggle('expanded'); | ||||
|             btn.textContent = isExpanded ? '▶' : '▼'; | ||||
|  | @ -643,52 +622,50 @@ | |||
|             const isChecked = checkbox.checked; | ||||
|             const permissionCode = permission.code; | ||||
|             const node = checkbox.closest('.permission-node'); | ||||
|              | ||||
| 
 | ||||
|             // 更新节点选中样式 | ||||
|             if (node) { | ||||
|                 if (isChecked) { | ||||
|                     node.classList.add('selected'); | ||||
|                 } else { | ||||
|                     node.classList.remove('selected'); | ||||
|                 } | ||||
|                 node.classList.toggle('selected', isChecked); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             if (isChecked) { | ||||
|                 selectedPermissions.add(permissionCode); | ||||
|                 // 选中子级权限时,自动选中所有父级权限 | ||||
|                 // 选中子级权限时,自动选中所有父级权限 | ||||
|                 selectParentPermissions(permission); | ||||
|                 // 如果是父权限,自动选中所有子权限 | ||||
|                 // 如果是父权限,自动选中所有子权限 | ||||
|                 if (permission.children && permission.children.length > 0) { | ||||
|                     selectChildrenPermissions(permission, true); | ||||
|                 } | ||||
|             } else { | ||||
|                 selectedPermissions.delete(permissionCode); | ||||
|                 // 如果是父权限,自动取消所有子权限 | ||||
|                 // 如果是父权限,自动取消所有子权限 | ||||
|                 if (permission.children && permission.children.length > 0) { | ||||
|                     selectChildrenPermissions(permission, false); | ||||
|                 } | ||||
|                 // 如果是子权限,检查是否需要取消父权限 | ||||
|                 // 如果是子权限,检查是否需要取消父权限 | ||||
|                 uncheckParentIfNeeded(permission); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             updatePermissionDisplay(); | ||||
|         } | ||||
| 
 | ||||
|         // 选择所有父级权限 | ||||
|         function selectParentPermissions(permission) { | ||||
|             if (!permission.parentCode) return; | ||||
|              | ||||
| 
 | ||||
|             // 查找父权限 | ||||
|             const parent = permissions.find(p => p.code === permission.parentCode); | ||||
|             if (!parent) return; | ||||
|              | ||||
| 
 | ||||
|             // 选中父权限 | ||||
|             const parentCheckbox = document.querySelector(`[data-permission-code="${parent.code}"]`); | ||||
|             if (parentCheckbox && !parentCheckbox.checked) { | ||||
|                 parentCheckbox.checked = true; | ||||
|                 selectedPermissions.add(parent.code); | ||||
|                 const parentNode = parentCheckbox.closest('.permission-node'); | ||||
|                 if (parentNode) parentNode.classList.add('selected'); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 递归选中上级父权限 | ||||
|             selectParentPermissions(parent); | ||||
|         } | ||||
|  | @ -696,17 +673,20 @@ | |||
|         // 选择/取消子权限 | ||||
|         function selectChildrenPermissions(parent, select) { | ||||
|             if (!parent.children) return; | ||||
|              | ||||
| 
 | ||||
|             parent.children.forEach(child => { | ||||
|                 const childCheckbox = document.querySelector(`[data-permission-code="${child.code}"]`); | ||||
|                 if (childCheckbox) { | ||||
|                     childCheckbox.checked = select; | ||||
|                     const childNode = childCheckbox.closest('.permission-node'); | ||||
|                     if (childNode) childNode.classList.toggle('selected', select); | ||||
| 
 | ||||
|                     if (select) { | ||||
|                         selectedPermissions.add(child.code); | ||||
|                     } else { | ||||
|                         selectedPermissions.delete(child.code); | ||||
|                     } | ||||
|                      | ||||
| 
 | ||||
|                     // 递归处理子权限 | ||||
|                     selectChildrenPermissions(child, select); | ||||
|                 } | ||||
|  | @ -716,20 +696,22 @@ | |||
|         // 检查是否需要取消父权限选择 | ||||
|         function uncheckParentIfNeeded(permission) { | ||||
|             if (!permission.parentCode) return; | ||||
|              | ||||
| 
 | ||||
|             // 查找父权限 | ||||
|             const parent = permissions.find(p => p.code === permission.parentCode); | ||||
|             if (!parent) return; | ||||
|              | ||||
| 
 | ||||
|             // 检查父权限的所有子权限是否都未选中 | ||||
|             const siblings = permissions.filter(p => p.parentCode === parent.code); | ||||
|             const hasSelectedSibling = siblings.some(sibling => selectedPermissions.has(sibling.code)); | ||||
|              | ||||
| 
 | ||||
|             if (!hasSelectedSibling) { | ||||
|                 const parentCheckbox = document.querySelector(`[data-permission-code="${parent.code}"]`); | ||||
|                 if (parentCheckbox) { | ||||
|                     parentCheckbox.checked = false; | ||||
|                     selectedPermissions.delete(parent.code); | ||||
|                     const parentNode = parentCheckbox.closest('.permission-node'); | ||||
|                     if (parentNode) parentNode.classList.remove('selected'); | ||||
|                     // 递归检查上级父权限 | ||||
|                     uncheckParentIfNeeded(parent); | ||||
|                 } | ||||
|  | @ -738,7 +720,6 @@ | |||
| 
 | ||||
|         // 更新权限显示 | ||||
|         function updatePermissionDisplay() { | ||||
|             // 这里可以添加一些UI反馈,比如显示已选权限数量等 | ||||
|             console.log('已选择权限:', Array.from(selectedPermissions)); | ||||
|         } | ||||
| 
 | ||||
|  | @ -748,7 +729,7 @@ | |||
|             document.addEventListener('click', function(e) { | ||||
|                 const dropdown = document.getElementById('marketDropdown'); | ||||
|                 const selectContainer = document.querySelector('.market-select-container'); | ||||
|                  | ||||
| 
 | ||||
|                 if (!selectContainer.contains(e.target)) { | ||||
|                     dropdown.classList.remove('show'); | ||||
|                 } | ||||
|  | @ -766,23 +747,26 @@ | |||
| 
 | ||||
|         // 重置表单 | ||||
|         function resetForm() { | ||||
|             if (confirm('确定要重置所有信息吗?')) { | ||||
|             if (confirm('确定要重置所有信息吗?')) { | ||||
|                 // 重置菜市场选择 | ||||
|                 selectedMarket = null; | ||||
|                 document.getElementById('marketSelect').value = ''; | ||||
|                 document.querySelectorAll('.market-option').forEach(option => { | ||||
|                     option.classList.remove('selected'); | ||||
|                 }); | ||||
|                  | ||||
| 
 | ||||
|                 // 重置手机号 | ||||
|                 document.getElementById('phoneNumber').value = ''; | ||||
|                  | ||||
| 
 | ||||
|                 // 重置权限选择 | ||||
|                 selectedPermissions.clear(); | ||||
|                 document.querySelectorAll('.permission-checkbox').forEach(checkbox => { | ||||
|                     checkbox.checked = false; | ||||
|                 }); | ||||
|                  | ||||
|                 document.querySelectorAll('.permission-node').forEach(node => { | ||||
|                     node.classList.remove('selected'); | ||||
|                 }); | ||||
| 
 | ||||
|                 // 重置搜索 | ||||
|                 document.getElementById('marketFilter').value = ''; | ||||
|                 filterMarkets(''); | ||||
|  | @ -791,7 +775,7 @@ | |||
| 
 | ||||
|         // 取消分配 | ||||
|         function cancelAssignment() { | ||||
|             if (confirm('确定要取消权限分配吗?未保存的更改将丢失。')) { | ||||
|             if (confirm('确定要取消权限分配吗?未保存的更改将丢失。')) { | ||||
|                 window.history.back(); | ||||
|             } | ||||
|         } | ||||
|  | @ -800,40 +784,40 @@ | |||
|         function saveAssignment() { | ||||
|             // 验证菜市场 | ||||
|             if (!selectedMarket) { | ||||
|                 alert('请选择菜市场!'); | ||||
|                 alert('请选择菜市场!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 验证手机号 | ||||
|             const phoneNumber = document.getElementById('phoneNumber').value.trim(); | ||||
|             if (!phoneNumber) { | ||||
|                 alert('请输入手机号!'); | ||||
|                 alert('请输入手机号!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             if (!/^1[3-9]\d{9}$/.test(phoneNumber)) { | ||||
|                 alert('请输入正确的手机号格式!'); | ||||
|                 alert('请输入正确的手机号格式!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 验证权限选择 | ||||
|             if (selectedPermissions.size === 0) { | ||||
|                 alert('请至少选择一个权限!'); | ||||
|                 alert('请至少选择一个权限!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 构建保存数据 | ||||
|             const assignmentData = { | ||||
|                 market: selectedMarket, | ||||
|                 phoneNumber: phoneNumber, | ||||
|                 permissions: Array.from(selectedPermissions) | ||||
|             }; | ||||
|              | ||||
| 
 | ||||
|             console.log('保存权限分配数据:', assignmentData); | ||||
|              | ||||
| 
 | ||||
|             // 这里应该调用API保存数据 | ||||
|             alert('权限分配保存成功!'); | ||||
|             alert('权限分配保存成功!'); | ||||
|         } | ||||
|     </script> | ||||
| </body> | ||||
| </html> | ||||
| </html> | ||||
|  |  | |||
|  | @ -12,8 +12,8 @@ | |||
|         } | ||||
| 
 | ||||
|         body { | ||||
|             font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | ||||
|             background-color: #f5f7fa; | ||||
|             font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||||
|             background-color: #f5f5f5; | ||||
|             color: #333; | ||||
|             height: 100vh; | ||||
|             margin: 0; | ||||
|  | @ -21,142 +21,171 @@ | |||
|         } | ||||
| 
 | ||||
|         .container { | ||||
|             width: 100%; | ||||
|             height: 100vh; | ||||
|             margin: 0; | ||||
|             background-color: #fff; | ||||
|             border-radius: 0; | ||||
|             box-shadow: none; | ||||
|             overflow: hidden; | ||||
|             max-width: 1600px; | ||||
|             margin: 0 auto; | ||||
|             padding: 20px; | ||||
|         } | ||||
| 
 | ||||
|         .header { | ||||
|             background: linear-gradient(135deg, #2c3e50, #3498db); | ||||
|             color: #fff; | ||||
|             padding: 20px 30px; | ||||
|         /* 页面头部 */ | ||||
|         .page-header { | ||||
|             background: white; | ||||
|             padding: 16px 24px; | ||||
|             margin-bottom: 16px; | ||||
|             border-radius: 8px; | ||||
|             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||||
|             display: flex; | ||||
|             justify-content: space-between; | ||||
|             align-items: center; | ||||
|         } | ||||
| 
 | ||||
|         .header h1 { | ||||
|             font-size: 1.8rem; | ||||
|         .page-title { | ||||
|             font-size: 24px; | ||||
|             font-weight: 600; | ||||
|             color: #262626; | ||||
|         } | ||||
| 
 | ||||
|         .header-actions { | ||||
|             display: flex; | ||||
|             gap: 10px; | ||||
|         } | ||||
| 
 | ||||
|         /* 按钮样式 */ | ||||
|         .btn { | ||||
|             padding: 10px 20px; | ||||
|             height: 40px; | ||||
|             padding: 0 16px; | ||||
|             border: none; | ||||
|             border-radius: 5px; | ||||
|             cursor: pointer; | ||||
|             border-radius: 6px; | ||||
|             font-size: 14px; | ||||
|             font-weight: 500; | ||||
|             transition: all 0.3s ease; | ||||
|             cursor: pointer; | ||||
|             display: inline-flex; | ||||
|             align-items: center; | ||||
|             justify-content: center; | ||||
|             transition: all 0.3s; | ||||
|             gap: 5px; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary { | ||||
|             background-color: #3498db; | ||||
|             color: #fff; | ||||
|             background: #1890ff; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-primary:hover { | ||||
|             background-color: #2980b9; | ||||
|             transform: translateY(-2px); | ||||
|             background: #40a9ff; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success { | ||||
|             background-color: #27ae60; | ||||
|             color: #fff; | ||||
|             background: #52c41a; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-success:hover { | ||||
|             background-color: #229954; | ||||
|             background: #73d13d; | ||||
|         } | ||||
| 
 | ||||
|         .btn-danger { | ||||
|             background-color: #e74c3c; | ||||
|             color: #fff; | ||||
|             background: #ff4d4f; | ||||
|             color: white; | ||||
|         } | ||||
| 
 | ||||
|         .btn-danger:hover { | ||||
|             background-color: #c0392b; | ||||
|             background: #ff7875; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning { | ||||
|             background-color: #f39c12; | ||||
|             color: #fff; | ||||
|         .btn-default { | ||||
|             background: white; | ||||
|             color: #666; | ||||
|             border: 1px solid #ddd; | ||||
|         } | ||||
| 
 | ||||
|         .btn-warning:hover { | ||||
|             background-color: #e67e22; | ||||
|         .btn-default:hover { | ||||
|             border-color: #1890ff; | ||||
|             color: #1890ff; | ||||
|         } | ||||
| 
 | ||||
|         /* 搜索栏 */ | ||||
|         .search-bar { | ||||
|             padding: 20px 30px; | ||||
|             background-color: #f8f9fa; | ||||
|             border-bottom: 1px solid #dee2e6; | ||||
|         .btn-sm { | ||||
|             height: 32px; | ||||
|             padding: 0 12px; | ||||
|             font-size: 12px; | ||||
|         } | ||||
| 
 | ||||
|         .button-group { | ||||
|             display: flex; | ||||
|             gap: 12px; | ||||
|         } | ||||
| 
 | ||||
|         /* 搜索区域 */ | ||||
|         .search-section { | ||||
|             background: white; | ||||
|             padding: 24px; | ||||
|             margin-bottom: 16px; | ||||
|             border-radius: 8px; | ||||
|             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||||
|         } | ||||
| 
 | ||||
|         .search-form { | ||||
|             display: flex; | ||||
|             gap: 15px; | ||||
|             align-items: center; | ||||
|             display: grid; | ||||
|             grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); | ||||
|             gap: 16px; | ||||
|             margin-bottom: 16px; | ||||
|         } | ||||
| 
 | ||||
|         .search-input { | ||||
|             flex: 1; | ||||
|             padding: 10px 15px; | ||||
|         .form-item { | ||||
|             display: flex; | ||||
|             flex-direction: column; | ||||
|             gap: 8px; | ||||
|         } | ||||
| 
 | ||||
|         .form-label { | ||||
|             font-size: 14px; | ||||
|             color: #666; | ||||
|             font-weight: 500; | ||||
|         } | ||||
| 
 | ||||
|         .form-input { | ||||
|             height: 40px; | ||||
|             padding: 0 12px; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 5px; | ||||
|             border-radius: 6px; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .search-input:focus { | ||||
|         .form-input:focus { | ||||
|             outline: none; | ||||
|             border-color: #3498db; | ||||
|             box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); | ||||
|             border-color: #1890ff; | ||||
|             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); | ||||
|         } | ||||
| 
 | ||||
|         /* 表格样式 */ | ||||
|         .table-container { | ||||
|             padding: 0 30px 30px 30px; | ||||
|         .table-section { | ||||
|             background: white; | ||||
|             border-radius: 8px; | ||||
|             box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||||
|             overflow: hidden; | ||||
|         } | ||||
| 
 | ||||
|         .table-wrapper { | ||||
|             overflow-x: auto; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-table { | ||||
|             width: 100%; | ||||
|             border-collapse: collapse; | ||||
|             margin-top: 20px; | ||||
|             background-color: #fff; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-table th, | ||||
|         .permissions-table td { | ||||
|             padding: 12px 15px; | ||||
|             text-align: left; | ||||
|             border-bottom: 1px solid #eee; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-table th { | ||||
|             background-color: #f8f9fa; | ||||
|             background: #fafafa; | ||||
|             padding: 12px 16px; | ||||
|             text-align: left; | ||||
|             font-weight: 600; | ||||
|             color: #2c3e50; | ||||
|             position: sticky; | ||||
|             top: 0; | ||||
|             z-index: 10; | ||||
|             color: #666; | ||||
|             border-bottom: 1px solid #f0f0f0; | ||||
|             white-space: nowrap; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-table tr:hover { | ||||
|             background-color: #f8f9fa; | ||||
|         .permissions-table td { | ||||
|             padding: 12px 16px; | ||||
|             border-bottom: 1px solid #f9f9f9; | ||||
|             vertical-align: top; | ||||
|         } | ||||
| 
 | ||||
|         .permissions-table tbody tr:hover { | ||||
|             background: #f8f9fa; | ||||
|         } | ||||
| 
 | ||||
|         .permission-row { | ||||
|  | @ -169,7 +198,7 @@ | |||
|         } | ||||
| 
 | ||||
|         .permission-row.child-row { | ||||
|             background-color: #fafbfc; | ||||
|             background-color: #fafafa; | ||||
|         } | ||||
| 
 | ||||
|         .permission-row.level-1 td:first-child { | ||||
|  | @ -210,38 +239,45 @@ | |||
| 
 | ||||
|         .permission-code { | ||||
|             font-family: monospace; | ||||
|             background-color: #ecf0f1; | ||||
|             padding: 2px 6px; | ||||
|             border-radius: 3px; | ||||
|             font-size: 13px; | ||||
|             background-color: #f0f0f0; | ||||
|             padding: 4px 8px; | ||||
|             border-radius: 4px; | ||||
|             font-size: 12px; | ||||
|         } | ||||
| 
 | ||||
|         .permission-type { | ||||
|             padding: 4px 8px; | ||||
|             border-radius: 12px; | ||||
|             border-radius: 4px; | ||||
|             font-size: 12px; | ||||
|             font-weight: 500; | ||||
|         } | ||||
| 
 | ||||
|         .type-menu { | ||||
|             background-color: #3498db; | ||||
|             color: #fff; | ||||
|             background: #e6f7ff; | ||||
|             color: #1890ff; | ||||
|             border: 1px solid #91d5ff; | ||||
|         } | ||||
| 
 | ||||
|         .type-button { | ||||
|             background-color: #27ae60; | ||||
|             color: #fff; | ||||
|             background: #f6ffed; | ||||
|             color: #52c41a; | ||||
|             border: 1px solid #b7eb8f; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn { | ||||
|             background: none; | ||||
|             border: none; | ||||
|             cursor: pointer; | ||||
|             padding: 2px 5px; | ||||
|             padding: 4px; | ||||
|             margin-right: 8px; | ||||
|             color: #3498db; | ||||
|             color: #1890ff; | ||||
|             font-size: 12px; | ||||
|             transition: transform 0.3s ease; | ||||
|             transition: all 0.3s; | ||||
|             border-radius: 4px; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn:hover { | ||||
|             background: #e6f7ff; | ||||
|         } | ||||
| 
 | ||||
|         .expand-btn.collapsed { | ||||
|  | @ -253,11 +289,6 @@ | |||
|             gap: 5px; | ||||
|         } | ||||
| 
 | ||||
|         .btn-sm { | ||||
|             padding: 5px 10px; | ||||
|             font-size: 12px; | ||||
|         } | ||||
| 
 | ||||
|         /* 弹窗样式 */ | ||||
|         .modal { | ||||
|             display: none; | ||||
|  | @ -293,23 +324,24 @@ | |||
|         } | ||||
| 
 | ||||
|         .modal-header { | ||||
|             background: linear-gradient(135deg, #2c3e50, #3498db); | ||||
|             color: #fff; | ||||
|             padding: 20px 25px; | ||||
|             background: #fafafa; | ||||
|             padding: 16px 24px; | ||||
|             display: flex; | ||||
|             justify-content: space-between; | ||||
|             align-items: center; | ||||
|             border-bottom: 1px solid #f0f0f0; | ||||
|         } | ||||
| 
 | ||||
|         .modal-header h3 { | ||||
|             font-size: 1.2rem; | ||||
|             font-size: 18px; | ||||
|             font-weight: 600; | ||||
|             color: #262626; | ||||
|         } | ||||
| 
 | ||||
|         .close { | ||||
|             background: none; | ||||
|             border: none; | ||||
|             color: #fff; | ||||
|             color: #666; | ||||
|             font-size: 24px; | ||||
|             cursor: pointer; | ||||
|             padding: 0; | ||||
|  | @ -319,15 +351,16 @@ | |||
|             align-items: center; | ||||
|             justify-content: center; | ||||
|             border-radius: 50%; | ||||
|             transition: background-color 0.3s ease; | ||||
|             transition: all 0.3s; | ||||
|         } | ||||
| 
 | ||||
|         .close:hover { | ||||
|             background-color: rgba(255, 255, 255, 0.2); | ||||
|             background-color: #f0f0f0; | ||||
|             color: #333; | ||||
|         } | ||||
| 
 | ||||
|         .modal-body { | ||||
|             padding: 25px; | ||||
|             padding: 24px; | ||||
|         } | ||||
| 
 | ||||
|         .form-group { | ||||
|  | @ -338,26 +371,27 @@ | |||
|             display: block; | ||||
|             margin-bottom: 8px; | ||||
|             font-weight: 500; | ||||
|             color: #2c3e50; | ||||
|             color: #333; | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input, | ||||
|         .form-group select, | ||||
|         .form-group textarea { | ||||
|             width: 100%; | ||||
|             padding: 10px 15px; | ||||
|             padding: 10px 12px; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 5px; | ||||
|             border-radius: 6px; | ||||
|             font-size: 14px; | ||||
|             transition: border-color 0.3s ease; | ||||
|             transition: all 0.3s; | ||||
|         } | ||||
| 
 | ||||
|         .form-group input:focus, | ||||
|         .form-group select:focus, | ||||
|         .form-group textarea:focus { | ||||
|             outline: none; | ||||
|             border-color: #3498db; | ||||
|             box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); | ||||
|             border-color: #1890ff; | ||||
|             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); | ||||
|         } | ||||
| 
 | ||||
|         .form-group textarea { | ||||
|  | @ -365,36 +399,44 @@ | |||
|             min-height: 80px; | ||||
|         } | ||||
| 
 | ||||
|         .form-group small { | ||||
|             color: #666; | ||||
|             font-size: 12px; | ||||
|             margin-top: 4px; | ||||
|             display: block; | ||||
|         } | ||||
| 
 | ||||
|         .modal-footer { | ||||
|             background-color: #f8f9fa; | ||||
|             padding: 15px 25px; | ||||
|             background-color: #fafafa; | ||||
|             padding: 12px 24px; | ||||
|             display: flex; | ||||
|             justify-content: flex-end; | ||||
|             gap: 10px; | ||||
|             border-top: 1px solid #dee2e6; | ||||
|             gap: 12px; | ||||
|             border-top: 1px solid #f0f0f0; | ||||
|         } | ||||
| 
 | ||||
|         /* 右键菜单样式 */ | ||||
|         .context-menu { | ||||
|             position: fixed; | ||||
|             background-color: #fff; | ||||
|             border: 1px solid #ddd; | ||||
|             border-radius: 5px; | ||||
|             border: 1px solid #f0f0f0; | ||||
|             border-radius: 6px; | ||||
|             box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | ||||
|             z-index: 2000; | ||||
|             padding: 5px 0; | ||||
|             padding: 4px 0; | ||||
|             min-width: 120px; | ||||
|             display: none; | ||||
|         } | ||||
| 
 | ||||
|         .context-menu-item { | ||||
|             padding: 8px 15px; | ||||
|             padding: 8px 16px; | ||||
|             cursor: pointer; | ||||
|             font-size: 14px; | ||||
|             transition: background-color 0.2s ease; | ||||
|             display: flex; | ||||
|             align-items: center; | ||||
|             gap: 8px; | ||||
|             color: #333; | ||||
|         } | ||||
| 
 | ||||
|         .context-menu-item:hover { | ||||
|  | @ -405,44 +447,46 @@ | |||
|         .empty-state { | ||||
|             text-align: center; | ||||
|             padding: 60px 20px; | ||||
|             color: #7f8c8d; | ||||
|             color: #999; | ||||
|         } | ||||
| 
 | ||||
|         .empty-state h3 { | ||||
|             margin-bottom: 10px; | ||||
|             color: #95a5a6; | ||||
|             color: #666; | ||||
|             font-size: 16px; | ||||
|             font-weight: 500; | ||||
|         } | ||||
| 
 | ||||
|         .empty-state p { | ||||
|             font-size: 14px; | ||||
|         } | ||||
| 
 | ||||
|         /* 响应式设计 */ | ||||
|         @media (max-width: 768px) { | ||||
|             .container { | ||||
|                 margin: 0; | ||||
|                 border-radius: 0; | ||||
|                 padding: 10px; | ||||
|             } | ||||
|              | ||||
|             .header { | ||||
|                 padding: 15px 20px; | ||||
| 
 | ||||
|             .page-header { | ||||
|                 padding: 12px 16px; | ||||
|                 flex-direction: column; | ||||
|                 gap: 15px; | ||||
|                 gap: 12px; | ||||
|                 align-items: flex-start; | ||||
|             } | ||||
|              | ||||
|             .search-bar { | ||||
|                 padding: 15px 20px; | ||||
| 
 | ||||
|             .search-section { | ||||
|                 padding: 16px; | ||||
|             } | ||||
|              | ||||
|             .table-container { | ||||
|                 padding: 0 20px 20px 20px; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             .permissions-table { | ||||
|                 font-size: 14px; | ||||
|                 font-size: 12px; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             .permissions-table th, | ||||
|             .permissions-table td { | ||||
|                 padding: 8px 10px; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             .modal-content { | ||||
|                 width: 95vw; | ||||
|                 margin: 10px; | ||||
|  | @ -452,46 +496,52 @@ | |||
| </head> | ||||
| <body> | ||||
|     <div class="container"> | ||||
|         <!-- 头部 --> | ||||
|         <div class="header"> | ||||
|             <h1>权限编辑</h1> | ||||
|             <div class="header-actions"> | ||||
|         <!-- 页面头部 --> | ||||
|         <div class="page-header"> | ||||
|             <h1 class="page-title">权限编辑</h1> | ||||
|             <div class="button-group"> | ||||
|                 <button class="btn btn-success" onclick="openAddModal()"> | ||||
|                     ➕ 新增权限 | ||||
|                     新增权限 | ||||
|                 </button> | ||||
|             </div> | ||||
|         </div> | ||||
| 
 | ||||
|         <!-- 搜索栏 --> | ||||
|         <div class="search-bar"> | ||||
|         <!-- 搜索区域 --> | ||||
|         <div class="search-section"> | ||||
|             <div class="search-form"> | ||||
|                 <input type="text" class="search-input" id="searchInput" placeholder="搜索权限编码、名称或描述..."> | ||||
|                 <button class="btn btn-primary" onclick="searchPermissions()">🔍 搜索</button> | ||||
|                 <button class="btn btn-warning" onclick="resetSearch()">🔄 重置</button> | ||||
|                 <div class="form-item"> | ||||
|                     <input type="text" class="form-input" id="searchInput" placeholder="搜索权限编码、名称或描述..."> | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="button-group"> | ||||
|                 <button class="btn btn-primary" onclick="searchPermissions()">搜索</button> | ||||
|                 <button class="btn btn-default" onclick="resetSearch()">重置</button> | ||||
|             </div> | ||||
|         </div> | ||||
| 
 | ||||
|         <!-- 表格容器 --> | ||||
|         <div class="table-container"> | ||||
|             <table class="permissions-table"> | ||||
|                 <thead> | ||||
|                     <tr> | ||||
|                         <th>权限编码</th> | ||||
|                         <th>权限名称</th> | ||||
|                         <th>权限描述</th> | ||||
|                         <th>权限类型</th> | ||||
|                         <th>父级权限</th> | ||||
|                         <th>可见身份</th> | ||||
|                         <th>操作</th> | ||||
|                     </tr> | ||||
|                 </thead> | ||||
|                 <tbody id="permissionsTableBody"> | ||||
|                     <!-- 数据将通过JavaScript动态加载 --> | ||||
|                 </tbody> | ||||
|             </table> | ||||
|             <div class="empty-state" id="emptyState" style="display: none;"> | ||||
|                 <h3>暂无权限数据</h3> | ||||
|                 <p>点击"新增权限"按钮开始添加权限信息</p> | ||||
|         <!-- 表格区域 --> | ||||
|         <div class="table-section"> | ||||
|             <div class="table-wrapper"> | ||||
|                 <table class="permissions-table"> | ||||
|                     <thead> | ||||
|                         <tr> | ||||
|                             <th>权限编码</th> | ||||
|                             <th>权限名称</th> | ||||
|                             <th>权限描述</th> | ||||
|                             <th>权限类型</th> | ||||
|                             <th>父级权限</th> | ||||
|                             <th>可见身份</th> | ||||
|                             <th>操作</th> | ||||
|                         </tr> | ||||
|                     </thead> | ||||
|                     <tbody id="permissionsTableBody"> | ||||
|                         <!-- 数据将通过JavaScript动态加载 --> | ||||
|                     </tbody> | ||||
|                 </table> | ||||
|                 <div class="empty-state" id="emptyState" style="display: none;"> | ||||
|                     <h3>暂无权限数据</h3> | ||||
|                     <p>点击"新增权限"按钮开始添加权限信息</p> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  | @ -515,7 +565,7 @@ | |||
|                     </div> | ||||
|                     <div class="form-group"> | ||||
|                         <label for="permissionDesc">权限描述</label> | ||||
|                         <textarea id="permissionDesc" name="description" placeholder="请输入权限描述(可选)"></textarea> | ||||
|                         <textarea id="permissionDesc" name="description" placeholder="请输入权限描述(可选)"></textarea> | ||||
|                     </div> | ||||
|                     <div class="form-group"> | ||||
|                         <label for="parentCode">父级权限编码</label> | ||||
|  | @ -546,7 +596,7 @@ | |||
|                 </form> | ||||
|             </div> | ||||
|             <div class="modal-footer"> | ||||
|                 <button type="button" class="btn btn-warning" onclick="closeModal()">取消</button> | ||||
|                 <button type="button" class="btn btn-default" onclick="closeModal()">取消</button> | ||||
|                 <button type="button" class="btn btn-success" onclick="savePermission()">保存</button> | ||||
|             </div> | ||||
|         </div> | ||||
|  | @ -555,13 +605,13 @@ | |||
|     <!-- 右键菜单 --> | ||||
|     <div id="contextMenu" class="context-menu"> | ||||
|         <div class="context-menu-item" onclick="addChildPermission()"> | ||||
|             ➕ 添加子权限 | ||||
|             添加子权限 | ||||
|         </div> | ||||
|         <div class="context-menu-item" onclick="editPermission()"> | ||||
|             ✏️ 编辑权限 | ||||
|             编辑权限 | ||||
|         </div> | ||||
|         <div class="context-menu-item" onclick="deletePermission()"> | ||||
|             🗑️ 删除权限 | ||||
|             删除权限 | ||||
|         </div> | ||||
|     </div> | ||||
| 
 | ||||
|  | @ -636,23 +686,23 @@ | |||
|         function renderPermissionsTable(data = permissions) { | ||||
|             const tableBody = document.getElementById('permissionsTableBody'); | ||||
|             const emptyState = document.getElementById('emptyState'); | ||||
|              | ||||
| 
 | ||||
|             if (data.length === 0) { | ||||
|                 tableBody.innerHTML = ''; | ||||
|                 emptyState.style.display = 'block'; | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             emptyState.style.display = 'none'; | ||||
|              | ||||
| 
 | ||||
|             // 构建树状结构 | ||||
|             const tree = buildPermissionTree(data); | ||||
|             let html = ''; | ||||
|              | ||||
| 
 | ||||
|             tree.forEach(item => { | ||||
|                 html += renderPermissionRow(item, 0); | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             tableBody.innerHTML = html; | ||||
|         } | ||||
| 
 | ||||
|  | @ -660,12 +710,12 @@ | |||
|         function buildPermissionTree(data) { | ||||
|             const map = {}; | ||||
|             const roots = []; | ||||
|              | ||||
| 
 | ||||
|             // 创建映射 | ||||
|             data.forEach(item => { | ||||
|                 map[item.code] = { ...item, children: [] }; | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             // 构建树结构 | ||||
|             data.forEach(item => { | ||||
|                 if (item.parentCode && map[item.parentCode]) { | ||||
|  | @ -674,7 +724,7 @@ | |||
|                     roots.push(map[item.code]); | ||||
|                 } | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             return roots; | ||||
|         } | ||||
| 
 | ||||
|  | @ -683,16 +733,16 @@ | |||
|             const hasChildren = item.children && item.children.length > 0; | ||||
|             const isParent = level === 0; | ||||
|             let rowClass = 'permission-row'; | ||||
|              | ||||
| 
 | ||||
|             if (isParent) { | ||||
|                 rowClass += ' parent-row'; | ||||
|             } else { | ||||
|                 rowClass += ' child-row level-' + level; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             let html = ` | ||||
|                 <tr class="${rowClass}"  | ||||
|                     data-id="${item.id}"  | ||||
|                 <tr class="${rowClass}" | ||||
|                     data-id="${item.id}" | ||||
|                     data-code="${item.code}" | ||||
|                     oncontextmenu="showContextMenu(event, this)"> | ||||
|                     <td> | ||||
|  | @ -710,14 +760,14 @@ | |||
|                     </td> | ||||
|                 </tr> | ||||
|             `; | ||||
|              | ||||
| 
 | ||||
|             // 添加子权限行 | ||||
|             if (hasChildren) { | ||||
|                 item.children.forEach(child => { | ||||
|                     html += renderPermissionRow(child, level + 1); | ||||
|                 }); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             return html; | ||||
|         } | ||||
| 
 | ||||
|  | @ -726,35 +776,35 @@ | |||
|             const row = btn.closest('tr'); | ||||
|             const parentCode = row.dataset.code; | ||||
|             let nextRow = row.nextElementSibling; | ||||
|              | ||||
| 
 | ||||
|             const isExpanded = btn.textContent === '▼'; | ||||
|             btn.textContent = isExpanded ? '▶' : '▼'; | ||||
|             btn.classList.toggle('collapsed', isExpanded); | ||||
|              | ||||
| 
 | ||||
|             // 找到这个权限的所有直接和间接子权限 | ||||
|             const childCodes = getChildPermissionCodes(parentCode); | ||||
|              | ||||
| 
 | ||||
|             // 切换相关子行的显示状态 | ||||
|             while (nextRow) { | ||||
|                 const nextRowCode = nextRow.dataset.code; | ||||
|                 const nextRowParent = permissions.find(p => p.code === nextRowCode)?.parentCode; | ||||
|                  | ||||
|                 // 如果当前行是目标权限的子权限(直接或间接) | ||||
| 
 | ||||
|                 // 如果当前行是目标权限的子权限(直接或间接) | ||||
|                 if (childCodes.includes(nextRowCode)) { | ||||
|                     nextRow.style.display = isExpanded ? 'none' : 'table-row'; | ||||
|                 } else if (!isChildOfAny(nextRowCode, childCodes)) { | ||||
|                     // 如果不是子权限,说明已到达同级或上级权限,停止处理 | ||||
|                     // 如果不是子权限,说明已到达同级或上级权限,停止处理 | ||||
|                     break; | ||||
|                 } | ||||
|                  | ||||
| 
 | ||||
|                 nextRow = nextRow.nextElementSibling; | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         // 获取某个权限的所有子权限编码(递归) | ||||
| 
 | ||||
|         // 获取某个权限的所有子权限编码(递归) | ||||
|         function getChildPermissionCodes(parentCode) { | ||||
|             const children = []; | ||||
|              | ||||
| 
 | ||||
|             function findChildren(code) { | ||||
|                 permissions.forEach(p => { | ||||
|                     if (p.parentCode === code) { | ||||
|  | @ -763,17 +813,17 @@ | |||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             findChildren(parentCode); | ||||
|             return children; | ||||
|         } | ||||
|          | ||||
| 
 | ||||
|         // 检查某个权限是否为指定权限列表中任一权限的子权限 | ||||
|         function isChildOfAny(code, parentCodes) { | ||||
|             const permission = permissions.find(p => p.code === code); | ||||
|             if (!permission) return false; | ||||
|              | ||||
|             return parentCodes.includes(permission.parentCode) ||  | ||||
| 
 | ||||
|             return parentCodes.includes(permission.parentCode) || | ||||
|                    (permission.parentCode && isChildOfAny(permission.parentCode, parentCodes)); | ||||
|         } | ||||
| 
 | ||||
|  | @ -781,7 +831,7 @@ | |||
|         function showContextMenu(event, row) { | ||||
|             event.preventDefault(); | ||||
|             contextMenuTargetRow = row; | ||||
|              | ||||
| 
 | ||||
|             const menu = document.getElementById('contextMenu'); | ||||
|             menu.style.display = 'block'; | ||||
|             menu.style.left = event.pageX + 'px'; | ||||
|  | @ -809,7 +859,7 @@ | |||
|         // 添加子权限 | ||||
|         function addChildPermission() { | ||||
|             if (!contextMenuTargetRow) return; | ||||
|              | ||||
| 
 | ||||
|             const parentCode = contextMenuTargetRow.dataset.code; | ||||
|             openAddModal(); | ||||
|             document.getElementById('parentCode').value = parentCode; | ||||
|  | @ -819,7 +869,7 @@ | |||
|         // 编辑权限 | ||||
|         function editPermission() { | ||||
|             if (!contextMenuTargetRow) return; | ||||
|              | ||||
| 
 | ||||
|             const id = parseInt(contextMenuTargetRow.dataset.id); | ||||
|             editPermissionById(id); | ||||
|             hideContextMenu(); | ||||
|  | @ -829,30 +879,30 @@ | |||
|         function editPermissionById(id) { | ||||
|             const permission = permissions.find(p => p.id === id); | ||||
|             if (!permission) return; | ||||
|              | ||||
| 
 | ||||
|             currentEditingId = id; | ||||
|             document.getElementById('modalTitle').textContent = '编辑权限'; | ||||
|             document.getElementById('permissionCode').value = permission.code; | ||||
|             document.getElementById('permissionName').value = permission.name; | ||||
|             document.getElementById('permissionDesc').value = permission.description || ''; | ||||
|             document.getElementById('permissionType').value = permission.type; | ||||
|              | ||||
| 
 | ||||
|             // 设置可见身份选项 | ||||
|             const visibleRolesSelect = document.getElementById('visibleRoles'); | ||||
|             Array.from(visibleRolesSelect.options).forEach(option => { | ||||
|                 option.selected = permission.visibleRoles && permission.visibleRoles.includes(option.value); | ||||
|             }); | ||||
|              | ||||
| 
 | ||||
|             updateParentCodeOptions(permission.code); | ||||
|             document.getElementById('parentCode').value = permission.parentCode || ''; | ||||
|              | ||||
| 
 | ||||
|             document.getElementById('permissionModal').classList.add('show'); | ||||
|         } | ||||
| 
 | ||||
|         // 删除权限 | ||||
|         function deletePermission() { | ||||
|             if (!contextMenuTargetRow) return; | ||||
|              | ||||
| 
 | ||||
|             const id = parseInt(contextMenuTargetRow.dataset.id); | ||||
|             deletePermissionById(id); | ||||
|             hideContextMenu(); | ||||
|  | @ -862,15 +912,15 @@ | |||
|         function deletePermissionById(id) { | ||||
|             const permission = permissions.find(p => p.id === id); | ||||
|             if (!permission) return; | ||||
|              | ||||
| 
 | ||||
|             // 检查是否有子权限 | ||||
|             const hasChildren = permissions.some(p => p.parentCode === permission.code); | ||||
|             if (hasChildren) { | ||||
|                 alert('该权限下有子权限,请先删除子权限!'); | ||||
|                 alert('该权限下有子权限,请先删除子权限!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
|             if (confirm(`确定要删除权限"${permission.name}"吗?`)) { | ||||
| 
 | ||||
|             if (confirm(`确定要删除权限"${permission.name}"吗?`)) { | ||||
|                 permissions = permissions.filter(p => p.id !== id); | ||||
|                 renderPermissionsTable(); | ||||
|             } | ||||
|  | @ -880,7 +930,7 @@ | |||
|         function updateParentCodeOptions(excludeCode = '') { | ||||
|             const select = document.getElementById('parentCode'); | ||||
|             select.innerHTML = '<option value="">无父级权限</option>'; | ||||
|              | ||||
| 
 | ||||
|             permissions.forEach(permission => { | ||||
|                 if (permission.code !== excludeCode && permission.type === 'menu') { | ||||
|                     const option = document.createElement('option'); | ||||
|  | @ -895,43 +945,43 @@ | |||
|         function savePermission() { | ||||
|             const form = document.getElementById('permissionForm'); | ||||
|             const formData = new FormData(form); | ||||
|              | ||||
| 
 | ||||
|             const code = formData.get('code').trim(); | ||||
|             const name = formData.get('name').trim(); | ||||
|             const description = formData.get('description').trim(); | ||||
|             const parentCode = formData.get('parentCode'); | ||||
|             const type = formData.get('type'); | ||||
|              | ||||
| 
 | ||||
|             // 获取可见身份选项 | ||||
|             const visibleRolesSelect = document.getElementById('visibleRoles'); | ||||
|             const selectedRoles = Array.from(visibleRolesSelect.selectedOptions).map(option => option.value); | ||||
|              | ||||
| 
 | ||||
|             // 验证 | ||||
|             if (!code || !name || !type) { | ||||
|                 alert('请填写必填项!'); | ||||
|                 alert('请填写必填项!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
|             // 检查权限编码是否重复(编辑时排除自身) | ||||
| 
 | ||||
|             // 检查权限编码是否重复(编辑时排除自身) | ||||
|             const existingPermission = permissions.find(p => p.code === code && p.id !== currentEditingId); | ||||
|             if (existingPermission) { | ||||
|                 alert('权限编码已存在!'); | ||||
|                 alert('权限编码已存在!'); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             // 验证父级权限 | ||||
|             if (parentCode) { | ||||
|                 const parentPermission = permissions.find(p => p.code === parentCode); | ||||
|                 if (!parentPermission) { | ||||
|                     alert('父级权限不存在!'); | ||||
|                     alert('父级权限不存在!'); | ||||
|                     return; | ||||
|                 } | ||||
|                 if (parentPermission.type !== 'menu') { | ||||
|                     alert('只能选择菜单类型的权限作为父级权限!'); | ||||
|                     alert('只能选择菜单类型的权限作为父级权限!'); | ||||
|                     return; | ||||
|                 } | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             const permissionData = { | ||||
|                 code, | ||||
|                 name, | ||||
|  | @ -940,7 +990,7 @@ | |||
|                 type, | ||||
|                 visibleRoles: selectedRoles | ||||
|             }; | ||||
|              | ||||
| 
 | ||||
|             if (currentEditingId) { | ||||
|                 // 编辑权限 | ||||
|                 const index = permissions.findIndex(p => p.id === currentEditingId); | ||||
|  | @ -952,7 +1002,7 @@ | |||
|                 const newId = Math.max(...permissions.map(p => p.id), 0) + 1; | ||||
|                 permissions.push({ id: newId, ...permissionData }); | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             closeModal(); | ||||
|             renderPermissionsTable(); | ||||
|         } | ||||
|  | @ -970,13 +1020,13 @@ | |||
|                 renderPermissionsTable(); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
|             const filteredPermissions = permissions.filter(permission =>  | ||||
| 
 | ||||
|             const filteredPermissions = permissions.filter(permission => | ||||
|                 permission.code.toLowerCase().includes(keyword) || | ||||
|                 permission.name.toLowerCase().includes(keyword) || | ||||
|                 (permission.description && permission.description.toLowerCase().includes(keyword)) | ||||
|             ); | ||||
|              | ||||
| 
 | ||||
|             renderPermissionsTable(filteredPermissions); | ||||
|         } | ||||
| 
 | ||||
|  | @ -1014,4 +1064,4 @@ | |||
|         }); | ||||
|     </script> | ||||
| </body> | ||||
| </html> | ||||
| </html> | ||||
|  |  | |||
|  | @ -84,6 +84,10 @@ | |||
|         .btn-small { | ||||
|             padding: 5px 12px; | ||||
|             font-size: 12px; | ||||
|             max-width: 90px; | ||||
|             white-space: normal; | ||||
|             word-break: break-all; | ||||
|             line-height: 1.4; | ||||
|         } | ||||
| 
 | ||||
|         .btn-danger { | ||||
|  | @ -477,6 +481,11 @@ | |||
|             background-color: #f5f7fa; | ||||
|             border-color: #c0c4cc; | ||||
|         } | ||||
| 
 | ||||
|         /* 隐藏元素 */ | ||||
|         .hidden { | ||||
|             display: none !important; | ||||
|         } | ||||
|     </style> | ||||
| </head> | ||||
| <body> | ||||
|  | @ -649,26 +658,9 @@ | |||
|             </div> | ||||
|             <div class="modal-body"> | ||||
|                 <form id="detailMarketForm"> | ||||
|                     <!-- 经营者信息 --> | ||||
|                     <div class="form-section"> | ||||
|                         <div class="form-section-title">经营者信息</div> | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">经营者账号</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailOperatorAccount" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">经营者姓名</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailOperatorName" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
| 
 | ||||
|                     <!-- 基础配置 --> | ||||
|                     <div class="form-section"> | ||||
|                         <div class="form-section-title">基础配置</div> | ||||
|                         <div class="form-section-title">基础信息</div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场名称</div> | ||||
|  | @ -677,47 +669,6 @@ | |||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">商品类目类型</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailCategoryType" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场背景图</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="upload-box" style="pointer-events: none;"> | ||||
|                                     <span class="upload-box-text">暂无图片</span> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场营业执照</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="upload-box" style="pointer-events: none;"> | ||||
|                                     <span class="upload-box-text">暂无图片</span> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场实拍图</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="upload-box" style="pointer-events: none;"> | ||||
|                                     <span class="upload-box-text">暂无图片</span> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场地址</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailAddress" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">详细地址</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|  | @ -726,93 +677,14 @@ | |||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场定位</div> | ||||
|                             <div class="form-label">定位信息</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailLocation" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场营业时间</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="switch-group"> | ||||
|                                     <span class="switch-label">手动营业</span> | ||||
|                                     <label class="switch"> | ||||
|                                         <input type="checkbox" id="detailAutoBusinessTime" disabled> | ||||
|                                         <span class="switch-slider"></span> | ||||
|                                     </label> | ||||
|                                     <span class="switch-label active">自动营业</span> | ||||
|                                 </div> | ||||
|                                 <div class="checkbox-group" style="margin-top: 10px;"> | ||||
|                                     <div class="checkbox-option"> | ||||
|                                         <input type="checkbox" id="detailEveryday" disabled> | ||||
|                                         <label for="detailEveryday">每天</label> | ||||
|                                 <div style="width: 100%; height: 300px; border: 1px solid #dcdfe6; border-radius: 4px; background-color: #f5f7fa; display: flex; align-items: center; justify-content: center; color: #909399; font-size: 14px;"> | ||||
|                                     <div style="text-align: center;"> | ||||
|                                         <div style="font-size: 48px; margin-bottom: 10px;">📍</div> | ||||
|                                         <div>地图定位显示区域</div> | ||||
|                                         <div style="font-size: 12px; margin-top: 5px;" id="detailLocationCoords"></div> | ||||
|                                     </div> | ||||
|                                     <div class="checkbox-option"> | ||||
|                                         <input type="checkbox" id="detailWorkday" disabled> | ||||
|                                         <label for="detailWorkday">工作日</label> | ||||
|                                     </div> | ||||
|                                     <div class="checkbox-option"> | ||||
|                                         <input type="checkbox" id="detailCustom" disabled> | ||||
|                                         <label for="detailCustom">自定义</label> | ||||
|                                     </div> | ||||
|                                 </div> | ||||
|                                 <div class="time-group" style="margin-top: 10px;"> | ||||
|                                     <input type="time" class="form-input time-input" id="detailStartTime" readonly> | ||||
|                                     <input type="time" class="form-input time-input" id="detailEndTime" readonly> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">菜市场状态</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="switch-group"> | ||||
|                                     <span class="switch-label">禁用</span> | ||||
|                                     <label class="switch"> | ||||
|                                         <input type="checkbox" id="detailMarketStatus" disabled> | ||||
|                                         <span class="switch-slider"></span> | ||||
|                                     </label> | ||||
|                                     <span class="switch-label active">启用</span> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">摊位数</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailBoothCount" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">营业状态</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <input type="text" class="form-input" id="detailBusinessStatus" readonly> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
| 
 | ||||
|                     <!-- 配送设置 --> | ||||
|                     <div class="form-section"> | ||||
|                         <div class="form-section-title">配送设置</div> | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label"></div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="form-hint">ℹ️ 开启后,将允许该菜市场经营者/摊主(无经营者)自由配置是否呼叫第三方骑手进行配送;</div> | ||||
|                                 <div class="form-hint">第三方配送费用因距离、天气、时段等因素会产生不同程度的浮动;将根据实际配送费用进行扣除。</div> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                         <div class="form-group"> | ||||
|                             <div class="form-label">是否允许第三方骑手配送</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="switch-group"> | ||||
|                                     <span class="switch-label">禁用</span> | ||||
|                                     <label class="switch"> | ||||
|                                         <input type="checkbox" id="detailThirdPartyDelivery" disabled> | ||||
|                                         <span class="switch-slider"></span> | ||||
|                                     </label> | ||||
|                                     <span class="switch-label active">启用</span> | ||||
|                                 </div> | ||||
|                             </div> | ||||
|                         </div> | ||||
|  | @ -945,11 +817,15 @@ | |||
|                         <div class="form-group"> | ||||
|                             <div class="form-label required">菜市场定位</div> | ||||
|                             <div class="form-input-wrapper"> | ||||
|                                 <div class="location-input"> | ||||
|                                     <input type="text" class="form-input" placeholder="请在地图上选择定位"> | ||||
|                                     <span class="location-icon">📍</span> | ||||
|                                 <div style="width: 100%; height: 300px; border: 1px solid #dcdfe6; border-radius: 4px; background-color: #f5f7fa; display: flex; align-items: center; justify-content: center; color: #909399; font-size: 14px; cursor: pointer;" onclick="selectLocation()"> | ||||
|                                     <div style="text-align: center;"> | ||||
|                                         <div style="font-size: 48px; margin-bottom: 10px;">📍</div> | ||||
|                                         <div>点击选择地图定位</div> | ||||
|                                         <div style="font-size: 12px; margin-top: 5px; color: #f56c6c;" id="selectedLocationText">请选择定位</div> | ||||
|                                     </div> | ||||
|                                 </div> | ||||
|                                 <div class="form-hint" style="color: #f56c6c;">请选择定位</div> | ||||
|                                 <input type="hidden" id="locationLat" value=""> | ||||
|                                 <input type="hidden" id="locationLng" value=""> | ||||
|                             </div> | ||||
|                         </div> | ||||
| 
 | ||||
|  | @ -959,12 +835,12 @@ | |||
|                                 <div class="switch-group"> | ||||
|                                     <span class="switch-label">手动营业</span> | ||||
|                                     <label class="switch"> | ||||
|                                         <input type="checkbox" id="autoBusinessTime" checked> | ||||
|                                         <input type="checkbox" id="autoBusinessTime" checked onchange="toggleBusinessTimeOptions()"> | ||||
|                                         <span class="switch-slider"></span> | ||||
|                                     </label> | ||||
|                                     <span class="switch-label active">自动营业</span> | ||||
|                                 </div> | ||||
|                                 <div class="checkbox-group" style="margin-top: 10px;"> | ||||
|                                 <div class="checkbox-group" id="businessDayOptions" style="margin-top: 10px;"> | ||||
|                                     <div class="checkbox-option"> | ||||
|                                         <input type="checkbox" id="everyday"> | ||||
|                                         <label for="everyday">每天</label> | ||||
|  | @ -978,7 +854,7 @@ | |||
|                                         <label for="custom">自定义</label> | ||||
|                                     </div> | ||||
|                                 </div> | ||||
|                                 <div class="time-group" style="margin-top: 10px;"> | ||||
|                                 <div class="time-group" id="businessTimeRange" style="margin-top: 10px;"> | ||||
|                                     <input type="time" class="form-input time-input" placeholder="开始营业时间"> | ||||
|                                     <input type="time" class="form-input time-input" placeholder="结束营业时间"> | ||||
|                                 </div> | ||||
|  | @ -1039,6 +915,39 @@ | |||
|         let countdown = 0; | ||||
|         let countdownTimer = null; | ||||
| 
 | ||||
|         // 切换营业时间选项的显示/隐藏 | ||||
|         function toggleBusinessTimeOptions() { | ||||
|             const autoBusinessTime = document.getElementById('autoBusinessTime'); | ||||
|             const businessDayOptions = document.getElementById('businessDayOptions'); | ||||
|             const businessTimeRange = document.getElementById('businessTimeRange'); | ||||
| 
 | ||||
|             if (autoBusinessTime.checked) { | ||||
|                 // 自动营业,显示时间范围和日期选项 | ||||
|                 businessDayOptions.classList.remove('hidden'); | ||||
|                 businessTimeRange.classList.remove('hidden'); | ||||
|             } else { | ||||
|                 // 手动营业,隐藏时间范围和日期选项 | ||||
|                 businessDayOptions.classList.add('hidden'); | ||||
|                 businessTimeRange.classList.add('hidden'); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // 选择地图定位 | ||||
|         function selectLocation() { | ||||
|             // 这里应该打开地图选择器,实际应调用地图API | ||||
|             // 模拟选择定位 | ||||
|             alert('此处应打开地图选择器,实际开发时需要集成地图API(如高德地图、百度地图等)'); | ||||
| 
 | ||||
|             // 模拟选择了一个位置 | ||||
|             const mockLat = 31.230416; | ||||
|             const mockLng = 121.473701; | ||||
| 
 | ||||
|             document.getElementById('locationLat').value = mockLat; | ||||
|             document.getElementById('locationLng').value = mockLng; | ||||
|             document.getElementById('selectedLocationText').textContent = '已选择: ' + mockLat + ', ' + mockLng; | ||||
|             document.getElementById('selectedLocationText').style.color = '#67c23a'; | ||||
|         } | ||||
| 
 | ||||
|         // 发送验证码 | ||||
|         function sendVerifyCode() { | ||||
|             const account = document.getElementById('operatorAccount').value; | ||||
|  | @ -1108,6 +1017,11 @@ | |||
|             } | ||||
|             // 重置表单 | ||||
|             document.getElementById('addMarketForm').reset(); | ||||
|             // 重置定位信息 | ||||
|             document.getElementById('locationLat').value = ''; | ||||
|             document.getElementById('locationLng').value = ''; | ||||
|             document.getElementById('selectedLocationText').textContent = '请选择定位'; | ||||
|             document.getElementById('selectedLocationText').style.color = '#f56c6c'; | ||||
|         } | ||||
| 
 | ||||
|         // 提交表单 | ||||
|  | @ -1237,31 +1151,16 @@ | |||
|         // 打开详情模态框 | ||||
|         function openDetailModal(rowData) { | ||||
|             // 填充详情数据 | ||||
|             document.getElementById('detailOperatorAccount').value = rowData.operatorAccount || ''; | ||||
|             document.getElementById('detailOperatorName').value = rowData.operatorName || ''; | ||||
|             document.getElementById('detailMarketName').value = rowData.marketName || ''; | ||||
|             document.getElementById('detailDetailAddress').value = rowData.address || ''; | ||||
| 
 | ||||
|             // 填充商品类目类型,转换为中文显示 | ||||
|             let categoryTypeText = ''; | ||||
|             if (rowData.categoryType === 'offline') { | ||||
|                 categoryTypeText = '线下菜市场'; | ||||
|             } else if (rowData.categoryType === 'cloud') { | ||||
|                 categoryTypeText = '云店'; | ||||
|             // 显示定位坐标信息(模拟数据,实际应从后端获取) | ||||
|             const coordsElement = document.getElementById('detailLocationCoords'); | ||||
|             if (rowData.location) { | ||||
|                 coordsElement.textContent = '经纬度: ' + rowData.location; | ||||
|             } else { | ||||
|                 categoryTypeText = rowData.categoryType || ''; | ||||
|                 coordsElement.textContent = '暂无定位信息'; | ||||
|             } | ||||
|             document.getElementById('detailCategoryType').value = categoryTypeText; | ||||
| 
 | ||||
|             document.getElementById('detailAddress').value = rowData.address || ''; | ||||
|             document.getElementById('detailDetailAddress').value = rowData.detailAddress || ''; | ||||
|             document.getElementById('detailLocation').value = rowData.location || ''; | ||||
|             document.getElementById('detailBoothCount').value = rowData.boothCount || ''; | ||||
|             document.getElementById('detailBusinessStatus').value = rowData.businessStatus || ''; | ||||
| 
 | ||||
|             // 设置开关状态 | ||||
|             document.getElementById('detailAutoBusinessTime').checked = rowData.autoBusinessTime || false; | ||||
|             document.getElementById('detailMarketStatus').checked = rowData.marketStatus || false; | ||||
|             document.getElementById('detailThirdPartyDelivery').checked = rowData.thirdPartyDelivery || false; | ||||
| 
 | ||||
|             // 显示模态框 | ||||
|             document.getElementById('detailMarketModal').classList.add('active'); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue