search.zml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <#def title = "扬彩知识库"/>
  2. <#def keywords = "知识库"/>
  3. <#def desc = "扬彩知识库"/>
  4. <#--头部起始-->
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>扬彩知识库</title>
  9. <meta charset="UTF-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  12. <meta name="viewport" content="width=device-width,initial-scale=1"/>
  13. <meta name="Keywords" content="知识库" />
  14. <meta name="Description" content="扬彩知识库" />
  15. <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
  16. ${Styles.src(zhiqim.css)}
  17. ${Scripts.src(zhiqim.js)}
  18. ${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))}
  19. ${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))}
  20. </head>
  21. <script>
  22. Z.onload(function()
  23. {
  24. //左侧分类列表点击事件
  25. Z(".sidebar p").click(function()
  26. {
  27. var $thisUl = Z(this).next("ul");
  28. var hasChild = ($thisUl.find("li").length > 0)?(1):(0);
  29. if (hasChild)
  30. {
  31. var $ulDisplay = $thisUl.css("display");
  32. var $thisIcon = Z(this).find(".z-font");
  33. $thisUl.slideToggle().siblings("ul").slideUp();
  34. if ($ulDisplay == "block")
  35. return Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
  36. Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
  37. $thisIcon.removeClass("z-arrowhead-down").addClass("z-arrowhead-up");
  38. }
  39. else
  40. selectCategory(Z(this).attr("data-id"));
  41. });
  42. //定义搜索框
  43. var search = new Z.SearchAutoList();
  44. search.elem = "searchinput";
  45. search.className = "SearchPresenter";
  46. search.methodName = "search";
  47. search.callback = function(){doSearchAjax(this.value);};
  48. search.execute();
  49. })
  50. //分类选择
  51. function selectCategory(id)
  52. {
  53. window.location.href = "/question.htm?categoryId=" + id;
  54. }
  55. //文章显示
  56. function getArticle(categoryId,articleId)
  57. {
  58. window.location.href = "/question.htm?categoryId=" + categoryId + "&articleId=" + articleId;
  59. }
  60. //执行搜索
  61. function doSearchAjax(str)
  62. {
  63. window.location.href = "/search.htm?keyword=" + str;
  64. }
  65. </script>
  66. <#--容器开始-->
  67. <div id="container" class="container">
  68. <!-- 左边导航 -->
  69. <div class="sidebar">
  70. <main<#if menu=="index"> class="selected"</#if> onclick="location.href='${context.getRootPath("/question.htm")}'"><img width="150" height="40" src="${context.getRootPath("/inc/images/logo.png")}" alt="扬彩印刷" title="扬彩印刷"></a></main>
  71. <p data-id="0">热门问题</p>
  72. <#for category : categoryList>
  73. <#if category.getCategoryLevel() == 2>
  74. <p data-id="${category.getCategoryId()}" class="<#if category.getCategoryId()==categoryId>z-selected</#if>">
  75. <#if isParent.get(categoryList.indexOf(category))><i class="z-font z-arrowhead-down z-float-left z-mg-r10"></i></#if>${category.getCategoryName()}
  76. </p>
  77. <ul style="display:none;">
  78. <#for child : childrenList>
  79. <#if child.getParentId() == category.getCategoryId()>
  80. <li <#if categoryId == child.getCategoryId()>class="z-selected"</#if> onclick="selectCategory(${child.getCategoryId()})">${child.getCategoryName()}</li>
  81. </#if>
  82. </#for>
  83. </ul>
  84. </#if>
  85. </#for>
  86. </div>
  87. <!-- 右边主体 -->
  88. <div class="mainbody">
  89. <!-- 搜索框 -->
  90. <div class="mainsearch">
  91. <span class="z-show-ib" id="search_wrap">
  92. <input id="searchinput" placeholder="输入问题关键词" value="${keyword}" type="text" class="z-input z-xlarge"><button onclick="doSearchAjax(searchinput.value)" class="z-button">&#xf004;</button>
  93. </span>
  94. </div>
  95. <div class="questionbody" id="questionbody">
  96. <div class="search-resultBar z-lh30">搜索结果:
  97. <span>${keyword}</span>&nbsp;&nbsp;共找到&nbsp;
  98. <span>${articleList.size()}</span>&nbsp;个结果
  99. </div>
  100. <dl class="search-resultList">
  101. <#for article : articleList>
  102. <dt><a href="javascript:{getArticle(${article.getCategoryId()},${article.getArticleId()})}">${article.getArticleTitle()}</a></dt>
  103. <dd>${contentList.get(articleList.indexOf(article))}</dd>
  104. </#for>
  105. <#if articleList.size()==0>
  106. <h2 style="font-weight:normal;">没有找到相关项目</h2>
  107. </#if>
  108. </dl>
  109. </div>
  110. </div>
  111. </div>
  112. </body>
  113. </html>