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
package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
import { LineChart } from '@mantine/charts';
|
2
|
+
import { Group, Paper, Text } from '@mantine/core';
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{ month: '09/24', revenue: 59000000 },
|
6
|
+
{ month: '10/24', revenue: 206000000 },
|
7
|
+
{ month: '11/24', revenue: 125000000 },
|
8
|
+
];
|
9
|
+
|
10
|
+
interface ChartTooltipProps {
|
11
|
+
label: string;
|
12
|
+
payload: Record<string, any>[] | undefined;
|
13
|
+
}
|
14
|
+
|
15
|
+
function ChartTooltip({ label, payload }: ChartTooltipProps) {
|
16
|
+
if (!payload) return null;
|
17
|
+
|
18
|
+
return (
|
19
|
+
<Paper px="md" py="sm" withBorder shadow="md" radius="md">
|
20
|
+
<Text fw={500} mb={5}>
|
21
|
+
{isNaN(Date.parse(label)) ? label : new Date(label.replace(/(\d{2})\/(\d{2})/, '20$2-$1')).toLocaleDateString('vi-VN', { month: 'long', year: 'numeric' })}
|
22
|
+
</Text>
|
23
|
+
{payload.map((item: any) => (
|
24
|
+
<Text key={item.name} fz="sm">
|
25
|
+
Doanh thu: {formatCurrency(item.value)}
|
26
|
+
</Text>
|
27
|
+
))}
|
28
|
+
</Paper>
|
29
|
+
);
|
30
|
+
}
|
31
|
+
|
32
|
+
let formatCurrency = (value: number): string => {
|
33
|
+
return value.toLocaleString('vi-VN', { style: 'currency', currency: 'VND' });
|
34
|
+
}
|
35
|
+
|
36
|
+
let formatCurrency2 = (value: number): string => {
|
37
|
+
if (value >= 1000000000) {
|
38
|
+
return `${(value / 1000000000).toFixed(1)} tỷ`;
|
39
|
+
} else if (value >= 1000000) {
|
40
|
+
return `${(value / 1000000).toFixed(1)} tr`;
|
41
|
+
}
|
42
|
+
return value.toLocaleString('vi-VN', { style: 'currency', currency: 'VND' });
|
43
|
+
}
|
44
|
+
|
45
|
+
export default function LineChart_TotalRevenueByDiscountIn3Months() {
|
46
|
+
return (
|
47
|
+
<>
|
48
|
+
<Group>
|
49
|
+
<Text mb={"50"}>Doanh thu sử dụng chiết khấu 3 tháng qua</Text>
|
50
|
+
<LineChart
|
51
|
+
w={"100%"}
|
52
|
+
h={200}
|
53
|
+
data={data}
|
54
|
+
dataKey="month"
|
55
|
+
series={[
|
56
|
+
{ name: 'revenue', color: 'indigo.6' },
|
57
|
+
]}
|
58
|
+
tooltipProps={{
|
59
|
+
content: ({ label, payload }) => <ChartTooltip label={label} payload={payload} />,
|
60
|
+
}}
|
61
|
+
curveType="linear"
|
62
|
+
yAxisLabel="Tổng doanh thu"
|
63
|
+
tickLine="y"
|
64
|
+
yAxisProps={{ width: 64, tickFormatter: (value: number) => formatCurrency2(value) }}
|
65
|
+
/>
|
66
|
+
</Group>
|
67
|
+
</>
|
68
|
+
);
|
69
|
+
}
|
package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
import { LineChart } from '@mantine/charts';
|
2
|
+
import { Group, Paper, Text } from '@mantine/core';
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{ month: '09/24', revenue: 69000000 },
|
6
|
+
{ month: '10/24', revenue: 206000000 },
|
7
|
+
{ month: '11/24', revenue: 842000000 },
|
8
|
+
];
|
9
|
+
|
10
|
+
interface ChartTooltipProps {
|
11
|
+
label: string;
|
12
|
+
payload: Record<string, any>[] | undefined;
|
13
|
+
}
|
14
|
+
|
15
|
+
function ChartTooltip({ label, payload }: ChartTooltipProps) {
|
16
|
+
if (!payload) return null;
|
17
|
+
|
18
|
+
return (
|
19
|
+
<Paper px="md" py="sm" withBorder shadow="md" radius="md">
|
20
|
+
<Text fw={500} mb={5}>
|
21
|
+
{isNaN(Date.parse(label)) ? label : new Date(label.replace(/(\d{2})\/(\d{2})/, '20$2-$1')).toLocaleDateString('vi-VN', { month: 'long', year: 'numeric' })}
|
22
|
+
</Text>
|
23
|
+
{payload.map((item: any) => (
|
24
|
+
<Text key={item.name} fz="sm">
|
25
|
+
Doanh thu: {formatCurrency(item.value)}
|
26
|
+
</Text>
|
27
|
+
))}
|
28
|
+
</Paper>
|
29
|
+
);
|
30
|
+
}
|
31
|
+
|
32
|
+
let formatCurrency = (value: number): string => {
|
33
|
+
return value.toLocaleString('vi-VN', { style: 'currency', currency: 'VND' });
|
34
|
+
}
|
35
|
+
|
36
|
+
let formatCurrency2 = (value: number): string => {
|
37
|
+
if (value >= 1000000000) {
|
38
|
+
return `${(value / 1000000000).toFixed(1)} tỷ`;
|
39
|
+
} else if (value >= 1000000) {
|
40
|
+
return `${(value / 1000000).toFixed(1)} tr`;
|
41
|
+
}
|
42
|
+
return value.toLocaleString('vi-VN', { style: 'currency', currency: 'VND' });
|
43
|
+
}
|
44
|
+
|
45
|
+
export default function LineChart_TotalRevenueByDiscountIn3Months() {
|
46
|
+
return (
|
47
|
+
<>
|
48
|
+
<Group>
|
49
|
+
<Text mb={"50"}>Doanh thu sử dụng mã giảm giá 3 tháng qua</Text>
|
50
|
+
<LineChart
|
51
|
+
w={"100%"}
|
52
|
+
h={200}
|
53
|
+
data={data}
|
54
|
+
dataKey="month"
|
55
|
+
series={[
|
56
|
+
{ name: 'revenue', color: 'indigo.6' },
|
57
|
+
]}
|
58
|
+
tooltipProps={{
|
59
|
+
content: ({ label, payload }) => <ChartTooltip label={label} payload={payload} />,
|
60
|
+
}}
|
61
|
+
curveType="linear"
|
62
|
+
yAxisLabel="Tổng doanh thu"
|
63
|
+
tickLine="y"
|
64
|
+
yAxisProps={{ width: 64, tickFormatter: (value: number) => formatCurrency2(value) }}
|
65
|
+
/>
|
66
|
+
</Group>
|
67
|
+
</>
|
68
|
+
);
|
69
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { LineChart } from '@mantine/charts';
|
2
|
+
import { Group, Paper, Text } from '@mantine/core';
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{ month: '06/23', totalStudent: 245 },
|
6
|
+
{ month: '03/23', totalStudent: 456 },
|
7
|
+
{ month: '08/23', totalStudent: 343 },
|
8
|
+
{ month: '09/23', totalStudent: 860 },
|
9
|
+
{ month: '10/23', totalStudent: 930 },
|
10
|
+
{ month: '11/23', totalStudent: 790 },
|
11
|
+
{ month: '12/23', totalStudent: 1060 },
|
12
|
+
{ month: '01/24', totalStudent: 1700 },
|
13
|
+
{ month: '02/24', totalStudent: 1350 },
|
14
|
+
{ month: '03/24', totalStudent: 700 },
|
15
|
+
{ month: '04/24', totalStudent: 860 },
|
16
|
+
{ month: '05/24', totalStudent: 930 },
|
17
|
+
];
|
18
|
+
|
19
|
+
interface ChartTooltipProps {
|
20
|
+
label: string;
|
21
|
+
payload: Record<string, any>[] | undefined;
|
22
|
+
}
|
23
|
+
|
24
|
+
function ChartTooltip({ label, payload }: ChartTooltipProps) {
|
25
|
+
if (!payload) return null;
|
26
|
+
|
27
|
+
return (
|
28
|
+
<Paper px="md" py="sm" withBorder shadow="md" radius="md">
|
29
|
+
<Text fw={500} mb={5}>
|
30
|
+
{isNaN(Date.parse(label)) ? label : new Date(label.replace(/(\d{2})\/(\d{2})/, '20$2-$1')).toLocaleDateString('vi-VN', { month: 'long', year: 'numeric' })}
|
31
|
+
</Text>
|
32
|
+
{payload.map((item: any) => (
|
33
|
+
<Text key={item.name} fz="sm">
|
34
|
+
Số lượng: {item.value}
|
35
|
+
</Text>
|
36
|
+
))}
|
37
|
+
</Paper>
|
38
|
+
);
|
39
|
+
}
|
40
|
+
|
41
|
+
export default function LineChart_TotalStudentIn12Months() {
|
42
|
+
return (
|
43
|
+
<>
|
44
|
+
<Group>
|
45
|
+
<Text mb={"50"}>Biểu đồ số lượng học viên 12 tháng qua</Text>
|
46
|
+
<LineChart
|
47
|
+
w={"100%"}
|
48
|
+
h={200}
|
49
|
+
data={data}
|
50
|
+
dataKey="month"
|
51
|
+
series={[
|
52
|
+
{ name: 'totalStudent', color: 'rgba(64, 65, 135, 1)' },
|
53
|
+
]}
|
54
|
+
tooltipProps={{
|
55
|
+
content: ({ label, payload }) => <ChartTooltip label={label} payload={payload} />,
|
56
|
+
}}
|
57
|
+
curveType="linear"
|
58
|
+
yAxisLabel="Tổng số học viên"
|
59
|
+
tickLine="y"
|
60
|
+
/>
|
61
|
+
</Group>
|
62
|
+
</>
|
63
|
+
);
|
64
|
+
}
|
@@ -0,0 +1,311 @@
|
|
1
|
+
'use client'
|
2
|
+
import { Center, Progress, Space, Text } from "@mantine/core";
|
3
|
+
|
4
|
+
// const data_singleDiscountCode = {
|
5
|
+
// total: 500,
|
6
|
+
// used: 453,
|
7
|
+
// }
|
8
|
+
|
9
|
+
export default function ViewDiscountStat() {
|
10
|
+
return (
|
11
|
+
<>
|
12
|
+
<PieChart_DiscountUsedPercentage />
|
13
|
+
{/* <Divider />
|
14
|
+
<Group w={"100%"} align="end">
|
15
|
+
<TextInput
|
16
|
+
flex={1}
|
17
|
+
label="Tìm mã giảm giá"
|
18
|
+
placeholder="Nhập mã giảm giá"
|
19
|
+
/>
|
20
|
+
<Button>
|
21
|
+
Tìm kiếm
|
22
|
+
</Button>
|
23
|
+
</Group>
|
24
|
+
<Space mt={32} />
|
25
|
+
<Center>
|
26
|
+
<Text>Đã sử dụng: <strong>{data_singleDiscountCode.used} / {data_singleDiscountCode.total}</strong> - ({((data_singleDiscountCode.used / data_singleDiscountCode.total) * 100).toFixed(2)}%)</Text>
|
27
|
+
</Center>
|
28
|
+
<Progress color="yellow" radius="xs" size="lg" value={(data_singleDiscountCode.used / data_singleDiscountCode.total) * 100} /> */}
|
29
|
+
</>
|
30
|
+
)
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
35
|
+
import { MyFlexColumn } from "@/components/Layouts/FlexColumn/MyFlexColumn";
|
36
|
+
import { PieChart } from '@mantine/charts';
|
37
|
+
import { MRT_ColumnDef } from "mantine-react-table";
|
38
|
+
import { useMemo } from "react";
|
39
|
+
|
40
|
+
function getRandomColor(seed: number): string {
|
41
|
+
const random = Math.sin(seed) * 10000;
|
42
|
+
const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, '0')}`;
|
43
|
+
return color;
|
44
|
+
}
|
45
|
+
|
46
|
+
const data_used_discountCode = [
|
47
|
+
{ name: 'DSC01', value: 54, color: getRandomColor(1) },
|
48
|
+
{ name: 'DSC02', value: 32, color: getRandomColor(2) },
|
49
|
+
{ name: 'DSC03', value: 5, color: getRandomColor(3) },
|
50
|
+
{ name: 'DSC04', value: 20, color: getRandomColor(4) },
|
51
|
+
{ name: 'DSC05', value: 12, color: getRandomColor(5) },
|
52
|
+
{ name: 'DSC06', value: 45, color: getRandomColor(6) },
|
53
|
+
{ name: 'DSC07', value: 23, color: getRandomColor(7) },
|
54
|
+
{ name: 'DSC08', value: 34, color: getRandomColor(8) },
|
55
|
+
{ name: 'DSC09', value: 29, color: getRandomColor(9) },
|
56
|
+
{ name: 'DSC10', value: 18, color: getRandomColor(10) },
|
57
|
+
{ name: 'DSC11', value: 37, color: getRandomColor(11) },
|
58
|
+
{ name: 'DSC12', value: 22, color: getRandomColor(12) },
|
59
|
+
{ name: 'DSC13', value: 41, color: getRandomColor(13) },
|
60
|
+
{ name: 'DSC14', value: 27, color: getRandomColor(14) },
|
61
|
+
{ name: 'DSC15', value: 33, color: getRandomColor(15) },
|
62
|
+
{ name: 'DSC16', value: 19, color: getRandomColor(16) },
|
63
|
+
{ name: 'DSC17', value: 25, color: getRandomColor(17) },
|
64
|
+
{ name: 'DSC18', value: 30, color: getRandomColor(18) },
|
65
|
+
{ name: 'DSC19', value: 21, color: getRandomColor(19) },
|
66
|
+
{ name: 'DSC20', value: 26, color: getRandomColor(20) }
|
67
|
+
];
|
68
|
+
|
69
|
+
interface IUsedDiscountCode {
|
70
|
+
code: string;
|
71
|
+
name: string;
|
72
|
+
total: number
|
73
|
+
used: number;
|
74
|
+
color: string;
|
75
|
+
}
|
76
|
+
|
77
|
+
const mockData = [
|
78
|
+
{
|
79
|
+
code: 'DSC01',
|
80
|
+
name: 'Discount Code 1',
|
81
|
+
total: 100,
|
82
|
+
used: 54,
|
83
|
+
color: getRandomColor(1)
|
84
|
+
},
|
85
|
+
{
|
86
|
+
code: 'DSC02',
|
87
|
+
name: 'Discount Code 2',
|
88
|
+
total: 150,
|
89
|
+
used: 32,
|
90
|
+
color: getRandomColor(2)
|
91
|
+
},
|
92
|
+
{
|
93
|
+
code: 'DSC03',
|
94
|
+
name: 'Discount Code 3',
|
95
|
+
total: 10,
|
96
|
+
used: 5,
|
97
|
+
color: getRandomColor(3)
|
98
|
+
},
|
99
|
+
{
|
100
|
+
code: 'DSC04',
|
101
|
+
name: 'Discount Code 4',
|
102
|
+
total: 100,
|
103
|
+
used: 20,
|
104
|
+
color: getRandomColor(4)
|
105
|
+
},
|
106
|
+
{
|
107
|
+
code: 'DSC05',
|
108
|
+
name: 'Discount Code 5',
|
109
|
+
total: 100,
|
110
|
+
used: 12,
|
111
|
+
color: getRandomColor(5)
|
112
|
+
},
|
113
|
+
{
|
114
|
+
code: 'DSC06',
|
115
|
+
name: 'Discount Code 6',
|
116
|
+
total: 100,
|
117
|
+
used: 45,
|
118
|
+
color: getRandomColor(6)
|
119
|
+
},
|
120
|
+
{
|
121
|
+
code: 'DSC07',
|
122
|
+
name: 'Discount Code 7',
|
123
|
+
total: 100,
|
124
|
+
used: 23,
|
125
|
+
color: getRandomColor(7)
|
126
|
+
},
|
127
|
+
{
|
128
|
+
code: 'DSC08',
|
129
|
+
name: 'Discount Code 8',
|
130
|
+
total: 100,
|
131
|
+
used: 34,
|
132
|
+
color: getRandomColor(8)
|
133
|
+
},
|
134
|
+
{
|
135
|
+
code: 'DSC09',
|
136
|
+
name: 'Discount Code 9',
|
137
|
+
total: 100,
|
138
|
+
used: 29,
|
139
|
+
color: getRandomColor(9)
|
140
|
+
},
|
141
|
+
{
|
142
|
+
code: 'DSC10',
|
143
|
+
name: 'Discount Code 10',
|
144
|
+
total: 100,
|
145
|
+
used: 18,
|
146
|
+
color: getRandomColor(10)
|
147
|
+
},
|
148
|
+
{
|
149
|
+
code: 'DSC11',
|
150
|
+
name: 'Discount Code 11',
|
151
|
+
total: 100,
|
152
|
+
used: 37,
|
153
|
+
color: getRandomColor(11)
|
154
|
+
},
|
155
|
+
{
|
156
|
+
code: 'DSC12',
|
157
|
+
name: 'Discount Code 12',
|
158
|
+
total: 100,
|
159
|
+
used: 22,
|
160
|
+
color: getRandomColor(12)
|
161
|
+
},
|
162
|
+
{
|
163
|
+
code: 'DSC13',
|
164
|
+
name: 'Discount Code 13',
|
165
|
+
total: 100,
|
166
|
+
used: 41,
|
167
|
+
color: getRandomColor(13)
|
168
|
+
},
|
169
|
+
{
|
170
|
+
code: 'DSC14',
|
171
|
+
name: 'Discount Code 14',
|
172
|
+
total: 100,
|
173
|
+
used: 27,
|
174
|
+
color: getRandomColor(14)
|
175
|
+
},
|
176
|
+
{
|
177
|
+
code: 'DSC15',
|
178
|
+
name: 'Discount Code 15',
|
179
|
+
total: 100,
|
180
|
+
used: 33,
|
181
|
+
color: getRandomColor(15)
|
182
|
+
},
|
183
|
+
{
|
184
|
+
code: 'DSC16',
|
185
|
+
name: 'Discount Code 16',
|
186
|
+
total: 100,
|
187
|
+
used: 19,
|
188
|
+
color: getRandomColor(16)
|
189
|
+
},
|
190
|
+
{
|
191
|
+
code: 'DSC17',
|
192
|
+
name: 'Discount Code 17',
|
193
|
+
total: 100,
|
194
|
+
used: 25,
|
195
|
+
color: getRandomColor(17)
|
196
|
+
},
|
197
|
+
{
|
198
|
+
code: 'DSC18',
|
199
|
+
name: 'Discount Code 18',
|
200
|
+
total: 100,
|
201
|
+
used: 30,
|
202
|
+
color: getRandomColor(18)
|
203
|
+
},
|
204
|
+
{
|
205
|
+
code: 'DSC19',
|
206
|
+
name: 'Discount Code 19',
|
207
|
+
total: 100,
|
208
|
+
used: 21,
|
209
|
+
color: getRandomColor(19)
|
210
|
+
},
|
211
|
+
{
|
212
|
+
code: 'DSC20',
|
213
|
+
name: 'Discount Code 20',
|
214
|
+
total: 100,
|
215
|
+
used: 26,
|
216
|
+
color: getRandomColor(20)
|
217
|
+
}
|
218
|
+
]
|
219
|
+
|
220
|
+
export function PieChart_DiscountUsedPercentage() {
|
221
|
+
|
222
|
+
const totalDisountCode = mockData.reduce((acc, cur) => acc + cur.used, 0);
|
223
|
+
|
224
|
+
const columns = useMemo<MRT_ColumnDef<IUsedDiscountCode>[]>(
|
225
|
+
() => [
|
226
|
+
{
|
227
|
+
header: "Màu",
|
228
|
+
accessorKey: "color",
|
229
|
+
accessorFn(originalRow) {
|
230
|
+
return (
|
231
|
+
<div style={{ width: 20, height: 20, backgroundColor: originalRow.color }} />
|
232
|
+
)
|
233
|
+
},
|
234
|
+
minSize: 30,
|
235
|
+
maxSize: 30
|
236
|
+
},
|
237
|
+
{
|
238
|
+
header: "Mã",
|
239
|
+
accessorKey: "code",
|
240
|
+
minSize: 20,
|
241
|
+
maxSize: 20
|
242
|
+
|
243
|
+
},
|
244
|
+
{
|
245
|
+
header: "%",
|
246
|
+
accessorKey: "used",
|
247
|
+
accessorFn(originalRow) {
|
248
|
+
return (
|
249
|
+
<>
|
250
|
+
<Center>
|
251
|
+
<Text>{((originalRow.used / totalDisountCode) * 100).toFixed(0)}%</Text>
|
252
|
+
</Center>
|
253
|
+
</>
|
254
|
+
)
|
255
|
+
},
|
256
|
+
minSize: 64,
|
257
|
+
maxSize: 64
|
258
|
+
},
|
259
|
+
{
|
260
|
+
header: "Số lượng sử dụng",
|
261
|
+
accessorKey: "value",
|
262
|
+
accessorFn(originalRow) {
|
263
|
+
return originalRow.used;
|
264
|
+
},
|
265
|
+
Cell: ({ row }) => {
|
266
|
+
return (
|
267
|
+
<>
|
268
|
+
<Center>
|
269
|
+
<Text>Đã sử dụng: <strong>{row.original.used} / {row.original.total}</strong> - ({((row.original.used / row.original.total) * 100).toFixed(2)}%)</Text>
|
270
|
+
</Center>
|
271
|
+
<Progress color="yellow" radius="xs" size="lg" value={(row.original.used / row.original.total) * 100} />
|
272
|
+
</>
|
273
|
+
)
|
274
|
+
},
|
275
|
+
minSize: 50,
|
276
|
+
maxSize: 50
|
277
|
+
}
|
278
|
+
],
|
279
|
+
[]
|
280
|
+
);
|
281
|
+
|
282
|
+
return (
|
283
|
+
<>
|
284
|
+
<MyFlexColumn>
|
285
|
+
<Text mb={"20"}>Biểu đồ phần trăm sử dụng chiết khấu học viên trong 60 ngày qua</Text>
|
286
|
+
<Center>
|
287
|
+
<PieChart
|
288
|
+
startAngle={90}
|
289
|
+
endAngle={-270}
|
290
|
+
strokeWidth={0}
|
291
|
+
withLabelsLine
|
292
|
+
labelsPosition="outside"
|
293
|
+
withLabels
|
294
|
+
labelsType="percent"
|
295
|
+
data={data_used_discountCode}
|
296
|
+
/>
|
297
|
+
</Center>
|
298
|
+
<Space mt={5} />
|
299
|
+
<MyDataTable
|
300
|
+
data={mockData}
|
301
|
+
columns={columns}
|
302
|
+
initialState={{
|
303
|
+
density: "xs",
|
304
|
+
pagination: { pageIndex: 0, pageSize: 5 },
|
305
|
+
}}
|
306
|
+
/>
|
307
|
+
</MyFlexColumn>
|
308
|
+
</>
|
309
|
+
)
|
310
|
+
}
|
311
|
+
|