code4eat 2 éve
szülő
commit
1a95a2bd60

+ 43 - 10
src/pages/platform/setting/hospManage/index.tsx

@@ -1,13 +1,13 @@
 /*
  * @Author: your name
  * @Date: 2022-01-13 15:22:48
- * @LastEditTime: 2022-07-28 16:17:38
+ * @LastEditTime: 2023-03-10 14:59:09
  * @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
  */
 
-import { FC } from 'react';
+import { FC, useState } from 'react';
 import { hospManageModelState, ConnectProps, Loading, connect } from 'umi';
 import { Button, Divider, Popconfirm } from 'antd';
 import KCTable from '@/components/kcTable';
@@ -18,6 +18,7 @@ import ActModal from './modals/modal';
 import './style.less';
 import { TableListItem } from './typings';
 import { getSpacifyHospMenu } from '@/service/menu';
+import { KCInput } from '@/components/KCInput';
 
 export enum TableActType {
   NOACT,
@@ -36,6 +37,9 @@ interface PageProps extends ConnectProps {
 const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
   const { reloadTable } = state;
 
+  const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
+  const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
+
   const columns: ProColumns<TableListItem>[] = [
     {
       title: 'ID',
@@ -223,23 +227,52 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
     }
   };
 
-  const initHospData = async (record: TableListItem)=>{
-        const resp = await hospInit(record.id);
+  const initHospData = async (record: TableListItem) => {
+    const resp = await hospInit(record.id);
   }
 
+  const tableDataSearchHandle = (paramName: string) => {
+
+
+    set_tableDataFilterParams({
+        ...tableDataFilterParams,
+        [`${paramName}`]: tableDataSearchKeywords
+    })
+}
+
   return (
     <div className="HospManage">
       <ActModal {...state} dispatch={dispatch} />
+      <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,
+                    hospName: ''
+                  });
+                }
+              }}
+              onSearch={() => tableDataSearchHandle('hospName')}
+
+            />
+          </div>
+        </div>
+        <div className='btnGroup'>
+          <span className='add' onClick={addHandle}>新增</span>
+        </div>
+      </div>
       <KCTable
+        newVer
         rowKey="id"
-        headerTitle="查询表格"
         columns={columns}
         reload={reloadTable}
-        toolBarRender={() => [
-          <Button key="3" type="primary" onClick={addHandle}>
-            新增院区
-          </Button>,
-        ]}
+        options={false}
+        params={tableDataFilterParams}
         request={(params) => getHospData(params)}
       />
     </div>

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-12 17:11:11
- * @LastEditTime: 2022-08-01 10:57:31
+ * @LastEditTime: 2023-03-10 15:12:25
  * @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
@@ -215,11 +215,11 @@ const ActModal: React.FC<ActModalProps> = ({ dispatch, isShowModal, tableAct, cu
       visible={isShowModal}
       onVisibleChange={onVisibleChangeHandle}
       layout="horizontal"
-      // width={1000}
+      width={tableAct == TableActType.EDITMENU?800:352}
       initialValues={setInitialValues()}
       title={setModalTitle()}
       labelCol={{
-        span: 6,
+        span: 7,
       }}
       wrapperCol={{ span: 12 }}
       onFinish={async (data) =>

+ 41 - 1
src/pages/platform/setting/hospManage/style.less

@@ -1,3 +1,43 @@
 .HospManage {
-  height: 100%;
+  height: auto;
+  padding: 16px;
+  background: #fff;
+
+  .toolBar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 16px;
+
+    .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;
+      }
+    }
+
+  }
 }

+ 1 - 3
src/pages/platform/setting/menuManage/style.less

@@ -1,3 +1 @@
-.HospManage {
-  height: 100%;
-}
+

+ 3 - 4
src/pages/platform/setting/pubDicMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-03-09 17:21:45
+ * @LastEditTime: 2023-03-10 17:31:00
  * @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
  */
@@ -54,8 +54,8 @@ const PubDicMana = () => {
         {
             title: '默认',
             dataIndex: 'data.0.dictDefault',
-            render: (_: any, record: number) => {
-                return record == 1 ? '是' : '否'
+            render: (_: any, record:any) => {
+                return record.dictDefault == 1 ? '是' : '否'
             },
 
         },
@@ -322,7 +322,6 @@ const PubDicMana = () => {
                                     }
                                 }}
                                 onSearch={() => tableDataSearchHandle('typeName')}
-
                             />
                         </div>
                     </div>

+ 0 - 3
src/pages/platform/setting/roleManage/style.less

@@ -1,3 +0,0 @@
-.HospManage {
-  height: 100%;
-}