2
0

2 Коммиты 2fe84cf159 ... cbd3abadee

Автор SHA1 Сообщение Дата
  code4eat cbd3abadee 修复角色绑定bug 11 месяцев назад
  code4eat 2427f797bf 添加菜单权限的访问限制update 1 год назад

+ 10 - 30
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2024-07-22 11:04:57
+ * @LastEditTime: 2024-09-06 14:36:23
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/config.ts
@@ -76,12 +76,9 @@ export default defineConfig({
           path: '/budgetManaSystem',
           microApp: 'budgetManaSystem',
           microAppProps: {
-            autoSetLoading: true,
+            // autoSetLoading: true,
             autoCaptureError: true,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
         },
         {
           path: '/pfmBackMana',
@@ -90,9 +87,6 @@ export default defineConfig({
             autoSetLoading: true,
             autoCaptureError: true,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
         },
         {
           path: '/CostAccountingSys',
@@ -101,10 +95,14 @@ export default defineConfig({
             autoCaptureError: true,
             //loader: (loading:boolean) => <div>loading</div>,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
-          // access: 'canVisitThisApp'
+        },
+        {
+          path: '/MedicalWisdomCheckSys',
+          microApp: 'MedicalWisdomCheckSys',
+          microAppProps: {
+            autoCaptureError: true,
+            //loader: (loading:boolean) => <div>loading</div>,
+          },
         },
         {
           path: '/devServer',
@@ -113,9 +111,6 @@ export default defineConfig({
             autoCaptureError: true,
             //loader: (loading:boolean) => <div>loading</div>,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
         },
         {
           path: '/personnelManaSystem',
@@ -124,9 +119,6 @@ export default defineConfig({
             autoCaptureError: true,
             //loader: (loading:boolean) => <div>loading</div>,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
         },
         {
           path: '/nursingWorkersManaSystem',
@@ -135,9 +127,6 @@ export default defineConfig({
             autoCaptureError: true,
             //loader: (loading:boolean) => <div>loading</div>,
           },
-          wrappers: [
-            '@/wrappers/auth',
-          ],
         },
         {
           path: '/channelIndex/channelIndexOne',
@@ -160,9 +149,6 @@ export default defineConfig({
             {
               path: '/platform/sqlEditer',
               component: '@/pages/platform/sqlediter/index.tsx',
-              wrappers: [
-                '@/wrappers/auth',
-              ],
             },
             {
               path: '/platform/setting',
@@ -170,16 +156,10 @@ export default defineConfig({
                 {
                   path: '/platform/setting/userManage',
                   component: '@/pages/platform/setting/userManage/index.tsx',
-                  wrappers: [
-                    '@/wrappers/auth',
-                  ],
                 },
                 {
                   path: '/platform/setting/hospManage',
                   component: '@/pages/platform/setting/hospManage/index.tsx',
-                  wrappers: [
-                    '@/wrappers/auth',
-                  ],
                 },
                 {
                   path: '/platform/setting/menuManage',

+ 1 - 1
config/proxy.ts

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-04-09 18:07:34
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-16 13:49:57
+ * @LastEditTime: 2024-08-23 10:17:09
  * @FilePath: /KC-MiddlePlatform/config/proxy.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */

BIN
public/images/cancel_black.png


BIN
public/images/todojindo.png


Разница между файлами не показана из-за своего большого размера
+ 8 - 0
public/zhongtaiB.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 3
public/zhongtaiC.js


+ 26 - 9
src/app.tsx

@@ -206,11 +206,25 @@ const responseInterceptorsHandle = async (response: Response, options: RequestOp
       return true;
     }
   } else {
-    console.log({ _response });
-    notification.error({
-      message: '错误:',
-      description: `${_response.msg ? _response.msg : _response.message ? _response.message : _response.errorMessage}`,
-    });
+    if ((_response.msg && _response.msg.indexOf('Token') != -1)||(_response.msg && _response.msg.indexOf('token') != -1)) {
+      Modal.confirm({
+        title: '抱歉,你的登录已过期,请重新登录!',
+        okText: '确定',
+        cancelText: '取消',
+        maskClosable: false,
+        // cancelButtonProps:
+        onOk: () => {
+          logoutHandle();
+          return Promise.resolve(true);
+        },
+      });
+      return;
+    }else{
+      notification.error({
+        message: '错误:',
+        description: `${_response.msg ? _response.msg : _response.message ? _response.message : _response.errorMessage}`,
+      });
+    }
     return false;
   }
 };
@@ -344,14 +358,19 @@ export const qiankun = async () => {
         },
         {
           name: 'pfmBackMana', // 唯一 id
-          //entry: '//localhost:8001'
-          entry: '//120.27.235.181:5000/pfmManager/', // 开发
+          entry: '//localhost:8001'
+          //entry: '//120.27.235.181:5000/pfmManager/', // 开发
         },
         {
           name: 'CostAccountingSys', // 唯一 id
           entry: '//localhost:8001',
           //entry: '//120.27.235.181:5000/costAccount/', // 开发
         },
+        {
+          name: 'MedicalWisdomCheckSys', // 唯一 id
+          //entry: '//localhost:8804',
+          entry: '//120.27.235.181:5000/pfmview/', // 开发
+        },
         // {
         //   name: 'personnelManaSystem', // 唯一 id
         //   entry: '//192.168.0.118:8005'
@@ -402,8 +421,6 @@ export function patchRoutes({ routes }: { routes: any }) {
           component: require('@/pages/platform/setting/static/index.tsx').default,
         }));
 
-        //console.log({paths});
-        
         paths.forEach((a: any) => {
           treeData.routes.push(a);
         });

+ 1 - 2
src/components/topBar/index.tsx

@@ -298,7 +298,6 @@ const TopBar: React.FC<TopBarType> = (props) => {
           set_password(undefined);
           set_tokenUpdateModalVisible(false);
         }
-
   }
 
 
@@ -451,7 +450,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
         </div>
         <Tooltip className='topBarTooltip' placement='bottomRight' title={<UserPannel />} color="#fff" onOpenChange={(visible) => setArrowRotate(visible)}>
           <div className='user'>
-            <div className='avator'><img src={require('../../../public/images/avatar.png')} /></div>
+            <div className='avator'><img src={userData?.avatarUrl?userData.avatarUrl:require('../../../public/images/avatar.png')} /></div>
             <div className='info'>
               <span className='hospName'>{localStorage.getItem('hospAbbreviation')}</span>
               <span className='name'>{userData?.name}</span>

+ 1 - 0
src/global.less

@@ -6,6 +6,7 @@
 body {
   margin: 0;
   height: 100%;
+  overflow: hidden;
   zoom: unset !important;
   background-color: transparent;
 }

+ 2 - 2
src/layouts/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-09 13:56:33
- * @LastEditTime: 2024-07-18 15:23:15
+ * @LastEditTime: 2024-07-31 13:53:53
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/layouts/index.tsx
@@ -110,7 +110,7 @@ const TopHoc = ({
       navData={navData}
       logo={logo}
       topBarTitle={topBarTitle}
-      userData={initialState?.userData}
+      userData={JSON.parse((localStorage.getItem('userInfo')?localStorage.getItem('userInfo'):localStorage.getItem('userData')) as string)}
       openedTabs={openedSysLists}
       onTabChange={onTabChangeHandle}
       onTabClick={onTabClickHandle}

+ 9 - 3
src/pages/index/components/TodoList/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-05-30 10:49:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-27 14:51:13
+ * @LastEditTime: 2024-07-25 10:49:29
  * @FilePath: /KC-MiddlePlatform/src/pages/index/components/TodoList/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -11,6 +11,11 @@
 
 import { useEffect, useState } from 'react';
 import './style.less';
+import { createFromIconfontCN } from '@ant-design/icons';
+import '../../../../../public/zhongtaiB.js'
+const IconFont = createFromIconfontCN({
+  scriptUrl:'',
+});
 
 export type todoItem = {
   recordTitle: string;
@@ -38,6 +43,7 @@ export const TodoList = (props: TodoList) => {
 
   const checkBtnHandle = (item: todoItem) => {
     todoListClickHandle && todoListClickHandle(item.id);
+
   };
 
   useEffect(() => {
@@ -48,13 +54,13 @@ export const TodoList = (props: TodoList) => {
     <div className="TodoList">
       <div className="topTitle">
         <span className="name">待办事项</span>
-        {/* <span className='actBtn'>全部处理</span> */}
+        <span className='actBtn'><IconFont type='icon-shuaxin' style={{marginRight:4}} />点击刷新</span>
       </div>
       <div className="wrap">
         {todoLists.map((item, index) => {
           return (
             <div className="todoList" key={index}>
-              <div className="checkBtn" onClick={() => checkBtnHandle(item)}></div>
+              <div className="checkBtn" onClick={() => checkBtnHandle(item)}>去处理</div>
               <div className="status">
                 <div className={setTodoClass(item)}>{item.recordTitle}</div>
                 <span className="date">{item.createDate ? `${item.createDate}`.replace(/:\d{2}$/, '') : ''}</span>

+ 24 - 10
src/pages/index/components/TodoList/style.less

@@ -4,6 +4,7 @@
   background: #ffffff;
   border-radius: 4px;
   padding-bottom: 24px;
+
   .topTitle {
     display: flex;
     flex-direction: row;
@@ -41,21 +42,28 @@
     .todoList {
       position: relative;
       margin-bottom: 24px;
+
       .checkBtn {
         position: absolute;
         right: 0px;
         top: 50%;
         cursor: pointer;
         margin-top: -16px;
-        width: 32px;
+        font-weight: 400;
+        font-size: 14px;
+        color: #525866;
+        width: 72px;
         height: 32px;
-        border-radius: 50%;
-        background: #f5f7fa;
-        background-image: url('./images/gou.png');
-        background-position: center center;
-        background-size: 15px 15px;
-        background-repeat: no-repeat;
+        text-align: center;
+        line-height: 32px;
+        background: #F5F7FA;
+        border-radius: 16px;
+        // background-image: url('./images/gou.png');
+        // background-position: center center;
+        // background-size: 15px 15px;
+        // background-repeat: no-repeat;
       }
+
       .status {
         display: flex;
         flex-direction: row;
@@ -94,6 +102,7 @@
 
             // }
           }
+
           &.orange {
             color: #ffaa33;
             background-color: #fcf7f0;
@@ -114,6 +123,7 @@
 
             // }
           }
+
           &.red {
             color: #ff6666;
             background-color: #fcf0f0;
@@ -143,6 +153,7 @@
           color: #7a8599;
         }
       }
+
       .detail {
         width: 323px;
         font-size: 14px;
@@ -152,7 +163,8 @@
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
-        & > span {
+
+        &>span {
           font-weight: 500;
           color: #17181a;
         }
@@ -169,12 +181,14 @@
       justify-content: center;
       flex-direction: column;
       align-items: center;
-      & > img {
+
+      &>img {
         width: 100px;
         height: 88px;
         margin-bottom: 16px;
       }
-      & > span {
+
+      &>span {
         font-size: 14px;
         font-weight: 400;
         color: #7a8599;

+ 108 - 10
src/pages/index/index.less

@@ -1,3 +1,98 @@
+.MsgProcessDrawer {
+  .drawerHeader {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 12px;
+
+    .title {
+      font-weight: 500;
+      font-size: 16px;
+      color: #17181A;
+
+      &>span {
+        display: inline-block;
+        width: 24px;
+        height: 24px;
+        cursor: pointer;
+        margin-right: 8px;
+        border-radius: 4px;
+        text-align: center;
+        line-height: 20px;
+
+        &>img {
+          width: 16px;
+          height: 16px;
+        }
+
+        &:hover {
+          background: #E6EAF2;
+        }
+      }
+    }
+  }
+
+  .msgInfo {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    height: 72px;
+    background: #FFFFFF;
+    border-radius: 8px;
+    padding: 0 16px;
+    margin-bottom: 16px;
+
+    .left {
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      &>img {
+        width: 32px;
+        height: 32px;
+        margin-right: 16px;
+      }
+
+      .detail {
+        .msgtitle {
+          height: 18px;
+          line-height: 18px;
+          font-weight: 500;
+          font-size: 18px;
+          color: #17181A;
+          margin-bottom: 8px;
+        }
+
+        .date {
+          height: 14px;
+          line-height: 14px;
+          font-weight: 400;
+          font-size: 14px;
+          color: #7A8599;
+        }
+      }
+    }
+
+    .right {
+      position: relative;
+      top: 12px;
+      font-weight: 500;
+      font-size: 14px;
+      color: #FFAA33;
+    }
+  }
+
+  .content {
+    height:calc(100% - 126px);
+    background: #FFFFFF;
+    border-radius: 8px;
+    overflow: scroll;
+  }
+}
+
 .indexPage {
   height: 100%;
   min-width: 1180px;
@@ -295,7 +390,7 @@
           background-size: cover !important;
           background-repeat: no-repeat !important;
 
-          & > img {
+          &>img {
             width: 810px;
             transition: all 0.3s linear;
           }
@@ -303,46 +398,49 @@
 
         /* 当屏幕宽度小于或等于 600px */
         @media screen and (max-width: 1250px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 600px;
           }
         }
 
         /* 当屏幕宽度小于或等于 600px */
         @media screen and (min-width: 1250px) and (max-width: 1360px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 700px;
           }
         }
 
         /* 当屏幕宽度在 601px 到 900px */
         @media screen and (min-width: 1360px) and (max-width: 1500px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 800px;
           }
         }
 
         /* 当屏幕宽度大于 900px */
         @media screen and (min-width: 1500px) and (max-width: 1760px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 900px;
           }
         }
+
         /* 当屏幕宽度大于 900px */
         @media screen and (min-width: 1760px) and (max-width: 1920px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 1000px;
           }
         }
+
         /* 当屏幕宽度大于 900px */
         @media screen and (min-width: 1960px) and (max-width: 2000px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 1200px;
           }
         }
+
         /* 当屏幕宽度大于 900px */
         @media screen and (min-width: 2000px) {
-          .imgWrap > img {
+          .imgWrap>img {
             width: 1400px;
           }
         }
@@ -419,7 +517,7 @@
                 color: #17181a;
                 text-align: left;
 
-                & > img {
+                &>img {
                   position: relative;
                   top: -1px;
                   width: 16px;
@@ -427,7 +525,7 @@
                   margin-right: 4px;
                 }
 
-                & > span {
+                &>span {
                   color: #7a8599;
                   padding-right: 16px;
                 }

+ 53 - 13
src/pages/index/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2024-05-16 17:57:43
+ * @LastEditTime: 2024-07-25 15:03:07
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
@@ -9,17 +9,22 @@
 
 import { useModel, history, Location, Helmet } from 'umi';
 import './index.less';
-import { Skeleton, Divider, Modal } from 'antd';
+import { Skeleton, Drawer } from 'antd';
 import { useState, useEffect } from 'react';
-import avatar from '../../../public/images/avatar.png';
-import TopBar from '@/components/topBar';
+
 import { FastEntry, FastEntryTabType } from './components/FastEntry';
-import { RecentlyVisited, RecentlyVisitedItemsType } from './components/RecentlyVisited';
+import { RecentlyVisitedItemsType } from './components/RecentlyVisited';
 import { todoItem, TodoList } from './components/TodoList';
-import { getSysParamsByCode, getUserIndexData, todoListAct, UserInfo } from '@/service';
-import { MsgRecord } from './components/MsgRecord';
-import { getParamsManaTableData } from '../platform/setting/paramsMana/service';
+import { getSysParamsByCode, getUserIndexData, UserInfo } from '@/service';
+
 import { KcimCenterSysId } from '@/constant';
+import { createFromIconfontCN } from '@ant-design/icons';
+
+
+import '../../../public/zhongtaiB.js'
+const IconFont = createFromIconfontCN({
+  scriptUrl:'',
+});
 
 export interface IndexPageType {
   location: Location;
@@ -55,6 +60,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
   const [allParams, set_allParams] = useState<any[]>([]);
   const [title, set_title] = useState<string | undefined>(undefined);
   const [welcomTitle, set_welcomTitle] = useState('欢迎进入医管平台');
+  const [drawerOpen, set_drawerOpen] = useState(false);
 
   const onLoadhandle = () => {
     set_iframeLoading(false);
@@ -104,10 +110,11 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
   };
 
   const todoListClickHandle = async (id: number) => {
-    const resp = await todoListAct([id]);
-    if (resp) {
-      getIndexPageDataFunc();
-    }
+    set_drawerOpen(true);
+    // const resp = await todoListAct([id]);
+    // if (resp) {
+    //   getIndexPageDataFunc();
+    // }
   };
 
   const setIframeUrl = async (allParams: any[]) => {
@@ -132,6 +139,11 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
     }
   };
 
+
+  const onClose = () => {
+    set_drawerOpen(false);
+  };
+
   useEffect(() => {
     if (allParams) {
       setIframeUrl(allParams);
@@ -153,7 +165,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
       const visitedPaths = JSON.parse(t);
       set_recentlyVisitedList(visitedPaths);
     }
-
+    
     getAllParamsHanle();
 
     // const url = `${spacialPage[0].url}&token=${youshuToken}`;
@@ -161,6 +173,33 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
 
   return (
     <div className="indexPage">
+      <Drawer className='MsgProcessDrawer'  title={null}  onClose={onClose} open={drawerOpen} mask={false} headerStyle={{display:'none'}}
+         bodyStyle={{background:'#F5F7FA'}}
+         width={600}
+         style={{ 
+          position: 'absolute', // 确保 Drawer 可以被定位
+          top:48,
+          bottom:0, // 距离底部 10%
+          height:'calc(100vh - 50px)', // 设置 Drawer 的高度
+        }}
+      >
+          <div className='drawerHeader'>
+                 <div className='title'><span onClick={()=>set_drawerOpen(false)}><img src={require('../../../public/images/cancel_black.png')} alt="" /></span>待办事项</div>
+          </div>
+          <div className='msgInfo'>
+               <div className='left'>
+                    <img src={require('../../../public/images/todojindo.png')} alt="" />
+                    <div className='detail'>
+                         <div className='msgtitle'>任立群发起了请假申请</div>
+                         <div className='date'>2023-12-26 11:24</div>
+                    </div>
+               </div>
+               <div className='right'>后勤管理 / 报事报修</div>
+          </div>
+          <div className='content'>
+            <div style={{padding:8}}><Skeleton active paragraph={{ rows: 12 }} /></div>
+          </div>
+      </Drawer>
       <Helmet>
         <title>{welcomTitle}</title>
       </Helmet>
@@ -183,6 +222,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
                 <img src={leftImgUrl} alt="" />
               </div>
             )}
+            
           </div>
         </div>
         <div className="right">

+ 2 - 2
src/pages/noAccess/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-14 14:14:32
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-18 13:56:55
+ * @LastEditTime: 2024-07-24 17:24:59
  * @FilePath: /BudgetManaSystem/src/pages/noAccess/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -20,7 +20,7 @@ const NoAccessPage: React.FC = () => {
               <img className='flagIcon' src={require('./images/noAccess.png')} alt="" />
               <div className='title'>暂无权限</div>
               <div className='subTitle'>当前功能暂无权限,请联系管理员分配权限</div>
-              <Link to='/index' replace ><div className='btn'>返回首页</div></Link>
+              {/* <Link to='/index' replace ><div className='btn'>返回首页</div></Link> */}
          </div>
     </div>
   );

+ 99 - 4
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2024-07-18 16:59:59
+ * @LastEditTime: 2024-08-21 17:39:43
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/_layout.tsx
@@ -14,7 +14,7 @@ import { getPlatformMenu, getSpecifyMenuDetail } from '@/service/menu';
 import './index.less';
 import { TreeItemType } from '@/utils';
 import { SpacicalPageParamsType } from '@/typings';
-import { Key, useEffect, useState } from 'react';
+import { Key, useEffect, useRef, useState } from 'react';
 
 import Icon, { FileOutlined, FolderOutlined, createFromIconfontCN } from '@ant-design/icons';
 import { getAllParams } from '@/service';
@@ -83,6 +83,48 @@ const findItemByKey: any = (tree: any[], key: string, keyName: string) => {
   return null;
 }
 
+
+
+// 权限检查函数
+function checkAccess(menu: any[], pathname: string) {
+  const matchPath = (path: any, target: string) => {
+    // 如果路径以 /platform 开头,则需要完整匹配
+    if (target.startsWith('/platform')) {
+      return path === target; // 完整匹配
+    }
+
+    // 否则,执行前缀匹配逻辑
+    return target.startsWith(path);
+  };
+
+  for (const item of menu) {
+    // 如果匹配成功,则立即返回 true
+    if (matchPath(item.path, pathname)) {
+      return true;
+    }
+
+    // 递归检查 item.child 的情况
+    if (item.child) {
+      const hasAccess = checkAccess(item.child, pathname);
+      if (hasAccess) {
+        return true;
+      }
+    }
+
+    // 递归检查 item.children 的情况
+    if (item.children) {
+      const hasAccess = checkAccess(item.children, pathname);
+      if (hasAccess) {
+        return true;
+      }
+    }
+  }
+
+  // 如果所有匹配都失败,返回 false
+  return false;
+}
+
+
 export default function Layout({ children, location, route, history, match, ...rest }: IRouteComponentProps) {
   const { initialState, setInitialState } = useModel('@@initialState');
   const [openKeys, set_openKeys] = useState<string[]>([]);
@@ -101,6 +143,10 @@ export default function Layout({ children, location, route, history, match, ...r
   const moreConfig: { menuRender?: any } = (isShowPageMenu && noMenu != 'true') ? {} : { menuRender: false }
 
   const { pathname } = location;
+  const isMenuClickRef = useRef(false);
+
+  const [loading, setLoading] = useState(true);
+  const [dataLoaded, setDataLoaded] = useState(false);
 
   const setEmptyPageContent = async (menuId: Key) => {
     const menuItem = await getSpecifyMenuDetail(menuId);
@@ -110,6 +156,18 @@ export default function Layout({ children, location, route, history, match, ...r
     set_emptyPageContent(menuItem.description);
   };
 
+
+  const checkPermission = (path: any) => {
+    const { navData = [], menuData = [] } = initialState || {};
+
+    // 检查访问权限
+    const hasAccess = checkAccess([...navData, ...menuData], path);
+
+    return hasAccess;
+  };
+
+
+
   useEffect(() => {
     const isShowMenu = localStorage.getItem('isChildShowMenu');
     set_isShowPageMenu(isShowMenu == 'true');
@@ -240,6 +298,42 @@ export default function Layout({ children, location, route, history, match, ...r
     return <>{pageUrl && <iframe id={'bi_iframe'} style={{ width: '100%', height: '100%', border: 'none' }} src={pageUrl} onLoad={() => adjustIframe()}></iframe>};</>;
   }
 
+
+
+  // useEffect(() => {
+  //   if (!dataLoaded && initialState) {
+  //     const navData = initialState.navData || [];
+  //     const menuData = initialState.menuData || [];
+
+  //     if (navData.length > 0 || menuData.length > 0) {
+  //       setDataLoaded(true);
+
+  //       const { pathname } = history.location;
+  //       const hasAccess = checkPermission(pathname);
+  //       if (!hasAccess) {
+  //         if (!pathname.includes('/platform')) {
+  //           history.push('/noAccess');
+  //         }
+  //       }
+  //       setLoading(false);
+  //     }
+  //   }
+  // }, [initialState, dataLoaded]);
+
+  useEffect(() => {
+    return history.listen((location) => {
+      if (!isMenuClickRef.current && dataLoaded) {
+        const hasPermission = checkPermission(location.pathname);
+        if (!hasPermission) {
+          history.push('/noAccess');
+        }
+      }
+      isMenuClickRef.current = false; // 重置状态
+    });
+  }, [dataLoaded, initialState]);
+
+
+
   return (
     <ProLayout
       style={{
@@ -280,6 +374,7 @@ export default function Layout({ children, location, route, history, match, ...r
         return (
           <a
             onClick={() => {
+              isMenuClickRef.current = true; // 标记为菜单点击
               history.push(`${item.path}${item.contentType == '4' ? `?isEmpty=true&menuId=${item.key}` : ''}` || '/');
             }}
           >
@@ -455,10 +550,10 @@ export default function Layout({ children, location, route, history, match, ...r
                   <IconFont style={{ display: 'inline-block',fontSize:24 }} className="menuCollapseIcon" type={collapsed ? 'icon-celanzhankai' : 'icon-celanshouqi'} />
                 </div>
               </div>
-
+              
             </ResizableContainer>
           </div>
-
+          
         );
       }}
       onPageChange={(location) => { }}

+ 24 - 62
src/pages/platform/components/usersEditer/index.tsx

@@ -1,57 +1,43 @@
 /*
- * @Author: your name
- * @Date: 2022-01-19 14:53:37
- * @LastEditTime: 2024-01-19 14:45:27
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2024-04-09 18:07:35
  * @LastEditors: code4eat awesomedema@gmail.com
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @LastEditTime: 2024-09-04 16:57:33
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/components/usersEditer/index.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
-
 import React, { useEffect, useState } from 'react';
-import KCTable from '@/components/kcTable';
 import { Input, Transfer } from 'antd';
-import { getUsers } from '@/service/user';
 import type { EditUsersDataType } from '@/service/user';
-import { ProColumns } from '@ant-design/pro-table';
-import { TableRequestParamsType } from '@/typings';
-import './style.less';
-
 import type { TransferDirection } from 'antd/es/transfer';
 
 export interface UserEditerType {
-  value?: React.Key[] | React.Key[];
-  onChange?: (selectedRowKeys: React.Key[]) => {};
+  value?: React.Key[];  // 修复类型声明
+  onChange?: (selectedRowKeys: React.Key[]) => void;  // 修复类型声明
   noAction?: boolean;
-  total?: [];
+  total?: EditUsersDataType[];  // 修复类型声明
 }
 
 const UserEditer: React.FC<UserEditerType> = ({ value = [], onChange, noAction = false, total = [] }) => {
-  const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
+  const [selectedKeys, setSelectedKeys] = useState<React.Key[]>(value);  // 初始状态为 value
   const [keyword, setKeyword] = useState('');
+  const [data, setData] = useState<EditUsersDataType[]>(total);  // 初始状态为 total
+  const [targetKeys, setTargetKeys] = useState<React.Key[]>(value);  // 初始状态为 value
 
-  const [data, setData] = useState<EditUsersDataType[]>([]);
-  const [targetKeys, setTargetKeys] = useState<React.Key[]>([]);
-
-  //record: T, selected: boolean, selectedRows: T[], nativeEvent: Event
-  const onSelectHandle = (record: EditUsersDataType, selected: boolean, selectedRows: EditUsersDataType[], nativeEvent: Event) => {
-    // console.log({record,selected,selectedRows,nativeEvent});
+  const onSelectHandle = (record: EditUsersDataType, selected: boolean) => {
     if (selected) {
-      //保证每次选择能够保留之前选中的
       setSelectedKeys([...selectedKeys, record.id]);
     } else {
-      const _selectedKeys = selectedKeys.filter((t) => t != record.id);
-      setSelectedKeys([..._selectedKeys]);
+      setSelectedKeys(selectedKeys.filter((t) => t !== record.id));
     }
   };
 
-  const onChangeHandle = (selectedRowKeys: React.Key[], selectedRows: any[]) => {
-    if (selectedRows.length == 0) {
-      //取消选择时
-      setSelectedKeys([]);
-    }
+  const onChangeHandle = (selectedRowKeys: React.Key[]) => {
+    setSelectedKeys(selectedRowKeys);
+    if (onChange) onChange(selectedRowKeys);
   };
 
-  const onSearchHandle = (e: React.ChangeEvent & { target: { value: string } }) => {
+  const onSearchHandle = (e: React.ChangeEvent<HTMLInputElement>) => {
     setKeyword(e.target.value);
   };
 
@@ -59,19 +45,19 @@ const UserEditer: React.FC<UserEditerType> = ({ value = [], onChange, noAction =
 
   const handleChange = (newTargetKeys: string[]) => {
     setTargetKeys(newTargetKeys);
-    onChange && onChange(newTargetKeys);
+    if (onChange) onChange(newTargetKeys);
   };
 
-  const handleSearch = (dir: TransferDirection, value: string) => {};
-
-  useEffect(() => {
-    onChange && onChange(selectedKeys);
-  }, [selectedKeys]);
+  const handleSearch = (dir: TransferDirection, value: string) => {
+    
+  };
 
+  // 同步外部 value 到组件内部状态
   useEffect(() => {
     setTargetKeys(value);
-    setData(total);
-  }, []);
+    setSelectedKeys(value);
+    setData(total);  // 这里是关键,确保数据也同步
+  }, [value, total]);  // 依赖于 value 和 total 的变化
 
   return (
     <div className="UserEditer">
@@ -87,30 +73,6 @@ const UserEditer: React.FC<UserEditerType> = ({ value = [], onChange, noAction =
         onSearch={handleSearch}
         render={(item) => (item.name ? `${item.name}(${item.account})` : '')}
       />
-
-      {/* <div className="search">
-        <span className="label">搜索人员:</span>
-        <Input
-          className="valueArea"
-          onChange={onSearchHandle}
-          allowClear={true}
-          placeholder="请输入姓名、工号"
-        />
-      </div>
-      <KCTable
-        rowKey="id"
-        columns={columns.filter((t) => (noAction ? t.title != '操作' : t))}
-        request={getData}
-        params={{ keyword: keyword }}
-        options={false}
-        search={false}
-        rowSelection={{
-          checkStrictly: false,
-          selectedRowKeys: selectedKeys,
-          onChange: onChangeHandle,
-          onSelect: onSelectHandle,
-        }}
-      /> */}
     </div>
   );
 };

+ 2 - 2
src/pages/platform/setting/departmentMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-06-09 10:57:54
+ * @LastEditTime: 2024-07-29 14:57:44
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -318,7 +318,7 @@ export default function DepartmentMana() {
                 </div>
             </div>
             <div style={{ marginTop: 16 }}>
-                <KCTable columns={columns as ProColumns[]} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />
+                <KCTable columns={columns as ProColumns[]} scroll={{y:`calc(100vh - 255px)`}} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />
             </div>
         </div>
     )

+ 12 - 2
src/pages/platform/setting/hospManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2024-01-10 17:18:42
+ * @LastEditTime: 2024-07-29 09:47:26
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/hospManage/index.tsx
@@ -720,11 +720,14 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     {
       title: '院区ID',
       dataIndex: 'id',
+      width:70
     },
     {
       title: '院区名称',
       dataIndex: 'hospName',
       hideInSearch: false,
+      ellipsis:true,
+      width:200
     },
     // {
     //   title: '是否主院',
@@ -736,6 +739,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     {
       title: '医院标识',
       dataIndex: 'hospSign',
+      ellipsis:true
     },
     // {
     //   title: '简称',
@@ -744,10 +748,13 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     {
       title: '主院名称',
       dataIndex: 'parentName',
+      ellipsis:true
     },
     {
       title: '医院等级',
       dataIndex: 'hospitalLevelName',
+      ellipsis:true,
+      width:90
     },
     // {
     //   title: '医院类型',
@@ -756,6 +763,8 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     {
       title: '医院性质',
       dataIndex: 'hospitalNatureName',
+      ellipsis:true,
+      width:90
     },
     // {
     //   title: '医院编码',
@@ -764,6 +773,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     {
       title: '系统名称',
       dataIndex: 'systemName',
+      ellipsis:true
     },
     // {
     //   title: '互通',
@@ -1036,7 +1046,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
           </span>
         </div>
       </div>
-      <KCTable newVer rowKey="id" columns={columns} reload={reloadTable} options={false} params={tableDataFilterParams} request={(params) => getHospData(params)} />
+      <KCTable newVer rowKey="id" scroll={{y:`calc(100vh - 250px)`}} columns={columns} reload={reloadTable} options={false} params={tableDataFilterParams} request={(params) => getHospData(params)} />
     </div>
   );
 };

+ 2 - 2
src/pages/platform/setting/hospParamsMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-09-28 11:17:13
+ * @LastEditTime: 2024-07-29 15:04:52
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -486,7 +486,7 @@ export default function PubDicTypeMana() {
                     </div>
                 </div>
                 <div style={{ marginTop: 16 }}>
-                    {currentSelectedTreeNode && <KCTable columns={columns as ProColumns[]} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
+                    {currentSelectedTreeNode && <KCTable scroll={{y:`calc(100vh - 315px)`}} columns={columns as ProColumns[]} reload={reload} rowKey='id' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
                 </div>
             </div>
         </div>

+ 2 - 2
src/pages/platform/setting/kcClassification/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-12-04 19:41:52
+ * @LastEditTime: 2024-07-29 14:50:07
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -212,7 +212,7 @@ export default function KcClassification() {
         </div>
       </div>
       <div style={{ marginTop: 16 }}>
-        <KCTable scroll={{ y: `calc(100vh - 250px)` }} pagination={false} columns={columns as ProColumns[]} rowKey="id" newVer dataSource={tableData} />
+        <KCTable scroll={{ y: `calc(100vh - 195px)` }} pagination={false} columns={columns as ProColumns[]} rowKey="id" newVer dataSource={tableData} />
       </div>
     </div>
   );

+ 3 - 2
src/pages/platform/setting/menuManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2022-07-28 14:49:55
+ * @LastEditTime: 2024-07-29 09:57:10
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/hospManage/index.tsx
@@ -95,7 +95,7 @@ const MenuManage: FC<PageProps> = ({ menuManageModel: state, dispatch }) => {
     // },
     {
       title: '操作',
-      width: 400,
+      width:265,
       key: 'option',
       valueType: 'option',
       render: (text, record) => {
@@ -271,6 +271,7 @@ const MenuManage: FC<PageProps> = ({ menuManageModel: state, dispatch }) => {
         headerTitle="查询表格"
         columns={columns}
         reload={reloadTable}
+        scroll={{y:`calc(100vh - 360px)`}}
         toolBarRender={() => [
           <Button key="3" type="primary" onClick={() => addHandle()}>
             新增中心

+ 10 - 3
src/pages/platform/setting/notificationTemplate/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-09-28 11:20:09
+ * @LastEditTime: 2024-07-29 14:48:12
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -34,7 +34,7 @@ export default function PubDicTypeMana() {
     //字典
     const [dirData, set_dirData] = useState<any[]>([]);
 
-    const columns = [
+    const columns:ProColumns[] = [
         {
             title: '主题',
             dataIndex: 'title',
@@ -43,30 +43,37 @@ export default function PubDicTypeMana() {
         {
             title: '消息内容',
             dataIndex: 'content',
+            ellipsis:true
         },
         {
             title: '院区',
             dataIndex: 'hospName',
+            ellipsis:true
         },
         {
             title: '系统',
             dataIndex: 'systemName',
+            ellipsis:true
         },
         {
             title: '接收类型',
             dataIndex: 'receiveTypeName',
+            ellipsis:true
         },
         {
             title: '接收对象',
             dataIndex: 'receiveTargetName',
+            ellipsis:true
         },
         {
             title: '消息级别',
             dataIndex: 'receiveLevelName',
+            ellipsis:true
         },
         {
             title: '处理链接',
             dataIndex: 'resolvePath',
+            ellipsis:true
         },
         {
             title: '备注',
@@ -75,7 +82,7 @@ export default function PubDicTypeMana() {
         {
             title: '操作',
             key: 'option',
-            width: 120,
+            width: 90,
             valueType: 'option',
             render: (_: any, record: any) => {
                 return [

+ 2 - 2
src/pages/platform/setting/pubDicMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-05 23:47:30
+ * @LastEditTime: 2024-07-31 13:47:53
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -134,7 +134,7 @@ const PubDicMana = () => {
     const currentSelectedHop = localStorage.getItem('currentSelectedSubHop');
     const { systemId: parentId } = currentSelectedTreeNode;
     let hospId = '0';
-    if (currentSelectedHop) {
+    if (currentSelectedHop&&pageType == 2) {
         const { id } = JSON.parse(currentSelectedHop);
         hospId = id
     }

+ 2 - 2
src/pages/platform/setting/pubDicTypeMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-05 23:47:07
+ * @LastEditTime: 2024-07-29 14:41:59
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -397,7 +397,7 @@ export default function PubDicTypeMana() {
           </div>
         </div>
         <div style={{ marginTop: 16 }}>
-          {currentSelectedTreeNode && <KCTable columns={columns as ProColumns[]} reload={reload} rowKey="dictId" newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
+          {currentSelectedTreeNode && <KCTable  scroll={{y:`calc(100vh - 255px)`}} columns={columns as ProColumns[]} reload={reload} rowKey="dictId" newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
         </div>
       </div>
     </div>

+ 11 - 7
src/pages/platform/setting/roleManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2024-07-02 17:26:56
+ * @LastEditTime: 2024-07-29 14:56:41
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/hospManage/index.tsx
@@ -714,12 +714,19 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
     {
       title: '院区名称',
       dataIndex: 'hospName',
+      ellipsis:true,
+      width:200
     },
     {
       title: '角色名称',
       dataIndex: 'roleName',
       hideInSearch: false,
     },
+    {
+      title: '角色编码',
+      dataIndex: 'roleCode',
+      hideInSearch: false,
+    },
     {
       title: '备注',
       dataIndex: 'remark',
@@ -735,10 +742,11 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
     {
       title: '变更日期',
       dataIndex: 'modifyTime',
+      ellipsis:true
     },
     {
       title: '操作',
-      width: 240,
+      width: 200,
       key: 'option',
       valueType: 'option',
       render: (text, record) => [
@@ -943,11 +951,7 @@ const RoleManage: FC<PageProps> = ({ roleManageModel: state, dispatch }) => {
         options={false}
         newVer
         reload={reloadTable}
-        // toolBarRender={() => [
-        //   <Button key="3" type="primary" onClick={addHandle}>
-        //     新增角色
-        //   </Button>,
-        // ]}
+        scroll={{y:`calc(100vh - 255px)`}}
         request={(params) => getData(params)}
       />
     </div>

+ 45 - 35
src/pages/platform/setting/roleManage/modals/modal.tsx

@@ -1,12 +1,3 @@
-/*
- * @Author: your name
- * @Date: 2022-01-12 17:11:11
- * @LastEditTime: 2024-01-10 16:50:30
- * @LastEditors: code4eat awesomedema@gmail.com
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/userManage/modal.tsx
- */
-
 import React from 'react';
 import KCModal from '@/components/KCModal';
 import KCProSelect from '@/components/KCProSelect';
@@ -26,8 +17,22 @@ interface ActModalProps extends roleManageModelState {
 }
 
 const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, currentEdit, hospId }) => {
+
+  const setInitialValues = () => {
+    if (tableAct === TableActType.EDIT) {
+      return { ...currentEdit };
+    }
+    if (tableAct === TableActType.ADD) {
+      return { hospId: hospId };
+    }
+    if (tableAct === TableActType.EDITMENU || tableAct === TableActType.EDITRELAUSER) {
+      return { ...currentEdit };
+    }
+  };
+
+  const initialValues = setInitialValues(); // 在表单渲染之前设置初始值
+
   const onVisibleChangeHandle = (bool: boolean) => {
-    // console.log({bool});
     if (!bool) {
       dispatch &&
         dispatch({
@@ -37,19 +42,22 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
   };
 
   const onFinishHandle = (data: any & AddUsersDataType) => {
-    if (tableAct == TableActType.ADD) {
+    console.log({initialValues});
+    
+
+    if (tableAct === TableActType.ADD) {
       dispatch &&
         dispatch({
           type: 'roleManageModel/postAddData',
-          payload: data,
+          payload: data,  // 使用合并后的数据
         });
     }
 
-    if (tableAct == TableActType.EDIT || tableAct == TableActType.EDITMENU || tableAct == TableActType.EDITRELAUSER) {
+    if (tableAct === TableActType.EDIT || tableAct === TableActType.EDITMENU || tableAct === TableActType.EDITRELAUSER) {
       dispatch &&
         dispatch({
           type: 'roleManageModel/postEditData',
-          payload: data,
+          payload: data,  // 使用合并后的数据
         });
     }
 
@@ -57,31 +65,21 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
   };
 
   const setModalTitle = () => {
-    if (tableAct == TableActType.EDIT) {
+    if (tableAct === TableActType.EDIT) {
       return '编辑角色';
     }
-    if (tableAct == TableActType.ADD) {
+    if (tableAct === TableActType.ADD) {
       return '新增角色';
     }
-    if (tableAct == TableActType.EDITMENU) {
+    if (tableAct === TableActType.EDITMENU) {
       return '绑定菜单';
     }
-    if (tableAct == TableActType.EDITRELAUSER) {
+    if (tableAct === TableActType.EDITRELAUSER) {
       return '绑定人员';
     }
   };
 
-  const setInitialValues = () => {
-    if (tableAct == TableActType.EDIT) {
-      return { ...currentEdit };
-    }
-    if (tableAct == TableActType.ADD) {
-      return { hospId: hospId };
-    }
-    if (tableAct == TableActType.EDITMENU || tableAct == TableActType.EDITRELAUSER) {
-      return { ...currentEdit };
-    }
-  };
+  
 
   return (
     <KCModal
@@ -89,26 +87,26 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
       onVisibleChange={onVisibleChangeHandle}
       layout="horizontal"
       width={500}
-      initialValues={setInitialValues()}
+      initialValues={initialValues}
       title={setModalTitle()}
       labelCol={{
         span: 5,
       }}
-      onFinish={async (data) => onFinishHandle(data)}
+      onFinish={async (data) => onFinishHandle({...data})}
     >
-      {tableAct == TableActType.EDITMENU && (
+      {tableAct === TableActType.EDITMENU && (
         <Form.Item name="bindMenuIds">
           <MenuEditer noAction={true} hospId={currentEdit?.hospId} />
         </Form.Item>
       )}
 
-      {tableAct == TableActType.EDITRELAUSER && (
+      {tableAct === TableActType.EDITRELAUSER && (
         <Form.Item name="bindUserIds">
           <UserEditer total={currentEdit ? currentEdit.allUsers : []} noAction={true} />
         </Form.Item>
       )}
 
-      {(tableAct == TableActType.ADD || tableAct == TableActType.EDIT) && (
+      {(tableAct === TableActType.ADD || tableAct === TableActType.EDIT) && (
         <>
           <KCProSelect
             label="选择院区"
@@ -134,7 +132,19 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
             rules={[
               {
                 required: true,
-                message: '请输入医院名称!',
+                message: '请输入角色名称!',
+              },
+            ]}
+          />
+           <ProFormText
+            width="md"
+            name="roleCode"
+            label="角色编码"
+            placeholder="请输入"
+            rules={[
+              {
+                required: true,
+                message: '请输入角色编码!',
               },
             ]}
           />

+ 2 - 1
src/pages/platform/setting/systemNavMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-12-16 09:42:52
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-11-10 10:25:38
+ * @LastEditTime: 2024-07-29 14:46:49
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -728,6 +728,7 @@ const MonthlyInfoCheck: React.FC = () => {
             pagination={false}
             reload={reload}
             newVer
+            scroll={{y:`calc(100vh - 195px)`}}
             params={tableDataFilterParams}
             rowKey="menuId"
             columns={columns as ProColumns[]}

+ 4 - 1
src/pages/platform/setting/userManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-11 09:43:18
- * @LastEditTime: 2024-04-01 14:07:34
+ * @LastEditTime: 2024-07-29 14:53:07
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/userManage/index.tsx
@@ -48,6 +48,8 @@ const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
     {
       title: '院区',
       dataIndex: 'hospName',
+      ellipsis:true,
+      width:210
     },
     {
       title: '姓名',
@@ -327,6 +329,7 @@ const UserManage: FC<PageProps> = ({ userManageModel: state, dispatch }) => {
         reload={reloadTable}
         params={tableDataFilterParams}
         newVer
+        scroll={{y:`calc(100vh - 255px)`}}
         expandable={{
           expandedRowRender: (record) => (
             <div className="userExpandInfo">

+ 2 - 65
src/wrappers/auth.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2024-04-09 18:07:35
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2024-07-18 16:16:07
+ * @LastEditTime: 2024-08-21 17:44:38
  * @FilePath: /KC-MiddlePlatform/src/wrappers/auth.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -11,74 +11,11 @@ import { history, useModel } from 'umi';
 import type { IRoute } from 'umi';
 // import { Outlet } from '@umijs/max';
 
-//权限检查函数
-function checkAccess(menu: IRoute[], pathname: string): boolean {
-  // 检查当前路径或其父路径是否匹配
-  const matchPath = (path: string, target: string): boolean => {
-    if (target.startsWith(path)) {
-      return true;
-    }
-    return false;
-  };
 
-  for (const item of menu) {
-    if (matchPath(item.path as string, pathname)) {
-      return true;
-    }
-    if (item.child) {
-      const hasAccess = checkAccess(item.child, pathname);
-      if (hasAccess) {
-        return true;
-      }
-    }
-    if (item.children) {
-      const hasAccess = checkAccess(item.children, pathname);
-      if (hasAccess) {
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-function removePrefix(input: string, prefix: string): string {
-  if (input.startsWith(prefix)) {
-    return input.slice(prefix.length);
-  }
-  return input;
-}
 
 // 权限包装组件
 const AuthWrapper: React.FC = (props) => {
-  const { initialState } = useModel('@@initialState');
-  const [loading,set_loading] = useState(true);
-  const [dataLoaded, setDataLoaded] = useState(false);
-
-  useEffect(() => {
-    if (!dataLoaded) {
-      const navData = initialState?.navData ?? [];
-      const menuData = initialState?.menuData ?? [];
-
-      if (navData.length > 0 || menuData.length > 0) {
-        setDataLoaded(true);
-
-        const { pathname } = history.location;
-        const needCheckPath = [...navData, ...menuData];
-        const hasAccess = checkAccess(needCheckPath, pathname);
-        console.log({ needCheckPath, pathname, hasAccess });
-
-        if (!hasAccess) {
-          if (!pathname.includes('/platform')) {
-            history.push('/noAccess');
-          }
-        }
-        set_loading(false);
-      }
-    }
-  }, [initialState, dataLoaded]);
-
-  return loading?<>loading</>:<div>{props.children}</div>;
+  return <div>{props.children}</div>;
 };
 
 export default AuthWrapper;
-export { checkAccess };

Некоторые файлы не были показаны из-за большого количества измененных файлов