diff --git a/src/pages/Note/Hlexical/index.jsx b/src/pages/Note/Hlexical/index.jsx index 101021a..e21375b 100644 --- a/src/pages/Note/Hlexical/index.jsx +++ b/src/pages/Note/Hlexical/index.jsx @@ -33,6 +33,8 @@ import TableCellActionMenuPlugin from './plugins/TableActionMenuPlugin'; import ExcalidrawPlugin from "./plugins/ExcalidrawPlugin"; import TableOfContentsPlugin from "./plugins/TableOfContentsPlugin"; import ContextMenuPlugin from "./plugins/ContextMenuPlugin" +import {Spin} from "antd"; +import {useState} from "react"; function Placeholder() { return
Enter some rich text...
; } @@ -45,28 +47,35 @@ export default function Hlexical(props) { }, nodes: UsefulNodes }; + const [spinningState,setSpinningState]=useState(true) console.log("Hlexical(props):this.props.filePath:", props.filePath) if (!isEmpty(props.filePath)&&props.filePath.endsWith(".md")){ - importFile(props.filePath).then(value => { + + let promise = importFile(props.filePath); + + promise.then(value => { if (isEmpty(value)) { return } editorConfig={...editorConfig,editorState: () => $convertFromMarkdownString(value.toString(), TRANSFORMERS)} + setSpinningState(false) }).catch(error => console.error(error) ) } return ( +
{/* 富文本插件 */}
+ } placeholder={} ErrorBoundary={LexicalErrorBoundary} - /> + /> {/*黑窗口动态记录当前操作*/} {/**/} @@ -83,7 +92,7 @@ export default function Hlexical(props) { /> {/* 表格单元格操作 */} - + {/*markdown 快捷键*/} {/*图片加载*/} @@ -91,22 +100,24 @@ export default function Hlexical(props) { {/*分割线 */} - + {/*页分割线*/} {/*目录加载*/} {/*右键菜单*/} - + {/* 画图 */} - + - - + + {/*文件操作导入文件*/} {/**/}
+
+ ); } diff --git a/src/pages/Note/Hlexical/plugins/ImportFilePlugin.js b/src/pages/Note/Hlexical/plugins/ImportFilePlugin.js index b1a67b3..acd73a7 100644 --- a/src/pages/Note/Hlexical/plugins/ImportFilePlugin.js +++ b/src/pages/Note/Hlexical/plugins/ImportFilePlugin.js @@ -28,6 +28,7 @@ export default function ImportFilePlugin(props) { ); editor.setEditorState(editorState); editor.dispatchCommand(CLEAR_HISTORY_COMMAND, undefined); + props.setSpinningState(false) } }).catch(error => console.error(error) diff --git a/src/redux/tableBarItem_reducer.js b/src/redux/tableBarItem_reducer.js index d6ce8b2..aa3b55a 100644 --- a/src/redux/tableBarItem_reducer.js +++ b/src/redux/tableBarItem_reducer.js @@ -17,6 +17,7 @@ export const tableBarItemSlice = createSlice({ activeKey:"", expandedKeyList:[], leftTableOfContents:"" + // document.querySelectorAll("[data-node-key='/media/shixiaohua/homedisk/work/202402/note使用记录.lexical']")[0].setAttribute('style','background:black') }, reducers: { addTableBarItem: (state, action) => {