Update Export Members dan Hide client portal

This commit is contained in:
ivan-sim
2024-01-03 16:57:22 +07:00
parent a157c41462
commit b5afefd71d
4 changed files with 156 additions and 21 deletions

View File

@@ -235,12 +235,12 @@ export default function Index() {
label: 'Divisi',
isSort: true,
},
{
id: 'limit',
align: 'center',
label: 'Limit',
isSort: false,
},
// {
// id: 'limit',
// align: 'center',
// label: 'Limit',
// isSort: false,
// },
{
id: 'status',
align: 'center',
@@ -292,18 +292,18 @@ export default function Index() {
corporateMembers.data.data.map((obj: any) => {
return {
...obj,
limit: (
<Stack>
<BorderLinearProgress
variant="determinate"
value={obj.limit.percentage}
sx={{ mb: 1 }}
/>
<Typography sx={{ typography: 'caption', color: '#637381' }}>
{fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
</Typography>
</Stack>
),
// limit: (
// <Stack>
// <BorderLinearProgress
// variant="determinate"
// value={obj.limit.percentage}
// sx={{ mb: 1 }}
// />
// <Typography sx={{ typography: 'caption', color: '#637381' }}>
// {fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
// </Typography>
// </Stack>
// ),
status:
obj.status === 1 ? (
<Button
@@ -369,12 +369,12 @@ export default function Index() {
</Stack>
<Grid container spacing={2}>
<Grid item xs={12} lg={6} md={12}>
{/* <Grid item xs={12} lg={6} md={12}>
<CardNotification data={itemList} />
</Grid>
<Grid item xs={12} lg={6} md={12}>
<CardPolicy data={policyData} />
</Grid>
</Grid> */}
<Grid item xs={12} lg={12} md={12}>
<Table
headCells={headCells}

View File

@@ -40,6 +40,7 @@ import TableMoreMenu from '../../components/table/TableMoreMenu';
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
import Label from '../../components/Label';
import { enqueueSnackbar } from 'notistack';
/* ---------------------------------- types --------------------------------- */
@@ -229,10 +230,32 @@ export default function List() {
};
const searchs = {
useSearchs: true,
searchText: searchText,
setSearchText: setSearchText,
handleSearchSubmit: handleSearchSubmit,
};
const [startDateValue, setStartDateValue] = useState('');
const [endDateValue, setEndDateValue] = useState('');
const [statusValue, setStatusValue] = useState('all');
const handleExportReport = async (appliedFilter = null) => {
axios.get(corporateValue + '/export-members/list').then((response) => {
const link = document.createElement('a');
link.href = response.data.data.file_url;
link.setAttribute('download', response.data.data.file_name);
document.body.appendChild(link);
link.click();
// handleClose();
});
}
const exportReport = {
useExport: true,
startDate: startDateValue,
endDate: endDateValue,
status: statusValue,
handleExportReport: handleExportReport
}
/* -------------------------------- headCell -------------------------------- */
const headCells: HeadCell<never>[] = [
@@ -375,6 +398,7 @@ export default function List() {
params={params}
searchs={searchs}
// filters={filters}
exportReport={exportReport}
/>
</Stack>
);