解决无法跳转到成果详情页面

This commit is contained in:
zhangxiaozhuozhuo 2023-11-20 14:55:44 +08:00
parent 0e5e1e0e88
commit 6088c0f6e1
4 changed files with 43 additions and 21 deletions

View File

@ -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>
);

View File

@ -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>
)

View File

@ -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">

View File

@ -40,7 +40,7 @@ export default (props) => {
</div>
</div>
{showChart && <AchivChart />}
{showList1 && < NoticeList />}
{showList1 && <NoticeList {...props} />}
</React.Fragment>
)