|
@@ -7,7 +7,7 @@ import { RootState } from "@/store";
|
|
|
import UpFileOne from "@/components/Z_upFileOne";
|
|
|
import { B2_APIgetInfo, B2_APIsave } from "@/store/action/B2Goods";
|
|
|
import { MessageFu } from "@/utils/message";
|
|
|
-import RichText from "@/components/Z_RicjText";
|
|
|
+import RichText from "@/components/Z_RichText";
|
|
|
import TextArea from "antd/es/input/TextArea";
|
|
|
|
|
|
type Props = {
|
|
@@ -26,8 +26,10 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
FormBoxRef.current?.setFieldsValue(res.data);
|
|
|
setCover(res.data.thumb);
|
|
|
|
|
|
+ setDirCode(res.data.id);
|
|
|
+
|
|
|
// 调用富文本子组件的函数,回显数据
|
|
|
- ricjTxtRef.current.ritxtShowFu(res.data.content);
|
|
|
+ richTxtRef.current.ritxtShowFu(res.data.content);
|
|
|
}
|
|
|
}, []);
|
|
|
|
|
@@ -37,6 +39,8 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
useEffect(() => {
|
|
|
if (editId > 0) getInfoFu(editId);
|
|
|
else {
|
|
|
+ setDirCode(Date.now() + "");
|
|
|
+
|
|
|
FormBoxRef.current?.setFieldsValue({
|
|
|
type: myType,
|
|
|
});
|
|
@@ -66,7 +70,7 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
if (!cover) return;
|
|
|
|
|
|
// 富文本 为空
|
|
|
- const { val, flag } = ricjTxtRef.current.fatherBtnOkFu();
|
|
|
+ const { val, flag } = richTxtRef.current.fatherBtnOkFu();
|
|
|
|
|
|
if (flag) return;
|
|
|
|
|
@@ -89,7 +93,10 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
);
|
|
|
|
|
|
// 富文本的ref
|
|
|
- const ricjTxtRef = useRef<any>(null);
|
|
|
+ const richTxtRef = useRef<any>(null);
|
|
|
+
|
|
|
+ // 文件的code码
|
|
|
+ const [dirCode, setDirCode] = useState("");
|
|
|
|
|
|
return (
|
|
|
<div className={styles.B2Edit}>
|
|
@@ -138,9 +145,10 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
</div>
|
|
|
<div className="e_rowR">
|
|
|
<RichText
|
|
|
- ref={ricjTxtRef}
|
|
|
+ myUrl="cms/goods/upload"
|
|
|
+ ref={richTxtRef}
|
|
|
check={check}
|
|
|
- dirCode="myGoods"
|
|
|
+ dirCode={dirCode}
|
|
|
isLook={isLook}
|
|
|
/>
|
|
|
</div>
|
|
@@ -158,7 +166,7 @@ function B2Edit({ editId, isLook, closeFu, editFu, addFu, myType }: Props) {
|
|
|
isLook={isLook}
|
|
|
coverCheck={check}
|
|
|
size={5}
|
|
|
- dirCode={"myGoods"}
|
|
|
+ dirCode={dirCode}
|
|
|
checkTxt="请上传图片!"
|
|
|
/>
|
|
|
</div>
|