|
|
|
@ -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( $('<meta content="authenticity_token" name="csrf-param" />') )
|
|
|
|
|
$('head').append( $(`<meta content="${response.data.csrf_token}" name="csrf-token" />`) )
|
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
|
<div className="df">
|
|
|
|
|
<span className="mr30 color-orange pt10">*</span>
|
|
|
|
|
<div className="flex1 mr20">
|
|
|
|
|
{
|
|
|
|
|
forums.length>0
|
|
|
|
|
}
|
|
|
|
|
<Select className="ecSelect" value={typeNameMap2[memoType]}
|
|
|
|
|
onChange={(val)=>this.onTypeChange(val)}>
|
|
|
|
|
<Option value="技术分享">技术分享</Option>
|
|
|
|
|
<Option value="操作指南">操作指南</Option>
|
|
|
|
|
<Option value="通知公告">通知公告</Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{width: '57px'}}>
|
|
|
|
|