From 5fa0d547afd6f56f604c2809d40e351f877dbba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 11 Nov 2022 14:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.css | 3 +- src/forge/Component/SiderBar.js | 3 +- src/forge/Main/Index.js | 95 +++++++++++++--------------- src/forge/Main/IndexItem.js | 2 +- src/forge/Main/projecthome/Index.jsx | 25 +++----- src/forge/css/index.scss | 1 + 6 files changed, 59 insertions(+), 70 deletions(-) diff --git a/src/App.css b/src/App.css index fcf5cb956..090ef43dc 100644 --- a/src/App.css +++ b/src/App.css @@ -72,7 +72,8 @@ body { .markdown-body p { margin:10px 0px!important; font-size: 16px !important; - white-space: pre-wrap; + /* 用户提出多个徽章换行显示,p标签会换行显示 */ + /* white-space: pre-wrap; */ } .markdown-body>p { diff --git a/src/forge/Component/SiderBar.js b/src/forge/Component/SiderBar.js index c0cae2ce2..61e6f85e3 100644 --- a/src/forge/Component/SiderBar.js +++ b/src/forge/Component/SiderBar.js @@ -36,7 +36,8 @@ function SiderBar(props) { //页面加载完成之后隐藏回到顶点 $(".-task-sidebar .gotop").hide(); // 意见反馈弹窗 - if(search && search.indexOf('feedback') !== -1){ + if(search && search.indexOf('feedback') !== -1 && search.indexOf('type=feedback') === -1){ + // 用户已经在issue中反馈,刷新页面不弹出意见反馈 setFeedBackModal(true) } },[]) diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index c76f3858a..4ac20e426 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -19,11 +19,12 @@ const Search = Input.Search; class Index extends Component { constructor(props) { super(props); + const searchParams = new URLSearchParams(props.location.search.substring(1)); this.state = { projectsList: undefined, page: 1, limit: 15, - search: undefined, + search: searchParams.get('search'), sort: undefined, total: 0, isSpin: true, @@ -125,47 +126,29 @@ class Index extends Component { const url = `/projects/group_type_list.json`; axios.get(url).then((result) => { if (result && result.data) { - this.setTypeList(result.data, undefined) + this.setState({ + typeList: result.data + }) } }).catch((error) => { }) } - setTypeList = (list, active_type) => { - this.setState({ - typeList: list.map((item, key) => { - return ( -
- {item.name} - {item.projects_count} -
-