From bf3e173da36c7b3bef4dde6dd4fd898b03c8a9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Tue, 20 Jan 2026 14:40:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0index.html=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/resources/static/index.html | 231 ++++++++++++++++++++++- 1 file changed, 222 insertions(+), 9 deletions(-) diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html index 6c2df13..b4f0d45 100644 --- a/web/src/main/resources/static/index.html +++ b/web/src/main/resources/static/index.html @@ -486,7 +486,7 @@ 创建时间 跟进内容 响应时间 - 负责人 + 负责人 操作 @@ -519,7 +519,7 @@ 创建时间 跟进内容 响应时间 - 负责人 + 负责人 操作 @@ -545,6 +545,8 @@ var managersList = []; var allPersonalData = []; var isLoadingAllData = false; + var currentManagerFilter = null; + var currentFilterTable = 'personal'; function init() { var savedUserInfo = localStorage.getItem('userInfo'); @@ -657,6 +659,11 @@ role: usersManagements.role || '' }; + // 添加负责人筛选参数 + if (currentManagerFilter) { + params.managerName = currentManagerFilter; + } + var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); @@ -695,6 +702,11 @@ role: usersManagements.role || '' }; + // 添加负责人筛选参数 + if (currentManagerFilter) { + params.managerName = currentManagerFilter; + } + var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); @@ -748,11 +760,21 @@ // 根据筛选条件过滤 if (personalFilter === 'followed') { - return user.followup && user.followup !== ''; + if (!(user.followup && user.followup !== '')) { + return false; + } } else if (personalFilter === 'unfollowed') { - return !user.followup || user.followup === ''; + if (!(!user.followup || user.followup === '')) { + return false; + } + } + + // 按负责人筛选 + if (currentManagerFilter) { + return user.managerName === currentManagerFilter; } - // 'all' 或其他情况,不过滤 + + // 其他情况,不过滤 return true; }); @@ -836,6 +858,151 @@ } } + function toggleManagerFilter(tableType) { + currentFilterTable = tableType || 'personal'; + + // 收集当前表格中的所有负责人名称 + var managers = new Set(); + var bodyElement = currentFilterTable === 'personal' ? + document.getElementById('personalBody') : + document.getElementById('publicBody'); + + var rows = bodyElement.getElementsByTagName('tr'); + for (var i = 0; i < rows.length; i++) { + var cells = rows[i].getElementsByTagName('td'); + // 找到负责人列(索引为7,因为从0开始计数) + if (cells.length > 7) { + var managerName = cells[7].textContent.trim(); + if (managerName && managerName !== '-') { + managers.add(managerName); + } + } + } + + // 如果没有负责人数据,显示提示 + if (managers.size === 0) { + showAlert('当前表格中没有负责人数据'); + return; + } + + // 创建筛选菜单 + createManagerFilterMenu(Array.from(managers)); + } + + function createManagerFilterMenu(managers) { + // 移除已存在的筛选菜单 + var existingMenu = document.getElementById('managerFilterMenu'); + if (existingMenu) { + existingMenu.remove(); + } + + // 创建筛选菜单 + var menu = document.createElement('div'); + menu.id = 'managerFilterMenu'; + menu.style.cssText = ` + position: absolute; + background-color: white; + border: 1px solid #d9d9d9; + border-radius: 4px; + box-shadow: 0 4px 12px rgba(0,0,0,0.15); + z-index: 1001; + padding: 8px 0; + min-width: 150px; + `; + + // 添加清除筛选选项 + var clearOption = document.createElement('div'); + clearOption.textContent = '清除筛选'; + clearOption.style.cssText = ` + padding: 8px 16px; + cursor: pointer; + font-size: 14px; + `; + clearOption.onmouseover = function() { + this.style.backgroundColor = '#f5f5f5'; + }; + clearOption.onmouseout = function() { + this.style.backgroundColor = 'white'; + }; + clearOption.onclick = function() { + currentManagerFilter = null; + applyManagerFilter(); + menu.remove(); + }; + menu.appendChild(clearOption); + + // 添加分隔线 + var divider = document.createElement('div'); + divider.style.cssText = ` + height: 1px; + background-color: #f0f0f0; + margin: 4px 0; + `; + menu.appendChild(divider); + + // 添加负责人选项 + managers.forEach(function(manager) { + var option = document.createElement('div'); + option.textContent = manager; + option.style.cssText = ` + padding: 8px 16px; + cursor: pointer; + font-size: 14px; + `; + option.onmouseover = function() { + this.style.backgroundColor = '#f5f5f5'; + }; + option.onmouseout = function() { + this.style.backgroundColor = 'white'; + }; + option.onclick = function() { + currentManagerFilter = manager; + applyManagerFilter(); + menu.remove(); + }; + menu.appendChild(option); + }); + + // 获取表头位置并显示菜单 + var headerElement = currentFilterTable === 'personal' ? + document.getElementById('managerHeader') : + document.getElementById('publicManagerHeader'); + + var rect = headerElement.getBoundingClientRect(); + menu.style.left = rect.left + 'px'; + menu.style.top = (rect.top + rect.height) + 'px'; + + // 添加到页面 + document.body.appendChild(menu); + + // 点击页面其他地方关闭菜单 + document.addEventListener('click', function closeMenu(event) { + if (!menu.contains(event.target) && event.target !== headerElement) { + menu.remove(); + document.removeEventListener('click', closeMenu); + } + }); + } + + function applyManagerFilter() { + if (currentFilterTable === 'personal') { + // 个人表格筛选 + personalPage = 1; + if (personalFilter === 'followed' || personalFilter === 'unfollowed') { + displayFilteredPersonalData(); + } else { + loadAllPersonalData(); // 加载所有数据以便筛选 + } + } else { + // 公海池表格筛选 + // 公海池数据需要重新加载,因为它可能有分页 + loadPublicData(); + } + + // 更新表头样式 + updateManagerHeaderStyle(); + } + function loadPublicData() { var userRole = userInfo.loginInfo.projectName; var usersManagements = userInfo.usersManagements; @@ -852,6 +1019,11 @@ role: usersManagements.role || '' }; + // 添加负责人筛选参数 + if (currentManagerFilter) { + params.managerName = currentManagerFilter; + } + var url = 'http://8.137.125.67:8083/KH/api/users/public?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); @@ -1079,11 +1251,21 @@ // 根据筛选条件过滤 if (personalFilter === 'followed') { - return user.followup && user.followup !== ''; + if (!(user.followup && user.followup !== '')) { + return false; + } } else if (personalFilter === 'unfollowed') { - return !user.followup || user.followup === ''; + if (!(!user.followup || user.followup === '')) { + return false; + } + } + + // 按负责人筛选 + if (currentManagerFilter) { + return user.managerName === currentManagerFilter; } - // 'all' 或其他情况,不过滤 + + // 其他情况,不过滤 return true; }); @@ -1190,7 +1372,16 @@ if (data.users && data.users.length > 0) { publicEmpty.style.display = 'none'; var filteredUsers = data.users.filter(function(user) { - return user.type !== 'Colleague'; + if (user.type === 'Colleague') { + return false; + } + + // 按负责人筛选 + if (currentManagerFilter) { + return user.managerName === currentManagerFilter; + } + + return true; }); if (filteredUsers.length > 0) { @@ -1355,6 +1546,28 @@ document.getElementById('alertModal').style.display = 'block'; } + function updateManagerHeaderStyle() { + // 更新个人表格表头样式 + var managerHeader = document.getElementById('managerHeader'); + if (currentFilterTable === 'personal' && currentManagerFilter) { + managerHeader.style.backgroundColor = '#e6f7ff'; + managerHeader.style.color = '#1890ff'; + } else { + managerHeader.style.backgroundColor = ''; + managerHeader.style.color = ''; + } + + // 更新公海池表格表头样式 + var publicManagerHeader = document.getElementById('publicManagerHeader'); + if (currentFilterTable === 'public' && currentManagerFilter) { + publicManagerHeader.style.backgroundColor = '#e6f7ff'; + publicManagerHeader.style.color = '#1890ff'; + } else { + publicManagerHeader.style.backgroundColor = ''; + publicManagerHeader.style.color = ''; + } + } + function closeAlertModal() { document.getElementById('alertModal').style.display = 'none'; } From 5b763028438706bc4bef5bf39e0dc200543a07c0 Mon Sep 17 00:00:00 2001 From: Default User Date: Tue, 20 Jan 2026 16:11:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=8C=BA?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BF=85=E5=A1=AB=E5=AD=97=E6=AE=B5=E6=8F=90=E7=A4=BA=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B6=E4=BB=96=E5=AE=A2=E6=88=B7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/web/entity/Users.java | 9 + web/src/main/resources/mapper/UsersMapper.xml | 8 +- web/src/main/resources/static/index.html | 571 +++++++++++++++++- 3 files changed, 574 insertions(+), 14 deletions(-) diff --git a/web/src/main/java/com/example/web/entity/Users.java b/web/src/main/java/com/example/web/entity/Users.java index a13ec6c..bce3f15 100644 --- a/web/src/main/java/com/example/web/entity/Users.java +++ b/web/src/main/java/com/example/web/entity/Users.java @@ -29,6 +29,7 @@ public class Users { private LocalDateTime updated_at;//更新时间 private String company;//客户公司 private String region;//客户地区 + private String detailedaddress;//详细地址 private String level;//客户等级 private String demand;//客户需求 private String spec;//规格 @@ -176,6 +177,14 @@ public class Users { this.region = region; } + public String getDetailedaddress() { + return detailedaddress; + } + + public void setDetailedaddress(String detailedaddress) { + this.detailedaddress = detailedaddress; + } + public String getLevel() { return level; } diff --git a/web/src/main/resources/mapper/UsersMapper.xml b/web/src/main/resources/mapper/UsersMapper.xml index 8c84ac3..9e237e6 100644 --- a/web/src/main/resources/mapper/UsersMapper.xml +++ b/web/src/main/resources/mapper/UsersMapper.xml @@ -180,7 +180,13 @@ UPDATE users SET followup = #{followup}, - followup_at = NOW() + followup_at = NOW(), + type = #{type}, + level = #{level}, + detailedaddress = #{detailedaddress}, + company = #{company}, + demand = #{demand}, + region = #{region} WHERE userId = #{userId} diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html index 6c2df13..d17c8b1 100644 --- a/web/src/main/resources/static/index.html +++ b/web/src/main/resources/static/index.html @@ -409,6 +409,19 @@ #returnModal button:active { transform: translateY(0); } + + /* 搜索选择组件样式 */ + .search-select-option:hover { + background-color: #f0f7ff; + color: #1890ff; + } + + /* 搜索输入框焦点样式 */ + #followupRegionSearch:focus { + outline: none; + border-color: #1890ff; + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + } @@ -657,7 +670,7 @@ role: usersManagements.role || '' }; - var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params); + var url = '/KH/api/users?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); @@ -695,7 +708,7 @@ role: usersManagements.role || '' }; - var url = 'http://8.137.125.67:8083/KH/api/users?' + objectToQueryString(params); + var url = '/KH/api/users?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); @@ -852,7 +865,7 @@ role: usersManagements.role || '' }; - var url = 'http://8.137.125.67:8083/KH/api/users/public?' + objectToQueryString(params); + var url = '/KH/api/users/public?' + objectToQueryString(params); var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); @@ -874,8 +887,8 @@ // 跟进弹窗HTML var followupModalHTML = ` -