|
|
@@ -5,6 +5,7 @@ import { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor/editor';
|
|
|
import { Editor, Toolbar } from '@wangeditor/editor-for-react';
|
|
|
import { Typography } from 'antd';
|
|
|
import { useEffect, useState } from 'react';
|
|
|
+import WordEditor from "@/components/WordEditor/WordEditor";
|
|
|
|
|
|
const editorConfig: Partial<IEditorConfig> = {
|
|
|
placeholder: '请输入内容...',
|
|
|
@@ -18,7 +19,10 @@ export function Edit() {
|
|
|
|
|
|
const [editor, setEditor] = useState<IDomEditor | null>(null);
|
|
|
|
|
|
- const [html, setHtml] = useState('');
|
|
|
+ const [isModified, setIsModified] = useState(false)
|
|
|
+ const handleValueChange = (state: boolean)=> {
|
|
|
+ setIsModified(state)
|
|
|
+ }
|
|
|
|
|
|
useEffect(() => {
|
|
|
return () => {
|
|
|
@@ -48,22 +52,12 @@ export function Edit() {
|
|
|
<div className="edit-box">
|
|
|
<div>编辑区</div>
|
|
|
<div className="edit-root">
|
|
|
- <Toolbar
|
|
|
- editor={editor}
|
|
|
- defaultConfig={toolbarConfig}
|
|
|
- mode="default"
|
|
|
- style={{ borderBottom: '1px solid #ccc' }}
|
|
|
- />
|
|
|
- <div className="edit-toolbar-box">
|
|
|
- <Editor
|
|
|
- value={html}
|
|
|
- defaultConfig={editorConfig}
|
|
|
- onCreated={setEditor}
|
|
|
- onChange={(editor) => setHtml(editor.getHtml())}
|
|
|
- mode="default"
|
|
|
- style={{ height: '300px', overflowY: 'hidden' }}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <WordEditor
|
|
|
+ onValueChange={handleValueChange}
|
|
|
+ key={"13412453353_123524534324"}
|
|
|
+ title={"13412453353_123524534324.docx"}
|
|
|
+ url={"http://eai-files.oss-cn-shanghai.aliyuncs.com/13412453353_123524534324.docx"}
|
|
|
+ ></WordEditor>
|
|
|
</div>
|
|
|
<div className="button-right">
|
|
|
<Button>只能批改</Button>
|