首页 > 其他 > 详细

在table列表里面运用,<th:block th:switch=''>所处的值为空,或者匹配不上时,td 这列就会少一列,解决方法

时间:2019-06-03 12:56:16      阅读:380      评论:0      收藏:0      [点我收藏+]
 

没有写过的代码:业务类型

 <th:block th:switch="${sales.handlingType}">
	                                	<td th:case="1001" th:text="单宽续约"/>
	                                	<td th:case="1002" th:text="移动续约"/>
						<td th:case="1003" th:text="融合续约"/>
						<td th:case="1006" th:text="加装不限量包"/>
                                                <td th:case="1008" th:text="宽带提速"/>
</th:block>

 如果,我此时的值为,加装影视包,就匹配不上,这时,这个表就少一列,如下图:

 

技术分享图片

 

下面这个修改好的:

<table class="table table-hover table-condensed">
			<thead>
				<tr>
					<th>#</th>
					<th>省份</th>
					<th>销售品名称</th>
	                                <th>省内销售品编码</th>
	                                <th>集团销售品编码</th>
	                                <th>业务类型</th>
	                                <th>操作标识</th>
	                                <th>最后操作时间</th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="sales, status: ${stockSalesList}">
	                                <th th:text="${(pageInfo.pageNo - 1) * pageInfo.pageSize + status.index + 1}"></th>
	                                <td th:text="${sales.provName}"></td>
	                                <td align="left" th:text="${sales.offerTitlePrev}"></td>
	                                <td align="left" th:text="${sales.offerCodePrev}"></td>
	                                <td th:text="${sales.offerCodeGroup}"></td>
	                                <td>
                          <div th:switch="${sales.handlingType}">
							<p th:case="1001" th:text="单宽续约"></p>
		                                	<p th:case="1002" th:text="移动续约"/>
							<p th:case="1003" th:text="融合续约"/>
							<p th:case="1006" th:text="加装不限量包"/>
							<p th:case="1008" th:text="宽带提速"/>
							<p th:case="1009" th:text="加装畅享提速包"/>
							<p th:case="1010" th:text="加装影视包"/>
	                                  </div>
	                                </td>
                        <th:block th:switch="${sales.operateMark}">
                                         <td th:case="0" th:text="初始"/>
                                         <td th:case="1" th:text="新增"/>
                                   <td th:case="2" th:text="更新"/>
                                   <td th:case="3" th:text="删除"/>
                                     </th:block>
                                     <td th:text="${#dates.format(sales.lastOperateTime,‘yy/MM/dd HH:mm:ss‘)}"></td>
                             </tr>
            </tbody>
      </table>

 效果如下图:

 

技术分享图片

 

在table列表里面运用,<th:block th:switch=''>所处的值为空,或者匹配不上时,td 这列就会少一列,解决方法

原文:https://www.cnblogs.com/hanxue53/p/10966425.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!