diff --git a/src/modules/search/ItemList.jsx b/src/modules/search/ItemList.jsx index 58415fcd6..80716f6d7 100644 --- a/src/modules/search/ItemList.jsx +++ b/src/modules/search/ItemList.jsx @@ -2,6 +2,7 @@ import React from 'react'; import './index.scss'; import dianzan from './image/dianzan.png'; import fork from './image/fork.png'; +import RenderHtml from '../../components/render-html'; export default (props) => { const { list } = props; @@ -25,7 +26,7 @@ export default (props) => {

} -

+ {item.content && }
{item.updateTime}
) diff --git a/src/modules/search/index.jsx b/src/modules/search/index.jsx index d6b23ca7f..dbe224d3b 100644 --- a/src/modules/search/index.jsx +++ b/src/modules/search/index.jsx @@ -64,6 +64,7 @@ const GlobalSearch = ({ location, showNotification, history, mygetHelmetapi }) = setTerm(val); setPage(1); setForcesearch(!forcesearch); + history.push(`/search?value=${val}`); } function searchDataList() { @@ -178,8 +179,6 @@ const GlobalSearch = ({ location, showNotification, history, mygetHelmetapi }) = size="large" onSearch={searchFun} className={{ 'global-search': true, "required-search": !searchValue }} - value={searchValue} - onChange={(e) => { setSearchValue(e.target.value) }} ref={(el) => setRef(el)} /> {!searchValue && 请输入搜索关键字} @@ -208,7 +207,7 @@ const GlobalSearch = ({ location, showNotification, history, mygetHelmetapi }) = 创建时间{iconSwitch(orderBy === "createTimeDesc" ? "desc" : orderBy === "createTimeAsc" ? "asc" :"")} -

{`找到${totalType1}条结果`}

+

{`找到${totalType1}条结果`}

@@ -228,7 +227,7 @@ const GlobalSearch = ({ location, showNotification, history, mygetHelmetapi }) =
-

{`找到${totalType2}条结果`}

+

{`找到${totalType2}条结果`}

@@ -285,7 +284,7 @@ const GlobalSearch = ({ location, showNotification, history, mygetHelmetapi }) =
-

{`找到${totalType5}条结果`}

+

{`找到${totalType5}条结果`}

diff --git a/src/modules/search/index.scss b/src/modules/search/index.scss index 0671b9eeb..955b37e52 100644 --- a/src/modules/search/index.scss +++ b/src/modules/search/index.scss @@ -48,7 +48,7 @@ .search-content { width: 1200px; margin: 1.5vw auto; - p{ + .search-item-title{ margin-bottom: .75em !important; } } @@ -85,12 +85,18 @@ &:hover{ color: #466aff; } - span{ + .highlightByGitlinkSearch{ color: #466aff; } } .search-item-content{ - span{ + -webkit-line-clamp: 5; + color: rgba(0, 0, 0, 0.65); + font-size: 14px; + a{ + color: rgba(0, 0, 0, 0.65); + } + .highlightByGitlinkSearch{ color: #466aff; } }