| | |
| | | |
| | | loadData = () => { |
| | | const { id } = this.props.match.params; |
| | | console.log(this.props) |
| | | console.log(id) |
| | | let _this = this; |
| | | _this.setState({ |
| | | loading: true, |
| | |
| | | id: id || 'new' |
| | | } |
| | | }).then(res => { |
| | | console.log(res) |
| | | if (res) { |
| | | _this.setState({ |
| | | saveData: { |
| | | ...res, |
| | |
| | | loading: false, |
| | | fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix, })) || [] |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | submit = () => { |
| | | let { saveData, editorContent } = this.state; |
| | | // editorContent = emoveTAG(editorContent); |
| | | console.log(saveData) |
| | | if (!saveData.documentTitle) { |
| | | return message.warning(this.switchWordByType(saveData.documentType).title + '标题不能为空'); |
| | | } |
| | |
| | | documentContent: editorContent |
| | | } |
| | | }).then(res => { |
| | | console.log(res) |
| | | _this.setState({ |
| | | iconLoading: false, |
| | | }); |
| | | if (res) { |
| | | message.success("提交成功!"); |
| | | this.props.history.push(this.switchWordByType(saveData.documentType).href); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | handleChange = (editorState) => { |
| | | console.log(editorState, editorState.toHTML()) |
| | | console.log('htnl', editorState.toHTML()) |
| | | this.setState({ editorState, editorContent: editorState.toHTML() }) |
| | | } |
| | | |