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