瀏覽代碼

修复角色菜单绑定时的回显bug

code4eat 1 年之前
父節點
當前提交
ec978d66a1

+ 5 - 1
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2023-09-26 16:55:19
+ * @LastEditTime: 2023-10-23 10:49:03
  * @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
@@ -67,6 +67,10 @@ export default defineConfig({
           path: '/pfmBackMana',
           microApp: 'pfmBackMana',
         },
+        {
+          path: '/CostAccountingSys',
+          microApp: 'CostAccountingSys',
+        },
         {
           path: '/channelIndex/channelIndexOne',
           component: '@/pages/channelIndex/channelIndexOne/index.tsx',

+ 1 - 1
config/proxy.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:00:52
- * @LastEditTime: 2023-09-26 14:22:34
+ * @LastEditTime: 2023-10-27 09:43:05
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/proxy.ts

+ 13 - 20
src/app.tsx

@@ -250,6 +250,7 @@ export const request: RequestConfig = {
 export const qiankun = async () => {
   console.log('process.env', process.env);
   const { NODE_ENV } = process.env;
+  //NODE_ENV == 'development'
   if (NODE_ENV == 'development') {
     return {
       apps: [
@@ -261,12 +262,12 @@ export const qiankun = async () => {
         //   name: 'app1', // 唯一 id
         //   entry: '//120.27.235.181:8804',  //测试
         // },
-        {
-          name: 'reviewMana', // 唯一 id
-          entry: '//120.27.235.181:5000/pfmview/',
-          //entry: '//localhost:8804',  //本地调试
-          //entry: '//198.198.203.161:5000/pfmview/', //淮南
-        },
+        // {
+        //   name: 'reviewMana', // 唯一 id
+        //   entry: '//120.27.235.181:5000/pfmview/',
+        //   //entry: '//localhost:8804',  //本地调试
+        //   //entry: '//198.198.203.161:5000/pfmview/', //淮南
+        // },
         {
           name: 'budgetManaSystem', // 唯一 id
           //entry: '//localhost:8002',
@@ -276,31 +277,23 @@ export const qiankun = async () => {
         },
         {
           name: 'pfmBackMana', // 唯一 id
+          //entry: '//localhost:8001'
+          entry: '//120.27.235.181:5000/pfmManager/', // 开发
+        },
+        {
+          name: 'CostAccountingSys', // 唯一 id
           entry: '//localhost:8001'
-          //entry: '//120.27.235.181:5000/pfmManager/', // 开发
+          //entry: '//120.27.235.181:5000/costAccount/', // 开发
         },
       ]
     }
   }else{
-    // addQiankunMicroApps({
-    //   name:'pfmBackMana',
-    //   entry: '//120.27.235.181:5000/pfmManager/'
-    // });
-    const apps = localStorage.getItem('apps');
-
-    if(apps){
-      return {
-        apps: JSON.parse(apps)
-      }
-    }else{
       const resp = await getQiankunMicroApps();
       if (resp) {
-        localStorage.setItem('apps',JSON.stringify(resp.list));
         return {
           apps:resp.list?resp.list:resp
         }
       }
-    }
   }
   
 }

+ 2 - 1
src/global.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-12-21 11:05:37
- * @LastEditTime: 2023-06-12 10:44:24
+ * @LastEditTime: 2023-10-24 16:40:54
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/global.tsx
@@ -23,6 +23,7 @@ export const logoutHandle = async () => {
   localStorage.removeItem('initialState');
   localStorage.removeItem('currentSelectedTab');
   //localStorage.removeItem('isChildShowMenu');
+ 
   localStorage.removeItem('selectedKeys');
   localStorage.removeItem('openKeys');
   // localStorage.removeItem('visitedTabs');

+ 16 - 9
src/pages/index/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2023-06-13 09:59:01
+ * @LastEditTime: 2023-10-08 14:43:17
  * @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
@@ -104,6 +104,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
       const needItem = resp.filter((a: any) => a.code == '1644270043527254016');
       const userData = localStorage.getItem('userData');
       let token = '';
+      
       if (userData) {
         const { youshuToken } = JSON.parse(userData);
         token = youshuToken
@@ -113,6 +114,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
         setspecialPageUrl(`http://eastern1.kcim-bi.163yun.com/dash/integration/56?rid=${needItem[0].value}&toolbar=[]&hideTitle=true&hideScaleBar=false&&scale=screen&hidePageBar=false&token=${token}`);
       }
     }
+
   }
 
 
@@ -205,14 +207,19 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
           <TodoList todoList={todoList} todoListClickHandle={todoListClickHandle} />
           <MsgRecord list={msgRecord} />
         </div>
-        <div className='iframe'>
-          <Skeleton loading={iframeLoading} paragraph={{ rows: 50 }} active />
-          <iframe
-            onLoad={() => onLoadhandle()}
-            style={{ width: '100%', height: 'calc(100vh - 40px)', border: 'none' }}
-            src={specialPageUrl}
-          ></iframe>
-        </div>
+        {
+          specialPageUrl&&(
+            <div className='iframe'>
+            <Skeleton loading={iframeLoading} paragraph={{ rows: 50 }} active />
+            <iframe
+              onLoad={() => onLoadhandle()}
+              style={{ width: '100%', height: 'calc(100vh - 40px)', border: 'none' }}
+              src={specialPageUrl}
+            ></iframe>
+          </div>
+          )
+        }
+       
       </div>
 
     </div>

+ 2 - 7
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2023-09-21 17:14:23
+ * @LastEditTime: 2023-10-24 16:55:59
  * @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
@@ -319,14 +319,9 @@ export default function Layout({ children, location, route, history, match, ...r
                   }
                 }
 
+             
               }
 
-              // console.log({homePage})
-              // return [...menuData, {
-              //   name: 'SQL编辑器',
-              //   path: '/platform/sqlEditer'
-              // }];
-
               const addIcon = (arr: any) => arr.map((item: any) => (item.children ? {
                 ...item,
                 icon: <FolderOutlined />,

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2023-09-15 16:59:22
+ * @LastEditTime: 2023-10-26 13:31:16
  * @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
@@ -686,7 +686,7 @@ const DrawerActBtn = ({ record }: { record: any }) => {
                     //更新表格row选中状态
                     if (record.type == 0) {
                       //选中的是目录
-                      const ids = record.children.map((item: any) => item.menuId);
+                      const ids = record.children?record.children.map((item: any) => item.menuId):[record.menuId];
                       const totalData = Array.from(new Set([...checkedTableMenuIds, ...ids]));
 
                       set_checkedTableMenuIds([...totalData]);

+ 4 - 4
src/pages/platform/setting/roleManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2023-09-20 15:51:06
+ * @LastEditTime: 2023-10-27 10:11:59
  * @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
@@ -404,7 +404,6 @@ const DrawerActBtn = ({ record }: { record: any }) => {
       roleId: record.roleId, function: [],
     }));
 
-    console.log({checkedTableMenuIds});
 
 
     const data = {
@@ -420,6 +419,7 @@ const DrawerActBtn = ({ record }: { record: any }) => {
       set_drawerTablereload(true);
       set_checkBoxCodes([]);
       set_checkedTableMenuIds([]);
+      setInitCheckData();
     }
 
   }
@@ -445,7 +445,7 @@ const DrawerActBtn = ({ record }: { record: any }) => {
 
 
   useEffect(() => {
-    console.log({currentSelectedTreeNode});
+
     if (currentSelectedTreeNode && !currentSelectedTreeNode.children) {  
 
       // setInitCheckData(); 
@@ -476,7 +476,7 @@ const DrawerActBtn = ({ record }: { record: any }) => {
   }, [treeData]);
 
   useEffect(()=>{
-       console.log({checkedMenuParentsIds});
+
   },[checkedMenuParentsIds])