chenlei 2 ay önce
ebeveyn
işleme
4126ee5376

+ 1 - 1
package.json

@@ -84,7 +84,7 @@
     "workbox-webpack-plugin": "^6.4.1"
   },
   "scripts": {
-    "start": "cross-env REACT_APP_API_URL=http://192.168.20.61:8090 REACT_APP_IMG_PUBLIC=/api node scripts/start.js",
+    "start": "cross-env REACT_APP_API_URL=https://sit-shoubodyh.4dage.com REACT_APP_IMG_PUBLIC=/api node scripts/start.js",
     "build": "cross-env PUBLIC_URL=./ REACT_APP_API_URL=https://sit-shoubodyh.4dage.com REACT_APP_IMG_PUBLIC= node scripts/build.js",
     "build:prod": "cross-env PUBLIC_URL=./ REACT_APP_API_URL=http://192.124.82.43:8091 REACT_APP_IMG_PUBLIC= node scripts/build.js"
   },

+ 5 - 3
src/pages/Assessment/Index/components/Sidebar/index.tsx

@@ -1,5 +1,5 @@
 import { FC, useEffect, useRef, useState } from "react";
-import { Button } from "antd";
+import { Button, Empty } from "antd";
 import { useNavigate } from "react-router-dom";
 import {
   DageLoading,
@@ -41,7 +41,7 @@ export const Sidebar: FC<SidebarProps> = ({
       // @ts-ignore
       item.hideAddBtn = item.isPoint === YES_OR_NO.YES;
       // @ts-ignore
-      item.hideDeleteBtn = Boolean(item.children.length);
+      item.hideDeleteBtn = Boolean(item.children?.length);
 
       if (item.children && item.children.length > 0) {
         item.children = transformTreeData(item.children);
@@ -108,7 +108,7 @@ export const Sidebar: FC<SidebarProps> = ({
         )}
       </div>
 
-      {currentId && treeData.length && (
+      {currentId && treeData.length ? (
         <DageTreeActions
           defaultExpandAll
           maxLevel={isFixed ? 5 : 2}
@@ -127,6 +127,8 @@ export const Sidebar: FC<SidebarProps> = ({
             lastCheckedItem.current = selectedNodes[0];
           }}
         />
+      ) : (
+        <Empty />
       )}
 
       {loading && <DageLoading />}

+ 16 - 1
src/pages/Management/Files/index.tsx

@@ -7,6 +7,8 @@ import { debounce } from "lodash";
 import { changeArchiveApi, getManageFileListAPi } from "@/api";
 import { ARCHIVE_TYPE_MAP } from "@/constants";
 import { ARCHIVE_TYPE } from "@/types";
+import { downloadFile } from "@/utils";
+import { getBaseURL } from "@dage/service";
 
 const DEFAULT_PARAMS = {
   pageNum: 1,
@@ -23,6 +25,7 @@ const ManagementReportPage = () => {
   const [loading, setLoading] = useState(false);
   const [total, setTotal] = useState(0);
   const [list, setList] = useState<[]>([]);
+  const baseUrl = getBaseURL();
 
   const debounceSearch = useMemo(
     () =>
@@ -176,7 +179,19 @@ const ManagementReportPage = () => {
 
                 return (
                   <>
-                    <Button type="link">下载</Button>
+                    <Button
+                      type="link"
+                      onClick={() =>
+                        downloadFile(
+                          baseUrl +
+                            process.env.REACT_APP_IMG_PUBLIC +
+                            item.filePath,
+                          item.fileName
+                        )
+                      }
+                    >
+                      下载
+                    </Button>
                     <Button
                       type="link"
                       danger={isArchived}

+ 1 - 1
src/pages/Performance/Report/index.tsx

@@ -36,7 +36,7 @@ const ManagementReportPage = () => {
             <Button
               key={tab.value}
               type="primary"
-              ghost={tab.value === type}
+              ghost={tab.value !== type}
               size="large"
               onClick={() => {
                 setType(tab.value);