aq-fe-framework 0.1.155 → 0.1.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/apiFactory.ts +46 -0
- package/dist/api/baseAxios.ts +22 -0
- package/dist/app/admin/(core)/core12196/page.tsx +13 -0
- package/dist/app/admin/(core)/core16209/page.tsx +13 -0
- package/dist/app/admin/(core)/core18256/page.tsx +12 -0
- package/dist/app/admin/(core)/core26965/page.tsx +13 -0
- package/dist/app/admin/(core)/core27311/page.tsx +13 -0
- package/dist/app/admin/(core)/core38677/page.tsx +13 -0
- package/dist/app/admin/(core)/core40207/page.tsx +13 -0
- package/dist/app/admin/(core)/core60524/page.tsx +11 -0
- package/dist/app/admin/(core)/core64229/page.tsx +12 -0
- package/dist/app/admin/(core)/core71678/page.tsx +11 -0
- package/dist/app/admin/(core)/core76318/page.tsx +13 -0
- package/dist/app/admin/(core)/core83092/page.tsx +13 -0
- package/dist/app/admin/[...slug]/page.tsx +7 -0
- package/dist/app/admin/error.tsx +42 -0
- package/dist/app/admin/layout.tsx +21 -0
- package/dist/app/admin/test/page.tsx +44 -0
- package/dist/app/auth/login/page.tsx +14 -0
- package/dist/app/globals.css +59 -0
- package/dist/app/layout.tsx +39 -0
- package/dist/app/page.tsx +18 -0
- package/dist/{chunk-PAHZ57DT.mjs → chunk-JLT4BL7I.mjs} +1 -1
- package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +66 -0
- package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +31 -0
- package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +47 -0
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +81 -0
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +68 -0
- package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +50 -0
- package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +13 -0
- package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +113 -0
- package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +19 -0
- package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +63 -0
- package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +36 -0
- package/dist/components/AppSpotlight/MyAppSpotlight.tsx +112 -0
- package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +46 -0
- package/dist/components/Buttons/Button/MyButton.tsx +90 -0
- package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +81 -0
- package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +75 -0
- package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +68 -0
- package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +29 -0
- package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +100 -0
- package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +81 -0
- package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +196 -0
- package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +71 -0
- package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +117 -0
- package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +37 -0
- package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +174 -0
- package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +29 -0
- package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +121 -0
- package/dist/components/Calendar/MyCalendar.tsx +118 -0
- package/dist/components/CenterFull/MyCenterFull.tsx +10 -0
- package/dist/components/Checkbox/MyCheckbox.tsx +9 -0
- package/dist/components/Combobox/Select/MySelect.tsx +12 -0
- package/dist/components/DataDisplay/Card/AQCard.tsx +49 -0
- package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +77 -0
- package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +184 -0
- package/dist/components/DataDisplay/IconText/MyIconText.tsx +17 -0
- package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +15 -0
- package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +9 -0
- package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +68 -0
- package/dist/components/FaviconSetter/FaviconSetter.tsx +33 -0
- package/dist/components/Inputs/DateInput/MyDateInput.tsx +11 -0
- package/dist/components/Inputs/Fieldset/MyFieldset.tsx +32 -0
- package/dist/components/Inputs/FileInput/MyFileInput.tsx +12 -0
- package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +12 -0
- package/dist/components/Inputs/TextArea/MyTextArea.tsx +11 -0
- package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +191 -0
- package/dist/components/Inputs/TextInput/MyTextInput.tsx +30 -0
- package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +357 -0
- package/dist/components/Layouts/BasicAppShell/css.module.css +62 -0
- package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +64 -0
- package/dist/components/Layouts/Container/MyContainer.tsx +16 -0
- package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +14 -0
- package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +14 -0
- package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +14 -0
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +147 -0
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +19 -0
- package/dist/components/Layouts/HeaderMegaMenu/css.module.css +50 -0
- package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +29 -0
- package/dist/components/Layouts/PageContent/MyPageContent.tsx +67 -0
- package/dist/components/Layouts/Tab/MyTab.tsx +33 -0
- package/dist/components/Loaders/MyCardioLoader.tsx +12 -0
- package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +61 -0
- package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +37 -0
- package/dist/components/ScheduleX/MyScheduleX.tsx +58 -0
- package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +9 -0
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.ts +62 -0
- package/dist/constants/array/daysOfWeek.ts +9 -0
- package/dist/constants/enum/ENUM_EMAILCONFIG.ts +6 -0
- package/dist/constants/enum/global.ts +26 -0
- package/dist/constants/object/color.ts +5 -0
- package/dist/constants/object/documentTypes.ts +8 -0
- package/dist/{components/index.css → css.module-4ICLUKPO.module.css} +29 -16
- package/dist/css.module-P45UW6UZ.module.css +4 -0
- package/dist/data/menuData.ts +31 -0
- package/dist/hooks/custom-hooks/useC_MutationAction.tsx +36 -0
- package/dist/hooks/index.ts +2 -0
- package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +14 -0
- package/dist/interfaces/EmailConfig.ts +10 -0
- package/dist/interfaces/IAQModule.ts +21 -0
- package/dist/interfaces/base.ts +9 -0
- package/dist/interfaces/global-interface/IAQSSO.ts +15 -0
- package/dist/interfaces/global-interface/IAQSyncData.ts +9 -0
- package/dist/interfaces/global-interface/IAcademicYear.ts +12 -0
- package/dist/interfaces/global-interface/IChangePassWord.ts +8 -0
- package/dist/interfaces/global-interface/IComplaintProccess.ts +9 -0
- package/dist/interfaces/global-interface/ICreateAccount.ts +24 -0
- package/dist/interfaces/global-interface/IDocument.ts +25 -0
- package/dist/interfaces/global-interface/IDocumentAttribute.ts +12 -0
- package/dist/interfaces/global-interface/IEvent.ts +30 -0
- package/dist/interfaces/global-interface/IEventComplaint.ts +20 -0
- package/dist/interfaces/global-interface/IEventFillter.ts +14 -0
- package/dist/interfaces/global-interface/IFile.ts +8 -0
- package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +8 -0
- package/dist/interfaces/global-interface/IPagePermission.ts +12 -0
- package/dist/interfaces/global-interface/IRolePermission.ts +7 -0
- package/dist/interfaces/global-interface/ISRMUserinfo.ts +35 -0
- package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +15 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +15 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +14 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +21 -0
- package/dist/interfaces/global-interface/ISignIn.ts +7 -0
- package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +15 -0
- package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +31 -0
- package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +14 -0
- package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +14 -0
- package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +12 -0
- package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +18 -0
- package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +16 -0
- package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +18 -0
- package/dist/interfaces/global-interface/IUpdateAccount.ts +15 -0
- package/dist/interfaces/global-interface/IUser.ts +21 -0
- package/dist/interfaces/global-interface/IUserPermission.ts +7 -0
- package/dist/lib/utils.ts +6 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +87 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +65 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +82 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +67 -0
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +77 -0
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +77 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +78 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +69 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +69 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +64 -0
- package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +311 -0
- package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +311 -0
- package/dist/modules-features/admin/core/core12196/F_core12196.tsx +20 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +101 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +112 -0
- package/dist/modules-features/admin/core/core16209/F_core16209.tsx +108 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +112 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +114 -0
- package/dist/modules-features/admin/core/core18256/F_core18256.tsx +29 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +34 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +14 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +59 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +40 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +22 -0
- package/dist/modules-features/admin/core/core26965/F_core26965.tsx +17 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +106 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +112 -0
- package/dist/modules-features/admin/core/core27311/F_core27311.tsx +21 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +109 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +113 -0
- package/dist/modules-features/admin/core/core35923/F_core35923.tsx +46 -0
- package/dist/modules-features/admin/core/core38677/F_core38677.tsx +28 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +79 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +52 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +264 -0
- package/dist/modules-features/admin/core/core40207/F_core40207.tsx +9 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +81 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +98 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +83 -0
- package/dist/modules-features/admin/core/core47643/F_core47643.tsx +10 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +13 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +34 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +57 -0
- package/dist/modules-features/admin/core/core60524/F_core60524.tsx +13 -0
- package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +111 -0
- package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +56 -0
- package/dist/modules-features/admin/core/core60524/useS_core60524.ts +16 -0
- package/dist/modules-features/admin/core/core64229/F_core64229.tsx +7 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +21 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +95 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +67 -0
- package/dist/modules-features/admin/core/core71678/F_core71678.tsx +8 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +117 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +61 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +16 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +92 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +49 -0
- package/dist/modules-features/admin/core/core76318/F_core76318.tsx +9 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +89 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +104 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +89 -0
- package/dist/modules-features/admin/core/core83092/F_core83092.tsx +27 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +85 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +52 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +263 -0
- package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +70 -0
- package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +154 -0
- package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +4 -0
- package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +22 -0
- package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +21 -0
- package/dist/modules-features/authenticate/useS_authenticate.ts +23 -0
- package/dist/modules-features/index.mjs +2 -2
- package/dist/modules-features/index.ts +79 -0
- package/dist/providers/MyMantineProvider.tsx +140 -0
- package/dist/providers/MyReactQueryProvider.tsx +24 -0
- package/dist/providers/Provider.tsx +13 -0
- package/dist/providers/mantine.module.css +21 -0
- package/dist/stores/CreateGenericStore.ts +23 -0
- package/dist/stores/index.ts +1 -0
- package/dist/types/types.ts +16 -0
- package/dist/utils/index.ts +9 -0
- package/dist/utils/utils_converter.ts +39 -0
- package/dist/utils/utils_currency.ts +5 -0
- package/dist/utils/utils_date.ts +34 -0
- package/dist/utils/utils_excel.ts +128 -0
- package/dist/utils/utils_file.ts +61 -0
- package/dist/utils/utils_notification.ts +46 -0
- package/dist/utils/utils_pdf.ts +21 -0
- package/dist/utils/utils_time.ts +15 -0
- package/dist/utils/utils_validateForm.ts +9 -0
- package/package.json +1 -1
- package/dist/modules-features/index.css +0 -100
@@ -0,0 +1,121 @@
|
|
1
|
+
"use client";
|
2
|
+
import baseAxios from "@/api/baseAxios";
|
3
|
+
import {
|
4
|
+
ActionIcon,
|
5
|
+
Button,
|
6
|
+
Group,
|
7
|
+
LoadingOverlay,
|
8
|
+
Modal,
|
9
|
+
Paper,
|
10
|
+
Text,
|
11
|
+
Tooltip,
|
12
|
+
} from "@mantine/core";
|
13
|
+
import { useDisclosure } from "@mantine/hooks";
|
14
|
+
import { IconLivePhoto, IconMaximize, IconMinimize } from "@tabler/icons-react";
|
15
|
+
import { useQuery } from "@tanstack/react-query";
|
16
|
+
import { useState } from "react";
|
17
|
+
interface IMyButtonViewPDF {
|
18
|
+
modalSize?: string;
|
19
|
+
label?: string;
|
20
|
+
id?: number;
|
21
|
+
src?: string;
|
22
|
+
isActionIcon?: boolean;
|
23
|
+
filePath?: string
|
24
|
+
}
|
25
|
+
export function MyButtonViewPDF({
|
26
|
+
id,
|
27
|
+
modalSize = "80%",
|
28
|
+
label = "Xem file",
|
29
|
+
src = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2016/07/85.signed.pdf",
|
30
|
+
isActionIcon = false,
|
31
|
+
filePath
|
32
|
+
}: IMyButtonViewPDF) {
|
33
|
+
const disc = useDisclosure(false);
|
34
|
+
const fullScreen = useState(false);
|
35
|
+
const hSize = useState("80vh");
|
36
|
+
const query = useQuery({
|
37
|
+
queryKey: ["MyButtonViewPDF", id, filePath],
|
38
|
+
queryFn: async () => {
|
39
|
+
if (filePath) {
|
40
|
+
const res = await baseAxios.get("/AQ/GetFile?filePath=" + filePath);
|
41
|
+
return res.data.data;
|
42
|
+
}
|
43
|
+
|
44
|
+
const res = await baseAxios.get("/Document/Get?id=" + id);
|
45
|
+
return res.data.data;
|
46
|
+
},
|
47
|
+
enabled: disc[0] == true,
|
48
|
+
});
|
49
|
+
return (
|
50
|
+
<>
|
51
|
+
<Tooltip label="Xem tài liệu trực tiếp">
|
52
|
+
{isActionIcon ? (
|
53
|
+
<ActionIcon
|
54
|
+
onClick={() => {
|
55
|
+
disc[1].open();
|
56
|
+
}}
|
57
|
+
>
|
58
|
+
<IconLivePhoto />
|
59
|
+
</ActionIcon>
|
60
|
+
) : (
|
61
|
+
<Button
|
62
|
+
color="cyan"
|
63
|
+
onClick={() => {
|
64
|
+
disc[1].open();
|
65
|
+
}}
|
66
|
+
leftSection={<IconLivePhoto />}
|
67
|
+
>
|
68
|
+
{label}
|
69
|
+
</Button>
|
70
|
+
)}
|
71
|
+
</Tooltip>
|
72
|
+
<Modal
|
73
|
+
fullScreen={fullScreen[0]}
|
74
|
+
opened={disc[0]}
|
75
|
+
onClose={disc[1].close}
|
76
|
+
size={modalSize}
|
77
|
+
title={
|
78
|
+
<Group>
|
79
|
+
<Text>Xem tài liệu trực tiếp</Text>
|
80
|
+
{fullScreen[0] ? (
|
81
|
+
<ActionIcon
|
82
|
+
onClick={() => {
|
83
|
+
fullScreen[1](false);
|
84
|
+
hSize[1]("80vh");
|
85
|
+
}}
|
86
|
+
>
|
87
|
+
<IconMinimize />
|
88
|
+
</ActionIcon>
|
89
|
+
) : (
|
90
|
+
<ActionIcon
|
91
|
+
onClick={() => {
|
92
|
+
fullScreen[1](true);
|
93
|
+
hSize[1]("90vh");
|
94
|
+
}}
|
95
|
+
>
|
96
|
+
<IconMaximize />
|
97
|
+
</ActionIcon>
|
98
|
+
)}
|
99
|
+
</Group>
|
100
|
+
}
|
101
|
+
>
|
102
|
+
<Paper h={hSize[0]} p={"lg"} pos={"relative"}>
|
103
|
+
<LoadingOverlay
|
104
|
+
visible={query.isLoading}
|
105
|
+
zIndex={1000}
|
106
|
+
overlayProps={{ radius: "sm", blur: 2 }}
|
107
|
+
/>
|
108
|
+
{query.data ? (
|
109
|
+
<iframe
|
110
|
+
src={`data:application/pdf;base64, ${filePath ? query.data?.fileBase64String : query.data?.fileDetail?.fileBase64String}`}
|
111
|
+
width={"100%"}
|
112
|
+
height={"100%"}
|
113
|
+
/>
|
114
|
+
) : (
|
115
|
+
<iframe src={src} width={"100%"} height={"100%"} />
|
116
|
+
)}
|
117
|
+
</Paper>
|
118
|
+
</Modal>
|
119
|
+
</>
|
120
|
+
);
|
121
|
+
}
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import {
|
2
|
+
createViewDay,
|
3
|
+
createViewMonthAgenda,
|
4
|
+
createViewMonthGrid,
|
5
|
+
createViewWeek
|
6
|
+
} from '@schedule-x/calendar';
|
7
|
+
import { createEventModalPlugin } from '@schedule-x/event-modal';
|
8
|
+
import { createEventsServicePlugin } from '@schedule-x/events-service';
|
9
|
+
import { ScheduleXCalendar, useNextCalendarApp } from '@schedule-x/react';
|
10
|
+
|
11
|
+
import { Paper, Text } from '@mantine/core';
|
12
|
+
import '@schedule-x/theme-default/dist/index.css';
|
13
|
+
import { useEffect } from "react";
|
14
|
+
import { MyFlexColumn } from '../Layouts/FlexColumn/MyFlexColumn';
|
15
|
+
|
16
|
+
export function MyCalendar() {
|
17
|
+
const plugins = [createEventsServicePlugin(), createEventModalPlugin()]
|
18
|
+
|
19
|
+
const calendar = useNextCalendarApp({
|
20
|
+
locale: "vi-VN",
|
21
|
+
dayBoundaries: {
|
22
|
+
start: '05:00',
|
23
|
+
end: '21:00',
|
24
|
+
},
|
25
|
+
weekOptions: {
|
26
|
+
gridHeight: 700
|
27
|
+
},
|
28
|
+
views: [createViewDay(), createViewWeek(), createViewMonthGrid(), createViewMonthAgenda()],
|
29
|
+
events: [
|
30
|
+
{
|
31
|
+
id: '1',
|
32
|
+
giangvien: 'TDMU048- Bùi Đức Anh',
|
33
|
+
title: 'Tin học căn bản',
|
34
|
+
people: ['Sức chứa: 30'],
|
35
|
+
location: 'Phòng: B103',
|
36
|
+
start: '2024-12-17 06:00',
|
37
|
+
end: '2024-12-17 08:00',
|
38
|
+
laLichThi: false,
|
39
|
+
description: 'Giảng viên: TDMU048- Bùi Đức Anh',
|
40
|
+
},
|
41
|
+
{
|
42
|
+
id: '2',
|
43
|
+
giangvien: 'CNTT030- Nguyễn Thế Bảo',
|
44
|
+
title: 'Tin học căn bản',
|
45
|
+
people: ['Sức chứa: 30'],
|
46
|
+
location: 'Phòng: B103',
|
47
|
+
start: '2024-12-18 06:00',
|
48
|
+
end: '2024-12-18 08:00',
|
49
|
+
laLichThi: false,
|
50
|
+
description: 'Giảng viên: CNTT030- Nguyễn Thế Bảo',
|
51
|
+
},
|
52
|
+
{
|
53
|
+
id: 3,
|
54
|
+
giangvien: 'CNTT026- Võ Thị Diễm Hương',
|
55
|
+
title: 'Tin học căn bản',
|
56
|
+
people: ['Sức chứa: 30'],
|
57
|
+
location: 'Phòng: B103',
|
58
|
+
start: '2024-12-19 06:00',
|
59
|
+
end: '2024-12-19 08:00',
|
60
|
+
laLichThi: false,
|
61
|
+
description: "Giảng viên: CNTT026- Võ Thị Diễm Hương"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
id: 4,
|
65
|
+
giangvien: 'KHNN065- Nguyễn Xuân Tiến',
|
66
|
+
title: 'Tin học căn bản',
|
67
|
+
people: ['Sức chứa: 30'],
|
68
|
+
location: 'Phòng: B102',
|
69
|
+
start: '2024-12-20 06:00',
|
70
|
+
end: '2024-12-20 08:00',
|
71
|
+
laLichThi: false,
|
72
|
+
description: "Giảng viên: KHNN065- Nguyễn Xuân Tiến"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
id: 5,
|
76
|
+
// giangvien: 'KHNN065- Nguyễn Xuân Tiến',
|
77
|
+
title: 'Tiếng anh thương mại',
|
78
|
+
people: ['Sức chứa: 30'],
|
79
|
+
location: 'Phòng: B102',
|
80
|
+
start: '2024-12-16 14:00',
|
81
|
+
end: '2024-12-16 16:00',
|
82
|
+
laLichThi: true,
|
83
|
+
// description: "Giảng viên: KHNN065- Nguyễn Xuân Tiến"
|
84
|
+
},
|
85
|
+
],
|
86
|
+
}, plugins)
|
87
|
+
|
88
|
+
useEffect(() => {
|
89
|
+
// get all events
|
90
|
+
calendar?.events.getAll()
|
91
|
+
}, [])
|
92
|
+
|
93
|
+
return (
|
94
|
+
<div>
|
95
|
+
<ScheduleXCalendar calendarApp={calendar} customComponents={{
|
96
|
+
timeGridEvent: ({ calendarEvent }) => {
|
97
|
+
console.log(calendarEvent);
|
98
|
+
return (
|
99
|
+
<Paper h={'100%'} bg={calendarEvent.laLichThi ? 'violet.2' : "blue.2"} p={4}>
|
100
|
+
<MyFlexColumn gap={1}>
|
101
|
+
<Text size='sm' fw={'bold'}>{calendarEvent.laLichThi ? "(Thi) " : "(Học) "}{calendarEvent.title}</Text>
|
102
|
+
{calendarEvent.laLichThi == false && <Text size='sm'>{calendarEvent.giangvien}</Text>}
|
103
|
+
<Text size='sm'>{calendarEvent.location}</Text>
|
104
|
+
</MyFlexColumn>
|
105
|
+
</Paper>
|
106
|
+
)
|
107
|
+
},
|
108
|
+
// eventModal: ({ calendarEvent }) => {
|
109
|
+
// return (
|
110
|
+
// <Paper bg={'red'} style={{ position: 'relative', overflow: "hidden" }}>
|
111
|
+
// âs
|
112
|
+
// </Paper>
|
113
|
+
// )
|
114
|
+
// }
|
115
|
+
}} />
|
116
|
+
</div>
|
117
|
+
)
|
118
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Select, SelectProps } from '@mantine/core';
|
2
|
+
|
3
|
+
interface IMySelect extends SelectProps {
|
4
|
+
label?: string;
|
5
|
+
data: Array<string | { value: string; label: string }>; // Thêm `data` là mảng các lựa chọn
|
6
|
+
}
|
7
|
+
|
8
|
+
export function MySelect({ label, ...rest }: IMySelect) {
|
9
|
+
return (
|
10
|
+
<Select label={label} placeholder={label ? `Chọn ${label?.toLowerCase()}` : ""} {...rest} />
|
11
|
+
)
|
12
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { MyFlexRow } from '@/components/Layouts/FlexRow/MyFlexRow';
|
2
|
+
import { Badge, Card, Center, Image, Text } from '@mantine/core';
|
3
|
+
import Link from 'next/link';
|
4
|
+
import { ReactNode } from 'react';
|
5
|
+
export interface IAQCardProps {
|
6
|
+
imgSrc?: string | null,
|
7
|
+
title?: string
|
8
|
+
description?: string,
|
9
|
+
children?: ReactNode,
|
10
|
+
date?: string
|
11
|
+
status?: string,
|
12
|
+
href?: string
|
13
|
+
}
|
14
|
+
|
15
|
+
export function AQCard({
|
16
|
+
imgSrc = "https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/images/bg-8.png",
|
17
|
+
title,
|
18
|
+
description,
|
19
|
+
date,
|
20
|
+
children,
|
21
|
+
status,
|
22
|
+
href = ""
|
23
|
+
}: IAQCardProps) {
|
24
|
+
return (
|
25
|
+
<Card shadow="sm" padding="lg" radius="md" withBorder component={Link} href={href}>
|
26
|
+
<Card.Section >
|
27
|
+
<Center>
|
28
|
+
<Image
|
29
|
+
src={imgSrc}
|
30
|
+
h={200}
|
31
|
+
w="auto"
|
32
|
+
fallbackSrc="https://placehold.co/600x400?text=Placeholder"
|
33
|
+
alt="Norway"
|
34
|
+
/>
|
35
|
+
</Center>
|
36
|
+
</Card.Section>
|
37
|
+
|
38
|
+
<MyFlexRow justify="space-between" mt="md" mb="xs">
|
39
|
+
<Text fw={500} >{title}</Text>
|
40
|
+
{status && <Badge color='violet.5' w={'150px'}>{status}</Badge>}
|
41
|
+
</MyFlexRow>
|
42
|
+
|
43
|
+
<Text size="sm" c="dimmed" lineClamp={2}>
|
44
|
+
{description}
|
45
|
+
</Text>
|
46
|
+
{children}
|
47
|
+
</Card>
|
48
|
+
);
|
49
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { Box, Button, Flex, Group, Paper, Text } from "@mantine/core";
|
2
|
+
import { IconArrowDownRight, IconArrowUpRight } from "@tabler/icons-react";
|
3
|
+
import { ReactNode } from "react";
|
4
|
+
|
5
|
+
interface MyCardInformationProps {
|
6
|
+
title?: string,
|
7
|
+
value?: string,
|
8
|
+
unit?: string,
|
9
|
+
description?: string,
|
10
|
+
icon?: ReactNode,
|
11
|
+
diff?: number,
|
12
|
+
extraControl?: ReactNode
|
13
|
+
}
|
14
|
+
|
15
|
+
export function MyCardInformation({
|
16
|
+
title,
|
17
|
+
value,
|
18
|
+
unit = "",
|
19
|
+
description,
|
20
|
+
icon,
|
21
|
+
diff = 0,
|
22
|
+
extraControl
|
23
|
+
}: MyCardInformationProps) {
|
24
|
+
return (
|
25
|
+
<Paper withBorder
|
26
|
+
p="md"
|
27
|
+
radius="md"
|
28
|
+
key={title}>
|
29
|
+
<Group justify="space-between">
|
30
|
+
<Flex direction={"column"}>
|
31
|
+
<Text
|
32
|
+
tt="uppercase"
|
33
|
+
size="lg"
|
34
|
+
c="dimmed"
|
35
|
+
>
|
36
|
+
{title}
|
37
|
+
</Text>
|
38
|
+
{unit == "" ?
|
39
|
+
<Text size="xs" style={{ visibility: 'hidden' }}>Đơn vị: <strong>{unit}</strong></Text>
|
40
|
+
:
|
41
|
+
<Text size="xs">Đơn vị: <strong>{unit}</strong></Text>
|
42
|
+
}
|
43
|
+
</Flex>
|
44
|
+
<Box>
|
45
|
+
{icon}
|
46
|
+
</Box>
|
47
|
+
</Group>
|
48
|
+
|
49
|
+
<Group
|
50
|
+
mt={"5"}
|
51
|
+
align="flex-end"
|
52
|
+
gap={"xs"}
|
53
|
+
>
|
54
|
+
<Text
|
55
|
+
fw={700}
|
56
|
+
fz="h1"
|
57
|
+
>{value}
|
58
|
+
</Text>
|
59
|
+
<Text
|
60
|
+
mb={"2"}
|
61
|
+
c={diff > 0 ? 'teal' : 'red'}
|
62
|
+
fz="h2"
|
63
|
+
fw={500}
|
64
|
+
>
|
65
|
+
<span>{diff}%</span>{diff > 0 ? <IconArrowUpRight /> : <IconArrowDownRight />}
|
66
|
+
</Text>
|
67
|
+
</Group>
|
68
|
+
|
69
|
+
<Group justify="space-between">
|
70
|
+
<Text tt="uppercase" fz="xs" c="dimmed">
|
71
|
+
{description}
|
72
|
+
</Text>
|
73
|
+
{extraControl}
|
74
|
+
</Group>
|
75
|
+
</Paper>
|
76
|
+
);
|
77
|
+
}
|
@@ -0,0 +1,184 @@
|
|
1
|
+
"use client"
|
2
|
+
import { Button, Group, Portal } from '@mantine/core';
|
3
|
+
import { IconDownload } from '@tabler/icons-react';
|
4
|
+
import { ConfigOptions, download, generateCsv, mkConfig } from 'export-to-csv';
|
5
|
+
import {
|
6
|
+
MantineReactTable,
|
7
|
+
MRT_Row,
|
8
|
+
MRT_TableInstance,
|
9
|
+
useMantineReactTable,
|
10
|
+
type MRT_ColumnDef,
|
11
|
+
type MRT_RowData,
|
12
|
+
type MRT_TableOptions
|
13
|
+
} from 'mantine-react-table';
|
14
|
+
import { MRT_Localization_VI } from "mantine-react-table/locales/vi/index.cjs";
|
15
|
+
import { ReactNode, useEffect } from 'react';
|
16
|
+
|
17
|
+
type FormatFunction<TData extends MRT_RowData> = (value: any) => any;
|
18
|
+
|
19
|
+
interface IDataTable<TData extends MRT_RowData> extends MRT_TableOptions<TData> {
|
20
|
+
columns: MRT_ColumnDef<TData>[]; // Table columns
|
21
|
+
data: TData[]; // Table data
|
22
|
+
rowActionSize?: number; // Row action button size
|
23
|
+
exportAble?: boolean; // Flag to enable export all data
|
24
|
+
renderTopToolbarCustomActions?: ((props: {
|
25
|
+
table: MRT_TableInstance<TData>;
|
26
|
+
}) => ReactNode) | undefined,
|
27
|
+
csvConfigProps?: ConfigOptions,
|
28
|
+
formats?: {
|
29
|
+
[K in keyof TData]?: FormatFunction<TData>;
|
30
|
+
};
|
31
|
+
setSelectedRow?: (data: any) => void;
|
32
|
+
}
|
33
|
+
|
34
|
+
function formatData<TData extends MRT_RowData>(
|
35
|
+
data: TData[],
|
36
|
+
formats: {
|
37
|
+
[K in keyof TData]?: FormatFunction<TData>;
|
38
|
+
}
|
39
|
+
): TData[] {
|
40
|
+
return data.map((row) => {
|
41
|
+
const transformedRow: Partial<TData> = {};
|
42
|
+
Object.entries(row).forEach(([key, value]) => {
|
43
|
+
// Type-safe format application
|
44
|
+
const formatFn = formats[key as keyof TData];
|
45
|
+
|
46
|
+
// Special handling for Date type
|
47
|
+
if (value instanceof Date) {
|
48
|
+
transformedRow[key as keyof TData] = formatFn
|
49
|
+
? formatFn(value.toISOString())
|
50
|
+
: value.toISOString();
|
51
|
+
}
|
52
|
+
// Special handling for objects (excluding null)
|
53
|
+
else if (value !== null && typeof value === "object") {
|
54
|
+
transformedRow[key as keyof TData] = formatFn
|
55
|
+
? formatFn(JSON.stringify(value))
|
56
|
+
: JSON.stringify(value);
|
57
|
+
}
|
58
|
+
// General case
|
59
|
+
else {
|
60
|
+
transformedRow[key as keyof TData] = formatFn ? formatFn(value) : value;
|
61
|
+
}
|
62
|
+
});
|
63
|
+
return transformedRow as TData;
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
export function MyDataTable<TData extends MRT_RowData>(
|
69
|
+
{ formats = {}, exportAble = false, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow, ...rest }: IDataTable<TData>) {
|
70
|
+
const { renderRowActions } = { ...rest };
|
71
|
+
const csvConfig = mkConfig({
|
72
|
+
fieldSeparator: ',',
|
73
|
+
decimalSeparator: '.',
|
74
|
+
useKeysAsHeaders: csvConfigProps?.columnHeaders ? false : true,
|
75
|
+
...csvConfigProps
|
76
|
+
});
|
77
|
+
|
78
|
+
const handleExport = (rows: MRT_Row<TData>[]) => {
|
79
|
+
if (rows.length == 0) {
|
80
|
+
const transformedData = formatData(data, formats); // Sử dụng formats từ props
|
81
|
+
const csv = generateCsv(csvConfig)(transformedData);
|
82
|
+
download(csvConfig)(csv);
|
83
|
+
return
|
84
|
+
}
|
85
|
+
const rowData = rows.map((row) => row.original);
|
86
|
+
const transformedRows = formatData(rowData, formats);
|
87
|
+
const csv = generateCsv(csvConfig)(transformedRows);
|
88
|
+
download(csvConfig)(csv);
|
89
|
+
};
|
90
|
+
|
91
|
+
const table = useMantineReactTable({
|
92
|
+
columns,
|
93
|
+
data,
|
94
|
+
renderTopToolbarCustomActions: ({ table }) => {
|
95
|
+
return (
|
96
|
+
<Group>
|
97
|
+
{renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table: table })}
|
98
|
+
{exportAble &&
|
99
|
+
<>
|
100
|
+
{/* <Button
|
101
|
+
color='green.8'
|
102
|
+
onClick={() => handleExport(table.getSelectedRowModel().rows)}
|
103
|
+
leftSection={<IconDownload />}
|
104
|
+
variant="filled"
|
105
|
+
>
|
106
|
+
Import
|
107
|
+
</Button> */}
|
108
|
+
|
109
|
+
<Button
|
110
|
+
color='green.8'
|
111
|
+
onClick={() => handleExport(table.getSelectedRowModel().rows)}
|
112
|
+
leftSection={<IconDownload />}
|
113
|
+
variant="filled"
|
114
|
+
>
|
115
|
+
Export
|
116
|
+
</Button>
|
117
|
+
|
118
|
+
</>
|
119
|
+
|
120
|
+
}
|
121
|
+
</Group>
|
122
|
+
);
|
123
|
+
},
|
124
|
+
enableRowNumbers: true,
|
125
|
+
enableRowSelection: exportAble,
|
126
|
+
enableEditing: renderRowActions ? true : false,
|
127
|
+
positionActionsColumn: "last",
|
128
|
+
enableColumnResizing: true,
|
129
|
+
layoutMode: "semantic",
|
130
|
+
displayColumnDefOptions: {
|
131
|
+
"mrt-row-actions": {
|
132
|
+
header: "Thao tác",
|
133
|
+
size: rowActionSize,
|
134
|
+
},
|
135
|
+
"mrt-row-numbers": {
|
136
|
+
Header: "STT",
|
137
|
+
size: 1
|
138
|
+
},
|
139
|
+
},
|
140
|
+
enableColumnPinning: true,
|
141
|
+
initialState: {
|
142
|
+
density: "md",
|
143
|
+
pagination: { pageIndex: 0, pageSize: 30 },
|
144
|
+
columnPinning: { right: ["mrt-row-actions"] },
|
145
|
+
columnVisibility: {
|
146
|
+
nguoiCapNhat: false,
|
147
|
+
ngayCapNhat: false
|
148
|
+
}
|
149
|
+
},
|
150
|
+
mantineTableHeadCellProps: {
|
151
|
+
style: {
|
152
|
+
verticalAlign: "middle",
|
153
|
+
paddingTop: "2px",
|
154
|
+
paddingBottom: "2px",
|
155
|
+
},
|
156
|
+
},
|
157
|
+
mantineTableBodyCellProps: {
|
158
|
+
style: {
|
159
|
+
paddingTop: "2px",
|
160
|
+
paddingBottom: "2px",
|
161
|
+
},
|
162
|
+
},
|
163
|
+
localization: MRT_Localization_VI,
|
164
|
+
...rest, // Override default table options
|
165
|
+
});
|
166
|
+
|
167
|
+
|
168
|
+
useEffect(() => {
|
169
|
+
setSelectedRow && setSelectedRow(table.getSelectedRowModel().rows.map((row) => row.original));
|
170
|
+
}, [table.getState().rowSelection]);
|
171
|
+
|
172
|
+
if (data == undefined) return
|
173
|
+
return (
|
174
|
+
<main style={{ position: "relative", zIndex: 1 }}>
|
175
|
+
{table.getState().isFullScreen ? (
|
176
|
+
<Portal>
|
177
|
+
<MantineReactTable table={table} />
|
178
|
+
</Portal>
|
179
|
+
) : (
|
180
|
+
<MantineReactTable table={table} />
|
181
|
+
)}
|
182
|
+
</main>
|
183
|
+
)
|
184
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Group, Text } from "@mantine/core";
|
2
|
+
|
3
|
+
interface MyIconTextProps {
|
4
|
+
icon?: React.ElementType;
|
5
|
+
text?: string;
|
6
|
+
}
|
7
|
+
|
8
|
+
export function MyIconText({ icon: Icon, text }: MyIconTextProps) {
|
9
|
+
return (
|
10
|
+
<Group wrap="nowrap" gap={10} mt={3}>
|
11
|
+
{Icon && <Icon stroke={1.5} size={16} />}
|
12
|
+
<Text fz="lg" c="dimmed">
|
13
|
+
{text}
|
14
|
+
</Text>
|
15
|
+
</Group>
|
16
|
+
);
|
17
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Group, Text } from "@mantine/core";
|
2
|
+
|
3
|
+
|
4
|
+
interface I {
|
5
|
+
keyLabel?: string,
|
6
|
+
label?: string
|
7
|
+
}
|
8
|
+
export function MyKeyLabel({ keyLabel, label }: I) {
|
9
|
+
return (
|
10
|
+
<Group gap={5}>
|
11
|
+
<Text fw={'bold'}>{keyLabel}:</Text>
|
12
|
+
<Text>{label}</Text>
|
13
|
+
</Group>
|
14
|
+
)
|
15
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { NumberFormatter, NumberFormatterProps } from '@mantine/core'
|
2
|
+
|
3
|
+
|
4
|
+
interface I extends NumberFormatterProps { }
|
5
|
+
export function MyNumberFormatter({ ...rest }: I) {
|
6
|
+
return (
|
7
|
+
<NumberFormatter thousandSeparator suffix=' VNĐ' {...rest}></NumberFormatter>
|
8
|
+
)
|
9
|
+
}
|