|
|
@@ -23,6 +23,7 @@ import { baseURL } from "@/utils/http";
|
|
|
|
|
|
import { forwardRef, useImperativeHandle } from "react";
|
|
|
// import { A1_APIupFile } from "@/store/action/A1Plate";
|
|
|
+import { A1_APIupFile } from "@/store/action/A4Prise";
|
|
|
|
|
|
type Props = {
|
|
|
check: boolean; //表单校验,为fasle表示不校验
|
|
|
@@ -120,26 +121,26 @@ function RichText({ check, dirCode, isLook, myUrl }: Props, ref: any) {
|
|
|
e.target.value = "";
|
|
|
|
|
|
try {
|
|
|
- // const res = await A1_APIupFile(fd, myUrl);
|
|
|
- // if (res.code === 0) {
|
|
|
- // MessageFu.success("上传成功!");
|
|
|
- // // 在光标位置插入图片
|
|
|
- // const newTxt = ContentUtils.insertMedias(editorValue, [
|
|
|
- // {
|
|
|
- // type: "IMAGE",
|
|
|
- // url: baseURL + res.data.filePath,
|
|
|
- // },
|
|
|
- // ]);
|
|
|
-
|
|
|
- // setEditorValue(newTxt);
|
|
|
- // }
|
|
|
+ const res = await A1_APIupFile(fd, myUrl);
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success("上传成功!");
|
|
|
+ // 在光标位置插入图片
|
|
|
+ const newTxt = ContentUtils.insertMedias(editorValue, [
|
|
|
+ {
|
|
|
+ type: "IMAGE",
|
|
|
+ url: baseURL + res.data.filePath,
|
|
|
+ },
|
|
|
+ ]);
|
|
|
+
|
|
|
+ setEditorValue(newTxt);
|
|
|
+ }
|
|
|
fileDomInitialFu();
|
|
|
} catch (error) {
|
|
|
fileDomInitialFu();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- [dirCode]
|
|
|
+ [dirCode, editorValue, myUrl]
|
|
|
);
|
|
|
|
|
|
// 让父组件调用的 回显 富文本
|