shaogen1995 2 лет назад
Родитель
Сommit
da4b2afc71

+ 6 - 2
houtai/src/components/VideoLookDom/index.tsx

@@ -5,7 +5,9 @@ import { useSelector } from "react-redux";
 import store, { RootState } from "@/store";
 import { baseURL } from "@/utils/http";
 function VideoLookDom() {
-  const videoSrc = useSelector((state: RootState) => state.layoutStore.videoSrc);
+  const videoSrc = useSelector(
+    (state: RootState) => state.layoutStore.videoSrc
+  );
   return (
     <div
       className={styles.VideoLookDom}
@@ -19,7 +21,9 @@ function VideoLookDom() {
 
       <div
         className="close"
-        onClick={() => store.dispatch({ type: "layout/lookVideo", payload: "" })}
+        onClick={() =>
+          store.dispatch({ type: "layout/lookVideo", payload: "" })
+        }
       >
         <CloseCircleOutlined />
       </div>

+ 4 - 4
houtai/src/pages/A3Goods/GoodsAdd/index.tsx

@@ -1,5 +1,5 @@
 import store, { RootState } from "@/store";
-import { Button, Checkbox, Form, Input, Popconfirm, Select } from "antd";
+import { Button, Checkbox, Form, FormInstance, Input, Popconfirm, Select } from "antd";
 import React, {
   useCallback,
   useEffect,
@@ -46,14 +46,14 @@ function GoodsAdd({ id, closeMoalFu, addListFu, editListFu }: Props) {
   });
 
   // 表单的ref
-  const FormBoxRef = useRef<any>({});
+  const FormBoxRef = useRef<FormInstance>(null);
 
   // 文件的dirCode码
   const [dirCode, setDirCode] = useState("");
 
   const getInfoInAPIFu = useCallback(async (id: number) => {
     const res = await getGoodsInfoByIdAPI(id);
-    FormBoxRef.current.setFieldsValue(res.data.entity);
+    FormBoxRef.current?.setFieldsValue(res.data.entity);
     setCover(res.data.entity.thumb);
 
     if (res.data.entity.type) setTypeCheck(res.data.entity.type.split(","));
@@ -78,7 +78,7 @@ function GoodsAdd({ id, closeMoalFu, addListFu, editListFu }: Props) {
     if (id > 0) getInfoInAPIFu(id);
     else {
       setDirCode(Date.now() + "");
-      FormBoxRef.current.setFieldsValue({
+      FormBoxRef.current?.setFieldsValue({
         display: 1,
       });
     }