临下班突然来了一个特别着急的BUG。
问题代码如下:
<table class="table table-border table-bordered table-hover table-bg table-sort"> <thead> <tr class="text-c"> <th width="25"><input type="checkbox" name="" value=""></th> <th width="30">id</th> <th width="30">区域</th> <th width="60">小区名称</th> <th width="90">标题</th> <th width="50">户型</th> <th width="30">图片数量</th> <th width="60">联系人</th> <th width="60">对接人</th> <th width="60">对接客服</th> <th width="60">视频房源</th> <th width="30">审核状态</th> <th width="30">身份认证</th> <th width="30">房本认证</th> <th width="30">浏览量</th> <th width="60">售价</th> <th width="90">备注</th> <th width="90">超市物业</th> <th width="100">发布时间</th> <th width="100">更新时间</th> <th width="60">上次审核时间</th> <th width="100">操作</th> </tr> </thead> <tbody> <tr class="text-c" th:each="list : ${dataList}"> <input type="hidden" th:id="${list.HouseID}" name="cooperation" th:value="${list.isCooperation+ '_' + list.cooperationId}"/> <td><input type="checkbox" class="houseId" th:value="${list.HouseID}" name=""/></td> <td th:text="${list.HouseID}"></td> <td th:text="${list.regionName}"></td> <td th:text="${list.subdistrictName}"></td> <td> <a th:text="${list.Title}" th:href="@{'https://sy.fangxiaoer.com/UHouse/sale/view/'+${list.HouseID}}" target="_blank"></a> </td> <!--<td th:text="${list.Title}"></td>--> <td th:text="${list.room+'室'+list.Hall+'厅'+list.Toilet+'卫'}"></td> <td th:text="${list.picCount}"></td> <td th:if="${#strings.equals(list.memberType, '2')}" th:text="${list.realName}"></td> <td th:if="${#strings.equals(list.memberType, '1')}" th:text="${#lists.size(#strings.listSplit(list.HouseOwner,'|')) le 1?list.HouseOwner:((#strings.listSplit(list.HouseOwner,'|')[0])+(#strings.listSplit(list.HouseOwner,'|')[1] eq '1'?'(先生)':'(女士)')) }"></td> <td th:text="${list.joinMember}"></td> <td th:text="${list.joinCustomerService}"></td> <td th:text="${list.houseVideoStatus eq 3 ? '是' :'否'}"></td> <th:block th:if="${list.State eq 3}"> <td class="td-status"><span class="label label-success radius">审核通过</span></td> </th:block> <th:block th:if="${list.State eq 1}"> <td class="td-status"><span class="label label-danger radius">未审核</span></td> </th:block> <th:block th:if="${list.State eq 4}"> <td class="td-status"><span class="label label-warning radius">审核未通过</span></td> </th:block> <th:block th:switch="${list.realEstateStatus}"> <td th:case="0" >n/a</td> <td th:case="2" >未审核</td> <td th:case="5" >未审核</td> <td th:case="15">未审核通过</td> <td th:case="100">审核通过</td> </th:block> <th:block th:switch="${list.realEstateStatus}"> <td th:case="0" >n/a</td> <td th:case="2" >n/a</td> <td th:case="5" >未审核</td> <td th:case="15">未审核</td> <td th:case="100">审核通过</td> </th:block> <td th:text="${list.TotalVisitedNum}"></td> <td th:text="${list.SalePrice + '万元'}"></td> <td th:text="${list.Remark}"></td> <td th:text="${list.pd}"></td> <td th:text="${list.addTimeStr}"></td> <td th:text="${list.updateTimeStr}"></td> <td th:text="${#strings.isEmpty(list.SchoolAreaMID)? '' : list.SchoolAreaMID +'['+list.MiddleSchoolID+']'}"></td> <td class="td-manage"> <a data-toggle="tooltip" data-placement="top" title="编辑" href="javascript:;" th:onclick="'javascript:edit(\'编辑\',\''+${list.HouseID}+'\',\'update\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> <a data-toggle="tooltip" data-placement="top" title="缩略图" href="javascript:;" th:onclick="'javascript:housePicShow(\'缩略图\',\''+${list.HouseID}+'\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> <a data-toggle="tooltip" data-placement="top" title="刷新" href="javascript:;" th:onclick="'javascript:putSaleHouse(\'刷新\',\''+${list.HouseID}+'\',\'refresh\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> <th:block th:if="${list.IsDel eq 0}"> <a data-toggle="tooltip" data-placement="top" title="删除" href="javascript:;" th:onclick="'javascript:putSaleHouse(\'删除\',\''+${list.HouseID}+'\',\'delete\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> </th:block> <th:block th:if="${list.IsDel eq 1}"> <a data-toggle="tooltip" data-placement="top" title="恢复" href="javascript:;" th:onclick="'javascript:putSaleHouse(\'恢复\',\''+${list.HouseID}+'\',\'recovery\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> </th:block> <a data-toggle="tooltip" data-placement="top" title="点击状况" href="javascript:;" th:onclick="'javascript:affective(\''+${list.HouseID}+'\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> <th:block th:if="${list.IsAdHouse eq 0 or list.IsAdHouse eq null}"> <a data-toggle="tooltip" data-placement="top" title="设置专题房源" href="javascript:;" th:onclick="'javascript:setAdHouse(\''+${list.HouseID}+'\',\'1\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> </th:block> <th:block th:if="${list.IsAdHouse eq 1}"> <a data-toggle="tooltip" data-placement="top" title="取消专题房源" href="javascript:;" th:onclick="'javascript:setAdHouse(\''+${list.HouseID}+'\',\'0\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> </th:block> <th:block th:if="${list.realEstateStatus ge 2}"> <a data-toggle="tooltip" data-placement="top" title="真房源审核" href="javascript:;" th:onclick="'javascript:checkRealHouse(\''+${list.HouseID}+'\',\'0\')'" class="ml-5" style="text-decoration:none"> <i class="Hui-iconfont"></i> </a> </th:block> </td> </tr> </tbody> </table>出现的问题最终定位在正常的tr td结构中被插入了一个<input type="hidden">标签,这个虽然在明面出现不了任何问题,但是会造成批量选择按钮失效
这种情况下,解决问题的方式就是把input挪到第一个td的下面,或者挪到所有的td后面,这样他就不会打扰tr 对第一个td多选框的批量选择操作了。
以上,问题完美解决