Selaa lähdekoodia

更新于20220426

code4eat 3 vuotta sitten
vanhempi
commit
b15be7e602

+ 2 - 2
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2022-03-04 15:53:22
+ * @LastEditTime: 2022-03-30 10:59:29
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/config.ts
@@ -48,6 +48,7 @@ export default defineConfig({
           component: '@/pages/index/index.tsx',
         },
         {
+          title:'精益管管理中台',
           path: '/platform',
           component: '@/pages/platform/_layout.tsx',
           routes: [
@@ -88,7 +89,6 @@ export default defineConfig({
   fastRefresh: {},
   layout: {
     layout: 'top',
-    title: '医务中台',
   },
   // mfsu: {},
   qiankun: {

+ 1 - 1
config/proxy.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:00:52
- * @LastEditTime: 2022-03-29 16:10:58
+ * @LastEditTime: 2022-04-01 14:23:25
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/proxy.ts

+ 2 - 3
src/app.tsx

@@ -197,10 +197,8 @@ export const request: RequestConfig = {
   errorConfig: {
     adaptor: (resData) => {
       if (!resData.success && resData.status != 200) {
-        // console.log({resData});
         return {
           ...resData,
-          // success:false,
         };
       } else {
         return {
@@ -229,7 +227,8 @@ export const qiankun = fetch('/config').then(() => ({
   apps: [
     {
       name: 'app1', // 唯一 id
-      // entry: '//112.124.59.133:8804',
+      // entry: '//112.124.59.133:8804',  //开发
+      // entry: '//118.31.245.65:8804', //线上
       entry: '//localhost:8804', // html entry
     },
   ],

+ 1 - 1
src/layouts/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-09 13:56:33
- * @LastEditTime: 2022-03-29 15:41:39
+ * @LastEditTime: 2022-03-30 10:07:30
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/layouts/index.tsx

+ 3 - 3
src/pages/document.ejs

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-02-14 14:02:45
- * @LastEditTime: 2022-02-14 16:20:23
+ * @LastEditTime: 2022-03-30 11:16:30
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/document.ejs
@@ -17,10 +17,10 @@
   name="viewport"
   content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
 />
-  <title>医务中台</title>
+  <title>精益管理中台</title>
   <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
 </head>
 <body>
   <!-- <div id="root"></div> -->
 </body>
-</html>
+</html>

+ 3 - 5
src/pages/index/index.tsx

@@ -1,13 +1,13 @@
 /*
  * @Author: your name
  * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2022-03-28 18:57:53
+ * @LastEditTime: 2022-03-30 11:35:41
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
  */
 
-import { useModel, history, Location } from 'umi';
+import { useModel, history, Location, Helmet } from 'umi';
 import './index.less';
 import LoginPage from '../login';
 
@@ -36,14 +36,12 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
     const { query } = history.location;
     const { redirect } = query as { redirect: string };
 
-    // console.log({systemInfo,redirect});
-
     history.push(redirect || systemInfo.path);
   };
 
   return (
     <div className="indexPage">
-      <LoginPage location={location}>
+      <LoginPage title='单点登录平台' location={location}>
         <div className="block">
           <div className="systemSelector">
             {systemLists?.map((t) => (

+ 14 - 11
src/pages/login/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-09 14:58:08
- * @LastEditTime: 2022-03-29 15:49:50
+ * @LastEditTime: 2022-03-31 17:52:58
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/login/index.tsx
@@ -11,7 +11,7 @@ import React, { useRef, useEffect, useState, Children } from 'react';
 import { Select, message } from 'antd';
 import './style.less';
 
-import { useModel, history, Location } from 'umi';
+import { useModel, history, Location, Helmet } from 'umi';
 
 import { Form, Input, Button, Checkbox, notification } from 'antd';
 
@@ -25,9 +25,10 @@ const { Option } = Select;
 
 export interface LoginPageType {
   location: Location;
+  title:string;
 }
 
-const LoginPage: React.FC<LoginPageType> = ({ location, children }) => {
+const LoginPage: React.FC<LoginPageType> = ({ location, children,title }) => {
   const [transitionObj, setTransitionObj] = useState<string>();
   const [transformObj, setTransformObj] = useState<string>();
   const loginPageRef = useRef<HTMLDivElement>(null);
@@ -100,8 +101,6 @@ const LoginPage: React.FC<LoginPageType> = ({ location, children }) => {
       if (initialState && initialState.getHospSubSystemListFunc) {
         const data = await initialState.getHospSubSystemListFunc();
 
-        console.log({ initialState });
-
         await setInitialState((s) => ({
           ...s,
           systemLists: data,
@@ -128,7 +127,7 @@ const LoginPage: React.FC<LoginPageType> = ({ location, children }) => {
         }
 
         if (data.length == 0) {
-          history.replace('/login');
+          return;
         }
       }
 
@@ -136,20 +135,24 @@ const LoginPage: React.FC<LoginPageType> = ({ location, children }) => {
     }
   };
 
+  
+  useEffect(()=>{
+    setCurrentHospName(title);  
+  },[title]);
+
+
   useEffect(() => {
     //根据hospSign获取分院信息
     location.pathname == '/login' && getSubHospFunc();
     setInitialState((s) => ({ ...s, currentSelectedSys: undefined, openedSysLists: [] }));
   }, []);
 
-  // return (
-  //   <div>
-  //       <iframe src="http://192.168.50.76:8902/TracerMethodology/?hospSign=IGlcn5nc4xBWc08C"></iframe>
-  //   </div>
-  // )
 
   return (
     <div className="loginPage" onMouseMove={onMouseMoveHandle} onMouseLeave={onMouseLeaveHandle} ref={loginPageRef}>
+      <Helmet>
+        <title>{currentHospName}</title>
+      </Helmet>
       <div className="circleBigOne" style={{ transform: transformObj, transition: transitionObj }}></div>
       <div className="circleBigerOne"></div>
       <div className="circleLittleOne" style={{ transform: transformObj, transition: transitionObj }}></div>

+ 21 - 11
src/pages/platform/_layout.tsx

@@ -1,13 +1,13 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2022-03-29 16:31:14
+ * @LastEditTime: 2022-03-30 11:15:54
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/_layout.tsx
  */
 
-import { IRouteComponentProps, useModel } from 'umi';
+import { IRouteComponentProps, useModel, Helmet } from 'umi';
 // import { CrownOutlined, UserOutlined, SmileOutlined } from '@ant-design/icons';
 import ProLayout, { PageContainer } from '@ant-design/pro-layout';
 import { getPlatformMenu } from '@/service/menu';
@@ -19,7 +19,8 @@ import { useState } from 'react';
 export default function Layout({ children, location, route, history, match, ...rest }: IRouteComponentProps) {
   const { initialState, setInitialState } = useModel('@@initialState');
   const [openKeys, set_openKeys] = useState<string[]>([]);
-
+  const [selectedKeys, set_selectedKeys] = useState<string[]>([]);
+  // console.log({ children, location, route, history, match});
   return (
     <ProLayout
       style={{
@@ -28,9 +29,9 @@ export default function Layout({ children, location, route, history, match, ...r
       logoStyle={{
         display: 'none',
       }}
-      // location={{
-      //   pathname: '/platform/setting',
-      // }}
+      location={{
+            
+      }}
       disableContentMargin
       menuItemRender={(item, dom) => (
         <a
@@ -43,8 +44,12 @@ export default function Layout({ children, location, route, history, match, ...r
       )}
       menuProps={{
         openKeys: [...openKeys],
-        onOpenChange: (openKeys: string[]) => {
-          set_openKeys([...openKeys]);
+        selectedKeys: [...selectedKeys],
+        onSelect: ({ key, keyPath, selectedKeys, domEvent }) => {
+          set_selectedKeys(selectedKeys)
+        },
+        onOpenChange: (keys: string[]) => {
+          set_openKeys([...keys]);
         },
       }}
       menu={{
@@ -58,6 +63,7 @@ export default function Layout({ children, location, route, history, match, ...r
 
               if (menuData.length > 0) {
                 set_openKeys([menuData[0].key]);
+                set_selectedKeys([menuData[0].key]);
               }
 
               const getVFromTree = (data: TreeItemType[], key: string) => {
@@ -90,7 +96,7 @@ export default function Layout({ children, location, route, history, match, ...r
 
               // return [
               //   {
-              //     "path":"/platform/setting",
+              //     "path":"/platform",
               //     "name":"系统设置",
               //     "softUrl":"/","icon":"",
               //     "children":[
@@ -108,20 +114,24 @@ export default function Layout({ children, location, route, history, match, ...r
           return [];
         },
       }}
-      onPageChange={(location) => {}}
+      onPageChange={(location) => { }}
       layout="side"
       headerRender={false}
       navTheme="light"
     >
+      <Helmet>
+        <title>精益管理中台</title>
+      </Helmet>
       <PageContainer
         className="kcmpPageContainer"
         header={{
-          title: '',
+          title:false,
         }}
         style={{
           margin: 0,
         }}
       >
+
         <div className="page" style={{ height: 'calc(100vh - 98px)', overflowY: 'scroll' }}>
           {children}
         </div>

+ 0 - 43
src/pages/platform/index/index.tsx

@@ -1,43 +0,0 @@
-/*
- * @Author: your name
- * @Date: 2022-01-06 15:07:59
- * @LastEditTime: 2022-01-06 15:09:45
- * @LastEditors: Please set LastEditors
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /KC-MiddlePlatform/src/pages/platform/index.tsx
- */
-
-/*
- * @Author: your name
- * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2022-01-06 14:15:37
- * @LastEditors: Please set LastEditors
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
- */
-
-import { useState, useEffect } from 'react';
-import { useModel, history } from 'umi';
-
-const IndexPage = () => {
-  return (
-    <div className="indexPage">
-      PLATFORM
-      {/* <TopBar
-        openedTabs={openedTabs ? openedTabs : []}
-        onTabChange={(data) => {
-          onCurrentSystemChanged(data);
-        }}
-        sysList={selectableSysList}
-        currentTab={currentOpenedTab}
-        userPannelTabClick={(tag) => userPannelTabClick(tag)}
-      /> */}
-      {/* <MicroApp name='MedicalWisdomCheckSys' /> */}
-      {/* {openedTabs && (
-        <IframePage activedItem={currentOpenedTab} list={openedTabs} onload={onIframePageLoad} />
-      )} */}
-    </div>
-  );
-};
-
-export default IndexPage;