CMS增加ES全文检索功能

This commit is contained in:
thinkgem
2023-04-10 15:10:29 +08:00
parent e3b9c25ea8
commit df76b8742c
13 changed files with 207 additions and 48 deletions

View File

@@ -33,7 +33,7 @@
<label class="control-label col-sm-4" title="">
<span class="required hide">*</span> ${text('来源')}<i class="fa icon-question hide"></i></label>
<div class="col-sm-8">
<#form:radio path="source" dictType="cms_source" class="form-control required" />
<#form:radio path="source" dictType="cms_source" defaultValue="2" class="form-control required" />
</div>
</div>
</div>

View File

@@ -97,6 +97,9 @@ $('#dataGrid').dataGrid({
}
actions.push('<a href="${ctx}/cms/category/delete?categoryCode='+row.categoryCode+'" class="btnList" title="${text("删除栏目表")}" data-confirm="${text("确认要删除该栏目表及所有子栏目表吗?")}" data-deltreenode="'+row.id+'"><i class="fa fa-trash-o"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/form?parentCode='+row.id+'&site.siteCode=${category.site.siteCode}" class="btnList" title="${text("新增下级栏目表")}"><i class="fa fa-plus-square"></i></a>&nbsp;');
//<% if(hasPermi('cms:category:rebuildIndex')){ %>
actions.push('<a href="${ctx}/cms/category/rebuildIndex?categoryCode='+row.categoryCode+'" class="btnList" title="${text("重建该栏目索引")}" data-confirm="${text("确认重建该栏目下文章索引吗")}"><i class="fa fa-crosshairs"></i></a>&nbsp;');
//<% } %>
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctxFront}/list-'+row.categoryCode+'" target="_blank" title="${text("访问栏目")}"><i class="fa fa-globe"></i></a>&nbsp;');
}

View File

@@ -78,6 +78,9 @@ $('#dataGrid').dataGrid({
actions.push('<a href="${ctx}/cms/site/enable?siteCode='+row.siteCode+'" class="btnList" title="${text("启用站点")}" data-confirm="${text("确认要启用该站点吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/site/delete?siteCode='+row.siteCode+'" class="btnList" title="${text("删除站点")}" data-confirm="${text("确认要删除该站点吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//<% if(hasPermi('cms:site:rebuildIndex')){ %>
actions.push('<a href="${ctx}/cms/site/rebuildIndex?siteCode='+row.siteCode+'" class="btnList" title="${text("重建该站点索引")}" data-confirm="${text("确认重建该站点文章索引吗")}"><i class="fa fa-crosshairs"></i></a>&nbsp;');
//<% } %>
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctxFront}/index-'+row.siteCode+'" target="_blank" title="${text("访问站点")}"><i class="fa fa-globe"></i></a>&nbsp;');
}

View File

@@ -2,17 +2,18 @@
<script src="${ctxStatic}/laydate/5.3/laydate.js?${_version}"></script>
<style type="text/css">
form.search {margin:12px 20px 5px;}
form.search input.txt {padding:4px 8px;font-size:16px;width:300px;margin:5px;border:1px solid #bbb;border-radius:3px;}
form.search input.txt {padding:4px 8px;font-size:18px;width:300px;margin:5px;border:1px solid #bbb;border-radius:3px;}
form.search input.txt.date {width:133px;}
form.search .sel {margin:15px 0;padding:10px 5px;border-bottom:1px solid #efefef;font-size:16px;}
form.search input.txt:hover, form.search input.txt:focus {outline:none;border:1px solid #4e71f2;}
form.search .sel {margin:0 0 15px 0;padding:10px 5px;border-bottom:1px solid #efefef;font-size:18px;}
form.search .act {font-weight:bold;}
form.search .btn {padding:4px 18px;font-size:16px;margin-top:-3px;margin-right:5px;border:1px solid #bbb;border-radius:3px;}
form.search .btn:hover {color:#333;background:#d1d1d1}
form.search .btn {padding:4px 18px;font-size:18px;margin-top:-3px;margin-right:5px;border:1px solid #bbb;border-radius:3px;}
form.search .btn:hover, form.search .btn:focus {outline:none;color:#333;background:#d1d1d1}
dl.search {line-height:25px;border-bottom:1px solid #efefef;margin:10px 20px 15px 20px;}
dl.search dt {border-top:1px solid #efefef;padding:13px 5px 5px;font-size:16px;}
dl.search dt {border-top:1px solid #efefef;padding:13px 5px 5px;font-size:18px;font-weight:normal;font-family:Arial,sans-serif;}
dl.search dt a {color:#0000cc;text-decoration:underline;}
dl.search dd {margin:0 5px 13px;font-size:13px;color:#333;word-break:break-all;word-wrap:break-word;}
dl.search dd .info, dl.search dd .info a {margin-top:3px;font-size:12px;color:#008000;}
dl.search dd {margin:0 5px 13px;font-size:14px;color:#333;word-break:break-all;word-wrap:break-word;}
dl.search dd .info, dl.search dd .info a {margin-top:3px;font-size:14px;color:#008000;}
dl.search .highlight {color:#DF0037;}
.pagination{margin:0 0 10px 10px;}
</style>
@@ -67,23 +68,28 @@ $(function(){
</form>
<dl class="search">
<#html:if test="${page! != null && (isBlank(t) || t == 'article')}">
<#html:foreach items="${page.list}" var="article">
<dt><a href="${article.url}" target="_blank">${article.title}</a></dt>
<dd>${article.content}
<#html:foreach items="${page.list}" var="obj">
<dt><a href="${obj.data.url!}" target="_blank">${obj.data.title!}</a></dt>
<dd>
${obj.text}
<div class="info">
发布者:${article.createBy} &nbsp; 点击数:${article.hits} &nbsp;
发布时间:${article.createDateStr} &nbsp; 更新时间:${article.updateDateStr} &nbsp;
<a href="${article.url}" target="_blank">查看全文</a><br/>
发布者:${obj.data.createBy!} &nbsp;
发布时间:${obj.data.createDate!,dateFormat='yyyy-MM-dd'} &nbsp;
更新时间:${obj.data.updateDate!,dateFormat='yyyy-MM-dd'} &nbsp;
<a href="${obj.data.url!}" target="_blank">查看全文</a><br/>
</div>
</dd>
</#html:foreach>
</#html:if>
<#html:if test="${page! != null && t == 'link'}">
<#html:forEach items="${page.list}" var="link">
<dt><a href="${link.url}" target="_blank">${link.title}</a></dt>
<dd><div class="info">
发布者:${link.createBy} &nbsp; 发布时间:${link.createDateStr} &nbsp; 更新时间:${link.updateDateStr} &nbsp;
<a href="${link.url}" target="_blank">打开链接</a><br/>
<#html:forEach items="${page.list}" var="obj">
<dt><a href="${obj.data.url!}" target="_blank">${link.title}</a></dt>
<dd>
<div class="info">
发布者:${obj.data.createBy!} &nbsp;
发布时间:${link.createDate!,dateFormat='yyyy-MM-dd'} &nbsp;
更新时间:${link.updateDate!,dateFormat='yyyy-MM-dd'} &nbsp;
<a href="${obj.data.url!}" target="_blank">打开链接</a><br/>
</div>
</dd>
</#html:forEach>