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,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_VoucherUsedPercentage />
|
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: 'VOU01', value: 124, color: getRandomColor(1) },
|
48
|
+
{ name: 'VOU02', value: 34, color: getRandomColor(2) },
|
49
|
+
{ name: 'VOU03', value: 23, color: getRandomColor(3) },
|
50
|
+
{ name: 'VOU04', value: 34, color: getRandomColor(4) },
|
51
|
+
{ name: 'VOU05', value: 46, color: getRandomColor(5) },
|
52
|
+
{ name: 'VOU06', value: 123, color: getRandomColor(6) },
|
53
|
+
{ name: 'VOU07', value: 87, color: getRandomColor(7) },
|
54
|
+
{ name: 'VOU08', value: 25, color: getRandomColor(8) },
|
55
|
+
{ name: 'VOU09', value: 34, color: getRandomColor(9) },
|
56
|
+
{ name: 'VOU10', value: 67, color: getRandomColor(10) },
|
57
|
+
{ name: 'VOU11', value: 23, color: getRandomColor(11) },
|
58
|
+
{ name: 'VOU12', value: 98, color: getRandomColor(12) },
|
59
|
+
{ name: 'VOU13', value: 54, color: getRandomColor(13) },
|
60
|
+
{ name: 'VOU14', value: 27, color: getRandomColor(14) },
|
61
|
+
{ name: 'VOU15', value: 3, color: getRandomColor(15) },
|
62
|
+
{ name: 'VOU16', value: 56, color: getRandomColor(16) },
|
63
|
+
{ name: 'VOU17', value: 85, color: getRandomColor(17) },
|
64
|
+
{ name: 'VOU18', value: 45, color: getRandomColor(18) },
|
65
|
+
{ name: 'VOU19', value: 64, color: getRandomColor(19) },
|
66
|
+
{ name: 'VOU20', value: 12, color: getRandomColor(20) }
|
67
|
+
];
|
68
|
+
|
69
|
+
interface IUsedVoucherCode {
|
70
|
+
code: string;
|
71
|
+
name: string;
|
72
|
+
total: number
|
73
|
+
used: number;
|
74
|
+
color: string;
|
75
|
+
}
|
76
|
+
|
77
|
+
const mockData = [
|
78
|
+
{
|
79
|
+
code: 'VOU01',
|
80
|
+
name: 'Voucher Code 1',
|
81
|
+
total: 150,
|
82
|
+
used: 124,
|
83
|
+
color: getRandomColor(1)
|
84
|
+
},
|
85
|
+
{
|
86
|
+
code: 'VOU02',
|
87
|
+
name: 'Voucher Code 2',
|
88
|
+
total: 150,
|
89
|
+
used: 34,
|
90
|
+
color: getRandomColor(2)
|
91
|
+
},
|
92
|
+
{
|
93
|
+
code: 'VOU03',
|
94
|
+
name: 'Voucher Code 3',
|
95
|
+
total: 50,
|
96
|
+
used: 23,
|
97
|
+
color: getRandomColor(3)
|
98
|
+
},
|
99
|
+
{
|
100
|
+
code: 'VOU04',
|
101
|
+
name: 'Voucher Code 4',
|
102
|
+
total: 100,
|
103
|
+
used: 34,
|
104
|
+
color: getRandomColor(4)
|
105
|
+
},
|
106
|
+
{
|
107
|
+
code: 'VOU05',
|
108
|
+
name: 'Voucher Code 5',
|
109
|
+
total: 100,
|
110
|
+
used: 46,
|
111
|
+
color: getRandomColor(5)
|
112
|
+
},
|
113
|
+
{
|
114
|
+
code: 'VOU06',
|
115
|
+
name: 'Voucher Code 6',
|
116
|
+
total: 130,
|
117
|
+
used: 123,
|
118
|
+
color: getRandomColor(6)
|
119
|
+
},
|
120
|
+
{
|
121
|
+
code: 'VOU07',
|
122
|
+
name: 'Voucher Code 7',
|
123
|
+
total: 100,
|
124
|
+
used: 87,
|
125
|
+
color: getRandomColor(7)
|
126
|
+
},
|
127
|
+
{
|
128
|
+
code: 'VOU08',
|
129
|
+
name: 'Voucher Code 8',
|
130
|
+
total: 100,
|
131
|
+
used: 25,
|
132
|
+
color: getRandomColor(8)
|
133
|
+
},
|
134
|
+
{
|
135
|
+
code: 'VOU09',
|
136
|
+
name: 'Voucher Code 9',
|
137
|
+
total: 100,
|
138
|
+
used: 34,
|
139
|
+
color: getRandomColor(9)
|
140
|
+
},
|
141
|
+
{
|
142
|
+
code: 'VOU10',
|
143
|
+
name: 'Voucher Code 10',
|
144
|
+
total: 100,
|
145
|
+
used: 67,
|
146
|
+
color: getRandomColor(10)
|
147
|
+
},
|
148
|
+
{
|
149
|
+
code: 'VOU11',
|
150
|
+
name: 'Voucher Code 11',
|
151
|
+
total: 100,
|
152
|
+
used: 23,
|
153
|
+
color: getRandomColor(11)
|
154
|
+
},
|
155
|
+
{
|
156
|
+
code: 'VOU12',
|
157
|
+
name: 'Voucher Code 12',
|
158
|
+
total: 100,
|
159
|
+
used: 98,
|
160
|
+
color: getRandomColor(12)
|
161
|
+
},
|
162
|
+
{
|
163
|
+
code: 'VOU13',
|
164
|
+
name: 'Voucher Code 13',
|
165
|
+
total: 100,
|
166
|
+
used: 54,
|
167
|
+
color: getRandomColor(13)
|
168
|
+
},
|
169
|
+
{
|
170
|
+
code: 'VOU14',
|
171
|
+
name: 'Voucher Code 14',
|
172
|
+
total: 100,
|
173
|
+
used: 27,
|
174
|
+
color: getRandomColor(14)
|
175
|
+
},
|
176
|
+
{
|
177
|
+
code: 'VOU15',
|
178
|
+
name: 'Voucher Code 15',
|
179
|
+
total: 100,
|
180
|
+
used: 3,
|
181
|
+
color: getRandomColor(15)
|
182
|
+
},
|
183
|
+
{
|
184
|
+
code: 'VOU16',
|
185
|
+
name: 'Voucher Code 16',
|
186
|
+
total: 100,
|
187
|
+
used: 56,
|
188
|
+
color: getRandomColor(16)
|
189
|
+
},
|
190
|
+
{
|
191
|
+
code: 'VOU17',
|
192
|
+
name: 'Voucher Code 17',
|
193
|
+
total: 100,
|
194
|
+
used: 85,
|
195
|
+
color: getRandomColor(17)
|
196
|
+
},
|
197
|
+
{
|
198
|
+
code: 'VOU18',
|
199
|
+
name: 'Voucher Code 18',
|
200
|
+
total: 100,
|
201
|
+
used: 45,
|
202
|
+
color: getRandomColor(18)
|
203
|
+
},
|
204
|
+
{
|
205
|
+
code: 'VOU19',
|
206
|
+
name: 'Voucher Code 19',
|
207
|
+
total: 100,
|
208
|
+
used: 64,
|
209
|
+
color: getRandomColor(19)
|
210
|
+
},
|
211
|
+
{
|
212
|
+
code: 'VOU20',
|
213
|
+
name: 'Voucher Code 20',
|
214
|
+
total: 100,
|
215
|
+
used: 12,
|
216
|
+
color: getRandomColor(20)
|
217
|
+
}
|
218
|
+
]
|
219
|
+
|
220
|
+
export function PieChart_VoucherUsedPercentage() {
|
221
|
+
|
222
|
+
const totalVoucherCode = mockData.reduce((acc, cur) => acc + cur.used, 0);
|
223
|
+
|
224
|
+
const columns = useMemo<MRT_ColumnDef<IUsedVoucherCode>[]>(
|
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 / totalVoucherCode) * 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 mã giảm giá 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
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { F_core12196_Read } from './F_core12196_Read'
|
3
|
+
import { F_core12196_Create } from './F_core12196_Create'
|
4
|
+
import { MyFlexEnd } from '@/components/Layouts/FlexEnd/MyFlexEnd'
|
5
|
+
import { Paper, Space } from '@mantine/core'
|
6
|
+
|
7
|
+
export function F_core12196({ FormTypeId
|
8
|
+
}: {
|
9
|
+
FormTypeId: number
|
10
|
+
}) {
|
11
|
+
return (
|
12
|
+
<Paper p={'md'} >
|
13
|
+
<MyFlexEnd>
|
14
|
+
<F_core12196_Create FormTypeId={FormTypeId} />
|
15
|
+
</MyFlexEnd>
|
16
|
+
<Space />
|
17
|
+
<F_core12196_Read FormTypeId={FormTypeId} />
|
18
|
+
</Paper>
|
19
|
+
)
|
20
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
"use client";
|
2
|
+
import baseAxios from "@/api/baseAxios";
|
3
|
+
import { MyFileInput, MyNumberInput } from "@/components";
|
4
|
+
import { MyButtonCreate } from "@/components/Buttons/ButtonCRUD/MyButtonCreate";
|
5
|
+
import { MyDateInput } from "@/components/Inputs/DateInput/MyDateInput";
|
6
|
+
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
7
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
8
|
+
import { F_core18256_Select } from "@/modules-features/admin/core/core18256/F_core18256_Select";
|
9
|
+
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
10
|
+
import { useForm } from "@mantine/form";
|
11
|
+
interface IDocument {
|
12
|
+
path?: string;
|
13
|
+
orderBy?: number;
|
14
|
+
documentType?: number;
|
15
|
+
promulgateDate?: Date;
|
16
|
+
decisionCode?: string;
|
17
|
+
departmentName?: string;
|
18
|
+
description?: string;
|
19
|
+
startDate?: Date;
|
20
|
+
endDate?: Date;
|
21
|
+
conclusion?: string;
|
22
|
+
note?: string;
|
23
|
+
documentAttributeId?: number;
|
24
|
+
documentAttributeName?: string;
|
25
|
+
isCycleCheck?: boolean;
|
26
|
+
meetingDate?: Date;
|
27
|
+
fileDetail?: {
|
28
|
+
fileBase64String?: string;
|
29
|
+
fileExtension?: string;
|
30
|
+
fileName?: string;
|
31
|
+
};
|
32
|
+
id?: number;
|
33
|
+
code?: string;
|
34
|
+
name?: string;
|
35
|
+
concurrencyStamp?: string;
|
36
|
+
isEnabled?: boolean;
|
37
|
+
ngayChinhSua?: Date;
|
38
|
+
nguoiChinhSua?: string;
|
39
|
+
}
|
40
|
+
interface I extends IDocument {
|
41
|
+
file?: File;
|
42
|
+
}
|
43
|
+
export function F_core12196_Create({ FormTypeId }: { FormTypeId: number }) {
|
44
|
+
const form = useForm<I>({
|
45
|
+
mode: "uncontrolled",
|
46
|
+
validate: {
|
47
|
+
decisionCode: (value) =>
|
48
|
+
value ? null : "Số quy định không được để trống",
|
49
|
+
promulgateDate: (value) =>
|
50
|
+
value ? null : "Ngày ban hành không được để trống",
|
51
|
+
name: (value) => (value ? null : "Tên tài liệu không được để trống"),
|
52
|
+
documentAttributeId: (value) =>
|
53
|
+
value ? null : "Loại văn bản không được để trống",
|
54
|
+
file: (value) => (value ? null : "Tệp đính kèm không được để trống"),
|
55
|
+
},
|
56
|
+
});
|
57
|
+
return (
|
58
|
+
<MyButtonCreate
|
59
|
+
objectName="Văn bản quy định tổ chức"
|
60
|
+
form={form}
|
61
|
+
onSubmit={async (values) => {
|
62
|
+
return await baseAxios.post("/Document/create", {
|
63
|
+
...values,
|
64
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Form,
|
65
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
66
|
+
});
|
67
|
+
}}
|
68
|
+
>
|
69
|
+
<MyTextInput
|
70
|
+
withAsterisk
|
71
|
+
label="Số quy định"
|
72
|
+
{...form.getInputProps("decisionCode")}
|
73
|
+
/>
|
74
|
+
<MyDateInput
|
75
|
+
withAsterisk
|
76
|
+
label="Ngày ban hành"
|
77
|
+
{...form.getInputProps("promulgateDate")}
|
78
|
+
/>
|
79
|
+
<MyTextInput
|
80
|
+
withAsterisk
|
81
|
+
label="Tên tài liệu"
|
82
|
+
{...form.getInputProps("name")}
|
83
|
+
/>
|
84
|
+
<F_core18256_Select
|
85
|
+
withAsterisk
|
86
|
+
label="Loại văn bản"
|
87
|
+
documentTypeId={FormTypeId}
|
88
|
+
{...form.getInputProps("documentAttributeId")}
|
89
|
+
/>
|
90
|
+
<MyFileInput
|
91
|
+
withAsterisk
|
92
|
+
label="Văn bản"
|
93
|
+
{...form.getInputProps("file")}
|
94
|
+
/>
|
95
|
+
<MyNumberInput
|
96
|
+
label="Thứ tự hiển thị trên danh sách"
|
97
|
+
{...form.getInputProps("orderBy")}
|
98
|
+
/>
|
99
|
+
</MyButtonCreate>
|
100
|
+
);
|
101
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import baseAxios from "@/api/baseAxios";
|
2
|
+
import { MyActionIconDelete } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete";
|
3
|
+
|
4
|
+
export function F_core12196_Delete({
|
5
|
+
id,
|
6
|
+
contextData,
|
7
|
+
}: {
|
8
|
+
id: number;
|
9
|
+
contextData: string;
|
10
|
+
}) {
|
11
|
+
return (
|
12
|
+
<MyActionIconDelete
|
13
|
+
contextData={contextData}
|
14
|
+
onSubmit={async () =>
|
15
|
+
await baseAxios.post("/Document/delete", { id: id })
|
16
|
+
}
|
17
|
+
/>
|
18
|
+
);
|
19
|
+
}
|
@@ -0,0 +1,165 @@
|
|
1
|
+
"use client";
|
2
|
+
import { MyFlexColumn } from "@/components/Layouts/FlexColumn/MyFlexColumn";
|
3
|
+
import { Accordion, Blockquote, Paper, Space } from "@mantine/core";
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
5
|
+
|
6
|
+
import baseAxios from "@/api/baseAxios";
|
7
|
+
import { MyButtonViewPDF } from "@/components/Buttons/ButtonViewPDF/MyButtonViewPDF";
|
8
|
+
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull";
|
9
|
+
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
10
|
+
import { MyPageContent } from "@/components/Layouts/PageContent/MyPageContent";
|
11
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
12
|
+
import { U0DateToDDMMYYYString } from "@/utils/utils_date";
|
13
|
+
import { MRT_ColumnDef } from "mantine-react-table";
|
14
|
+
import { useMemo } from "react";
|
15
|
+
|
16
|
+
import { F_core12196_Create } from "./F_core12196_Create";
|
17
|
+
import { F_core12196_Delete } from "./F_core12196_Delete";
|
18
|
+
import { F_core12196_Update } from "./F_core12196_Update";
|
19
|
+
import { MyFlexEnd } from "@/components";
|
20
|
+
interface I {
|
21
|
+
documentType?: number;
|
22
|
+
id?: number;
|
23
|
+
code?: string;
|
24
|
+
name?: string;
|
25
|
+
concurrencyStamp?: string;
|
26
|
+
isEnabled?: boolean;
|
27
|
+
}
|
28
|
+
|
29
|
+
export function F_core12196_Read({ FormTypeId }: { FormTypeId: number }) {
|
30
|
+
const documentAttributeQuery = useQuery<I[]>({
|
31
|
+
queryKey: ["F_core12196_Read", FormTypeId],
|
32
|
+
queryFn: async () => {
|
33
|
+
const result = await baseAxios.get("/DocumentAttribute/GetByType?", {
|
34
|
+
params: { documentType: FormTypeId },
|
35
|
+
});
|
36
|
+
return result.data?.data || [];
|
37
|
+
},
|
38
|
+
});
|
39
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
40
|
+
if (documentAttributeQuery.isError) return "có lỗi xảy ra!";
|
41
|
+
if (documentAttributeQuery.data?.length == 0)
|
42
|
+
return <Blockquote color="yellow">Chưa có loại văn bản</Blockquote>;
|
43
|
+
return (
|
44
|
+
<MyFlexColumn>
|
45
|
+
<Accordion
|
46
|
+
variant="contained"
|
47
|
+
defaultValue={documentAttributeQuery.data?.map(
|
48
|
+
(item) => item.id?.toString()!
|
49
|
+
)}
|
50
|
+
multiple
|
51
|
+
>
|
52
|
+
{documentAttributeQuery.data?.map((item, idx) => (
|
53
|
+
<SubRead
|
54
|
+
key={idx}
|
55
|
+
name={item.name!}
|
56
|
+
documentType={item.id!}
|
57
|
+
FormTypeId={FormTypeId}
|
58
|
+
/>
|
59
|
+
))}
|
60
|
+
</Accordion>
|
61
|
+
</MyFlexColumn>
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
65
|
+
function SubRead({
|
66
|
+
name,
|
67
|
+
documentType,
|
68
|
+
FormTypeId,
|
69
|
+
}: {
|
70
|
+
name: string;
|
71
|
+
documentType: number;
|
72
|
+
FormTypeId: number;
|
73
|
+
}) {
|
74
|
+
interface I {
|
75
|
+
path?: string;
|
76
|
+
orderBy?: number;
|
77
|
+
documentType?: number;
|
78
|
+
promulgateDate?: Date;
|
79
|
+
decisionCode?: string;
|
80
|
+
departmentName?: string;
|
81
|
+
description?: string;
|
82
|
+
startDate?: Date;
|
83
|
+
endDate?: Date;
|
84
|
+
conclusion?: string;
|
85
|
+
note?: string;
|
86
|
+
documentAttributeId?: number;
|
87
|
+
documentAttributeName?: string;
|
88
|
+
isCycleCheck?: boolean;
|
89
|
+
meetingDate?: Date;
|
90
|
+
fileDetail?: {
|
91
|
+
fileBase64String?: string;
|
92
|
+
fileExtension?: string;
|
93
|
+
fileName?: string;
|
94
|
+
};
|
95
|
+
id?: number;
|
96
|
+
code?: string;
|
97
|
+
name?: string;
|
98
|
+
concurrencyStamp?: string;
|
99
|
+
isEnabled?: boolean;
|
100
|
+
ngayChinhSua?: Date;
|
101
|
+
nguoiChinhSua?: string;
|
102
|
+
}
|
103
|
+
const documentQuery = useQuery<I[]>({
|
104
|
+
queryKey: ["SF2_3Read" + documentType],
|
105
|
+
queryFn: async () => {
|
106
|
+
const result = await baseAxios.get(
|
107
|
+
`/Document/GetByDocumentAttribute?id=${documentType}`
|
108
|
+
);
|
109
|
+
return result.data.data;
|
110
|
+
},
|
111
|
+
});
|
112
|
+
const columns = useMemo<MRT_ColumnDef<I>[]>(
|
113
|
+
() => [
|
114
|
+
{
|
115
|
+
header: "Số quy định",
|
116
|
+
accessorKey: "decisionCode",
|
117
|
+
},
|
118
|
+
{
|
119
|
+
header: "Ngày ban hành",
|
120
|
+
accessorFn: (row) =>
|
121
|
+
U0DateToDDMMYYYString(new Date(row.promulgateDate!)),
|
122
|
+
},
|
123
|
+
{
|
124
|
+
header: "Tên tài liệu",
|
125
|
+
accessorKey: "name",
|
126
|
+
},
|
127
|
+
{
|
128
|
+
header: "File",
|
129
|
+
accessorFn: (row) => {
|
130
|
+
return (
|
131
|
+
<MyCenterFull>
|
132
|
+
<MyButtonViewPDF id={row.id} />
|
133
|
+
</MyCenterFull>
|
134
|
+
);
|
135
|
+
},
|
136
|
+
},
|
137
|
+
],
|
138
|
+
[]
|
139
|
+
);
|
140
|
+
if (documentQuery.isLoading) return "Loading...";
|
141
|
+
if (documentQuery.isError) return "Error!";
|
142
|
+
return (
|
143
|
+
<Accordion.Item value={documentType.toString()}>
|
144
|
+
<Accordion.Control>{name}</Accordion.Control>
|
145
|
+
<Accordion.Panel>
|
146
|
+
<MyDataTable
|
147
|
+
columns={columns}
|
148
|
+
data={documentQuery.data!}
|
149
|
+
renderRowActions={({ row }) => (
|
150
|
+
<MyCenterFull>
|
151
|
+
<F_core12196_Update
|
152
|
+
FormTypeId={FormTypeId}
|
153
|
+
values={row.original!}
|
154
|
+
/>
|
155
|
+
<F_core12196_Delete
|
156
|
+
id={row.original.id!}
|
157
|
+
contextData={row.original.decisionCode!}
|
158
|
+
/>
|
159
|
+
</MyCenterFull>
|
160
|
+
)}
|
161
|
+
/>
|
162
|
+
</Accordion.Panel>
|
163
|
+
</Accordion.Item>
|
164
|
+
);
|
165
|
+
}
|