From 8b1731541682853e9a55e0fa672750ddf6005b9e Mon Sep 17 00:00:00 2001
From: yunkexin <760754045@qq.com>
Date: Fri, 22 Mar 2024 09:25:48 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 src/components/MainPage/FoUserInfoShow.js |   2 +-
 src/layout/Sider.js                       |   2 -
 src/routes/Home.js                        | 163 ++++++++++++++++++++--
 src/routes/dashboard.css                  |   4 +
 4 files changed, 155 insertions(+), 16 deletions(-)
diff --git a/src/components/MainPage/FoUserInfoShow.js b/src/components/MainPage/FoUserInfoShow.js
index 130c543..12b7809 100644
--- a/src/components/MainPage/FoUserInfoShow.js
+++ b/src/components/MainPage/FoUserInfoShow.js
@@ -59,7 +59,7 @@ class FoUserInfoShow extends React.Component {
                     postName = ret[0]?.Nav_Person.Nav_Post?.NAME
                     this.setState({   //设置setState全局变量                        
                         userPhone: ret[0]?.PHONE,
-                        Department: ret[0]?.Nav_Department.NAME,
+                        Department: ret[0]?.Nav_Department?.NAME,
                         teamName: teamName,
                         postName: postName,
                     })
diff --git a/src/layout/Sider.js b/src/layout/Sider.js
index 7b09a66..775729c 100644
--- a/src/layout/Sider.js
+++ b/src/layout/Sider.js
@@ -54,7 +54,6 @@ const Sider = (props) => {
   };
   /** 子菜单路由 */
   const navToMenu = (menu) => {
-    console.log("12312312312", menu);
     props.history.push({ pathname: `/main/${menu.ID}` });
   };
 
@@ -73,7 +72,6 @@ const Sider = (props) => {
   /** 已激活菜单 */
   const [activeMenu, setActiveMenu] = useState(null);
   const handleActiveMenu = (menu) => {
-    console.log("111111");
     setActiveMenu(menu);
     navToMenu(menu);
   };
diff --git a/src/routes/Home.js b/src/routes/Home.js
index 8e2f1d3..f685d3d 100644
--- a/src/routes/Home.js
+++ b/src/routes/Home.js
@@ -23,6 +23,7 @@ import {
   Dropdown,
   Menu,
   Empty,
+  Modal
 } from "antd";
 import styles from "./dashboard.css";
 import "slick-carousel/slick/slick.css";
@@ -31,6 +32,7 @@ import echarts from "echarts";
 import config from "../config";
 import ModifyPassword from "../components/MainPage/ModifyPassword";
 import FoUserInfoShow from "../components/MainPage/FoUserInfoShow";
+import FormPage from "../components/FormPage";
 const { TabPane } = Tabs;
 const WorkBench = (props) => {
   return (
@@ -46,7 +48,7 @@ const WorkBench = (props) => {
             ? "已读"
             : "已办";
         const type = props.index == 1 || props.index == 2 ? prepare : warning;
-        
+
         return (
           
 {
               borderBottom:
                 index !== props.data.length - 1 ? "1px solid #e7e6e4" : "",
             }}
+            className="home-work-back"
+            onClick={() => {
+              props.benchCLick(item);
+            }}
           >
             
 {
     if (key == 1) {
       this.getBaseData(1, "1", 5);
+      this.setState({
+        tableKey: "1",
+      });
     } else if (key == 2) {
       this.getBaseData(1, "4", 5);
+      this.setState({
+        tableKey: "4",
+      });
     } else if (key == 3) {
       this.getBaseData(1, "2", 5);
+      this.setState({
+        tableKey: "2",
+      });
     } else {
       this.getBaseData(1, "3", 5);
+      this.setState({
+        tableKey: "3",
+      });
     }
   };
+  workClick = (e) => {
+    this.showEditModal(
+      e.SOURCE_DATA_ID,
+      e.SOURCE_FORMCODE,
+      e.ID,
+      e.NOTICE_TITLE,
+      e.CODE
+    );
+  };
+  showEditModal = (dataId, formCode, TaskID, title, taskCode) => {
+    this.props.dispatch({
+      type: "app/getDataByPost",
+      url: "BI/BIController/getVersion",
+      onComplete: (ret) => {
+        if (ret > config.version) {
+          window.localStorage.clear();
+          message.success("清除成功,即将重新加载页面", 2, () => {
+            setTimeout(() => window.location.reload(true), 500);
+          });
+        }
+      },
+    });
+    const newtmpData = {
+      data: {
+        id: dataId,
+        TaskID: TaskID,
+        onCancel: this.handleCancel,
+        taskCode: taskCode,
+        tableKey: this.state.tableKey,
+        homeReload: true,
+      },
+      formCode: formCode,
+    };
+    this.setState(
+      {
+        noticeTitle: title,
+        taskCode: taskCode,
+        tmpData: newtmpData,
+        currActivatedMenu: "",
+      },
+      () =>{
+        this.setState({
+          formVisible: true,
+        })
+      }
+      
+        
+        
+    );
+  };
+  clearData = () => {
+    let newtmpData = { ...this.state.tmpData };
+    newtmpData["data"].id = "";
+    newtmpData["data"].homeReload = false;
+    newtmpData.formCode = "";
+    this.setState({
+      formVisible: false,
+      tmpData: [], //newtmpData
+    });
+  };
+  handleCancel = () => {
+    // 退出弹窗
+    this.getBaseData(1, this.state.tableKey, 5);
+    this.clearData();
+  };
+  closeModal=()=>{
+    this.setState({
+      formVisible: false,
+    })
+  }
   getBaseData = (pagination, key, limit) => {
     const current = pagination ? pagination.current : 1;
     const json = initFilter(this.props.login.OrgId, "", "CODE", 1, current);
@@ -574,13 +666,13 @@ class Home extends React.Component {
               fontSize: "20",
             },
           },
-          color: '#ffd6b5',
+          color: "#ffd6b5",
           legend: {
             show: false,
             itemGap: 12,
             data: ["01", "02"],
           },
-  
+
           series: [
             {
               name: "Line 1",
@@ -835,7 +927,7 @@ class Home extends React.Component {
   handleUserMenuClick = (evt) => {
     switch (evt.key) {
       case "user-menu-logout":
-        handleLogout();
+        this.handleLogout();
         break;
       case "user-menu-cacheclean":
         window.localStorage.clear();
@@ -863,6 +955,19 @@ class Home extends React.Component {
         }}
         ref={this.resizeRef}
       >
+        
+          
+        
+
         
           
               
               
-                
-                
-                
-                
+                
+                
+                
+                
               
             
             
@@ -1326,7 +1447,11 @@ class Home extends React.Component {
                       }}
                     >
                       {this.state.workData.length > 0 ? (
-                        
+                        
                       ) : (
                         
                       )}
@@ -1353,7 +1478,11 @@ class Home extends React.Component {
                       }}
                     >
                       {this.state.workData.length > 0 ? (
-                        
+                        
                       ) : (
                         
                       )}
@@ -1380,7 +1509,11 @@ class Home extends React.Component {
                       }}
                     >
                       {this.state.workData.length > 0 ? (
-                        
+                        
                       ) : (
                         
                       )}
@@ -1407,7 +1540,11 @@ class Home extends React.Component {
                       }}
                     >
                       {this.state.workData.length > 0 ? (
-                        
+                        
                       ) : (
                         
                       )}
diff --git a/src/routes/dashboard.css b/src/routes/dashboard.css
index 92af254..87481e5 100644
--- a/src/routes/dashboard.css
+++ b/src/routes/dashboard.css
@@ -240,6 +240,10 @@
   font-size: 12px;
   margin-left: 5px;
 }
+:global(.home-work-back):hover {
+background-color: #eef5ff;
+cursor: pointer;
+}
 :global(.home-work-icon) {
   padding: 3px 5px;
   margin-right: 10px;