Browse Source

Update ui (e.g. datagrid

master
cyril.tsui 1 year ago
parent
commit
d0798b6531
6 changed files with 94 additions and 46 deletions
  1. +1
    -1
      src/pages/User/DetailPage/UserAuthorityCard.js
  2. +6
    -6
      src/pages/User/DetailPage/index.js
  3. +20
    -5
      src/pages/User/SearchPage/UserSearchForm.js
  4. +1
    -0
      src/pages/User/SearchPage/UserTable.js
  5. +33
    -33
      src/pages/User/SearchPage/index.js
  6. +33
    -1
      src/themes/overrides/DataGrid.js

+ 1
- 1
src/pages/User/DetailPage/UserAuthorityCard.js View File

@@ -50,7 +50,7 @@ const UserAuthorityCard = ({ isCollectData, updateUserAuthList, userData, isNewR
border={false} border={false}
content={false} content={false}
> >
<Typography variant="h5" sx={{ mt: 3, ml: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}>
<Typography variant="h6" sx={{ mt: 3, ml: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}>
User Authority User Authority
</Typography> </Typography>




+ 6
- 6
src/pages/User/DetailPage/index.js View File

@@ -204,7 +204,7 @@ const UserMaintainPage = () => {
!onReady ? !onReady ?
<LoadingComponent /> <LoadingComponent />
: :
<Grid container sx={{ minHeight: '90vh' }}>
<Grid container sx={{ minHeight: '90vh', backgroundColor: 'backgroundColor.default' }}>
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
@@ -222,7 +222,7 @@ const UserMaintainPage = () => {
<Grid item xs={12} md={5} lg={5}> <Grid item xs={12} md={5} lg={5}>
<Grid container> <Grid container>
<Grid item xs={12} md={12} lg={12}> <Grid item xs={12} md={12} lg={12}>
<Box xs={12} ml={4} mt={3} sx={{ p: 1, border: '3px groove grey', borderRadius: '10px' }}>
<Box xs={12} ml={4} mt={3} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}>
<UserInformationCard <UserInformationCard
updateUserObject={updateUserObject} updateUserObject={updateUserObject}
userData={userData} userData={userData}
@@ -233,7 +233,7 @@ const UserMaintainPage = () => {
</Grid> </Grid>


<Grid item xs={12} md={12} lg={12} sx={{ mt: 3 }}> <Grid item xs={12} md={12} lg={12} sx={{ mt: 3 }}>
<Box xs={12} ml={4} mt={3} sx={{ p: 1, border: '3px groove grey', borderRadius: '10px' }}>
<Box xs={12} ml={4} mt={2} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}>
<UserGroupCard <UserGroupCard
updateUserGroupList={updateUserGroupList} updateUserGroupList={updateUserGroupList}
userData={userData} userData={userData}
@@ -246,7 +246,7 @@ const UserMaintainPage = () => {
</Grid> </Grid>
{/*col 2*/} {/*col 2*/}
<Grid item xs={12} md={7} lg={7}> <Grid item xs={12} md={7} lg={7}>
<Box xs={12} ml={4} mt={3} mr={3} sx={{ p: 1, border: '3px groove grey', borderRadius: '10px' }}>
<Box xs={12} ml={4} mt={3} mr={3} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}>
<UserAuthorityCard <UserAuthorityCard
updateUserAuthList={updateUserAuthList} updateUserAuthList={updateUserAuthList}
userData={userData} userData={userData}
@@ -270,7 +270,7 @@ const UserMaintainPage = () => {
disabled={isNewRecord} disabled={isNewRecord}
onClick={handleDeleteClick} onClick={handleDeleteClick}
> >
Delete User
<Typography variant="h5">Delete User</Typography>
</Button> </Button>
<GeneralConfirmWindow <GeneralConfirmWindow
isWindowOpen={isWindowOpen} isWindowOpen={isWindowOpen}
@@ -292,7 +292,7 @@ const UserMaintainPage = () => {
}} }}
onClick={submitData} onClick={submitData}
> >
Save
<Typography variant="h5">Save</Typography>
</Button> </Button>
</Grid> </Grid>
</Grid> </Grid>


+ 20
- 5
src/pages/User/SearchPage/UserSearchForm.js View File

@@ -70,7 +70,7 @@ const UserSearchForm = ({ applySearch }) => {
{/*row 1*/} {/*row 1*/}
<CardContent sx={{ px: 2.5, pt: 3 }}> <CardContent sx={{ px: 2.5, pt: 3 }}>
<Grid item justifyContent="space-between" alignItems="center"> <Grid item justifyContent="space-between" alignItems="center">
Search Form (GLD User)
<Typography variant="h5">Search Form (GLD User)</Typography>
</Grid> </Grid>
</CardContent> </CardContent>


@@ -82,6 +82,9 @@ const UserSearchForm = ({ applySearch }) => {
{...register("userName")} {...register("userName")}
id='userName' id='userName'
label="Username" label="Username"
InputLabelProps={{
shrink: true
}}
/> />
</Grid> </Grid>


@@ -91,6 +94,9 @@ const UserSearchForm = ({ applySearch }) => {
{...register("fullenName")} {...register("fullenName")}
id="fullenName" id="fullenName"
label="Full Name" label="Full Name"
InputLabelProps={{
shrink: true
}}
/> />
</Grid> </Grid>


@@ -100,6 +106,9 @@ const UserSearchForm = ({ applySearch }) => {
{...register("post")} {...register("post")}
id="post" id="post"
label="Post" label="Post"
InputLabelProps={{
shrink: true
}}
/> />
</Grid> </Grid>


@@ -109,6 +118,9 @@ const UserSearchForm = ({ applySearch }) => {
{...register("email")} {...register("email")}
id="email" id="email"
label="Email" label="Email"
InputLabelProps={{
shrink: true
}}
/> />
</Grid> </Grid>


@@ -118,6 +130,9 @@ const UserSearchForm = ({ applySearch }) => {
{...register("phone")} {...register("phone")}
id="phone" id="phone"
label="Phone" label="Phone"
InputLabelProps={{
shrink: true
}}
/> />
</Grid> </Grid>


@@ -132,7 +147,7 @@ const UserSearchForm = ({ applySearch }) => {
size="small" size="small"
/> />
} }
label={<Typography variant="h6">Locked</Typography>}
label={<Typography variant="h5">Locked</Typography>}
/> />
</Grid> </Grid>
</Grid> </Grid>
@@ -151,7 +166,7 @@ const UserSearchForm = ({ applySearch }) => {
alignItems: 'end' alignItems: 'end'
}}> }}>
<AddCircleOutlineIcon /> <AddCircleOutlineIcon />
New User
<Typography sx={{ ml: 1 }} variant="h5">New User</Typography>
</Button> </Button>
</Grid> </Grid>
<Grid item xs={8} md={8} sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> <Grid item xs={8} md={8} sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}>
@@ -165,7 +180,7 @@ const UserSearchForm = ({ applySearch }) => {
textTransform: 'capitalize', textTransform: 'capitalize',
alignItems: 'end' alignItems: 'end'
}}> }}>
Clear
<Typography variant="h5">Clear</Typography>
</Button> </Button>
</Grid> </Grid>


@@ -178,7 +193,7 @@ const UserSearchForm = ({ applySearch }) => {
textTransform: 'capitalize', textTransform: 'capitalize',
alignItems: 'end' alignItems: 'end'
}}> }}>
Search
<Typography variant="h5">Search</Typography>
</Button> </Button>
</Grid> </Grid>
</Grid> </Grid>


+ 1
- 0
src/pages/User/SearchPage/UserTable.js View File

@@ -136,6 +136,7 @@ export default function UserTable({recordList,setChangeLocked}) {
}, },
}} }}
onRowDoubleClick={handleRowDoubleClick} onRowDoubleClick={handleRowDoubleClick}
getRowHeight={() => 'auto'}
/> />
</div> </div>
); );


+ 33
- 33
src/pages/User/SearchPage/index.js View File

@@ -1,14 +1,14 @@
// material-ui // material-ui
import { import {
Grid,
Grid,
Typography, Typography,
Stack, Stack,
// Button // Button
} from '@mui/material'; } from '@mui/material';
import MainCard from "../../../components/MainCard"; import MainCard from "../../../components/MainCard";
import {useEffect, useState} from "react";
import { useEffect, useState } from "react";
import axios from "axios"; import axios from "axios";
import {GLD_USER_PATH} from "../../../utils/ApiPathConst";
import { GLD_USER_PATH } from "../../../utils/ApiPathConst";
import * as React from "react"; import * as React from "react";


import Loadable from 'components/Loadable'; import Loadable from 'components/Loadable';
@@ -22,7 +22,7 @@ const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`, backgroundImage: `url(${titleBackgroundImg})`,
width: '100%', width: '100%',
height: '100%', height: '100%',
backgroundSize:'contain',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
backgroundColor: '#0C489E', backgroundColor: '#0C489E',
backgroundPosition: 'right' backgroundPosition: 'right'
@@ -30,7 +30,7 @@ const BackgroundHead = {
// ==============================|| DASHBOARD - DEFAULT ||============================== // // ==============================|| DASHBOARD - DEFAULT ||============================== //


const UserSettingPage = () => { const UserSettingPage = () => {
const [record,setRecord] = useState([]);
const [record, setRecord] = useState([]);
const [searchCriteria, setSearchCriteria] = useState({}); const [searchCriteria, setSearchCriteria] = useState({});
const [onReady, setOnReady] = useState(false); const [onReady, setOnReady] = useState(false);
const [changelocked, setChangeLocked] = React.useState(false); const [changelocked, setChangeLocked] = React.useState(false);
@@ -49,9 +49,9 @@ const UserSettingPage = () => {
getUserList(); getUserList();
}, [searchCriteria]); }, [searchCriteria]);


function getUserList(){
function getUserList() {
axios.get(`${GLD_USER_PATH}`, axios.get(`${GLD_USER_PATH}`,
{params: searchCriteria}
{ params: searchCriteria }
) )
.then((response) => { .then((response) => {
if (response.status === 200) { if (response.status === 200) {
@@ -70,35 +70,35 @@ const UserSettingPage = () => {


return ( return (
!onReady ? !onReady ?
<LoadingComponent/>
<LoadingComponent />
: :
<Grid container sx={{minHeight: '90vh'}} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">View GLD User</Typography>
</Stack>
</div>
</Grid>
<Grid container sx={{ minHeight: '90vh', backgroundColor: "backgroundColor.default" }} direction="column">
<Grid item xs={12}>
<div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">View GLD User</Typography>
</Stack>
</div>
</Grid>


{/*row 1*/}
<Grid item xs={12} md={12} lg={12}>
<SearchForm applySearch={applySearch}/>
</Grid>
{/*row 2*/}
<Grid item xs={12} md={12} lg={12}>
<MainCard elevation={0}
border={false}
content={false}
>
<EventTable
recordList={record}
setChangeLocked={setChangeLocked}
/>
</MainCard>
</Grid>
{/*row 1*/}
<Grid item xs={12} md={12} lg={12}>
<SearchForm applySearch={applySearch} />
</Grid>
{/*row 2*/}
<Grid item xs={12} md={12} lg={12}>
<MainCard elevation={0}
border={false}
content={false}
>
<EventTable
recordList={record}
setChangeLocked={setChangeLocked}
/>
</MainCard>
</Grid>


</Grid>
</Grid>


); );
}; };


+ 33
- 1
src/themes/overrides/DataGrid.js View File

@@ -4,10 +4,13 @@ export default function DataGrid() {
const cellFontSize = "1.1rem" const cellFontSize = "1.1rem"
const cellFooterFontSize = "1.1rem" const cellFooterFontSize = "1.1rem"
const cellHeaderFontSize = "1.1rem" const cellHeaderFontSize = "1.1rem"
const selectedNumberFontSize = "1.2rem"
const actionIconSize = "2rem"


const cellFontWeight = 600 const cellFontWeight = 600
const cellFooterFontWeight = 600 const cellFooterFontWeight = 600
const cellHeaderFontWeight = 600 const cellHeaderFontWeight = 600
const selectedNumberFontWeight = 600


return { return {
MuiDataGrid: { MuiDataGrid: {
@@ -22,7 +25,36 @@ export default function DataGrid() {
fontSize: cellFooterFontSize, fontSize: cellFooterFontSize,
fontWeight: cellFooterFontWeight fontWeight: cellFooterFontWeight
}, },
'& .MuiDataGrid-columnHeader': {
'& .MuiTablePagination-selectLabel': {
fontSize: cellFooterFontSize,
fontWeight: cellFooterFontWeight,
marginTop: 15,
},
'& .MuiTablePagination-select': {
fontSize: selectedNumberFontSize,
fontWeight: selectedNumberFontWeight,
marginTop: 8,
},
'& .MuiTablePagination-selectIcon': {
marginTop: 1,
},
'& .MuiTablePagination-displayedRows': {
fontSize: cellFooterFontSize,
fontWeight: cellFooterFontWeight,
},
'& .MuiTablePagination-actions': {
fontSize: cellFooterFontSize,
fontWeight: cellFooterFontWeight,
svg: {
width: actionIconSize,
height: actionIconSize,
}
},
'& .MuiDataGrid-rowCount': {
fontSize: cellFooterFontSize,
fontWeight: cellFooterFontWeight
},
'& .MuiDataGrid-columnHeaderTitle': {
fontSize: cellHeaderFontSize, fontSize: cellHeaderFontSize,
fontWeight: cellHeaderFontWeight, fontWeight: cellHeaderFontWeight,
}, },


Loading…
Cancel
Save