From 04bc9b9a158072e6fc217425ee7389bc3ee133c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Sep 2019 10:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/forums/MemoNew.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/forums/MemoNew.js b/public/react/src/modules/forums/MemoNew.js index 2f6eb196d..4b3fd6550 100644 --- a/public/react/src/modules/forums/MemoNew.js +++ b/public/react/src/modules/forums/MemoNew.js @@ -119,11 +119,13 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback){ const typeNameMap = { '技术分享': 5, - '操作指南': 3, + '操作指南': 3, + '通知公告':16, } export const typeNameMap2 = { 5: '技术分享', - 3: '操作指南', + 3: '操作指南', + 16: '通知公告', } const defaultType = '技术分享' @@ -171,7 +173,8 @@ class MemoNew extends Component { currentSelectRepertoiresIndex: -1, repertoiresTagMap: {}, - fileList: [] + fileList: [], + forums:[{id:5,name:"技术分享"},{id:3,name:"技术指南"},{id:16,name:"通知公告"}], } } onCommit() { @@ -336,6 +339,13 @@ class MemoNew extends Component { $('head').append( $('') ) $('head').append( $(``) ) } + if(data.forums){ + this.setState({ + forums: data.forums===undefined||data.forums===null||data.forums.length===0? this.state.forums:data.forums + // repertoires, + // repertoiresTagMap + }) + } }).catch((error) => { console.log(error) }) @@ -607,7 +617,7 @@ class MemoNew extends Component { }); } render() { - const { match, history } = this.props + const { match, history,forums } = this.props const { // repertoires, repertoiresTagMap, currentSelectRepertoiresIndex, memoRepertoire, tag_list, @@ -750,10 +760,14 @@ class MemoNew extends Component {