123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
- <html>
- <head>
- <title>选择文章</title>
- <meta name="decorator" content="default"/>
- <style type="text/css">
- .table td i {
- margin: 0 2px;
- }
- </style>
- <script type="text/javascript">
- $(document).ready(function () {
- //弹出框去滚动条
- top.$('#jbox-content').css("overflow-y", "hidden");
- show_title(30);
- // 反选
- $('body').on('click', 'input[name="info"]', function () {
- var allInputLength = $('input[name="info"]').length - $('input[name="info"]:disabled').length,
- allInputCheckedLength = $('input[name="info"]:checked').length,
- checkAllEle = $('.check-all');
- // 判断选中长度和总长度,如果相等就是全选否则取消全选
- if (allInputLength === allInputCheckedLength) {
- checkAllEle.attr('checked', true);
- } else {
- checkAllEle.attr('checked', false);
- }
- })
- });
- function page(n, s) {
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- function getCheckedItems() {
- var items = new Array();
- var $items = $('.check-item:checked');
- $items.each(function () {
- //通过拿到的商品ID组合键获取其它值
- var productId = $(this).val();
- items.push(productId);
- });
- return items;
- }
- function allCkbfun(ckb) {
- var isChecked = ckb.checked;
- $(".check-item").attr('checked', isChecked);
- }
- /**
- * @param obj
- * jquery控制input只能输入数字
- */
- function onlynum(obj) {
- obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
- }
- /**
- * @param obj
- * jquery控制input只能输入数字和两位小数(金额)
- */
- function num(obj) {
- obj.value = obj.value.replace(/[^\d.]/g, ""); //清除"数字"和"."以外的字符
- obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字
- obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个, 清除多余的
- obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
- obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
- }
- var ontypeId = null;
- var typeId = null;
- function ischangeType() {
- if (null != typeId) {
- $("#typeListId option[value=" + typeId + "]").val(ontypeId);
- }
- $("#optionType").find("option").eq(0).prop("selected", true)
- optionTypeParent()
- }
- function optionTypeParent() {
- $("#optionType [parent]").each(function (item) {
- if ($("#typeListId option:selected").val() == $(this).attr("parent")) {
- $(this).show()
- } else {
- $(this).hide()
- }
- })
- }
- function isoptionType() {
- if ("" != $("#optionType option:selected").val()) {
- ontypeId = $("#optionType option:selected").attr("parent")
- typeId = $("#optionType option:selected").val()
- $("#typeListId option:selected").val($("#optionType option:selected").val())
- }else {
- ischangeType()
- }
- }
- $(document).ready(function () {
- $("#typeListId option[value=" + $("#optionType option:selected").attr("parent") + "]").prop("selected", true);
- optionTypeParent()
- isoptionType()
- $("input[type='radio'][name='publishSource']").change(function (obj) {
- $("#searchForm").submit();
- })
- })
- </script>
- </head>
- <body>
- <form:form id="searchForm" modelAttribute="info" action="${ctx}/info/info/findInfoPage" method="post"
- class="breadcrumb form-search">
- <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
- <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
- <div class="ul-form">
- <br>
- <input type="radio" name="publishSource"
- value="1" ${empty info.publishSource?'checked=checked':info.publishSource eq 1?'checked=checked':''} >采美文章
- <input type="radio" name="publishSource" value="2" ${info.publishSource eq 2?'checked=checked':''}>供应商文章
- <br>
- <br>
- <label>ID:</label>
- <form:hidden path="cmRelatedType"/>
- <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
- <label>标题:</label>
- <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
- <label>发布人:</label>
- <form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
- <label>发布时间:</label>
- <form:input path="startPubDate" type="text" maxlength="10" class="input-medium Wdate"
- value="${startPubDate}"
- onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
- 至
- <form:input path="endPubDate" type="text" maxlength="10" class="input-medium Wdate"
- value="${startPubDate}"
- onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
- <br> <br>
- <label>文章分类:</label>
- <form:select id="typeListId" path="infoType.id" class="input-small" onchange="ischangeType()">
- <form:option value="" label=" "/>
- <c:forEach items="${typeList}" var="type" varStatus="index">
- <c:if test="${type.parentId eq 0}">
- <form:option value="${type.id}" label="${type.name}"/>
- </c:if>
- </c:forEach>
- </form:select>
- <form:select id="optionType" path="typeId" class="input-small" onchange="isoptionType()">
- <form:option value="" label=" "/>
- <c:forEach items="${typeList}" var="type" varStatus="index">
- <c:if test="${type.parentId ne 0}">
- <form:option value="${type.id}" label="${type.name}" parent="${type.parentId}"
- cssStyle="display: none"/>
- </c:if>
- </c:forEach>
- </form:select>
-  <input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
- <div class="clearfix"></div>
- </div>
- </form:form>
- <sys:message content="${message}"/>
- <table class="table table-striped table-bordered table-condensed table-hover">
- <tr>
- <th style="width:20px;"><input class="check-all" type="checkbox" onclick="allCkbfun(this);"/></th>
- <th>文章ID</th>
- <th>文章分类</th>
- <th>引导图</th>
- <th>发布人</th>
- <th>文章标题</th>
- <th>发布时间</th>
- </tr>
- <tbody>
- <c:if test="${not empty page.list}">
- <c:forEach items="${page.list}" var="item">
- <tr id="${item.id}" class="itemtr">
- <th>
- <input class="check-item" type="checkbox" name="info" value='${item.id}'/>
- </th>
- <td>${item.id}</td>
- <td>${item.infoType.name}</td>
- <td><img src="${item.guidanceImage}" width="50px" height="50px"></td>
- <td>${item.publisher}</td>
- <td>${item.title}</td>
- <td><fmt:formatDate value="${item.pubdate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
- </tr>
- </c:forEach>
- </c:if>
- </tbody>
- </table>
- <c:if test="${empty page.list}">
- <p style="text-align: center;"><font color="#1e90ff">暂无数据……</font></p>
- </c:if>
- <div class="pagination">${page}</div>
- </body>
- </html>
|