aq-fe-framework 0.1.156 → 0.1.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JLT4BL7I.mjs → chunk-ZO7PLULO.mjs} +4 -4
- package/dist/{css.module-4ICLUKPO.module.css → components/index.css} +16 -29
- package/dist/components/index.mjs +2 -2
- package/dist/modules-features/index.css +100 -0
- package/dist/modules-features/index.mjs +5 -5
- package/package.json +1 -1
- package/dist/api/apiFactory.ts +0 -46
- package/dist/api/baseAxios.ts +0 -22
- package/dist/app/admin/(core)/core12196/page.tsx +0 -13
- package/dist/app/admin/(core)/core16209/page.tsx +0 -13
- package/dist/app/admin/(core)/core18256/page.tsx +0 -12
- package/dist/app/admin/(core)/core26965/page.tsx +0 -13
- package/dist/app/admin/(core)/core27311/page.tsx +0 -13
- package/dist/app/admin/(core)/core38677/page.tsx +0 -13
- package/dist/app/admin/(core)/core40207/page.tsx +0 -13
- package/dist/app/admin/(core)/core60524/page.tsx +0 -11
- package/dist/app/admin/(core)/core64229/page.tsx +0 -12
- package/dist/app/admin/(core)/core71678/page.tsx +0 -11
- package/dist/app/admin/(core)/core76318/page.tsx +0 -13
- package/dist/app/admin/(core)/core83092/page.tsx +0 -13
- package/dist/app/admin/[...slug]/page.tsx +0 -7
- package/dist/app/admin/error.tsx +0 -42
- package/dist/app/admin/layout.tsx +0 -21
- package/dist/app/admin/test/page.tsx +0 -44
- package/dist/app/auth/login/page.tsx +0 -14
- package/dist/app/globals.css +0 -59
- package/dist/app/layout.tsx +0 -39
- package/dist/app/page.tsx +0 -18
- package/dist/components/Aceternity/BoxesBackground/MyBoxes.tsx +0 -66
- package/dist/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx +0 -31
- package/dist/components/ActionIcons/ActionIcon/MyActionIcon.tsx +0 -47
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx +0 -81
- package/dist/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx +0 -68
- package/dist/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx +0 -50
- package/dist/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx +0 -13
- package/dist/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx +0 -113
- package/dist/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx +0 -19
- package/dist/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx +0 -63
- package/dist/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx +0 -36
- package/dist/components/AppSpotlight/MyAppSpotlight.tsx +0 -112
- package/dist/components/Buttons/Anchor/MyAnchorViewPDF.tsx +0 -46
- package/dist/components/Buttons/Button/MyButton.tsx +0 -90
- package/dist/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx +0 -81
- package/dist/components/Buttons/ButtonCRUD/AQButtonExportData.tsx +0 -75
- package/dist/components/Buttons/ButtonCRUD/MyButtonCreate.tsx +0 -68
- package/dist/components/Buttons/ButtonImport/MyButtonImport.tsx +0 -29
- package/dist/components/Buttons/ButtonImport/SelectFieldModal.tsx +0 -100
- package/dist/components/Buttons/ButtonImport/SelectFileModal.tsx +0 -81
- package/dist/components/Buttons/ButtonImport/useS_ButtonImport.ts +0 -196
- package/dist/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx +0 -71
- package/dist/components/Buttons/ButtonModal/MyButtonModal.tsx +0 -117
- package/dist/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx +0 -37
- package/dist/components/Buttons/ButtonPrintPDFTable/MyButtonPrintTablePDF.tsx +0 -174
- package/dist/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx +0 -29
- package/dist/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx +0 -121
- package/dist/components/Calendar/MyCalendar.tsx +0 -118
- package/dist/components/CenterFull/MyCenterFull.tsx +0 -10
- package/dist/components/Checkbox/MyCheckbox.tsx +0 -9
- package/dist/components/Combobox/Select/MySelect.tsx +0 -12
- package/dist/components/DataDisplay/Card/AQCard.tsx +0 -49
- package/dist/components/DataDisplay/CardInformation/MyCardInformation.tsx +0 -77
- package/dist/components/DataDisplay/DataTable/MyDataTable.tsx +0 -184
- package/dist/components/DataDisplay/IconText/MyIconText.tsx +0 -17
- package/dist/components/DataDisplay/KeyLabel/MyKeyLabel.tsx +0 -15
- package/dist/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx +0 -9
- package/dist/components/DataDisplay/StatCard/AQStatCard1.tsx +0 -68
- package/dist/components/FaviconSetter/FaviconSetter.tsx +0 -33
- package/dist/components/Inputs/DateInput/MyDateInput.tsx +0 -11
- package/dist/components/Inputs/Fieldset/MyFieldset.tsx +0 -32
- package/dist/components/Inputs/FileInput/MyFileInput.tsx +0 -12
- package/dist/components/Inputs/NumberInput/MyNumberInput.tsx +0 -12
- package/dist/components/Inputs/TextArea/MyTextArea.tsx +0 -11
- package/dist/components/Inputs/TextEditor/MyTextEditor.tsx +0 -191
- package/dist/components/Inputs/TextInput/MyTextInput.tsx +0 -30
- package/dist/components/Layouts/BasicAppShell/BasicAppShell.tsx +0 -357
- package/dist/components/Layouts/BasicAppShell/css.module.css +0 -62
- package/dist/components/Layouts/BasicAppShell/useS_BasicAppShell.ts +0 -64
- package/dist/components/Layouts/Container/MyContainer.tsx +0 -16
- package/dist/components/Layouts/FlexColumn/MyFlexColumn.tsx +0 -14
- package/dist/components/Layouts/FlexEnd/MyFlexEnd.tsx +0 -14
- package/dist/components/Layouts/FlexRow/MyFlexRow.tsx +0 -14
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenu.tsx +0 -147
- package/dist/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts +0 -19
- package/dist/components/Layouts/HeaderMegaMenu/css.module.css +0 -50
- package/dist/components/Layouts/HtmlWrapper/MyHtmlWrapper.tsx +0 -29
- package/dist/components/Layouts/PageContent/MyPageContent.tsx +0 -67
- package/dist/components/Layouts/Tab/MyTab.tsx +0 -33
- package/dist/components/Loaders/MyCardioLoader.tsx +0 -12
- package/dist/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx +0 -61
- package/dist/components/RESTAPIComponents/SelectAPIGet/MySelectAPIGet.tsx +0 -37
- package/dist/components/ScheduleX/MyScheduleX.tsx +0 -58
- package/dist/components/Skeletons/SkeletonTable/MySkeletonTable.tsx +0 -9
- package/dist/components/index.ts +0 -62
- package/dist/constants/array/daysOfWeek.ts +0 -9
- package/dist/constants/enum/ENUM_EMAILCONFIG.ts +0 -6
- package/dist/constants/enum/global.ts +0 -26
- package/dist/constants/object/color.ts +0 -5
- package/dist/constants/object/documentTypes.ts +0 -8
- package/dist/css.module-P45UW6UZ.module.css +0 -4
- package/dist/data/menuData.ts +0 -31
- package/dist/hooks/custom-hooks/useC_MutationAction.tsx +0 -36
- package/dist/hooks/index.ts +0 -2
- package/dist/hooks/query/AQ/useQ_AQ_GetAQModule.ts +0 -14
- package/dist/interfaces/EmailConfig.ts +0 -10
- package/dist/interfaces/IAQModule.ts +0 -21
- package/dist/interfaces/base.ts +0 -9
- package/dist/interfaces/global-interface/IAQSSO.ts +0 -15
- package/dist/interfaces/global-interface/IAQSyncData.ts +0 -9
- package/dist/interfaces/global-interface/IAcademicYear.ts +0 -12
- package/dist/interfaces/global-interface/IChangePassWord.ts +0 -8
- package/dist/interfaces/global-interface/IComplaintProccess.ts +0 -9
- package/dist/interfaces/global-interface/ICreateAccount.ts +0 -24
- package/dist/interfaces/global-interface/IDocument.ts +0 -25
- package/dist/interfaces/global-interface/IDocumentAttribute.ts +0 -12
- package/dist/interfaces/global-interface/IEvent.ts +0 -30
- package/dist/interfaces/global-interface/IEventComplaint.ts +0 -20
- package/dist/interfaces/global-interface/IEventFillter.ts +0 -14
- package/dist/interfaces/global-interface/IFile.ts +0 -8
- package/dist/interfaces/global-interface/IImportStudentPaticipation.ts +0 -8
- package/dist/interfaces/global-interface/IPagePermission.ts +0 -12
- package/dist/interfaces/global-interface/IRolePermission.ts +0 -7
- package/dist/interfaces/global-interface/ISRMUserinfo.ts +0 -35
- package/dist/interfaces/global-interface/IScientificProfileProjectUser.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroup.ts +0 -15
- package/dist/interfaces/global-interface/IScientificProfileResearchGroupUser.ts +0 -14
- package/dist/interfaces/global-interface/IScientificProfileResearchProject.ts +0 -21
- package/dist/interfaces/global-interface/ISignIn.ts +0 -7
- package/dist/interfaces/global-interface/ISystemCatalogAcademicYear.ts +0 -15
- package/dist/interfaces/global-interface/ISystemCatalogDomainCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectLevelCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogProjectTypeCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogRoleActivity.ts +0 -11
- package/dist/interfaces/global-interface/ISystemCatalogTaskCategory.ts +0 -11
- package/dist/interfaces/global-interface/ISystemManagementAcademicHistory.ts +0 -31
- package/dist/interfaces/global-interface/ISystemManagementProfessionalWorkHistory.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementPublishedScientificWork.ts +0 -14
- package/dist/interfaces/global-interface/ISystemManagementRoleGroup.ts +0 -12
- package/dist/interfaces/global-interface/ISystemManagementRoleGroupMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/ISystemManagementScientificResearchProject.ts +0 -16
- package/dist/interfaces/global-interface/ISystemManagementUserMenuPermission.ts +0 -18
- package/dist/interfaces/global-interface/IUpdateAccount.ts +0 -15
- package/dist/interfaces/global-interface/IUser.ts +0 -21
- package/dist/interfaces/global-interface/IUserPermission.ts +0 -7
- package/dist/lib/utils.ts +0 -6
- package/dist/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx +0 -87
- package/dist/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx +0 -65
- package/dist/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx +0 -82
- package/dist/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx +0 -67
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx +0 -77
- package/dist/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx +0 -78
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx +0 -69
- package/dist/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx +0 -64
- package/dist/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx +0 -311
- package/dist/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx +0 -311
- package/dist/modules-features/admin/core/core12196/F_core12196.tsx +0 -20
- package/dist/modules-features/admin/core/core12196/F_core12196_Create.tsx +0 -101
- package/dist/modules-features/admin/core/core12196/F_core12196_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core12196/F_core12196_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core12196/F_core12196_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209.tsx +0 -108
- package/dist/modules-features/admin/core/core16209/F_core16209_Create.tsx +0 -112
- package/dist/modules-features/admin/core/core16209/F_core16209_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core16209/F_core16209_Update.tsx +0 -114
- package/dist/modules-features/admin/core/core18256/F_core18256.tsx +0 -29
- package/dist/modules-features/admin/core/core18256/F_core18256_Create.tsx +0 -34
- package/dist/modules-features/admin/core/core18256/F_core18256_Delete.tsx +0 -14
- package/dist/modules-features/admin/core/core18256/F_core18256_Read.tsx +0 -59
- package/dist/modules-features/admin/core/core18256/F_core18256_Select.tsx +0 -40
- package/dist/modules-features/admin/core/core18256/F_core18256_Update.tsx +0 -22
- package/dist/modules-features/admin/core/core26965/F_core26965.tsx +0 -17
- package/dist/modules-features/admin/core/core26965/F_core26965_Create.tsx +0 -106
- package/dist/modules-features/admin/core/core26965/F_core26965_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core26965/F_core26965_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core26965/F_core26965_Update.tsx +0 -112
- package/dist/modules-features/admin/core/core27311/F_core27311.tsx +0 -21
- package/dist/modules-features/admin/core/core27311/F_core27311_Create.tsx +0 -109
- package/dist/modules-features/admin/core/core27311/F_core27311_Delete.tsx +0 -19
- package/dist/modules-features/admin/core/core27311/F_core27311_Read.tsx +0 -165
- package/dist/modules-features/admin/core/core27311/F_core27311_Update.tsx +0 -113
- package/dist/modules-features/admin/core/core35923/F_core35923.tsx +0 -46
- package/dist/modules-features/admin/core/core38677/F_core38677.tsx +0 -28
- package/dist/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx +0 -79
- package/dist/modules-features/admin/core/core38677/F_core38677_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx +0 -264
- package/dist/modules-features/admin/core/core40207/F_core40207.tsx +0 -9
- package/dist/modules-features/admin/core/core40207/F_core40207_Create.tsx +0 -81
- package/dist/modules-features/admin/core/core40207/F_core40207_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core40207/F_core40207_Read.tsx +0 -98
- package/dist/modules-features/admin/core/core40207/F_core40207_Update.tsx +0 -83
- package/dist/modules-features/admin/core/core47643/F_core47643.tsx +0 -10
- package/dist/modules-features/admin/core/core47643/F_core47643_Delete.tsx +0 -13
- package/dist/modules-features/admin/core/core47643/F_core47643_Form.tsx +0 -34
- package/dist/modules-features/admin/core/core47643/F_core47643_Read.tsx +0 -57
- package/dist/modules-features/admin/core/core60524/F_core60524.tsx +0 -13
- package/dist/modules-features/admin/core/core60524/F_core60524_Form.tsx +0 -111
- package/dist/modules-features/admin/core/core60524/F_core60524_Save.tsx +0 -56
- package/dist/modules-features/admin/core/core60524/useS_core60524.ts +0 -16
- package/dist/modules-features/admin/core/core64229/F_core64229.tsx +0 -7
- package/dist/modules-features/admin/core/core64229/F_core64229_Delete.tsx +0 -21
- package/dist/modules-features/admin/core/core64229/F_core64229_Form.tsx +0 -95
- package/dist/modules-features/admin/core/core64229/F_core64229_Read.tsx +0 -67
- package/dist/modules-features/admin/core/core71678/F_core71678.tsx +0 -8
- package/dist/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx +0 -117
- package/dist/modules-features/admin/core/core71678/F_core71678_Create.tsx +0 -61
- package/dist/modules-features/admin/core/core71678/F_core71678_Delete.tsx +0 -16
- package/dist/modules-features/admin/core/core71678/F_core71678_Read.tsx +0 -92
- package/dist/modules-features/admin/core/core71678/F_core71678_Update.tsx +0 -49
- package/dist/modules-features/admin/core/core76318/F_core76318.tsx +0 -9
- package/dist/modules-features/admin/core/core76318/F_core76318_Create.tsx +0 -89
- package/dist/modules-features/admin/core/core76318/F_core76318_Delete.tsx +0 -17
- package/dist/modules-features/admin/core/core76318/F_core76318_Read.tsx +0 -104
- package/dist/modules-features/admin/core/core76318/F_core76318_Update.tsx +0 -89
- package/dist/modules-features/admin/core/core83092/F_core83092.tsx +0 -27
- package/dist/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx +0 -85
- package/dist/modules-features/admin/core/core83092/F_core83092_Save.tsx +0 -52
- package/dist/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx +0 -263
- package/dist/modules-features/admin/core/core83092/useS_core83092.tsx +0 -70
- package/dist/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx +0 -154
- package/dist/modules-features/authenticate/F_authenticate_Login/css.module.css +0 -4
- package/dist/modules-features/authenticate/F_authenticate_Logout.tsx +0 -22
- package/dist/modules-features/authenticate/F_authenticate_SplashPage.tsx +0 -21
- package/dist/modules-features/authenticate/useS_authenticate.ts +0 -23
- package/dist/modules-features/index.ts +0 -79
- package/dist/providers/MyMantineProvider.tsx +0 -140
- package/dist/providers/MyReactQueryProvider.tsx +0 -24
- package/dist/providers/Provider.tsx +0 -13
- package/dist/providers/mantine.module.css +0 -21
- package/dist/stores/CreateGenericStore.ts +0 -23
- package/dist/stores/index.ts +0 -1
- package/dist/types/types.ts +0 -16
- package/dist/utils/index.ts +0 -9
- package/dist/utils/utils_converter.ts +0 -39
- package/dist/utils/utils_currency.ts +0 -5
- package/dist/utils/utils_date.ts +0 -34
- package/dist/utils/utils_excel.ts +0 -128
- package/dist/utils/utils_file.ts +0 -61
- package/dist/utils/utils_notification.ts +0 -46
- package/dist/utils/utils_pdf.ts +0 -21
- package/dist/utils/utils_time.ts +0 -15
- package/dist/utils/utils_validateForm.ts +0 -9
@@ -1,57 +0,0 @@
|
|
1
|
-
import baseAxios from "@/api/baseAxios"
|
2
|
-
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull"
|
3
|
-
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable"
|
4
|
-
|
5
|
-
import { Group } from "@mantine/core"
|
6
|
-
import { useQuery } from "@tanstack/react-query"
|
7
|
-
import { MRT_ColumnDef } from "mantine-react-table"
|
8
|
-
import { useMemo } from "react"
|
9
|
-
import { F_core47643_Delete } from "./F_core47643_Delete"
|
10
|
-
import { F_core47643_Form } from "./F_core47643_Form"
|
11
|
-
import { IBaseEntity } from "@/interfaces/base"
|
12
|
-
|
13
|
-
interface I extends IBaseEntity { }
|
14
|
-
|
15
|
-
export function F_core47643_Read() {
|
16
|
-
const query = useQ_core47643_GetAdminRole()
|
17
|
-
const columns = useMemo<MRT_ColumnDef<I>[]>(() => [
|
18
|
-
{
|
19
|
-
header: "Mã",
|
20
|
-
accessorKey: "code"
|
21
|
-
},
|
22
|
-
{
|
23
|
-
header: "Quyền",
|
24
|
-
accessorKey: "name"
|
25
|
-
}
|
26
|
-
], [])
|
27
|
-
if (query.isLoading) return "Đang tải dữ liệu..."
|
28
|
-
if (query.isError) return "Có lỗi xảy ra!"
|
29
|
-
return (
|
30
|
-
<MyDataTable
|
31
|
-
data={query.data!}
|
32
|
-
columns={columns}
|
33
|
-
renderTopToolbarCustomActions={() => (
|
34
|
-
<Group>
|
35
|
-
<F_core47643_Form />
|
36
|
-
</Group>
|
37
|
-
)}
|
38
|
-
renderRowActions={({ row }) => (
|
39
|
-
<MyCenterFull>
|
40
|
-
<F_core47643_Form values={row.original} />
|
41
|
-
<F_core47643_Delete values={row.original} />
|
42
|
-
</MyCenterFull>
|
43
|
-
)}
|
44
|
-
/>
|
45
|
-
)
|
46
|
-
}
|
47
|
-
|
48
|
-
function useQ_core47643_GetAdminRole() {
|
49
|
-
const query = useQuery({
|
50
|
-
queryKey: ["useQ_core47643_GetAdminRole"],
|
51
|
-
queryFn: async () => {
|
52
|
-
const res = await baseAxios.get("/Role/GetAdminRole")
|
53
|
-
return res.data.data
|
54
|
-
}
|
55
|
-
})
|
56
|
-
return query
|
57
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { useEffect } from 'react'
|
2
|
-
import F_core60524_Form from './F_core60524_Form'
|
3
|
-
import { useS_core60524 } from './useS_core60524'
|
4
|
-
|
5
|
-
export function F_core60524({ AQModuleId }: { AQModuleId: number }) {
|
6
|
-
const store = useS_core60524()
|
7
|
-
useEffect(() => {
|
8
|
-
store.setProperty("AQModuleId", AQModuleId)
|
9
|
-
}, [])
|
10
|
-
return (
|
11
|
-
<F_core60524_Form />
|
12
|
-
)
|
13
|
-
}
|
@@ -1,111 +0,0 @@
|
|
1
|
-
import { MyDateInput, MyFlexEnd } from "@/components";
|
2
|
-
import { MyFileInput } from "@/components/Inputs/FileInput/MyFileInput";
|
3
|
-
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
4
|
-
import { useQ_AQ_GetAQModule } from "@/hooks/query/AQ/useQ_AQ_GetAQModule";
|
5
|
-
import { IAQModule } from "@/interfaces/IAQModule";
|
6
|
-
import { utils_file_fileToAQDocumentType } from "@/utils";
|
7
|
-
import { Grid, Paper } from "@mantine/core";
|
8
|
-
import { useForm } from "@mantine/form";
|
9
|
-
import { useEffect } from "react";
|
10
|
-
import F_core60524_Save from "./F_core60524_Save";
|
11
|
-
|
12
|
-
|
13
|
-
export interface I_core60524_AQModule extends IAQModule {
|
14
|
-
faviconFile?: File,
|
15
|
-
logoFile?: File
|
16
|
-
}
|
17
|
-
|
18
|
-
export default function F_core60524_Form() {
|
19
|
-
const query = useQ_AQ_GetAQModule()
|
20
|
-
const form = useForm<I_core60524_AQModule>({
|
21
|
-
mode: "uncontrolled",
|
22
|
-
validate: {
|
23
|
-
faviconFileDetail: (value) => value ? null : "Không được để trống",
|
24
|
-
logoFileDetail: (value) => value ? null : "Không được để trống",
|
25
|
-
}
|
26
|
-
})
|
27
|
-
|
28
|
-
useEffect(() => {
|
29
|
-
// Set giá trị mặc định
|
30
|
-
if (!query.data) return
|
31
|
-
const values = {
|
32
|
-
code: query.data.code || "",
|
33
|
-
name: query.data.name || "",
|
34
|
-
officelName: query.data.officelName || "",
|
35
|
-
email: query.data.email || "",
|
36
|
-
phoneNumber: query.data.phoneNumber || "",
|
37
|
-
registrationDate: new Date(query.data.registrationDate!) || new Date(),
|
38
|
-
limiteDate: new Date(query.data.limiteDate!) || new Date(),
|
39
|
-
faviconPath: query.data.faviconPath || "",
|
40
|
-
logoPath: query.data.logoPath || "",
|
41
|
-
faviconFile: new File([], query.data.faviconFileDetail?.fileName!),
|
42
|
-
logoFile: new File([], query.data.logoFileDetail?.fileName!),
|
43
|
-
|
44
|
-
faviconFileDetail: query.data.faviconFileDetail,
|
45
|
-
logoFileDetail: query.data.logoFileDetail
|
46
|
-
}
|
47
|
-
form.setInitialValues(values)
|
48
|
-
form.setValues(values)
|
49
|
-
}, [query.data]);
|
50
|
-
|
51
|
-
return (
|
52
|
-
<Paper p={'md'}>
|
53
|
-
<Grid>
|
54
|
-
<Grid.Col span={5}>
|
55
|
-
<MyTextInput {...form.getInputProps("code")} label="Mã module" disabled />
|
56
|
-
</Grid.Col>
|
57
|
-
<Grid.Col span={{ base: 12, md: 7 }}>
|
58
|
-
<MyTextInput {...form.getInputProps("name")} label="Tên module" />
|
59
|
-
</Grid.Col>
|
60
|
-
<Grid.Col span={12}>
|
61
|
-
<MyTextInput {...form.getInputProps("officelName")} label="Tên đơn vị chủ quản" />
|
62
|
-
</Grid.Col>
|
63
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
64
|
-
<MyTextInput {...form.getInputProps("email")} label="Email" />
|
65
|
-
</Grid.Col>
|
66
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
67
|
-
<MyTextInput isPhoneNumber {...form.getInputProps("phoneNumber")} label="Số điện thoại" />
|
68
|
-
</Grid.Col>
|
69
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
70
|
-
<MyDateInput
|
71
|
-
value={form.getValues().registrationDate}
|
72
|
-
onChange={(date) => form.setFieldValue("registrationDate", new Date(date)!)}
|
73
|
-
label="Ngày đăng ký"
|
74
|
-
/>
|
75
|
-
</Grid.Col>
|
76
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
77
|
-
<MyDateInput
|
78
|
-
value={form.getValues().limiteDate}
|
79
|
-
onChange={(date) => form.setFieldValue("limiteDate", new Date(date)!)}
|
80
|
-
label="Ngày hết hạn"
|
81
|
-
/>
|
82
|
-
</Grid.Col>
|
83
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
84
|
-
<MyFileInput
|
85
|
-
accept="image/png,image/jpeg"
|
86
|
-
label="Favicon (16px x 16px)"
|
87
|
-
value={form.getValues().faviconFile}
|
88
|
-
onChange={async (e) => {
|
89
|
-
form.setFieldValue("faviconFile", e!)
|
90
|
-
form.setFieldValue("faviconFileDetail", await utils_file_fileToAQDocumentType(e!))
|
91
|
-
}}
|
92
|
-
/>
|
93
|
-
</Grid.Col>
|
94
|
-
<Grid.Col span={{ base: 12, md: 6 }}>
|
95
|
-
<MyFileInput
|
96
|
-
accept="image/png,image/jpeg"
|
97
|
-
label="Logo (330px x 115px)"
|
98
|
-
value={form.getValues().logoFile}
|
99
|
-
onChange={async (e) => {
|
100
|
-
form.setFieldValue("logoFile", e!)
|
101
|
-
form.setFieldValue("logoFileDetail", await utils_file_fileToAQDocumentType(e!))
|
102
|
-
}}
|
103
|
-
/>
|
104
|
-
</Grid.Col>
|
105
|
-
</Grid>
|
106
|
-
<MyFlexEnd>
|
107
|
-
<F_core60524_Save form={form} />
|
108
|
-
</MyFlexEnd>
|
109
|
-
</Paper>
|
110
|
-
)
|
111
|
-
}
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios';
|
2
|
-
import { MyButton } from '@/components';
|
3
|
-
import { utils_notification_show } from '@/utils';
|
4
|
-
import { useForm } from '@mantine/form';
|
5
|
-
import { useMutation } from '@tanstack/react-query';
|
6
|
-
import { I_core60524_AQModule } from './F_core60524_Form';
|
7
|
-
import { useS_core60524 } from './useS_core60524';
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
export default function F_core60524_Save({
|
12
|
-
form
|
13
|
-
}: {
|
14
|
-
form: ReturnType<typeof useForm<I_core60524_AQModule>>
|
15
|
-
}) {
|
16
|
-
const store = useS_core60524()
|
17
|
-
const mutation = useMutation({
|
18
|
-
mutationFn: async (body: I_core60524_AQModule) => {
|
19
|
-
const res = await baseAxios.post("/AQ/UpdateAQSetting", body)
|
20
|
-
return res
|
21
|
-
}
|
22
|
-
})
|
23
|
-
|
24
|
-
async function handleSave() {
|
25
|
-
const { faviconFile, logoFile, ...formValues } = form.getValues()
|
26
|
-
mutation.mutate({
|
27
|
-
...formValues,
|
28
|
-
logoFileDetail: form.isDirty("logoFileDetail") == false ? {
|
29
|
-
fileName: formValues.logoFileDetail?.fileName,
|
30
|
-
fileExtension: formValues.logoFileDetail?.fileExtension,
|
31
|
-
fileBase64String: "",
|
32
|
-
} : formValues.logoFileDetail,
|
33
|
-
|
34
|
-
faviconFileDetail: form.isDirty("faviconFileDetail") == false ? {
|
35
|
-
fileName: formValues.faviconFileDetail?.fileName,
|
36
|
-
fileExtension: formValues.faviconFileDetail?.fileExtension,
|
37
|
-
fileBase64String: "",
|
38
|
-
} : formValues.faviconFileDetail,
|
39
|
-
id: store.state.AQModuleId,
|
40
|
-
}, {
|
41
|
-
onSuccess: () => {
|
42
|
-
utils_notification_show({
|
43
|
-
crudType: "update"
|
44
|
-
})
|
45
|
-
}
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
return (
|
50
|
-
<MyButton
|
51
|
-
disabled={!form.isDirty()}
|
52
|
-
crudType='save'
|
53
|
-
onClick={handleSave}
|
54
|
-
/>
|
55
|
-
)
|
56
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { createGenericStore } from "@/stores";
|
2
|
-
|
3
|
-
interface I {
|
4
|
-
AQModuleId?: number
|
5
|
-
}
|
6
|
-
|
7
|
-
const useStore = createGenericStore<I>({
|
8
|
-
initialState: {}
|
9
|
-
})
|
10
|
-
|
11
|
-
export function useS_core60524() {
|
12
|
-
const store = useStore()
|
13
|
-
return {
|
14
|
-
...store,
|
15
|
-
}
|
16
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios'
|
2
|
-
import { MyActionIconDelete, MyActionIconUpdate, MyButtonCreate, MyButtonImport, MyFlexColumn, MyNumberInput, MySelect, MyTextInput } from '@/components'
|
3
|
-
import { ENUM_EMAILCONFIG_MODULE } from '@/constants/enum/ENUM_EMAILCONFIG'
|
4
|
-
import { IBaseEntity } from '@/interfaces/base'
|
5
|
-
import { utils_converter_enumToSelectOptions } from '@/utils'
|
6
|
-
import { NumberInput, PasswordInput } from '@mantine/core'
|
7
|
-
import { useForm } from '@mantine/form'
|
8
|
-
import React from 'react'
|
9
|
-
|
10
|
-
export function F_core64229_Delete({ values }: { values: IBaseEntity }) {
|
11
|
-
return (
|
12
|
-
<MyActionIconDelete
|
13
|
-
contextData={values?.code}
|
14
|
-
onSubmit={() => {
|
15
|
-
return baseAxios.post("/EmailConfig/Delete", {
|
16
|
-
id: values?.id
|
17
|
-
})
|
18
|
-
}}
|
19
|
-
/>
|
20
|
-
)
|
21
|
-
}
|
@@ -1,95 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios'
|
2
|
-
import { MyActionIconUpdate, MyButtonCreate, MyButtonImport, MyFlexColumn, MyNumberInput, MySelect, MyTextInput } from '@/components'
|
3
|
-
import { ENUM_EMAILCONFIG_MODULE } from '@/constants/enum/ENUM_EMAILCONFIG'
|
4
|
-
import { IEmailConfig } from '@/interfaces/EmailConfig'
|
5
|
-
import { utils_converter_enumToSelectOptions } from '@/utils'
|
6
|
-
import { NumberInput, PasswordInput } from '@mantine/core'
|
7
|
-
import { useForm } from '@mantine/form'
|
8
|
-
import React from 'react'
|
9
|
-
|
10
|
-
interface I extends IEmailConfig {
|
11
|
-
password?: string
|
12
|
-
}
|
13
|
-
export function F_core64229_Form({ values }: { values?: I }) {
|
14
|
-
const form = useForm<I>({
|
15
|
-
mode: "uncontrolled",
|
16
|
-
initialValues: values ? values : {
|
17
|
-
emailModule: ENUM_EMAILCONFIG_MODULE["Đào tạo"],
|
18
|
-
}
|
19
|
-
})
|
20
|
-
|
21
|
-
function handleSubmit() {
|
22
|
-
const formValues = form.getValues()
|
23
|
-
return baseAxios.post(`/EmailConfig/${values ? "update" : "create"}`, {
|
24
|
-
"id": values ? formValues.id : 0,
|
25
|
-
"code": "string",
|
26
|
-
"name": "string",
|
27
|
-
"concurrencyStamp": "string",
|
28
|
-
"isEnabled": true,
|
29
|
-
"order": 0,
|
30
|
-
"emailModule": formValues.emailModule,
|
31
|
-
"hostMailServer": formValues.hostMailServer,
|
32
|
-
"outgoingPort": formValues.outgoingPort,
|
33
|
-
"incomingPort": formValues.incomingPort,
|
34
|
-
"sll": formValues.sll,
|
35
|
-
"userName": formValues.userName,
|
36
|
-
"password": formValues.password,
|
37
|
-
})
|
38
|
-
}
|
39
|
-
|
40
|
-
if (values) return (
|
41
|
-
<MyActionIconUpdate
|
42
|
-
form={form}
|
43
|
-
onSubmit={handleSubmit}
|
44
|
-
>
|
45
|
-
<FormInput form={form} />
|
46
|
-
</MyActionIconUpdate>
|
47
|
-
)
|
48
|
-
return (
|
49
|
-
<MyButtonCreate
|
50
|
-
form={form}
|
51
|
-
onSubmit={handleSubmit}>
|
52
|
-
<FormInput form={form} />
|
53
|
-
</MyButtonCreate>
|
54
|
-
)
|
55
|
-
}
|
56
|
-
|
57
|
-
function FormInput({ form }: { form: ReturnType<typeof useForm<I>> }) {
|
58
|
-
return (
|
59
|
-
<MyFlexColumn>
|
60
|
-
<MySelect
|
61
|
-
label='Phân hệ'
|
62
|
-
data={utils_converter_enumToSelectOptions(ENUM_EMAILCONFIG_MODULE)}
|
63
|
-
{...form.getInputProps("emailModule")}
|
64
|
-
value={form.getValues().emailModule?.toString()}
|
65
|
-
/>
|
66
|
-
<MyTextInput
|
67
|
-
label='Host mail server'
|
68
|
-
{...form.getInputProps("hostMailServer")}
|
69
|
-
/>
|
70
|
-
<MyNumberInput
|
71
|
-
label='Outgoing port'
|
72
|
-
{...form.getInputProps("outgoingPort")}
|
73
|
-
/>
|
74
|
-
<MyNumberInput
|
75
|
-
label='Incoming port'
|
76
|
-
{...form.getInputProps("incomingPort")}
|
77
|
-
/>
|
78
|
-
<MySelect
|
79
|
-
label='SSL'
|
80
|
-
data={["true", "false"]}
|
81
|
-
value={form.getValues().sll?.toString()}
|
82
|
-
onChange={(e) => form.setFieldValue("sll", e == "true" ? true : false)}
|
83
|
-
/>
|
84
|
-
<MyTextInput
|
85
|
-
label='Username'
|
86
|
-
{...form.getInputProps("userName")}
|
87
|
-
/>
|
88
|
-
<PasswordInput
|
89
|
-
label='Password'
|
90
|
-
placeholder='Nhập password'
|
91
|
-
{...form.getInputProps("password")}
|
92
|
-
/>
|
93
|
-
</MyFlexColumn>
|
94
|
-
);
|
95
|
-
}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios'
|
2
|
-
import { MyCenterFull, MyDataTable } from '@/components'
|
3
|
-
import { ENUM_EMAILCONFIG_MODULE } from '@/constants/enum/ENUM_EMAILCONFIG'
|
4
|
-
import { useQuery } from '@tanstack/react-query'
|
5
|
-
import { MRT_ColumnDef } from 'mantine-react-table'
|
6
|
-
import React, { useMemo } from 'react'
|
7
|
-
import { F_core64229_Form } from './F_core64229_Form'
|
8
|
-
import { F_core64229_Delete } from './F_core64229_Delete'
|
9
|
-
import { IEmailConfig } from '@/interfaces/EmailConfig'
|
10
|
-
|
11
|
-
export function F_core64229_Read() {
|
12
|
-
const query = useQuery<IEmailConfig[]>({
|
13
|
-
queryKey: ["F_core64229_Read"],
|
14
|
-
queryFn: async () => {
|
15
|
-
const res = await baseAxios.get("/EmailConfig/GetAll")
|
16
|
-
return res.data.data
|
17
|
-
}
|
18
|
-
})
|
19
|
-
const columns = useMemo<MRT_ColumnDef<IEmailConfig>[]>(() => [
|
20
|
-
{
|
21
|
-
header: "Phân hệ",
|
22
|
-
accessorFn: (row) => {
|
23
|
-
return ENUM_EMAILCONFIG_MODULE[row.emailModule!]
|
24
|
-
}
|
25
|
-
},
|
26
|
-
{
|
27
|
-
header: "Host mail server",
|
28
|
-
accessorKey: "hostMailServer"
|
29
|
-
},
|
30
|
-
{
|
31
|
-
header: "Outgoing port",
|
32
|
-
accessorKey: "outgoingPort"
|
33
|
-
},
|
34
|
-
{
|
35
|
-
header: "Incoming port",
|
36
|
-
accessorKey: "incomingPort"
|
37
|
-
},
|
38
|
-
{
|
39
|
-
header: "SSL",
|
40
|
-
accessorFn: (row) => row.sll?.toString()
|
41
|
-
},
|
42
|
-
{
|
43
|
-
header: "Username",
|
44
|
-
accessorKey: "userName"
|
45
|
-
},
|
46
|
-
{
|
47
|
-
header: "Password",
|
48
|
-
accessorFn: () => "*******"
|
49
|
-
}
|
50
|
-
], [])
|
51
|
-
if (query.isLoading) return "Đang tải"
|
52
|
-
return (
|
53
|
-
<MyDataTable
|
54
|
-
columns={columns}
|
55
|
-
data={query.data!}
|
56
|
-
renderTopToolbarCustomActions={() => (
|
57
|
-
<F_core64229_Form />
|
58
|
-
)}
|
59
|
-
renderRowActions={({ row }) => (
|
60
|
-
<MyCenterFull>
|
61
|
-
<F_core64229_Form values={row.original} />
|
62
|
-
<F_core64229_Delete values={row.original} />
|
63
|
-
</MyCenterFull>
|
64
|
-
)}
|
65
|
-
/>
|
66
|
-
)
|
67
|
-
}
|
@@ -1,117 +0,0 @@
|
|
1
|
-
import baseAxios from "@/api/baseAxios";
|
2
|
-
import { MyButtonModal } from "@/components/Buttons/ButtonModal/MyButtonModal";
|
3
|
-
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
4
|
-
;
|
5
|
-
import { utils_notification_show } from "@/utils/utils_notification";
|
6
|
-
import { Button, Fieldset, Group, Table } from "@mantine/core";
|
7
|
-
import { useDisclosure } from "@mantine/hooks";
|
8
|
-
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
9
|
-
import { MRT_ColumnDef, MRT_RowSelectionState } from "mantine-react-table";
|
10
|
-
import { useEffect, useMemo, useState } from "react";
|
11
|
-
import { I_core71678_Read } from "./F_core71678_Read";
|
12
|
-
import { IBaseEntity } from "@/interfaces/base";
|
13
|
-
|
14
|
-
interface IRole extends IBaseEntity {
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
export function F_core71678_ChangePermission({ user }: { user: I_core71678_Read }) {
|
19
|
-
const disc = useDisclosure();
|
20
|
-
const queryClient = useQueryClient()
|
21
|
-
const [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});
|
22
|
-
const rowSelect = useState<IRole[]>()
|
23
|
-
const query = useQuery<IRole[]>({
|
24
|
-
queryKey: [`F1_1ChangePermission`],
|
25
|
-
queryFn: async () => {
|
26
|
-
const response = await baseAxios.get("/Role/GetAdminRole");
|
27
|
-
return response.data.data
|
28
|
-
},
|
29
|
-
})
|
30
|
-
const mutation = useMutation({
|
31
|
-
mutationFn: async (roleIds: number[]) => {
|
32
|
-
const res = await baseAxios.post("/Role/AddUser?userId=" + user.id, roleIds)
|
33
|
-
return res
|
34
|
-
}
|
35
|
-
})
|
36
|
-
const permissionColumns = useMemo<MRT_ColumnDef<IRole>[]>(
|
37
|
-
() => [
|
38
|
-
{
|
39
|
-
header: "Quyền",
|
40
|
-
accessorKey: "name",
|
41
|
-
},
|
42
|
-
],
|
43
|
-
[]
|
44
|
-
);
|
45
|
-
function handleSave() {
|
46
|
-
mutation.mutate(Object.keys(rowSelection).map(Number), {
|
47
|
-
onSuccess: () => {
|
48
|
-
utils_notification_show({ crudType: "update" })
|
49
|
-
disc[1].close()
|
50
|
-
queryClient.invalidateQueries()
|
51
|
-
}
|
52
|
-
})
|
53
|
-
}
|
54
|
-
useEffect(() => {
|
55
|
-
const result = user.roles?.reduce((acc, item) => {
|
56
|
-
if (item.id !== undefined) { // Chỉ gán khi id có giá trị
|
57
|
-
acc[item.id] = true;
|
58
|
-
}
|
59
|
-
return acc;
|
60
|
-
}, {} as Record<string, boolean>);
|
61
|
-
setRowSelection(result!)
|
62
|
-
}, [])
|
63
|
-
return (
|
64
|
-
<MyButtonModal modalSize={"xl"} disclosure={disc} title="Chọn quyền cho người dùng" label="Sửa quyền">
|
65
|
-
<Table
|
66
|
-
// mt={{ base: 0, lg: 16 }}
|
67
|
-
w={'100%'}
|
68
|
-
variant="vertical" layout="fixed">
|
69
|
-
<Table.Tbody>
|
70
|
-
<Table.Tr>
|
71
|
-
<Table.Th w={160}>Họ và tên:</Table.Th>
|
72
|
-
<Table.Td>{user.fullName}</Table.Td>
|
73
|
-
</Table.Tr>
|
74
|
-
|
75
|
-
<Table.Tr>
|
76
|
-
<Table.Th>Tên đăng nhập:</Table.Th>
|
77
|
-
<Table.Td>
|
78
|
-
{user.userName}
|
79
|
-
</Table.Td>
|
80
|
-
</Table.Tr>
|
81
|
-
|
82
|
-
<Table.Tr>
|
83
|
-
<Table.Th>Email:</Table.Th>
|
84
|
-
<Table.Td>{user.email}</Table.Td>
|
85
|
-
</Table.Tr>
|
86
|
-
|
87
|
-
|
88
|
-
</Table.Tbody>
|
89
|
-
</Table>
|
90
|
-
{query.isLoading && "Đang tải dữ liệu..."}
|
91
|
-
{query.isError && "Lỗi khi tải dữ liệu..."}
|
92
|
-
<Fieldset legend="Chọn quyền">
|
93
|
-
<MyDataTable
|
94
|
-
enableRowSelection={true}
|
95
|
-
onRowSelectionChange={setRowSelection}
|
96
|
-
state={{ rowSelection }}
|
97
|
-
setSelectedRow={rowSelect[1]}
|
98
|
-
getRowId={(originalRow) => originalRow.id?.toString()}
|
99
|
-
initialState={{
|
100
|
-
density: "xs",
|
101
|
-
pagination: { pageIndex: 0, pageSize: 10 },
|
102
|
-
columnPinning: { right: ["mrt-row-actions"] },
|
103
|
-
columnVisibility: {
|
104
|
-
nguoiCapNhat: false,
|
105
|
-
ngayCapNhat: false
|
106
|
-
}
|
107
|
-
}}
|
108
|
-
columns={permissionColumns}
|
109
|
-
data={query.data!}
|
110
|
-
/>
|
111
|
-
</Fieldset>
|
112
|
-
<Group justify='flex-end' mt={24}>
|
113
|
-
<Button onClick={handleSave}>Lưu</Button>
|
114
|
-
</Group>
|
115
|
-
</MyButtonModal>
|
116
|
-
)
|
117
|
-
}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
"use client"
|
2
|
-
import baseAxios from '@/api/baseAxios'
|
3
|
-
import { MyButtonCreate } from '@/components/Buttons/ButtonCRUD/MyButtonCreate'
|
4
|
-
import { MyTextInput } from '@/components/Inputs/TextInput/MyTextInput'
|
5
|
-
import { IBaseEntity } from '@/interfaces/base'
|
6
|
-
import { U0MyValidateEmail } from '@/utils/utils_validateForm'
|
7
|
-
import { useForm } from '@mantine/form'
|
8
|
-
|
9
|
-
interface I extends IBaseEntity {
|
10
|
-
userName?: string,
|
11
|
-
passwordHash?: string
|
12
|
-
address?: string
|
13
|
-
fullName?: string,
|
14
|
-
isBlocked?: boolean
|
15
|
-
email?: string,
|
16
|
-
password?: string,
|
17
|
-
workingUnitId?: number
|
18
|
-
phoneNumber?: string
|
19
|
-
AQModuleId?: number
|
20
|
-
}
|
21
|
-
const ENDPOINT = "/Account/create"
|
22
|
-
export function F_core71678_Create() {
|
23
|
-
const form = useForm<I>({
|
24
|
-
initialValues: {
|
25
|
-
fullName: "",
|
26
|
-
code: "",
|
27
|
-
userName: "",
|
28
|
-
password: "",
|
29
|
-
email: "",
|
30
|
-
phoneNumber: "",
|
31
|
-
},
|
32
|
-
validate: {
|
33
|
-
email: (value) => U0MyValidateEmail(value),
|
34
|
-
}
|
35
|
-
})
|
36
|
-
async function handleSubmit() {
|
37
|
-
return await baseAxios.post(ENDPOINT, {
|
38
|
-
...form.getValues(),
|
39
|
-
passwordHash: "",
|
40
|
-
id: 0,
|
41
|
-
address: "",
|
42
|
-
concurrencyStamp: "",
|
43
|
-
isBlocked: false,
|
44
|
-
isEnabled: true,
|
45
|
-
workingUnitId: undefined,
|
46
|
-
AQModuleId: 1002
|
47
|
-
})
|
48
|
-
}
|
49
|
-
return (
|
50
|
-
<MyButtonCreate form={form} onSubmit={handleSubmit} objectName='người dùng'>
|
51
|
-
<MyTextInput label='Mã tài khoản' {...form.getInputProps("code")} />
|
52
|
-
<MyTextInput label='Tên tài khoản' {...form.getInputProps("userName")} />
|
53
|
-
<MyTextInput label='Mật khẩu' {...form.getInputProps("password")} />
|
54
|
-
<MyTextInput label='Họ và tên' {...form.getInputProps("fullName")} />
|
55
|
-
<MyTextInput label='Email' {...form.getInputProps("email")} />
|
56
|
-
<MyTextInput label='Số điện thoại' {...form.getInputProps("phoneNumber")} />
|
57
|
-
</MyButtonCreate>
|
58
|
-
)
|
59
|
-
}
|
60
|
-
|
61
|
-
|
@@ -1,16 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import baseAxios from "@/api/baseAxios";
|
3
|
-
import { MyActionIconDelete } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete";
|
4
|
-
|
5
|
-
const ENDPOINT = "/Account/delete"
|
6
|
-
export function F_core71678_Delete({ id, code }: { id: number, code: string }) {
|
7
|
-
return (
|
8
|
-
<MyActionIconDelete
|
9
|
-
contextData={code}
|
10
|
-
onSubmit={async () =>
|
11
|
-
await baseAxios.post(ENDPOINT, { id: id })
|
12
|
-
}
|
13
|
-
/>
|
14
|
-
)
|
15
|
-
}
|
16
|
-
|