浏览代码

修复bug

code4eat 3 年之前
父节点
当前提交
6e2067f2df

+ 1 - 1
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2022-07-06 15:35:23
+ * @LastEditTime: 2022-07-07 18:14: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

+ 1 - 1
src/pages/index/components/MsgRecord/style.less

@@ -24,7 +24,7 @@
 
   .wrap {
     display: flex;
-    flex-direction: row;
+    flex-direction:column;
     flex-wrap: wrap;
     padding: 16px;
 

+ 6 - 7
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: 2022-07-07 10:15:33
+ * @LastEditTime: 2022-07-07 17:53:44
  * @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
  */
@@ -36,10 +36,9 @@ export const TodoList = (props:TodoList) => {
     const [todoLists, set_todoLists] = useState<todoItem[]>([]);
 
     const setTodoClass = (val:todoItem)=>{
-           
-        if(val.taskLevel == 3)return 'todoList green';
-        if(val.taskLevel == 2)return 'todoList orange';
-        if(val.taskLevel == 1)return 'todoList red';
+        if(val.taskLevel == 3)return 'todoStatus green';
+        if(val.taskLevel == 2)return 'todoStatus orange';
+        if(val.taskLevel == 1)return 'todoStatus red';
     }
 
     const checkBtnHandle = (item:todoItem)=>{
@@ -60,10 +59,10 @@ export const TodoList = (props:TodoList) => {
                 {
                     todoLists.map((item, index) => {
                         return (
-                            <div className={setTodoClass(item)} key={index}>
+                            <div className='todoList'  key={index}>
                                    <div className='checkBtn' onClick={()=>checkBtnHandle(item)}></div>
                                    <div className='status'>
-                                         <div className='todoStatus'>医务管理系统 / 医资授予</div>
+                                         <div className={setTodoClass(item)}>医务管理系统 / 医资授予</div>
                                          <span className='date'>{item.createDate}</span>
                                    </div>
                                    <div className='detail' dangerouslySetInnerHTML={{__html:item.content}}></div>

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-10 09:33:30
- * @LastEditTime: 2022-07-07 10:17:22
+ * @LastEditTime: 2022-07-07 17:53:03
  * @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
@@ -65,6 +65,7 @@ const IndexPage: React.FC<IndexPageType> = ({ location }) => {
           set_fastEntry(fastEntryList);
 
           set_todoList(resp.todoList.map((t:any)=>({
+            id:t.id,
             status:1,
             content:t.content,
             createDate:t.createDate,

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2022-07-06 15:41:35
+ * @LastEditTime: 2022-07-07 18:19: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/_layout.tsx
@@ -37,7 +37,7 @@ export default function Layout({ children, location, route, history, match, ...r
       menuItemRender={(item, dom) => (
         <a
           onClick={() => {
-            history.push(item.path || '/');
+            history.push( `${item.path}${item.contentType == 4?'?isEmpty=true':''}` || '/');
           }}
         >
           {dom}
@@ -63,10 +63,10 @@ export default function Layout({ children, location, route, history, match, ...r
             const systemId = initialState.currentSelectedSys?.menuId;
             if (systemId) {
               const menuData = await getPlatformMenu(Number(systemId));
-
+              // console.log({menuData});
               if (menuData.length > 0) {
-                set_openKeys([menuData[0].key, menuData[0].children[0].key]);
-                set_selectedKeys([menuData[0].key, menuData[0].children[0].key]);
+                set_openKeys([menuData[0].key]);
+                set_selectedKeys([menuData[0].key]);
               }
 
               const getVFromTree = (data: TreeItemType[], key: string) => {
@@ -112,6 +112,13 @@ export default function Layout({ children, location, route, history, match, ...r
       headerRender={false}
       navTheme="light"
     >
+      {
+        location.query.isEmpty == 'true'&&(
+             <div>
+                  <h1>空白</h1>
+             </div>
+        )
+      }
       <PageContainer
         className="kcmpPageContainer"
         header={{

+ 7 - 7
src/pages/platform/setting/hospManage/modals/modal.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-12 17:11:11
- * @LastEditTime: 2022-07-07 11:10:32
+ * @LastEditTime: 2022-07-07 16:26:50
  * @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
@@ -257,8 +257,8 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
               const resp = await getPlatformDictionary('HOSPITAL_LEVEL');
               if (resp) {
                 return resp[0].dataVoList.map((t) => ({
-                  label: t.value,
-                  value: t.code,
+                  label: t.code,
+                  value: t.value,
                 }));
               }
               return [];
@@ -278,8 +278,8 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
               const resp = await getPlatformDictionary('HOSPITAL_TYPE');
               if (resp) {
                 return resp[0].dataVoList.map((t) => ({
-                  label: t.value,
-                  value: t.code,
+                  label: t.code,
+                  value: t.value,
                 }));
               }
               return [];
@@ -299,8 +299,8 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
               const resp = await getPlatformDictionary('HOSPITAL_NATURE');
               if (resp) {
                 return resp[0].dataVoList.map((t) => ({
-                  label: t.value,
-                  value: t.code,
+                  label: t.code,
+                  value: t.value,
                 }));
               }
               return [];

+ 34 - 10
src/pages/platform/setting/menuManage/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2022-07-06 18:32:17
+ * @LastEditTime: 2022-07-07 18:03:47
  * @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
@@ -177,24 +177,48 @@ const MenuManage: FC<PageProps> = ({ menuManageModel: state, dispatch }) => {
 
     if (name) {
       //搜索菜单
-      const deeper = (data: MenuItemDataType[], keyword: string) => {
-        let result: MenuItemDataType[] = [];
+      // const deeper = (data: MenuItemDataType[], keyword: string) => {
+      //   let result: MenuItemDataType[] = [];
 
-        data.forEach((t, index) => {
-          if (t.name.includes(keyword)) {
-            result.push({ ...t, children: [] }); //不带出子集
+      //   data.forEach((t, index) => {
+      //     if (t.name.includes(keyword)) {
+      //       result.push({ ...t, children: [] }); //不带出子集
+      //     } else {
+      //       if (t.children && t.children.length > 0) {
+      //         result.push({ ...t, children: deeper(t.children, keyword) });
+      //       }
+      //     }
+      //   });
+      //   return result;
+      // };
+
+      let deeper = (data: MenuItemDataType[], keyword: string) => {
+        let newarr:MenuItemDataType[] = [];
+        data.forEach(element => {
+          if (element.name.indexOf(keyword) > -1) { // 判断条件
+            newarr.push(element);
           } else {
-            if (t.children && t.children.length > 0) {
-              result.push({ ...t, children: deeper(t.children, keyword) });
+            if (element.children && element.children.length > 0) {
+            
+            
+              let redata = deeper(element.children,keyword);
+              if (redata && redata.length > 0) {
+                let obj = {
+                  ...element,
+                  children: redata
+                };
+                newarr.push(obj);
+              }
             }
           }
         });
-        return result;
+        return newarr;
       };
+
       return {
         data: resp.list ? deeper(resp.list, name) : [],
         success: true,
-        total: resp.totalCount,
+        total: (deeper(resp.list, name)).length,
       };
     }
 

+ 24 - 3
src/pages/platform/setting/menuManage/modals/modal.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-12 17:11:11
- * @LastEditTime: 2022-07-07 11:03:29
+ * @LastEditTime: 2022-07-07 16:22: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/userManage/modal.tsx
@@ -14,7 +14,7 @@ import { menuManageModelState, Dispatch } from 'umi';
 
 import { Form } from 'antd'
 
-import { ProFormText, ProFormDependency, ProFormDigit, ProFormRadio } from '@ant-design/pro-form';
+import { ProFormText, ProFormDependency, ProFormDigit, ProFormRadio, ProFormTextArea } from '@ant-design/pro-form';
 import type { AddUsersDataType } from '@/service/user';
 import { randomString } from '@/utils';
 import { MenuTypes } from '@/constant';
@@ -253,6 +253,10 @@ const ActModal: React.FC<ActModalProps> = ({
                             label: '填报',
                             value: 3,
                           },
+                          {
+                            label: '空白',
+                            value: 4,
+                          },
                         ]}
                         rules={[
                           {
@@ -275,11 +279,12 @@ const ActModal: React.FC<ActModalProps> = ({
                           },
                         ]}
                       />
+
                       <ProFormDependency name={['contentType']}>
                         {({ contentType }) => {
                           return (
                             contentType &&
-                            contentType != 0 && (
+                            contentType != 0 && contentType != 4 &&(
                               //页面内容为非一般时,填写对应有数Id
                               <ProFormDigit
                                 label="报告Id"
@@ -302,6 +307,22 @@ const ActModal: React.FC<ActModalProps> = ({
                 );
               }}
             </ProFormDependency>
+            <ProFormDependency name={['contentType']}>
+              {
+                ({ contentType }) => {
+                  if (contentType == 4) {
+                    return (
+                      <ProFormTextArea
+                        name="description"
+                        label="空白页描述"
+                        placeholder="请输入"
+                        fieldProps={{}}
+                      />
+                    )
+                  }
+                }
+              }
+            </ProFormDependency>
           </>
         )
       }

+ 2 - 2
src/pages/platform/setting/menuManage/model.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-12 10:12:55
- * @LastEditTime: 2022-07-06 18:34:46
+ * @LastEditTime: 2022-07-07 16:23:55
  * @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/model.ts
@@ -116,7 +116,7 @@ const menuManageModel: menuManageModelType = {
           menuId: undefined,
         }),
       );
-      yield editMenu({ ..._currentEditOld, ...payload,children:undefined,isHomepage:_currentEditOld.isHomepage?_currentEditOld.isHomepage:0});
+      yield editMenu({ ..._currentEditOld, ...payload,children:undefined});
       yield put({
         type: 'reloadTable',
         payload: true,