|
@@ -1,13 +1,55 @@
|
|
|
-import React from "react";
|
|
|
+import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
|
import styles from "./index.module.scss";
|
|
|
import { Button } from "antd";
|
|
|
+import { useDispatch, useSelector } from "react-redux";
|
|
|
+import { A1_APIgetInfo } from "@/store/action/A1outline";
|
|
|
+import ZRichText from "@/components/ZRichText";
|
|
|
+import { RootState } from "@/store";
|
|
|
+
|
|
|
function A1outline() {
|
|
|
+ // 富文本的ref
|
|
|
+ const ZRichTextRef = useRef<any>(null);
|
|
|
+
|
|
|
+ const dispatch = useDispatch();
|
|
|
+
|
|
|
+ const getInfoFu = useCallback(() => {
|
|
|
+ dispatch(A1_APIgetInfo());
|
|
|
+ }, [dispatch]);
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ getInfoFu();
|
|
|
+ }, [getInfoFu]);
|
|
|
+
|
|
|
+ const text = useSelector((state: RootState) => state.A1outline.data);
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ ZRichTextRef.current?.ritxtShowFu(text);
|
|
|
+ }, [text]);
|
|
|
+
|
|
|
+ // 是否是查看
|
|
|
+ const [isEdit, setIsEdit] = useState(true);
|
|
|
+
|
|
|
+ // 点击确定
|
|
|
+ const btnOkFu = useCallback(() => {
|
|
|
+ const rtf = ZRichTextRef.current?.fatherBtnOkFu();
|
|
|
+ }, []);
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.A1outline}>
|
|
|
<div className="pageTitle">概述管理</div>
|
|
|
<div className="A1top">
|
|
|
<Button type="primary">编辑</Button>
|
|
|
</div>
|
|
|
+ <div className="A1main">
|
|
|
+ <ZRichText
|
|
|
+ check={false}
|
|
|
+ dirCode="A1outline"
|
|
|
+ isLook={isEdit}
|
|
|
+ ref={ZRichTextRef}
|
|
|
+ myUrl="cms/intro/upload"
|
|
|
+ full={true}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
}
|