|
|
@ -36,7 +36,8 @@ const Index = ({ params, openDialog, toggleDialog, closeDialog }) => { |
|
|
|
const [tooltipTambah, setTooltipTambah] = useState(false) |
|
|
|
const [tooltipTambah, setTooltipTambah] = useState(false) |
|
|
|
const [totalPage, setTotalPage] = useState(0) |
|
|
|
const [totalPage, setTotalPage] = useState(0) |
|
|
|
const [typeDialog, setTypeDialog] = useState('Save') |
|
|
|
const [typeDialog, setTypeDialog] = useState('Save') |
|
|
|
const [loading, SetLoading] = useState(false) |
|
|
|
const [loading, setLoading] = useState(false) |
|
|
|
|
|
|
|
const [openDialogMasterMenu, setOpenDialogFormMenu] = useState(false) |
|
|
|
const { t } = useTranslation() |
|
|
|
const { t } = useTranslation() |
|
|
|
// const pageName = params.name;
|
|
|
|
// const pageName = params.name;
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +85,7 @@ const Index = ({ params, openDialog, toggleDialog, closeDialog }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getDataMenu = async () => { |
|
|
|
const getDataMenu = async () => { |
|
|
|
SetLoading(true) |
|
|
|
setLoading(true) |
|
|
|
let start = 0; |
|
|
|
let start = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (currentPage !== 1 && currentPage > 1) { |
|
|
|
if (currentPage !== 1 && currentPage > 1) { |
|
|
@ -114,17 +115,17 @@ const Index = ({ params, openDialog, toggleDialog, closeDialog }) => { |
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
if (result && result.data && result.data.code == 200) { |
|
|
|
setDatatable(result.data.data); |
|
|
|
setDatatable(result.data.data); |
|
|
|
setTotalPage(result.data.totalRecord); |
|
|
|
setTotalPage(result.data.totalRecord); |
|
|
|
SetLoading(false) |
|
|
|
setLoading(false) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
|
|
SetLoading(false) |
|
|
|
setLoading(false) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleOpenDialog = async (type) => { |
|
|
|
const handleOpenDialog = async (type) => { |
|
|
|
await setTypeDialog(type) |
|
|
|
await setTypeDialog(type) |
|
|
|
getDataAllMenu(); |
|
|
|
getDataAllMenu(); |
|
|
|
// setOpenDialog(true)
|
|
|
|
setOpenDialogFormMenu(true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleCloseDialog = (type, data) => { |
|
|
|
const handleCloseDialog = (type, data) => { |
|
|
@ -134,19 +135,16 @@ const Index = ({ params, openDialog, toggleDialog, closeDialog }) => { |
|
|
|
editMenu(data); |
|
|
|
editMenu(data); |
|
|
|
} |
|
|
|
} |
|
|
|
setDataEdit([]) |
|
|
|
setDataEdit([]) |
|
|
|
// setOpenDialog(false)
|
|
|
|
setOpenDialogFormMenu(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const toggleAddDialog = () => { |
|
|
|
const toggleAddDialog = () => { |
|
|
|
// setOpenDialog(!openDialog)
|
|
|
|
setOpenDialogFormMenu(!openDialog) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleCancel = () => { |
|
|
|
const handleCancel = () => { |
|
|
|
closeDialog('cancel', 'none') |
|
|
|
closeDialog('cancel', 'none') |
|
|
|
// setDatatable([]);
|
|
|
|
setLoading(false); |
|
|
|
// setBaseUrl([]);
|
|
|
|
|
|
|
|
// setAvailableBaseUrl(false);
|
|
|
|
|
|
|
|
// setLoading(false);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -334,15 +332,15 @@ const Index = ({ params, openDialog, toggleDialog, closeDialog }) => { |
|
|
|
> |
|
|
|
> |
|
|
|
{t('deleteMsg')} |
|
|
|
{t('deleteMsg')} |
|
|
|
</SweetAlert> |
|
|
|
</SweetAlert> |
|
|
|
{/* <DialogForm |
|
|
|
<DialogForm |
|
|
|
openDialog={openDialog} |
|
|
|
openDialog={openDialogMasterMenu} |
|
|
|
closeDialog={handleCloseDialog} |
|
|
|
closeDialog={handleCloseDialog} |
|
|
|
toggleDialog={() => toggleAddDialog} |
|
|
|
toggleDialog={() => toggleAddDialog} |
|
|
|
typeDialog={typeDialog} |
|
|
|
typeDialog={typeDialog} |
|
|
|
dataEdit={dataEdit} |
|
|
|
dataEdit={dataEdit} |
|
|
|
clickOpenModal={clickOpenModal} |
|
|
|
clickOpenModal={clickOpenModal} |
|
|
|
dataMenu={allDataMenu} |
|
|
|
dataMenu={allDataMenu} |
|
|
|
/> */} |
|
|
|
/> |
|
|
|
<Modal size="xl" fullscreen="xl" scrollable={true} isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<Modal size="xl" fullscreen="xl" scrollable={true} isOpen={openDialog} toggle={toggleDialog}> |
|
|
|
<ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}> |
|
|
|
<ModalHeader className="capitalize withBtn" toggle={closeDialog} style={{ width: "100%" }}> |
|
|
|
MASTER MENU |
|
|
|
MASTER MENU |
|
|
|