shaogen1995 1 ano atrás
pai
commit
e78ece239f

+ 2 - 2
src/components/Z1upImgs/index.tsx

@@ -55,7 +55,7 @@ function Z1upImgs(
   const [fileList, setFileList] = useState<FileImgListType[]>([]);
 
   useEffect(() => {
-    if (lookData) setFileList(lookData);
+    if (lookData&&lookData.length>0) setFileList(lookData);
   }, [lookData]);
 
   const myInput = useRef<HTMLInputElement>(null);
@@ -118,7 +118,7 @@ function Z1upImgs(
 
   // 让父组件调用,拿到 附件信息
   const imgIdsRes = useCallback(() => {
-    return fileList.map((v) => v.id).join(",");
+    return fileList.map((v) => v.id);
   }, [fileList]);
 
   // 可以让父组件调用子组件的方法

+ 2 - 2
src/components/Z2upVideos/index.tsx

@@ -49,7 +49,7 @@ function Z2upVideos(
   const [fileList, setFileList] = useState<FileImgListType[]>([]);
 
   useEffect(() => {
-    if (lookData) setFileList(lookData);
+    if (lookData&&lookData.length>0) setFileList(lookData);
   }, [lookData]);
 
   const myInput = useRef<HTMLInputElement>(null);
@@ -112,7 +112,7 @@ function Z2upVideos(
 
   // 让父组件调用,拿到 附件信息
   const videoIdsRes = useCallback(() => {
-    return fileList.map((v) => v.id).join(",");
+    return fileList.map((v) => v.id);
   }, [fileList]);
 
   // 可以让父组件调用子组件的方法

+ 3 - 2
src/components/Z3upFiles/index.tsx

@@ -34,7 +34,8 @@ function Z3upFiles(
   const [fileList, setFileList] = useState<FileImgListType[]>([]);
 
   useEffect(() => {
-    if (lookData) setFileList(lookData);
+    if (lookData&&lookData.length>0) setFileList(lookData);
+    
   }, [lookData]);
 
   const myInput = useRef<HTMLInputElement>(null);
@@ -86,7 +87,7 @@ function Z3upFiles(
 
   // 让父组件调用,拿到 附件信息
   const filesIdRes = useCallback(() => {
-    return fileList.map((v) => v.id).join(",");
+    return fileList.map((v) => v.id);
   }, [fileList]);
 
   // 可以让父组件调用子组件的方法

+ 6 - 7
src/pages/A1Project/A1Add/index.tsx

@@ -67,7 +67,7 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
       FormBoxRef.current?.setFieldsValue({
         ...info,
         province,
-        dateScope: [dayjs(dateScope[0]), dayjs(dateScope[1])],
+        dateScope: dateScope ? [dayjs(dateScope[0]), dayjs(dateScope[1])] : "",
       });
 
       // 回显的时候闪动 问题
@@ -163,10 +163,9 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
       // 项目成果
       const filesRes = filesRef.current.filesIdRes();
 
-      const fileIds =
-        imgsRes +
-        (videosRes ? `,${videosRes}` : "") +
-        (filesRes ? `,${filesRes}` : "");
+      const fileIdsArr = [...imgsRes, ...videosRes, ...filesRes];
+
+      const fileIds = fileIdsArr.join(",");
 
       const obj = {
         ...value,
@@ -174,7 +173,7 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
         dateScope,
         fileIds,
         linkJson: JSON.stringify(linkArr),
-        amount:value.amount?value.amount:'',
+        amount: value.amount ? value.amount : "",
         province,
         dirCode,
       };
@@ -324,7 +323,7 @@ function A1Add({ pageType, closeFu, addFu, editFu }: Props) {
                 <div className="e_rowR e_rowRLook">
                   {isOk
                     ? lookInfo.amount
-                      ?"¥"+ lookInfo.amount
+                      ? "¥" + lookInfo.amount
                       : "(空)"
                     : ""}
                 </div>

+ 2 - 2
src/pages/A1Project/A1Outer/A1OMove/index.tsx

@@ -42,8 +42,8 @@ function A1OMove({ mId, id1, id2, closeFu, projectId, moveSuFu }: Props) {
       const res = await A1_APIOgetListMove(projectId, id);
 
       if (res.code === 0) {
-        
-        setTableInfo(res.data.records);
+        const data:A1OFileType[] =res.data.records
+        setTableInfo(data.filter(v=>v.type===1));
       }
     },
     [projectId]