7.5 wangeditor

This commit is contained in:
jl-zhoujl2
2022-07-05 21:57:38 +08:00
parent fc9e58fd1e
commit 93fc1e3e44
3 changed files with 42 additions and 2 deletions

View File

@ -36,6 +36,11 @@ export default [
path: '/Calendar',
component: './MainPage/ProjectManager/components/CalendarForm',
},
//富文本组件
{
path: '/editor',
component: './MainPage/ProjectManager/components/WangEditor',
},
//401错误页
{
exact: true,
@ -243,7 +248,7 @@ export default [
path: '/Supervision',
component: './Project/ProjectManage/Supervision'
},
{//审查人员 项目管理页
{//审查人员 项目管理页
name: 'Examination',
path: '/Examination',
component: './Project/ProjectManage/Examination'

View File

@ -46,7 +46,7 @@ const BraftText: React.FC<WangType> = (props) => {
'fullscreen', //全屏
// 'emoticon',//表情
// 'image',//图片
'image',//图片
// 'video',//视频
// 'table',//表格
// 'todo',//待办

View File

@ -0,0 +1,35 @@
import React, { useRef, useState } from 'react';
import { Button, Typography } from 'antd';
import BraftText from '@/components/richText/wang';
import ProCard from '@ant-design/pro-card';
import { isEmpty } from '@/utils/CommonUtils';
const Editor: React.FC<{}> = () => {
const braftRef = useRef<any>(null);
const [text, setText] = useState();
const { Text, Paragraph } = Typography;
return (
<ProCard
split={'vertical'}
bordered
headerBordered
>
<ProCard title="文本域" colSpan="50%" extra={<Button type='primary' onClick={() => setText(braftRef.current?.getHtml())}></Button>}>
<BraftText braftRef={braftRef} echo={''} disabled={false} height={600} />
</ProCard>
<ProCard title="代码段">
{isEmpty(text) ? '没有' : (
<Paragraph>
<pre>
<Text copyable>
{text}
</Text>
</pre>
</Paragraph>
)}
</ProCard>
</ProCard>
);
};
export default Editor;