aq-fe-framework 0.1.156 → 0.1.157
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/{chunk-JLT4BL7I.mjs → chunk-ZO7PLULO.mjs} +4 -4
- package/dist/{css.module-4ICLUKPO.module.css → components/index.css} +16 -29
- package/dist/components/index.mjs +2 -2
- package/dist/modules-features/index.css +100 -0
- package/dist/modules-features/index.mjs +5 -5
- package/package.json +1 -1
- package/dist/api/apiFactory.ts +0 -46
- package/dist/api/baseAxios.ts +0 -22
- package/dist/app/admin/(core)/core12196/page.tsx +0 -13
- package/dist/app/admin/(core)/core16209/page.tsx +0 -13
- package/dist/app/admin/(core)/core18256/page.tsx +0 -12
- package/dist/app/admin/(core)/core26965/page.tsx +0 -13
- package/dist/app/admin/(core)/core27311/page.tsx +0 -13
- package/dist/app/admin/(core)/core38677/page.tsx +0 -13
- package/dist/app/admin/(core)/core40207/page.tsx +0 -13
- package/dist/app/admin/(core)/core60524/page.tsx +0 -11
- package/dist/app/admin/(core)/core64229/page.tsx +0 -12
- package/dist/app/admin/(core)/core71678/page.tsx +0 -11
- package/dist/app/admin/(core)/core76318/page.tsx +0 -13
- package/dist/app/admin/(core)/core83092/page.tsx +0 -13
- package/dist/app/admin/[...slug]/page.tsx +0 -7
- package/dist/app/admin/error.tsx +0 -42
- package/dist/app/admin/layout.tsx +0 -21
- package/dist/app/admin/test/page.tsx +0 -44
- package/dist/app/auth/login/page.tsx +0 -14
- package/dist/app/globals.css +0 -59
- package/dist/app/layout.tsx +0 -39
- package/dist/app/page.tsx +0 -18
- package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +0 -66
- package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +0 -31
- package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +0 -47
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +0 -81
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +0 -68
- package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +0 -50
- package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +0 -13
- package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +0 -113
- package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +0 -19
- package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +0 -63
- package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +0 -36
- package/dist/components/AppSpotlight/MyAppSpotlight.tsx +0 -112
- package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +0 -46
- package/dist/components/Buttons/Button/MyButton.tsx +0 -90
- package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +0 -81
- package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +0 -75
- package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +0 -68
- package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +0 -29
- package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +0 -100
- package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +0 -81
- package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +0 -196
- package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +0 -71
- package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +0 -117
- package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +0 -37
- package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +0 -174
- package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +0 -29
- package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +0 -121
- package/dist/components/Calendar/MyCalendar.tsx +0 -118
- package/dist/components/CenterFull/MyCenterFull.tsx +0 -10
- package/dist/components/Checkbox/MyCheckbox.tsx +0 -9
- package/dist/components/Combobox/Select/MySelect.tsx +0 -12
- package/dist/components/DataDisplay/Card/AQCard.tsx +0 -49
- package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +0 -77
- package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +0 -184
- package/dist/components/DataDisplay/IconText/MyIconText.tsx +0 -17
- package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +0 -15
- package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +0 -9
- package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +0 -68
- package/dist/components/FaviconSetter/FaviconSetter.tsx +0 -33
- package/dist/components/Inputs/DateInput/MyDateInput.tsx +0 -11
- package/dist/components/Inputs/Fieldset/MyFieldset.tsx +0 -32
- package/dist/components/Inputs/FileInput/MyFileInput.tsx +0 -12
- package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +0 -12
- package/dist/components/Inputs/TextArea/MyTextArea.tsx +0 -11
- package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +0 -191
- package/dist/components/Inputs/TextInput/MyTextInput.tsx +0 -30
- package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +0 -357
- package/dist/components/Layouts/BasicAppShell/css.module.css +0 -62
- package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +0 -64
- package/dist/components/Layouts/Container/MyContainer.tsx +0 -16
- package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +0 -14
- package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +0 -14
- package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +0 -14
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +0 -147
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +0 -19
- package/dist/components/Layouts/HeaderMegaMenu/css.module.css +0 -50
- package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +0 -29
- package/dist/components/Layouts/PageContent/MyPageContent.tsx +0 -67
- package/dist/components/Layouts/Tab/MyTab.tsx +0 -33
- package/dist/components/Loaders/MyCardioLoader.tsx +0 -12
- package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +0 -61
- package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +0 -37
- package/dist/components/ScheduleX/MyScheduleX.tsx +0 -58
- package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +0 -9
- package/dist/components/index.ts +0 -62
- package/dist/constants/array/daysOfWeek.ts +0 -9
- package/dist/constants/enum/ENUM_EMAILCONFIG.ts +0 -6
- package/dist/constants/enum/global.ts +0 -26
- package/dist/constants/object/color.ts +0 -5
- package/dist/constants/object/documentTypes.ts +0 -8
- package/dist/css.module-P45UW6UZ.module.css +0 -4
- package/dist/data/menuData.ts +0 -31
- package/dist/hooks/custom-hooks/useC_MutationAction.tsx +0 -36
- package/dist/hooks/index.ts +0 -2
- package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +0 -14
- package/dist/interfaces/EmailConfig.ts +0 -10
- package/dist/interfaces/IAQModule.ts +0 -21
- package/dist/interfaces/base.ts +0 -9
- package/dist/interfaces/global-interface/IAQSSO.ts +0 -15
- package/dist/interfaces/global-interface/IAQSyncData.ts +0 -9
- package/dist/interfaces/global-interface/IAcademicYear.ts +0 -12
- package/dist/interfaces/global-interface/IChangePassWord.ts +0 -8
- package/dist/interfaces/global-interface/IComplaintProccess.ts +0 -9
- package/dist/interfaces/global-interface/ICreateAccount.ts +0 -24
- package/dist/interfaces/global-interface/IDocument.ts +0 -25
- package/dist/interfaces/global-interface/IDocumentAttribute.ts +0 -12
- package/dist/interfaces/global-interface/IEvent.ts +0 -30
- package/dist/interfaces/global-interface/IEventComplaint.ts +0 -20
- package/dist/interfaces/global-interface/IEventFillter.ts +0 -14
- package/dist/interfaces/global-interface/IFile.ts +0 -8
- package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +0 -8
- package/dist/interfaces/global-interface/IPagePermission.ts +0 -12
- package/dist/interfaces/global-interface/IRolePermission.ts +0 -7
- package/dist/interfaces/global-interface/ISRMUserinfo.ts +0 -35
- package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +0 -14
- package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +0 -21
- package/dist/interfaces/global-interface/ISignIn.ts +0 -7
- package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +0 -15
- package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +0 -31
- package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +0 -12
- package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +0 -16
- package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/IUpdateAccount.ts +0 -15
- package/dist/interfaces/global-interface/IUser.ts +0 -21
- package/dist/interfaces/global-interface/IUserPermission.ts +0 -7
- package/dist/lib/utils.ts +0 -6
- package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +0 -87
- package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +0 -65
- package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +0 -82
- package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +0 -67
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +0 -78
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +0 -64
- package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +0 -311
- package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +0 -311
- package/dist/modules-features/admin/core/core12196/F_core12196.tsx +0 -20
- package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +0 -101
- package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209.tsx +0 -108
- package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +0 -114
- package/dist/modules-features/admin/core/core18256/F_core18256.tsx +0 -29
- package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +0 -34
- package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +0 -14
- package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +0 -59
- package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +0 -40
- package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +0 -22
- package/dist/modules-features/admin/core/core26965/F_core26965.tsx +0 -17
- package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +0 -106
- package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core27311/F_core27311.tsx +0 -21
- package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +0 -109
- package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +0 -113
- package/dist/modules-features/admin/core/core35923/F_core35923.tsx +0 -46
- package/dist/modules-features/admin/core/core38677/F_core38677.tsx +0 -28
- package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +0 -79
- package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +0 -264
- package/dist/modules-features/admin/core/core40207/F_core40207.tsx +0 -9
- package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +0 -81
- package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +0 -98
- package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +0 -83
- package/dist/modules-features/admin/core/core47643/F_core47643.tsx +0 -10
- package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +0 -13
- package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +0 -34
- package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +0 -57
- package/dist/modules-features/admin/core/core60524/F_core60524.tsx +0 -13
- package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +0 -111
- package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +0 -56
- package/dist/modules-features/admin/core/core60524/useS_core60524.ts +0 -16
- package/dist/modules-features/admin/core/core64229/F_core64229.tsx +0 -7
- package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +0 -21
- package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +0 -95
- package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +0 -67
- package/dist/modules-features/admin/core/core71678/F_core71678.tsx +0 -8
- package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +0 -117
- package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +0 -61
- package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +0 -16
- package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +0 -92
- package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +0 -49
- package/dist/modules-features/admin/core/core76318/F_core76318.tsx +0 -9
- package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +0 -89
- package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +0 -104
- package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +0 -89
- package/dist/modules-features/admin/core/core83092/F_core83092.tsx +0 -27
- package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +0 -85
- package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +0 -263
- package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +0 -70
- package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +0 -154
- package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +0 -4
- package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +0 -22
- package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +0 -21
- package/dist/modules-features/authenticate/useS_authenticate.ts +0 -23
- package/dist/modules-features/index.ts +0 -79
- package/dist/providers/MyMantineProvider.tsx +0 -140
- package/dist/providers/MyReactQueryProvider.tsx +0 -24
- package/dist/providers/Provider.tsx +0 -13
- package/dist/providers/mantine.module.css +0 -21
- package/dist/stores/CreateGenericStore.ts +0 -23
- package/dist/stores/index.ts +0 -1
- package/dist/types/types.ts +0 -16
- package/dist/utils/index.ts +0 -9
- package/dist/utils/utils_converter.ts +0 -39
- package/dist/utils/utils_currency.ts +0 -5
- package/dist/utils/utils_date.ts +0 -34
- package/dist/utils/utils_excel.ts +0 -128
- package/dist/utils/utils_file.ts +0 -61
- package/dist/utils/utils_notification.ts +0 -46
- package/dist/utils/utils_pdf.ts +0 -21
- package/dist/utils/utils_time.ts +0 -15
- package/dist/utils/utils_validateForm.ts +0 -9
@@ -1,174 +0,0 @@
|
|
1
|
-
import { MyHtmlWrapper } from "@/components/Layouts/HtmlWrapper/MyHtmlWrapper";
|
2
|
-
import { Box, Table } from "@mantine/core";
|
3
|
-
import { MRT_RowData } from "mantine-react-table";
|
4
|
-
import { MyButtonPrintPDF } from "../ButtonPrintPDF/MyButtonPrintPDF";
|
5
|
-
interface FieldConfig {
|
6
|
-
fieldName: string; // Field name in the data
|
7
|
-
header: string; // Header name for the print
|
8
|
-
isCenter?: boolean; // Optional flag to center align content, default is true
|
9
|
-
formatFunction?: (value: any, row: any) => any; // Optional formatting function
|
10
|
-
}
|
11
|
-
|
12
|
-
interface PrintConfig {
|
13
|
-
fields: FieldConfig[]; // Array of field configurations
|
14
|
-
title?: string; // Optional title for the printed table
|
15
|
-
showRowNumbers?: boolean; // Optional flag to show row numbers
|
16
|
-
}
|
17
|
-
|
18
|
-
interface AQButtonPrintTableProps<TData extends MRT_RowData = any> extends React.ComponentPropsWithoutRef<typeof MyButtonPrintPDF> {
|
19
|
-
printConfig?: PrintConfig; // Optional print configuration
|
20
|
-
objectName?: string; // Name of the file to print
|
21
|
-
data?: TData[]; // Data to print
|
22
|
-
}
|
23
|
-
|
24
|
-
export function MyButtonPrintTablePDF<TData extends MRT_RowData = any>({
|
25
|
-
printConfig,
|
26
|
-
data,
|
27
|
-
...rest
|
28
|
-
}: AQButtonPrintTableProps<TData>) {
|
29
|
-
const formatDate = (date: Date): string => {
|
30
|
-
const day = String(date.getDate()).padStart(2, '0');
|
31
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
32
|
-
const year = date.getFullYear();
|
33
|
-
return `${day}/${month}/${year}`;
|
34
|
-
};
|
35
|
-
|
36
|
-
// Hàm format giá trị theo kiểu dữ liệu
|
37
|
-
const formatValue = (value: any): string => {
|
38
|
-
if (value === undefined || value === null) {
|
39
|
-
return '';
|
40
|
-
}
|
41
|
-
|
42
|
-
// Xử lý định dạng ngày tháng
|
43
|
-
if (value instanceof Date) {
|
44
|
-
return formatDate(value);
|
45
|
-
}
|
46
|
-
|
47
|
-
// Xử lý các kiểu dữ liệu khác
|
48
|
-
return String(value);
|
49
|
-
};
|
50
|
-
|
51
|
-
const rows = data?.map((item, index) => {
|
52
|
-
if (!printConfig?.fields) return null;
|
53
|
-
|
54
|
-
return (
|
55
|
-
<Table.Tr key={index}>
|
56
|
-
{printConfig.showRowNumbers && (
|
57
|
-
<Table.Td ta="center" px="xs" style={{ border: "1px solid lightgray" }}>
|
58
|
-
{index + 1}
|
59
|
-
</Table.Td>
|
60
|
-
)}
|
61
|
-
{printConfig.fields.map((field) => {
|
62
|
-
let value = item[field.fieldName];
|
63
|
-
|
64
|
-
if (field.formatFunction) {
|
65
|
-
value = field.formatFunction(value, item);
|
66
|
-
} else {
|
67
|
-
value = formatValue(value);
|
68
|
-
}
|
69
|
-
|
70
|
-
const alignment = field.isCenter === false ? "left" : "center";
|
71
|
-
|
72
|
-
// Xử lý giá trị HTML
|
73
|
-
if (typeof value === 'string' && (value.includes('<') || value.includes('<'))) {
|
74
|
-
return (
|
75
|
-
<Table.Td
|
76
|
-
key={field.fieldName}
|
77
|
-
px="xs"
|
78
|
-
ta={alignment}
|
79
|
-
style={{ border: "1px solid lightgray" }}
|
80
|
-
>
|
81
|
-
<MyHtmlWrapper html={value} />
|
82
|
-
</Table.Td>
|
83
|
-
);
|
84
|
-
}
|
85
|
-
|
86
|
-
// Xử lý giá trị boolean
|
87
|
-
if (value === 'true' || value === 'false') {
|
88
|
-
return (
|
89
|
-
<Table.Td
|
90
|
-
key={field.fieldName}
|
91
|
-
ta={alignment}
|
92
|
-
px="xs"
|
93
|
-
style={{ border: "1px solid lightgray" }}
|
94
|
-
>
|
95
|
-
<input type="checkbox" checked={value === 'true'} readOnly />
|
96
|
-
</Table.Td>
|
97
|
-
);
|
98
|
-
}
|
99
|
-
|
100
|
-
return (
|
101
|
-
<Table.Td
|
102
|
-
key={field.fieldName}
|
103
|
-
ta={alignment}
|
104
|
-
px="xs"
|
105
|
-
style={{ border: "1px solid lightgray" }}
|
106
|
-
>
|
107
|
-
{value}
|
108
|
-
</Table.Td>
|
109
|
-
);
|
110
|
-
})}
|
111
|
-
</Table.Tr>
|
112
|
-
);
|
113
|
-
});
|
114
|
-
|
115
|
-
const renderContent = () => {
|
116
|
-
if (!data || !printConfig?.fields) return null;
|
117
|
-
|
118
|
-
const today = new Date();
|
119
|
-
const formattedDate = today.toLocaleDateString('vi-VN', {
|
120
|
-
year: 'numeric',
|
121
|
-
month: 'long',
|
122
|
-
day: 'numeric',
|
123
|
-
hour: '2-digit',
|
124
|
-
minute: '2-digit'
|
125
|
-
});
|
126
|
-
|
127
|
-
const tableTitle = printConfig?.title || "Bảng dữ liệu";
|
128
|
-
|
129
|
-
return (
|
130
|
-
<Box p="lg" >
|
131
|
-
<div style={{ textAlign: 'center', marginTop: '10px', fontStyle: 'italic', color: '#666' }}>
|
132
|
-
Ngày in: {formattedDate}
|
133
|
-
</div>
|
134
|
-
<h2 style={{ textAlign: 'center', fontSize: '24px', fontWeight: 'bold', marginBottom: '20px' }}>
|
135
|
-
{tableTitle}
|
136
|
-
</h2>
|
137
|
-
<Table withColumnBorders highlightOnHover style={{ border: "1px solid lightgray" }}>
|
138
|
-
<Table.Thead>
|
139
|
-
<Table.Tr>
|
140
|
-
{printConfig.showRowNumbers && (
|
141
|
-
<Table.Th style={{ border: "1px solid lightgray" }} w="10%" ta="center" px="xs">
|
142
|
-
STT
|
143
|
-
</Table.Th>
|
144
|
-
)}
|
145
|
-
{printConfig.fields.map((field) => {
|
146
|
-
const alignment = field.isCenter === false ? "left" : "center";
|
147
|
-
return (
|
148
|
-
<Table.Th
|
149
|
-
key={field.fieldName}
|
150
|
-
style={{ border: "1px solid lightgray" }}
|
151
|
-
ta={alignment}
|
152
|
-
px="xs"
|
153
|
-
>
|
154
|
-
{field.header}
|
155
|
-
</Table.Th>
|
156
|
-
);
|
157
|
-
})}
|
158
|
-
</Table.Tr>
|
159
|
-
</Table.Thead>
|
160
|
-
<Table.Tbody>
|
161
|
-
{rows}
|
162
|
-
</Table.Tbody>
|
163
|
-
</Table>
|
164
|
-
</Box>
|
165
|
-
);
|
166
|
-
};
|
167
|
-
return (
|
168
|
-
<MyButtonPrintPDF
|
169
|
-
contentToPrint={renderContent()}
|
170
|
-
{...rest}
|
171
|
-
/>
|
172
|
-
);
|
173
|
-
}
|
174
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import { Button, ButtonProps } from "@mantine/core";
|
3
|
-
import { IconArrowBack } from "@tabler/icons-react";
|
4
|
-
import { useRouter } from "next/navigation";
|
5
|
-
|
6
|
-
interface IMyButtonRouterBack extends ButtonProps {
|
7
|
-
url?: string;
|
8
|
-
label?: string;
|
9
|
-
}
|
10
|
-
|
11
|
-
export function MyButtonRouterBack({ url, label, ...rest }: IMyButtonRouterBack) {
|
12
|
-
const router = useRouter();
|
13
|
-
return (
|
14
|
-
<Button
|
15
|
-
variant="light"
|
16
|
-
leftSection={<IconArrowBack stroke={2} />}
|
17
|
-
onClick={() => {
|
18
|
-
if (url) {
|
19
|
-
router.replace(url);
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
router.back();
|
23
|
-
}}
|
24
|
-
{...rest}
|
25
|
-
>
|
26
|
-
{label ? label : "Trở về"}
|
27
|
-
</Button>
|
28
|
-
);
|
29
|
-
}
|
@@ -1,121 +0,0 @@
|
|
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
|
-
}
|
@@ -1,118 +0,0 @@
|
|
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
|
-
}
|
@@ -1,12 +0,0 @@
|
|
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
|
-
}
|
@@ -1,49 +0,0 @@
|
|
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
|
-
}
|
@@ -1,77 +0,0 @@
|
|
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
|
-
}
|