Przeglądaj źródła

修复首页快速入口跳转&添加v0.1.2页面

code4eat 2 lat temu
rodzic
commit
7e4370c4ad

+ 9 - 1
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2023-02-27 10:04:38
+ * @LastEditTime: 2023-03-06 15:01:40
  * @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
@@ -100,6 +100,14 @@ export default defineConfig({
             //   path: '/platform/setting/reports',
             //   component: '@/pages/platform/setting/reports/index.tsx',
             // },
+            {
+              path: '/platform/setting/pubDicTypeMana',
+              component: '@/pages/platform/setting/pubDicTypeMana/index.tsx',
+            },
+            {
+              path: '/platform/setting/pubDicMana',
+              component: '@/pages/platform/setting/pubDicMana/index.tsx',
+            },
             {
               path: '/platform/setting/indicatorMana',
               component: '@/pages/platform/setting/indicatorMana/index.tsx',

+ 22 - 0
mock/pubDicType.ts

@@ -0,0 +1,22 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 17:08:00
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-06 16:12:47
+ * @FilePath: /KC-MiddlePlatform/mock/pubDicType.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { Request, Response } from 'express';
+
+const getMenu = (req: Request, res: Response) => {
+    const result = { "status": 200, "msg": "返回成功", "data": { "totalCount": 22, "pageSize": 10, "totalPage": 3, "current": 1, "list": [{ "dictId": "1", "dictName": "资质项目类型", "dictType": "QUALIFICATION_PROJECT_TYPE", "status": "1", "remark": "资质类型列表", "hospId": "0", "hospName": "所有院区" }] } }
+
+    return res.json(result);
+};
+
+export default {
+    //'GET /gateway/sysdictdata/getDictType': getMenu,
+};

BIN
public/images/kc-logo.png


+ 1 - 1
src/app.tsx

@@ -107,7 +107,7 @@ const requestInterceptorsHandle = (url: string, options: RequestOptionsInit) =>
 
   return {
     url: `/gateway${url}`,
-    options: { ...options, interceptors: true, headers: authHeader },
+    options: { ...options, interceptors: true, headers: authHeader,timeout:100000000, },
   };
 };
 

+ 57 - 0
src/components/KCInput/index.tsx

@@ -0,0 +1,57 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 15:18:14
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-03 17:15:26
+ * @FilePath: /KC-MiddlePlatform/src/components/KCInput/index.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+import { createFromIconfontCN } from '@ant-design/icons';
+import {ProFormText } from '@ant-design/pro-form'
+import { ProFormFieldItemProps } from '@ant-design/pro-form/lib/interface'
+
+import { Input, InputProps, InputRef } from 'antd';
+import Password from 'antd/lib/input/Password';
+
+
+
+export type KCInput = ProFormFieldItemProps<InputProps, InputRef> & {
+    Password?: typeof Password;
+    search?:boolean; //开启搜索输入
+    onChange?:(e: any)=>void;
+    onSearch?:()=>void;
+    style?: React.CSSProperties | undefined;
+    placeholder?: string | undefined
+
+}
+
+const IconFont = createFromIconfontCN({
+    scriptUrl: '//at.alicdn.com/t/c/font_1927152_4nm5kxbv4m3.js',
+});
+
+
+export const KCInput = (props:KCInput) => {
+
+  const {
+    fieldProps,search,onChange,onSearch = ()=>{},
+    style,
+    placeholder,
+    ...rest
+  } = props;
+
+  if(search){
+     return (
+        <Input allowClear  onChange={(e)=>onChange&&onChange(e)} placeholder={placeholder} style={{...style}} suffix={
+            <IconFont type="iconsousuo" onClick={() => onSearch()} />
+        }
+        onPressEnter={()=>onSearch()}
+        />
+     )
+  }
+  
+  return (
+    <ProFormText  {...rest} style={{...style}} placeholder={placeholder} fieldProps={{...fieldProps}} />
+  )
+}

+ 35 - 11
src/components/kcTable/index.tsx

@@ -1,8 +1,8 @@
 /*
  * @Author: your name
  * @Date: 2022-01-11 16:03:24
- * @LastEditTime: 2022-01-19 16:23:23
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2023-03-03 16:12:49
+ * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/components/kcTable/index.tsx
  */
@@ -15,6 +15,7 @@ import './style.less';
 const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
   columns,
   reload,
+  newVer,
   ...restProps
 }) => {
   const [tableColumns, setTableColumns] = useState<ProColumns[]>([]);
@@ -35,15 +36,38 @@ const KCTable: React.FC<KCTableType.KCTableProps<any, {}>> = ({
     }
   }, [reload]);
 
-  return (
-    <ProTable
-      className="KCTable"
-      actionRef={actionRef}
-      columns={tableColumns}
-      pagination={{ defaultPageSize: 10 }}
-      {...restProps}
-    />
-  );
+  if(newVer){
+    return (
+      <ProTable
+        tableStyle={{
+          border: '1px solid #DAE2F2',
+          borderRadius:4
+        }}
+        toolBarRender={false}
+        search={false}
+        className="KCTable"
+        actionRef={actionRef}
+        columns={tableColumns}
+        pagination={{ defaultPageSize: 10 }}
+        {...restProps}
+      />
+    );
+  }else{
+    return (
+      <ProTable
+        tableStyle={{
+          border: '1px solid #DAE2F2',
+          borderRadius:4
+        }}
+        className="KCTable"
+        actionRef={actionRef}
+        columns={tableColumns}
+        pagination={{ defaultPageSize: 10 }}
+        {...restProps}
+      />
+    );
+  }
+
 };
 
 export default KCTable;

+ 52 - 0
src/components/kcTable/style.less

@@ -1,2 +1,54 @@
 .KCTable {
+   
+  .kcmp-ant-card {
+    border-radius: 4px;
+    overflow: hidden;
+  }
+  .kcmp-ant-card-body {
+    padding: 16px;
+  }
+  .kcmp-ant-table-thead>tr>th {
+    background: #EEF3FA;
+    border-bottom: 1px solid #DAE2F2;
+  }
+
+  .kcmp-ant-table-thead > tr > th:not(:last-child):not(.kcmp-ant-table-selection-column):not(.kcmp-ant-table-row-expand-icon-cell):not([colspan])::before {
+       display: none;
+  }
+
+
+  .kcmp-ant-table-tbody>tr>td {
+    border-bottom: 1px solid #DAE2F2;
+  }
+
+  .kcmp-ant-table-tbody > tr.kcmp-ant-table-row:hover > td, .kcmp-ant-table-tbody > tr > td.kcmp-ant-table-cell-row-hover {
+        background: #F5F7FA;
+  }
+
+  .kcmp-ant-table-row {
+       .kcmp-ant-space {
+        gap: 8px !important;
+       }
+       .kcmp-ant-table-cell-row-hover {
+            
+       }
+  }
+
+  .kcmp-ant-pagination {
+    padding-right: 16px;
+
+    .kcmp-ant-pagination-item {
+      border: 1px solid #DAE2F2 !important;
+      border-radius: 4px !important;
+      margin-right: 8px;
+
+      &.kcmp-ant-pagination-item-active {
+        background: #3377FF;
+
+        &>a {
+          color: #fff;
+        }
+      }
+    }
+  }
 }

+ 9 - 4
src/components/kcTable/typing.d.ts

@@ -1,17 +1,22 @@
 /*
  * @Author: your name
  * @Date: 2022-01-11 16:24:23
- * @LastEditTime: 2022-01-13 10:26:42
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2023-03-03 16:18:48
+ * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/components/kcTable/typing.d.ts
  */
 
 import { ProColumns, ProTableProps } from '@ant-design/pro-table';
 
+
+type ParamsType = {
+  [x: string]: any;
+}
 declare namespace KCTableType {
-  export interface KCTableProps<T, U> extends ProTableProps<T, U> {
-    columns: ProColumns<T, 'text'>[];
+  export interface KCTableProps<T, U extends ParamsType> extends ProTableProps<T, U> {
+    columns: ProColumns<any, 'text'>[];
     reload?: boolean;
+    newVer?:boolean,
   }
 }

+ 15 - 11
src/components/topBar/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-16 09:12:37
- * @LastEditTime: 2023-02-27 15:12:27
+ * @LastEditTime: 2023-03-07 16:03:00
  * @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
@@ -41,12 +41,14 @@ const TopBar: React.FC<TopBarType> = (props) => {
   const [currentSelectedTab, setCurrentSelectedTab] = useState<TopBar.Tab>();
   const [ifOpenPannel, setIfOpenPannel] = useState(false);
   const [arrowRotate, setArrowRotate] = useState(false);
-  const [pageTitle, set_pageTitle] = useState('我的系统');
+  const [pageTitle, set_pageTitle] = useState('欢迎进入医管平台');
   const [currentActivedBlockIndex, set_currentActivedBlockIndex] = useState(0);
   const [panelData, set_panelData] = useState<TopBar.PanelData[]>([]);
 
   const [onTabSystemTabs,set_onTabSystemTabs] = useState<TopBar.Tab[]>([]); //tab导航可以放下的数量,剩余通过下拉获取
 
+  const { initialState, setInitialState } = useModel('@@initialState');
+
 
   const localSavedTab = localStorage.getItem('currentSelectedTab');
 
@@ -147,6 +149,9 @@ const TopBar: React.FC<TopBarType> = (props) => {
     set_pageTitle('欢迎进入医管平台');
     setIfOpenPannel(false);
     localStorage.removeItem('currentSelectedTab');
+    localStorage.removeItem('selectedKeys');
+    localStorage.removeItem('visitedTabs');
+    localStorage.removeItem('openKeys');
   }
 
   const goSystemIndex = (name:string)=>{
@@ -202,9 +207,12 @@ const TopBar: React.FC<TopBarType> = (props) => {
 
       if (_panelData && _panelData.length > 0 && _panelData[blockIndex].child) {
         setSystemTabs(_panelData[blockIndex].child[channelIndex].child);  //恢复体系列表
+        setCurrentSelectedTab(_currentSelectedTabFromLocal);
+        localStorage.setItem('currentSelectedTab', JSON.stringify(_currentSelectedTabFromLocal));
+        setInitialState((s) => ({ ...s, currentSelectedSys: _currentSelectedTabFromLocal }));
       }
-
-      _systemTabClickHandle(_currentSelectedTabFromLocal);  //恢复选中的tab
+      
+      //_systemTabClickHandle(_currentSelectedTabFromLocal);  //恢复选中的tab
   
 
     }
@@ -212,7 +220,7 @@ const TopBar: React.FC<TopBarType> = (props) => {
 
   useEffect(() => { 
     if (currentSelectedTabFromLocal) {
-      //reSetNav(navData, currentSelectedTabFromLocal);
+      reSetNav(navData, currentSelectedTabFromLocal);
     }
       
     set_panelData(navData);
@@ -221,14 +229,10 @@ const TopBar: React.FC<TopBarType> = (props) => {
   useEffect(()=>{
 
     if(currentTab)reSetNav(panelData,currentTab);
- 
+     
   },[currentTab]);
 
-  // useEffect(()=>{
-  //   if(currentSelectedSys){
-  //     onTabClickHandle(currentSelectedSys);
-  //   }
-  // },[currentSelectedSys])
+ 
 
 
   useEffect(()=>{

+ 2 - 2
src/components/topBar/style.less

@@ -47,8 +47,8 @@
     width: 350px;
 
     .logo {
-      width: 108px;
-      height: 18px;
+      width: 120px;
+      height: 24px;
     }
 
     .systemTitle {

+ 224 - 17
src/global.less

@@ -1,4 +1,3 @@
-
 * {
   margin: 0;
   padding: 0;
@@ -11,8 +10,8 @@ input {
 
 //overwrite antd-pro css
 
-.kcmp-ant-pro-global-header {
-  padding: 0 !important;
+.kcmp-ant-pro-page-container-warp {
+  display: none !important;
 }
 
 .kcmp-ant-pro-sider-light {
@@ -23,29 +22,237 @@ input {
   max-width: 100%;
 }
 
+.kcmp-ant-layout {
+  background: #F5F7FA;
+}
+
+.kcmp-ant-pro-table-search {
+  padding: 16px;
+  padding-bottom: 16px;
+}
+
+.kcmp-ant-form-item {
+  margin-bottom: 16px;
+}
+
+
+/**
+      input 
+**/
+.kcmp-ant-input-affix-wrapper {
+  padding: 0px 8px;
+  border-radius: 4px;
+  border: 1px solid #CFD7E6;
+
+  &>input {
+    &::placeholder {
+      font-size: 14px;
+      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+      font-weight: 400;
+      color: #99A6BF;
+    }
+  }
+}
+
+
+/**
+    Form
+**/
+
+.kcmp-ant-form-item {
+  .kcmp-ant-form-item-label {
+    padding: 0;
+    //height: 15px;
+    line-height: 15px;
+    margin-bottom: 5px;
+
+    .kcmp-ant-form-item-required {
+      &::before {
+        margin-right: 0 !important;
+      }
+    }
+  }
+
+  .kcmp-ant-form-item-control-input {
+
+    .kcmp-ant-form-item-control-input-content {
+      textarea {
+        padding: 4px 8px;
+        border-radius: 4px !important;
+        border: 1px solid #CFD7E6;
+      }
+
+      .kcmp-ant-input {
+
+        //padding-left: 8px;
+        &::placeholder {
+          color: #99A6BF;
+        }
+      }
+    }
+  }
+}
+
+
+/**
+    input-number
+**/
+
+.kcmp-ant-input-number {
+  height: 24px;
+  border-radius: 4px;
+  border: 1px solid #CFD7E6;
+
+  .kcmp-ant-input-number-handler-wrap {
+    .kcmp-ant-input-number-handler {
+      border-left: 1px solid #CFD7E6;
+    }
+    .kcmp-ant-input-number-handler-down {
+      border-top: 1px solid #CFD7E6;
+    }
+    .kcmp-ant-input-number-handler-up-inner, .kcmp-ant-input-number-handler-down-inner {
+         color: #99A6BF;
+    }
+  }
+
+  .kcmp-ant-input-number-input-wrap {
+
+    .kcmp-ant-input-number-input {
+      height: 22px;
+      line-height: 24px;
+      padding: 0 8px;
+
+      &::placeholder {
+        color: #99A6BF;
+      }
+    }
+  }
+}
 
 
-div::-webkit-scrollbar{
-  width:2px;
-  height:2px;
+/**
+    Select
+**/
+.kcmp-ant-select {
+  .kcmp-ant-select-selector {
+    height: 24px !important;
+    padding: 0 8px !important;
+    border-radius: 4px !important;
+    border: 1px solid #CFD7E6 !important;
+
+    .kcmp-ant-select-selection-item {
+      line-height: 24px;
+    }
+
+    .kcmp-ant-select-selection-search-input {
+      height: 24px !important;
+    }
+
+    .kcmp-ant-select-selection-placeholder {
+      line-height: 22px !important;
+      font-size: 14px;
+      font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+      font-weight: 400;
+      color: #99A6BF;
+    }
+  }
+
+  .kcmp-ant-select-arrow {
+    color: #CFD7E6;
+  }
+
+  &.kcmp-ant-select-disabled {
+    .kcmp-ant-select-selector {
+      border: 1px solid #DADEE6 !important;
+
+      .kcmp-ant-select-selection-placeholder {
+        color: #7A8599;
+      }
+    }
+
+    .kcmp-ant-select-arrow {
+      color: #7A8599;
+    }
+  }
+}
+
+/**
+       ModalForm
+**/
+
+.kcmp-ant-modal {
+  padding-bottom: 0;
+  background: #FFFFFF;
+  border-radius: 8px;
+  overflow: hidden;
+
+  .kcmp-ant-modal-content {
+    .kcmp-ant-modal-close-x {
+      color: #17181A;
+    }
+
+    .kcmp-ant-modal-header {
+      padding: 16px;
+      font-size: 16px;
+      font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+      font-weight: 500;
+      color: #17181A;
+      border-bottom: none;
+    }
+
+    .kcmp-ant-modal-body {
+      padding: 0;
+      padding-left: 16px;
+      padding-right: 16px;
+    }
+
+    .kcmp-ant-modal-footer {
+      padding: 16px;
+      padding-top: 0;
+      border-top: none;
+
+      .kcmp-ant-btn {
+        height: 24px;
+        line-height: 13px;
+        border-radius: 4px;
+        padding: 5px 14px;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        box-sizing: border-box;
+      }
+    }
+  }
+}
+
+
+
+
+div::-webkit-scrollbar {
+  width: 2px;
+  height: 2px;
   /**/
 }
-div::-webkit-scrollbar-track{
-  background:transparent;
-  border-radius:2px;
+
+div::-webkit-scrollbar-track {
+  background: transparent;
+  border-radius: 2px;
 }
-div::-webkit-scrollbar-thumb{
+
+div::-webkit-scrollbar-thumb {
   background: #bfbfbf;
-  border-radius:10px;
+  border-radius: 10px;
 }
-div::-webkit-scrollbar-thumb:hover{
-  width:4px;
-  height:4px;
+
+div::-webkit-scrollbar-thumb:hover {
+  width: 4px;
+  height: 4px;
   background: rgb(136, 135, 135);
 }
-div::-webkit-scrollbar-corner{
-  background:rgb(136, 135, 135) ;
-  
+
+div::-webkit-scrollbar-corner {
+  background: rgb(136, 135, 135);
+
 }
 
 

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

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-05-27 14:17:59
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2022-07-12 09:48:06
+ * @LastEditTime: 2023-03-07 15:56:31
  * @FilePath: /KC-MiddlePlatform/src/pages/index/components/FastEntry/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -43,6 +43,7 @@ export const FastEntry = (props: FastEntryType) => {
 
     const tabClickHandle = async (tab: FastEntryTabType) => {
         await setInitialState((s) => ({ ...s, currentSelectedSys:tab as any,currentTab:tab})); 
+        history.push(tab.path)
     }
 
     

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

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2022-05-30 09:50:41
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2022-07-12 09:46:26
+ * @LastEditTime: 2023-03-07 16:00:57
  * @FilePath: /KC-MiddlePlatform/src/pages/index/components/RecentlyVisited/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -43,6 +43,7 @@ export const RecentlyVisited = (props:RecentlyVisitedPropsType) => {
         //更新currentSelectedSys/currentTab触发导航跳转
         console.log({val});
         await setInitialState((s) => ({ ...s, currentSelectedSys:val as any,currentTab:val})); 
+        history.push(val.path)
     }
 
     useEffect(()=>{

+ 47 - 29
src/pages/login/style.less

@@ -5,7 +5,7 @@
   width: 100%;
   height: 100vh;
   overflow: hidden;
- 
+
   .left {
     display: flex;
     justify-content: center;
@@ -14,32 +14,37 @@
     height: 100%;
     position: relative;
     background: #F7FAFC;
+
     .topLogo {
-        position: absolute;
-        top:40px;
-        left:40px;
-        display: flex;
-        flex-direction: row;
-        align-items: center;
-        .logo {
-          width: 160px;
-          height: 32px;
-        }
-        .logoDesc {
-          height: 16px;
-          font-size: 12px;
-          line-height: 16px;
-          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-          color: #7A8599;
-          margin-left: 16px;
-          padding-left: 16px;
-          border-left: 1px solid #CFD6E6;
-        }
+      position: absolute;
+      top: 40px;
+      left: 40px;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+
+      .logo {
+        width: 160px;
+        height: 32px;
+      }
+
+      .logoDesc {
+        height: 16px;
+        font-size: 12px;
+        line-height: 16px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        color: #7A8599;
+        margin-left: 16px;
+        padding-left: 16px;
+        border-left: 1px solid #CFD6E6;
+      }
     }
+
     .loginbanner {
       width: 70%;
     }
   }
+
   .rightLoginArea {
     position: relative;
     display: flex;
@@ -51,15 +56,17 @@
 
     .topLogo {
       position: absolute;
-      top:40px;
-      left:40px;
+      top: 40px;
+      left: 40px;
       display: flex;
       flex-direction: row;
       align-items: center;
+
       .logo {
         width: 160px;
         height: 32px;
       }
+
       .logoDesc {
         height: 16px;
         font-size: 12px;
@@ -70,16 +77,24 @@
         padding-left: 16px;
         border-left: 1px solid #CFD6E6;
       }
-  }
+    }
 
     .subHospSelector {
       margin-bottom: 24px;
+
       .kcmp-ant-select .kcmp-ant-select-selector {
-        border-radius: 16px;
+        border-radius: 16px !important;
         padding-left: 20px !important;
         background: #F5F7FA;
+        height: 32px !important;
+
+        .kcmp-ant-select-selection-item {
+            line-height:29px !important;
+        }
+
       }
     }
+
     .systemName {
       font-size: 32px;
       height: 32px;
@@ -89,6 +104,7 @@
       color: #1a2233;
       margin-bottom: 32px;
     }
+
     .input {
       width: 280px;
       height: 40px;
@@ -96,6 +112,7 @@
       border-radius: 4px;
       border: 1px solid #cfd7e6;
     }
+
     .loginBtn {
       width: 280px;
       height: 40px;
@@ -114,24 +131,24 @@
       border: none;
       outline: none;
     }
+
     .kcmp-ant-select-focused {
       border: none;
       outline: none;
     }
+
     .kcmp-ant-select-selector {
       border: none;
       outline: none;
     }
 
-    .kcmp-ant-select-focused:not(.kcmp-ant-select-disabled).kcmp-ant-select:not(.kcmp-ant-select-customize-input)
-      .kcmp-ant-select-selector {
+    .kcmp-ant-select-focused:not(.kcmp-ant-select-disabled).kcmp-ant-select:not(.kcmp-ant-select-customize-input) .kcmp-ant-select-selector {
       border-color: transparent;
       box-shadow: none;
       padding: 0;
     }
 
-    .kcmp-ant-select-single:not(.kcmp-ant-select-customize-input)
-      .kcmp-ant-select-selector {
+    .kcmp-ant-select-single:not(.kcmp-ant-select-customize-input) .kcmp-ant-select-selector {
       width: 100%;
       height: 32px;
       padding: 0;
@@ -154,6 +171,7 @@
       font-weight: 400;
       color: #515866;
     }
+
     .versionInfo {
       position: absolute;
       bottom: 30px;

+ 39 - 19
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2023-02-27 15:43:12
+ * @LastEditTime: 2023-03-07 16:28:14
  * @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
@@ -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 { pathname } = location;
 
   const setEmptyPageContent = async (menuId: Key) => {
     const menuItem = await getSpecifyMenuDetail(menuId);
@@ -47,9 +47,6 @@ export default function Layout({ children, location, route, history, match, ...r
 
   useEffect(() => {
 
-    // console.log({location});
-    // console.log(location.query.isEmpty == 'true');
-
     if (location.query.menuId) {
       setEmptyPageContent(location.query.menuId as string);
     }
@@ -57,8 +54,8 @@ export default function Layout({ children, location, route, history, match, ...r
     set_isEmpty(location.query.isEmpty == 'true');
   }, [location]);
 
- 
-  const adjustIframe = ()=>{
+
+  const adjustIframe = () => {
     // var ifm:any = document.getElementById("bi_iframe");
     // if(ifm){
     //   ifm.height=document.documentElement.clientHeight;
@@ -69,7 +66,7 @@ export default function Layout({ children, location, route, history, match, ...r
   //临时演示处理
 
   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 <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>;
   }
 
 
@@ -86,6 +83,8 @@ export default function Layout({ children, location, route, history, match, ...r
       location={{
 
       }}
+      headerContentRender={false}
+      headerRender={false}
       siderWidth={isShowPageMenu ? 220 : 0}
       pageTitleRender={false}
       disableContentMargin
@@ -105,10 +104,12 @@ export default function Layout({ children, location, route, history, match, ...r
         openKeys: [...openKeys],
         selectedKeys: [...selectedKeys],
         onSelect: ({ key, keyPath, selectedKeys, domEvent }) => {
-          set_selectedKeys(selectedKeys)
+          set_selectedKeys(selectedKeys);
+          localStorage.setItem('selectedKeys', JSON.stringify(selectedKeys));
         },
         onOpenChange: (keys: string[]) => {
           set_openKeys([...keys]);
+          localStorage.setItem('openKeys', JSON.stringify(keys));
         },
       }}
       menu={{
@@ -118,6 +119,7 @@ export default function Layout({ children, location, route, history, match, ...r
         },
         request: async () => {
 
+
           if (initialState && initialState.currentSelectedSys) {
             const { systemId, menuId, path } = initialState.currentSelectedSys;
             if (systemId || menuId) {
@@ -125,7 +127,6 @@ export default function Layout({ children, location, route, history, match, ...r
               const menuData = await getPlatformMenu(systemId || menuId);
               let homePage: TreeItemType | undefined;
 
-
               const getVFromTree = (data: TreeItemType[], key: string) => {
                 let result: SpacicalPageParamsType[] = [];
                 function looper(data: TreeItemType[], key: string) {
@@ -151,9 +152,12 @@ export default function Layout({ children, location, route, history, match, ...r
                 return result;
               };
 
+
               const _menu = getVFromTree(menuData, 'contentType');
 
 
+
+
               setInitialState((t) => ({ ...t, spacicalPageParamsType: _menu }));
 
               if (homePage) {
@@ -163,15 +167,30 @@ export default function Layout({ children, location, route, history, match, ...r
                 history.push(homePage.path);
 
               } else {
-           
+
+
+
                 if (path == '/platform') {
-                  if(menuData[0].children&&menuData[0].children.length>0){
 
-                    const childs = menuData[0].children;        
-                    set_openKeys([menuData[0].key]);
-                    set_selectedKeys([childs[0].key]);
-                    history.push(`${childs[0].path}`);
-                    
+                  const selectedKeys = localStorage.getItem('selectedKeys');
+                  const openKeys = localStorage.getItem('openKeys');
+
+                  if (selectedKeys&&openKeys) {
+                    const _selectedKeys = JSON.parse(selectedKeys);
+                    const _openKeys = JSON.parse(openKeys);
+                    set_openKeys(_openKeys);
+                    set_selectedKeys(_selectedKeys);
+                  } else {
+                    if (menuData[0].children && menuData[0].children.length > 0) {
+
+                      const childs = menuData[0].children;
+                      set_openKeys([menuData[0].key]);
+                      set_selectedKeys([childs[0].key]);
+                      localStorage.setItem('openKeys',JSON.stringify([menuData[0].key]));
+                      localStorage.setItem('selectedKeys',JSON.stringify([childs[0].key]));
+                      history.push(`${childs[0].path}`);
+
+                    }
                   }
                 }
 
@@ -194,9 +213,11 @@ export default function Layout({ children, location, route, history, match, ...r
 
               const result = addIcon(menuData);
 
+
               return [...result];
 
 
+
             }
             return [];
           }
@@ -205,7 +226,6 @@ export default function Layout({ children, location, route, history, match, ...r
       }}
       onPageChange={(location) => { }}
       layout="side"
-      headerRender={false}
       navTheme="light"
     >
       {
@@ -231,7 +251,7 @@ export default function Layout({ children, location, route, history, match, ...r
               <title>精益管理中台</title>
             </Helmet>
 
-            <div className="page" style={{ height: 'calc(100vh - 98px)', overflowY: 'scroll' }}>
+            <div className="page" style={{ height: 'calc(100vh - 80px)', overflowY: 'scroll' }}>
               {children}
             </div>
           </PageContainer>

+ 6 - 3
src/pages/platform/index.less

@@ -8,13 +8,16 @@
 }
 
 .kcmp-ant-page-header {
-  background-color: #f0f2f5;
+  background-color: #F5F7FA;
 }
 
 .kcmpPageContainer {
   .kcmp-ant-pro-page-container-children-content {
     margin: 0;
-    margin-left: 24px;
-    margin-right: 24px;
+    margin-top: 16px;
+    margin-left:16px;
+    margin-right:12px;
+    border-radius: 4px;
+    overflow: hidden;
   }
 }

+ 357 - 0
src/pages/platform/setting/pubDicMana/index.tsx

@@ -0,0 +1,357 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-07 16:52:55
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { KCInput } from '@/components/KCInput';
+import KCTable from '@/components/kcTable';
+import { getAllHosp } from '@/service/hospList';
+import { ModalForm, ProFormDigit, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
+import { ProColumns } from '@ant-design/pro-table';
+import { message, Popconfirm } from 'antd';
+import { useEffect, useState } from 'react';
+import { getData, PubDicTypeData } from '../pubDicTypeMana/service';
+import { addPubDicRelaTbaleData, editPubDicRelaTbaleData, getPubDicRelaTbaleData } from './service';
+
+
+import './style.less';
+
+
+
+const PubDicMana = () => {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+    const [reload, set_reload] = useState(false);
+    const [typeList, set_typeList] = useState<PubDicTypeData[]>([]);
+    const [showTypeListArr, set_showTypeListArr] = useState<PubDicTypeData[]>([]);
+    const [currentSelectedType, set_currentSelectedType] = useState<PubDicTypeData | undefined>(undefined);
+    const [currentEdit,set_currentEdit] = useState<any>(undefined);
+
+
+
+
+    const columns = [
+        {
+            title: '项目名称',
+            align: 'center',
+            dataIndex: 'name',
+
+        },
+        {
+            title: '项目代码',
+            align: 'center',
+            dataIndex: 'code',
+        },
+        {
+            title: '项目值',
+            align: 'center',
+            dataIndex: 'value',
+        },
+        {
+            title: '默认',
+            align: 'center',
+            dataIndex: 'data.0.dictDefault',
+            render: (_: any, record: number) => {
+                return record == 1 ? '是' : '否'
+            },
+
+        },
+        {
+            title: '序号',
+            align: 'center',
+            dataIndex: 'dictSort',
+
+        },
+        {
+            title: '适用院区',
+            align: 'center',
+            dataIndex: 'hospName',
+
+        },
+        {
+            title: '操作',
+            align: 'center',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={() => delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>
+                ]
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const { dictType } = params;
+        if (dictType) {
+            const resp = await getPubDicRelaTbaleData(params);
+            set_reload(false);
+            if (resp) {
+                return {
+                    data: resp,
+                    success: true,
+                    // total: resp.totalCount,
+                    // pageSize: resp.pageSize,
+                    // totalPage: resp.totalPage,
+                }
+            }
+        }
+        return []
+    }
+
+    const getTypeList = async () => {
+        const resp = await getData({ pageSize: 1000, current: 1 });
+        if (resp) {
+            set_typeList(resp.list);
+            set_showTypeListArr(resp.list);
+        }
+    }
+
+    const delTableData = async (record: any) => {
+        //   const resp = await delData(record.dictId);
+        //   if(resp){
+        //     set_reload(true);
+        //     message.success('操作成功!');
+        //   }
+    }
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+        if (type == 'EDIT') {
+            const {dictDataId} = currentEdit;
+            const resp = await editPubDicRelaTbaleData({...formVal,dictDataId});
+            if (resp) {
+                set_reload(true);
+            }
+        }
+        if (type == 'ADD') {
+            const resp = await addPubDicRelaTbaleData(formVal);
+            if (resp) {
+                set_reload(true);
+            }
+        }
+
+
+    }
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+        set_currentEdit(record);
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}公用字典(职称)`}
+                width={352}
+                initialValues={type == 'EDIT' ? { ...record } : {}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
+                }
+                onFinish={(val) => {
+                    return updateTable(val, type);
+                }}
+            >
+                <ProFormText
+                    name="name"
+                    label="项目名称:"
+                    placeholder="请输入"
+                    disabled={type == 'EDIT'}
+                    rules={[{ required: true, message: '项目名称不能为空!' }]}
+                />
+                <ProFormText
+                    name="code"
+                    label="项目代码:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '项目代码不能为空!' }]}
+                />
+                <ProFormText
+                    name="value"
+                    label="项目值:"
+                    placeholder="请输入"
+
+                />
+                <ProFormDigit label="顺序号:" name="dictSort" rules={[{ required: true, message: '顺序号不能为空!' }]} />
+
+                <ProFormRadio.Group
+                    name="dictDefault"
+                    label="默认:"
+                    fieldProps={{
+                        buttonStyle: 'solid'
+                    }}
+                    options={[
+                        {
+                            label: '是',
+                            value: 1,
+                        },
+                        {
+                            label: '否',
+                            value: 0,
+                        },
+                    ]}
+                    rules={[{ required: true, message: '默认不能为空!' }]}
+                />
+                <ProFormSelect
+                    name="hospId"
+                    label="适用院区:"
+                    placeholder="请选择院区"
+                    request={async () => {
+                        const resp = await getAllHosp({ pageSize: 200, current: 1 });
+                        if (resp) {
+                            const data: any = resp.list?.map((a) => ({
+                                label: a.hospName,
+                                value: a.id
+                            }));
+
+                            return [
+                                {
+                                    label:'所有院区',value:'0'
+                                },...data
+                            ];
+                        }
+                        return []
+
+                    }}
+                    rules={[{ required: true, message: '院区不能为空!' }]}
+                />
+
+            </ModalForm>
+        )
+    }
+
+    const editHandle = (record: any) => {
+
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+    }
+
+    useEffect(()=>{
+        if(currentSelectedType){
+            set_tableDataFilterParams({...tableDataFilterParams,dictType:currentSelectedType.dictType})
+        }
+    },[currentSelectedType])
+
+    useEffect(() => {
+        if (showTypeListArr.length > 0) {
+            set_currentSelectedType(showTypeListArr[0]);
+            set_tableDataFilterParams({ ...tableDataFilterParams, dictType: showTypeListArr[0].dictType });
+        }
+    }, [showTypeListArr])
+
+    useEffect(() => {
+        getTypeList();
+    }, [])
+
+    return (
+        <div className='PubDicMana'>
+            <div className='left'>
+                <KCInput placeholder={'请输入类型名称'} search allowClear
+                    onChange={(e) => {
+                        set_tableDataSearchKeywords(e.target.value);
+                        if (e.target.value.length == 0) {
+                            set_tableDataFilterParams({
+                                ...tableDataFilterParams,
+                                typeName: ''
+                            });
+                        }
+                    }}
+                    onSearch={() => tableDataSearchHandle('typeName')}
+
+                />
+                <div className='wrap'>
+                    {
+                        showTypeListArr.map((item, index) => {
+                            return (
+                                <div className={currentSelectedType ? currentSelectedType.dictId == item.dictId ? 'type on' : 'type' : 'type'}
+                                    key={index}
+                                    onClick={() => set_currentSelectedType(item)}
+                                >{item.dictName}</div>
+                            )
+                        })
+                    }
+                </div>
+            </div>
+            <div className='right'>
+                <div className='toolBar'>
+                    <div className='filter'>
+                        <div className='filterItem'>
+                            <span className='label'>适用院区:</span>
+                            <ProFormSelect
+                                noStyle
+                                allowClear
+                                placeholder="请选择"
+                                style={{ width: 160,marginRight:16}}
+                                request={async () => {
+                                    const resp = await getAllHosp({ pageSize: 200, current: 1 });
+                                    if (resp) {
+                                        const data: any = resp.list?.map((a) => ({
+                                            label: a.hospName,
+                                            value: a.id
+                                        }));
+
+                                        return [
+                                            {
+                                                label:'所有院区',value:'0'
+                                            },...data
+                                        ];
+                                    }
+                                    return []
+
+                                }}
+                                fieldProps={{
+                                    onChange(value, option) {
+                                        set_tableDataFilterParams({...tableDataFilterParams,hospId:value})
+                                    },
+                                }}
+                            />
+                        </div>
+                        <div className='filterItem'>
+                            <span className='label'>检索:</span>
+                            <KCInput placeholder={'请输入项目名称'} style={{ width: 160 }} search allowClear
+                                onChange={(e) => {
+                                    set_tableDataSearchKeywords(e.target.value);
+                                    if (e.target.value.length == 0) {
+                                        set_tableDataFilterParams({
+                                            ...tableDataFilterParams,
+                                            typeName: ''
+                                        });
+                                    }
+                                }}
+                                onSearch={() => tableDataSearchHandle('typeName')}
+
+                            />
+                        </div>
+                    </div>
+                    <div className='btnGroup'>
+                        <UpDataActBtn record type='ADD' />
+                    </div>
+                </div>
+                <div style={{ marginTop: 16 }}>
+                    {currentSelectedType && <KCTable columns={columns as ProColumns[]} reload={reload} rowKey='dictDataId' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />}
+                </div>
+            </div>
+        </div>
+    )
+}
+
+
+export default PubDicMana;

+ 72 - 0
src/pages/platform/setting/pubDicMana/service.ts

@@ -0,0 +1,72 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-07 11:12:10
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-07 15:20:00
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicMana/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+
+import { request } from 'umi';
+
+
+
+//获取表格数据
+
+export type PubDicRelaTbaleDataType = {
+    dictType:string;
+    current?:number;
+    pageSize?:number;
+    typeName?:string;
+    hospId?:string;
+}
+
+export const getPubDicRelaTbaleData = (params:PubDicRelaTbaleDataType) => {
+    return request('/centerSys/sysdictdata/getDictDataList', {
+      method: 'GET',
+      params:{...params}
+    });
+};
+
+
+//新增表格数据
+
+export type AddPubDicRelaTbaleDataType = {
+    dictSort:number;
+    dictType:string;
+    dictDefault:number;
+    code:string;
+    name:string;
+    value:string;
+    hospId:number;
+}
+
+export const addPubDicRelaTbaleData = (data:AddPubDicRelaTbaleDataType) => {
+    return request('/centerSys/sysdictdata/addData', {
+      method: 'POST',
+      data
+    });
+};
+
+//编辑表格数据
+
+export type EditPubDicRelaTbaleDataType = {
+    dictDataId:string;
+    dictSort:number;
+    dictType:string;
+    dictDefault:number;
+    code:string;
+    name:string;
+    value:string;
+    hospId:number;
+}
+
+export const editPubDicRelaTbaleData = (data:EditPubDicRelaTbaleDataType) => {
+    return request('/centerSys/sysdictdata/editData', {
+      method: 'POST',
+      data
+    });
+};

+ 88 - 0
src/pages/platform/setting/pubDicMana/style.less

@@ -0,0 +1,88 @@
+.PubDicMana {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+
+  .left {
+    border-radius: 4px;
+    width: 220px;
+    height: 100%;
+    overflow: scroll;
+    margin-right: 16px;
+    padding: 16px;
+    background: #FFFFFF;
+
+    .wrap {
+      margin-top: 16px;
+
+      .type {
+        cursor: pointer;
+        height: 32px;
+        line-height: 32px;
+        padding-left: 8px;
+        background: #FFFFFF;
+        border-radius: 4px;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #17181A;
+        margin-bottom: 4px;
+
+        &.on {
+          font-weight: 500;
+          color: #17181A;
+          background: #F0F2F5;
+        }
+
+        &:last-child {
+            margin-bottom: 0;
+        }
+      }
+    }
+  }
+
+  .right {
+    width: calc(100% - 220px);
+    padding: 16px;
+    border-radius: 4px;
+    background: #FFFFFF;
+
+    .toolBar {
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+      align-items: center;
+
+      .filter {
+        display: flex;
+        flex-direction: row;
+        justify-content: flex-start;
+        align-items: center;
+
+        .filterItem {
+          display: flex;
+          flex-direction: row;
+          justify-content: center;
+          align-items: center;
+        }
+      }
+
+      .btnGroup {
+        .add {
+          cursor: pointer;
+          display: inline-block;
+          font-size: 14px;
+          font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+          font-weight: 400;
+          color: #FFFFFF;
+          line-height: 24px;
+          padding: 0 14px;
+          background: #3377FF;
+          border-radius: 4px;
+        }
+      }
+
+    }
+  }
+}

+ 225 - 0
src/pages/platform/setting/pubDicTypeMana/index.tsx

@@ -0,0 +1,225 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 11:30:33
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-07 16:34:16
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { KCInput } from '@/components/KCInput';
+import KCTable from '@/components/kcTable';
+import { getAllHosp } from '@/service/hospList';
+import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form'
+import { ProColumns } from '@ant-design/pro-table';
+import { message, Popconfirm } from 'antd';
+import React, { useState } from 'react'
+import { addData, delData, editData, getData } from './service';
+
+import './style.less';
+
+
+
+export default function PubDicTypeMana() {
+
+    const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+    const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+    const [reload, set_reload] = useState(false);
+    const [currentEdit,set_currentEdit] = useState<any>(undefined);
+
+
+
+
+    const columns = [
+        {
+            title: '类型名称',
+            align: 'center',
+            dataIndex: 'dictName',
+
+        },
+        {
+            title: '类型代码',
+            align: 'center',
+            dataIndex: 'dictType',
+        },
+        {
+            title: '说明',
+            align: 'center',
+            dataIndex: 'remark',
+        },
+        {
+            title: '院区',
+            align: 'center',
+            dataIndex: 'hospName',
+
+        },
+        {
+            title: '操作',
+            align: 'center',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_: any, record: any) => {
+                return [
+                    <UpDataActBtn key={'act'} record={record} type='EDIT' />,
+                    <Popconfirm
+                        title="是否确认删除?"
+                        key="del"
+                        onConfirm={()=>delTableData(record)}
+                    >
+                        <a>删除</a>
+                    </Popconfirm>
+                ]
+            },
+        },
+
+    ]
+
+
+    const getTableData = async (params: any) => {
+        const resp = await getData(params);
+        set_reload(false);
+        if (resp) {
+            return {
+                data: resp.list,
+                success: true,
+                total: resp.totalCount,
+                pageSize: resp.pageSize,
+                totalPage: resp.totalPage,
+            }
+        }
+        return []
+    }
+
+    const delTableData = async (record:any)=>{
+          const resp = await delData(record.dictId);
+          if(resp){
+            set_reload(true);
+            // message.success('操作成功!');
+          }
+    }
+
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
+       
+        if (type == 'ADD') {
+            const resp = await addData(formVal);
+            if (resp) {
+                set_reload(true);
+            }
+        }
+        if (type == 'EDIT') {
+            const {dictId} = currentEdit;
+            const resp = await editData({...formVal,dictId});
+            if (resp) {
+                set_reload(true);
+            }
+        }
+
+
+    }
+
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
+
+        return (
+            <ModalForm
+                title={`${type == 'EDIT' ? '编辑' : '新增'}公用字典类型`}
+                width={352}
+                initialValues={type == 'EDIT' ? { ...record } : {}}
+                trigger={
+                    type == 'EDIT' ? <a key="edit" onClick={() => set_currentEdit(record)}>编辑</a> : <span className='add'>新增</span>
+                }
+                onFinish={(val) => {
+                    return updateTable(val, type);
+                }}
+            >
+                <ProFormSelect
+                    name="hospId"
+                    label="院区:"
+                    disabled={type == 'EDIT'}
+                    placeholder="请选择院区"
+                    request={async () => {
+                        const resp = await getAllHosp({ pageSize: 200, current: 1 });
+                        if (resp) {
+                            const data: any = resp.list?.map((a) => ({
+                                label: a.hospName,
+                                value: a.id
+                            }));
+
+                            return data;
+                        }
+                        return []
+
+                    }}
+
+                    fieldProps={{
+
+                    }}
+                />
+                <ProFormText
+                    name="dictName"
+                    label="类型名称:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '类型名称不能为空!' }]}
+                />
+                <ProFormText
+                    name="dictType"
+                    label="类型代码:"
+                    placeholder="请输入"
+                    rules={[{ required: true, message: '类型代码不能为空!' }]}
+                />
+                <ProFormTextArea
+                    name="remark"
+                    label="说明:"
+                    placeholder="请输入"
+
+                />
+            </ModalForm>
+        )
+    }
+
+    const editHandle = (record: any) => {
+
+    }
+
+    const tableDataSearchHandle = (paramName: string) => {
+
+
+        set_tableDataFilterParams({
+            ...tableDataFilterParams,
+            [`${paramName}`]: tableDataSearchKeywords
+        })
+    }
+
+    return (
+        <div className='PubDicTypeMana'>
+            <div className='toolBar'>
+                <div className='filter'>
+                    <div className='filterItem'>
+                        <span className='label'>检索:</span>
+                        <KCInput placeholder={'请输入类型名称'} style={{ width: 160 }} search allowClear
+                            onChange={(e) => {
+                                set_tableDataSearchKeywords(e.target.value);
+                                if (e.target.value.length == 0) {
+                                    set_tableDataFilterParams({
+                                        ...tableDataFilterParams,
+                                        typeName: ''
+                                    });
+                                }
+                            }}
+                            onSearch={() => tableDataSearchHandle('typeName')}
+
+                        />
+                    </div>
+                </div>
+                <div className='btnGroup'>
+                    <UpDataActBtn record type='ADD' />
+                </div>
+            </div>
+            <div style={{ marginTop: 16 }}>
+                <KCTable columns={columns as ProColumns[]} reload={reload} rowKey='dictId' newVer params={tableDataFilterParams} request={(params) => getTableData(params)} />
+            </div>
+        </div>
+    )
+}

+ 87 - 0
src/pages/platform/setting/pubDicTypeMana/service.ts

@@ -0,0 +1,87 @@
+/*
+ * @Author: code4eat awesomedema@gmail.com
+ * @Date: 2023-03-03 16:31:27
+ * @LastEditors: code4eat awesomedema@gmail.com
+ * @LastEditTime: 2023-03-07 10:28:57
+ * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+
+
+import { request } from 'umi';
+
+//获取table列表数据
+
+export type PubDicTypeData = {
+  dictId:string;
+  dictName:string;
+  dictType:string;
+  hospId:string;
+  hospName:string;
+  remark:string;
+  status:string
+}
+
+
+export const getData = (params?:any) => {
+  return request<{
+       current:number;
+       list:PubDicTypeData[];
+       pageSize:number;
+       totalCount:number;
+       totalPage:number;
+  }>('/centerSys/sysdictdata/getDictType', {
+    method: 'GET',
+    params:{...params}
+  });
+};
+
+
+//新增表格数据
+export type AddTableDataType = {
+  hospId:number;
+  dictName:string;
+  dictType:string;
+  remark:string
+}
+export const addData = (data:AddTableDataType) => {
+  return request('/centerSys/sysdictdata/addDictType', {
+    method: 'POST',
+    data
+  });
+};
+
+
+
+//编辑表格数据
+export type EditTableDataType = {
+  dictId:number;
+  hospId:number;
+  dictName:string;
+  dictType:string;
+  remark:string
+}
+
+export const editData = (data:EditTableDataType) => {
+  return request('/centerSys/sysdictdata/editDictType', {
+    method: 'POST',
+    data
+  });
+};
+
+//删除表格操作
+export const delData = (dictId:string) => {
+  return request('/centerSys/sysdictdata/deleteDictType', {
+    method: 'POST',
+    params:{dictId}
+  });
+};
+
+
+
+
+
+
+
+

+ 42 - 0
src/pages/platform/setting/pubDicTypeMana/style.less

@@ -0,0 +1,42 @@
+.PubDicTypeMana {
+  padding: 16px;
+  background: #FFFFFF;
+  border-radius: 4px;
+
+  .toolBar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+
+    .filter {
+      display: flex;
+      flex-direction: row;
+      justify-content: flex-start;
+      align-items: center;
+
+      .filterItem {
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        align-items: center;
+      }
+    }
+
+    .btnGroup {
+      .add {
+        cursor: pointer;
+        display: inline-block;
+        font-size: 14px;
+        font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+        font-weight: 400;
+        color: #FFFFFF;
+        line-height: 24px;
+        padding: 0 14px;
+        background: #3377FF;
+        border-radius: 4px;
+      }
+    }
+
+  }
+}

+ 3 - 3
src/service/hospList.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 09:15:59
- * @LastEditTime: 2023-01-10 13:17:04
+ * @LastEditTime: 2023-03-06 13:47:16
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/service/hospList.ts
@@ -58,10 +58,10 @@ export type HospTableItem = {
 };
 
 //获取医院列表
-export const getAllHosp = async (params: {
+export const getAllHosp = async (params?: {
   current: number;
   pageSize: number;
-  hospitalName: string;
+  hospitalName?: string;
 }) => {
   return request<{
     current: number;