From 2ea56ed08b58386f0612635101b1acd51cd4a44c Mon Sep 17 00:00:00 2001 From: Mr Ke <kelq@hugeinfo.com.cn> Date: Wed, 29 Apr 2020 18:06:45 +0800 Subject: [PATCH] 浏览日志,操作日志;用户中心(个人信息);用户管理(用户中心) --- src/components/page/DocumentEditPage/index.jsx | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/page/DocumentEditPage/index.jsx b/src/components/page/DocumentEditPage/index.jsx index 65f4acf..8543d5c 100644 --- a/src/components/page/DocumentEditPage/index.jsx +++ b/src/components/page/DocumentEditPage/index.jsx @@ -42,8 +42,6 @@ loadData = () => { const { id } = this.props.match.params; - console.log(this.props) - console.log(id) let _this = this; _this.setState({ loading: true, @@ -55,15 +53,16 @@ id: id || 'new' } }).then(res => { - console.log(res) - _this.setState({ - saveData: { - ...res, - documentType: res.documentType || 'DT00002' - }, - loading: false, - fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix, })) || [] - }); + if (res) { + _this.setState({ + saveData: { + ...res, + documentType: res.documentType || 'DT00002' + }, + loading: false, + fileList: res.attachmentList && res.attachmentList.map((a) => ({ ...a, key: a.id, uid: a.id, name: a.fileName + '.' + a.suffix, })) || [] + }); + } }); } @@ -79,7 +78,6 @@ submit = () => { let { saveData, editorContent } = this.state; // editorContent = emoveTAG(editorContent); - console.log(saveData) if (!saveData.documentTitle) { return message.warning(this.switchWordByType(saveData.documentType).title + '标题不能为空'); } @@ -98,12 +96,13 @@ documentContent: editorContent } }).then(res => { - console.log(res) _this.setState({ iconLoading: false, }); - message.success("提交成功!"); - this.props.history.push(this.switchWordByType(saveData.documentType).href); + if (res) { + message.success("提交成功!"); + this.props.history.push(this.switchWordByType(saveData.documentType).href); + } }); } @@ -135,7 +134,7 @@ } handleChange = (editorState) => { - console.log(editorState, editorState.toHTML()) + console.log('htnl', editorState.toHTML()) this.setState({ editorState, editorContent: editorState.toHTML() }) } @@ -164,6 +163,7 @@ showUploadList: { showPreviewIcon: true, showDownloadIcon: false, showRemoveIcon: disabled ? false : true } }; + //指定编辑器工具栏的控件列表 const controls = ['undo', 'redo', 'separator', 'headings', 'separator', 'font-size', 'line-height', 'letter-spacing', 'separator', 'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator', 'text-indent', 'text-align', 'separator', -- Gitblit v1.8.0