Renxy пре 2 година
родитељ
комит
b7b89b0241
2 измењених фајлова са 2 додато и 15 уклоњено
  1. 2 3
      src/components/FileViewer/index.js
  2. 0 12
      src/pages/Detail/FormAndFilesNode.js

+ 2 - 3
src/components/FileViewer/index.js

@@ -4,7 +4,6 @@ import { memo } from 'react';
 
 const FileViewerModal = ({ data, visible, onCancel, downloadFile }) => {
   const type = data?.url?.split('.')[data?.url?.split('.').length - 1];
-  console.log(data?.url, type, visible);
 
   return (
     <Modal
@@ -16,7 +15,7 @@ const FileViewerModal = ({ data, visible, onCancel, downloadFile }) => {
       onOk={onCancel}
       bodyStyle={{ height: '680px', overflowY: 'hidden' }}
     >
-      {/* {data?.url && (
+      {data?.url && (
         <FileViewer
           key={data?.name}
           fileType={type}
@@ -30,7 +29,7 @@ const FileViewerModal = ({ data, visible, onCancel, downloadFile }) => {
             </div>
           )}
         />
-      )} */}
+      )}
     </Modal>
   );
 };

+ 0 - 12
src/pages/Detail/FormAndFilesNode.js

@@ -69,9 +69,6 @@ const FormAndFilesNode = ({ title, formData, excelFileData, loading, downloadFil
       ),
     },
   ];
-  const type = useMemo(() => {
-    return exportData?.url?.split('.')[exportData?.url?.split('.').length - 1];
-  }, [exportData]);
   return (
     <>
       {excelFileData && formData && (
@@ -84,15 +81,6 @@ const FormAndFilesNode = ({ title, formData, excelFileData, loading, downloadFil
           </Row>
         </Card>
       )}
-      {/* <FileViewer
-        key={exportData?.name}
-        fileType={type}
-        filePath={exportData?.url}
-        // onError={() => downloadFile(data)}
-        onError={e => console.error(e)}
-        // errorComponent={<div>文件加载错误</div>}
-        unsupportedComponent={() => <div>不支持的文件格式</div>}
-      /> */}
       <FileViewerModal
         data={exportData}
         visible={excelFileVisible}