解决无法跳转到成果详情页面
This commit is contained in:
parent
0e5e1e0e88
commit
6088c0f6e1
|
|
@ -60,12 +60,13 @@ class Index extends Component {
|
|||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/achievement/overview"
|
||||
render={(props) => (
|
||||
<Overview {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/achievement/overview"
|
||||
render={(props) => (
|
||||
<Overview {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,12 +3,23 @@ import { NewSvg } from '../../svg';
|
|||
import './index.scss';
|
||||
export default (props) => {
|
||||
const { list, itemClick, } = props;
|
||||
let cleanedText = '';
|
||||
|
||||
return (
|
||||
list.map(item => {
|
||||
if (item.text) {
|
||||
cleanedText = item.text.replace(/<p>|<\/p>/g, '');
|
||||
} else {
|
||||
cleanedText = '';
|
||||
}
|
||||
console.log('@@@',item.id);
|
||||
|
||||
return (
|
||||
<div className="list-box" key={item.id}>
|
||||
<div className="list-title" onClick={() => { itemClick(item.id) }}>
|
||||
<div className="list-title" onClick={() => {
|
||||
console.log('###点击了:'+item.id)
|
||||
itemClick(item.id)
|
||||
}}>
|
||||
{item.achievementName || item.title} {item.new && <NewSvg color="#ffb300"/>}
|
||||
</div>
|
||||
<div className="list-other">
|
||||
|
|
@ -19,7 +30,7 @@ export default (props) => {
|
|||
<p><i className="iconfont icon-dianjiliang mr5 font-12" />{item.visits || 0}</p>
|
||||
</div>
|
||||
<div className="list-text">
|
||||
<p>摘要:{item.text && item.text.substring(3, item.text.length-4)}</p>
|
||||
<p>摘要:{cleanedText}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -79,15 +79,19 @@ export default (props) => {
|
|||
}
|
||||
}, [tab, title, orderBy, curPage]);
|
||||
|
||||
// @@@ 排序实现逻辑
|
||||
function changeSort(sortType) {
|
||||
setOrderBy(sortType);
|
||||
setCurPage(1);
|
||||
}
|
||||
|
||||
// @@@ 跳转到成果详情页
|
||||
function noticeClick(id) {
|
||||
console.log('$$$noticeClick:'+id)
|
||||
props.history.push(`/achievement/noticeDetail/${id}`);
|
||||
}
|
||||
|
||||
// @@@ 右侧 上方 搜索、排序功能的DOM
|
||||
function sortNav() {
|
||||
return <div className="notice-sort-nav">
|
||||
<Search
|
||||
|
|
@ -105,6 +109,7 @@ export default (props) => {
|
|||
</div>
|
||||
}
|
||||
|
||||
// @@@ 查看更多 跳转逻辑
|
||||
function handleClick(e) {
|
||||
setTab(e.key);
|
||||
setCurPage(1);
|
||||
|
|
@ -112,6 +117,7 @@ export default (props) => {
|
|||
setOrderBy('publishDateDesc');
|
||||
}
|
||||
|
||||
// @@@ 左侧menu菜单项 跳转逻辑
|
||||
function click(e){
|
||||
setTab(e);
|
||||
setCurPage(1);
|
||||
|
|
@ -119,25 +125,27 @@ export default (props) => {
|
|||
setOrderBy('publishDateDesc');
|
||||
}
|
||||
|
||||
// @@@ 右侧根据成果来源类型 分块显示 的 实现逻辑
|
||||
function cont(param, titleStr, key, svgStr) {
|
||||
return <React.Fragment>
|
||||
<div className="item-head-title">
|
||||
<div className="item-head-title-content">
|
||||
<i className={svgStr}></i>
|
||||
<span>{titleStr}</span>
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="item-head-title">
|
||||
<div className="item-head-title-content">
|
||||
<i className={svgStr}></i>
|
||||
<span>{titleStr}</span>
|
||||
</div>
|
||||
{param.length === 5 && <span className="link" onClick={() => { handleClick({ key: key }) }}>查看更多 <Icon type="arrow-right" /></span>}
|
||||
</div>
|
||||
{param.length === 5 && <span className="link" onClick={() => { handleClick({ key: key }) }}>查看更多 <Icon type="arrow-right" /></span>}
|
||||
</div>
|
||||
{param.length > 0 ? <ItemList
|
||||
list={param}
|
||||
itemClick={noticeClick}
|
||||
/> : <Nodata _html="暂无数据" />}
|
||||
</React.Fragment>
|
||||
{param.length > 0 ? <ItemList list={param} itemClick={noticeClick} /> : <Nodata _html="暂无数据" />}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
// 成果库具体jsx渲染函数
|
||||
// @@@ 右侧 下方
|
||||
function content() {
|
||||
if (tab === '0') {
|
||||
// @@@ 如果选中“成果来源” 默认选项 右侧显示逻辑
|
||||
if(callList.length === 0 && changeList.length === 0 && competitionList.length === 0 && checkList.length === 0 && abandonList.length === 0){
|
||||
return <React.Fragment><Nodata _html="暂无数据" /></React.Fragment>
|
||||
}else{
|
||||
|
|
@ -150,6 +158,7 @@ export default (props) => {
|
|||
</React.Fragment>
|
||||
}
|
||||
} else {
|
||||
// @@@ 如果选中除“成果来源” 外其他选项 右侧显示逻辑
|
||||
let titleStr;
|
||||
let svgStr;
|
||||
switch (tab) {
|
||||
|
|
@ -198,6 +207,7 @@ export default (props) => {
|
|||
}
|
||||
}
|
||||
|
||||
// @@@ 【成果列表】整体(包含:左侧 右侧 )的主界面DOM
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="centerbox notice-list clearfix">
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default (props) => {
|
|||
</div>
|
||||
</div>
|
||||
{showChart && <AchivChart />}
|
||||
{showList1 && < NoticeList />}
|
||||
{showList1 && <NoticeList {...props} />}
|
||||
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue