Переглянути джерело

登录样式优化,表格滚动等

zhouna 3 роки тому
батько
коміт
95aab84e4b

+ 1 - 0
src/common/common.less

@@ -6,6 +6,7 @@
 
 body{
   background: @body-bg;
+  overflow-y: hidden;
 }
 .clearfix:after{
   content: "";

+ 5 - 5
src/components/AHeader/index.js

@@ -40,15 +40,15 @@ function AHeader({ history,hideName }){
                 const { userInfo,software } = data;
                 const sysId = localStorage.getItem("systemId");
                 const hisId = localStorage.getItem("hospitalId");
-                const sys = software.find((it)=>{return +it.id===+sysId});
+                const sys = software.find((it)=>{
+                    return +it.id===+sysId
+                });
                 dispatch(setUser(userInfo));
-                dispatch(setSys({sysId,sysName:sys.name,hisId}));
+                sys&&dispatch(setSys({sysId,sysName:sys.name,hisId}));
             }else{
                 message.warning(res.data.msg||'获取医院列表失败');
             }
-        }).catch(()=>{
-            message.error("接口出错");
-        });
+        })
     }
     //修改密码
     function changePsd(){

+ 1 - 1
src/components/Login/index.js

@@ -28,7 +28,7 @@ function Login({history}) {
         <div className="login-container clearfix">
             <div className="bg-box">
                 <h1>AI病案质控平台</h1>
-                <img src={loginBg} alt="背景图片"/>
+                {/*<img src={loginBg} alt="背景图片"/>*/}
             </div>
             <div className="content-box">
                 <div className="logo">

+ 4 - 5
src/components/Login/index.less

@@ -6,11 +6,10 @@
   .bg-box{
     position: relative;
     float: left;
-    width: 63%;
+    width: 62%;
     height: 100%;
-    background:#fff;
-    /*background: url("../../images/login-bg.png") #ccc no-repeat;
-    background-size: cover;*/
+    background: url("../../images/login-bg.png") no-repeat;
+    background-size: cover;
     h1{
       position: absolute;
       font-size: 28px;
@@ -23,7 +22,7 @@
     }
   }
   .content-box{
-    width: 37%;
+    width: 38%;
     height: 100%;
     background: url("../../images/login-v.png") top right #fff no-repeat;
     float: right;

+ 16 - 5
src/components/OrgManager/index.js

@@ -11,12 +11,22 @@ const {post,api,xPost} = apiObj;
 const { Option } = Select;
 function OrgManager(){
     useEffect(() => {
-        //getFilterList();
+        //监听resize事件
+        setTableHt(window.innerHeight-260);
+        window.addEventListener('resize',()=>{
+            setTableHt(window.innerHeight-260);
+        });
+        //刷新列表
         getTableData();
+        //解绑事件
+        return function clear(){
+            window.removeEventListener("resize");
+        }
     },[]);
 
     const [dataSource, setDataSource] = useState([]);   //列表数据
     const [orgDetail, setOrgDetail] = useState([]);   //组织详情数据
+    const [tableHt, setTableHt] = useState(300);   //表格滚动高度
     const [visible,setVisible] = useState(false);   //删除禁用确认弹窗显示
     const [addVisible,setAddVisible] = useState(false);         //新增页面显示
     const [confirmLoading, setConfirmLoading] = useState(false);
@@ -167,22 +177,22 @@ function OrgManager(){
     function RenderTable(){
         const columns = [
             { title: '组织机构层级', dataIndex: 'hospitalName', key: 'hospitalName' },
-            { title: '类型',  key: 'type',render:(row)=>{
+            { title: '类型',width:150,  key: 'type',render:(row)=>{
                     if(row.children){
                         return '-'
                     }else{
                         return row.typeName;
                     }
                 } },
-            { title: '状态',  key: 'status',render:(row)=>{
+            { title: '状态',width:120,  key: 'status',render:(row)=>{
                     if(row.children){
                         return '-'
                     }else{
                         return (<span className={ (row.status==='1')?'Enable':'Disable' }>{row.statusName}</span>);
                     }
                 } },
-            { title: '创建时间', dataIndex: 'gmtCreate', key: 'gmtCreate' },
-            { title: '操作', key: 'operation', render: (row) => {
+            { title: '创建时间',width:240, dataIndex: 'gmtCreate', key: 'gmtCreate' },
+            { title: '操作',width:240, key: 'operation', render: (row) => {
                     //console.log(21,row)
                     if(row.rootFlag){
                         return '-'
@@ -205,6 +215,7 @@ function OrgManager(){
         ];
         return (
             <Table
+                scroll={{ y: tableHt }}
                 pagination={false}
                 className="components-table-demo-nested"
                 rowKey={record => record.hospitalId}

+ 2 - 4
src/components/SysChoose/index.js

@@ -43,7 +43,7 @@ function SysChoose({history}) {
     }
     //获取组织列表
     function getOrgList(){
-        xPost(api.getUserHospitals).then((res)=>{
+        xPost(api.getUserHospitals).then((res)=>{console.log(res)
             if(res.data.code===200){
                 const data = res.data.data;
                 const { software,userInfo } = data;
@@ -56,9 +56,7 @@ function SysChoose({history}) {
             }else{
                 message.warning(res.data.msg||'获取医院列表失败');
             }
-        }).catch(()=>{
-            message.error("接口出错");
-        });
+        })
     }
     //点击进入
     function getIn(id){