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,52 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios'
|
2
|
-
import { MyButton } from '@/components/Buttons/Button/MyButton'
|
3
|
-
import { utils_notification_show } from '@/utils/utils_notification'
|
4
|
-
import { useMutation } from '@tanstack/react-query'
|
5
|
-
import { useEffect, useState } from 'react'
|
6
|
-
import { useS_core83092 } from '../core83092/useS_core83092'
|
7
|
-
|
8
|
-
interface IPagePermission {
|
9
|
-
pageId?: number,
|
10
|
-
isCreate?: boolean
|
11
|
-
isRead?: boolean,
|
12
|
-
isUpdate?: boolean
|
13
|
-
isDelete?: boolean,
|
14
|
-
isPrint?: boolean,
|
15
|
-
isExport?: boolean
|
16
|
-
}
|
17
|
-
interface IBody {
|
18
|
-
pagePermissions?: IPagePermission[]
|
19
|
-
roleId?: number
|
20
|
-
}
|
21
|
-
export function F_core38677_Save() {
|
22
|
-
const store = useS_core83092()
|
23
|
-
const disable = useState<boolean>(false)
|
24
|
-
const mutation = useMutation({
|
25
|
-
mutationFn: async (body: IBody) => {
|
26
|
-
const res = await baseAxios.put("/Role/UpdatePermission", body)
|
27
|
-
return res
|
28
|
-
}
|
29
|
-
})
|
30
|
-
function handleSave() {
|
31
|
-
mutation.mutate({
|
32
|
-
pagePermissions: store.state.rolePermissions!,
|
33
|
-
roleId: store.state.roleId
|
34
|
-
}, {
|
35
|
-
onSuccess: () => {
|
36
|
-
utils_notification_show({
|
37
|
-
crudType: "update"
|
38
|
-
})
|
39
|
-
}
|
40
|
-
})
|
41
|
-
}
|
42
|
-
useEffect(() => {
|
43
|
-
if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
|
44
|
-
disable[1](true)
|
45
|
-
return
|
46
|
-
}
|
47
|
-
disable[1](false)
|
48
|
-
}, [store.state.rolePermissions])
|
49
|
-
return (
|
50
|
-
<MyButton disabled={disable[0]} crudType='save' onClick={handleSave} />
|
51
|
-
)
|
52
|
-
}
|
@@ -1,264 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import baseAxios from "@/api/baseAxios";
|
3
|
-
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull";
|
4
|
-
import { groupToTwoLevels, I_BasicAppShell_LinkItem, utils_layout_getItemsWithoutLinks } from "@/components/Layouts/BasicAppShell/BasicAppShell";
|
5
|
-
import { MyFlexRow } from "@/components/Layouts/FlexRow/MyFlexRow";
|
6
|
-
import { OBJECT_COlORS } from "@/constants/object/color";
|
7
|
-
import { menuData } from "@/data/menuData";
|
8
|
-
import { Checkbox, Flex, ScrollArea, Table, Text } from "@mantine/core";
|
9
|
-
import { IconEdit, IconEyeUp, IconFileExport, IconPlus, IconPrinter, IconTrash } from "@tabler/icons-react";
|
10
|
-
import { useQuery } from "@tanstack/react-query";
|
11
|
-
import React, { useEffect, useState } from "react";
|
12
|
-
import { I_core83092_RolePermission, useS_core83092, utils_core83092_mergePage } from "../core83092/useS_core83092";
|
13
|
-
|
14
|
-
const title = "Danh sách chức năng"
|
15
|
-
export function F_core38677_ViewMenuPermissions({ menuData }: { menuData: I_BasicAppShell_LinkItem[] }) {
|
16
|
-
const store = useS_core83092()
|
17
|
-
const query = useGetUserPermission()
|
18
|
-
const list = useState<I_BasicAppShell_LinkItem[]>([])
|
19
|
-
useEffect(() => {
|
20
|
-
list[1](groupToTwoLevels(menuData))
|
21
|
-
}, [])
|
22
|
-
|
23
|
-
useEffect(() => {
|
24
|
-
if (!query.data) return
|
25
|
-
store.setProperty("rolePermissions", query.data)
|
26
|
-
|
27
|
-
}, [query.data])
|
28
|
-
if (list[0]?.length == 0) return "Đang tải..."
|
29
|
-
return (
|
30
|
-
<ScrollArea.Autosize h={'70vh'} >
|
31
|
-
<Table>
|
32
|
-
<Table.Thead
|
33
|
-
bg={"light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))"}
|
34
|
-
style={{
|
35
|
-
position: 'sticky',
|
36
|
-
top: 0, zIndex: 1,
|
37
|
-
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.1)',
|
38
|
-
border: '1px solid var(--mantine-color-gray-4)',
|
39
|
-
}}>
|
40
|
-
<Table.Tr>
|
41
|
-
<Table.Th>{title}</Table.Th>
|
42
|
-
<Table.Th >
|
43
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
44
|
-
<Checkbox checked={store.isAllPermission("isRead")} onChange={(e) => {
|
45
|
-
store.toogleAllPermissionWithType("isRead", e.target.checked)
|
46
|
-
}}></Checkbox>
|
47
|
-
<MyFlexRow gap={3}>Xem<IconEyeUp color={"gray"} /></MyFlexRow>
|
48
|
-
</Flex>
|
49
|
-
</Table.Th>
|
50
|
-
<Table.Th >
|
51
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
52
|
-
<Checkbox checked={store.isAllPermission("isCreate")} onChange={(e) => {
|
53
|
-
store.toogleAllPermissionWithType("isCreate", e.target.checked)
|
54
|
-
}}></Checkbox>
|
55
|
-
<MyFlexRow gap={3}>Thêm<IconPlus color={"blue"} /></MyFlexRow>
|
56
|
-
</Flex>
|
57
|
-
</Table.Th>
|
58
|
-
<Table.Th >
|
59
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
60
|
-
<Checkbox checked={store.isAllPermission("isUpdate")} onChange={(e) => {
|
61
|
-
store.toogleAllPermissionWithType("isUpdate", e.target.checked)
|
62
|
-
}}></Checkbox>
|
63
|
-
<MyFlexRow gap={3}>Sửa<IconEdit color={"var(--mantine-color-yellow-8)"} /></MyFlexRow>
|
64
|
-
</Flex>
|
65
|
-
</Table.Th>
|
66
|
-
<Table.Th >
|
67
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
68
|
-
<Checkbox checked={store.isAllPermission("isDelete")} onChange={(e) => {
|
69
|
-
store.toogleAllPermissionWithType("isDelete", e.target.checked)
|
70
|
-
}}></Checkbox>
|
71
|
-
<MyFlexRow gap={3}>Xóa<IconTrash color={"var(--mantine-color-red-8)"} /></MyFlexRow>
|
72
|
-
</Flex>
|
73
|
-
</Table.Th>
|
74
|
-
<Table.Th >
|
75
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
76
|
-
<Checkbox checked={store.isAllPermission("isPrint")} onChange={(e) => {
|
77
|
-
store.toogleAllPermissionWithType("isPrint", e.target.checked)
|
78
|
-
}}></Checkbox>
|
79
|
-
<MyFlexRow gap={3}>In<IconPrinter color={"var(--mantine-color-cyan-8)"} /></MyFlexRow>
|
80
|
-
</Flex>
|
81
|
-
</Table.Th>
|
82
|
-
<Table.Th >
|
83
|
-
<Flex gap={3} direction={"column"} justify={"center"} align={"center"}>
|
84
|
-
<Checkbox checked={store.isAllPermission("isExport")} onChange={(e) => {
|
85
|
-
store.toogleAllPermissionWithType("isExport", e.target.checked)
|
86
|
-
}}></Checkbox>
|
87
|
-
<MyFlexRow gap={3}>Xuất<IconFileExport color={"var(--mantine-color-green-8)"} /></MyFlexRow>
|
88
|
-
</Flex>
|
89
|
-
</Table.Th>
|
90
|
-
</Table.Tr>
|
91
|
-
</Table.Thead>
|
92
|
-
<Table.Tbody bg={"light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))"}>
|
93
|
-
{list[0]?.map((item, idx) => {
|
94
|
-
if (item.links == undefined) return (
|
95
|
-
<Table.Tr key={idx}>
|
96
|
-
<Table.Td>{item.label}</Table.Td>
|
97
|
-
<Table.Td >
|
98
|
-
<MyCenterFull>
|
99
|
-
<Checkbox />
|
100
|
-
</MyCenterFull>
|
101
|
-
</Table.Td>
|
102
|
-
<Table.Td>
|
103
|
-
<MyCenterFull>
|
104
|
-
<Checkbox />
|
105
|
-
</MyCenterFull>
|
106
|
-
</Table.Td>
|
107
|
-
<Table.Td>
|
108
|
-
<MyCenterFull>
|
109
|
-
<Checkbox />
|
110
|
-
</MyCenterFull>
|
111
|
-
</Table.Td>
|
112
|
-
<Table.Td>
|
113
|
-
<MyCenterFull>
|
114
|
-
<Checkbox />
|
115
|
-
</MyCenterFull>
|
116
|
-
</Table.Td>
|
117
|
-
<Table.Td>
|
118
|
-
<MyCenterFull>
|
119
|
-
<Checkbox />
|
120
|
-
</MyCenterFull>
|
121
|
-
</Table.Td>
|
122
|
-
<Table.Td>
|
123
|
-
<MyCenterFull>
|
124
|
-
<Checkbox />
|
125
|
-
</MyCenterFull>
|
126
|
-
</Table.Td>
|
127
|
-
</Table.Tr>
|
128
|
-
)
|
129
|
-
|
130
|
-
return (
|
131
|
-
<React.Fragment key={idx}>
|
132
|
-
<Table.Tr key={item.label}>
|
133
|
-
<Table.Td
|
134
|
-
colSpan={7}
|
135
|
-
bg={OBJECT_COlORS.mantineBackgroundBlueLight}>
|
136
|
-
<Text fs={"oblique"} size="sm" fw={"bold"}>
|
137
|
-
{item.label}
|
138
|
-
</Text>
|
139
|
-
</Table.Td>
|
140
|
-
</Table.Tr>
|
141
|
-
{item.links.map((item, idx) =>
|
142
|
-
<Table.Tr key={idx}>
|
143
|
-
<Table.Td>{item.label}</Table.Td>
|
144
|
-
<Table.Td >
|
145
|
-
<MyCenterFull>
|
146
|
-
<Checkbox
|
147
|
-
checked={store.findByPageId(item.pageId!)?.isRead || false}
|
148
|
-
onChange={(e) => {
|
149
|
-
store.updatePermission(item.pageId!, {
|
150
|
-
isRead: e.target.checked
|
151
|
-
})
|
152
|
-
}}
|
153
|
-
/>
|
154
|
-
</MyCenterFull>
|
155
|
-
</Table.Td>
|
156
|
-
<Table.Td>
|
157
|
-
<MyCenterFull>
|
158
|
-
<Checkbox
|
159
|
-
checked={store.findByPageId(item.pageId!)?.isCreate || false}
|
160
|
-
onChange={(e) => {
|
161
|
-
store.updatePermission(item.pageId!, {
|
162
|
-
isCreate: e.target.checked
|
163
|
-
})
|
164
|
-
}}
|
165
|
-
/>
|
166
|
-
</MyCenterFull>
|
167
|
-
</Table.Td>
|
168
|
-
<Table.Td>
|
169
|
-
<MyCenterFull>
|
170
|
-
<Checkbox
|
171
|
-
checked={store.findByPageId(item.pageId!)?.isUpdate || false}
|
172
|
-
onChange={(e) => {
|
173
|
-
store.updatePermission(item.pageId!, {
|
174
|
-
isUpdate: e.target.checked
|
175
|
-
})
|
176
|
-
}}
|
177
|
-
/>
|
178
|
-
</MyCenterFull>
|
179
|
-
</Table.Td>
|
180
|
-
<Table.Td>
|
181
|
-
<MyCenterFull>
|
182
|
-
<Checkbox
|
183
|
-
checked={store.findByPageId(item.pageId!)?.isDelete || false}
|
184
|
-
onChange={(e) => {
|
185
|
-
store.updatePermission(item.pageId!, {
|
186
|
-
isDelete: e.target.checked
|
187
|
-
})
|
188
|
-
}}
|
189
|
-
/>
|
190
|
-
</MyCenterFull>
|
191
|
-
</Table.Td>
|
192
|
-
<Table.Td>
|
193
|
-
<MyCenterFull>
|
194
|
-
<Checkbox
|
195
|
-
checked={store.findByPageId(item.pageId!)?.isPrint || false}
|
196
|
-
onChange={(e) => {
|
197
|
-
store.updatePermission(item.pageId!, {
|
198
|
-
isPrint: e.target.checked
|
199
|
-
})
|
200
|
-
}}
|
201
|
-
/>
|
202
|
-
</MyCenterFull>
|
203
|
-
</Table.Td>
|
204
|
-
<Table.Td>
|
205
|
-
<MyCenterFull>
|
206
|
-
<Checkbox
|
207
|
-
checked={store.findByPageId(item.pageId!)?.isExport || false}
|
208
|
-
onChange={(e) => {
|
209
|
-
store.updatePermission(item.pageId!, {
|
210
|
-
isExport: e.target.checked
|
211
|
-
})
|
212
|
-
}}
|
213
|
-
/>
|
214
|
-
</MyCenterFull>
|
215
|
-
</Table.Td>
|
216
|
-
</Table.Tr>
|
217
|
-
)}
|
218
|
-
</React.Fragment>
|
219
|
-
)
|
220
|
-
})}
|
221
|
-
</Table.Tbody>
|
222
|
-
</Table>
|
223
|
-
</ScrollArea.Autosize>
|
224
|
-
)
|
225
|
-
}
|
226
|
-
|
227
|
-
function useGetUserPermission() {
|
228
|
-
const store = useS_core83092()
|
229
|
-
const query = useQuery<I_core83092_RolePermission[]>({
|
230
|
-
queryKey: ['F_7p4mh9d75x_AuthorizationTable', store.state.roleId],
|
231
|
-
queryFn: async () => {
|
232
|
-
const result = await baseAxios.get('/Role/GetRolePermission?roleId=' + store.state.roleId)
|
233
|
-
const menudataFinal = utils_layout_getItemsWithoutLinks(menuData)
|
234
|
-
if (result.data.data.length == 0) {
|
235
|
-
const final = menudataFinal.map((item) => ({
|
236
|
-
pageId: item.pageId,
|
237
|
-
isRead: false,
|
238
|
-
isCreate: false,
|
239
|
-
isUpdate: false,
|
240
|
-
isDelete: false,
|
241
|
-
isExport: false,
|
242
|
-
isPrint: false,
|
243
|
-
}) as I_core83092_RolePermission)
|
244
|
-
return final.filter(item => item.pageId != undefined)
|
245
|
-
}
|
246
|
-
const menuDataFromAPI = result.data.data
|
247
|
-
const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map(item => ({
|
248
|
-
pageId: item.pageId,
|
249
|
-
isCreate: item.isCreate || false,
|
250
|
-
isRead: item.isRead || false,
|
251
|
-
isUpdate: item.isUpdate || false || false,
|
252
|
-
isDelete: item.isDelete,
|
253
|
-
isPrint: item.isPrint || false,
|
254
|
-
isExport: item.isExport || false
|
255
|
-
}) as I_core83092_RolePermission).filter(item => item.pageId != undefined)
|
256
|
-
return mergedArray
|
257
|
-
},
|
258
|
-
enabled: store.state.roleId != 0,
|
259
|
-
refetchOnWindowFocus: false
|
260
|
-
})
|
261
|
-
return query
|
262
|
-
}
|
263
|
-
|
264
|
-
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { MyPageContent } from "@/components";
|
2
|
-
import { F_core40207_Read } from "./F_core40207_Read";
|
3
|
-
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
4
|
-
|
5
|
-
export function F_core40207({ GuidelineTypeId }: { GuidelineTypeId: number }) {
|
6
|
-
return (
|
7
|
-
<F_core40207_Read GuidelineTypeId={GuidelineTypeId} />
|
8
|
-
)
|
9
|
-
}
|
@@ -1,81 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import baseAxios from "@/api/baseAxios";
|
3
|
-
import { MyButtonCreate, MyTextInput } from "@/components";
|
4
|
-
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
5
|
-
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
6
|
-
import { FileInput } from "@mantine/core";
|
7
|
-
import { useForm } from "@mantine/form";
|
8
|
-
|
9
|
-
interface IDocument {
|
10
|
-
path?: string;
|
11
|
-
orderBy?: number;
|
12
|
-
documentType?: number;
|
13
|
-
promulgateDate?: Date;
|
14
|
-
decisionCode?: string;
|
15
|
-
departmentName?: string;
|
16
|
-
description?: string;
|
17
|
-
startDate?: Date;
|
18
|
-
endDate?: Date;
|
19
|
-
conclusion?: string;
|
20
|
-
note?: string;
|
21
|
-
documentAttributeId?: number;
|
22
|
-
documentAttributeName?: string;
|
23
|
-
isCycleCheck?: boolean;
|
24
|
-
meetingDate?: Date;
|
25
|
-
fileDetail?: {
|
26
|
-
fileBase64String?: string;
|
27
|
-
fileExtension?: string;
|
28
|
-
fileName?: string;
|
29
|
-
};
|
30
|
-
id?: number;
|
31
|
-
code?: string;
|
32
|
-
name?: string;
|
33
|
-
concurrencyStamp?: string;
|
34
|
-
isEnabled?: boolean;
|
35
|
-
ngayChinhSua?: Date;
|
36
|
-
nguoiChinhSua?: string;
|
37
|
-
}
|
38
|
-
interface I extends IDocument {
|
39
|
-
file?: File;
|
40
|
-
}
|
41
|
-
|
42
|
-
export function F_core40207_Create({ GuidelineTypeId }: { GuidelineTypeId: number }) {
|
43
|
-
const form = useForm<I>({
|
44
|
-
mode: "uncontrolled",
|
45
|
-
validate: {
|
46
|
-
code: (value) => (value ? null : "Không được để trống"),
|
47
|
-
name: (value) => (value ? null : "Không được để trống"),
|
48
|
-
file: (value) => (value ? null : "Không được để trống"),
|
49
|
-
},
|
50
|
-
});
|
51
|
-
return (
|
52
|
-
<MyButtonCreate
|
53
|
-
objectName="văn bản"
|
54
|
-
form={form}
|
55
|
-
onSubmit={async (values) => {
|
56
|
-
return await baseAxios.post("/Document/create", {
|
57
|
-
...values,
|
58
|
-
DocumentType: GuidelineTypeId, //1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
59
|
-
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
60
|
-
});
|
61
|
-
}}
|
62
|
-
>
|
63
|
-
<MyTextInput
|
64
|
-
withAsterisk
|
65
|
-
label="Mã tài liệu"
|
66
|
-
{...form.getInputProps("code")}
|
67
|
-
/>
|
68
|
-
<MyTextInput
|
69
|
-
withAsterisk
|
70
|
-
label="Tên tài liệu"
|
71
|
-
{...form.getInputProps("name")}
|
72
|
-
/>
|
73
|
-
<FileInput
|
74
|
-
withAsterisk
|
75
|
-
label="Tài liệu"
|
76
|
-
placeholder="Tải lên tài liệu"
|
77
|
-
{...form.getInputProps("file")}
|
78
|
-
/>
|
79
|
-
</MyButtonCreate>
|
80
|
-
);
|
81
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import baseAxios from "@/api/baseAxios";
|
2
|
-
import { MyActionIconDelete } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete";
|
3
|
-
|
4
|
-
export function F_core40207_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
|
-
}
|
@@ -1,98 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import baseAxios from "@/api/baseAxios";
|
3
|
-
import { MyButtonViewPDF } from "@/components/Buttons/ButtonViewPDF/MyButtonViewPDF";
|
4
|
-
import { MyCenterFull } from "@/components/CenterFull/MyCenterFull";
|
5
|
-
import { MyDataTable } from "@/components/DataDisplay/DataTable/MyDataTable";
|
6
|
-
import { OBJECT_DOCUMENT_TYPES } from "@/constants/object/documentTypes";
|
7
|
-
import { useQuery } from "@tanstack/react-query";
|
8
|
-
import { MRT_ColumnDef } from "mantine-react-table";
|
9
|
-
import { useMemo } from "react";
|
10
|
-
import { F_core40207_Create } from "./F_core40207_Create";
|
11
|
-
import { F_core40207_Delete } from "./F_core40207_Delete";
|
12
|
-
import { F_core40207_Update } from "./F_core40207_Update";
|
13
|
-
|
14
|
-
interface I {
|
15
|
-
path?: string;
|
16
|
-
orderBy?: number;
|
17
|
-
documentType?: number;
|
18
|
-
promulgateDate?: Date;
|
19
|
-
decisionCode?: string;
|
20
|
-
departmentName?: string;
|
21
|
-
description?: string;
|
22
|
-
startDate?: Date;
|
23
|
-
endDate?: Date;
|
24
|
-
conclusion?: string;
|
25
|
-
note?: string;
|
26
|
-
documentAttributeId?: number;
|
27
|
-
documentAttributeName?: string;
|
28
|
-
isCycleCheck?: boolean;
|
29
|
-
meetingDate?: Date;
|
30
|
-
fileDetail?: {
|
31
|
-
fileBase64String?: string;
|
32
|
-
fileExtension?: string;
|
33
|
-
fileName?: string;
|
34
|
-
};
|
35
|
-
id?: number;
|
36
|
-
code?: string;
|
37
|
-
name?: string;
|
38
|
-
concurrencyStamp?: string;
|
39
|
-
isEnabled?: boolean;
|
40
|
-
ngayChinhSua?: Date;
|
41
|
-
nguoiChinhSua?: string;
|
42
|
-
}
|
43
|
-
|
44
|
-
export function F_core40207_Read({ GuidelineTypeId }: { GuidelineTypeId: number }) {
|
45
|
-
const query = useQuery<I[]>({
|
46
|
-
queryKey: ["F_core40207_Read"],
|
47
|
-
queryFn: async () => {
|
48
|
-
const result = await baseAxios.get(
|
49
|
-
`/Document/GetByType?documentType=${GuidelineTypeId}`
|
50
|
-
);
|
51
|
-
return result.data?.data || [];
|
52
|
-
},
|
53
|
-
});
|
54
|
-
const columns = useMemo<MRT_ColumnDef<I>[]>(
|
55
|
-
() => [
|
56
|
-
{
|
57
|
-
header: "Mã tài liệu",
|
58
|
-
accessorKey: "code",
|
59
|
-
},
|
60
|
-
{
|
61
|
-
header: "Tên tài liệu",
|
62
|
-
accessorKey: "name",
|
63
|
-
},
|
64
|
-
{
|
65
|
-
header: "File",
|
66
|
-
accessorFn: (row) => {
|
67
|
-
return (
|
68
|
-
<MyCenterFull>
|
69
|
-
<MyButtonViewPDF id={row.id} />
|
70
|
-
</MyCenterFull>
|
71
|
-
);
|
72
|
-
},
|
73
|
-
},
|
74
|
-
],
|
75
|
-
[]
|
76
|
-
);
|
77
|
-
|
78
|
-
if (query.isLoading) return "Loading...";
|
79
|
-
if (query.isError) return "có lỗi xảy ra!";
|
80
|
-
return (
|
81
|
-
<MyDataTable
|
82
|
-
columns={columns}
|
83
|
-
data={query.data!}
|
84
|
-
renderTopToolbarCustomActions={() => <F_core40207_Create GuidelineTypeId={GuidelineTypeId} />}
|
85
|
-
renderRowActions={({ row }) => {
|
86
|
-
return (
|
87
|
-
<MyCenterFull>
|
88
|
-
<F_core40207_Update values={row.original} />
|
89
|
-
<F_core40207_Delete
|
90
|
-
id={row.original.id!}
|
91
|
-
contextData={row.original.code!}
|
92
|
-
/>
|
93
|
-
</MyCenterFull>
|
94
|
-
);
|
95
|
-
}}
|
96
|
-
/>
|
97
|
-
);
|
98
|
-
}
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import baseAxios from "@/api/baseAxios";
|
2
|
-
import { MyActionIconUpdate } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate";
|
3
|
-
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
4
|
-
import { utils_file_fileToAQDocumentType } from "@/utils/utils_file";
|
5
|
-
import { FileInput } from "@mantine/core";
|
6
|
-
import { useForm } from "@mantine/form";
|
7
|
-
interface IDocument {
|
8
|
-
path?: string;
|
9
|
-
orderBy?: number;
|
10
|
-
documentType?: number;
|
11
|
-
promulgateDate?: Date;
|
12
|
-
decisionCode?: string;
|
13
|
-
departmentName?: string;
|
14
|
-
description?: string;
|
15
|
-
startDate?: Date;
|
16
|
-
endDate?: Date;
|
17
|
-
conclusion?: string;
|
18
|
-
note?: string;
|
19
|
-
documentAttributeId?: number;
|
20
|
-
documentAttributeName?: string;
|
21
|
-
isCycleCheck?: boolean;
|
22
|
-
meetingDate?: Date;
|
23
|
-
fileDetail?: {
|
24
|
-
fileBase64String?: string;
|
25
|
-
fileExtension?: string;
|
26
|
-
fileName?: string;
|
27
|
-
};
|
28
|
-
id?: number;
|
29
|
-
code?: string;
|
30
|
-
name?: string;
|
31
|
-
concurrencyStamp?: string;
|
32
|
-
isEnabled?: boolean;
|
33
|
-
ngayChinhSua?: Date;
|
34
|
-
nguoiChinhSua?: string;
|
35
|
-
}
|
36
|
-
interface I extends IDocument {
|
37
|
-
file?: File;
|
38
|
-
}
|
39
|
-
export function F_core40207_Update({ values }: { values: I }) {
|
40
|
-
const form = useForm<I>({
|
41
|
-
mode: "uncontrolled",
|
42
|
-
initialValues: {
|
43
|
-
...values,
|
44
|
-
file: new File(
|
45
|
-
[],
|
46
|
-
values.path?.split("/")[values.path.split("/").length - 1]!
|
47
|
-
),
|
48
|
-
},
|
49
|
-
validate: {
|
50
|
-
code: (value) => (value ? null : "Không được để trống"),
|
51
|
-
name: (value) => (value ? null : "Không được để trống"),
|
52
|
-
file: (value) => (value ? null : "Không được để trống"),
|
53
|
-
},
|
54
|
-
});
|
55
|
-
return (
|
56
|
-
<MyActionIconUpdate
|
57
|
-
form={form}
|
58
|
-
onSubmit={async (values) => {
|
59
|
-
return await baseAxios.post("/Document/Update", {
|
60
|
-
...values,
|
61
|
-
fileDetail: await utils_file_fileToAQDocumentType(values.file!),
|
62
|
-
});
|
63
|
-
}}
|
64
|
-
>
|
65
|
-
<MyTextInput
|
66
|
-
withAsterisk
|
67
|
-
label="Mã tài liệu"
|
68
|
-
{...form.getInputProps("code")}
|
69
|
-
/>
|
70
|
-
<MyTextInput
|
71
|
-
withAsterisk
|
72
|
-
label="Tên tài liệu"
|
73
|
-
{...form.getInputProps("name")}
|
74
|
-
/>
|
75
|
-
<FileInput
|
76
|
-
withAsterisk
|
77
|
-
label="Tài liệu"
|
78
|
-
placeholder="Tải lên tài liệu"
|
79
|
-
{...form.getInputProps("file")}
|
80
|
-
/>
|
81
|
-
</MyActionIconUpdate>
|
82
|
-
);
|
83
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import baseAxios from '@/api/baseAxios'
|
2
|
-
import { MyActionIconDelete } from '@/components/ActionIcons/ActionIconCRUD/MyActionIconDelete'
|
3
|
-
import { IBaseEntity } from '@/interfaces/base'
|
4
|
-
|
5
|
-
const ENDPOINT = "/Role/Delete"
|
6
|
-
export function F_core47643_Delete({ values }: { values: IBaseEntity }) {
|
7
|
-
return (
|
8
|
-
<MyActionIconDelete
|
9
|
-
contextData={values.code}
|
10
|
-
onSubmit={() => baseAxios.post(ENDPOINT, { id: values.id })}
|
11
|
-
/>
|
12
|
-
)
|
13
|
-
}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import baseAxios from "@/api/baseAxios";
|
2
|
-
import { MyActionIconUpdate } from "@/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate";
|
3
|
-
import { MyButtonCreate } from "@/components/Buttons/ButtonCRUD/MyButtonCreate";
|
4
|
-
import { MyTextInput } from "@/components/Inputs/TextInput/MyTextInput";
|
5
|
-
import { useForm } from "@mantine/form";
|
6
|
-
|
7
|
-
interface I {
|
8
|
-
id?: number
|
9
|
-
code?: string,
|
10
|
-
name?: string
|
11
|
-
}
|
12
|
-
export function F_core47643_Form({ values }: { values?: I }) {
|
13
|
-
const form = useForm<I>({
|
14
|
-
mode: "uncontrolled",
|
15
|
-
initialValues: values
|
16
|
-
})
|
17
|
-
|
18
|
-
if (values) return (
|
19
|
-
<MyActionIconUpdate form={form} onSubmit={async () => {
|
20
|
-
return await baseAxios.post("/Role/Update", form.getValues())
|
21
|
-
}}>
|
22
|
-
<MyTextInput readOnly variant="filled" label="Mã" {...form.getInputProps("code")} />
|
23
|
-
<MyTextInput label="Quyền" {...form.getInputProps("name")} />
|
24
|
-
</MyActionIconUpdate>
|
25
|
-
)
|
26
|
-
return (
|
27
|
-
<MyButtonCreate form={form} onSubmit={async () => {
|
28
|
-
return await baseAxios.post("/Role/Create", form.getValues())
|
29
|
-
}}>
|
30
|
-
<MyTextInput label="Mã" {...form.getInputProps("code")} />
|
31
|
-
<MyTextInput label="Quyền" {...form.getInputProps("name")} />
|
32
|
-
</MyButtonCreate>
|
33
|
-
)
|
34
|
-
}
|