公告 富文本 完结
This commit is contained in:
parent
0e5397da87
commit
ab36d5d2df
@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Form } from 'antd'
|
import { Form, Col } from 'antd'
|
||||||
import { extendInclude, extendRule, initFilter } from "../../utils/common";
|
import { extendInclude, extendRule, initFilter } from "../../utils/common";
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import BraftEditor from 'braft-editor';
|
import BraftEditor from 'braft-editor';
|
||||||
@ -8,10 +8,6 @@ import 'braft-editor/dist/index.css';
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function ContentChange() {
|
|
||||||
var ccc = this;
|
|
||||||
debugger
|
|
||||||
}
|
|
||||||
export default {
|
export default {
|
||||||
onBeforeEdit: ({ isNew, setFieldValue, stateData, setFieldVisible }) => {
|
onBeforeEdit: ({ isNew, setFieldValue, stateData, setFieldVisible }) => {
|
||||||
if (stateData.ORG_ID != "00300000-0000-0000-0000-000000000000") {
|
if (stateData.ORG_ID != "00300000-0000-0000-0000-000000000000") {
|
||||||
@ -25,21 +21,29 @@ export default {
|
|||||||
handleRenderHeadControl(params) {
|
handleRenderHeadControl(params) {
|
||||||
if (params.colConfig.field == 'CONTENT') {
|
if (params.colConfig.field == 'CONTENT') {
|
||||||
const initialEditorState = BraftEditor.createEditorState(params.record.CONTENT || '');
|
const initialEditorState = BraftEditor.createEditorState(params.record.CONTENT || '');
|
||||||
|
const formItemLayout = {
|
||||||
|
labelCol: { span: 24 },
|
||||||
|
wrapperCol: { span: 24 }
|
||||||
|
};
|
||||||
|
const customOrResponse = {
|
||||||
|
lg: 24, xxl: 24
|
||||||
|
}
|
||||||
return <>
|
return <>
|
||||||
{/* 自定义表单控件 */}
|
<Col key={params.colConfig.field} {...customOrResponse}>
|
||||||
{/* <Form.Item> */}
|
<Form.Item {...formItemLayout} label="正文" >
|
||||||
<BraftEditor style={{ border: "2px solid red", width: "95%" }}
|
<BraftEditor style={{ border: "1px solid #d9d9d9", width: "98%" }}
|
||||||
value={initialEditorState}
|
contentStyle={{ zIndex: 'auto' }}
|
||||||
onBlur={(editorState) => {
|
value={initialEditorState}
|
||||||
const htmlContent = editorState.toHTML();
|
onBlur={(editorState) => {
|
||||||
if (params.record.CONTENT != htmlContent) {
|
const htmlContent = editorState.toHTML();
|
||||||
params.setFieldValue('CONTENT', htmlContent);
|
if (params.record.CONTENT != htmlContent) {
|
||||||
// params.setState('CONTENT', htmlContent);
|
params.setFieldValue('CONTENT', htmlContent);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
placeholder="请输入正文..."
|
placeholder="请输入正文..."
|
||||||
/>
|
/>
|
||||||
{/* </Form.Item> */}
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user