cmBaikeHotSearchForm.jsp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>热搜词管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style>
  8. .jumpType{
  9. margin-left: 20px;
  10. width: 400px;
  11. }
  12. .productList{
  13. margin-left: 20px;
  14. }
  15. </style>
  16. <script type="text/javascript">
  17. $(document).ready(function() {
  18. //$("#name").focus();
  19. $("#inputForm").validate({
  20. submitHandler: function(form){
  21. loading('正在提交,请稍等...');
  22. form.submit();
  23. },
  24. errorContainer: "#messageBox",
  25. errorPlacement: function(error, element) {
  26. $("#messageBox").text("输入有误,请先更正。");
  27. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  28. error.appendTo(element.parent().parent());
  29. } else {
  30. error.insertAfter(element);
  31. }
  32. }
  33. });
  34. });
  35. </script>
  36. </head>
  37. <body>
  38. <ul class="nav nav-tabs">
  39. <li><a href="${ctx}/baike/cmBaikeHotSearch/">热搜词列表</a></li>
  40. <li class="active"><a href="${ctx}/baike/cmBaikeHotSearch/form?id=${cmBaikeHotSearch.id}">热搜词${not empty cmBaikeHotSearch.id?'编辑':'添加'}</a></li>
  41. </ul><br/>
  42. <form:form id="inputForm" modelAttribute="cmBaikeHotSearch" action="${ctx}/baike/cmBaikeHotSearch/save" method="post" class="form-horizontal">
  43. <form:hidden path="id"/>
  44. <sys:message content="${message}"/>
  45. <div class="control-group">
  46. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>热搜词:</label>
  47. <div class="controls">
  48. <form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-xlarge required"/>
  49. </div>
  50. </div>
  51. <div class="control-group">
  52. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>跳转方式:</label>
  53. <div class="controls">
  54. <form:radiobutton path="jumpType" name="jumpType" value="1" label="仅搜索" checked="true"/>
  55. <br> <br>
  56. <form:radiobutton path="jumpType" name="jumpType" value="2" label="产品" onclick="changeJumpType()"/>
  57. <form:select path="productId" class="input-xlarge productList">
  58. <form:option value="" label="请选择"/>
  59. <form:options items="${productList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
  60. </form:select>
  61. <br> <br>
  62. <form:radiobutton path="jumpType" name="jumpType" value="3" label="仪器" onclick="changeJumpType()"/>
  63. <form:select path="instrumentId" class="input-xlarge productList">
  64. <form:option value="" label="请选择"/>
  65. <form:options items="${instrumentList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
  66. </form:select>
  67. <br> <br>
  68. <form:radiobutton path="jumpType" name="jumpType" value="4" label="链接" />
  69. <form:input path="jumpLink" htmlEscape="false" class="input-xlarge jumpType"/>
  70. </div>
  71. </div>
  72. <%--<div class="control-group">
  73. <label class="control-label">产品/仪器id:</label>
  74. <div class="controls">
  75. <form:select path="productId" class="input-xlarge ">
  76. <form:option value="" label=""/>
  77. <form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  78. </form:select>
  79. </div>
  80. </div>--%>
  81. <div class="control-group">
  82. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
  83. <div class="controls">
  84. <form:input path="sort" htmlEscape="false" class="input-xlarge digits required"/>
  85. </div>
  86. </div>
  87. <div class="control-group">
  88. <label class="control-label">状态:</label>
  89. <div class="controls">
  90. <form:select path="status" class="input-xlarge required">
  91. <form:option value="1" label="启用"/>
  92. <form:option value="0" label="停用"/>
  93. </form:select>
  94. </div>
  95. </div>
  96. <div class="form-actions">
  97. <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
  98. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  99. </div>
  100. </form:form>
  101. <script>
  102. $(function () {
  103. changeJumpType()
  104. });
  105. function changeJumpType() {
  106. var jumpType = $("input[name='jumpType']:checked").val();
  107. var productList = $("#productId");
  108. var instrumentList = $("#instrumentId");
  109. if (jumpType == 2) {
  110. productList.addClass("required");
  111. instrumentList.removeClass("required");
  112. } else if (jumpType == 3) {
  113. productList.removeClass("required");
  114. instrumentList.addClass("required");
  115. } else {
  116. productList.removeClass("required");
  117. instrumentList.removeClass("required");
  118. }
  119. }
  120. </script>
  121. </body>
  122. </html>