code4eat 3 лет назад
Родитель
Сommit
8bd037458e

+ 17 - 9
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-01 13:13:35
+ * @LastEditTime: 2022-01-14 09:52:16
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/config/config.ts
@@ -18,7 +18,15 @@ const { REACT_APP_ENV } = process.env;
 
 export default defineConfig({
   hash: true,
-  antd: {},
+  antd:{
+    config:{
+      prefixCls: 'mwc-ant',
+      // getPopupContainer:(triggerNode:HTMLElement)=>triggerNode
+    }
+  },
+  lessLoader: {
+    modifyVars: { '@ant-prefix': 'mwc-ant' } 
+  }, //对应修改生成的 antd 样式类名
   dva: {
     hmr: true,
   },
@@ -38,7 +46,7 @@ export default defineConfig({
   routes,
   theme: {
     'primary-color': defaultSettings.primaryColor,
-    
+    '@ant-prefix': 'mwc-ant'
   },
   // esbuild is father build tools
   // https://umijs.org/plugins/plugin-esbuild
@@ -69,13 +77,13 @@ export default defineConfig({
     },
   ],
   nodeModulesTransform: { type: 'none' },
-  mfsu: {
-    // production: { output: '.mfsu-production' }
-  },
+  // mfsu: {
+  //   // production: { output: '.mfsu-production' }
+  // },
   // webpack5: {
   // },
   exportStatic: {},
-  // qiankun: {
-  //   slave: {},
-  // },
+  qiankun: {
+    slave: {},
+  },
 });

+ 5 - 4
config/defaultSettings.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2021-12-27 16:34:38
+ * @LastEditTime: 2022-01-14 10:41:15
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/config/defaultSettings.ts
@@ -16,11 +16,12 @@ const Settings: LayoutSettings & {
 } = {
   navTheme: 'light',
   // 拂晓蓝
-  primaryColor: '#00528E',
-  layout: 'mix',
+  primaryColor: '#3071f2',
+  layout: 'side',
+  headerRender:false,
   contentWidth: 'Fluid',
   fixedHeader: false,
-  fixSiderbar: true,
+  fixSiderbar: false,
   colorWeak: false,
   title: '医院智慧查检系统',
   pwa: false,

+ 1 - 1
config/proxy.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-05 17:06:44
+ * @LastEditTime: 2022-01-14 10:07:19
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/config/proxy.ts

+ 1 - 1
package.json

@@ -62,7 +62,7 @@
     "antd": "^4.14.0",
     "classnames": "^2.2.6",
     "lodash": "^4.17.11",
-    "moment": "^2.25.3",
+    "moment": "2.18.1",
     "omit.js": "^2.0.2",
     "react": "^16.0.0",
     "react-dev-inspector": "^1.1.1",

+ 7 - 7
src/app.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-05 09:22:09
+ * @LastEditTime: 2022-01-10 14:58:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/app.tsx
@@ -35,7 +35,6 @@ if(history){
   hospSign = history.location.query?.hospSign;
   if(!hospSign){
     hospSign = localStorage.getItem('hospSign');
-    console.log({'localStorage':hospSign});
   }
 }
 
@@ -75,12 +74,13 @@ export async function getInitialState(): Promise<{
   const fetchUserInfo = async () => {
     try {
       const userData = localStorage.getItem('userData');
+      console.log({userData});
       if(userData){
         return JSON.parse(userData);
       }
       throw Error;
     } catch (error) {
-        history.push(`${loginPath}?hospSign=${hospSign}`);    
+        // history.push(`${loginPath}?hospSign=${hospSign}`);    
     }
     return undefined;
   };
@@ -138,7 +138,7 @@ const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
   const userData = localStorage.getItem('userData');
   let authHeader = {token:''};
   
-
+  
   if(userData){
        const {token}:API.CurrentUserData = JSON.parse(userData);
        authHeader.token = token;
@@ -309,9 +309,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState,setInitialState }) =>
     onPageChange:() => {
       const { location } = history;
       // 如果没有登录,重定向到 login
-      if (!initialState?.currentUser && location.pathname !== loginPath) {
-        history.push(`${loginPath}?hospSign=${hospSign}`);
-      }
+      // if (!initialState?.currentUser && location.pathname !== loginPath) {
+      //   history.push(`${loginPath}?hospSign=${hospSign}`);
+      // }
     },
     menu: {
 

+ 4 - 2
src/components/MccsModal/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-08 17:09:34
- * @LastEditTime: 2021-12-09 09:08:37
+ * @LastEditTime: 2022-01-07 17:09:20
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /MedicalWisdomCheckSys/src/components/MccsModal/index.tsx
@@ -45,7 +45,9 @@ const MccsModal: React.FC<MccsModalProps> = (props) => {
       visible={visible}
       formRef={formRef}
       onVisibleChange={onVisibleChange}
-      modalProps={{destroyOnClose:true}}
+      modalProps={{
+        destroyOnClose:true,
+      }}
       {...restProps}
     >
       <MccsModalContext.Provider value={{formRef:formRef}}>

+ 3 - 3
src/components/MccsPageContainer/index.less

@@ -1,14 +1,14 @@
 
 
-.ant-pro-page-container-children-content {
+.mwc-ant-pro-page-container-children-content {
     padding: 0 !important;
     margin:0;
     margin-top: 16px;
 }
-.ant-pro-page-container {
+.mwc-ant-pro-page-container {
     padding: 0 !important;
     min-width: 1100px;
-    .ant-pro-grid-content {
+    .mwc-ant-pro-grid-content {
         padding:16px;
         padding-top: 0;
     }

+ 6 - 2
src/components/MccsTable/index.less

@@ -1,11 +1,11 @@
 
 
-.ant-card-body {
+.mwc-ant-card-body {
     padding: 0;
 }
 
 
-.ant-pro-table-search {
+.mwc-ant-pro-table-search {
     padding: 0;
     padding-bottom: 24px;
     .ant-form-item {
@@ -16,3 +16,7 @@
 .formGroup {
     margin-bottom: 20px;
 }
+
+.mwc-ant-form-item {
+    margin-bottom: 0;
+}

+ 12 - 12
src/global.less

@@ -9,37 +9,37 @@ body,
 
 //---------------custom------------
 
-@primary-color: #00528E !important;
+// @primary-color: #00528E !important;
 
-@primary-color-rgba:rgba(0,82,142,0.3);
+// @primary-color-rgba:rgba(0,82,142,0.3);
 @scoreA:#69D1CC;
 @scoreB:#80ABFF;
 @scoreC:#FFC080;
 @scoreD:#3377FF;
 @scoreE:#690;
 
-.ant-pro-sider-logo {
+.mwc-ant-pro-sider-logo {
    h1 {
     font-size:16px !important;
    }
 }
-.ant-menu-submenu-selected {
+.mwc-ant-menu-submenu-selected {
     //  color: @primary-color !important;
      .ant-menu-item-selected {
       // color: @primary-color !important;
      }
 }
 
-.ant-tree-checkbox-checked .ant-tree-checkbox-inner {
+.mwc-ant-tree-checkbox-checked .ant-tree-checkbox-inner {
   background-color: #00528E;
   border-color: #00528E;
 }
 
-.ant-tabs-top > .ant-tabs-nav::before {
+.mwc-ant-tabs-top > .ant-tabs-nav::before {
    border: none;
 }
 
-.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
+.mwc-ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
   color: #00528E;
   font-size: 16px;
   font-weight: bold;
@@ -47,7 +47,7 @@ body,
   text-shadow: 0 0 0.25px currentColor;
 }
 
-.ant-tabs-large > .ant-tabs-nav .ant-tabs-tab {
+.mwc-ant-tabs-large > .mwc-ant-tabs-nav .mwc-ant-tabs-tab {
   padding: 16px 0;
   font-size: 16px;
   padding-bottom:10px;
@@ -60,10 +60,10 @@ body,
   filter: invert(80%);
 }
 
-.ant-layout {
+.mwc-ant-layout {
   min-height: 100vh;
 }
-.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
+.mwc-ant-pro-sider.mwc-ant-layout-sider.mwc-ant-pro-sider-fixed {
   left: unset;
 }
 
@@ -83,7 +83,7 @@ ol {
 }
 
 @media (max-width: @screen-xs) {
-  .ant-table {
+  .mwc-ant-table {
     width: 100%;
     overflow-x: auto;
     &-thead > tr,
@@ -101,7 +101,7 @@ ol {
 
 // Compatible with IE11
 @media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) {
-  body .ant-design-pro > .ant-layout {
+  body .mwc-ant-design-pro > .mwc-ant-layout {
     min-height: 100vh;
   }
 }

+ 2 - 5
src/global.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2022-01-01 16:17:14
+ * @LastEditTime: 2022-01-14 11:37:33
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/global.tsx
@@ -19,10 +19,7 @@ const isHttps = document.location.protocol === 'https:';
     
   // if pwa is true
 if (pwa) {
-  // Notify user if offline now
-  window.addEventListener('sw.offline', () => {
-    message.warning('app.pwa.offline');
-  });
+
 
   // Pop up a prompt on the page asking the user if they want to use the latest version
   window.addEventListener('sw.updated',(event: Event) => {

+ 1 - 0
src/pages/GradeHospitalAccreditation/accreditationDetail/components/materialTable/style.less

@@ -19,6 +19,7 @@
         justify-content: space-between;
         align-items: center;
         padding-bottom: 16px;
+        // margin-top: 16px;
         margin-bottom: 16px;
         border-bottom:  1px solid #DADEE6;
         .tableTitle {

+ 7 - 7
src/pages/GradeHospitalAccreditation/articleManagement/index.less

@@ -1,28 +1,28 @@
 
 .ArticleManagement {
       //overwrite antd css
-.ant-col-6 {
+.mwc-ant-col-6 {
   margin-bottom: 10px;
 }
 
-.ant-space-align-center {
+.mwc-ant-space-align-center {
   align-items: flex-start;
 }
 
-.ant-pro-table-search {
+.mwc-ant-pro-table-search {
   padding-bottom: 0;
 }
 
-.ant-pro-page-container-warp {
+.mwc-ant-pro-page-container-warp {
   display: none !important;
 }
 
-.ant-pro-card-col {
+.mwc-ant-pro-card-col {
   transition: width 0.2s ease-in;
   transform: translate3d(0,0,0);
 }
 
-textarea.ant-input {
+textarea.mwc-ant-input {
   font-size: 14px !important;
   font-family: SourceHanSansCN-Normal, SourceHanSansCN;
   font-weight: 400;
@@ -125,7 +125,7 @@ textarea.ant-input {
     background-color: #FFFFFF;
   }
 
-  .ant-form-item {
+  .mwc-ant-form-item {
     margin-bottom: 0;
   }
 }

+ 1 - 1
src/pages/document.ejs

@@ -18,7 +18,7 @@
     <title>医院智慧查检系统</title>
     <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
   </head>
-  <body>
+  <body >
     <noscript>
       <div class="noscript-container">
         Hi there! Please