Parcourir la source

添加成本跳转

code4eat il y a 2 ans
Parent
commit
7e2c4e3b0a

+ 5 - 1
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2023-02-13 17:59:24
+ * @LastEditTime: 2023-02-27 10:04:38
  * @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
@@ -46,6 +46,10 @@ export default defineConfig({
           path: '/app1',
           microApp: 'app1',
         },
+        // {
+        //   path: '/costMana',
+        //   microApp: 'costMana',
+        // },
         {
           path: '/PFMBackC',
           microApp: 'PFMBackC',

+ 40 - 8
src/app.tsx

@@ -10,6 +10,7 @@ import { logoutHandle } from './global';
 import { Platforms } from './constant';
 import { SpacicalPageParamsType } from './typings';
 
+
 const loginPath = '/login';
 
 let hospSign: string = ''; //医院标识
@@ -230,10 +231,10 @@ export const request: RequestConfig = {
 export const qiankun = fetch('/config').then(() => ({
   // 注册子应用信息
   apps: [
-    {
-      name: 'microApp', // 唯一 id
-      entry: '//localhost:8808', // 开发
-    },
+    // {
+    //   name: 'microApp', // 唯一 id
+    //   entry: '//localhost:8808', // 开发
+    // },
     {
       name: 'app1', // 唯一 id
       entry: '//112.124.59.133:8804',  //测试
@@ -243,15 +244,15 @@ export const qiankun = fetch('/config').then(() => ({
     },
     {
       name: 'reviewMana', // 唯一 id
-     //entry: '//112.124.59.133:8807',  //测试
-      entry: '//118.31.245.65:8807', //线上
+      entry: '//112.124.59.133:8807',  //测试
+      //entry: '//118.31.245.65:8807', //线上
       //entry:'//192.168.50.143:8804',//本机
       //entry: '//localhost:8804', // 开发
     },
     {
       name: 'budgetManaSystem', // 唯一 id
-      entry: '//localhost:8001'
-      //entry: '//112.124.59.133:5000/perform/', // 开发
+      //entry: '//localhost:8001'
+      entry: '//112.124.59.133:5000/perform/', // 开发
     },
     {
       name: 'PFMBackC', // 唯一 id
@@ -277,6 +278,37 @@ export function useQiankunStateForSlave() {
   };
 }
 
+
+
+//@/pages/platform/setting/reports/index
+export function patchRoutes({ routes }:{routes:any}) {
+  const paths = [...new Array(100).keys()].map((a,index)=>({
+    path: `/platform/setting/reports/${15+(index+1)}`,
+    exact: true,
+    component: require('@/pages/platform/setting/reports/index.tsx').default,
+  }));
+
+
+  const treeLoop = (treeData:any)=>{
+        //console.log({treeData})
+        if(treeData.path == '/platform'){
+          paths.forEach((a:any)=>{
+            treeData.routes.push(a); 
+          })
+          return;  
+        }else{
+            if(treeData.routes&&treeData.routes.length>0){
+              treeData.routes.forEach((a:any)=>{
+                  treeLoop(a);
+              })
+            }
+        }
+  }
+
+  treeLoop(routes[0]);
+}
+
+
 export const layout = ({ initialState: { userData } }: { initialState: InitialStateType }): BasicLayoutProps => {
   return {
     headerRender: false,

+ 22 - 4
src/components/topBar/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-16 09:12:37
- * @LastEditTime: 2023-02-13 14:37:01
+ * @LastEditTime: 2023-02-27 15:12:27
  * @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/components/topBar/index.tsx
@@ -45,6 +45,8 @@ const TopBar: React.FC<TopBarType> = (props) => {
   const [currentActivedBlockIndex, set_currentActivedBlockIndex] = useState(0);
   const [panelData, set_panelData] = useState<TopBar.PanelData[]>([]);
 
+  const [onTabSystemTabs,set_onTabSystemTabs] = useState<TopBar.Tab[]>([]); //tab导航可以放下的数量,剩余通过下拉获取
+
 
   const localSavedTab = localStorage.getItem('currentSelectedTab');
 
@@ -218,7 +220,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
 
   useEffect(()=>{
 
-    //if(currentTab)reSetNav(panelData,currentTab);
+    if(currentTab)reSetNav(panelData,currentTab);
  
   },[currentTab]);
 
@@ -227,6 +229,22 @@ const TopBar: React.FC<TopBarType> = (props) => {
   //     onTabClickHandle(currentSelectedSys);
   //   }
   // },[currentSelectedSys])
+
+
+  useEffect(()=>{
+      //  console.log('systemTabs.length',systemTabs.length);
+       if(systemTabs.length>6){
+        const tabs = systemTabs.filter((a:any,index:number)=>{
+                if(index<=5){
+                   return a
+                } 
+        });
+
+        set_onTabSystemTabs(tabs);
+       }else{
+        set_onTabSystemTabs(systemTabs);
+       }
+  },[systemTabs]);
   
   
   useEffect(() => {
@@ -263,7 +281,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
            * 已打开的tab
            */}
           <div className='tabWrap'>
-            {systemTabs&&systemTabs.map((item, index) => (
+            {onTabSystemTabs&&(onTabSystemTabs).map((item, index) => (
               <div key={index} className={currentSelectedTab?.menuId == item.menuId ? `tab on` : `tab`} onClick={() => _systemTabClickHandle(item)}>
                 <div className='tabText'>{item.name} </div>
                 <div className='closeIconWrap'>
@@ -273,7 +291,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
             ))}
           </div>
         </>
-
+        
 
         {/* <div className='notification'>
           <img className='notificationIcon' src={require('../../../public/images/notificationIcon.png')} />

+ 10 - 5
src/global.less

@@ -1,3 +1,10 @@
+
+* {
+  margin: 0;
+  padding: 0;
+}
+
+
 input {
   outline: none !important;
 }
@@ -17,13 +24,8 @@ input {
 }
 
 
-// div {
-//    overflow-x: h idden;
-// }
-
 
 div::-webkit-scrollbar{
-  
   width:2px;
   height:2px;
   /**/
@@ -37,10 +39,13 @@ div::-webkit-scrollbar-thumb{
   border-radius:10px;
 }
 div::-webkit-scrollbar-thumb:hover{
+  width:4px;
+  height:4px;
   background: rgb(136, 135, 135);
 }
 div::-webkit-scrollbar-corner{
   background:rgb(136, 135, 135) ;
+  
 }
 
 

+ 3 - 3
src/layouts/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-09 13:56:33
- * @LastEditTime: 2023-02-13 14:00:26
+ * @LastEditTime: 2023-02-27 10:38:07
  * @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
@@ -27,8 +27,6 @@ const TopHoc = ({ currentSelectedSys, openedSysLists, navData,set_emptyPageConte
 
   const onTabClickHandle = async (data: TopBar.Tab) => {
 
-    console.log({data});
-
     if(JSON.stringify(data) != '{}'){
       await setInitialState((s) => ({ ...s, currentSelectedSys: data }));
   
@@ -138,6 +136,8 @@ export default function Layout({ children, location, route, history, match }: IR
     return <div>{children}</div>;
   }
 
+
+ 
   return (
     <ProLayout
       layout="top"

+ 22 - 5
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2022-12-12 15:40:54
+ * @LastEditTime: 2023-02-27 15:43:12
  * @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
@@ -13,7 +13,7 @@ import ProLayout, { PageContainer } from '@ant-design/pro-layout';
 import { getPlatformMenu, getSpecifyMenuDetail } from '@/service/menu';
 import './index.less';
 import { TreeItemType } from '@/utils';
-import { SpacicalPageParamsType } from '@/typings';
+import { Iframe, SpacicalPageParamsType } from '@/typings';
 import { Key, useEffect, useState } from 'react';
 import IconFont from '@ant-design/icons/lib/components/IconFont';
 import { FileOutlined, FolderOutlined, SmileOutlined } from '@ant-design/icons';
@@ -29,7 +29,7 @@ export default function Layout({ children, location, route, history, match, ...r
   //const isShowMenu = localStorage.getItem('isChildShowMenu');
   // console.log({ children, location, route, history, match});
 
-
+  const {pathname} = location;
 
   const setEmptyPageContent = async (menuId: Key) => {
     const menuItem = await getSpecifyMenuDetail(menuId);
@@ -55,7 +55,23 @@ export default function Layout({ children, location, route, history, match, ...r
     }
 
     set_isEmpty(location.query.isEmpty == 'true');
-  }, [location])
+  }, [location]);
+
+ 
+  const adjustIframe = ()=>{
+    // var ifm:any = document.getElementById("bi_iframe");
+    // if(ifm){
+    //   ifm.height=document.documentElement.clientHeight;
+    //   ifm.width=document.documentElement.clientWidth;
+    // }
+  }
+
+  //临时演示处理
+
+  if (location.pathname == '/platform/costMana') {
+    return <iframe id={'bi_iframe'}  style={{ width: '100%', height: '100%', border: 'none' }}  src="http://112.124.59.133:4000/platformMana/roleManage?hospSign=dOBHdoPmJgPGnMSH" onLoad={()=>adjustIframe()} ></iframe>;
+  }
+
 
 
   return (
@@ -144,7 +160,8 @@ export default function Layout({ children, location, route, history, match, ...r
                 // console.log({homePage});
                 set_openKeys([homePage.key]);
                 set_selectedKeys([homePage.key]);
-                history.push(homePage.path)
+                history.push(homePage.path);
+
               } else {
            
                 if (path == '/platform') {

+ 3 - 1
src/pages/platform/setting/reports/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-03-03 18:04:40
- * @LastEditTime: 2023-01-12 10:07:51
+ * @LastEditTime: 2023-02-27 14:16:42
  * @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/reports/index.tsx
@@ -16,6 +16,8 @@ export default () => {
   const [specialPageUrl, setspecialPageUrl] = useState<string | undefined>(undefined);
   const [loading, setloading] = useState(false);
 
+  console.log('reports');
+
   const onLoadhandle = () => {
     setloading(false);
   };