aq-fe-framework 0.1.154 → 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/{IAQModule-Cn6xUy-6.d.mts → IAQModule-XZYlbivW.d.mts} +1 -1
- 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-5U2JSHSJ.mjs +22 -0
- package/dist/chunk-7ZCOFATU.mjs +42 -0
- package/dist/chunk-FWCSY2DS.mjs +37 -0
- package/dist/chunk-JLT4BL7I.mjs +7634 -0
- package/dist/chunk-KWCUUD5Z.mjs +235 -0
- package/dist/chunk-Y3YGC5IH.mjs +21 -0
- package/dist/chunk-Z6OQG54Q.mjs +39 -0
- 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 +143 -62
- 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/css.module-4ICLUKPO.module.css +107 -0
- 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.d.mts +1 -1
- package/dist/hooks/index.mjs +11 -2
- 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.d.mts +1 -1
- package/dist/modules-features/index.mjs +4053 -79
- 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.mjs +7 -1
- package/dist/stores/index.ts +1 -0
- package/dist/types/types.ts +16 -0
- package/dist/utils/index.mjs +45 -9
- 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
@@ -1,79 +1,4053 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
1
|
+
import {
|
2
|
+
F_authenticate_Logout,
|
3
|
+
MyActionIconDelete,
|
4
|
+
MyActionIconUpdate,
|
5
|
+
MyBoxesBackground,
|
6
|
+
MyButton,
|
7
|
+
MyButtonCreate,
|
8
|
+
MyButtonModal,
|
9
|
+
MyButtonViewPDF,
|
10
|
+
MyCenterFull,
|
11
|
+
MyDataTable,
|
12
|
+
MyDateInput,
|
13
|
+
MyFieldset,
|
14
|
+
MyFileInput,
|
15
|
+
MyFlexColumn,
|
16
|
+
MyFlexEnd,
|
17
|
+
MyFlexRow,
|
18
|
+
MyNumberInput,
|
19
|
+
MyPageContent,
|
20
|
+
MySelect,
|
21
|
+
MyTab,
|
22
|
+
MyTextInput,
|
23
|
+
OBJECT_COlORS,
|
24
|
+
groupToTwoLevels,
|
25
|
+
useS_authenticate,
|
26
|
+
utils_layout_getItemsWithoutLinks
|
27
|
+
} from "../chunk-JLT4BL7I.mjs";
|
28
|
+
import {
|
29
|
+
baseAxios_default,
|
30
|
+
useQ_AQ_GetAQModule
|
31
|
+
} from "../chunk-Z6OQG54Q.mjs";
|
32
|
+
import {
|
33
|
+
createGenericStore
|
34
|
+
} from "../chunk-Y3YGC5IH.mjs";
|
35
|
+
import {
|
36
|
+
U0DateToDDMMYYYString,
|
37
|
+
U0MyValidateEmail,
|
38
|
+
utils_converter_enumToSelectOptions,
|
39
|
+
utils_file_fileToAQDocumentType
|
40
|
+
} from "../chunk-KWCUUD5Z.mjs";
|
41
|
+
import "../chunk-5U2JSHSJ.mjs";
|
42
|
+
import {
|
43
|
+
utils_notification_show
|
44
|
+
} from "../chunk-7ZCOFATU.mjs";
|
45
|
+
import {
|
46
|
+
__objRest,
|
47
|
+
__spreadProps,
|
48
|
+
__spreadValues
|
49
|
+
} from "../chunk-FWCSY2DS.mjs";
|
50
|
+
|
51
|
+
// src/modules-features/admin/core/core12196/F_core12196_Read.tsx
|
52
|
+
import { Accordion, Blockquote } from "@mantine/core";
|
53
|
+
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
54
|
+
import { useMemo } from "react";
|
55
|
+
|
56
|
+
// src/modules-features/admin/core/core12196/F_core12196_Delete.tsx
|
57
|
+
import { jsx } from "react/jsx-runtime";
|
58
|
+
function F_core12196_Delete({
|
59
|
+
id,
|
60
|
+
contextData
|
61
|
+
}) {
|
62
|
+
return /* @__PURE__ */ jsx(
|
63
|
+
MyActionIconDelete,
|
64
|
+
{
|
65
|
+
contextData,
|
66
|
+
onSubmit: async () => await baseAxios_default.post("/Document/delete", { id })
|
67
|
+
}
|
68
|
+
);
|
69
|
+
}
|
70
|
+
|
71
|
+
// src/modules-features/admin/core/core18256/F_core18256_Select.tsx
|
72
|
+
import { Select } from "@mantine/core";
|
73
|
+
import { useQuery } from "@tanstack/react-query";
|
74
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
75
|
+
function F_core18256_Select(_a) {
|
76
|
+
var _b = _a, { documentTypeId, label = "", dataMapper } = _b, rest = __objRest(_b, ["documentTypeId", "label", "dataMapper"]);
|
77
|
+
var _a2, _b2;
|
78
|
+
const query = useQuery({
|
79
|
+
queryKey: [`/DocumentAttribute/GetByType?documentType=${documentTypeId}`],
|
80
|
+
queryFn: async () => {
|
81
|
+
const result = (await baseAxios_default.get(`/DocumentAttribute/GetByType?documentType=${documentTypeId}`)).data.data;
|
82
|
+
return result;
|
83
|
+
}
|
84
|
+
});
|
85
|
+
if (query.isLoading) return "Loading...";
|
86
|
+
const data = (_a2 = query.data) == null ? void 0 : _a2.map((item) => {
|
87
|
+
var _a3;
|
88
|
+
if (dataMapper) return dataMapper(item);
|
89
|
+
return {
|
90
|
+
value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
|
91
|
+
label: `${item.code}-${item.name}`
|
92
|
+
};
|
93
|
+
});
|
94
|
+
return /* @__PURE__ */ jsx2(
|
95
|
+
Select,
|
96
|
+
__spreadProps(__spreadValues({
|
97
|
+
label,
|
98
|
+
placeholder: `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}`,
|
99
|
+
data
|
100
|
+
}, rest), {
|
101
|
+
value: (_b2 = rest.value) == null ? void 0 : _b2.toString()
|
102
|
+
})
|
103
|
+
);
|
104
|
+
}
|
105
|
+
|
106
|
+
// src/modules-features/admin/core/core12196/F_core12196_Update.tsx
|
107
|
+
import { useForm } from "@mantine/form";
|
108
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
109
|
+
function F_core12196_Update({
|
110
|
+
values,
|
111
|
+
FormTypeId
|
112
|
+
}) {
|
113
|
+
var _a;
|
114
|
+
const form = useForm({
|
115
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
116
|
+
file: new File(
|
117
|
+
[],
|
118
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
119
|
+
),
|
120
|
+
promulgateDate: new Date(values.promulgateDate)
|
121
|
+
}),
|
122
|
+
validate: {
|
123
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
124
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
125
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
126
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
127
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
128
|
+
}
|
129
|
+
});
|
130
|
+
return /* @__PURE__ */ jsxs(
|
131
|
+
MyActionIconUpdate,
|
132
|
+
{
|
133
|
+
form,
|
134
|
+
onSubmit: async (values2) => {
|
135
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
136
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
137
|
+
}));
|
138
|
+
},
|
139
|
+
children: [
|
140
|
+
/* @__PURE__ */ jsx3(
|
141
|
+
MyTextInput,
|
142
|
+
__spreadValues({
|
143
|
+
withAsterisk: true,
|
144
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
145
|
+
}, form.getInputProps("decisionCode"))
|
146
|
+
),
|
147
|
+
/* @__PURE__ */ jsx3(
|
148
|
+
MyDateInput,
|
149
|
+
__spreadValues({
|
150
|
+
withAsterisk: true,
|
151
|
+
label: "Ng\xE0y ban h\xE0nh"
|
152
|
+
}, form.getInputProps("promulgateDate"))
|
153
|
+
),
|
154
|
+
/* @__PURE__ */ jsx3(
|
155
|
+
MyTextInput,
|
156
|
+
__spreadValues({
|
157
|
+
withAsterisk: true,
|
158
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
159
|
+
}, form.getInputProps("name"))
|
160
|
+
),
|
161
|
+
/* @__PURE__ */ jsx3(
|
162
|
+
F_core18256_Select,
|
163
|
+
__spreadValues({
|
164
|
+
withAsterisk: true,
|
165
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
166
|
+
documentTypeId: FormTypeId
|
167
|
+
}, form.getInputProps("documentAttributeId"))
|
168
|
+
),
|
169
|
+
/* @__PURE__ */ jsx3(
|
170
|
+
MyFileInput,
|
171
|
+
__spreadValues({
|
172
|
+
withAsterisk: true,
|
173
|
+
label: "V\u0103n b\u1EA3n"
|
174
|
+
}, form.getInputProps("file"))
|
175
|
+
),
|
176
|
+
/* @__PURE__ */ jsx3(
|
177
|
+
MyNumberInput,
|
178
|
+
__spreadValues({
|
179
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
180
|
+
}, form.getInputProps("orderBy"))
|
181
|
+
)
|
182
|
+
]
|
183
|
+
}
|
184
|
+
);
|
185
|
+
}
|
186
|
+
|
187
|
+
// src/modules-features/admin/core/core12196/F_core12196_Read.tsx
|
188
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
189
|
+
function F_core12196_Read({ FormTypeId }) {
|
190
|
+
var _a, _b, _c;
|
191
|
+
const documentAttributeQuery = useQuery2({
|
192
|
+
queryKey: ["F_core12196_Read", FormTypeId],
|
193
|
+
queryFn: async () => {
|
194
|
+
var _a2;
|
195
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", {
|
196
|
+
params: { documentType: FormTypeId }
|
197
|
+
});
|
198
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
199
|
+
}
|
200
|
+
});
|
201
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
202
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
203
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0)
|
204
|
+
return /* @__PURE__ */ jsx4(Blockquote, { color: "yellow", children: "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n" });
|
205
|
+
return /* @__PURE__ */ jsx4(MyFlexColumn, { children: /* @__PURE__ */ jsx4(
|
206
|
+
Accordion,
|
207
|
+
{
|
208
|
+
variant: "contained",
|
209
|
+
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
210
|
+
(item) => {
|
211
|
+
var _a2;
|
212
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
213
|
+
}
|
214
|
+
),
|
215
|
+
multiple: true,
|
216
|
+
children: (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ jsx4(
|
217
|
+
SubRead,
|
218
|
+
{
|
219
|
+
name: item.name,
|
220
|
+
documentType: item.id,
|
221
|
+
FormTypeId
|
222
|
+
},
|
223
|
+
idx
|
224
|
+
))
|
225
|
+
}
|
226
|
+
) });
|
227
|
+
}
|
228
|
+
function SubRead({
|
229
|
+
name,
|
230
|
+
documentType,
|
231
|
+
FormTypeId
|
232
|
+
}) {
|
233
|
+
const documentQuery = useQuery2({
|
234
|
+
queryKey: ["SF2_3Read" + documentType],
|
235
|
+
queryFn: async () => {
|
236
|
+
const result = await baseAxios_default.get(
|
237
|
+
`/Document/GetByDocumentAttribute?id=${documentType}`
|
238
|
+
);
|
239
|
+
return result.data.data;
|
240
|
+
}
|
241
|
+
});
|
242
|
+
const columns = useMemo(
|
243
|
+
() => [
|
244
|
+
{
|
245
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
246
|
+
accessorKey: "decisionCode"
|
247
|
+
},
|
248
|
+
{
|
249
|
+
header: "Ng\xE0y ban h\xE0nh",
|
250
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
251
|
+
},
|
252
|
+
{
|
253
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
254
|
+
accessorKey: "name"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
header: "File",
|
258
|
+
accessorFn: (row) => {
|
259
|
+
return /* @__PURE__ */ jsx4(MyCenterFull, { children: /* @__PURE__ */ jsx4(MyButtonViewPDF, { id: row.id }) });
|
260
|
+
}
|
261
|
+
}
|
262
|
+
],
|
263
|
+
[]
|
264
|
+
);
|
265
|
+
if (documentQuery.isLoading) return "Loading...";
|
266
|
+
if (documentQuery.isError) return "Error!";
|
267
|
+
return /* @__PURE__ */ jsxs2(Accordion.Item, { value: documentType.toString(), children: [
|
268
|
+
/* @__PURE__ */ jsx4(Accordion.Control, { children: name }),
|
269
|
+
/* @__PURE__ */ jsx4(Accordion.Panel, { children: /* @__PURE__ */ jsx4(
|
270
|
+
MyDataTable,
|
271
|
+
{
|
272
|
+
columns,
|
273
|
+
data: documentQuery.data,
|
274
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ jsxs2(MyCenterFull, { children: [
|
275
|
+
/* @__PURE__ */ jsx4(
|
276
|
+
F_core12196_Update,
|
277
|
+
{
|
278
|
+
FormTypeId,
|
279
|
+
values: row.original
|
280
|
+
}
|
281
|
+
),
|
282
|
+
/* @__PURE__ */ jsx4(
|
283
|
+
F_core12196_Delete,
|
284
|
+
{
|
285
|
+
id: row.original.id,
|
286
|
+
contextData: row.original.decisionCode
|
287
|
+
}
|
288
|
+
)
|
289
|
+
] })
|
290
|
+
}
|
291
|
+
) })
|
292
|
+
] });
|
293
|
+
}
|
294
|
+
|
295
|
+
// src/constants/object/documentTypes.ts
|
296
|
+
var OBJECT_DOCUMENT_TYPES = {
|
297
|
+
Security: 1,
|
298
|
+
Refinement: 2,
|
299
|
+
Guideline: 3,
|
300
|
+
Regulations: 4,
|
301
|
+
Workflow: 5,
|
302
|
+
Form: 6
|
303
|
+
};
|
304
|
+
|
305
|
+
// src/modules-features/admin/core/core12196/F_core12196_Create.tsx
|
306
|
+
import { useForm as useForm2 } from "@mantine/form";
|
307
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
308
|
+
function F_core12196_Create({ FormTypeId }) {
|
309
|
+
const form = useForm2({
|
310
|
+
mode: "uncontrolled",
|
311
|
+
validate: {
|
312
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
313
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
314
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
315
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
316
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
317
|
+
}
|
318
|
+
});
|
319
|
+
return /* @__PURE__ */ jsxs3(
|
320
|
+
MyButtonCreate,
|
321
|
+
{
|
322
|
+
objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c",
|
323
|
+
form,
|
324
|
+
onSubmit: async (values) => {
|
325
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
326
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Form,
|
327
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
328
|
+
}));
|
329
|
+
},
|
330
|
+
children: [
|
331
|
+
/* @__PURE__ */ jsx5(
|
332
|
+
MyTextInput,
|
333
|
+
__spreadValues({
|
334
|
+
withAsterisk: true,
|
335
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
336
|
+
}, form.getInputProps("decisionCode"))
|
337
|
+
),
|
338
|
+
/* @__PURE__ */ jsx5(
|
339
|
+
MyDateInput,
|
340
|
+
__spreadValues({
|
341
|
+
withAsterisk: true,
|
342
|
+
label: "Ng\xE0y ban h\xE0nh"
|
343
|
+
}, form.getInputProps("promulgateDate"))
|
344
|
+
),
|
345
|
+
/* @__PURE__ */ jsx5(
|
346
|
+
MyTextInput,
|
347
|
+
__spreadValues({
|
348
|
+
withAsterisk: true,
|
349
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
350
|
+
}, form.getInputProps("name"))
|
351
|
+
),
|
352
|
+
/* @__PURE__ */ jsx5(
|
353
|
+
F_core18256_Select,
|
354
|
+
__spreadValues({
|
355
|
+
withAsterisk: true,
|
356
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
357
|
+
documentTypeId: FormTypeId
|
358
|
+
}, form.getInputProps("documentAttributeId"))
|
359
|
+
),
|
360
|
+
/* @__PURE__ */ jsx5(
|
361
|
+
MyFileInput,
|
362
|
+
__spreadValues({
|
363
|
+
withAsterisk: true,
|
364
|
+
label: "V\u0103n b\u1EA3n"
|
365
|
+
}, form.getInputProps("file"))
|
366
|
+
),
|
367
|
+
/* @__PURE__ */ jsx5(
|
368
|
+
MyNumberInput,
|
369
|
+
__spreadValues({
|
370
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
371
|
+
}, form.getInputProps("orderBy"))
|
372
|
+
)
|
373
|
+
]
|
374
|
+
}
|
375
|
+
);
|
376
|
+
}
|
377
|
+
|
378
|
+
// src/modules-features/admin/core/core12196/F_core12196.tsx
|
379
|
+
import { Paper as Paper2, Space as Space2 } from "@mantine/core";
|
380
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
381
|
+
function F_core12196({
|
382
|
+
FormTypeId
|
383
|
+
}) {
|
384
|
+
return /* @__PURE__ */ jsxs4(Paper2, { p: "md", children: [
|
385
|
+
/* @__PURE__ */ jsx6(MyFlexEnd, { children: /* @__PURE__ */ jsx6(F_core12196_Create, { FormTypeId }) }),
|
386
|
+
/* @__PURE__ */ jsx6(Space2, {}),
|
387
|
+
/* @__PURE__ */ jsx6(F_core12196_Read, { FormTypeId })
|
388
|
+
] });
|
389
|
+
}
|
390
|
+
|
391
|
+
// src/modules-features/admin/core/core16209/F_core16209.tsx
|
392
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
393
|
+
import { useMemo as useMemo2 } from "react";
|
394
|
+
|
395
|
+
// src/modules-features/admin/core/core16209/F_core16209_Create.tsx
|
396
|
+
import { FileInput, Textarea } from "@mantine/core";
|
397
|
+
import { useForm as useForm3 } from "@mantine/form";
|
398
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
399
|
+
function F_core16209_Create({
|
400
|
+
RefinementTypeId
|
401
|
+
}) {
|
402
|
+
const form = useForm3({
|
403
|
+
mode: "uncontrolled",
|
404
|
+
validate: {
|
405
|
+
meetingDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
406
|
+
departmentName: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
407
|
+
description: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
408
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
409
|
+
startDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
410
|
+
endDate: (value, values) => value && values.startDate && new Date(value) > new Date(values.startDate) ? null : "Ng\xE0y k\u1EBFt th\xFAc ph\u1EA3i l\u1EDBn h\u01A1n ng\xE0y b\u1EAFt \u0111\u1EA7u"
|
411
|
+
}
|
412
|
+
});
|
413
|
+
return /* @__PURE__ */ jsxs5(
|
414
|
+
MyButtonCreate,
|
415
|
+
{
|
416
|
+
objectName: "v\u0103n b\u1EA3n",
|
417
|
+
form,
|
418
|
+
onSubmit: async (values) => {
|
419
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
420
|
+
DocumentType: RefinementTypeId,
|
421
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
422
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
423
|
+
}));
|
424
|
+
},
|
425
|
+
children: [
|
426
|
+
/* @__PURE__ */ jsx7(
|
427
|
+
MyDateInput,
|
428
|
+
__spreadValues({
|
429
|
+
withAsterisk: true,
|
430
|
+
label: "Ng\xE0y h\u1ECDp"
|
431
|
+
}, form.getInputProps("meetingDate"))
|
432
|
+
),
|
433
|
+
/* @__PURE__ */ jsx7(
|
434
|
+
MyTextInput,
|
435
|
+
__spreadValues({
|
436
|
+
withAsterisk: true,
|
437
|
+
label: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u"
|
438
|
+
}, form.getInputProps("departmentName"))
|
439
|
+
),
|
440
|
+
/* @__PURE__ */ jsx7(
|
441
|
+
MyTextInput,
|
442
|
+
__spreadValues({
|
443
|
+
withAsterisk: true,
|
444
|
+
label: "N\u1ED9i dung c\u1EA3i ti\u1EBFn"
|
445
|
+
}, form.getInputProps("description"))
|
446
|
+
),
|
447
|
+
/* @__PURE__ */ jsx7(MyTextInput, __spreadValues({ label: "K\u1EBFt lu\u1EADn" }, form.getInputProps("conclusion"))),
|
448
|
+
/* @__PURE__ */ jsx7(
|
449
|
+
MyDateInput,
|
450
|
+
__spreadValues({
|
451
|
+
withAsterisk: true,
|
452
|
+
label: "Ng\xE0y b\u1EAFt \u0111\u1EA7u"
|
453
|
+
}, form.getInputProps("startDate"))
|
454
|
+
),
|
455
|
+
/* @__PURE__ */ jsx7(
|
456
|
+
MyDateInput,
|
457
|
+
__spreadValues({
|
458
|
+
withAsterisk: true,
|
459
|
+
label: "Ng\xE0y k\u1EBFt th\xFAc"
|
460
|
+
}, form.getInputProps("endDate"))
|
461
|
+
),
|
462
|
+
/* @__PURE__ */ jsx7(
|
463
|
+
FileInput,
|
464
|
+
__spreadValues({
|
465
|
+
placeholder: "T\u1EA3i l\xEAn t\xE0i li\u1EC7u",
|
466
|
+
withAsterisk: true,
|
467
|
+
label: "T\xE0i li\u1EC7u"
|
468
|
+
}, form.getInputProps("file"))
|
469
|
+
),
|
470
|
+
/* @__PURE__ */ jsx7(Textarea, __spreadValues({ label: "Ghi ch\xFA" }, form.getInputProps("note")))
|
471
|
+
]
|
472
|
+
}
|
473
|
+
);
|
474
|
+
}
|
475
|
+
|
476
|
+
// src/modules-features/admin/core/core16209/F_core16209_Delete.tsx
|
477
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
478
|
+
function F_core16209_Delete({
|
479
|
+
id,
|
480
|
+
contextData
|
481
|
+
}) {
|
482
|
+
return /* @__PURE__ */ jsx8(
|
483
|
+
MyActionIconDelete,
|
484
|
+
{
|
485
|
+
contextData,
|
486
|
+
onSubmit: () => baseAxios_default.post("/Document/delete", { id })
|
487
|
+
}
|
488
|
+
);
|
489
|
+
}
|
490
|
+
|
491
|
+
// src/modules-features/admin/core/core16209/F_core16209_Update.tsx
|
492
|
+
import { FileInput as FileInput2, Textarea as Textarea2 } from "@mantine/core";
|
493
|
+
import { useForm as useForm4 } from "@mantine/form";
|
494
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
495
|
+
function F_core16209_Update({ values }) {
|
496
|
+
var _a;
|
497
|
+
const form = useForm4({
|
498
|
+
mode: "uncontrolled",
|
499
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
500
|
+
file: new File(
|
501
|
+
[],
|
502
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
503
|
+
),
|
504
|
+
startDate: new Date(values.startDate),
|
505
|
+
endDate: new Date(values.endDate),
|
506
|
+
meetingDate: new Date(values.meetingDate)
|
507
|
+
}),
|
508
|
+
validate: {
|
509
|
+
meetingDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
510
|
+
departmentName: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
511
|
+
description: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
512
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
513
|
+
startDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
514
|
+
endDate: (value, values2) => value && values2.startDate && new Date(value) > new Date(values2.startDate) ? null : "Ng\xE0y k\u1EBFt th\xFAc ph\u1EA3i l\u1EDBn h\u01A1n ng\xE0y b\u1EAFt \u0111\u1EA7u"
|
515
|
+
}
|
516
|
+
});
|
517
|
+
return /* @__PURE__ */ jsxs6(
|
518
|
+
MyActionIconUpdate,
|
519
|
+
{
|
520
|
+
form,
|
521
|
+
onSubmit: async (values2) => {
|
522
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
523
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
524
|
+
}));
|
525
|
+
},
|
526
|
+
children: [
|
527
|
+
/* @__PURE__ */ jsx9(
|
528
|
+
MyDateInput,
|
529
|
+
__spreadValues({
|
530
|
+
withAsterisk: true,
|
531
|
+
label: "Ng\xE0y h\u1ECDp"
|
532
|
+
}, form.getInputProps("meetingDate"))
|
533
|
+
),
|
534
|
+
/* @__PURE__ */ jsx9(
|
535
|
+
MyTextInput,
|
536
|
+
__spreadValues({
|
537
|
+
withAsterisk: true,
|
538
|
+
label: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u"
|
539
|
+
}, form.getInputProps("departmentName"))
|
540
|
+
),
|
541
|
+
/* @__PURE__ */ jsx9(
|
542
|
+
MyTextInput,
|
543
|
+
__spreadValues({
|
544
|
+
withAsterisk: true,
|
545
|
+
label: "N\u1ED9i dung c\u1EA3i ti\u1EBFn"
|
546
|
+
}, form.getInputProps("description"))
|
547
|
+
),
|
548
|
+
/* @__PURE__ */ jsx9(MyTextInput, __spreadValues({ label: "K\u1EBFt lu\u1EADn" }, form.getInputProps("conclusion"))),
|
549
|
+
/* @__PURE__ */ jsx9(
|
550
|
+
MyDateInput,
|
551
|
+
__spreadValues({
|
552
|
+
withAsterisk: true,
|
553
|
+
label: "Ng\xE0y b\u1EAFt \u0111\u1EA7u"
|
554
|
+
}, form.getInputProps("startDate"))
|
555
|
+
),
|
556
|
+
/* @__PURE__ */ jsx9(
|
557
|
+
MyDateInput,
|
558
|
+
__spreadValues({
|
559
|
+
withAsterisk: true,
|
560
|
+
label: "Ng\xE0y k\u1EBFt th\xFAc"
|
561
|
+
}, form.getInputProps("endDate"))
|
562
|
+
),
|
563
|
+
/* @__PURE__ */ jsx9(
|
564
|
+
FileInput2,
|
565
|
+
__spreadValues({
|
566
|
+
placeholder: "T\u1EA3i l\xEAn t\xE0i li\u1EC7u",
|
567
|
+
withAsterisk: true,
|
568
|
+
label: "T\xE0i li\u1EC7u"
|
569
|
+
}, form.getInputProps("file"))
|
570
|
+
),
|
571
|
+
/* @__PURE__ */ jsx9(Textarea2, __spreadValues({ label: "Ghi ch\xFA" }, form.getInputProps("note")))
|
572
|
+
]
|
573
|
+
}
|
574
|
+
);
|
575
|
+
}
|
576
|
+
|
577
|
+
// src/modules-features/admin/core/core16209/F_core16209.tsx
|
578
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
579
|
+
function F_core16209({ RefinementTypeId }) {
|
580
|
+
const query = useQuery3({
|
581
|
+
queryKey: ["F_core16209_Read"],
|
582
|
+
queryFn: async () => {
|
583
|
+
var _a;
|
584
|
+
const result = await baseAxios_default.get(
|
585
|
+
`/Document/GetByType?documentType=${RefinementTypeId}`
|
586
|
+
);
|
587
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
588
|
+
}
|
589
|
+
});
|
590
|
+
const columns = useMemo2(
|
591
|
+
() => [
|
592
|
+
{
|
593
|
+
header: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u",
|
594
|
+
accessorKey: "departmentName"
|
595
|
+
},
|
596
|
+
{
|
597
|
+
header: "N\u1ED9i dung c\u1EA3i ti\u1EBFn",
|
598
|
+
accessorKey: "description"
|
599
|
+
},
|
600
|
+
{
|
601
|
+
header: "Ng\xE0y b\u1EAFt \u0111\u1EA7u",
|
602
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.startDate))
|
603
|
+
},
|
604
|
+
{
|
605
|
+
header: "Ng\xE0y k\u1EBFt th\xFAc",
|
606
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.endDate))
|
607
|
+
},
|
608
|
+
{
|
609
|
+
header: "File",
|
610
|
+
accessorFn: (row) => {
|
611
|
+
return /* @__PURE__ */ jsx10(MyCenterFull, { children: /* @__PURE__ */ jsx10(MyButtonViewPDF, { id: row.id }) });
|
612
|
+
}
|
613
|
+
}
|
614
|
+
],
|
615
|
+
[]
|
616
|
+
);
|
617
|
+
if (query.isLoading) return "Loading...";
|
618
|
+
if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
619
|
+
return /* @__PURE__ */ jsx10(
|
620
|
+
MyDataTable,
|
621
|
+
{
|
622
|
+
columns,
|
623
|
+
data: query.data,
|
624
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx10(F_core16209_Create, { RefinementTypeId }),
|
625
|
+
renderRowActions: ({ row }) => {
|
626
|
+
return /* @__PURE__ */ jsxs7(MyCenterFull, { children: [
|
627
|
+
/* @__PURE__ */ jsx10(F_core16209_Update, { values: row.original }),
|
628
|
+
/* @__PURE__ */ jsx10(
|
629
|
+
F_core16209_Delete,
|
630
|
+
{
|
631
|
+
id: row.original.id,
|
632
|
+
contextData: row.original.departmentName
|
633
|
+
}
|
634
|
+
)
|
635
|
+
] });
|
636
|
+
}
|
637
|
+
}
|
638
|
+
);
|
639
|
+
}
|
640
|
+
|
641
|
+
// src/modules-features/admin/core/core18256/F_core18256.tsx
|
642
|
+
import { Tabs } from "@mantine/core";
|
643
|
+
|
644
|
+
// src/modules-features/admin/core/core18256/F_core18256_Read.tsx
|
645
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
646
|
+
import { useMemo as useMemo3 } from "react";
|
647
|
+
|
648
|
+
// src/modules-features/admin/core/core18256/F_core18256_Create.tsx
|
649
|
+
import { useForm as useForm5 } from "@mantine/form";
|
650
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
651
|
+
function F_core18256_Create({ documentType }) {
|
652
|
+
const form = useForm5({
|
653
|
+
mode: "uncontrolled",
|
654
|
+
initialValues: {
|
655
|
+
name: "",
|
656
|
+
code: "",
|
657
|
+
documentType
|
658
|
+
},
|
659
|
+
validate: {
|
660
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
661
|
+
}
|
662
|
+
});
|
663
|
+
return /* @__PURE__ */ jsxs8(MyButtonCreate, { objectName: "Lo\u1EA1i v\u0103n b\u1EA3n", form, onSubmit: (values) => baseAxios_default.post("/DocumentAttribute/Create", values), children: [
|
664
|
+
/* @__PURE__ */ jsx11(MyTextInput, __spreadValues({ label: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("code"))),
|
665
|
+
/* @__PURE__ */ jsx11(MyTextInput, __spreadValues({ label: "T\xEAn lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("name")))
|
666
|
+
] });
|
667
|
+
}
|
668
|
+
|
669
|
+
// src/modules-features/admin/core/core18256/F_core18256_Delete.tsx
|
670
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
671
|
+
function F_core18256_Delete({ id }) {
|
672
|
+
return /* @__PURE__ */ jsx12(
|
673
|
+
MyActionIconDelete,
|
674
|
+
{
|
675
|
+
onSubmit: async () => await baseAxios_default.post("/DocumentAttribute/Delete", { id })
|
676
|
+
}
|
677
|
+
);
|
678
|
+
}
|
679
|
+
|
680
|
+
// src/modules-features/admin/core/core18256/F_core18256_Update.tsx
|
681
|
+
import { useForm as useForm6 } from "@mantine/form";
|
682
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
683
|
+
function F_core18256_Update({ values }) {
|
684
|
+
const form = useForm6({
|
685
|
+
initialValues: values
|
686
|
+
});
|
687
|
+
return /* @__PURE__ */ jsxs9(MyActionIconUpdate, { form, onSubmit: async (values2) => await baseAxios_default.post("/DocumentAttribute/Update", values2), children: [
|
688
|
+
/* @__PURE__ */ jsx13(MyTextInput, __spreadValues({ label: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("code"))),
|
689
|
+
/* @__PURE__ */ jsx13(MyTextInput, __spreadValues({ label: "T\xEAn lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("name")))
|
690
|
+
] });
|
691
|
+
}
|
692
|
+
|
693
|
+
// src/modules-features/admin/core/core18256/F_core18256_Read.tsx
|
694
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
695
|
+
function F_core18256_Read({ documentType }) {
|
696
|
+
const documentAttributeQuery = useQuery4({
|
697
|
+
queryKey: ["F_core18256_Read", documentType],
|
698
|
+
queryFn: async () => {
|
699
|
+
var _a;
|
700
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType } });
|
701
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
702
|
+
}
|
703
|
+
});
|
704
|
+
const columns = useMemo3(
|
705
|
+
() => [
|
706
|
+
{
|
707
|
+
header: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n",
|
708
|
+
accessorKey: "code"
|
709
|
+
},
|
710
|
+
{
|
711
|
+
header: "T\xEAn Lo\u1EA1i V\u0103n B\u1EA3n",
|
712
|
+
accessorKey: "name"
|
713
|
+
}
|
714
|
+
],
|
715
|
+
[]
|
716
|
+
);
|
717
|
+
if (documentAttributeQuery.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
|
718
|
+
if (documentAttributeQuery.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
719
|
+
return /* @__PURE__ */ jsx14(
|
720
|
+
MyDataTable,
|
721
|
+
{
|
722
|
+
columns,
|
723
|
+
enableRowNumbers: true,
|
724
|
+
data: documentAttributeQuery.data,
|
725
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx14(F_core18256_Create, { documentType }),
|
726
|
+
renderRowActions: ({ row }) => {
|
727
|
+
return /* @__PURE__ */ jsxs10(MyCenterFull, { children: [
|
728
|
+
/* @__PURE__ */ jsx14(F_core18256_Update, { values: row.original }),
|
729
|
+
/* @__PURE__ */ jsx14(F_core18256_Delete, { id: row.original.id })
|
730
|
+
] });
|
731
|
+
}
|
732
|
+
}
|
733
|
+
);
|
734
|
+
}
|
735
|
+
|
736
|
+
// src/modules-features/admin/core/core18256/F_core18256.tsx
|
737
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
738
|
+
var tabData = [
|
739
|
+
{ label: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh" },
|
740
|
+
{ label: "2. Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c" },
|
741
|
+
{ label: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu" }
|
742
|
+
];
|
743
|
+
function F_core18256() {
|
744
|
+
return /* @__PURE__ */ jsxs11(MyTab, { tabList: tabData, children: [
|
745
|
+
/* @__PURE__ */ jsx15(Tabs.Panel, { value: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh", children: /* @__PURE__ */ jsx15(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Regulations }) }),
|
746
|
+
/* @__PURE__ */ jsx15(Tabs.Panel, { value: "2. Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", children: /* @__PURE__ */ jsx15(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Workflow }) }),
|
747
|
+
/* @__PURE__ */ jsx15(Tabs.Panel, { value: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu", children: /* @__PURE__ */ jsx15(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Form }) })
|
748
|
+
] });
|
749
|
+
}
|
750
|
+
|
751
|
+
// src/modules-features/admin/core/core26965/F_core26965_Create.tsx
|
752
|
+
import { useForm as useForm7 } from "@mantine/form";
|
753
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
754
|
+
function F_core26965_Create({
|
755
|
+
RegulationsTypeId
|
756
|
+
}) {
|
757
|
+
const form = useForm7({
|
758
|
+
mode: "uncontrolled",
|
759
|
+
validate: {
|
760
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
761
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
762
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
763
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
764
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
765
|
+
}
|
766
|
+
});
|
767
|
+
return /* @__PURE__ */ jsxs12(
|
768
|
+
MyButtonCreate,
|
769
|
+
{
|
770
|
+
objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c",
|
771
|
+
form,
|
772
|
+
onSubmit: async (values) => {
|
773
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
774
|
+
DocumentType: RegulationsTypeId,
|
775
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
776
|
+
}));
|
777
|
+
},
|
778
|
+
children: [
|
779
|
+
/* @__PURE__ */ jsx16(
|
780
|
+
MyTextInput,
|
781
|
+
__spreadValues({
|
782
|
+
withAsterisk: true,
|
783
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
784
|
+
}, form.getInputProps("decisionCode"))
|
785
|
+
),
|
786
|
+
/* @__PURE__ */ jsx16(
|
787
|
+
MyDateInput,
|
788
|
+
__spreadValues({
|
789
|
+
withAsterisk: true,
|
790
|
+
label: "Ng\xE0y ban h\xE0nh"
|
791
|
+
}, form.getInputProps("promulgateDate"))
|
792
|
+
),
|
793
|
+
/* @__PURE__ */ jsx16(
|
794
|
+
MyTextInput,
|
795
|
+
__spreadValues({
|
796
|
+
withAsterisk: true,
|
797
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
798
|
+
}, form.getInputProps("name"))
|
799
|
+
),
|
800
|
+
/* @__PURE__ */ jsx16(
|
801
|
+
F_core18256_Select,
|
802
|
+
__spreadValues({
|
803
|
+
withAsterisk: true,
|
804
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
805
|
+
documentTypeId: RegulationsTypeId
|
806
|
+
}, form.getInputProps("documentAttributeId"))
|
807
|
+
),
|
808
|
+
/* @__PURE__ */ jsx16(
|
809
|
+
MyFileInput,
|
810
|
+
__spreadValues({
|
811
|
+
withAsterisk: true,
|
812
|
+
label: "V\u0103n b\u1EA3n"
|
813
|
+
}, form.getInputProps("file"))
|
814
|
+
),
|
815
|
+
/* @__PURE__ */ jsx16(
|
816
|
+
MyNumberInput,
|
817
|
+
__spreadValues({
|
818
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
819
|
+
}, form.getInputProps("orderBy"))
|
820
|
+
)
|
821
|
+
]
|
822
|
+
}
|
823
|
+
);
|
824
|
+
}
|
825
|
+
|
826
|
+
// src/modules-features/admin/core/core26965/F_core26965_Read.tsx
|
827
|
+
import { Accordion as Accordion2, Blockquote as Blockquote2 } from "@mantine/core";
|
828
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
829
|
+
import { useMemo as useMemo4 } from "react";
|
830
|
+
|
831
|
+
// src/modules-features/admin/core/core26965/F_core26965_Delete.tsx
|
832
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
833
|
+
function F_core26965_Delete({
|
834
|
+
id,
|
835
|
+
contextData
|
836
|
+
}) {
|
837
|
+
return /* @__PURE__ */ jsx17(
|
838
|
+
MyActionIconDelete,
|
839
|
+
{
|
840
|
+
contextData,
|
841
|
+
onSubmit: async () => await baseAxios_default.post("/Document/delete", { id })
|
842
|
+
}
|
843
|
+
);
|
844
|
+
}
|
845
|
+
|
846
|
+
// src/modules-features/admin/core/core26965/F_core26965_Update.tsx
|
847
|
+
import { useForm as useForm8 } from "@mantine/form";
|
848
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
849
|
+
function F_core26965_Update({
|
850
|
+
values,
|
851
|
+
RegulationsTypeId
|
852
|
+
}) {
|
853
|
+
var _a;
|
854
|
+
const form = useForm8({
|
855
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
856
|
+
file: new File(
|
857
|
+
[],
|
858
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
859
|
+
),
|
860
|
+
promulgateDate: new Date(values.promulgateDate)
|
861
|
+
}),
|
862
|
+
validate: {
|
863
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
864
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
865
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
866
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
867
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
868
|
+
}
|
869
|
+
});
|
870
|
+
return /* @__PURE__ */ jsxs13(
|
871
|
+
MyActionIconUpdate,
|
872
|
+
{
|
873
|
+
form,
|
874
|
+
onSubmit: async (values2) => {
|
875
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
876
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
877
|
+
}));
|
878
|
+
},
|
879
|
+
children: [
|
880
|
+
/* @__PURE__ */ jsx18(
|
881
|
+
MyTextInput,
|
882
|
+
__spreadValues({
|
883
|
+
withAsterisk: true,
|
884
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
885
|
+
}, form.getInputProps("decisionCode"))
|
886
|
+
),
|
887
|
+
/* @__PURE__ */ jsx18(
|
888
|
+
MyDateInput,
|
889
|
+
__spreadValues({
|
890
|
+
withAsterisk: true,
|
891
|
+
label: "Ng\xE0y ban h\xE0nh"
|
892
|
+
}, form.getInputProps("promulgateDate"))
|
893
|
+
),
|
894
|
+
/* @__PURE__ */ jsx18(
|
895
|
+
MyTextInput,
|
896
|
+
__spreadValues({
|
897
|
+
withAsterisk: true,
|
898
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
899
|
+
}, form.getInputProps("name"))
|
900
|
+
),
|
901
|
+
/* @__PURE__ */ jsx18(
|
902
|
+
F_core18256_Select,
|
903
|
+
__spreadValues({
|
904
|
+
withAsterisk: true,
|
905
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
906
|
+
documentTypeId: RegulationsTypeId
|
907
|
+
}, form.getInputProps("documentAttributeId"))
|
908
|
+
),
|
909
|
+
/* @__PURE__ */ jsx18(
|
910
|
+
MyFileInput,
|
911
|
+
__spreadValues({
|
912
|
+
withAsterisk: true,
|
913
|
+
label: "V\u0103n b\u1EA3n"
|
914
|
+
}, form.getInputProps("file"))
|
915
|
+
),
|
916
|
+
/* @__PURE__ */ jsx18(
|
917
|
+
MyNumberInput,
|
918
|
+
__spreadValues({
|
919
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
920
|
+
}, form.getInputProps("orderBy"))
|
921
|
+
)
|
922
|
+
]
|
923
|
+
}
|
924
|
+
);
|
925
|
+
}
|
926
|
+
|
927
|
+
// src/modules-features/admin/core/core26965/F_core26965_Read.tsx
|
928
|
+
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
929
|
+
function F_core26965_Read({
|
930
|
+
RegulationsTypeId
|
931
|
+
}) {
|
932
|
+
var _a, _b, _c;
|
933
|
+
const documentAttributeQuery = useQuery5({
|
934
|
+
queryKey: ["F_core26965_Read", RegulationsTypeId],
|
935
|
+
queryFn: async () => {
|
936
|
+
var _a2;
|
937
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", {
|
938
|
+
params: { documentType: RegulationsTypeId }
|
939
|
+
});
|
940
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
941
|
+
}
|
942
|
+
});
|
943
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
944
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
945
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0)
|
946
|
+
return /* @__PURE__ */ jsx19(Blockquote2, { color: "yellow", children: "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n" });
|
947
|
+
return /* @__PURE__ */ jsx19(MyFlexColumn, { children: /* @__PURE__ */ jsx19(
|
948
|
+
Accordion2,
|
949
|
+
{
|
950
|
+
variant: "contained",
|
951
|
+
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
952
|
+
(item) => {
|
953
|
+
var _a2;
|
954
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
955
|
+
}
|
956
|
+
),
|
957
|
+
multiple: true,
|
958
|
+
children: (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ jsx19(
|
959
|
+
SubRead2,
|
960
|
+
{
|
961
|
+
name: item.name,
|
962
|
+
documentType: item.id,
|
963
|
+
RegulationsTypeId
|
964
|
+
},
|
965
|
+
idx
|
966
|
+
))
|
967
|
+
}
|
968
|
+
) });
|
969
|
+
}
|
970
|
+
function SubRead2({
|
971
|
+
name,
|
972
|
+
documentType,
|
973
|
+
RegulationsTypeId
|
974
|
+
}) {
|
975
|
+
const documentQuery = useQuery5({
|
976
|
+
queryKey: ["SubRead" + documentType],
|
977
|
+
queryFn: async () => {
|
978
|
+
const result = await baseAxios_default.get(
|
979
|
+
`/Document/GetByDocumentAttribute?id=${documentType}`
|
980
|
+
);
|
981
|
+
return result.data.data;
|
982
|
+
}
|
983
|
+
});
|
984
|
+
const columns = useMemo4(
|
985
|
+
() => [
|
986
|
+
{
|
987
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
988
|
+
accessorKey: "decisionCode"
|
989
|
+
},
|
990
|
+
{
|
991
|
+
header: "Ng\xE0y ban h\xE0nh",
|
992
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
993
|
+
},
|
994
|
+
{
|
995
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
996
|
+
accessorKey: "name"
|
997
|
+
},
|
998
|
+
{
|
999
|
+
header: "File",
|
1000
|
+
accessorFn: (row) => {
|
1001
|
+
return /* @__PURE__ */ jsx19(MyCenterFull, { children: /* @__PURE__ */ jsx19(MyButtonViewPDF, { id: row.id }) });
|
1002
|
+
}
|
1003
|
+
}
|
1004
|
+
],
|
1005
|
+
[]
|
1006
|
+
);
|
1007
|
+
if (documentQuery.isLoading) return "Loading...";
|
1008
|
+
if (documentQuery.isError) return "Error!";
|
1009
|
+
return /* @__PURE__ */ jsxs14(Accordion2.Item, { value: documentType.toString(), children: [
|
1010
|
+
/* @__PURE__ */ jsx19(Accordion2.Control, { children: name }),
|
1011
|
+
/* @__PURE__ */ jsx19(Accordion2.Panel, { children: /* @__PURE__ */ jsx19(
|
1012
|
+
MyDataTable,
|
1013
|
+
{
|
1014
|
+
columns,
|
1015
|
+
data: documentQuery.data,
|
1016
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ jsxs14(MyCenterFull, { children: [
|
1017
|
+
/* @__PURE__ */ jsx19(
|
1018
|
+
F_core26965_Update,
|
1019
|
+
{
|
1020
|
+
RegulationsTypeId,
|
1021
|
+
values: row.original
|
1022
|
+
}
|
1023
|
+
),
|
1024
|
+
/* @__PURE__ */ jsx19(
|
1025
|
+
F_core26965_Delete,
|
1026
|
+
{
|
1027
|
+
id: row.original.id,
|
1028
|
+
contextData: row.original.decisionCode
|
1029
|
+
}
|
1030
|
+
)
|
1031
|
+
] })
|
1032
|
+
}
|
1033
|
+
) })
|
1034
|
+
] });
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
// src/modules-features/admin/core/core26965/F_core26965.tsx
|
1038
|
+
import { Paper as Paper3, Space as Space3 } from "@mantine/core";
|
1039
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
1040
|
+
function F_core26965({ RegulationsTypeId }) {
|
1041
|
+
return /* @__PURE__ */ jsxs15(Paper3, { p: "md", children: [
|
1042
|
+
/* @__PURE__ */ jsx20(MyFlexEnd, { children: /* @__PURE__ */ jsx20(F_core26965_Create, { RegulationsTypeId }) }),
|
1043
|
+
/* @__PURE__ */ jsx20(Space3, {}),
|
1044
|
+
/* @__PURE__ */ jsx20(F_core26965_Read, { RegulationsTypeId })
|
1045
|
+
] });
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
// src/modules-features/admin/core/core27311/F_core27311_Create.tsx
|
1049
|
+
import { useForm as useForm9 } from "@mantine/form";
|
1050
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
1051
|
+
function F_core27311_Create({
|
1052
|
+
WorkflowTypeId
|
1053
|
+
}) {
|
1054
|
+
const form = useForm9({
|
1055
|
+
mode: "uncontrolled",
|
1056
|
+
validate: {
|
1057
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1058
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1059
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1060
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1061
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
1062
|
+
}
|
1063
|
+
});
|
1064
|
+
return /* @__PURE__ */ jsxs16(
|
1065
|
+
MyButtonCreate,
|
1066
|
+
{
|
1067
|
+
objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c",
|
1068
|
+
form,
|
1069
|
+
onSubmit: async (values) => {
|
1070
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
1071
|
+
DocumentType: WorkflowTypeId,
|
1072
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
1073
|
+
}));
|
1074
|
+
},
|
1075
|
+
children: [
|
1076
|
+
/* @__PURE__ */ jsx21(
|
1077
|
+
MyTextInput,
|
1078
|
+
__spreadValues({
|
1079
|
+
withAsterisk: true,
|
1080
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
1081
|
+
}, form.getInputProps("decisionCode"))
|
1082
|
+
),
|
1083
|
+
/* @__PURE__ */ jsx21(
|
1084
|
+
MyDateInput,
|
1085
|
+
__spreadValues({
|
1086
|
+
withAsterisk: true,
|
1087
|
+
label: "Ng\xE0y ban h\xE0nh"
|
1088
|
+
}, form.getInputProps("promulgateDate"))
|
1089
|
+
),
|
1090
|
+
/* @__PURE__ */ jsx21(
|
1091
|
+
MyTextInput,
|
1092
|
+
__spreadValues({
|
1093
|
+
withAsterisk: true,
|
1094
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
1095
|
+
}, form.getInputProps("name"))
|
1096
|
+
),
|
1097
|
+
/* @__PURE__ */ jsx21(
|
1098
|
+
F_core18256_Select,
|
1099
|
+
__spreadValues({
|
1100
|
+
withAsterisk: true,
|
1101
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
1102
|
+
documentTypeId: WorkflowTypeId
|
1103
|
+
}, form.getInputProps("documentAttributeId"))
|
1104
|
+
),
|
1105
|
+
/* @__PURE__ */ jsx21(
|
1106
|
+
MyFileInput,
|
1107
|
+
__spreadValues({
|
1108
|
+
withAsterisk: true,
|
1109
|
+
label: "V\u0103n b\u1EA3n"
|
1110
|
+
}, form.getInputProps("file"))
|
1111
|
+
),
|
1112
|
+
/* @__PURE__ */ jsx21(
|
1113
|
+
MyNumberInput,
|
1114
|
+
__spreadValues({
|
1115
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
1116
|
+
}, form.getInputProps("orderBy"))
|
1117
|
+
)
|
1118
|
+
]
|
1119
|
+
}
|
1120
|
+
);
|
1121
|
+
}
|
1122
|
+
|
1123
|
+
// src/modules-features/admin/core/core27311/F_core27311_Read.tsx
|
1124
|
+
import { Accordion as Accordion3, Blockquote as Blockquote3 } from "@mantine/core";
|
1125
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
1126
|
+
import { useMemo as useMemo5 } from "react";
|
1127
|
+
|
1128
|
+
// src/modules-features/admin/core/core27311/F_core27311_Delete.tsx
|
1129
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
1130
|
+
function F_core27311_Delete({
|
1131
|
+
id,
|
1132
|
+
contextData
|
1133
|
+
}) {
|
1134
|
+
return /* @__PURE__ */ jsx22(
|
1135
|
+
MyActionIconDelete,
|
1136
|
+
{
|
1137
|
+
contextData,
|
1138
|
+
onSubmit: async () => await baseAxios_default.post("/Document/delete", { id })
|
1139
|
+
}
|
1140
|
+
);
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
// src/modules-features/admin/core/core27311/F_core27311_Update.tsx
|
1144
|
+
import { useForm as useForm10 } from "@mantine/form";
|
1145
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
1146
|
+
function F_core27311_Update({
|
1147
|
+
values,
|
1148
|
+
WorkflowTypeId
|
1149
|
+
}) {
|
1150
|
+
var _a;
|
1151
|
+
const form = useForm10({
|
1152
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
1153
|
+
file: new File(
|
1154
|
+
[],
|
1155
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
1156
|
+
),
|
1157
|
+
promulgateDate: new Date(values.promulgateDate)
|
1158
|
+
}),
|
1159
|
+
validate: {
|
1160
|
+
decisionCode: (value) => value ? null : "S\u1ED1 quy \u0111\u1ECBnh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1161
|
+
promulgateDate: (value) => value ? null : "Ng\xE0y ban h\xE0nh kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1162
|
+
name: (value) => value ? null : "T\xEAn t\xE0i li\u1EC7u kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1163
|
+
documentAttributeId: (value) => value ? null : "Lo\u1EA1i v\u0103n b\u1EA3n kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1164
|
+
file: (value) => value ? null : "T\u1EC7p \u0111\xEDnh k\xE8m kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
1165
|
+
}
|
1166
|
+
});
|
1167
|
+
return /* @__PURE__ */ jsxs17(
|
1168
|
+
MyActionIconUpdate,
|
1169
|
+
{
|
1170
|
+
form,
|
1171
|
+
onSubmit: async (values2) => {
|
1172
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
1173
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
1174
|
+
}));
|
1175
|
+
},
|
1176
|
+
children: [
|
1177
|
+
/* @__PURE__ */ jsx23(
|
1178
|
+
MyTextInput,
|
1179
|
+
__spreadValues({
|
1180
|
+
withAsterisk: true,
|
1181
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
1182
|
+
}, form.getInputProps("decisionCode"))
|
1183
|
+
),
|
1184
|
+
/* @__PURE__ */ jsx23(
|
1185
|
+
MyDateInput,
|
1186
|
+
__spreadValues({
|
1187
|
+
withAsterisk: true,
|
1188
|
+
label: "Ng\xE0y ban h\xE0nh"
|
1189
|
+
}, form.getInputProps("promulgateDate"))
|
1190
|
+
),
|
1191
|
+
/* @__PURE__ */ jsx23(
|
1192
|
+
MyTextInput,
|
1193
|
+
__spreadValues({
|
1194
|
+
withAsterisk: true,
|
1195
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
1196
|
+
}, form.getInputProps("name"))
|
1197
|
+
),
|
1198
|
+
/* @__PURE__ */ jsx23(
|
1199
|
+
F_core18256_Select,
|
1200
|
+
__spreadValues({
|
1201
|
+
withAsterisk: true,
|
1202
|
+
label: "Lo\u1EA1i v\u0103n b\u1EA3n",
|
1203
|
+
documentTypeId: WorkflowTypeId
|
1204
|
+
}, form.getInputProps("documentAttributeId"))
|
1205
|
+
),
|
1206
|
+
/* @__PURE__ */ jsx23(
|
1207
|
+
MyFileInput,
|
1208
|
+
__spreadValues({
|
1209
|
+
withAsterisk: true,
|
1210
|
+
label: "V\u0103n b\u1EA3n"
|
1211
|
+
}, form.getInputProps("file"))
|
1212
|
+
),
|
1213
|
+
/* @__PURE__ */ jsx23(
|
1214
|
+
MyNumberInput,
|
1215
|
+
__spreadValues({
|
1216
|
+
label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch"
|
1217
|
+
}, form.getInputProps("orderBy"))
|
1218
|
+
)
|
1219
|
+
]
|
1220
|
+
}
|
1221
|
+
);
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
// src/modules-features/admin/core/core27311/F_core27311_Read.tsx
|
1225
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
1226
|
+
function F_core27311_Read({
|
1227
|
+
WorkflowTypeId
|
1228
|
+
}) {
|
1229
|
+
var _a, _b, _c;
|
1230
|
+
const documentAttributeQuery = useQuery6({
|
1231
|
+
queryKey: ["F_core27311_Read", WorkflowTypeId],
|
1232
|
+
queryFn: async () => {
|
1233
|
+
var _a2;
|
1234
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", {
|
1235
|
+
params: { documentType: WorkflowTypeId }
|
1236
|
+
});
|
1237
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
1238
|
+
}
|
1239
|
+
});
|
1240
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
1241
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
1242
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0)
|
1243
|
+
return /* @__PURE__ */ jsx24(Blockquote3, { color: "yellow", children: "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n" });
|
1244
|
+
return /* @__PURE__ */ jsx24(MyFlexColumn, { children: /* @__PURE__ */ jsx24(
|
1245
|
+
Accordion3,
|
1246
|
+
{
|
1247
|
+
variant: "contained",
|
1248
|
+
defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map(
|
1249
|
+
(item) => {
|
1250
|
+
var _a2;
|
1251
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
1252
|
+
}
|
1253
|
+
),
|
1254
|
+
multiple: true,
|
1255
|
+
children: (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ jsx24(
|
1256
|
+
SubRead3,
|
1257
|
+
{
|
1258
|
+
name: item.name,
|
1259
|
+
documentType: item.id,
|
1260
|
+
WorkflowTypeId
|
1261
|
+
},
|
1262
|
+
idx
|
1263
|
+
))
|
1264
|
+
}
|
1265
|
+
) });
|
1266
|
+
}
|
1267
|
+
function SubRead3({
|
1268
|
+
name,
|
1269
|
+
documentType,
|
1270
|
+
WorkflowTypeId
|
1271
|
+
}) {
|
1272
|
+
const documentQuery = useQuery6({
|
1273
|
+
queryKey: ["SubRead" + documentType],
|
1274
|
+
queryFn: async () => {
|
1275
|
+
const result = await baseAxios_default.get(
|
1276
|
+
`/Document/GetByDocumentAttribute?id=${documentType}`
|
1277
|
+
);
|
1278
|
+
return result.data.data;
|
1279
|
+
}
|
1280
|
+
});
|
1281
|
+
const columns = useMemo5(
|
1282
|
+
() => [
|
1283
|
+
{
|
1284
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
1285
|
+
accessorKey: "decisionCode"
|
1286
|
+
},
|
1287
|
+
{
|
1288
|
+
header: "Ng\xE0y ban h\xE0nh",
|
1289
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
1290
|
+
},
|
1291
|
+
{
|
1292
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
1293
|
+
accessorKey: "name"
|
1294
|
+
},
|
1295
|
+
{
|
1296
|
+
header: "File",
|
1297
|
+
accessorFn: (row) => {
|
1298
|
+
return /* @__PURE__ */ jsx24(MyCenterFull, { children: /* @__PURE__ */ jsx24(MyButtonViewPDF, { id: row.id }) });
|
1299
|
+
}
|
1300
|
+
}
|
1301
|
+
],
|
1302
|
+
[]
|
1303
|
+
);
|
1304
|
+
if (documentQuery.isLoading) return "Loading...";
|
1305
|
+
if (documentQuery.isError) return "Error!";
|
1306
|
+
return /* @__PURE__ */ jsxs18(Accordion3.Item, { value: documentType.toString(), children: [
|
1307
|
+
/* @__PURE__ */ jsx24(Accordion3.Control, { children: name }),
|
1308
|
+
/* @__PURE__ */ jsx24(Accordion3.Panel, { children: /* @__PURE__ */ jsx24(
|
1309
|
+
MyDataTable,
|
1310
|
+
{
|
1311
|
+
columns,
|
1312
|
+
data: documentQuery.data,
|
1313
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ jsxs18(MyCenterFull, { children: [
|
1314
|
+
/* @__PURE__ */ jsx24(
|
1315
|
+
F_core27311_Update,
|
1316
|
+
{
|
1317
|
+
WorkflowTypeId,
|
1318
|
+
values: row.original
|
1319
|
+
}
|
1320
|
+
),
|
1321
|
+
/* @__PURE__ */ jsx24(
|
1322
|
+
F_core27311_Delete,
|
1323
|
+
{
|
1324
|
+
id: row.original.id,
|
1325
|
+
contextData: row.original.decisionCode
|
1326
|
+
}
|
1327
|
+
)
|
1328
|
+
] })
|
1329
|
+
}
|
1330
|
+
) })
|
1331
|
+
] });
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
// src/modules-features/admin/core/core27311/F_core27311.tsx
|
1335
|
+
import { Paper as Paper4, Space as Space4 } from "@mantine/core";
|
1336
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
1337
|
+
function F_core27311({
|
1338
|
+
WorkflowTypeId
|
1339
|
+
}) {
|
1340
|
+
return /* @__PURE__ */ jsxs19(Paper4, { p: "md", children: [
|
1341
|
+
/* @__PURE__ */ jsx25(MyFlexEnd, { children: /* @__PURE__ */ jsx25(F_core27311_Create, { WorkflowTypeId }) }),
|
1342
|
+
/* @__PURE__ */ jsx25(Space4, {}),
|
1343
|
+
/* @__PURE__ */ jsx25(F_core27311_Read, { WorkflowTypeId })
|
1344
|
+
] });
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
// src/modules-features/admin/core/core35923/F_core35923.tsx
|
1348
|
+
import { Grid } from "@mantine/core";
|
1349
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
1350
|
+
function F_core35923() {
|
1351
|
+
return /* @__PURE__ */ jsxs20(MyFieldset, { title: "C\u1EADp nh\u1EADt th\xF4ng tin \u0111\u01A1n v\u1ECB ch\u1EE7 qu\u1EA3n", children: [
|
1352
|
+
/* @__PURE__ */ jsxs20(Grid, { children: [
|
1353
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 5 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "M\xE3 module", disabled: true }) }),
|
1354
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 7 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "T\xEAn module" }) }),
|
1355
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: 12, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "T\xEAn \u0111\u01A1n v\u1ECB ch\u1EE7 qu\u1EA3n" }) }),
|
1356
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "Email" }) }),
|
1357
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }) }),
|
1358
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "Ng\xE0y \u0111\u0103ng k\xFD" }) }),
|
1359
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyTextInput, { label: "Ng\xE0y h\u1EBFt h\u1EA1n" }) }),
|
1360
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyFileInput, { label: "Favicon (16px x 16px)" }) }),
|
1361
|
+
/* @__PURE__ */ jsx26(Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx26(MyFileInput, { label: "Logo (330px x 115px)" }) })
|
1362
|
+
] }),
|
1363
|
+
/* @__PURE__ */ jsx26(MyFlexEnd, { children: /* @__PURE__ */ jsx26(MyButton, { crudType: "save" }) })
|
1364
|
+
] });
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
// src/modules-features/admin/core/core38677/F_core38677.tsx
|
1368
|
+
import { Grid as Grid2, Paper as Paper5, ScrollArea as ScrollArea2 } from "@mantine/core";
|
1369
|
+
|
1370
|
+
// src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
|
1371
|
+
import { Container } from "@mantine/core";
|
1372
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
1373
|
+
import { useEffect, useMemo as useMemo6, useState } from "react";
|
1374
|
+
|
1375
|
+
// src/modules-features/admin/core/core83092/useS_core83092.tsx
|
1376
|
+
var useStore = createGenericStore({
|
1377
|
+
initialState: { roleId: 0 },
|
1378
|
+
storageKey: "useS_core83092"
|
1379
|
+
});
|
1380
|
+
function useS_core83092() {
|
1381
|
+
const store = useStore();
|
1382
|
+
function toogleAllPermissionWithType(field, isCheck) {
|
1383
|
+
var _a;
|
1384
|
+
const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map((item) => __spreadProps(__spreadValues({}, item), {
|
1385
|
+
[field]: isCheck
|
1386
|
+
}));
|
1387
|
+
store.setProperty("rolePermissions", updatedData);
|
1388
|
+
}
|
1389
|
+
function findByPageId(pageId) {
|
1390
|
+
var _a;
|
1391
|
+
const rolePermission = (_a = store.state.rolePermissions) == null ? void 0 : _a.find((item) => item.pageId == pageId);
|
1392
|
+
return rolePermission;
|
1393
|
+
}
|
1394
|
+
function updatePermission(pageId, updatedPermission) {
|
1395
|
+
var _a;
|
1396
|
+
const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map(
|
1397
|
+
(item) => item.pageId === pageId ? __spreadValues(__spreadValues({}, item), updatedPermission) : item
|
1398
|
+
);
|
1399
|
+
store.setProperty("rolePermissions", updatedData);
|
1400
|
+
}
|
1401
|
+
function isAllPermission(field) {
|
1402
|
+
var _a, _b;
|
1403
|
+
return (_b = (_a = store.state.rolePermissions) == null ? void 0 : _a.every((item) => item[field] === true)) != null ? _b : false;
|
1404
|
+
}
|
1405
|
+
return __spreadProps(__spreadValues({}, store), {
|
1406
|
+
toogleAllPermissionWithType,
|
1407
|
+
findByPageId,
|
1408
|
+
updatePermission,
|
1409
|
+
isAllPermission
|
1410
|
+
});
|
1411
|
+
}
|
1412
|
+
function utils_core83092_mergePage(arr1, arr2) {
|
1413
|
+
const pageMap = /* @__PURE__ */ new Map();
|
1414
|
+
arr1.forEach((page) => pageMap.set(page.pageId, page));
|
1415
|
+
arr2.forEach((page) => {
|
1416
|
+
if (pageMap.has(page.pageId)) {
|
1417
|
+
pageMap.set(page.pageId, page);
|
1418
|
+
}
|
1419
|
+
});
|
1420
|
+
return Array.from(pageMap.values());
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
// src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
|
1424
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
1425
|
+
function F_core38677_ReadUser() {
|
1426
|
+
const store = useS_core83092();
|
1427
|
+
const query = useQ_Account_GetAdminAccount();
|
1428
|
+
const [rowSelection, setRowSelection] = useState({});
|
1429
|
+
const columns = useMemo6(
|
1430
|
+
() => [
|
1431
|
+
{
|
1432
|
+
header: "M\xE3",
|
1433
|
+
accessorKey: "code",
|
1434
|
+
size: 60
|
1435
|
+
},
|
1436
|
+
{
|
1437
|
+
header: "T\xEAn quy\u1EC1n",
|
1438
|
+
accessorKey: "name"
|
1439
|
+
}
|
1440
|
+
],
|
1441
|
+
[]
|
1442
|
+
);
|
1443
|
+
const handleRowClick = (rowId) => {
|
1444
|
+
setRowSelection({ [rowId]: true });
|
1445
|
+
store.setProperty("roleId", parseInt(rowId));
|
1446
|
+
};
|
1447
|
+
useEffect(() => {
|
1448
|
+
if (store.state.roleId == 0) return;
|
1449
|
+
setRowSelection({ [store.state.roleId]: true });
|
1450
|
+
}, [store.state.roleId]);
|
1451
|
+
useEffect(() => {
|
1452
|
+
if (!query.data) return;
|
1453
|
+
store.setProperty("roleId", query.data[0].id);
|
1454
|
+
}, [query.data]);
|
1455
|
+
if (query.isLoading) return "Loading...";
|
1456
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
1457
|
+
return /* @__PURE__ */ jsx27(Container, { fluid: true, children: /* @__PURE__ */ jsx27(
|
1458
|
+
MyDataTable,
|
1459
|
+
{
|
1460
|
+
columns,
|
1461
|
+
data: query.data,
|
1462
|
+
getRowId: (row) => {
|
1463
|
+
var _a;
|
1464
|
+
return (_a = row.id) == null ? void 0 : _a.toString();
|
1465
|
+
},
|
1466
|
+
mantineTableBodyRowProps: ({ row }) => ({
|
1467
|
+
onClick: () => handleRowClick(row.id),
|
1468
|
+
style: {
|
1469
|
+
cursor: "pointer",
|
1470
|
+
backgroundColor: rowSelection[row.id] ? "var(--mantine-color-blue-light)" : "transparent"
|
1471
|
+
}
|
1472
|
+
}),
|
1473
|
+
state: rowSelection
|
1474
|
+
}
|
1475
|
+
) });
|
1476
|
+
}
|
1477
|
+
function useQ_Account_GetAdminAccount() {
|
1478
|
+
const query = useQuery7({
|
1479
|
+
queryKey: ["useQ_Role_GetAdminRole"],
|
1480
|
+
queryFn: async () => {
|
1481
|
+
var _a;
|
1482
|
+
const result = await baseAxios_default.get(`/Role/GetAdminRole`);
|
1483
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
1484
|
+
},
|
1485
|
+
refetchOnWindowFocus: false
|
1486
|
+
});
|
1487
|
+
return query;
|
1488
|
+
}
|
1489
|
+
|
1490
|
+
// src/modules-features/admin/core/core38677/F_core38677_Save.tsx
|
1491
|
+
import { useMutation } from "@tanstack/react-query";
|
1492
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
1493
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
1494
|
+
function F_core38677_Save() {
|
1495
|
+
const store = useS_core83092();
|
1496
|
+
const disable = useState2(false);
|
1497
|
+
const mutation = useMutation({
|
1498
|
+
mutationFn: async (body) => {
|
1499
|
+
const res = await baseAxios_default.put("/Role/UpdatePermission", body);
|
1500
|
+
return res;
|
1501
|
+
}
|
1502
|
+
});
|
1503
|
+
function handleSave() {
|
1504
|
+
mutation.mutate({
|
1505
|
+
pagePermissions: store.state.rolePermissions,
|
1506
|
+
roleId: store.state.roleId
|
1507
|
+
}, {
|
1508
|
+
onSuccess: () => {
|
1509
|
+
utils_notification_show({
|
1510
|
+
crudType: "update"
|
1511
|
+
});
|
1512
|
+
}
|
1513
|
+
});
|
1514
|
+
}
|
1515
|
+
useEffect2(() => {
|
1516
|
+
if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
|
1517
|
+
disable[1](true);
|
1518
|
+
return;
|
1519
|
+
}
|
1520
|
+
disable[1](false);
|
1521
|
+
}, [store.state.rolePermissions]);
|
1522
|
+
return /* @__PURE__ */ jsx28(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
1523
|
+
}
|
1524
|
+
|
1525
|
+
// src/data/menuData.ts
|
1526
|
+
var menuData = [
|
1527
|
+
{
|
1528
|
+
label: "Qu\u1EA3n l\xED h\u1EC7 th\u1ED1ng",
|
1529
|
+
links: [
|
1530
|
+
{ pageId: 1, name: "Account management", label: "Qu\u1EA3n l\xED t\xE0i kho\u1EA3n", link: "core71678" },
|
1531
|
+
{ pageId: 2, name: "Access control level", label: "Ph\xE2n quy\u1EC1n c\u1EA5p \u0111\u01A1n v\u1ECB", link: "core38677" },
|
1532
|
+
{ pageId: 3, name: "Access control", label: "Ph\xE2n quy\u1EC1n s\u1EED d\u1EE5ng", link: "core83092" },
|
1533
|
+
{ pageId: 4, name: "Security regulations", label: "Quy \u0111\u1ECBnh an to\xE0n/ b\u1EA3o m\u1EADt th\xF4ng tin", link: "core76318", status: "Default" },
|
1534
|
+
{ pageId: 5, name: "System updates", label: "Th\xF4ng tin x\xE2y d\u1EF1ng, c\u1EA3i ti\u1EBFn, b\u1EA3o tr\xEC h\u1EC7 th\u1ED1ng", link: "core16209", status: "Default" },
|
1535
|
+
{ pageId: 6, name: "User guide", label: "T\xE0i li\u1EC7u h\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng", link: "core40207", status: "Default" }
|
1536
|
+
]
|
1537
|
+
},
|
1538
|
+
{
|
1539
|
+
label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh",
|
1540
|
+
links: [
|
1541
|
+
{ pageId: 7, name: "Organizational regulations", label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", link: "core26965", status: "Default" },
|
1542
|
+
{ pageId: 8, name: "Workflow process", label: "Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", link: "core27311", status: "Default" },
|
1543
|
+
{ pageId: 9, name: "Form templates", label: "T\xE0i li\u1EC7u bi\u1EC3u m\u1EABu", link: "core12196", status: "Default" }
|
1544
|
+
]
|
1545
|
+
},
|
1546
|
+
{
|
1547
|
+
label: "Danh m\u1EE5c h\u1EC7 th\u1ED1ng ",
|
1548
|
+
links: [
|
1549
|
+
{ pageId: 0, name: "Document categories", label: "Danh m\u1EE5c lo\u1EA1i v\u0103n b\u1EA3n", link: "core18256" },
|
1550
|
+
{ pageId: 0, name: "", label: "Danh m\u1EE5c c\u1EA5u h\xECnh mail", link: "core64229", status: "Default" },
|
1551
|
+
{ pageId: 0, name: "", label: "C\u1EA5u h\xECnh th\xF4ng tin ch\u1EE7 qu\u1EA3n", link: "core60524", status: "Default" }
|
1552
|
+
]
|
1553
|
+
}
|
1554
|
+
];
|
1555
|
+
|
1556
|
+
// src/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx
|
1557
|
+
import { Checkbox, Flex, ScrollArea, Table, Text } from "@mantine/core";
|
1558
|
+
import { IconEdit, IconEyeUp, IconFileExport, IconPlus, IconPrinter, IconTrash } from "@tabler/icons-react";
|
1559
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
1560
|
+
import React, { useEffect as useEffect3, useState as useState3 } from "react";
|
1561
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
1562
|
+
var title = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
|
1563
|
+
function F_core38677_ViewMenuPermissions({ menuData: menuData2 }) {
|
1564
|
+
var _a, _b;
|
1565
|
+
const store = useS_core83092();
|
1566
|
+
const query = useGetUserPermission();
|
1567
|
+
const list = useState3([]);
|
1568
|
+
useEffect3(() => {
|
1569
|
+
list[1](groupToTwoLevels(menuData2));
|
1570
|
+
}, []);
|
1571
|
+
useEffect3(() => {
|
1572
|
+
if (!query.data) return;
|
1573
|
+
store.setProperty("rolePermissions", query.data);
|
1574
|
+
}, [query.data]);
|
1575
|
+
if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
|
1576
|
+
return /* @__PURE__ */ jsx29(ScrollArea.Autosize, { h: "70vh", children: /* @__PURE__ */ jsxs21(Table, { children: [
|
1577
|
+
/* @__PURE__ */ jsx29(
|
1578
|
+
Table.Thead,
|
1579
|
+
{
|
1580
|
+
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
|
1581
|
+
style: {
|
1582
|
+
position: "sticky",
|
1583
|
+
top: 0,
|
1584
|
+
zIndex: 1,
|
1585
|
+
boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
|
1586
|
+
border: "1px solid var(--mantine-color-gray-4)"
|
1587
|
+
},
|
1588
|
+
children: /* @__PURE__ */ jsxs21(Table.Tr, { children: [
|
1589
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: title }),
|
1590
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1591
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isRead"), onChange: (e) => {
|
1592
|
+
store.toogleAllPermissionWithType("isRead", e.target.checked);
|
1593
|
+
} }),
|
1594
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1595
|
+
"Xem",
|
1596
|
+
/* @__PURE__ */ jsx29(IconEyeUp, { color: "gray" })
|
1597
|
+
] })
|
1598
|
+
] }) }),
|
1599
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1600
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isCreate"), onChange: (e) => {
|
1601
|
+
store.toogleAllPermissionWithType("isCreate", e.target.checked);
|
1602
|
+
} }),
|
1603
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1604
|
+
"Th\xEAm",
|
1605
|
+
/* @__PURE__ */ jsx29(IconPlus, { color: "blue" })
|
1606
|
+
] })
|
1607
|
+
] }) }),
|
1608
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1609
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isUpdate"), onChange: (e) => {
|
1610
|
+
store.toogleAllPermissionWithType("isUpdate", e.target.checked);
|
1611
|
+
} }),
|
1612
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1613
|
+
"S\u1EEDa",
|
1614
|
+
/* @__PURE__ */ jsx29(IconEdit, { color: "var(--mantine-color-yellow-8)" })
|
1615
|
+
] })
|
1616
|
+
] }) }),
|
1617
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1618
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isDelete"), onChange: (e) => {
|
1619
|
+
store.toogleAllPermissionWithType("isDelete", e.target.checked);
|
1620
|
+
} }),
|
1621
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1622
|
+
"X\xF3a",
|
1623
|
+
/* @__PURE__ */ jsx29(IconTrash, { color: "var(--mantine-color-red-8)" })
|
1624
|
+
] })
|
1625
|
+
] }) }),
|
1626
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1627
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isPrint"), onChange: (e) => {
|
1628
|
+
store.toogleAllPermissionWithType("isPrint", e.target.checked);
|
1629
|
+
} }),
|
1630
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1631
|
+
"In",
|
1632
|
+
/* @__PURE__ */ jsx29(IconPrinter, { color: "var(--mantine-color-cyan-8)" })
|
1633
|
+
] })
|
1634
|
+
] }) }),
|
1635
|
+
/* @__PURE__ */ jsx29(Table.Th, { children: /* @__PURE__ */ jsxs21(Flex, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
1636
|
+
/* @__PURE__ */ jsx29(Checkbox, { checked: store.isAllPermission("isExport"), onChange: (e) => {
|
1637
|
+
store.toogleAllPermissionWithType("isExport", e.target.checked);
|
1638
|
+
} }),
|
1639
|
+
/* @__PURE__ */ jsxs21(MyFlexRow, { gap: 3, children: [
|
1640
|
+
"Xu\u1EA5t",
|
1641
|
+
/* @__PURE__ */ jsx29(IconFileExport, { color: "var(--mantine-color-green-8)" })
|
1642
|
+
] })
|
1643
|
+
] }) })
|
1644
|
+
] })
|
1645
|
+
}
|
1646
|
+
),
|
1647
|
+
/* @__PURE__ */ jsx29(Table.Tbody, { bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))", children: (_b = list[0]) == null ? void 0 : _b.map((item, idx) => {
|
1648
|
+
if (item.links == void 0) return /* @__PURE__ */ jsxs21(Table.Tr, { children: [
|
1649
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: item.label }),
|
1650
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) }),
|
1651
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) }),
|
1652
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) }),
|
1653
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) }),
|
1654
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) }),
|
1655
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(Checkbox, {}) }) })
|
1656
|
+
] }, idx);
|
1657
|
+
return /* @__PURE__ */ jsxs21(React.Fragment, { children: [
|
1658
|
+
/* @__PURE__ */ jsx29(Table.Tr, { children: /* @__PURE__ */ jsx29(
|
1659
|
+
Table.Td,
|
1660
|
+
{
|
1661
|
+
colSpan: 7,
|
1662
|
+
bg: OBJECT_COlORS.mantineBackgroundBlueLight,
|
1663
|
+
children: /* @__PURE__ */ jsx29(Text, { fs: "oblique", size: "sm", fw: "bold", children: item.label })
|
1664
|
+
}
|
1665
|
+
) }, item.label),
|
1666
|
+
item.links.map(
|
1667
|
+
(item2, idx2) => {
|
1668
|
+
var _a2, _b2, _c, _d, _e, _f;
|
1669
|
+
return /* @__PURE__ */ jsxs21(Table.Tr, { children: [
|
1670
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: item2.label }),
|
1671
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1672
|
+
Checkbox,
|
1673
|
+
{
|
1674
|
+
checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
|
1675
|
+
onChange: (e) => {
|
1676
|
+
store.updatePermission(item2.pageId, {
|
1677
|
+
isRead: e.target.checked
|
1678
|
+
});
|
1679
|
+
}
|
1680
|
+
}
|
1681
|
+
) }) }),
|
1682
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1683
|
+
Checkbox,
|
1684
|
+
{
|
1685
|
+
checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
|
1686
|
+
onChange: (e) => {
|
1687
|
+
store.updatePermission(item2.pageId, {
|
1688
|
+
isCreate: e.target.checked
|
1689
|
+
});
|
1690
|
+
}
|
1691
|
+
}
|
1692
|
+
) }) }),
|
1693
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1694
|
+
Checkbox,
|
1695
|
+
{
|
1696
|
+
checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
|
1697
|
+
onChange: (e) => {
|
1698
|
+
store.updatePermission(item2.pageId, {
|
1699
|
+
isUpdate: e.target.checked
|
1700
|
+
});
|
1701
|
+
}
|
1702
|
+
}
|
1703
|
+
) }) }),
|
1704
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1705
|
+
Checkbox,
|
1706
|
+
{
|
1707
|
+
checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
|
1708
|
+
onChange: (e) => {
|
1709
|
+
store.updatePermission(item2.pageId, {
|
1710
|
+
isDelete: e.target.checked
|
1711
|
+
});
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
) }) }),
|
1715
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1716
|
+
Checkbox,
|
1717
|
+
{
|
1718
|
+
checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
|
1719
|
+
onChange: (e) => {
|
1720
|
+
store.updatePermission(item2.pageId, {
|
1721
|
+
isPrint: e.target.checked
|
1722
|
+
});
|
1723
|
+
}
|
1724
|
+
}
|
1725
|
+
) }) }),
|
1726
|
+
/* @__PURE__ */ jsx29(Table.Td, { children: /* @__PURE__ */ jsx29(MyCenterFull, { children: /* @__PURE__ */ jsx29(
|
1727
|
+
Checkbox,
|
1728
|
+
{
|
1729
|
+
checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
|
1730
|
+
onChange: (e) => {
|
1731
|
+
store.updatePermission(item2.pageId, {
|
1732
|
+
isExport: e.target.checked
|
1733
|
+
});
|
1734
|
+
}
|
1735
|
+
}
|
1736
|
+
) }) })
|
1737
|
+
] }, idx2);
|
1738
|
+
}
|
1739
|
+
)
|
1740
|
+
] }, idx);
|
1741
|
+
}) })
|
1742
|
+
] }) });
|
1743
|
+
}
|
1744
|
+
function useGetUserPermission() {
|
1745
|
+
const store = useS_core83092();
|
1746
|
+
const query = useQuery8({
|
1747
|
+
queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
|
1748
|
+
queryFn: async () => {
|
1749
|
+
const result = await baseAxios_default.get("/Role/GetRolePermission?roleId=" + store.state.roleId);
|
1750
|
+
const menudataFinal = utils_layout_getItemsWithoutLinks(menuData);
|
1751
|
+
if (result.data.data.length == 0) {
|
1752
|
+
const final = menudataFinal.map((item) => ({
|
1753
|
+
pageId: item.pageId,
|
1754
|
+
isRead: false,
|
1755
|
+
isCreate: false,
|
1756
|
+
isUpdate: false,
|
1757
|
+
isDelete: false,
|
1758
|
+
isExport: false,
|
1759
|
+
isPrint: false
|
1760
|
+
}));
|
1761
|
+
return final.filter((item) => item.pageId != void 0);
|
1762
|
+
}
|
1763
|
+
const menuDataFromAPI = result.data.data;
|
1764
|
+
const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
|
1765
|
+
pageId: item.pageId,
|
1766
|
+
isCreate: item.isCreate || false,
|
1767
|
+
isRead: item.isRead || false,
|
1768
|
+
isUpdate: item.isUpdate || false || false,
|
1769
|
+
isDelete: item.isDelete,
|
1770
|
+
isPrint: item.isPrint || false,
|
1771
|
+
isExport: item.isExport || false
|
1772
|
+
})).filter((item) => item.pageId != void 0);
|
1773
|
+
return mergedArray;
|
1774
|
+
},
|
1775
|
+
enabled: store.state.roleId != 0,
|
1776
|
+
refetchOnWindowFocus: false
|
1777
|
+
});
|
1778
|
+
return query;
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
// src/modules-features/admin/core/core38677/F_core38677.tsx
|
1782
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
1783
|
+
function F_core38677({ menuData: menuData2 }) {
|
1784
|
+
return /* @__PURE__ */ jsxs22(Grid2, { grow: true, children: [
|
1785
|
+
/* @__PURE__ */ jsx30(Grid2.Col, { span: 4, children: /* @__PURE__ */ jsx30(F_core38677_ReadUser, {}) }),
|
1786
|
+
/* @__PURE__ */ jsx30(Grid2.Col, { span: 8, children: /* @__PURE__ */ jsxs22(MyFlexColumn, { h: "80vh", flex: 1, children: [
|
1787
|
+
/* @__PURE__ */ jsx30(ScrollArea2.Autosize, { h: "100%", children: /* @__PURE__ */ jsx30(Paper5, { p: "md", bg: OBJECT_COlORS.mantineBackgroundSecondary, children: /* @__PURE__ */ jsx30(F_core38677_ViewMenuPermissions, { menuData: menuData2 }) }) }),
|
1788
|
+
/* @__PURE__ */ jsx30(F_core38677_Save, {})
|
1789
|
+
] }) })
|
1790
|
+
] });
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
// src/modules-features/admin/core/core40207/F_core40207_Read.tsx
|
1794
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
1795
|
+
import { useMemo as useMemo7 } from "react";
|
1796
|
+
|
1797
|
+
// src/modules-features/admin/core/core40207/F_core40207_Create.tsx
|
1798
|
+
import { FileInput as FileInput3 } from "@mantine/core";
|
1799
|
+
import { useForm as useForm11 } from "@mantine/form";
|
1800
|
+
import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
|
1801
|
+
function F_core40207_Create({ GuidelineTypeId }) {
|
1802
|
+
const form = useForm11({
|
1803
|
+
mode: "uncontrolled",
|
1804
|
+
validate: {
|
1805
|
+
code: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1806
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1807
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
1808
|
+
}
|
1809
|
+
});
|
1810
|
+
return /* @__PURE__ */ jsxs23(
|
1811
|
+
MyButtonCreate,
|
1812
|
+
{
|
1813
|
+
objectName: "v\u0103n b\u1EA3n",
|
1814
|
+
form,
|
1815
|
+
onSubmit: async (values) => {
|
1816
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
1817
|
+
DocumentType: GuidelineTypeId,
|
1818
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
1819
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
1820
|
+
}));
|
1821
|
+
},
|
1822
|
+
children: [
|
1823
|
+
/* @__PURE__ */ jsx31(
|
1824
|
+
MyTextInput,
|
1825
|
+
__spreadValues({
|
1826
|
+
withAsterisk: true,
|
1827
|
+
label: "M\xE3 t\xE0i li\u1EC7u"
|
1828
|
+
}, form.getInputProps("code"))
|
1829
|
+
),
|
1830
|
+
/* @__PURE__ */ jsx31(
|
1831
|
+
MyTextInput,
|
1832
|
+
__spreadValues({
|
1833
|
+
withAsterisk: true,
|
1834
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
1835
|
+
}, form.getInputProps("name"))
|
1836
|
+
),
|
1837
|
+
/* @__PURE__ */ jsx31(
|
1838
|
+
FileInput3,
|
1839
|
+
__spreadValues({
|
1840
|
+
withAsterisk: true,
|
1841
|
+
label: "T\xE0i li\u1EC7u",
|
1842
|
+
placeholder: "T\u1EA3i l\xEAn t\xE0i li\u1EC7u"
|
1843
|
+
}, form.getInputProps("file"))
|
1844
|
+
)
|
1845
|
+
]
|
1846
|
+
}
|
1847
|
+
);
|
1848
|
+
}
|
1849
|
+
|
1850
|
+
// src/modules-features/admin/core/core40207/F_core40207_Delete.tsx
|
1851
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
1852
|
+
function F_core40207_Delete({
|
1853
|
+
id,
|
1854
|
+
contextData
|
1855
|
+
}) {
|
1856
|
+
return /* @__PURE__ */ jsx32(
|
1857
|
+
MyActionIconDelete,
|
1858
|
+
{
|
1859
|
+
contextData,
|
1860
|
+
onSubmit: () => baseAxios_default.post("/Document/delete", { id })
|
1861
|
+
}
|
1862
|
+
);
|
1863
|
+
}
|
1864
|
+
|
1865
|
+
// src/modules-features/admin/core/core40207/F_core40207_Update.tsx
|
1866
|
+
import { FileInput as FileInput4 } from "@mantine/core";
|
1867
|
+
import { useForm as useForm12 } from "@mantine/form";
|
1868
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
1869
|
+
function F_core40207_Update({ values }) {
|
1870
|
+
var _a;
|
1871
|
+
const form = useForm12({
|
1872
|
+
mode: "uncontrolled",
|
1873
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
1874
|
+
file: new File(
|
1875
|
+
[],
|
1876
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
1877
|
+
)
|
1878
|
+
}),
|
1879
|
+
validate: {
|
1880
|
+
code: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1881
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
1882
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
1883
|
+
}
|
1884
|
+
});
|
1885
|
+
return /* @__PURE__ */ jsxs24(
|
1886
|
+
MyActionIconUpdate,
|
1887
|
+
{
|
1888
|
+
form,
|
1889
|
+
onSubmit: async (values2) => {
|
1890
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
1891
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
1892
|
+
}));
|
1893
|
+
},
|
1894
|
+
children: [
|
1895
|
+
/* @__PURE__ */ jsx33(
|
1896
|
+
MyTextInput,
|
1897
|
+
__spreadValues({
|
1898
|
+
withAsterisk: true,
|
1899
|
+
label: "M\xE3 t\xE0i li\u1EC7u"
|
1900
|
+
}, form.getInputProps("code"))
|
1901
|
+
),
|
1902
|
+
/* @__PURE__ */ jsx33(
|
1903
|
+
MyTextInput,
|
1904
|
+
__spreadValues({
|
1905
|
+
withAsterisk: true,
|
1906
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
1907
|
+
}, form.getInputProps("name"))
|
1908
|
+
),
|
1909
|
+
/* @__PURE__ */ jsx33(
|
1910
|
+
FileInput4,
|
1911
|
+
__spreadValues({
|
1912
|
+
withAsterisk: true,
|
1913
|
+
label: "T\xE0i li\u1EC7u",
|
1914
|
+
placeholder: "T\u1EA3i l\xEAn t\xE0i li\u1EC7u"
|
1915
|
+
}, form.getInputProps("file"))
|
1916
|
+
)
|
1917
|
+
]
|
1918
|
+
}
|
1919
|
+
);
|
1920
|
+
}
|
1921
|
+
|
1922
|
+
// src/modules-features/admin/core/core40207/F_core40207_Read.tsx
|
1923
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
1924
|
+
function F_core40207_Read({ GuidelineTypeId }) {
|
1925
|
+
const query = useQuery9({
|
1926
|
+
queryKey: ["F_core40207_Read"],
|
1927
|
+
queryFn: async () => {
|
1928
|
+
var _a;
|
1929
|
+
const result = await baseAxios_default.get(
|
1930
|
+
`/Document/GetByType?documentType=${GuidelineTypeId}`
|
1931
|
+
);
|
1932
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
1933
|
+
}
|
1934
|
+
});
|
1935
|
+
const columns = useMemo7(
|
1936
|
+
() => [
|
1937
|
+
{
|
1938
|
+
header: "M\xE3 t\xE0i li\u1EC7u",
|
1939
|
+
accessorKey: "code"
|
1940
|
+
},
|
1941
|
+
{
|
1942
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
1943
|
+
accessorKey: "name"
|
1944
|
+
},
|
1945
|
+
{
|
1946
|
+
header: "File",
|
1947
|
+
accessorFn: (row) => {
|
1948
|
+
return /* @__PURE__ */ jsx34(MyCenterFull, { children: /* @__PURE__ */ jsx34(MyButtonViewPDF, { id: row.id }) });
|
1949
|
+
}
|
1950
|
+
}
|
1951
|
+
],
|
1952
|
+
[]
|
1953
|
+
);
|
1954
|
+
if (query.isLoading) return "Loading...";
|
1955
|
+
if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
1956
|
+
return /* @__PURE__ */ jsx34(
|
1957
|
+
MyDataTable,
|
1958
|
+
{
|
1959
|
+
columns,
|
1960
|
+
data: query.data,
|
1961
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx34(F_core40207_Create, { GuidelineTypeId }),
|
1962
|
+
renderRowActions: ({ row }) => {
|
1963
|
+
return /* @__PURE__ */ jsxs25(MyCenterFull, { children: [
|
1964
|
+
/* @__PURE__ */ jsx34(F_core40207_Update, { values: row.original }),
|
1965
|
+
/* @__PURE__ */ jsx34(
|
1966
|
+
F_core40207_Delete,
|
1967
|
+
{
|
1968
|
+
id: row.original.id,
|
1969
|
+
contextData: row.original.code
|
1970
|
+
}
|
1971
|
+
)
|
1972
|
+
] });
|
1973
|
+
}
|
1974
|
+
}
|
1975
|
+
);
|
1976
|
+
}
|
1977
|
+
|
1978
|
+
// src/modules-features/admin/core/core40207/F_core40207.tsx
|
1979
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
1980
|
+
function F_core40207({ GuidelineTypeId }) {
|
1981
|
+
return /* @__PURE__ */ jsx35(F_core40207_Read, { GuidelineTypeId });
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
// src/modules-features/admin/core/core47643/F_core47643_Read.tsx
|
1985
|
+
import { Group } from "@mantine/core";
|
1986
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
1987
|
+
import { useMemo as useMemo8 } from "react";
|
1988
|
+
|
1989
|
+
// src/modules-features/admin/core/core47643/F_core47643_Delete.tsx
|
1990
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
1991
|
+
var ENDPOINT = "/Role/Delete";
|
1992
|
+
function F_core47643_Delete({ values }) {
|
1993
|
+
return /* @__PURE__ */ jsx36(
|
1994
|
+
MyActionIconDelete,
|
1995
|
+
{
|
1996
|
+
contextData: values.code,
|
1997
|
+
onSubmit: () => baseAxios_default.post(ENDPOINT, { id: values.id })
|
1998
|
+
}
|
1999
|
+
);
|
2000
|
+
}
|
2001
|
+
|
2002
|
+
// src/modules-features/admin/core/core47643/F_core47643_Form.tsx
|
2003
|
+
import { useForm as useForm13 } from "@mantine/form";
|
2004
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
2005
|
+
function F_core47643_Form({ values }) {
|
2006
|
+
const form = useForm13({
|
2007
|
+
mode: "uncontrolled",
|
2008
|
+
initialValues: values
|
2009
|
+
});
|
2010
|
+
if (values) return /* @__PURE__ */ jsxs26(MyActionIconUpdate, { form, onSubmit: async () => {
|
2011
|
+
return await baseAxios_default.post("/Role/Update", form.getValues());
|
2012
|
+
}, children: [
|
2013
|
+
/* @__PURE__ */ jsx37(MyTextInput, __spreadValues({ readOnly: true, variant: "filled", label: "M\xE3" }, form.getInputProps("code"))),
|
2014
|
+
/* @__PURE__ */ jsx37(MyTextInput, __spreadValues({ label: "Quy\u1EC1n" }, form.getInputProps("name")))
|
2015
|
+
] });
|
2016
|
+
return /* @__PURE__ */ jsxs26(MyButtonCreate, { form, onSubmit: async () => {
|
2017
|
+
return await baseAxios_default.post("/Role/Create", form.getValues());
|
2018
|
+
}, children: [
|
2019
|
+
/* @__PURE__ */ jsx37(MyTextInput, __spreadValues({ label: "M\xE3" }, form.getInputProps("code"))),
|
2020
|
+
/* @__PURE__ */ jsx37(MyTextInput, __spreadValues({ label: "Quy\u1EC1n" }, form.getInputProps("name")))
|
2021
|
+
] });
|
2022
|
+
}
|
2023
|
+
|
2024
|
+
// src/modules-features/admin/core/core47643/F_core47643_Read.tsx
|
2025
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
2026
|
+
function F_core47643_Read() {
|
2027
|
+
const query = useQ_core47643_GetAdminRole();
|
2028
|
+
const columns = useMemo8(() => [
|
2029
|
+
{
|
2030
|
+
header: "M\xE3",
|
2031
|
+
accessorKey: "code"
|
2032
|
+
},
|
2033
|
+
{
|
2034
|
+
header: "Quy\u1EC1n",
|
2035
|
+
accessorKey: "name"
|
2036
|
+
}
|
2037
|
+
], []);
|
2038
|
+
if (query.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
|
2039
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
2040
|
+
return /* @__PURE__ */ jsx38(
|
2041
|
+
MyDataTable,
|
2042
|
+
{
|
2043
|
+
data: query.data,
|
2044
|
+
columns,
|
2045
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx38(Group, { children: /* @__PURE__ */ jsx38(F_core47643_Form, {}) }),
|
2046
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ jsxs27(MyCenterFull, { children: [
|
2047
|
+
/* @__PURE__ */ jsx38(F_core47643_Form, { values: row.original }),
|
2048
|
+
/* @__PURE__ */ jsx38(F_core47643_Delete, { values: row.original })
|
2049
|
+
] })
|
2050
|
+
}
|
2051
|
+
);
|
2052
|
+
}
|
2053
|
+
function useQ_core47643_GetAdminRole() {
|
2054
|
+
const query = useQuery10({
|
2055
|
+
queryKey: ["useQ_core47643_GetAdminRole"],
|
2056
|
+
queryFn: async () => {
|
2057
|
+
const res = await baseAxios_default.get("/Role/GetAdminRole");
|
2058
|
+
return res.data.data;
|
2059
|
+
}
|
2060
|
+
});
|
2061
|
+
return query;
|
2062
|
+
}
|
2063
|
+
|
2064
|
+
// src/modules-features/admin/core/core47643/F_core47643.tsx
|
2065
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
2066
|
+
function F_core47643() {
|
2067
|
+
return /* @__PURE__ */ jsx39(MyPageContent, { title: "Danh m\u1EE5c quy\u1EC1n", canBack: true, children: /* @__PURE__ */ jsx39(F_core47643_Read, {}) });
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
// src/modules-features/admin/core/core60524/F_core60524.tsx
|
2071
|
+
import { useEffect as useEffect5 } from "react";
|
2072
|
+
|
2073
|
+
// src/modules-features/admin/core/core60524/F_core60524_Form.tsx
|
2074
|
+
import { Grid as Grid3, Paper as Paper6 } from "@mantine/core";
|
2075
|
+
import { useForm as useForm14 } from "@mantine/form";
|
2076
|
+
import { useEffect as useEffect4 } from "react";
|
2077
|
+
|
2078
|
+
// src/modules-features/admin/core/core60524/F_core60524_Save.tsx
|
2079
|
+
import { useMutation as useMutation2 } from "@tanstack/react-query";
|
2080
|
+
|
2081
|
+
// src/modules-features/admin/core/core60524/useS_core60524.ts
|
2082
|
+
var useStore2 = createGenericStore({
|
2083
|
+
initialState: {}
|
2084
|
+
});
|
2085
|
+
function useS_core60524() {
|
2086
|
+
const store = useStore2();
|
2087
|
+
return __spreadValues({}, store);
|
2088
|
+
}
|
2089
|
+
|
2090
|
+
// src/modules-features/admin/core/core60524/F_core60524_Save.tsx
|
2091
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
2092
|
+
function F_core60524_Save({
|
2093
|
+
form
|
2094
|
+
}) {
|
2095
|
+
const store = useS_core60524();
|
2096
|
+
const mutation = useMutation2({
|
2097
|
+
mutationFn: async (body) => {
|
2098
|
+
const res = await baseAxios_default.post("/AQ/UpdateAQSetting", body);
|
2099
|
+
return res;
|
2100
|
+
}
|
2101
|
+
});
|
2102
|
+
async function handleSave() {
|
2103
|
+
var _b, _c, _d, _e;
|
2104
|
+
const _a = form.getValues(), { faviconFile, logoFile } = _a, formValues = __objRest(_a, ["faviconFile", "logoFile"]);
|
2105
|
+
mutation.mutate(__spreadProps(__spreadValues({}, formValues), {
|
2106
|
+
logoFileDetail: form.isDirty("logoFileDetail") == false ? {
|
2107
|
+
fileName: (_b = formValues.logoFileDetail) == null ? void 0 : _b.fileName,
|
2108
|
+
fileExtension: (_c = formValues.logoFileDetail) == null ? void 0 : _c.fileExtension,
|
2109
|
+
fileBase64String: ""
|
2110
|
+
} : formValues.logoFileDetail,
|
2111
|
+
faviconFileDetail: form.isDirty("faviconFileDetail") == false ? {
|
2112
|
+
fileName: (_d = formValues.faviconFileDetail) == null ? void 0 : _d.fileName,
|
2113
|
+
fileExtension: (_e = formValues.faviconFileDetail) == null ? void 0 : _e.fileExtension,
|
2114
|
+
fileBase64String: ""
|
2115
|
+
} : formValues.faviconFileDetail,
|
2116
|
+
id: store.state.AQModuleId
|
2117
|
+
}), {
|
2118
|
+
onSuccess: () => {
|
2119
|
+
utils_notification_show({
|
2120
|
+
crudType: "update"
|
2121
|
+
});
|
2122
|
+
}
|
2123
|
+
});
|
2124
|
+
}
|
2125
|
+
return /* @__PURE__ */ jsx40(
|
2126
|
+
MyButton,
|
2127
|
+
{
|
2128
|
+
disabled: !form.isDirty(),
|
2129
|
+
crudType: "save",
|
2130
|
+
onClick: handleSave
|
2131
|
+
}
|
2132
|
+
);
|
2133
|
+
}
|
2134
|
+
|
2135
|
+
// src/modules-features/admin/core/core60524/F_core60524_Form.tsx
|
2136
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
2137
|
+
function F_core60524_Form() {
|
2138
|
+
const query = useQ_AQ_GetAQModule();
|
2139
|
+
const form = useForm14({
|
2140
|
+
mode: "uncontrolled",
|
2141
|
+
validate: {
|
2142
|
+
faviconFileDetail: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2143
|
+
logoFileDetail: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
2144
|
+
}
|
2145
|
+
});
|
2146
|
+
useEffect4(() => {
|
2147
|
+
var _a, _b;
|
2148
|
+
if (!query.data) return;
|
2149
|
+
const values = {
|
2150
|
+
code: query.data.code || "",
|
2151
|
+
name: query.data.name || "",
|
2152
|
+
officelName: query.data.officelName || "",
|
2153
|
+
email: query.data.email || "",
|
2154
|
+
phoneNumber: query.data.phoneNumber || "",
|
2155
|
+
registrationDate: new Date(query.data.registrationDate) || /* @__PURE__ */ new Date(),
|
2156
|
+
limiteDate: new Date(query.data.limiteDate) || /* @__PURE__ */ new Date(),
|
2157
|
+
faviconPath: query.data.faviconPath || "",
|
2158
|
+
logoPath: query.data.logoPath || "",
|
2159
|
+
faviconFile: new File([], (_a = query.data.faviconFileDetail) == null ? void 0 : _a.fileName),
|
2160
|
+
logoFile: new File([], (_b = query.data.logoFileDetail) == null ? void 0 : _b.fileName),
|
2161
|
+
faviconFileDetail: query.data.faviconFileDetail,
|
2162
|
+
logoFileDetail: query.data.logoFileDetail
|
2163
|
+
};
|
2164
|
+
form.setInitialValues(values);
|
2165
|
+
form.setValues(values);
|
2166
|
+
}, [query.data]);
|
2167
|
+
return /* @__PURE__ */ jsxs28(Paper6, { p: "md", children: [
|
2168
|
+
/* @__PURE__ */ jsxs28(Grid3, { children: [
|
2169
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: 5, children: /* @__PURE__ */ jsx41(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("code")), { label: "M\xE3 module", disabled: true })) }),
|
2170
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 7 }, children: /* @__PURE__ */ jsx41(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("name")), { label: "T\xEAn module" })) }),
|
2171
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: 12, children: /* @__PURE__ */ jsx41(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("officelName")), { label: "T\xEAn \u0111\u01A1n v\u1ECB ch\u1EE7 qu\u1EA3n" })) }),
|
2172
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(MyTextInput, __spreadProps(__spreadValues({}, form.getInputProps("email")), { label: "Email" })) }),
|
2173
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(MyTextInput, __spreadProps(__spreadValues({ isPhoneNumber: true }, form.getInputProps("phoneNumber")), { label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" })) }),
|
2174
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(
|
2175
|
+
MyDateInput,
|
2176
|
+
{
|
2177
|
+
value: form.getValues().registrationDate,
|
2178
|
+
onChange: (date) => form.setFieldValue("registrationDate", new Date(date)),
|
2179
|
+
label: "Ng\xE0y \u0111\u0103ng k\xFD"
|
2180
|
+
}
|
2181
|
+
) }),
|
2182
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(
|
2183
|
+
MyDateInput,
|
2184
|
+
{
|
2185
|
+
value: form.getValues().limiteDate,
|
2186
|
+
onChange: (date) => form.setFieldValue("limiteDate", new Date(date)),
|
2187
|
+
label: "Ng\xE0y h\u1EBFt h\u1EA1n"
|
2188
|
+
}
|
2189
|
+
) }),
|
2190
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(
|
2191
|
+
MyFileInput,
|
2192
|
+
{
|
2193
|
+
accept: "image/png,image/jpeg",
|
2194
|
+
label: "Favicon (16px x 16px)",
|
2195
|
+
value: form.getValues().faviconFile,
|
2196
|
+
onChange: async (e) => {
|
2197
|
+
form.setFieldValue("faviconFile", e);
|
2198
|
+
form.setFieldValue("faviconFileDetail", await utils_file_fileToAQDocumentType(e));
|
2199
|
+
}
|
2200
|
+
}
|
2201
|
+
) }),
|
2202
|
+
/* @__PURE__ */ jsx41(Grid3.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ jsx41(
|
2203
|
+
MyFileInput,
|
2204
|
+
{
|
2205
|
+
accept: "image/png,image/jpeg",
|
2206
|
+
label: "Logo (330px x 115px)",
|
2207
|
+
value: form.getValues().logoFile,
|
2208
|
+
onChange: async (e) => {
|
2209
|
+
form.setFieldValue("logoFile", e);
|
2210
|
+
form.setFieldValue("logoFileDetail", await utils_file_fileToAQDocumentType(e));
|
2211
|
+
}
|
2212
|
+
}
|
2213
|
+
) })
|
2214
|
+
] }),
|
2215
|
+
/* @__PURE__ */ jsx41(MyFlexEnd, { children: /* @__PURE__ */ jsx41(F_core60524_Save, { form }) })
|
2216
|
+
] });
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
// src/modules-features/admin/core/core60524/F_core60524.tsx
|
2220
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
2221
|
+
function F_core60524({ AQModuleId }) {
|
2222
|
+
const store = useS_core60524();
|
2223
|
+
useEffect5(() => {
|
2224
|
+
store.setProperty("AQModuleId", AQModuleId);
|
2225
|
+
}, []);
|
2226
|
+
return /* @__PURE__ */ jsx42(F_core60524_Form, {});
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
// src/constants/enum/ENUM_EMAILCONFIG.ts
|
2230
|
+
var ENUM_EMAILCONFIG_MODULE = /* @__PURE__ */ ((ENUM_EMAILCONFIG_MODULE2) => {
|
2231
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["\u0110\xE0o t\u1EA1o"] = 1] = "\u0110\xE0o t\u1EA1o";
|
2232
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Tuy\u1EC3n sinh"] = 2] = "Tuy\u1EC3n sinh";
|
2233
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Sinh vi\xEAn"] = 3] = "Sinh vi\xEAn";
|
2234
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Kh\u1EA3o th\xED"] = 4] = "Kh\u1EA3o th\xED";
|
2235
|
+
return ENUM_EMAILCONFIG_MODULE2;
|
2236
|
+
})(ENUM_EMAILCONFIG_MODULE || {});
|
2237
|
+
|
2238
|
+
// src/modules-features/admin/core/core64229/F_core64229_Read.tsx
|
2239
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
2240
|
+
import { useMemo as useMemo9 } from "react";
|
2241
|
+
|
2242
|
+
// src/modules-features/admin/core/core64229/F_core64229_Form.tsx
|
2243
|
+
import { PasswordInput } from "@mantine/core";
|
2244
|
+
import { useForm as useForm15 } from "@mantine/form";
|
2245
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
2246
|
+
function F_core64229_Form({ values }) {
|
2247
|
+
const form = useForm15({
|
2248
|
+
mode: "uncontrolled",
|
2249
|
+
initialValues: values ? values : {
|
2250
|
+
emailModule: 1 /* Đào tạo */
|
2251
|
+
}
|
2252
|
+
});
|
2253
|
+
function handleSubmit() {
|
2254
|
+
const formValues = form.getValues();
|
2255
|
+
return baseAxios_default.post(`/EmailConfig/${values ? "update" : "create"}`, {
|
2256
|
+
"id": values ? formValues.id : 0,
|
2257
|
+
"code": "string",
|
2258
|
+
"name": "string",
|
2259
|
+
"concurrencyStamp": "string",
|
2260
|
+
"isEnabled": true,
|
2261
|
+
"order": 0,
|
2262
|
+
"emailModule": formValues.emailModule,
|
2263
|
+
"hostMailServer": formValues.hostMailServer,
|
2264
|
+
"outgoingPort": formValues.outgoingPort,
|
2265
|
+
"incomingPort": formValues.incomingPort,
|
2266
|
+
"sll": formValues.sll,
|
2267
|
+
"userName": formValues.userName,
|
2268
|
+
"password": formValues.password
|
2269
|
+
});
|
2270
|
+
}
|
2271
|
+
if (values) return /* @__PURE__ */ jsx43(
|
2272
|
+
MyActionIconUpdate,
|
2273
|
+
{
|
2274
|
+
form,
|
2275
|
+
onSubmit: handleSubmit,
|
2276
|
+
children: /* @__PURE__ */ jsx43(FormInput, { form })
|
2277
|
+
}
|
2278
|
+
);
|
2279
|
+
return /* @__PURE__ */ jsx43(
|
2280
|
+
MyButtonCreate,
|
2281
|
+
{
|
2282
|
+
form,
|
2283
|
+
onSubmit: handleSubmit,
|
2284
|
+
children: /* @__PURE__ */ jsx43(FormInput, { form })
|
2285
|
+
}
|
2286
|
+
);
|
2287
|
+
}
|
2288
|
+
function FormInput({ form }) {
|
2289
|
+
var _a, _b;
|
2290
|
+
return /* @__PURE__ */ jsxs29(MyFlexColumn, { children: [
|
2291
|
+
/* @__PURE__ */ jsx43(
|
2292
|
+
MySelect,
|
2293
|
+
__spreadProps(__spreadValues({
|
2294
|
+
label: "Ph\xE2n h\u1EC7",
|
2295
|
+
data: utils_converter_enumToSelectOptions(ENUM_EMAILCONFIG_MODULE)
|
2296
|
+
}, form.getInputProps("emailModule")), {
|
2297
|
+
value: (_a = form.getValues().emailModule) == null ? void 0 : _a.toString()
|
2298
|
+
})
|
2299
|
+
),
|
2300
|
+
/* @__PURE__ */ jsx43(
|
2301
|
+
MyTextInput,
|
2302
|
+
__spreadValues({
|
2303
|
+
label: "Host mail server"
|
2304
|
+
}, form.getInputProps("hostMailServer"))
|
2305
|
+
),
|
2306
|
+
/* @__PURE__ */ jsx43(
|
2307
|
+
MyNumberInput,
|
2308
|
+
__spreadValues({
|
2309
|
+
label: "Outgoing port"
|
2310
|
+
}, form.getInputProps("outgoingPort"))
|
2311
|
+
),
|
2312
|
+
/* @__PURE__ */ jsx43(
|
2313
|
+
MyNumberInput,
|
2314
|
+
__spreadValues({
|
2315
|
+
label: "Incoming port"
|
2316
|
+
}, form.getInputProps("incomingPort"))
|
2317
|
+
),
|
2318
|
+
/* @__PURE__ */ jsx43(
|
2319
|
+
MySelect,
|
2320
|
+
{
|
2321
|
+
label: "SSL",
|
2322
|
+
data: ["true", "false"],
|
2323
|
+
value: (_b = form.getValues().sll) == null ? void 0 : _b.toString(),
|
2324
|
+
onChange: (e) => form.setFieldValue("sll", e == "true" ? true : false)
|
2325
|
+
}
|
2326
|
+
),
|
2327
|
+
/* @__PURE__ */ jsx43(
|
2328
|
+
MyTextInput,
|
2329
|
+
__spreadValues({
|
2330
|
+
label: "Username"
|
2331
|
+
}, form.getInputProps("userName"))
|
2332
|
+
),
|
2333
|
+
/* @__PURE__ */ jsx43(
|
2334
|
+
PasswordInput,
|
2335
|
+
__spreadValues({
|
2336
|
+
label: "Password",
|
2337
|
+
placeholder: "Nh\u1EADp password"
|
2338
|
+
}, form.getInputProps("password"))
|
2339
|
+
)
|
2340
|
+
] });
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
// src/modules-features/admin/core/core64229/F_core64229_Delete.tsx
|
2344
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
2345
|
+
function F_core64229_Delete({ values }) {
|
2346
|
+
return /* @__PURE__ */ jsx44(
|
2347
|
+
MyActionIconDelete,
|
2348
|
+
{
|
2349
|
+
contextData: values == null ? void 0 : values.code,
|
2350
|
+
onSubmit: () => {
|
2351
|
+
return baseAxios_default.post("/EmailConfig/Delete", {
|
2352
|
+
id: values == null ? void 0 : values.id
|
2353
|
+
});
|
2354
|
+
}
|
2355
|
+
}
|
2356
|
+
);
|
2357
|
+
}
|
2358
|
+
|
2359
|
+
// src/modules-features/admin/core/core64229/F_core64229_Read.tsx
|
2360
|
+
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
2361
|
+
function F_core64229_Read() {
|
2362
|
+
const query = useQuery11({
|
2363
|
+
queryKey: ["F_core64229_Read"],
|
2364
|
+
queryFn: async () => {
|
2365
|
+
const res = await baseAxios_default.get("/EmailConfig/GetAll");
|
2366
|
+
return res.data.data;
|
2367
|
+
}
|
2368
|
+
});
|
2369
|
+
const columns = useMemo9(() => [
|
2370
|
+
{
|
2371
|
+
header: "Ph\xE2n h\u1EC7",
|
2372
|
+
accessorFn: (row) => {
|
2373
|
+
return ENUM_EMAILCONFIG_MODULE[row.emailModule];
|
2374
|
+
}
|
2375
|
+
},
|
2376
|
+
{
|
2377
|
+
header: "Host mail server",
|
2378
|
+
accessorKey: "hostMailServer"
|
2379
|
+
},
|
2380
|
+
{
|
2381
|
+
header: "Outgoing port",
|
2382
|
+
accessorKey: "outgoingPort"
|
2383
|
+
},
|
2384
|
+
{
|
2385
|
+
header: "Incoming port",
|
2386
|
+
accessorKey: "incomingPort"
|
2387
|
+
},
|
2388
|
+
{
|
2389
|
+
header: "SSL",
|
2390
|
+
accessorFn: (row) => {
|
2391
|
+
var _a;
|
2392
|
+
return (_a = row.sll) == null ? void 0 : _a.toString();
|
2393
|
+
}
|
2394
|
+
},
|
2395
|
+
{
|
2396
|
+
header: "Username",
|
2397
|
+
accessorKey: "userName"
|
2398
|
+
},
|
2399
|
+
{
|
2400
|
+
header: "Password",
|
2401
|
+
accessorFn: () => "*******"
|
2402
|
+
}
|
2403
|
+
], []);
|
2404
|
+
if (query.isLoading) return "\u0110ang t\u1EA3i";
|
2405
|
+
return /* @__PURE__ */ jsx45(
|
2406
|
+
MyDataTable,
|
2407
|
+
{
|
2408
|
+
columns,
|
2409
|
+
data: query.data,
|
2410
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx45(F_core64229_Form, {}),
|
2411
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ jsxs30(MyCenterFull, { children: [
|
2412
|
+
/* @__PURE__ */ jsx45(F_core64229_Form, { values: row.original }),
|
2413
|
+
/* @__PURE__ */ jsx45(F_core64229_Delete, { values: row.original })
|
2414
|
+
] })
|
2415
|
+
}
|
2416
|
+
);
|
2417
|
+
}
|
2418
|
+
|
2419
|
+
// src/modules-features/admin/core/core64229/F_core64229.tsx
|
2420
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
2421
|
+
function F_core64229() {
|
2422
|
+
return /* @__PURE__ */ jsx46(F_core64229_Read, {});
|
2423
|
+
}
|
2424
|
+
|
2425
|
+
// src/modules-features/admin/core/core71678/F_core71678_Read.tsx
|
2426
|
+
import { Button as Button2, Group as Group3 } from "@mantine/core";
|
2427
|
+
import { IconShield } from "@tabler/icons-react";
|
2428
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
2429
|
+
import { useRouter } from "next/navigation";
|
2430
|
+
import { useMemo as useMemo11, useState as useState5 } from "react";
|
2431
|
+
|
2432
|
+
// src/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx
|
2433
|
+
import { Button, Fieldset, Group as Group2, Table as Table2 } from "@mantine/core";
|
2434
|
+
import { useDisclosure } from "@mantine/hooks";
|
2435
|
+
import { useMutation as useMutation3, useQuery as useQuery12, useQueryClient } from "@tanstack/react-query";
|
2436
|
+
import { useEffect as useEffect6, useMemo as useMemo10, useState as useState4 } from "react";
|
2437
|
+
import { jsx as jsx47, jsxs as jsxs31 } from "react/jsx-runtime";
|
2438
|
+
function F_core71678_ChangePermission({ user }) {
|
2439
|
+
const disc = useDisclosure();
|
2440
|
+
const queryClient = useQueryClient();
|
2441
|
+
const [rowSelection, setRowSelection] = useState4({});
|
2442
|
+
const rowSelect = useState4();
|
2443
|
+
const query = useQuery12({
|
2444
|
+
queryKey: [`F1_1ChangePermission`],
|
2445
|
+
queryFn: async () => {
|
2446
|
+
const response = await baseAxios_default.get("/Role/GetAdminRole");
|
2447
|
+
return response.data.data;
|
2448
|
+
}
|
2449
|
+
});
|
2450
|
+
const mutation = useMutation3({
|
2451
|
+
mutationFn: async (roleIds) => {
|
2452
|
+
const res = await baseAxios_default.post("/Role/AddUser?userId=" + user.id, roleIds);
|
2453
|
+
return res;
|
2454
|
+
}
|
2455
|
+
});
|
2456
|
+
const permissionColumns = useMemo10(
|
2457
|
+
() => [
|
2458
|
+
{
|
2459
|
+
header: "Quy\u1EC1n",
|
2460
|
+
accessorKey: "name"
|
2461
|
+
}
|
2462
|
+
],
|
2463
|
+
[]
|
2464
|
+
);
|
2465
|
+
function handleSave() {
|
2466
|
+
mutation.mutate(Object.keys(rowSelection).map(Number), {
|
2467
|
+
onSuccess: () => {
|
2468
|
+
utils_notification_show({ crudType: "update" });
|
2469
|
+
disc[1].close();
|
2470
|
+
queryClient.invalidateQueries();
|
2471
|
+
}
|
2472
|
+
});
|
2473
|
+
}
|
2474
|
+
useEffect6(() => {
|
2475
|
+
var _a;
|
2476
|
+
const result = (_a = user.roles) == null ? void 0 : _a.reduce((acc, item) => {
|
2477
|
+
if (item.id !== void 0) {
|
2478
|
+
acc[item.id] = true;
|
2479
|
+
}
|
2480
|
+
return acc;
|
2481
|
+
}, {});
|
2482
|
+
setRowSelection(result);
|
2483
|
+
}, []);
|
2484
|
+
return /* @__PURE__ */ jsxs31(MyButtonModal, { modalSize: "xl", disclosure: disc, title: "Ch\u1ECDn quy\u1EC1n cho ng\u01B0\u1EDDi d\xF9ng", label: "S\u1EEDa quy\u1EC1n", children: [
|
2485
|
+
/* @__PURE__ */ jsx47(
|
2486
|
+
Table2,
|
2487
|
+
{
|
2488
|
+
w: "100%",
|
2489
|
+
variant: "vertical",
|
2490
|
+
layout: "fixed",
|
2491
|
+
children: /* @__PURE__ */ jsxs31(Table2.Tbody, { children: [
|
2492
|
+
/* @__PURE__ */ jsxs31(Table2.Tr, { children: [
|
2493
|
+
/* @__PURE__ */ jsx47(Table2.Th, { w: 160, children: "H\u1ECD v\xE0 t\xEAn:" }),
|
2494
|
+
/* @__PURE__ */ jsx47(Table2.Td, { children: user.fullName })
|
2495
|
+
] }),
|
2496
|
+
/* @__PURE__ */ jsxs31(Table2.Tr, { children: [
|
2497
|
+
/* @__PURE__ */ jsx47(Table2.Th, { children: "T\xEAn \u0111\u0103ng nh\u1EADp:" }),
|
2498
|
+
/* @__PURE__ */ jsx47(Table2.Td, { children: user.userName })
|
2499
|
+
] }),
|
2500
|
+
/* @__PURE__ */ jsxs31(Table2.Tr, { children: [
|
2501
|
+
/* @__PURE__ */ jsx47(Table2.Th, { children: "Email:" }),
|
2502
|
+
/* @__PURE__ */ jsx47(Table2.Td, { children: user.email })
|
2503
|
+
] })
|
2504
|
+
] })
|
2505
|
+
}
|
2506
|
+
),
|
2507
|
+
query.isLoading && "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...",
|
2508
|
+
query.isError && "L\u1ED7i khi t\u1EA3i d\u1EEF li\u1EC7u...",
|
2509
|
+
/* @__PURE__ */ jsx47(Fieldset, { legend: "Ch\u1ECDn quy\u1EC1n", children: /* @__PURE__ */ jsx47(
|
2510
|
+
MyDataTable,
|
2511
|
+
{
|
2512
|
+
enableRowSelection: true,
|
2513
|
+
onRowSelectionChange: setRowSelection,
|
2514
|
+
state: { rowSelection },
|
2515
|
+
setSelectedRow: rowSelect[1],
|
2516
|
+
getRowId: (originalRow) => {
|
2517
|
+
var _a;
|
2518
|
+
return (_a = originalRow.id) == null ? void 0 : _a.toString();
|
2519
|
+
},
|
2520
|
+
initialState: {
|
2521
|
+
density: "xs",
|
2522
|
+
pagination: { pageIndex: 0, pageSize: 10 },
|
2523
|
+
columnPinning: { right: ["mrt-row-actions"] },
|
2524
|
+
columnVisibility: {
|
2525
|
+
nguoiCapNhat: false,
|
2526
|
+
ngayCapNhat: false
|
2527
|
+
}
|
2528
|
+
},
|
2529
|
+
columns: permissionColumns,
|
2530
|
+
data: query.data
|
2531
|
+
}
|
2532
|
+
) }),
|
2533
|
+
/* @__PURE__ */ jsx47(Group2, { justify: "flex-end", mt: 24, children: /* @__PURE__ */ jsx47(Button, { onClick: handleSave, children: "L\u01B0u" }) })
|
2534
|
+
] });
|
2535
|
+
}
|
2536
|
+
|
2537
|
+
// src/modules-features/admin/core/core71678/F_core71678_Create.tsx
|
2538
|
+
import { useForm as useForm16 } from "@mantine/form";
|
2539
|
+
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
2540
|
+
var ENDPOINT2 = "/Account/create";
|
2541
|
+
function F_core71678_Create() {
|
2542
|
+
const form = useForm16({
|
2543
|
+
initialValues: {
|
2544
|
+
fullName: "",
|
2545
|
+
code: "",
|
2546
|
+
userName: "",
|
2547
|
+
password: "",
|
2548
|
+
email: "",
|
2549
|
+
phoneNumber: ""
|
2550
|
+
},
|
2551
|
+
validate: {
|
2552
|
+
email: (value) => U0MyValidateEmail(value)
|
2553
|
+
}
|
2554
|
+
});
|
2555
|
+
async function handleSubmit() {
|
2556
|
+
return await baseAxios_default.post(ENDPOINT2, __spreadProps(__spreadValues({}, form.getValues()), {
|
2557
|
+
passwordHash: "",
|
2558
|
+
id: 0,
|
2559
|
+
address: "",
|
2560
|
+
concurrencyStamp: "",
|
2561
|
+
isBlocked: false,
|
2562
|
+
isEnabled: true,
|
2563
|
+
workingUnitId: void 0,
|
2564
|
+
AQModuleId: 1002
|
2565
|
+
}));
|
2566
|
+
}
|
2567
|
+
return /* @__PURE__ */ jsxs32(MyButtonCreate, { form, onSubmit: handleSubmit, objectName: "ng\u01B0\u1EDDi d\xF9ng", children: [
|
2568
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "M\xE3 t\xE0i kho\u1EA3n" }, form.getInputProps("code"))),
|
2569
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i kho\u1EA3n" }, form.getInputProps("userName"))),
|
2570
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "M\u1EADt kh\u1EA9u" }, form.getInputProps("password"))),
|
2571
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))),
|
2572
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))),
|
2573
|
+
/* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber")))
|
2574
|
+
] });
|
2575
|
+
}
|
2576
|
+
|
2577
|
+
// src/modules-features/admin/core/core71678/F_core71678_Delete.tsx
|
2578
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
2579
|
+
var ENDPOINT3 = "/Account/delete";
|
2580
|
+
function F_core71678_Delete({ id, code }) {
|
2581
|
+
return /* @__PURE__ */ jsx49(
|
2582
|
+
MyActionIconDelete,
|
2583
|
+
{
|
2584
|
+
contextData: code,
|
2585
|
+
onSubmit: async () => await baseAxios_default.post(ENDPOINT3, { id })
|
2586
|
+
}
|
2587
|
+
);
|
2588
|
+
}
|
2589
|
+
|
2590
|
+
// src/modules-features/admin/core/core71678/F_core71678_Update.tsx
|
2591
|
+
import { useForm as useForm17 } from "@mantine/form";
|
2592
|
+
import { useEffect as useEffect7 } from "react";
|
2593
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
2594
|
+
function F_core71678_Update({ user }) {
|
2595
|
+
const form = useForm17({
|
2596
|
+
initialValues: user
|
2597
|
+
});
|
2598
|
+
useEffect7(() => {
|
2599
|
+
console.log(form.values);
|
2600
|
+
}, [form.values]);
|
2601
|
+
return /* @__PURE__ */ jsx50(MyActionIconUpdate, { form, onSubmit: async (values) => {
|
2602
|
+
return await baseAxios_default.post(
|
2603
|
+
"/Account/update",
|
2604
|
+
__spreadProps(__spreadValues({}, values), {
|
2605
|
+
id: values.id,
|
2606
|
+
address: "",
|
2607
|
+
concurrencyStamp: "",
|
2608
|
+
isBlocked: false,
|
2609
|
+
isEnabled: true,
|
2610
|
+
workingUnitId: null
|
2611
|
+
})
|
2612
|
+
);
|
2613
|
+
}, children: /* @__PURE__ */ jsxs33(MyFlexColumn, { children: [
|
2614
|
+
/* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ disabled: true, label: "M\xE3 t\xE0i kho\u1EA3n" }, form.getInputProps("code"))),
|
2615
|
+
/* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ disabled: true, label: "T\xEAn t\xE0i kho\u1EA3n" }, form.getInputProps("userName"))),
|
2616
|
+
/* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))),
|
2617
|
+
/* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))),
|
2618
|
+
/* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber")))
|
2619
|
+
] }) });
|
2620
|
+
}
|
2621
|
+
|
2622
|
+
// src/modules-features/admin/core/core71678/F_core71678_Read.tsx
|
2623
|
+
import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
2624
|
+
var ENDPOINT4 = "/Account/GetAdminAccount";
|
2625
|
+
function F_core71678_Read() {
|
2626
|
+
const router = useRouter();
|
2627
|
+
const [rowSelection, setRowSelection] = useState5({});
|
2628
|
+
const AllUserQuery = useQuery13({
|
2629
|
+
queryKey: ["F_core71678_Read"],
|
2630
|
+
queryFn: async () => {
|
2631
|
+
var _a;
|
2632
|
+
const result = await baseAxios_default.get(
|
2633
|
+
ENDPOINT4,
|
2634
|
+
{ params: { page: 5, pageNumber: 1 } }
|
2635
|
+
);
|
2636
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
2637
|
+
}
|
2638
|
+
});
|
2639
|
+
const columns = useMemo11(
|
2640
|
+
() => [
|
2641
|
+
{
|
2642
|
+
header: "T\xEAn t\xE0i kho\u1EA3n",
|
2643
|
+
accessorKey: "userName"
|
2644
|
+
},
|
2645
|
+
{
|
2646
|
+
header: "H\u1ECD v\xE0 t\xEAn",
|
2647
|
+
accessorKey: "fullName"
|
2648
|
+
},
|
2649
|
+
{
|
2650
|
+
header: "Email",
|
2651
|
+
accessorKey: "email"
|
2652
|
+
},
|
2653
|
+
{
|
2654
|
+
header: "Quy\u1EC1n",
|
2655
|
+
accessorFn: (row) => /* @__PURE__ */ jsx51(F_core71678_ChangePermission, { user: row })
|
2656
|
+
}
|
2657
|
+
],
|
2658
|
+
[]
|
2659
|
+
);
|
2660
|
+
if (AllUserQuery.isLoading) return "Loading...";
|
2661
|
+
return /* @__PURE__ */ jsx51(
|
2662
|
+
MyDataTable,
|
2663
|
+
{
|
2664
|
+
columns,
|
2665
|
+
data: AllUserQuery.data,
|
2666
|
+
renderTopToolbarCustomActions: () => {
|
2667
|
+
return /* @__PURE__ */ jsxs34(Group3, { children: [
|
2668
|
+
/* @__PURE__ */ jsx51(F_core71678_Create, {}),
|
2669
|
+
/* @__PURE__ */ jsx51(
|
2670
|
+
Button2,
|
2671
|
+
{
|
2672
|
+
color: "violet",
|
2673
|
+
leftSection: /* @__PURE__ */ jsx51(IconShield, {}),
|
2674
|
+
onClick: () => {
|
2675
|
+
router.push("core47643");
|
2676
|
+
},
|
2677
|
+
children: "Danh m\u1EE5c quy\u1EC1n"
|
2678
|
+
}
|
2679
|
+
)
|
2680
|
+
] });
|
2681
|
+
},
|
2682
|
+
renderRowActions: ({ row }) => {
|
2683
|
+
return /* @__PURE__ */ jsxs34(MyCenterFull, { children: [
|
2684
|
+
/* @__PURE__ */ jsx51(F_core71678_Update, { user: row.original }),
|
2685
|
+
/* @__PURE__ */ jsx51(F_core71678_Delete, { id: row.original.id, code: row.original.code })
|
2686
|
+
] });
|
2687
|
+
}
|
2688
|
+
}
|
2689
|
+
);
|
2690
|
+
}
|
2691
|
+
|
2692
|
+
// src/modules-features/admin/core/core71678/F_core71678.tsx
|
2693
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
2694
|
+
function F_core71678() {
|
2695
|
+
return /* @__PURE__ */ jsx52(F_core71678_Read, {});
|
2696
|
+
}
|
2697
|
+
|
2698
|
+
// src/modules-features/admin/core/core76318/F_core76318_Read.tsx
|
2699
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
2700
|
+
import { useMemo as useMemo12 } from "react";
|
2701
|
+
|
2702
|
+
// src/modules-features/admin/core/core76318/F_core76318_Create.tsx
|
2703
|
+
import { FileInput as FileInput5 } from "@mantine/core";
|
2704
|
+
import { useForm as useForm18 } from "@mantine/form";
|
2705
|
+
import { jsx as jsx53, jsxs as jsxs35 } from "react/jsx-runtime";
|
2706
|
+
function F_core76318_Create({ SecurityTypeId }) {
|
2707
|
+
const form = useForm18({
|
2708
|
+
mode: "uncontrolled",
|
2709
|
+
validate: {
|
2710
|
+
decisionCode: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2711
|
+
promulgateDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2712
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2713
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
2714
|
+
}
|
2715
|
+
});
|
2716
|
+
return /* @__PURE__ */ jsxs35(
|
2717
|
+
MyButtonCreate,
|
2718
|
+
{
|
2719
|
+
objectName: "v\u0103n b\u1EA3n",
|
2720
|
+
form,
|
2721
|
+
onSubmit: async (values) => {
|
2722
|
+
return await baseAxios_default.post("/Document/create", __spreadProps(__spreadValues({}, values), {
|
2723
|
+
DocumentType: SecurityTypeId,
|
2724
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
2725
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
2726
|
+
}));
|
2727
|
+
},
|
2728
|
+
children: [
|
2729
|
+
/* @__PURE__ */ jsx53(
|
2730
|
+
MyTextInput,
|
2731
|
+
__spreadValues({
|
2732
|
+
withAsterisk: true,
|
2733
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
2734
|
+
}, form.getInputProps("decisionCode"))
|
2735
|
+
),
|
2736
|
+
/* @__PURE__ */ jsx53(
|
2737
|
+
MyDateInput,
|
2738
|
+
__spreadValues({
|
2739
|
+
withAsterisk: true,
|
2740
|
+
label: "Ng\xE0y ban h\xE0nh"
|
2741
|
+
}, form.getInputProps("promulgateDate"))
|
2742
|
+
),
|
2743
|
+
/* @__PURE__ */ jsx53(
|
2744
|
+
MyTextInput,
|
2745
|
+
__spreadValues({
|
2746
|
+
withAsterisk: true,
|
2747
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
2748
|
+
}, form.getInputProps("name"))
|
2749
|
+
),
|
2750
|
+
/* @__PURE__ */ jsx53(
|
2751
|
+
FileInput5,
|
2752
|
+
__spreadValues({
|
2753
|
+
withAsterisk: true,
|
2754
|
+
placeholder: "T\u1EA3i l\xEAn t\xE0i li\u1EC7u",
|
2755
|
+
label: "T\xE0i li\u1EC7u"
|
2756
|
+
}, form.getInputProps("file"))
|
2757
|
+
)
|
2758
|
+
]
|
2759
|
+
}
|
2760
|
+
);
|
2761
|
+
}
|
2762
|
+
|
2763
|
+
// src/modules-features/admin/core/core76318/F_core76318_Delete.tsx
|
2764
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
2765
|
+
function F_core76318_Delete({
|
2766
|
+
id,
|
2767
|
+
contextData
|
2768
|
+
}) {
|
2769
|
+
return /* @__PURE__ */ jsx54(
|
2770
|
+
MyActionIconDelete,
|
2771
|
+
{
|
2772
|
+
contextData,
|
2773
|
+
onSubmit: () => baseAxios_default.post("/Document/delete", { id })
|
2774
|
+
}
|
2775
|
+
);
|
2776
|
+
}
|
2777
|
+
|
2778
|
+
// src/modules-features/admin/core/core76318/F_core76318_Update.tsx
|
2779
|
+
import { FileInput as FileInput6, TextInput as TextInput2 } from "@mantine/core";
|
2780
|
+
import { useForm as useForm19 } from "@mantine/form";
|
2781
|
+
import { jsx as jsx55, jsxs as jsxs36 } from "react/jsx-runtime";
|
2782
|
+
function F_core76318_Update({ values }) {
|
2783
|
+
var _a;
|
2784
|
+
const form = useForm19({
|
2785
|
+
mode: "uncontrolled",
|
2786
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
2787
|
+
file: new File(
|
2788
|
+
[],
|
2789
|
+
(_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]
|
2790
|
+
),
|
2791
|
+
promulgateDate: new Date(values.promulgateDate)
|
2792
|
+
}),
|
2793
|
+
validate: {
|
2794
|
+
decisionCode: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2795
|
+
promulgateDate: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2796
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
2797
|
+
file: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
2798
|
+
}
|
2799
|
+
});
|
2800
|
+
return /* @__PURE__ */ jsxs36(
|
2801
|
+
MyActionIconUpdate,
|
2802
|
+
{
|
2803
|
+
form,
|
2804
|
+
onSubmit: async (values2) => {
|
2805
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
2806
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
2807
|
+
}));
|
2808
|
+
},
|
2809
|
+
children: [
|
2810
|
+
/* @__PURE__ */ jsx55(
|
2811
|
+
TextInput2,
|
2812
|
+
__spreadValues({
|
2813
|
+
withAsterisk: true,
|
2814
|
+
label: "S\u1ED1 quy \u0111\u1ECBnh"
|
2815
|
+
}, form.getInputProps("decisionCode"))
|
2816
|
+
),
|
2817
|
+
/* @__PURE__ */ jsx55(
|
2818
|
+
MyDateInput,
|
2819
|
+
__spreadValues({
|
2820
|
+
withAsterisk: true,
|
2821
|
+
label: "Ng\xE0y ban h\xE0nh"
|
2822
|
+
}, form.getInputProps("promulgateDate"))
|
2823
|
+
),
|
2824
|
+
/* @__PURE__ */ jsx55(
|
2825
|
+
TextInput2,
|
2826
|
+
__spreadValues({
|
2827
|
+
withAsterisk: true,
|
2828
|
+
label: "T\xEAn t\xE0i li\u1EC7u"
|
2829
|
+
}, form.getInputProps("name"))
|
2830
|
+
),
|
2831
|
+
/* @__PURE__ */ jsx55(
|
2832
|
+
FileInput6,
|
2833
|
+
__spreadValues({
|
2834
|
+
withAsterisk: true,
|
2835
|
+
label: "Ch\u1ECDn file"
|
2836
|
+
}, form.getInputProps("file"))
|
2837
|
+
)
|
2838
|
+
]
|
2839
|
+
}
|
2840
|
+
);
|
2841
|
+
}
|
2842
|
+
|
2843
|
+
// src/modules-features/admin/core/core76318/F_core76318_Read.tsx
|
2844
|
+
import { jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
|
2845
|
+
function F_core76318_Read({ SecurityTypeId }) {
|
2846
|
+
const query = useQuery14({
|
2847
|
+
queryKey: ["F_core76318_Read"],
|
2848
|
+
queryFn: async () => {
|
2849
|
+
var _a;
|
2850
|
+
const result = await baseAxios_default.get(
|
2851
|
+
`/Document/GetByType?documentType=${SecurityTypeId}`
|
2852
|
+
);
|
2853
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
2854
|
+
}
|
2855
|
+
});
|
2856
|
+
const columns = useMemo12(
|
2857
|
+
() => [
|
2858
|
+
{
|
2859
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
2860
|
+
accessorKey: "decisionCode"
|
2861
|
+
},
|
2862
|
+
{
|
2863
|
+
header: "Ng\xE0y ban h\xE0nh",
|
2864
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
2865
|
+
},
|
2866
|
+
{
|
2867
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
2868
|
+
accessorKey: "name"
|
2869
|
+
},
|
2870
|
+
{
|
2871
|
+
header: "File",
|
2872
|
+
accessorFn: (row) => {
|
2873
|
+
return /* @__PURE__ */ jsx56(MyCenterFull, { children: /* @__PURE__ */ jsx56(MyButtonViewPDF, { id: row.id }) });
|
2874
|
+
}
|
2875
|
+
}
|
2876
|
+
],
|
2877
|
+
[]
|
2878
|
+
);
|
2879
|
+
if (query.isLoading) return "Loading...";
|
2880
|
+
if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
2881
|
+
return /* @__PURE__ */ jsx56(
|
2882
|
+
MyDataTable,
|
2883
|
+
{
|
2884
|
+
columns,
|
2885
|
+
data: query.data,
|
2886
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx56(F_core76318_Create, { SecurityTypeId }),
|
2887
|
+
renderRowActions: ({ row }) => {
|
2888
|
+
var _a;
|
2889
|
+
return /* @__PURE__ */ jsxs37(MyCenterFull, { children: [
|
2890
|
+
/* @__PURE__ */ jsx56(F_core76318_Update, { values: row.original }),
|
2891
|
+
/* @__PURE__ */ jsx56(
|
2892
|
+
F_core76318_Delete,
|
2893
|
+
{
|
2894
|
+
id: row.original.id,
|
2895
|
+
contextData: (_a = row.original.decisionCode) == null ? void 0 : _a.toString()
|
2896
|
+
}
|
2897
|
+
)
|
2898
|
+
] });
|
2899
|
+
}
|
2900
|
+
}
|
2901
|
+
);
|
2902
|
+
}
|
2903
|
+
|
2904
|
+
// src/modules-features/admin/core/core76318/F_core76318.tsx
|
2905
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
2906
|
+
function F_core76318({ SecurityTypeId }) {
|
2907
|
+
return /* @__PURE__ */ jsx57(F_core76318_Read, { SecurityTypeId });
|
2908
|
+
}
|
2909
|
+
|
2910
|
+
// src/modules-features/admin/core/core83092/F_core83092.tsx
|
2911
|
+
import { Grid as Grid4, Paper as Paper7, ScrollArea as ScrollArea4 } from "@mantine/core";
|
2912
|
+
|
2913
|
+
// src/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx
|
2914
|
+
import { Container as Container2 } from "@mantine/core";
|
2915
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
2916
|
+
import { useEffect as useEffect8, useMemo as useMemo13, useState as useState6 } from "react";
|
2917
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
2918
|
+
function F_core83092_ReadUser() {
|
2919
|
+
const store = useS_core83092();
|
2920
|
+
const query = useQ_core83092_Account_GetAdminAccount();
|
2921
|
+
const [rowSelection, setRowSelection] = useState6({});
|
2922
|
+
const columns = useMemo13(
|
2923
|
+
() => [
|
2924
|
+
{
|
2925
|
+
header: "H\u1ECD v\xE0 t\xEAn",
|
2926
|
+
accessorKey: "fullName",
|
2927
|
+
size: 60
|
2928
|
+
},
|
2929
|
+
{
|
2930
|
+
header: "Email",
|
2931
|
+
accessorKey: "email"
|
2932
|
+
}
|
2933
|
+
],
|
2934
|
+
[]
|
2935
|
+
);
|
2936
|
+
const handleRowClick = (rowId) => {
|
2937
|
+
setRowSelection({ [rowId]: true });
|
2938
|
+
store.setProperty("roleId", parseInt(rowId));
|
2939
|
+
};
|
2940
|
+
useEffect8(() => {
|
2941
|
+
if (store.state.roleId == 0) return;
|
2942
|
+
setRowSelection({ [store.state.roleId]: true });
|
2943
|
+
}, [store.state.roleId]);
|
2944
|
+
useEffect8(() => {
|
2945
|
+
if (!query.data) return;
|
2946
|
+
store.setProperty("roleId", query.data[0].id);
|
2947
|
+
}, [query.data]);
|
2948
|
+
if (query.isLoading) return "Loading...";
|
2949
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
2950
|
+
return /* @__PURE__ */ jsx58(Container2, { fluid: true, w: "100%", children: /* @__PURE__ */ jsx58(
|
2951
|
+
MyDataTable,
|
2952
|
+
{
|
2953
|
+
columns,
|
2954
|
+
data: query.data,
|
2955
|
+
getRowId: (row) => {
|
2956
|
+
var _a;
|
2957
|
+
return (_a = row.id) == null ? void 0 : _a.toString();
|
2958
|
+
},
|
2959
|
+
mantineTableBodyRowProps: ({ row }) => ({
|
2960
|
+
onClick: () => handleRowClick(row.id),
|
2961
|
+
style: {
|
2962
|
+
cursor: "pointer",
|
2963
|
+
backgroundColor: rowSelection[row.id] ? "#d0e7ff" : "transparent"
|
2964
|
+
}
|
2965
|
+
}),
|
2966
|
+
state: rowSelection
|
2967
|
+
}
|
2968
|
+
) });
|
2969
|
+
}
|
2970
|
+
function useQ_core83092_Account_GetAdminAccount() {
|
2971
|
+
const query = useQuery15({
|
2972
|
+
queryKey: ["useQ_core83092_Account_GetAdminAccount"],
|
2973
|
+
queryFn: async () => {
|
2974
|
+
var _a;
|
2975
|
+
const result = await baseAxios_default.get(`/Account/GetAdminAccount`, { params: { page: 5, pageNumber: 1 } });
|
2976
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
2977
|
+
},
|
2978
|
+
refetchOnWindowFocus: false
|
2979
|
+
});
|
2980
|
+
return query;
|
2981
|
+
}
|
2982
|
+
|
2983
|
+
// src/modules-features/admin/core/core83092/F_core83092_Save.tsx
|
2984
|
+
import { useMutation as useMutation4 } from "@tanstack/react-query";
|
2985
|
+
import { useEffect as useEffect9, useState as useState7 } from "react";
|
2986
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
2987
|
+
function F_core83092_Save() {
|
2988
|
+
const store = useS_core83092();
|
2989
|
+
const disable = useState7(false);
|
2990
|
+
const mutation = useMutation4({
|
2991
|
+
mutationFn: async (body) => {
|
2992
|
+
const res = await baseAxios_default.put("/Role/UpdateUserPermission", body);
|
2993
|
+
return res;
|
2994
|
+
}
|
2995
|
+
});
|
2996
|
+
function handleSave() {
|
2997
|
+
mutation.mutate({
|
2998
|
+
pagePermissions: store.state.rolePermissions,
|
2999
|
+
userId: store.state.roleId
|
3000
|
+
}, {
|
3001
|
+
onSuccess: () => {
|
3002
|
+
utils_notification_show({
|
3003
|
+
crudType: "update"
|
3004
|
+
});
|
3005
|
+
}
|
3006
|
+
});
|
3007
|
+
}
|
3008
|
+
useEffect9(() => {
|
3009
|
+
if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
|
3010
|
+
disable[1](true);
|
3011
|
+
return;
|
3012
|
+
}
|
3013
|
+
disable[1](false);
|
3014
|
+
}, [store.state.rolePermissions]);
|
3015
|
+
return /* @__PURE__ */ jsx59(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
3016
|
+
}
|
3017
|
+
|
3018
|
+
// src/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx
|
3019
|
+
import { Checkbox as Checkbox2, Flex as Flex2, ScrollArea as ScrollArea3, Table as Table3, Text as Text2 } from "@mantine/core";
|
3020
|
+
import { IconEdit as IconEdit2, IconEyeUp as IconEyeUp2, IconFileExport as IconFileExport2, IconPlus as IconPlus2, IconPrinter as IconPrinter2, IconTrash as IconTrash2 } from "@tabler/icons-react";
|
3021
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
3022
|
+
import React3, { useEffect as useEffect10, useState as useState8 } from "react";
|
3023
|
+
import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
|
3024
|
+
var title2 = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
|
3025
|
+
function F_core83092_ViewMenuPermissions({ menuData: menuData2 }) {
|
3026
|
+
var _a, _b;
|
3027
|
+
const store = useS_core83092();
|
3028
|
+
const query = useGetUserPermission2({ menuData: menuData2 });
|
3029
|
+
const list = useState8([]);
|
3030
|
+
useEffect10(() => {
|
3031
|
+
list[1](groupToTwoLevels(menuData2));
|
3032
|
+
}, []);
|
3033
|
+
useEffect10(() => {
|
3034
|
+
if (!query.data) return;
|
3035
|
+
store.setProperty("rolePermissions", query.data);
|
3036
|
+
}, [query.data]);
|
3037
|
+
if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
|
3038
|
+
return /* @__PURE__ */ jsx60(ScrollArea3.Autosize, { h: "70vh", children: /* @__PURE__ */ jsxs38(Table3, { children: [
|
3039
|
+
/* @__PURE__ */ jsx60(
|
3040
|
+
Table3.Thead,
|
3041
|
+
{
|
3042
|
+
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
|
3043
|
+
style: {
|
3044
|
+
position: "sticky",
|
3045
|
+
top: 0,
|
3046
|
+
zIndex: 1,
|
3047
|
+
boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
|
3048
|
+
border: "1px solid var(--mantine-color-gray-4)"
|
3049
|
+
},
|
3050
|
+
children: /* @__PURE__ */ jsxs38(Table3.Tr, { children: [
|
3051
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: title2 }),
|
3052
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3053
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isRead"), onChange: (e) => {
|
3054
|
+
store.toogleAllPermissionWithType("isRead", e.target.checked);
|
3055
|
+
} }),
|
3056
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3057
|
+
"Xem",
|
3058
|
+
/* @__PURE__ */ jsx60(IconEyeUp2, { color: "gray" })
|
3059
|
+
] })
|
3060
|
+
] }) }),
|
3061
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3062
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isCreate"), onChange: (e) => {
|
3063
|
+
store.toogleAllPermissionWithType("isCreate", e.target.checked);
|
3064
|
+
} }),
|
3065
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3066
|
+
"Th\xEAm",
|
3067
|
+
/* @__PURE__ */ jsx60(IconPlus2, { color: "blue" })
|
3068
|
+
] })
|
3069
|
+
] }) }),
|
3070
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3071
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isUpdate"), onChange: (e) => {
|
3072
|
+
store.toogleAllPermissionWithType("isUpdate", e.target.checked);
|
3073
|
+
} }),
|
3074
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3075
|
+
"S\u1EEDa",
|
3076
|
+
/* @__PURE__ */ jsx60(IconEdit2, { color: "var(--mantine-color-yellow-8)" })
|
3077
|
+
] })
|
3078
|
+
] }) }),
|
3079
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3080
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isDelete"), onChange: (e) => {
|
3081
|
+
store.toogleAllPermissionWithType("isDelete", e.target.checked);
|
3082
|
+
} }),
|
3083
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3084
|
+
"X\xF3a",
|
3085
|
+
/* @__PURE__ */ jsx60(IconTrash2, { color: "var(--mantine-color-red-8)" })
|
3086
|
+
] })
|
3087
|
+
] }) }),
|
3088
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3089
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isPrint"), onChange: (e) => {
|
3090
|
+
store.toogleAllPermissionWithType("isPrint", e.target.checked);
|
3091
|
+
} }),
|
3092
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3093
|
+
"In",
|
3094
|
+
/* @__PURE__ */ jsx60(IconPrinter2, { color: "var(--mantine-color-cyan-8)" })
|
3095
|
+
] })
|
3096
|
+
] }) }),
|
3097
|
+
/* @__PURE__ */ jsx60(Table3.Th, { children: /* @__PURE__ */ jsxs38(Flex2, { gap: 3, direction: "column", justify: "center", align: "center", children: [
|
3098
|
+
/* @__PURE__ */ jsx60(Checkbox2, { checked: store.isAllPermission("isExport"), onChange: (e) => {
|
3099
|
+
store.toogleAllPermissionWithType("isExport", e.target.checked);
|
3100
|
+
} }),
|
3101
|
+
/* @__PURE__ */ jsxs38(MyFlexRow, { gap: 3, children: [
|
3102
|
+
"Xu\u1EA5t",
|
3103
|
+
/* @__PURE__ */ jsx60(IconFileExport2, { color: "var(--mantine-color-green-8)" })
|
3104
|
+
] })
|
3105
|
+
] }) })
|
3106
|
+
] })
|
3107
|
+
}
|
3108
|
+
),
|
3109
|
+
/* @__PURE__ */ jsx60(Table3.Tbody, { bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))", children: (_b = list[0]) == null ? void 0 : _b.map((item, idx) => {
|
3110
|
+
if (item.links == void 0) return /* @__PURE__ */ jsxs38(Table3.Tr, { children: [
|
3111
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: item.label }),
|
3112
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) }),
|
3113
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) }),
|
3114
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) }),
|
3115
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) }),
|
3116
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) }),
|
3117
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(Checkbox2, {}) }) })
|
3118
|
+
] }, idx);
|
3119
|
+
return /* @__PURE__ */ jsxs38(React3.Fragment, { children: [
|
3120
|
+
/* @__PURE__ */ jsx60(Table3.Tr, { children: /* @__PURE__ */ jsx60(
|
3121
|
+
Table3.Td,
|
3122
|
+
{
|
3123
|
+
colSpan: 7,
|
3124
|
+
bg: OBJECT_COlORS.mantineBackgroundBlueLight,
|
3125
|
+
children: /* @__PURE__ */ jsx60(Text2, { fs: "oblique", size: "sm", fw: "bold", children: item.label })
|
3126
|
+
}
|
3127
|
+
) }, item.label),
|
3128
|
+
item.links.map(
|
3129
|
+
(item2, idx2) => {
|
3130
|
+
var _a2, _b2, _c, _d, _e, _f;
|
3131
|
+
return /* @__PURE__ */ jsxs38(Table3.Tr, { children: [
|
3132
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: item2.label }),
|
3133
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3134
|
+
Checkbox2,
|
3135
|
+
{
|
3136
|
+
checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
|
3137
|
+
onChange: (e) => {
|
3138
|
+
store.updatePermission(item2.pageId, {
|
3139
|
+
isRead: e.target.checked
|
3140
|
+
});
|
3141
|
+
}
|
3142
|
+
}
|
3143
|
+
) }) }),
|
3144
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3145
|
+
Checkbox2,
|
3146
|
+
{
|
3147
|
+
checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
|
3148
|
+
onChange: (e) => {
|
3149
|
+
store.updatePermission(item2.pageId, {
|
3150
|
+
isCreate: e.target.checked
|
3151
|
+
});
|
3152
|
+
}
|
3153
|
+
}
|
3154
|
+
) }) }),
|
3155
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3156
|
+
Checkbox2,
|
3157
|
+
{
|
3158
|
+
checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
|
3159
|
+
onChange: (e) => {
|
3160
|
+
store.updatePermission(item2.pageId, {
|
3161
|
+
isUpdate: e.target.checked
|
3162
|
+
});
|
3163
|
+
}
|
3164
|
+
}
|
3165
|
+
) }) }),
|
3166
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3167
|
+
Checkbox2,
|
3168
|
+
{
|
3169
|
+
checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
|
3170
|
+
onChange: (e) => {
|
3171
|
+
store.updatePermission(item2.pageId, {
|
3172
|
+
isDelete: e.target.checked
|
3173
|
+
});
|
3174
|
+
}
|
3175
|
+
}
|
3176
|
+
) }) }),
|
3177
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3178
|
+
Checkbox2,
|
3179
|
+
{
|
3180
|
+
checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
|
3181
|
+
onChange: (e) => {
|
3182
|
+
store.updatePermission(item2.pageId, {
|
3183
|
+
isPrint: e.target.checked
|
3184
|
+
});
|
3185
|
+
}
|
3186
|
+
}
|
3187
|
+
) }) }),
|
3188
|
+
/* @__PURE__ */ jsx60(Table3.Td, { children: /* @__PURE__ */ jsx60(MyCenterFull, { children: /* @__PURE__ */ jsx60(
|
3189
|
+
Checkbox2,
|
3190
|
+
{
|
3191
|
+
checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
|
3192
|
+
onChange: (e) => {
|
3193
|
+
store.updatePermission(item2.pageId, {
|
3194
|
+
isExport: e.target.checked
|
3195
|
+
});
|
3196
|
+
}
|
3197
|
+
}
|
3198
|
+
) }) })
|
3199
|
+
] }, idx2);
|
3200
|
+
}
|
3201
|
+
)
|
3202
|
+
] }, idx);
|
3203
|
+
}) })
|
3204
|
+
] }) });
|
3205
|
+
}
|
3206
|
+
function useGetUserPermission2({ menuData: menuData2 }) {
|
3207
|
+
const store = useS_core83092();
|
3208
|
+
const query = useQuery16({
|
3209
|
+
queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
|
3210
|
+
queryFn: async () => {
|
3211
|
+
const result = await baseAxios_default.get("/Role/GetUserPermission?userId=" + store.state.roleId);
|
3212
|
+
const menudataFinal = utils_layout_getItemsWithoutLinks(menuData2);
|
3213
|
+
if (result.data.data.length == 0) {
|
3214
|
+
const final = menudataFinal.map((item) => ({
|
3215
|
+
pageId: item.pageId,
|
3216
|
+
isRead: false,
|
3217
|
+
isCreate: false,
|
3218
|
+
isUpdate: false,
|
3219
|
+
isDelete: false,
|
3220
|
+
isExport: false,
|
3221
|
+
isPrint: false
|
3222
|
+
}));
|
3223
|
+
return final.filter((item) => item.pageId != void 0);
|
3224
|
+
}
|
3225
|
+
const menuDataFromAPI = result.data.data;
|
3226
|
+
const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
|
3227
|
+
pageId: item.pageId,
|
3228
|
+
isCreate: item.isCreate || false,
|
3229
|
+
isRead: item.isRead || false,
|
3230
|
+
isUpdate: item.isUpdate || false || false,
|
3231
|
+
isDelete: item.isDelete,
|
3232
|
+
isPrint: item.isPrint || false,
|
3233
|
+
isExport: item.isExport || false
|
3234
|
+
})).filter((item) => item.pageId != void 0);
|
3235
|
+
return mergedArray;
|
3236
|
+
},
|
3237
|
+
enabled: store.state.roleId != 0,
|
3238
|
+
refetchOnWindowFocus: false
|
3239
|
+
});
|
3240
|
+
return query;
|
3241
|
+
}
|
3242
|
+
|
3243
|
+
// src/modules-features/admin/core/core83092/F_core83092.tsx
|
3244
|
+
import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
|
3245
|
+
function F_core83092({ menuData: menuData2 }) {
|
3246
|
+
return /* @__PURE__ */ jsxs39(Grid4, { grow: true, children: [
|
3247
|
+
/* @__PURE__ */ jsx61(Grid4.Col, { span: 4, children: /* @__PURE__ */ jsx61(F_core83092_ReadUser, {}) }),
|
3248
|
+
/* @__PURE__ */ jsx61(Grid4.Col, { span: 8, children: /* @__PURE__ */ jsxs39(MyFlexColumn, { h: "80vh", flex: 1, children: [
|
3249
|
+
/* @__PURE__ */ jsx61(ScrollArea4.Autosize, { h: "100%", children: /* @__PURE__ */ jsx61(Paper7, { p: "md", bg: OBJECT_COlORS.mantineBackgroundSecondary, children: /* @__PURE__ */ jsx61(F_core83092_ViewMenuPermissions, { menuData: menuData2 }) }) }),
|
3250
|
+
/* @__PURE__ */ jsx61(F_core83092_Save, {})
|
3251
|
+
] }) })
|
3252
|
+
] });
|
3253
|
+
}
|
3254
|
+
|
3255
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx
|
3256
|
+
import { BarChart } from "@mantine/charts";
|
3257
|
+
import { Group as Group4, Paper as Paper8, Text as Text3, useMantineColorScheme } from "@mantine/core";
|
3258
|
+
import { Fragment, jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
|
3259
|
+
|
3260
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx
|
3261
|
+
import { BarChart as BarChart2 } from "@mantine/charts";
|
3262
|
+
import { Group as Group5, Paper as Paper9, Text as Text4, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
|
3263
|
+
import { Fragment as Fragment2, jsx as jsx63, jsxs as jsxs41 } from "react/jsx-runtime";
|
3264
|
+
|
3265
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx
|
3266
|
+
import { BarChart as BarChart3 } from "@mantine/charts";
|
3267
|
+
import { Group as Group6, Paper as Paper10, Text as Text5, useMantineColorScheme as useMantineColorScheme3 } from "@mantine/core";
|
3268
|
+
import { Fragment as Fragment3, jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
|
3269
|
+
|
3270
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx
|
3271
|
+
import { BarChart as BarChart4 } from "@mantine/charts";
|
3272
|
+
import { Group as Group7, Paper as Paper11, Text as Text6, useMantineColorScheme as useMantineColorScheme4 } from "@mantine/core";
|
3273
|
+
import { Fragment as Fragment4, jsx as jsx65, jsxs as jsxs43 } from "react/jsx-runtime";
|
3274
|
+
|
3275
|
+
// src/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx
|
3276
|
+
import { BarChart as BarChart5 } from "@mantine/charts";
|
3277
|
+
import { Group as Group8, Paper as Paper12, Text as Text7, useMantineColorScheme as useMantineColorScheme5 } from "@mantine/core";
|
3278
|
+
import { jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
|
3279
|
+
|
3280
|
+
// src/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx
|
3281
|
+
import { BarChart as BarChart6 } from "@mantine/charts";
|
3282
|
+
import { Group as Group9, Paper as Paper13, Text as Text8, useMantineColorScheme as useMantineColorScheme6 } from "@mantine/core";
|
3283
|
+
import { jsx as jsx67, jsxs as jsxs45 } from "react/jsx-runtime";
|
3284
|
+
|
3285
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx
|
3286
|
+
import { LineChart } from "@mantine/charts";
|
3287
|
+
import { Group as Group10, Paper as Paper14, Text as Text9 } from "@mantine/core";
|
3288
|
+
import { Fragment as Fragment5, jsx as jsx68, jsxs as jsxs46 } from "react/jsx-runtime";
|
3289
|
+
|
3290
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx
|
3291
|
+
import { LineChart as LineChart2 } from "@mantine/charts";
|
3292
|
+
import { Group as Group11, Paper as Paper15, Text as Text10 } from "@mantine/core";
|
3293
|
+
import { Fragment as Fragment6, jsx as jsx69, jsxs as jsxs47 } from "react/jsx-runtime";
|
3294
|
+
|
3295
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx
|
3296
|
+
import { LineChart as LineChart3 } from "@mantine/charts";
|
3297
|
+
import { Group as Group12, Paper as Paper16, Text as Text11 } from "@mantine/core";
|
3298
|
+
import { Fragment as Fragment7, jsx as jsx70, jsxs as jsxs48 } from "react/jsx-runtime";
|
3299
|
+
|
3300
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx
|
3301
|
+
import { LineChart as LineChart4 } from "@mantine/charts";
|
3302
|
+
import { Group as Group13, Paper as Paper17, Text as Text12 } from "@mantine/core";
|
3303
|
+
import { Fragment as Fragment8, jsx as jsx71, jsxs as jsxs49 } from "react/jsx-runtime";
|
3304
|
+
|
3305
|
+
// src/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx
|
3306
|
+
import { Center, Progress, Space as Space5, Text as Text13 } from "@mantine/core";
|
3307
|
+
import { PieChart } from "@mantine/charts";
|
3308
|
+
import { useMemo as useMemo14 } from "react";
|
3309
|
+
import { Fragment as Fragment9, jsx as jsx72, jsxs as jsxs50 } from "react/jsx-runtime";
|
3310
|
+
function getRandomColor(seed) {
|
3311
|
+
const random = Math.sin(seed) * 1e4;
|
3312
|
+
const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
|
3313
|
+
return color;
|
3314
|
+
}
|
3315
|
+
var data_used_discountCode = [
|
3316
|
+
{ name: "DSC01", value: 54, color: getRandomColor(1) },
|
3317
|
+
{ name: "DSC02", value: 32, color: getRandomColor(2) },
|
3318
|
+
{ name: "DSC03", value: 5, color: getRandomColor(3) },
|
3319
|
+
{ name: "DSC04", value: 20, color: getRandomColor(4) },
|
3320
|
+
{ name: "DSC05", value: 12, color: getRandomColor(5) },
|
3321
|
+
{ name: "DSC06", value: 45, color: getRandomColor(6) },
|
3322
|
+
{ name: "DSC07", value: 23, color: getRandomColor(7) },
|
3323
|
+
{ name: "DSC08", value: 34, color: getRandomColor(8) },
|
3324
|
+
{ name: "DSC09", value: 29, color: getRandomColor(9) },
|
3325
|
+
{ name: "DSC10", value: 18, color: getRandomColor(10) },
|
3326
|
+
{ name: "DSC11", value: 37, color: getRandomColor(11) },
|
3327
|
+
{ name: "DSC12", value: 22, color: getRandomColor(12) },
|
3328
|
+
{ name: "DSC13", value: 41, color: getRandomColor(13) },
|
3329
|
+
{ name: "DSC14", value: 27, color: getRandomColor(14) },
|
3330
|
+
{ name: "DSC15", value: 33, color: getRandomColor(15) },
|
3331
|
+
{ name: "DSC16", value: 19, color: getRandomColor(16) },
|
3332
|
+
{ name: "DSC17", value: 25, color: getRandomColor(17) },
|
3333
|
+
{ name: "DSC18", value: 30, color: getRandomColor(18) },
|
3334
|
+
{ name: "DSC19", value: 21, color: getRandomColor(19) },
|
3335
|
+
{ name: "DSC20", value: 26, color: getRandomColor(20) }
|
3336
|
+
];
|
3337
|
+
var mockData = [
|
3338
|
+
{
|
3339
|
+
code: "DSC01",
|
3340
|
+
name: "Discount Code 1",
|
3341
|
+
total: 100,
|
3342
|
+
used: 54,
|
3343
|
+
color: getRandomColor(1)
|
3344
|
+
},
|
3345
|
+
{
|
3346
|
+
code: "DSC02",
|
3347
|
+
name: "Discount Code 2",
|
3348
|
+
total: 150,
|
3349
|
+
used: 32,
|
3350
|
+
color: getRandomColor(2)
|
3351
|
+
},
|
3352
|
+
{
|
3353
|
+
code: "DSC03",
|
3354
|
+
name: "Discount Code 3",
|
3355
|
+
total: 10,
|
3356
|
+
used: 5,
|
3357
|
+
color: getRandomColor(3)
|
3358
|
+
},
|
3359
|
+
{
|
3360
|
+
code: "DSC04",
|
3361
|
+
name: "Discount Code 4",
|
3362
|
+
total: 100,
|
3363
|
+
used: 20,
|
3364
|
+
color: getRandomColor(4)
|
3365
|
+
},
|
3366
|
+
{
|
3367
|
+
code: "DSC05",
|
3368
|
+
name: "Discount Code 5",
|
3369
|
+
total: 100,
|
3370
|
+
used: 12,
|
3371
|
+
color: getRandomColor(5)
|
3372
|
+
},
|
3373
|
+
{
|
3374
|
+
code: "DSC06",
|
3375
|
+
name: "Discount Code 6",
|
3376
|
+
total: 100,
|
3377
|
+
used: 45,
|
3378
|
+
color: getRandomColor(6)
|
3379
|
+
},
|
3380
|
+
{
|
3381
|
+
code: "DSC07",
|
3382
|
+
name: "Discount Code 7",
|
3383
|
+
total: 100,
|
3384
|
+
used: 23,
|
3385
|
+
color: getRandomColor(7)
|
3386
|
+
},
|
3387
|
+
{
|
3388
|
+
code: "DSC08",
|
3389
|
+
name: "Discount Code 8",
|
3390
|
+
total: 100,
|
3391
|
+
used: 34,
|
3392
|
+
color: getRandomColor(8)
|
3393
|
+
},
|
3394
|
+
{
|
3395
|
+
code: "DSC09",
|
3396
|
+
name: "Discount Code 9",
|
3397
|
+
total: 100,
|
3398
|
+
used: 29,
|
3399
|
+
color: getRandomColor(9)
|
3400
|
+
},
|
3401
|
+
{
|
3402
|
+
code: "DSC10",
|
3403
|
+
name: "Discount Code 10",
|
3404
|
+
total: 100,
|
3405
|
+
used: 18,
|
3406
|
+
color: getRandomColor(10)
|
3407
|
+
},
|
3408
|
+
{
|
3409
|
+
code: "DSC11",
|
3410
|
+
name: "Discount Code 11",
|
3411
|
+
total: 100,
|
3412
|
+
used: 37,
|
3413
|
+
color: getRandomColor(11)
|
3414
|
+
},
|
3415
|
+
{
|
3416
|
+
code: "DSC12",
|
3417
|
+
name: "Discount Code 12",
|
3418
|
+
total: 100,
|
3419
|
+
used: 22,
|
3420
|
+
color: getRandomColor(12)
|
3421
|
+
},
|
3422
|
+
{
|
3423
|
+
code: "DSC13",
|
3424
|
+
name: "Discount Code 13",
|
3425
|
+
total: 100,
|
3426
|
+
used: 41,
|
3427
|
+
color: getRandomColor(13)
|
3428
|
+
},
|
3429
|
+
{
|
3430
|
+
code: "DSC14",
|
3431
|
+
name: "Discount Code 14",
|
3432
|
+
total: 100,
|
3433
|
+
used: 27,
|
3434
|
+
color: getRandomColor(14)
|
3435
|
+
},
|
3436
|
+
{
|
3437
|
+
code: "DSC15",
|
3438
|
+
name: "Discount Code 15",
|
3439
|
+
total: 100,
|
3440
|
+
used: 33,
|
3441
|
+
color: getRandomColor(15)
|
3442
|
+
},
|
3443
|
+
{
|
3444
|
+
code: "DSC16",
|
3445
|
+
name: "Discount Code 16",
|
3446
|
+
total: 100,
|
3447
|
+
used: 19,
|
3448
|
+
color: getRandomColor(16)
|
3449
|
+
},
|
3450
|
+
{
|
3451
|
+
code: "DSC17",
|
3452
|
+
name: "Discount Code 17",
|
3453
|
+
total: 100,
|
3454
|
+
used: 25,
|
3455
|
+
color: getRandomColor(17)
|
3456
|
+
},
|
3457
|
+
{
|
3458
|
+
code: "DSC18",
|
3459
|
+
name: "Discount Code 18",
|
3460
|
+
total: 100,
|
3461
|
+
used: 30,
|
3462
|
+
color: getRandomColor(18)
|
3463
|
+
},
|
3464
|
+
{
|
3465
|
+
code: "DSC19",
|
3466
|
+
name: "Discount Code 19",
|
3467
|
+
total: 100,
|
3468
|
+
used: 21,
|
3469
|
+
color: getRandomColor(19)
|
3470
|
+
},
|
3471
|
+
{
|
3472
|
+
code: "DSC20",
|
3473
|
+
name: "Discount Code 20",
|
3474
|
+
total: 100,
|
3475
|
+
used: 26,
|
3476
|
+
color: getRandomColor(20)
|
3477
|
+
}
|
3478
|
+
];
|
3479
|
+
function PieChart_DiscountUsedPercentage() {
|
3480
|
+
const totalDisountCode = mockData.reduce((acc, cur) => acc + cur.used, 0);
|
3481
|
+
const columns = useMemo14(
|
3482
|
+
() => [
|
3483
|
+
{
|
3484
|
+
header: "M\xE0u",
|
3485
|
+
accessorKey: "color",
|
3486
|
+
accessorFn(originalRow) {
|
3487
|
+
return /* @__PURE__ */ jsx72("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
|
3488
|
+
},
|
3489
|
+
minSize: 30,
|
3490
|
+
maxSize: 30
|
3491
|
+
},
|
3492
|
+
{
|
3493
|
+
header: "M\xE3",
|
3494
|
+
accessorKey: "code",
|
3495
|
+
minSize: 20,
|
3496
|
+
maxSize: 20
|
3497
|
+
},
|
3498
|
+
{
|
3499
|
+
header: "%",
|
3500
|
+
accessorKey: "used",
|
3501
|
+
accessorFn(originalRow) {
|
3502
|
+
return /* @__PURE__ */ jsx72(Fragment9, { children: /* @__PURE__ */ jsx72(Center, { children: /* @__PURE__ */ jsxs50(Text13, { children: [
|
3503
|
+
(originalRow.used / totalDisountCode * 100).toFixed(0),
|
3504
|
+
"%"
|
3505
|
+
] }) }) });
|
3506
|
+
},
|
3507
|
+
minSize: 64,
|
3508
|
+
maxSize: 64
|
3509
|
+
},
|
3510
|
+
{
|
3511
|
+
header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
|
3512
|
+
accessorKey: "value",
|
3513
|
+
accessorFn(originalRow) {
|
3514
|
+
return originalRow.used;
|
3515
|
+
},
|
3516
|
+
Cell: ({ row }) => {
|
3517
|
+
return /* @__PURE__ */ jsxs50(Fragment9, { children: [
|
3518
|
+
/* @__PURE__ */ jsx72(Center, { children: /* @__PURE__ */ jsxs50(Text13, { children: [
|
3519
|
+
"\u0110\xE3 s\u1EED d\u1EE5ng: ",
|
3520
|
+
/* @__PURE__ */ jsxs50("strong", { children: [
|
3521
|
+
row.original.used,
|
3522
|
+
" / ",
|
3523
|
+
row.original.total
|
3524
|
+
] }),
|
3525
|
+
" - (",
|
3526
|
+
(row.original.used / row.original.total * 100).toFixed(2),
|
3527
|
+
"%)"
|
3528
|
+
] }) }),
|
3529
|
+
/* @__PURE__ */ jsx72(Progress, { color: "yellow", radius: "xs", size: "lg", value: row.original.used / row.original.total * 100 })
|
3530
|
+
] });
|
3531
|
+
},
|
3532
|
+
minSize: 50,
|
3533
|
+
maxSize: 50
|
3534
|
+
}
|
3535
|
+
],
|
3536
|
+
[]
|
3537
|
+
);
|
3538
|
+
return /* @__PURE__ */ jsx72(Fragment9, { children: /* @__PURE__ */ jsxs50(MyFlexColumn, { children: [
|
3539
|
+
/* @__PURE__ */ jsx72(Text13, { mb: "20", children: "Bi\u1EC3u \u0111\u1ED3 ph\u1EA7n tr\u0103m s\u1EED d\u1EE5ng chi\u1EBFt kh\u1EA5u h\u1ECDc vi\xEAn trong 60 ng\xE0y qua" }),
|
3540
|
+
/* @__PURE__ */ jsx72(Center, { children: /* @__PURE__ */ jsx72(
|
3541
|
+
PieChart,
|
3542
|
+
{
|
3543
|
+
startAngle: 90,
|
3544
|
+
endAngle: -270,
|
3545
|
+
strokeWidth: 0,
|
3546
|
+
withLabelsLine: true,
|
3547
|
+
labelsPosition: "outside",
|
3548
|
+
withLabels: true,
|
3549
|
+
labelsType: "percent",
|
3550
|
+
data: data_used_discountCode
|
3551
|
+
}
|
3552
|
+
) }),
|
3553
|
+
/* @__PURE__ */ jsx72(Space5, { mt: 5 }),
|
3554
|
+
/* @__PURE__ */ jsx72(
|
3555
|
+
MyDataTable,
|
3556
|
+
{
|
3557
|
+
data: mockData,
|
3558
|
+
columns,
|
3559
|
+
initialState: {
|
3560
|
+
density: "xs",
|
3561
|
+
pagination: { pageIndex: 0, pageSize: 5 }
|
3562
|
+
}
|
3563
|
+
}
|
3564
|
+
)
|
3565
|
+
] }) });
|
3566
|
+
}
|
3567
|
+
|
3568
|
+
// src/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx
|
3569
|
+
import { Center as Center2, Progress as Progress2, Space as Space6, Text as Text14 } from "@mantine/core";
|
3570
|
+
import { PieChart as PieChart2 } from "@mantine/charts";
|
3571
|
+
import { useMemo as useMemo15 } from "react";
|
3572
|
+
import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
|
3573
|
+
function getRandomColor2(seed) {
|
3574
|
+
const random = Math.sin(seed) * 1e4;
|
3575
|
+
const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
|
3576
|
+
return color;
|
3577
|
+
}
|
3578
|
+
var data_used_discountCode2 = [
|
3579
|
+
{ name: "VOU01", value: 124, color: getRandomColor2(1) },
|
3580
|
+
{ name: "VOU02", value: 34, color: getRandomColor2(2) },
|
3581
|
+
{ name: "VOU03", value: 23, color: getRandomColor2(3) },
|
3582
|
+
{ name: "VOU04", value: 34, color: getRandomColor2(4) },
|
3583
|
+
{ name: "VOU05", value: 46, color: getRandomColor2(5) },
|
3584
|
+
{ name: "VOU06", value: 123, color: getRandomColor2(6) },
|
3585
|
+
{ name: "VOU07", value: 87, color: getRandomColor2(7) },
|
3586
|
+
{ name: "VOU08", value: 25, color: getRandomColor2(8) },
|
3587
|
+
{ name: "VOU09", value: 34, color: getRandomColor2(9) },
|
3588
|
+
{ name: "VOU10", value: 67, color: getRandomColor2(10) },
|
3589
|
+
{ name: "VOU11", value: 23, color: getRandomColor2(11) },
|
3590
|
+
{ name: "VOU12", value: 98, color: getRandomColor2(12) },
|
3591
|
+
{ name: "VOU13", value: 54, color: getRandomColor2(13) },
|
3592
|
+
{ name: "VOU14", value: 27, color: getRandomColor2(14) },
|
3593
|
+
{ name: "VOU15", value: 3, color: getRandomColor2(15) },
|
3594
|
+
{ name: "VOU16", value: 56, color: getRandomColor2(16) },
|
3595
|
+
{ name: "VOU17", value: 85, color: getRandomColor2(17) },
|
3596
|
+
{ name: "VOU18", value: 45, color: getRandomColor2(18) },
|
3597
|
+
{ name: "VOU19", value: 64, color: getRandomColor2(19) },
|
3598
|
+
{ name: "VOU20", value: 12, color: getRandomColor2(20) }
|
3599
|
+
];
|
3600
|
+
var mockData2 = [
|
3601
|
+
{
|
3602
|
+
code: "VOU01",
|
3603
|
+
name: "Voucher Code 1",
|
3604
|
+
total: 150,
|
3605
|
+
used: 124,
|
3606
|
+
color: getRandomColor2(1)
|
3607
|
+
},
|
3608
|
+
{
|
3609
|
+
code: "VOU02",
|
3610
|
+
name: "Voucher Code 2",
|
3611
|
+
total: 150,
|
3612
|
+
used: 34,
|
3613
|
+
color: getRandomColor2(2)
|
3614
|
+
},
|
3615
|
+
{
|
3616
|
+
code: "VOU03",
|
3617
|
+
name: "Voucher Code 3",
|
3618
|
+
total: 50,
|
3619
|
+
used: 23,
|
3620
|
+
color: getRandomColor2(3)
|
3621
|
+
},
|
3622
|
+
{
|
3623
|
+
code: "VOU04",
|
3624
|
+
name: "Voucher Code 4",
|
3625
|
+
total: 100,
|
3626
|
+
used: 34,
|
3627
|
+
color: getRandomColor2(4)
|
3628
|
+
},
|
3629
|
+
{
|
3630
|
+
code: "VOU05",
|
3631
|
+
name: "Voucher Code 5",
|
3632
|
+
total: 100,
|
3633
|
+
used: 46,
|
3634
|
+
color: getRandomColor2(5)
|
3635
|
+
},
|
3636
|
+
{
|
3637
|
+
code: "VOU06",
|
3638
|
+
name: "Voucher Code 6",
|
3639
|
+
total: 130,
|
3640
|
+
used: 123,
|
3641
|
+
color: getRandomColor2(6)
|
3642
|
+
},
|
3643
|
+
{
|
3644
|
+
code: "VOU07",
|
3645
|
+
name: "Voucher Code 7",
|
3646
|
+
total: 100,
|
3647
|
+
used: 87,
|
3648
|
+
color: getRandomColor2(7)
|
3649
|
+
},
|
3650
|
+
{
|
3651
|
+
code: "VOU08",
|
3652
|
+
name: "Voucher Code 8",
|
3653
|
+
total: 100,
|
3654
|
+
used: 25,
|
3655
|
+
color: getRandomColor2(8)
|
3656
|
+
},
|
3657
|
+
{
|
3658
|
+
code: "VOU09",
|
3659
|
+
name: "Voucher Code 9",
|
3660
|
+
total: 100,
|
3661
|
+
used: 34,
|
3662
|
+
color: getRandomColor2(9)
|
3663
|
+
},
|
3664
|
+
{
|
3665
|
+
code: "VOU10",
|
3666
|
+
name: "Voucher Code 10",
|
3667
|
+
total: 100,
|
3668
|
+
used: 67,
|
3669
|
+
color: getRandomColor2(10)
|
3670
|
+
},
|
3671
|
+
{
|
3672
|
+
code: "VOU11",
|
3673
|
+
name: "Voucher Code 11",
|
3674
|
+
total: 100,
|
3675
|
+
used: 23,
|
3676
|
+
color: getRandomColor2(11)
|
3677
|
+
},
|
3678
|
+
{
|
3679
|
+
code: "VOU12",
|
3680
|
+
name: "Voucher Code 12",
|
3681
|
+
total: 100,
|
3682
|
+
used: 98,
|
3683
|
+
color: getRandomColor2(12)
|
3684
|
+
},
|
3685
|
+
{
|
3686
|
+
code: "VOU13",
|
3687
|
+
name: "Voucher Code 13",
|
3688
|
+
total: 100,
|
3689
|
+
used: 54,
|
3690
|
+
color: getRandomColor2(13)
|
3691
|
+
},
|
3692
|
+
{
|
3693
|
+
code: "VOU14",
|
3694
|
+
name: "Voucher Code 14",
|
3695
|
+
total: 100,
|
3696
|
+
used: 27,
|
3697
|
+
color: getRandomColor2(14)
|
3698
|
+
},
|
3699
|
+
{
|
3700
|
+
code: "VOU15",
|
3701
|
+
name: "Voucher Code 15",
|
3702
|
+
total: 100,
|
3703
|
+
used: 3,
|
3704
|
+
color: getRandomColor2(15)
|
3705
|
+
},
|
3706
|
+
{
|
3707
|
+
code: "VOU16",
|
3708
|
+
name: "Voucher Code 16",
|
3709
|
+
total: 100,
|
3710
|
+
used: 56,
|
3711
|
+
color: getRandomColor2(16)
|
3712
|
+
},
|
3713
|
+
{
|
3714
|
+
code: "VOU17",
|
3715
|
+
name: "Voucher Code 17",
|
3716
|
+
total: 100,
|
3717
|
+
used: 85,
|
3718
|
+
color: getRandomColor2(17)
|
3719
|
+
},
|
3720
|
+
{
|
3721
|
+
code: "VOU18",
|
3722
|
+
name: "Voucher Code 18",
|
3723
|
+
total: 100,
|
3724
|
+
used: 45,
|
3725
|
+
color: getRandomColor2(18)
|
3726
|
+
},
|
3727
|
+
{
|
3728
|
+
code: "VOU19",
|
3729
|
+
name: "Voucher Code 19",
|
3730
|
+
total: 100,
|
3731
|
+
used: 64,
|
3732
|
+
color: getRandomColor2(19)
|
3733
|
+
},
|
3734
|
+
{
|
3735
|
+
code: "VOU20",
|
3736
|
+
name: "Voucher Code 20",
|
3737
|
+
total: 100,
|
3738
|
+
used: 12,
|
3739
|
+
color: getRandomColor2(20)
|
3740
|
+
}
|
3741
|
+
];
|
3742
|
+
function PieChart_VoucherUsedPercentage() {
|
3743
|
+
const totalVoucherCode = mockData2.reduce((acc, cur) => acc + cur.used, 0);
|
3744
|
+
const columns = useMemo15(
|
3745
|
+
() => [
|
3746
|
+
{
|
3747
|
+
header: "M\xE0u",
|
3748
|
+
accessorKey: "color",
|
3749
|
+
accessorFn(originalRow) {
|
3750
|
+
return /* @__PURE__ */ jsx73("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
|
3751
|
+
},
|
3752
|
+
minSize: 30,
|
3753
|
+
maxSize: 30
|
3754
|
+
},
|
3755
|
+
{
|
3756
|
+
header: "M\xE3",
|
3757
|
+
accessorKey: "code",
|
3758
|
+
minSize: 20,
|
3759
|
+
maxSize: 20
|
3760
|
+
},
|
3761
|
+
{
|
3762
|
+
header: "%",
|
3763
|
+
accessorKey: "used",
|
3764
|
+
accessorFn(originalRow) {
|
3765
|
+
return /* @__PURE__ */ jsx73(Fragment10, { children: /* @__PURE__ */ jsx73(Center2, { children: /* @__PURE__ */ jsxs51(Text14, { children: [
|
3766
|
+
(originalRow.used / totalVoucherCode * 100).toFixed(0),
|
3767
|
+
"%"
|
3768
|
+
] }) }) });
|
3769
|
+
},
|
3770
|
+
minSize: 64,
|
3771
|
+
maxSize: 64
|
3772
|
+
},
|
3773
|
+
{
|
3774
|
+
header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
|
3775
|
+
accessorKey: "value",
|
3776
|
+
accessorFn(originalRow) {
|
3777
|
+
return originalRow.used;
|
3778
|
+
},
|
3779
|
+
Cell: ({ row }) => {
|
3780
|
+
return /* @__PURE__ */ jsxs51(Fragment10, { children: [
|
3781
|
+
/* @__PURE__ */ jsx73(Center2, { children: /* @__PURE__ */ jsxs51(Text14, { children: [
|
3782
|
+
"\u0110\xE3 s\u1EED d\u1EE5ng: ",
|
3783
|
+
/* @__PURE__ */ jsxs51("strong", { children: [
|
3784
|
+
row.original.used,
|
3785
|
+
" / ",
|
3786
|
+
row.original.total
|
3787
|
+
] }),
|
3788
|
+
" - (",
|
3789
|
+
(row.original.used / row.original.total * 100).toFixed(2),
|
3790
|
+
"%)"
|
3791
|
+
] }) }),
|
3792
|
+
/* @__PURE__ */ jsx73(Progress2, { color: "yellow", radius: "xs", size: "lg", value: row.original.used / row.original.total * 100 })
|
3793
|
+
] });
|
3794
|
+
},
|
3795
|
+
minSize: 50,
|
3796
|
+
maxSize: 50
|
3797
|
+
}
|
3798
|
+
],
|
3799
|
+
[]
|
3800
|
+
);
|
3801
|
+
return /* @__PURE__ */ jsx73(Fragment10, { children: /* @__PURE__ */ jsxs51(MyFlexColumn, { children: [
|
3802
|
+
/* @__PURE__ */ jsx73(Text14, { mb: "20", children: "Bi\u1EC3u \u0111\u1ED3 ph\u1EA7n tr\u0103m s\u1EED d\u1EE5ng m\xE3 gi\u1EA3m gi\xE1 h\u1ECDc vi\xEAn trong 60 ng\xE0y qua" }),
|
3803
|
+
/* @__PURE__ */ jsx73(Center2, { children: /* @__PURE__ */ jsx73(
|
3804
|
+
PieChart2,
|
3805
|
+
{
|
3806
|
+
startAngle: 90,
|
3807
|
+
endAngle: -270,
|
3808
|
+
strokeWidth: 0,
|
3809
|
+
withLabelsLine: true,
|
3810
|
+
labelsPosition: "outside",
|
3811
|
+
withLabels: true,
|
3812
|
+
labelsType: "percent",
|
3813
|
+
data: data_used_discountCode2
|
3814
|
+
}
|
3815
|
+
) }),
|
3816
|
+
/* @__PURE__ */ jsx73(Space6, { mt: 5 }),
|
3817
|
+
/* @__PURE__ */ jsx73(
|
3818
|
+
MyDataTable,
|
3819
|
+
{
|
3820
|
+
data: mockData2,
|
3821
|
+
columns,
|
3822
|
+
initialState: {
|
3823
|
+
density: "xs",
|
3824
|
+
pagination: { pageIndex: 0, pageSize: 5 }
|
3825
|
+
}
|
3826
|
+
}
|
3827
|
+
)
|
3828
|
+
] }) });
|
3829
|
+
}
|
3830
|
+
|
3831
|
+
// src/modules-features/authenticate/F_authenticate_SplashPage.tsx
|
3832
|
+
import { useRouter as useRouter2 } from "next/navigation";
|
3833
|
+
import { useEffect as useEffect11 } from "react";
|
3834
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
3835
|
+
function F_authenticate_SplashPage() {
|
3836
|
+
const router = useRouter2();
|
3837
|
+
const S_Authenticate = useS_authenticate();
|
3838
|
+
useEffect11(() => {
|
3839
|
+
if (S_Authenticate.state.token == "") {
|
3840
|
+
router.push("/authenticate/login");
|
3841
|
+
return;
|
3842
|
+
}
|
3843
|
+
router.push("/admin/core71678");
|
3844
|
+
}, [S_Authenticate.state.token]);
|
3845
|
+
return /* @__PURE__ */ jsx74(MyBoxesBackground, { title: "H\u1EC7 th\u1ED1ng th\xF4ng tin qu\u1EA3n l\xED \u0111\xE0o t\u1EA1o ng\u1EAFn h\u1EA1n" });
|
3846
|
+
}
|
3847
|
+
|
3848
|
+
// src/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx
|
3849
|
+
import {
|
3850
|
+
Anchor,
|
3851
|
+
BackgroundImage,
|
3852
|
+
Button as Button3,
|
3853
|
+
Center as Center3,
|
3854
|
+
Checkbox as Checkbox3,
|
3855
|
+
Flex as Flex3,
|
3856
|
+
Group as Group14,
|
3857
|
+
Paper as Paper18,
|
3858
|
+
PasswordInput as PasswordInput2,
|
3859
|
+
Text as Text15,
|
3860
|
+
TextInput as TextInput3,
|
3861
|
+
Title
|
3862
|
+
} from "@mantine/core";
|
3863
|
+
import { useForm as useForm20 } from "@mantine/form";
|
3864
|
+
import { useMutation as useMutation5 } from "@tanstack/react-query";
|
3865
|
+
import axios from "axios";
|
3866
|
+
import Link from "next/link";
|
3867
|
+
import { useRouter as useRouter3 } from "next/navigation";
|
3868
|
+
import { useState as useState9 } from "react";
|
3869
|
+
|
3870
|
+
// src/modules-features/authenticate/F_authenticate_Login/css.module.css
|
3871
|
+
var css_default = "../css.module-P45UW6UZ.module.css";
|
3872
|
+
|
3873
|
+
// src/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx
|
3874
|
+
import { jsx as jsx75, jsxs as jsxs52 } from "react/jsx-runtime";
|
3875
|
+
function F_authenticate_Login({
|
3876
|
+
loginInfo,
|
3877
|
+
redirectUrlAfterLogin = "/admin/dashboard",
|
3878
|
+
additionalActions,
|
3879
|
+
backgroundImage = "/imgs/0/IMG0AuthBackground.png",
|
3880
|
+
onSuccess
|
3881
|
+
}) {
|
3882
|
+
const router = useRouter3();
|
3883
|
+
const authenticate_store = useS_authenticate();
|
3884
|
+
const loadingState = useState9(false);
|
3885
|
+
const mutation = useM_Account_Sigin();
|
3886
|
+
const form = useForm20({
|
3887
|
+
mode: "uncontrolled",
|
3888
|
+
initialValues: {
|
3889
|
+
username: (loginInfo == null ? void 0 : loginInfo.username) || "admincoe",
|
3890
|
+
password: (loginInfo == null ? void 0 : loginInfo.password) || "123456"
|
3891
|
+
},
|
3892
|
+
validate: {
|
3893
|
+
username: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
3894
|
+
password: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
3895
|
+
}
|
3896
|
+
});
|
3897
|
+
function handleSubmit(userName, passWord) {
|
3898
|
+
loadingState[1](true);
|
3899
|
+
mutation.mutate({
|
3900
|
+
"userName": userName,
|
3901
|
+
"passWord": passWord
|
3902
|
+
}, {
|
3903
|
+
onSuccess: (data) => {
|
3904
|
+
if (data.isSuccess === false) {
|
3905
|
+
form.setFieldError("username", "T\xE0i kho\u1EA3n kh\xF4ng t\u1ED3n t\u1EA1i");
|
3906
|
+
loadingState[1](false);
|
3907
|
+
return;
|
3908
|
+
}
|
3909
|
+
if (data.isSuccess == 0) {
|
3910
|
+
form.setFieldError("password", data.message);
|
3911
|
+
loadingState[1](false);
|
3912
|
+
return;
|
3913
|
+
}
|
3914
|
+
authenticate_store.setProperty("code", data.data.userName);
|
3915
|
+
authenticate_store.setProperty("fullName", data.data.userFullName);
|
3916
|
+
authenticate_store.setProperty("userId", data.data.userId);
|
3917
|
+
authenticate_store.setProperty("token", data.data.token);
|
3918
|
+
if (onSuccess) {
|
3919
|
+
onSuccess(data);
|
3920
|
+
loadingState[1](false);
|
3921
|
+
return;
|
3922
|
+
}
|
3923
|
+
router.replace(redirectUrlAfterLogin);
|
3924
|
+
}
|
3925
|
+
});
|
3926
|
+
}
|
3927
|
+
return /* @__PURE__ */ jsx75(
|
3928
|
+
BackgroundImage,
|
3929
|
+
{
|
3930
|
+
src: backgroundImage,
|
3931
|
+
h: "100vh",
|
3932
|
+
children: /* @__PURE__ */ jsx75(Center3, { h: "100vh", children: /* @__PURE__ */ jsxs52(Paper18, { withBorder: true, w: 400, m: "md", shadow: "md", p: 30, mt: 30, radius: "md", children: [
|
3933
|
+
/* @__PURE__ */ jsxs52(Flex3, { direction: "column", mb: "md", children: [
|
3934
|
+
/* @__PURE__ */ jsx75(Title, { ta: "center", className: css_default.title, children: "\u0110\u0103ng nh\u1EADp!" }),
|
3935
|
+
/* @__PURE__ */ jsxs52(Text15, { c: "dimmed", size: "sm", ta: "center", mt: 5, children: [
|
3936
|
+
"B\u1EA1n g\u1EB7p v\u1EA5n \u0111\u1EC1 k\u1EF9 thu\u1EADt?\xA0",
|
3937
|
+
/* @__PURE__ */ jsx75(Anchor, { size: "sm", component: "button", children: "V\xE0o link n\xE0y" })
|
3938
|
+
] })
|
3939
|
+
] }),
|
3940
|
+
/* @__PURE__ */ jsx75("form", { onSubmit: form.onSubmit(async (values) => handleSubmit(values.username, values.password)), children: /* @__PURE__ */ jsxs52(MyFlexColumn, { children: [
|
3941
|
+
/* @__PURE__ */ jsx75(
|
3942
|
+
TextInput3,
|
3943
|
+
__spreadProps(__spreadValues({}, form.getInputProps("username")), {
|
3944
|
+
label: "T\xE0i kho\u1EA3n",
|
3945
|
+
placeholder: "Nh\u1EADp t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n",
|
3946
|
+
withAsterisk: true
|
3947
|
+
})
|
3948
|
+
),
|
3949
|
+
/* @__PURE__ */ jsx75(
|
3950
|
+
PasswordInput2,
|
3951
|
+
__spreadProps(__spreadValues({}, form.getInputProps("password")), {
|
3952
|
+
label: "M\u1EADt kh\u1EA9u",
|
3953
|
+
placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u c\u1EE7a b\u1EA1n",
|
3954
|
+
withAsterisk: true
|
3955
|
+
})
|
3956
|
+
),
|
3957
|
+
/* @__PURE__ */ jsxs52(Group14, { justify: "space-between", children: [
|
3958
|
+
/* @__PURE__ */ jsx75(Checkbox3, { label: "L\u01B0u \u0111\u0103ng nh\u1EADp" }),
|
3959
|
+
/* @__PURE__ */ jsx75(Anchor, { component: Link, href: "quen-mat-khau", size: "sm", children: "Qu\xEAn m\u1EADt kh\u1EA9u?" })
|
3960
|
+
] }),
|
3961
|
+
/* @__PURE__ */ jsx75(
|
3962
|
+
Button3,
|
3963
|
+
{
|
3964
|
+
loading: loadingState[0],
|
3965
|
+
type: "submit",
|
3966
|
+
fullWidth: true,
|
3967
|
+
children: "\u0110\u0103ng nh\u1EADp"
|
3968
|
+
}
|
3969
|
+
),
|
3970
|
+
additionalActions
|
3971
|
+
] }) })
|
3972
|
+
] }) })
|
3973
|
+
}
|
3974
|
+
);
|
3975
|
+
}
|
3976
|
+
function useM_Account_Sigin() {
|
3977
|
+
const ENDPOINT5 = process.env.NEXT_PUBLIC_API + "/Account/SignIn";
|
3978
|
+
const mutation = useMutation5({
|
3979
|
+
mutationFn: async (values) => {
|
3980
|
+
const result = await axios.post(ENDPOINT5, values);
|
3981
|
+
return result.data;
|
3982
|
+
}
|
3983
|
+
});
|
3984
|
+
return mutation;
|
3985
|
+
}
|
3986
|
+
export {
|
3987
|
+
F_authenticate_Login,
|
3988
|
+
F_authenticate_Logout,
|
3989
|
+
F_authenticate_SplashPage,
|
3990
|
+
F_core12196,
|
3991
|
+
F_core12196_Create,
|
3992
|
+
F_core12196_Delete,
|
3993
|
+
F_core12196_Read,
|
3994
|
+
F_core12196_Update,
|
3995
|
+
F_core16209,
|
3996
|
+
F_core16209_Create,
|
3997
|
+
F_core16209_Delete,
|
3998
|
+
F_core16209_Update,
|
3999
|
+
F_core18256,
|
4000
|
+
F_core18256_Create,
|
4001
|
+
F_core18256_Delete,
|
4002
|
+
F_core18256_Read,
|
4003
|
+
F_core18256_Select,
|
4004
|
+
F_core18256_Update,
|
4005
|
+
F_core26965,
|
4006
|
+
F_core26965_Create,
|
4007
|
+
F_core26965_Delete,
|
4008
|
+
F_core26965_Update,
|
4009
|
+
F_core27311,
|
4010
|
+
F_core27311_Create,
|
4011
|
+
F_core27311_Delete,
|
4012
|
+
F_core27311_Read,
|
4013
|
+
F_core27311_Update,
|
4014
|
+
F_core35923,
|
4015
|
+
F_core38677,
|
4016
|
+
F_core38677_ReadUser,
|
4017
|
+
F_core38677_Save,
|
4018
|
+
F_core38677_ViewMenuPermissions,
|
4019
|
+
F_core40207,
|
4020
|
+
F_core40207_Create,
|
4021
|
+
F_core40207_Delete,
|
4022
|
+
F_core40207_Read,
|
4023
|
+
F_core40207_Update,
|
4024
|
+
F_core47643,
|
4025
|
+
F_core47643_Delete,
|
4026
|
+
F_core47643_Form,
|
4027
|
+
F_core47643_Read,
|
4028
|
+
F_core60524,
|
4029
|
+
F_core64229,
|
4030
|
+
F_core64229_Delete,
|
4031
|
+
F_core64229_Form,
|
4032
|
+
F_core64229_Read,
|
4033
|
+
F_core71678,
|
4034
|
+
F_core71678_ChangePermission,
|
4035
|
+
F_core71678_Create,
|
4036
|
+
F_core71678_Delete,
|
4037
|
+
F_core71678_Read,
|
4038
|
+
F_core71678_Update,
|
4039
|
+
F_core76318,
|
4040
|
+
F_core76318_Create,
|
4041
|
+
F_core76318_Delete,
|
4042
|
+
F_core76318_Update,
|
4043
|
+
F_core83092,
|
4044
|
+
F_core83092_ReadUser,
|
4045
|
+
F_core83092_Save,
|
4046
|
+
F_core83092_ViewMenuPermissions,
|
4047
|
+
PieChart_DiscountUsedPercentage,
|
4048
|
+
PieChart_VoucherUsedPercentage,
|
4049
|
+
useS_authenticate,
|
4050
|
+
useS_core60524,
|
4051
|
+
useS_core83092,
|
4052
|
+
utils_core83092_mergePage
|
4053
|
+
};
|