aq-fe-framework 0.1.155 → 0.1.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/apiFactory.ts +46 -0
- package/dist/api/baseAxios.ts +22 -0
- package/dist/app/admin/(core)/core12196/page.tsx +13 -0
- package/dist/app/admin/(core)/core16209/page.tsx +13 -0
- package/dist/app/admin/(core)/core18256/page.tsx +12 -0
- package/dist/app/admin/(core)/core26965/page.tsx +13 -0
- package/dist/app/admin/(core)/core27311/page.tsx +13 -0
- package/dist/app/admin/(core)/core38677/page.tsx +13 -0
- package/dist/app/admin/(core)/core40207/page.tsx +13 -0
- package/dist/app/admin/(core)/core60524/page.tsx +11 -0
- package/dist/app/admin/(core)/core64229/page.tsx +12 -0
- package/dist/app/admin/(core)/core71678/page.tsx +11 -0
- package/dist/app/admin/(core)/core76318/page.tsx +13 -0
- package/dist/app/admin/(core)/core83092/page.tsx +13 -0
- package/dist/app/admin/[...slug]/page.tsx +7 -0
- package/dist/app/admin/error.tsx +42 -0
- package/dist/app/admin/layout.tsx +21 -0
- package/dist/app/admin/test/page.tsx +44 -0
- package/dist/app/auth/login/page.tsx +14 -0
- package/dist/app/globals.css +59 -0
- package/dist/app/layout.tsx +39 -0
- package/dist/app/page.tsx +18 -0
- package/dist/{chunk-PAHZ57DT.mjs → chunk-JLT4BL7I.mjs} +1 -1
- package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +66 -0
- package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +31 -0
- package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +47 -0
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +81 -0
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +68 -0
- package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +50 -0
- package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +13 -0
- package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +113 -0
- package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +19 -0
- package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +63 -0
- package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +36 -0
- package/dist/components/AppSpotlight/MyAppSpotlight.tsx +112 -0
- package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +46 -0
- package/dist/components/Buttons/Button/MyButton.tsx +90 -0
- package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +81 -0
- package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +75 -0
- package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +68 -0
- package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +29 -0
- package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +100 -0
- package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +81 -0
- package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +196 -0
- package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +71 -0
- package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +117 -0
- package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +37 -0
- package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +174 -0
- package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +29 -0
- package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +121 -0
- package/dist/components/Calendar/MyCalendar.tsx +118 -0
- package/dist/components/CenterFull/MyCenterFull.tsx +10 -0
- package/dist/components/Checkbox/MyCheckbox.tsx +9 -0
- package/dist/components/Combobox/Select/MySelect.tsx +12 -0
- package/dist/components/DataDisplay/Card/AQCard.tsx +49 -0
- package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +77 -0
- package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +184 -0
- package/dist/components/DataDisplay/IconText/MyIconText.tsx +17 -0
- package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +15 -0
- package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +9 -0
- package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +68 -0
- package/dist/components/FaviconSetter/FaviconSetter.tsx +33 -0
- package/dist/components/Inputs/DateInput/MyDateInput.tsx +11 -0
- package/dist/components/Inputs/Fieldset/MyFieldset.tsx +32 -0
- package/dist/components/Inputs/FileInput/MyFileInput.tsx +12 -0
- package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +12 -0
- package/dist/components/Inputs/TextArea/MyTextArea.tsx +11 -0
- package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +191 -0
- package/dist/components/Inputs/TextInput/MyTextInput.tsx +30 -0
- package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +357 -0
- package/dist/components/Layouts/BasicAppShell/css.module.css +62 -0
- package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +64 -0
- package/dist/components/Layouts/Container/MyContainer.tsx +16 -0
- package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +14 -0
- package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +14 -0
- package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +14 -0
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +147 -0
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +19 -0
- package/dist/components/Layouts/HeaderMegaMenu/css.module.css +50 -0
- package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +29 -0
- package/dist/components/Layouts/PageContent/MyPageContent.tsx +67 -0
- package/dist/components/Layouts/Tab/MyTab.tsx +33 -0
- package/dist/components/Loaders/MyCardioLoader.tsx +12 -0
- package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +61 -0
- package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +37 -0
- package/dist/components/ScheduleX/MyScheduleX.tsx +58 -0
- package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +9 -0
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.ts +62 -0
- package/dist/constants/array/daysOfWeek.ts +9 -0
- package/dist/constants/enum/ENUM_EMAILCONFIG.ts +6 -0
- package/dist/constants/enum/global.ts +26 -0
- package/dist/constants/object/color.ts +5 -0
- package/dist/constants/object/documentTypes.ts +8 -0
- package/dist/{components/index.css → css.module-4ICLUKPO.module.css} +29 -16
- package/dist/css.module-P45UW6UZ.module.css +4 -0
- package/dist/data/menuData.ts +31 -0
- package/dist/hooks/custom-hooks/useC_MutationAction.tsx +36 -0
- package/dist/hooks/index.ts +2 -0
- package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +14 -0
- package/dist/interfaces/EmailConfig.ts +10 -0
- package/dist/interfaces/IAQModule.ts +21 -0
- package/dist/interfaces/base.ts +9 -0
- package/dist/interfaces/global-interface/IAQSSO.ts +15 -0
- package/dist/interfaces/global-interface/IAQSyncData.ts +9 -0
- package/dist/interfaces/global-interface/IAcademicYear.ts +12 -0
- package/dist/interfaces/global-interface/IChangePassWord.ts +8 -0
- package/dist/interfaces/global-interface/IComplaintProccess.ts +9 -0
- package/dist/interfaces/global-interface/ICreateAccount.ts +24 -0
- package/dist/interfaces/global-interface/IDocument.ts +25 -0
- package/dist/interfaces/global-interface/IDocumentAttribute.ts +12 -0
- package/dist/interfaces/global-interface/IEvent.ts +30 -0
- package/dist/interfaces/global-interface/IEventComplaint.ts +20 -0
- package/dist/interfaces/global-interface/IEventFillter.ts +14 -0
- package/dist/interfaces/global-interface/IFile.ts +8 -0
- package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +8 -0
- package/dist/interfaces/global-interface/IPagePermission.ts +12 -0
- package/dist/interfaces/global-interface/IRolePermission.ts +7 -0
- package/dist/interfaces/global-interface/ISRMUserinfo.ts +35 -0
- package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +15 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +15 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +14 -0
- package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +21 -0
- package/dist/interfaces/global-interface/ISignIn.ts +7 -0
- package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +15 -0
- package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +11 -0
- package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +11 -0
- package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +31 -0
- package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +14 -0
- package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +14 -0
- package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +12 -0
- package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +18 -0
- package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +16 -0
- package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +18 -0
- package/dist/interfaces/global-interface/IUpdateAccount.ts +15 -0
- package/dist/interfaces/global-interface/IUser.ts +21 -0
- package/dist/interfaces/global-interface/IUserPermission.ts +7 -0
- package/dist/lib/utils.ts +6 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +87 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +65 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +82 -0
- package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +67 -0
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +77 -0
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +77 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +78 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +69 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +69 -0
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +64 -0
- package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +311 -0
- package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +311 -0
- package/dist/modules-features/admin/core/core12196/F_core12196.tsx +20 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +101 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +112 -0
- package/dist/modules-features/admin/core/core16209/F_core16209.tsx +108 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +112 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +114 -0
- package/dist/modules-features/admin/core/core18256/F_core18256.tsx +29 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +34 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +14 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +59 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +40 -0
- package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +22 -0
- package/dist/modules-features/admin/core/core26965/F_core26965.tsx +17 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +106 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +112 -0
- package/dist/modules-features/admin/core/core27311/F_core27311.tsx +21 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +109 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +19 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +165 -0
- package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +113 -0
- package/dist/modules-features/admin/core/core35923/F_core35923.tsx +46 -0
- package/dist/modules-features/admin/core/core38677/F_core38677.tsx +28 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +79 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +52 -0
- package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +264 -0
- package/dist/modules-features/admin/core/core40207/F_core40207.tsx +9 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +81 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +98 -0
- package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +83 -0
- package/dist/modules-features/admin/core/core47643/F_core47643.tsx +10 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +13 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +34 -0
- package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +57 -0
- package/dist/modules-features/admin/core/core60524/F_core60524.tsx +13 -0
- package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +111 -0
- package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +56 -0
- package/dist/modules-features/admin/core/core60524/useS_core60524.ts +16 -0
- package/dist/modules-features/admin/core/core64229/F_core64229.tsx +7 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +21 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +95 -0
- package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +67 -0
- package/dist/modules-features/admin/core/core71678/F_core71678.tsx +8 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +117 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +61 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +16 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +92 -0
- package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +49 -0
- package/dist/modules-features/admin/core/core76318/F_core76318.tsx +9 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +89 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +17 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +104 -0
- package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +89 -0
- package/dist/modules-features/admin/core/core83092/F_core83092.tsx +27 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +85 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +52 -0
- package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +263 -0
- package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +70 -0
- package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +154 -0
- package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +4 -0
- package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +22 -0
- package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +21 -0
- package/dist/modules-features/authenticate/useS_authenticate.ts +23 -0
- package/dist/modules-features/index.mjs +2 -2
- package/dist/modules-features/index.ts +79 -0
- package/dist/providers/MyMantineProvider.tsx +140 -0
- package/dist/providers/MyReactQueryProvider.tsx +24 -0
- package/dist/providers/Provider.tsx +13 -0
- package/dist/providers/mantine.module.css +21 -0
- package/dist/stores/CreateGenericStore.ts +23 -0
- package/dist/stores/index.ts +1 -0
- package/dist/types/types.ts +16 -0
- package/dist/utils/index.ts +9 -0
- package/dist/utils/utils_converter.ts +39 -0
- package/dist/utils/utils_currency.ts +5 -0
- package/dist/utils/utils_date.ts +34 -0
- package/dist/utils/utils_excel.ts +128 -0
- package/dist/utils/utils_file.ts +61 -0
- package/dist/utils/utils_notification.ts +46 -0
- package/dist/utils/utils_pdf.ts +21 -0
- package/dist/utils/utils_time.ts +15 -0
- package/dist/utils/utils_validateForm.ts +9 -0
- package/package.json +1 -1
- package/dist/modules-features/index.css +0 -100
@@ -0,0 +1,112 @@
|
|
1
|
+
import baseAxios from "@/api/baseAxios";
|
2
|
+
import { MyActionIconUpdate } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate";
|
3
|
+
import { MyDateInput } from "@/components/Inputs/DateInput/MyDateInput";
|
4
|
+
import { MyFileInput } from "@/components/Inputs/FileInput/MyFileInput";
|
5
|
+
import { MyNumberInput } from "@/components/Inputs/NumberInput/MyNumberInput";
|
6
|
+
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
7
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
8
|
+
import { F_core18256_Select } from "@/modules-features/admin/core/core18256/F_core18256_Select";
|
9
|
+
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
10
|
+
import { useForm } from "@mantine/form";
|
11
|
+
interface IDocument {
|
12
|
+
path?: string;
|
13
|
+
orderBy?: number;
|
14
|
+
documentType?: number;
|
15
|
+
promulgateDate?: Date;
|
16
|
+
decisionCode?: string;
|
17
|
+
departmentName?: string;
|
18
|
+
description?: string;
|
19
|
+
startDate?: Date;
|
20
|
+
endDate?: Date;
|
21
|
+
conclusion?: string;
|
22
|
+
note?: string;
|
23
|
+
documentAttributeId?: number;
|
24
|
+
documentAttributeName?: string;
|
25
|
+
isCycleCheck?: boolean;
|
26
|
+
meetingDate?: Date;
|
27
|
+
fileDetail?: {
|
28
|
+
fileBase64String?: string;
|
29
|
+
fileExtension?: string;
|
30
|
+
fileName?: string;
|
31
|
+
};
|
32
|
+
id?: number;
|
33
|
+
code?: string;
|
34
|
+
name?: string;
|
35
|
+
concurrencyStamp?: string;
|
36
|
+
isEnabled?: boolean;
|
37
|
+
ngayChinhSua?: Date;
|
38
|
+
nguoiChinhSua?: string;
|
39
|
+
}
|
40
|
+
interface I extends IDocument {
|
41
|
+
file?: File;
|
42
|
+
}
|
43
|
+
export function F_core12196_Update({
|
44
|
+
values,
|
45
|
+
FormTypeId,
|
46
|
+
}: {
|
47
|
+
values: I;
|
48
|
+
FormTypeId: number;
|
49
|
+
}) {
|
50
|
+
const form = useForm<I>({
|
51
|
+
initialValues: {
|
52
|
+
...values,
|
53
|
+
file: new File(
|
54
|
+
[],
|
55
|
+
values.path?.split("/")[values.path.split("/").length - 1]!
|
56
|
+
),
|
57
|
+
promulgateDate: new Date(values.promulgateDate!),
|
58
|
+
},
|
59
|
+
validate: {
|
60
|
+
decisionCode: (value) =>
|
61
|
+
value ? null : "Số quy định không được để trống",
|
62
|
+
promulgateDate: (value) =>
|
63
|
+
value ? null : "Ngày ban hành không được để trống",
|
64
|
+
name: (value) => (value ? null : "Tên tài liệu không được để trống"),
|
65
|
+
documentAttributeId: (value) =>
|
66
|
+
value ? null : "Loại văn bản không được để trống",
|
67
|
+
file: (value) => (value ? null : "Tệp đính kèm không được để trống"),
|
68
|
+
},
|
69
|
+
});
|
70
|
+
return (
|
71
|
+
<MyActionIconUpdate
|
72
|
+
form={form}
|
73
|
+
onSubmit={async (values) => {
|
74
|
+
return await baseAxios.post("/Document/Update", {
|
75
|
+
...values,
|
76
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
77
|
+
});
|
78
|
+
}}
|
79
|
+
>
|
80
|
+
<MyTextInput
|
81
|
+
withAsterisk
|
82
|
+
label="Số quy định"
|
83
|
+
{...form.getInputProps("decisionCode")}
|
84
|
+
/>
|
85
|
+
<MyDateInput
|
86
|
+
withAsterisk
|
87
|
+
label="Ngày ban hành"
|
88
|
+
{...form.getInputProps("promulgateDate")}
|
89
|
+
/>
|
90
|
+
<MyTextInput
|
91
|
+
withAsterisk
|
92
|
+
label="Tên tài liệu"
|
93
|
+
{...form.getInputProps("name")}
|
94
|
+
/>
|
95
|
+
<F_core18256_Select
|
96
|
+
withAsterisk
|
97
|
+
label="Loại văn bản"
|
98
|
+
documentTypeId={FormTypeId}
|
99
|
+
{...form.getInputProps("documentAttributeId")}
|
100
|
+
/>
|
101
|
+
<MyFileInput
|
102
|
+
withAsterisk
|
103
|
+
label="Văn bản"
|
104
|
+
{...form.getInputProps("file")}
|
105
|
+
/>
|
106
|
+
<MyNumberInput
|
107
|
+
label="Thứ tự hiển thị trên danh sách"
|
108
|
+
{...form.getInputProps("orderBy")}
|
109
|
+
/>
|
110
|
+
</MyActionIconUpdate>
|
111
|
+
);
|
112
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
"use client";
|
2
|
+
import baseAxios from "@/api/baseAxios";
|
3
|
+
import { MyPageContent } from "@/components";
|
4
|
+
import { MyButtonViewPDF } from "@/components/Buttons/ButtonViewPDF/MyButtonViewPDF";
|
5
|
+
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull";
|
6
|
+
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
7
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
8
|
+
import { U0DateToDDMMYYYString } from "@/utils/utils_date";
|
9
|
+
import { useQuery } from "@tanstack/react-query";
|
10
|
+
import { MRT_ColumnDef } from "mantine-react-table";
|
11
|
+
import { useMemo } from "react";
|
12
|
+
import { F_core16209_Create } from "./F_core16209_Create";
|
13
|
+
import { F_core16209_Delete } from "./F_core16209_Delete";
|
14
|
+
import { F_core16209_Update } from "./F_core16209_Update";
|
15
|
+
|
16
|
+
interface I {
|
17
|
+
path?: string;
|
18
|
+
orderBy?: number;
|
19
|
+
documentType?: number;
|
20
|
+
promulgateDate?: Date;
|
21
|
+
decisionCode?: string;
|
22
|
+
departmentName?: string;
|
23
|
+
description?: string;
|
24
|
+
startDate?: Date;
|
25
|
+
endDate?: Date;
|
26
|
+
conclusion?: string;
|
27
|
+
note?: string;
|
28
|
+
documentAttributeId?: number;
|
29
|
+
documentAttributeName?: string;
|
30
|
+
isCycleCheck?: boolean;
|
31
|
+
meetingDate?: Date;
|
32
|
+
fileDetail?: {
|
33
|
+
fileBase64String?: string;
|
34
|
+
fileExtension?: string;
|
35
|
+
fileName?: string;
|
36
|
+
};
|
37
|
+
id?: number;
|
38
|
+
code?: string;
|
39
|
+
name?: string;
|
40
|
+
concurrencyStamp?: string;
|
41
|
+
isEnabled?: boolean;
|
42
|
+
ngayChinhSua?: Date;
|
43
|
+
nguoiChinhSua?: string;
|
44
|
+
}
|
45
|
+
|
46
|
+
export function F_core16209({ RefinementTypeId }: { RefinementTypeId: number }) {
|
47
|
+
const query = useQuery<I[]>({
|
48
|
+
queryKey: ["F_core16209_Read"],
|
49
|
+
queryFn: async () => {
|
50
|
+
const result = await baseAxios.get(
|
51
|
+
`/Document/GetByType?documentType=${RefinementTypeId}`
|
52
|
+
);
|
53
|
+
return result.data?.data || [];
|
54
|
+
},
|
55
|
+
});
|
56
|
+
const columns = useMemo<MRT_ColumnDef<I>[]>(
|
57
|
+
() => [
|
58
|
+
{
|
59
|
+
header: "Đơn vị yêu cầu",
|
60
|
+
accessorKey: "departmentName",
|
61
|
+
},
|
62
|
+
{
|
63
|
+
header: "Nội dung cải tiến",
|
64
|
+
accessorKey: "description",
|
65
|
+
},
|
66
|
+
{
|
67
|
+
header: "Ngày bắt đầu",
|
68
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.startDate!)),
|
69
|
+
},
|
70
|
+
{
|
71
|
+
header: "Ngày kết thúc",
|
72
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.endDate!)),
|
73
|
+
},
|
74
|
+
{
|
75
|
+
header: "File",
|
76
|
+
accessorFn: (row) => {
|
77
|
+
return (
|
78
|
+
<MyCenterFull>
|
79
|
+
<MyButtonViewPDF id={row.id} />
|
80
|
+
</MyCenterFull>
|
81
|
+
);
|
82
|
+
},
|
83
|
+
},
|
84
|
+
],
|
85
|
+
[]
|
86
|
+
);
|
87
|
+
|
88
|
+
if (query.isLoading) return "Loading...";
|
89
|
+
if (query.isError) return "có lỗi xảy ra!";
|
90
|
+
return (
|
91
|
+
<MyDataTable
|
92
|
+
columns={columns}
|
93
|
+
data={query.data!}
|
94
|
+
renderTopToolbarCustomActions={() => <F_core16209_Create RefinementTypeId={RefinementTypeId} />}
|
95
|
+
renderRowActions={({ row }) => {
|
96
|
+
return (
|
97
|
+
<MyCenterFull>
|
98
|
+
<F_core16209_Update values={row.original} />
|
99
|
+
<F_core16209_Delete
|
100
|
+
id={row.original.id!}
|
101
|
+
contextData={row.original.departmentName!}
|
102
|
+
/>
|
103
|
+
</MyCenterFull>
|
104
|
+
);
|
105
|
+
}}
|
106
|
+
/>
|
107
|
+
);
|
108
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
"use client";
|
2
|
+
import baseAxios from "@/api/baseAxios";
|
3
|
+
import { MyButtonCreate } from "@/components/Buttons/ButtonCRUD/MyButtonCreate";
|
4
|
+
import { MyDateInput } from "@/components/Inputs/DateInput/MyDateInput";
|
5
|
+
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
6
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
7
|
+
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
8
|
+
import { FileInput, Textarea } from "@mantine/core";
|
9
|
+
import { useForm } from "@mantine/form";
|
10
|
+
|
11
|
+
interface IDocument {
|
12
|
+
path?: string;
|
13
|
+
orderBy?: number;
|
14
|
+
documentType?: number;
|
15
|
+
promulgateDate?: Date;
|
16
|
+
decisionCode?: string;
|
17
|
+
departmentName?: string;
|
18
|
+
description?: string;
|
19
|
+
startDate?: Date;
|
20
|
+
endDate?: Date;
|
21
|
+
conclusion?: string;
|
22
|
+
note?: string;
|
23
|
+
documentAttributeId?: number;
|
24
|
+
documentAttributeName?: string;
|
25
|
+
isCycleCheck?: boolean;
|
26
|
+
meetingDate?: Date;
|
27
|
+
fileDetail?: {
|
28
|
+
fileBase64String?: string;
|
29
|
+
fileExtension?: string;
|
30
|
+
fileName?: string;
|
31
|
+
};
|
32
|
+
id?: number;
|
33
|
+
code?: string;
|
34
|
+
name?: string;
|
35
|
+
concurrencyStamp?: string;
|
36
|
+
isEnabled?: boolean;
|
37
|
+
ngayChinhSua?: Date;
|
38
|
+
nguoiChinhSua?: string;
|
39
|
+
}
|
40
|
+
interface I extends IDocument {
|
41
|
+
file?: File;
|
42
|
+
}
|
43
|
+
|
44
|
+
export function F_core16209_Create({
|
45
|
+
RefinementTypeId,
|
46
|
+
}: {
|
47
|
+
RefinementTypeId: number;
|
48
|
+
}) {
|
49
|
+
const form = useForm<I>({
|
50
|
+
mode: "uncontrolled",
|
51
|
+
validate: {
|
52
|
+
meetingDate: (value) => (value ? null : "Không được để trống"),
|
53
|
+
departmentName: (value) => (value ? null : "Không được để trống"),
|
54
|
+
description: (value) => (value ? null : "Không được để trống"),
|
55
|
+
file: (value) => (value ? null : "Không được để trống"),
|
56
|
+
startDate: (value) => (value ? null : "Không được để trống"),
|
57
|
+
endDate: (value, values) =>
|
58
|
+
value &&
|
59
|
+
values.startDate &&
|
60
|
+
new Date(value) > new Date(values.startDate)
|
61
|
+
? null
|
62
|
+
: "Ngày kết thúc phải lớn hơn ngày bắt đầu",
|
63
|
+
},
|
64
|
+
});
|
65
|
+
return (
|
66
|
+
<MyButtonCreate
|
67
|
+
objectName="văn bản"
|
68
|
+
form={form}
|
69
|
+
onSubmit={async (values) => {
|
70
|
+
return await baseAxios.post("/Document/create", {
|
71
|
+
...values,
|
72
|
+
DocumentType: RefinementTypeId, //1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
73
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
74
|
+
});
|
75
|
+
}}
|
76
|
+
>
|
77
|
+
<MyDateInput
|
78
|
+
withAsterisk
|
79
|
+
label="Ngày họp"
|
80
|
+
{...form.getInputProps("meetingDate")}
|
81
|
+
/>
|
82
|
+
<MyTextInput
|
83
|
+
withAsterisk
|
84
|
+
label="Đơn vị yêu cầu"
|
85
|
+
{...form.getInputProps("departmentName")}
|
86
|
+
/>
|
87
|
+
<MyTextInput
|
88
|
+
withAsterisk
|
89
|
+
label="Nội dung cải tiến"
|
90
|
+
{...form.getInputProps("description")}
|
91
|
+
/>
|
92
|
+
<MyTextInput label="Kết luận" {...form.getInputProps("conclusion")} />
|
93
|
+
<MyDateInput
|
94
|
+
withAsterisk
|
95
|
+
label="Ngày bắt đầu"
|
96
|
+
{...form.getInputProps("startDate")}
|
97
|
+
/>
|
98
|
+
<MyDateInput
|
99
|
+
withAsterisk
|
100
|
+
label="Ngày kết thúc"
|
101
|
+
{...form.getInputProps("endDate")}
|
102
|
+
/>
|
103
|
+
<FileInput
|
104
|
+
placeholder="Tải lên tài liệu"
|
105
|
+
withAsterisk
|
106
|
+
label="Tài liệu"
|
107
|
+
{...form.getInputProps("file")}
|
108
|
+
/>
|
109
|
+
<Textarea label="Ghi chú" {...form.getInputProps("note")}></Textarea>
|
110
|
+
</MyButtonCreate>
|
111
|
+
);
|
112
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import baseAxios from "@/api/baseAxios";
|
2
|
+
import { MyActionIconDelete } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete";
|
3
|
+
|
4
|
+
export function F_core16209_Delete({
|
5
|
+
id,
|
6
|
+
contextData,
|
7
|
+
}: {
|
8
|
+
id: number;
|
9
|
+
contextData: string;
|
10
|
+
}) {
|
11
|
+
return (
|
12
|
+
<MyActionIconDelete
|
13
|
+
contextData={contextData}
|
14
|
+
onSubmit={() => baseAxios.post("/Document/delete", { id: id })}
|
15
|
+
/>
|
16
|
+
);
|
17
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
import baseAxios from "@/api/baseAxios";
|
2
|
+
import { MyTextInput } from "@/components";
|
3
|
+
import { MyActionIconUpdate } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate";
|
4
|
+
import { MyDateInput } from "@/components/Inputs/DateInput/MyDateInput";
|
5
|
+
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
6
|
+
import { FileInput, Textarea, TextInput } from "@mantine/core";
|
7
|
+
import { DateInput } from "@mantine/dates";
|
8
|
+
import { useForm } from "@mantine/form";
|
9
|
+
import { debug } from "console";
|
10
|
+
interface IDocument {
|
11
|
+
path?: string;
|
12
|
+
orderBy?: number;
|
13
|
+
documentType?: number;
|
14
|
+
promulgateDate?: Date;
|
15
|
+
decisionCode?: string;
|
16
|
+
departmentName?: string;
|
17
|
+
description?: string;
|
18
|
+
startDate?: Date;
|
19
|
+
endDate?: Date;
|
20
|
+
conclusion?: string;
|
21
|
+
note?: string;
|
22
|
+
documentAttributeId?: number;
|
23
|
+
documentAttributeName?: string;
|
24
|
+
isCycleCheck?: boolean;
|
25
|
+
meetingDate?: Date;
|
26
|
+
fileDetail?: {
|
27
|
+
fileBase64String?: string;
|
28
|
+
fileExtension?: string;
|
29
|
+
fileName?: string;
|
30
|
+
};
|
31
|
+
id?: number;
|
32
|
+
code?: string;
|
33
|
+
name?: string;
|
34
|
+
concurrencyStamp?: string;
|
35
|
+
isEnabled?: boolean;
|
36
|
+
ngayChinhSua?: Date;
|
37
|
+
nguoiChinhSua?: string;
|
38
|
+
}
|
39
|
+
interface I extends IDocument {
|
40
|
+
file?: File;
|
41
|
+
}
|
42
|
+
export function F_core16209_Update({ values }: { values: I }) {
|
43
|
+
const form = useForm<I>({
|
44
|
+
mode: "uncontrolled",
|
45
|
+
initialValues: {
|
46
|
+
...values,
|
47
|
+
file: new File(
|
48
|
+
[],
|
49
|
+
values.path?.split("/")[values.path.split("/").length - 1]!
|
50
|
+
),
|
51
|
+
startDate: new Date(values.startDate!),
|
52
|
+
endDate: new Date(values.endDate!),
|
53
|
+
meetingDate: new Date(values.meetingDate!),
|
54
|
+
},
|
55
|
+
validate: {
|
56
|
+
meetingDate: (value) => (value ? null : "Không được để trống"),
|
57
|
+
departmentName: (value) => (value ? null : "Không được để trống"),
|
58
|
+
description: (value) => (value ? null : "Không được để trống"),
|
59
|
+
file: (value) => (value ? null : "Không được để trống"),
|
60
|
+
startDate: (value) => (value ? null : "Không được để trống"),
|
61
|
+
endDate: (value, values) =>
|
62
|
+
value &&
|
63
|
+
values.startDate &&
|
64
|
+
new Date(value) > new Date(values.startDate)
|
65
|
+
? null
|
66
|
+
: "Ngày kết thúc phải lớn hơn ngày bắt đầu",
|
67
|
+
},
|
68
|
+
});
|
69
|
+
return (
|
70
|
+
<MyActionIconUpdate
|
71
|
+
form={form}
|
72
|
+
onSubmit={async (values) => {
|
73
|
+
return await baseAxios.post("/Document/Update", {
|
74
|
+
...values,
|
75
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
76
|
+
});
|
77
|
+
}}
|
78
|
+
>
|
79
|
+
<MyDateInput
|
80
|
+
withAsterisk
|
81
|
+
label="Ngày họp"
|
82
|
+
{...form.getInputProps("meetingDate")}
|
83
|
+
/>
|
84
|
+
<MyTextInput
|
85
|
+
withAsterisk
|
86
|
+
label="Đơn vị yêu cầu"
|
87
|
+
{...form.getInputProps("departmentName")}
|
88
|
+
/>
|
89
|
+
<MyTextInput
|
90
|
+
withAsterisk
|
91
|
+
label="Nội dung cải tiến"
|
92
|
+
{...form.getInputProps("description")}
|
93
|
+
/>
|
94
|
+
<MyTextInput label="Kết luận" {...form.getInputProps("conclusion")} />
|
95
|
+
<MyDateInput
|
96
|
+
withAsterisk
|
97
|
+
label="Ngày bắt đầu"
|
98
|
+
{...form.getInputProps("startDate")}
|
99
|
+
/>
|
100
|
+
<MyDateInput
|
101
|
+
withAsterisk
|
102
|
+
label="Ngày kết thúc"
|
103
|
+
{...form.getInputProps("endDate")}
|
104
|
+
/>
|
105
|
+
<FileInput
|
106
|
+
placeholder="Tải lên tài liệu"
|
107
|
+
withAsterisk
|
108
|
+
label="Tài liệu"
|
109
|
+
{...form.getInputProps("file")}
|
110
|
+
/>
|
111
|
+
<Textarea label="Ghi chú" {...form.getInputProps("note")}></Textarea>
|
112
|
+
</MyActionIconUpdate>
|
113
|
+
);
|
114
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { MyTab } from "@/components";
|
4
|
+
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
5
|
+
import { Tabs } from "@mantine/core";
|
6
|
+
import { F_core18256_Read } from "./F_core18256_Read";
|
7
|
+
|
8
|
+
|
9
|
+
const tabData = [
|
10
|
+
{ label: "1. Văn bản quy định" },
|
11
|
+
{ label: "2. Quy trình xử lý công việc" },
|
12
|
+
{ label: "3. Danh mục biểu mẫu" },
|
13
|
+
];
|
14
|
+
|
15
|
+
export function F_core18256() {
|
16
|
+
return (
|
17
|
+
<MyTab tabList={tabData}>
|
18
|
+
<Tabs.Panel value="1. Văn bản quy định">
|
19
|
+
<F_core18256_Read documentType={OBJECT_DOCUMENT_TYPES.Regulations} />
|
20
|
+
</Tabs.Panel>
|
21
|
+
<Tabs.Panel value="2. Quy trình xử lý công việc">
|
22
|
+
<F_core18256_Read documentType={OBJECT_DOCUMENT_TYPES.Workflow} />
|
23
|
+
</Tabs.Panel>
|
24
|
+
<Tabs.Panel value="3. Danh mục biểu mẫu">
|
25
|
+
<F_core18256_Read documentType={OBJECT_DOCUMENT_TYPES.Form} />
|
26
|
+
</Tabs.Panel>
|
27
|
+
</MyTab>
|
28
|
+
);
|
29
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
'use client'
|
2
|
+
import baseAxios from "@/api/baseAxios"
|
3
|
+
import { MyButtonCreate } from "@/components"
|
4
|
+
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput"
|
5
|
+
import { useForm } from "@mantine/form"
|
6
|
+
interface I {
|
7
|
+
name?: string,
|
8
|
+
code?: string,
|
9
|
+
documentType?: number
|
10
|
+
}
|
11
|
+
|
12
|
+
export function F_core18256_Create(
|
13
|
+
{ documentType }: { documentType: number }
|
14
|
+
) {
|
15
|
+
const form = useForm<I>({
|
16
|
+
mode: "uncontrolled",
|
17
|
+
initialValues: {
|
18
|
+
name: "",
|
19
|
+
code: "",
|
20
|
+
documentType: documentType
|
21
|
+
},
|
22
|
+
validate: {
|
23
|
+
name: (value) => value ? null : 'Không được để trống'
|
24
|
+
}
|
25
|
+
})
|
26
|
+
return (
|
27
|
+
<MyButtonCreate objectName="Loại văn bản" form={form} onSubmit={(values) => baseAxios.post("/DocumentAttribute/Create", values)}>
|
28
|
+
<MyTextInput label="Mã loại văn bản" {...form.getInputProps("code")} />
|
29
|
+
<MyTextInput label="Tên loại văn bản" {...form.getInputProps("name")} />
|
30
|
+
</MyButtonCreate>
|
31
|
+
)
|
32
|
+
}
|
33
|
+
|
34
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
'use client'
|
2
|
+
|
3
|
+
import baseAxios from "@/api/baseAxios"
|
4
|
+
import { MyActionIconDelete } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete"
|
5
|
+
|
6
|
+
export function F_core18256_Delete({ id }: { id: number }) {
|
7
|
+
return (
|
8
|
+
<MyActionIconDelete
|
9
|
+
onSubmit={
|
10
|
+
async () => await baseAxios.post("/DocumentAttribute/Delete", { id: id })
|
11
|
+
}
|
12
|
+
/>
|
13
|
+
)
|
14
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
'use client'
|
2
|
+
|
3
|
+
import baseAxios from "@/api/baseAxios";
|
4
|
+
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull";
|
5
|
+
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
6
|
+
import { useQuery } from "@tanstack/react-query";
|
7
|
+
import { MRT_ColumnDef } from "mantine-react-table";
|
8
|
+
import { useMemo } from "react";
|
9
|
+
import { F_core18256_Create } from "./F_core18256_Create";
|
10
|
+
import { F_core18256_Delete } from "./F_core18256_Delete";
|
11
|
+
import { F_core18256_Update } from "./F_core18256_Update";
|
12
|
+
|
13
|
+
interface I {
|
14
|
+
id?: number, name?: string, code?: string
|
15
|
+
}
|
16
|
+
export function F_core18256_Read({ documentType }: { documentType: number }
|
17
|
+
) {
|
18
|
+
const documentAttributeQuery = useQuery<I[]>({
|
19
|
+
queryKey: ['F_core18256_Read', documentType],
|
20
|
+
queryFn: async () => {
|
21
|
+
const result = await baseAxios.get("/DocumentAttribute/GetByType?", { params: { documentType } })
|
22
|
+
return result.data?.data || []
|
23
|
+
},
|
24
|
+
})
|
25
|
+
|
26
|
+
const columns = useMemo<MRT_ColumnDef<I>[]>(
|
27
|
+
() => [
|
28
|
+
{
|
29
|
+
header: "Mã loại văn bản",
|
30
|
+
accessorKey: "code"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
header: "Tên Loại Văn Bản",
|
34
|
+
accessorKey: "name"
|
35
|
+
}
|
36
|
+
],
|
37
|
+
[]
|
38
|
+
);
|
39
|
+
|
40
|
+
if (documentAttributeQuery.isLoading) return "Đang tải dữ liệu..."
|
41
|
+
if (documentAttributeQuery.isError) return "Có lỗi xảy ra!"
|
42
|
+
return (
|
43
|
+
<MyDataTable
|
44
|
+
columns={columns}
|
45
|
+
enableRowNumbers={true}
|
46
|
+
data={documentAttributeQuery.data!}
|
47
|
+
renderTopToolbarCustomActions={() => <F_core18256_Create documentType={documentType} />}
|
48
|
+
renderRowActions={({ row }) => {
|
49
|
+
return (
|
50
|
+
<MyCenterFull>
|
51
|
+
<F_core18256_Update values={row.original} />
|
52
|
+
<F_core18256_Delete id={row.original.id!} />
|
53
|
+
</MyCenterFull>
|
54
|
+
)
|
55
|
+
}}
|
56
|
+
/>
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import baseAxios from "@/api/baseAxios";
|
2
|
+
import { Select, SelectProps } from "@mantine/core";
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
4
|
+
|
5
|
+
interface ISelect extends SelectProps {
|
6
|
+
documentTypeId?: number
|
7
|
+
label?: string;
|
8
|
+
dataMapper?: (item: any) => { value: string; label: string }; // Hàm tùy chỉnh cách map dữ liệu
|
9
|
+
}
|
10
|
+
|
11
|
+
export function F_core18256_Select({ documentTypeId, label = "", dataMapper, ...rest }: ISelect) {
|
12
|
+
|
13
|
+
const query = useQuery({
|
14
|
+
queryKey: [`/DocumentAttribute/GetByType?documentType=${documentTypeId}`],
|
15
|
+
queryFn: async () => {
|
16
|
+
const result = (await baseAxios.get(`/DocumentAttribute/GetByType?documentType=${documentTypeId}`)).data.data;
|
17
|
+
return result
|
18
|
+
},
|
19
|
+
});
|
20
|
+
|
21
|
+
if (query.isLoading) return "Loading...";
|
22
|
+
|
23
|
+
const data = query.data?.map((item: any) => {
|
24
|
+
if (dataMapper) return dataMapper(item)
|
25
|
+
return {
|
26
|
+
value: item.id?.toString()!,
|
27
|
+
label: `${item.code}-${item.name}`,
|
28
|
+
}
|
29
|
+
});
|
30
|
+
|
31
|
+
return (
|
32
|
+
<Select
|
33
|
+
label={label}
|
34
|
+
placeholder={`Chọn ${label?.toLowerCase()}`}
|
35
|
+
data={data}
|
36
|
+
{...rest}
|
37
|
+
value={rest.value?.toString()}
|
38
|
+
/>
|
39
|
+
);
|
40
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
'use client'
|
2
|
+
import baseAxios from "@/api/baseAxios"
|
3
|
+
import { MyActionIconUpdate } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate"
|
4
|
+
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput"
|
5
|
+
import { useForm } from "@mantine/form"
|
6
|
+
interface I {
|
7
|
+
id?: number, name?: string, code?: string
|
8
|
+
}
|
9
|
+
export function F_core18256_Update(
|
10
|
+
{ values }: { values: I }
|
11
|
+
) {
|
12
|
+
const form = useForm({
|
13
|
+
initialValues: values
|
14
|
+
})
|
15
|
+
|
16
|
+
return (
|
17
|
+
<MyActionIconUpdate form={form} onSubmit={async (values) => await baseAxios.post("/DocumentAttribute/Update", values)}>
|
18
|
+
<MyTextInput label="Mã loại văn bản" {...form.getInputProps("code")} />
|
19
|
+
<MyTextInput label="Tên loại văn bản" {...form.getInputProps("name")} />
|
20
|
+
</MyActionIconUpdate>
|
21
|
+
)
|
22
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { MyFlexColumn, MyFlexEnd, MyPageContent } from "@/components";
|
2
|
+
import { F_core26965_Create } from "./F_core26965_Create";
|
3
|
+
import F_core26965_Read from "./F_core26965_Read";
|
4
|
+
import { Paper, Space } from "@mantine/core";
|
5
|
+
import { OBJECT_COlORS } from "@/constants/object/color";
|
6
|
+
|
7
|
+
export function F_core26965({ RegulationsTypeId }: { RegulationsTypeId: number }) {
|
8
|
+
return (
|
9
|
+
<Paper p={'md'}>
|
10
|
+
<MyFlexEnd>
|
11
|
+
<F_core26965_Create RegulationsTypeId={RegulationsTypeId} />
|
12
|
+
</MyFlexEnd>
|
13
|
+
<Space />
|
14
|
+
<F_core26965_Read RegulationsTypeId={RegulationsTypeId} />
|
15
|
+
</Paper>
|
16
|
+
)
|
17
|
+
}
|