From 6088c0f6e10dbd7efbad3f92bec62af956d1ae33 Mon Sep 17 00:00:00 2001 From: zhangxiaozhuozhuo <7658685+zhangxiaozhuozhuo@user.noreply.gitee.com> Date: Mon, 20 Nov 2023 14:55:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A0=E6=B3=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E6=88=90=E6=9E=9C=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/military/achievement.js | 13 +++---- .../achievement/components/itemList/index.jsx | 15 ++++++-- src/military/achievement/noticeList/index.jsx | 34 ++++++++++++------- src/military/achievement/overview/index.jsx | 2 +- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/military/achievement.js b/src/military/achievement.js index c8929bcaf..5b8f84710 100644 --- a/src/military/achievement.js +++ b/src/military/achievement.js @@ -60,12 +60,13 @@ class Index extends Component { )} > - ( - - )} - > + ( + + )} + > + ); diff --git a/src/military/achievement/components/itemList/index.jsx b/src/military/achievement/components/itemList/index.jsx index f6cabb36e..0ab7bcad2 100644 --- a/src/military/achievement/components/itemList/index.jsx +++ b/src/military/achievement/components/itemList/index.jsx @@ -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>/g, ''); + } else { + cleanedText = ''; + } + console.log('@@@',item.id); + return (

-
{ itemClick(item.id) }}> +
{ + console.log('###点击了:'+item.id) + itemClick(item.id) + }}> {item.achievementName || item.title} {item.new && }
@@ -19,7 +30,7 @@ export default (props) => {

{item.visits || 0}

-

摘要:{item.text && item.text.substring(3, item.text.length-4)}

+

摘要:{cleanedText}

) diff --git a/src/military/achievement/noticeList/index.jsx b/src/military/achievement/noticeList/index.jsx index 6d298658a..f95a0d011 100644 --- a/src/military/achievement/noticeList/index.jsx +++ b/src/military/achievement/noticeList/index.jsx @@ -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
{
} + // @@@ 查看更多 跳转逻辑 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 -
-
- - {titleStr} + return ( + +
+
+ + {titleStr} +
+ {param.length === 5 && { handleClick({ key: key }) }}>查看更多 }
- {param.length === 5 && { handleClick({ key: key }) }}>查看更多 } -
- {param.length > 0 ? : } - + {param.length > 0 ? : } + + ) } // 成果库具体jsx渲染函数 + // @@@ 右侧 下方 function content() { if (tab === '0') { + // @@@ 如果选中“成果来源” 默认选项 右侧显示逻辑 if(callList.length === 0 && changeList.length === 0 && competitionList.length === 0 && checkList.length === 0 && abandonList.length === 0){ return }else{ @@ -150,6 +158,7 @@ export default (props) => { } } else { + // @@@ 如果选中除“成果来源” 外其他选项 右侧显示逻辑 let titleStr; let svgStr; switch (tab) { @@ -198,6 +207,7 @@ export default (props) => { } } + // @@@ 【成果列表】整体(包含:左侧 右侧 )的主界面DOM return (
diff --git a/src/military/achievement/overview/index.jsx b/src/military/achievement/overview/index.jsx index 27c8ccee1..5536c0030 100644 --- a/src/military/achievement/overview/index.jsx +++ b/src/military/achievement/overview/index.jsx @@ -40,7 +40,7 @@ export default (props) => {
{showChart && } - {showList1 && < NoticeList />} + {showList1 && }
)