aq-fe-framework 0.1.53 → 0.1.54
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-4WRQVG5N.mjs → chunk-G6EYKJHS.mjs} +3199 -593
- package/dist/{chunk-D4NFPB3H.mjs → chunk-LJHYZ5B5.mjs} +60 -0
- package/dist/components/index.css +6 -0
- package/dist/components/index.mjs +2 -2
- package/dist/modules-features/index.d.mts +4 -2
- package/dist/modules-features/index.mjs +63 -2588
- package/dist/utils/index.mjs +3 -5
- package/package.json +1 -1
- package/dist/chunk-CDDX46TC.mjs +0 -62
|
@@ -3,15 +3,293 @@ import {
|
|
|
3
3
|
useS_Sidebar
|
|
4
4
|
} from "./chunk-AL73DX37.mjs";
|
|
5
5
|
import {
|
|
6
|
+
U0DateToDDMMYYYString,
|
|
7
|
+
U0MyValidateEmail,
|
|
8
|
+
utils_converter_enumToSelectOptions,
|
|
9
|
+
utils_file_fileToAQDocumentType,
|
|
6
10
|
utils_notification_show,
|
|
7
11
|
utils_pdf_download
|
|
8
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LJHYZ5B5.mjs";
|
|
9
13
|
import {
|
|
10
14
|
__objRest,
|
|
11
15
|
__spreadProps,
|
|
12
16
|
__spreadValues
|
|
13
17
|
} from "./chunk-FWCSY2DS.mjs";
|
|
14
18
|
|
|
19
|
+
// src/components/Layouts/FlexColumn/MyFlexColumn.tsx
|
|
20
|
+
import { Flex } from "@mantine/core";
|
|
21
|
+
function MyFlexColumn(_a) {
|
|
22
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
23
|
+
return /* @__PURE__ */ React.createElement(Flex, __spreadValues({ direction: "column", gap: "md" }, rest), children);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/modules-features/admin/core/core12196/F_core12196.tsx
|
|
27
|
+
import { Accordion, Blockquote } from "@mantine/core";
|
|
28
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
29
|
+
|
|
30
|
+
// src/api/baseAxios.ts
|
|
31
|
+
import axios from "axios";
|
|
32
|
+
var baseAxios = axios.create({
|
|
33
|
+
baseURL: process.env.NEXT_PUBLIC_API
|
|
34
|
+
// server
|
|
35
|
+
// baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
|
|
36
|
+
});
|
|
37
|
+
baseAxios.interceptors.request.use(
|
|
38
|
+
(config2) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const tokenData = localStorage.getItem("useS_Authenticate");
|
|
41
|
+
const state = JSON.parse(tokenData);
|
|
42
|
+
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
|
43
|
+
if (token) {
|
|
44
|
+
config2.headers.Authorization = `Bearer ${token}`;
|
|
45
|
+
}
|
|
46
|
+
return config2;
|
|
47
|
+
},
|
|
48
|
+
(error) => {
|
|
49
|
+
return Promise.reject(error);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
var baseAxios_default = baseAxios;
|
|
53
|
+
|
|
54
|
+
// src/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx
|
|
55
|
+
import { ActionIcon, Button, Group, LoadingOverlay, Modal, Paper, Text, Tooltip } from "@mantine/core";
|
|
56
|
+
import { useDisclosure } from "@mantine/hooks";
|
|
57
|
+
import { IconLivePhoto, IconMaximize, IconMinimize } from "@tabler/icons-react";
|
|
58
|
+
import { useQuery } from "@tanstack/react-query";
|
|
59
|
+
import { useState } from "react";
|
|
60
|
+
function MyButtonViewPDF({ id, modalSize = "80%", label = "Xem file", src = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2016/07/85.signed.pdf" }) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const disc = useDisclosure(false);
|
|
63
|
+
const fullScreen = useState(false);
|
|
64
|
+
const hSize = useState("80vh");
|
|
65
|
+
const query = useQuery({
|
|
66
|
+
queryKey: ["MyButtonViewPDF", id],
|
|
67
|
+
queryFn: async () => {
|
|
68
|
+
return (await baseAxios_default.get("/Document/Get?id=" + id)).data.data;
|
|
69
|
+
},
|
|
70
|
+
enabled: id != void 0 && disc[0] == true
|
|
71
|
+
});
|
|
72
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(Button, { color: "cyan", onClick: () => {
|
|
73
|
+
disc[1].open();
|
|
74
|
+
}, leftSection: /* @__PURE__ */ React.createElement(IconLivePhoto, null) }, label)), /* @__PURE__ */ React.createElement(
|
|
75
|
+
Modal,
|
|
76
|
+
{
|
|
77
|
+
fullScreen: fullScreen[0],
|
|
78
|
+
opened: disc[0],
|
|
79
|
+
onClose: disc[1].close,
|
|
80
|
+
size: modalSize,
|
|
81
|
+
title: /* @__PURE__ */ React.createElement(Group, null, /* @__PURE__ */ React.createElement(Text, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
82
|
+
ActionIcon,
|
|
83
|
+
{
|
|
84
|
+
onClick: () => {
|
|
85
|
+
fullScreen[1](false);
|
|
86
|
+
hSize[1]("80vh");
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
/* @__PURE__ */ React.createElement(IconMinimize, null)
|
|
90
|
+
) : /* @__PURE__ */ React.createElement(
|
|
91
|
+
ActionIcon,
|
|
92
|
+
{
|
|
93
|
+
onClick: () => {
|
|
94
|
+
fullScreen[1](true);
|
|
95
|
+
hSize[1]("90vh");
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
/* @__PURE__ */ React.createElement(IconMaximize, null)
|
|
99
|
+
))
|
|
100
|
+
},
|
|
101
|
+
/* @__PURE__ */ React.createElement(Paper, { h: hSize[0], p: "lg", pos: "relative" }, /* @__PURE__ */ React.createElement(LoadingOverlay, { visible: query.isLoading, zIndex: 1e3, overlayProps: { radius: "sm", blur: 2 } }), query.data ? /* @__PURE__ */ React.createElement(
|
|
102
|
+
"iframe",
|
|
103
|
+
{
|
|
104
|
+
src: `data:application/pdf;base64, ${(_b = (_a = query.data) == null ? void 0 : _a.fileDetail) == null ? void 0 : _b.fileBase64String}`,
|
|
105
|
+
width: "100%",
|
|
106
|
+
height: "100%"
|
|
107
|
+
}
|
|
108
|
+
) : /* @__PURE__ */ React.createElement(
|
|
109
|
+
"iframe",
|
|
110
|
+
{
|
|
111
|
+
src,
|
|
112
|
+
width: "100%",
|
|
113
|
+
height: "100%"
|
|
114
|
+
}
|
|
115
|
+
))
|
|
116
|
+
));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// src/components/CenterFull/MyCenterFull.tsx
|
|
120
|
+
import { Center, Group as Group2 } from "@mantine/core";
|
|
121
|
+
function MyCenterFull({ children }) {
|
|
122
|
+
return /* @__PURE__ */ React.createElement(Center, { w: "100%" }, /* @__PURE__ */ React.createElement(Group2, null, children));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/components/DataDisplay/DataTable/MyDataTable.tsx
|
|
126
|
+
import { Button as Button2, Group as Group3 } from "@mantine/core";
|
|
127
|
+
import { IconDownload } from "@tabler/icons-react";
|
|
128
|
+
import { download, generateCsv, mkConfig } from "export-to-csv";
|
|
129
|
+
import {
|
|
130
|
+
MantineReactTable,
|
|
131
|
+
useMantineReactTable
|
|
132
|
+
} from "mantine-react-table";
|
|
133
|
+
import { MRT_Localization_VI } from "mantine-react-table/locales/vi/index.cjs";
|
|
134
|
+
import { useEffect } from "react";
|
|
135
|
+
function formatData(data, formats) {
|
|
136
|
+
return data.map((row) => {
|
|
137
|
+
const transformedRow = {};
|
|
138
|
+
Object.entries(row).forEach(([key, value]) => {
|
|
139
|
+
const formatFn = formats[key];
|
|
140
|
+
if (value instanceof Date) {
|
|
141
|
+
transformedRow[key] = formatFn ? formatFn(value.toISOString()) : value.toISOString();
|
|
142
|
+
} else if (value !== null && typeof value === "object") {
|
|
143
|
+
transformedRow[key] = formatFn ? formatFn(JSON.stringify(value)) : JSON.stringify(value);
|
|
144
|
+
} else {
|
|
145
|
+
transformedRow[key] = formatFn ? formatFn(value) : value;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return transformedRow;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function MyDataTable(_a) {
|
|
152
|
+
var _b = _a, { formats = {}, exportAble = false, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow } = _b, rest = __objRest(_b, ["formats", "exportAble", "csvConfigProps", "rowActionSize", "columns", "data", "renderTopToolbarCustomActions", "setSelectedRow"]);
|
|
153
|
+
const { renderRowActions } = __spreadValues({}, rest);
|
|
154
|
+
const csvConfig = mkConfig(__spreadValues({
|
|
155
|
+
fieldSeparator: ",",
|
|
156
|
+
decimalSeparator: ".",
|
|
157
|
+
useKeysAsHeaders: (csvConfigProps == null ? void 0 : csvConfigProps.columnHeaders) ? false : true
|
|
158
|
+
}, csvConfigProps));
|
|
159
|
+
const handleExport = (rows) => {
|
|
160
|
+
if (rows.length == 0) {
|
|
161
|
+
const transformedData = formatData(data, formats);
|
|
162
|
+
const csv2 = generateCsv(csvConfig)(transformedData);
|
|
163
|
+
download(csvConfig)(csv2);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const rowData = rows.map((row) => row.original);
|
|
167
|
+
const transformedRows = formatData(rowData, formats);
|
|
168
|
+
const csv = generateCsv(csvConfig)(transformedRows);
|
|
169
|
+
download(csvConfig)(csv);
|
|
170
|
+
};
|
|
171
|
+
const table = useMantineReactTable(__spreadValues({
|
|
172
|
+
columns,
|
|
173
|
+
data,
|
|
174
|
+
renderTopToolbarCustomActions: ({ table: table2 }) => {
|
|
175
|
+
return /* @__PURE__ */ React.createElement(Group3, null, renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table: table2 }), exportAble && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
176
|
+
Button2,
|
|
177
|
+
{
|
|
178
|
+
color: "green.8",
|
|
179
|
+
onClick: () => handleExport(table2.getSelectedRowModel().rows),
|
|
180
|
+
leftSection: /* @__PURE__ */ React.createElement(IconDownload, null),
|
|
181
|
+
variant: "filled"
|
|
182
|
+
},
|
|
183
|
+
"Export"
|
|
184
|
+
)));
|
|
185
|
+
},
|
|
186
|
+
enableRowNumbers: true,
|
|
187
|
+
enableRowSelection: exportAble,
|
|
188
|
+
enableEditing: renderRowActions ? true : false,
|
|
189
|
+
positionActionsColumn: "last",
|
|
190
|
+
enableColumnResizing: true,
|
|
191
|
+
layoutMode: "semantic",
|
|
192
|
+
displayColumnDefOptions: {
|
|
193
|
+
"mrt-row-actions": {
|
|
194
|
+
header: "Thao t\xE1c",
|
|
195
|
+
size: rowActionSize
|
|
196
|
+
},
|
|
197
|
+
"mrt-row-numbers": {
|
|
198
|
+
Header: "STT",
|
|
199
|
+
size: 1
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
enableColumnPinning: true,
|
|
203
|
+
initialState: {
|
|
204
|
+
density: "md",
|
|
205
|
+
pagination: { pageIndex: 0, pageSize: 30 },
|
|
206
|
+
columnPinning: { right: ["mrt-row-actions"] },
|
|
207
|
+
columnVisibility: {
|
|
208
|
+
nguoiCapNhat: false,
|
|
209
|
+
ngayCapNhat: false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
mantineTableHeadCellProps: {
|
|
213
|
+
style: {
|
|
214
|
+
verticalAlign: "middle",
|
|
215
|
+
paddingTop: "2px",
|
|
216
|
+
paddingBottom: "2px"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
mantineTableBodyCellProps: {
|
|
220
|
+
style: {
|
|
221
|
+
paddingTop: "2px",
|
|
222
|
+
paddingBottom: "2px"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
localization: MRT_Localization_VI
|
|
226
|
+
}, rest));
|
|
227
|
+
useEffect(() => {
|
|
228
|
+
setSelectedRow && setSelectedRow(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
229
|
+
}, [table.getState().rowSelection]);
|
|
230
|
+
if (data == void 0) return;
|
|
231
|
+
return /* @__PURE__ */ React.createElement(MantineReactTable, { table });
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// src/components/Buttons/ButtonRouterBack/MyButtonRouterBack.tsx
|
|
235
|
+
import { Button as Button3 } from "@mantine/core";
|
|
236
|
+
import { IconArrowBack } from "@tabler/icons-react";
|
|
237
|
+
import { useRouter } from "next/navigation";
|
|
238
|
+
function MyButtonRouterBack(_a) {
|
|
239
|
+
var _b = _a, { url, label } = _b, rest = __objRest(_b, ["url", "label"]);
|
|
240
|
+
const router = useRouter();
|
|
241
|
+
return /* @__PURE__ */ React.createElement(
|
|
242
|
+
Button3,
|
|
243
|
+
__spreadValues({
|
|
244
|
+
variant: "light",
|
|
245
|
+
leftSection: /* @__PURE__ */ React.createElement(IconArrowBack, { stroke: 2 }),
|
|
246
|
+
onClick: () => {
|
|
247
|
+
if (url) {
|
|
248
|
+
router.replace(url);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
router.back();
|
|
252
|
+
}
|
|
253
|
+
}, rest),
|
|
254
|
+
label ? label : "Tr\u1EDF v\u1EC1"
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// src/components/Layouts/PageContent/MyPageContent.tsx
|
|
259
|
+
import { Code, Container, Divider, Group as Group4, Indicator, Title } from "@mantine/core";
|
|
260
|
+
var getStatusColor = (status) => {
|
|
261
|
+
switch (status) {
|
|
262
|
+
case "Prototype":
|
|
263
|
+
return "blue";
|
|
264
|
+
case "Beta":
|
|
265
|
+
return "orange";
|
|
266
|
+
default:
|
|
267
|
+
return "gray";
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
var PageTitle = ({ title: title3, status }) => {
|
|
271
|
+
const color = getStatusColor(status);
|
|
272
|
+
return /* @__PURE__ */ React.createElement(Indicator, { label: status, size: 16, inline: true, color, disabled: !status, pt: 6 }, /* @__PURE__ */ React.createElement(Title, null, title3));
|
|
273
|
+
};
|
|
274
|
+
function MyPageContent({ leftTopBar, title: title3, canBack = false, rightTopBar, status, children }) {
|
|
275
|
+
const SidebarStore = useS_Sidebar();
|
|
276
|
+
const finalTitle = title3 || SidebarStore.state.title;
|
|
277
|
+
return /* @__PURE__ */ React.createElement(Container, { p: 0, fluid: true }, /* @__PURE__ */ React.createElement(Group4, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Group4, null, canBack && /* @__PURE__ */ React.createElement(MyButtonRouterBack, null), /* @__PURE__ */ React.createElement(PageTitle, { title: finalTitle, status }), leftTopBar), /* @__PURE__ */ React.createElement(Group4, null, rightTopBar, /* @__PURE__ */ React.createElement(Code, { color: "var(--mantine-color-blue-light)" }, SidebarStore.state.menuCode))), /* @__PURE__ */ React.createElement(Divider, null), children);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// src/constants/object/documentTypes.ts
|
|
281
|
+
var OBJECT_DOCUMENT_TYPES = {
|
|
282
|
+
Security: 30,
|
|
283
|
+
Refinement: 31,
|
|
284
|
+
Guideline: 32,
|
|
285
|
+
Regulations: 33,
|
|
286
|
+
Workflow: 34,
|
|
287
|
+
Form: 35
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// src/modules-features/admin/core/core12196/F_core12196.tsx
|
|
291
|
+
import { useMemo as useMemo3 } from "react";
|
|
292
|
+
|
|
15
293
|
// src/lib/utils.ts
|
|
16
294
|
import { clsx } from "clsx";
|
|
17
295
|
import { twMerge } from "tailwind-merge";
|
|
@@ -37,7 +315,7 @@ var MyBoxesCore = (_a) => {
|
|
|
37
315
|
"--indigo-300",
|
|
38
316
|
"--violet-300"
|
|
39
317
|
];
|
|
40
|
-
const
|
|
318
|
+
const getRandomColor3 = () => {
|
|
41
319
|
return colors[Math.floor(Math.random() * colors.length)];
|
|
42
320
|
};
|
|
43
321
|
return /* @__PURE__ */ React2.createElement(
|
|
@@ -55,7 +333,7 @@ var MyBoxesCore = (_a) => {
|
|
|
55
333
|
motion.div,
|
|
56
334
|
{
|
|
57
335
|
whileHover: {
|
|
58
|
-
backgroundColor: `var(${
|
|
336
|
+
backgroundColor: `var(${getRandomColor3()})`,
|
|
59
337
|
transition: { duration: 0 }
|
|
60
338
|
},
|
|
61
339
|
animate: {
|
|
@@ -82,9 +360,9 @@ var MyBoxesCore = (_a) => {
|
|
|
82
360
|
var Boxes = React2.memo(MyBoxesCore);
|
|
83
361
|
|
|
84
362
|
// src/components/Loaders/MyCardioLoader.tsx
|
|
85
|
-
import { useEffect } from "react";
|
|
363
|
+
import { useEffect as useEffect2 } from "react";
|
|
86
364
|
function MyCardioLoader() {
|
|
87
|
-
|
|
365
|
+
useEffect2(() => {
|
|
88
366
|
async function getLoader() {
|
|
89
367
|
const { cardio } = await import("ldrs");
|
|
90
368
|
cardio.register();
|
|
@@ -95,30 +373,30 @@ function MyCardioLoader() {
|
|
|
95
373
|
}
|
|
96
374
|
|
|
97
375
|
// src/components/Aceternity/BoxesBackground/MyBoxesBackground.tsx
|
|
98
|
-
import { Center, Space, Text } from "@mantine/core";
|
|
99
|
-
function MyBoxesBackground({ title, desc = "\u0110\u01B0\u1EE3c ph\xE1t tri\u1EC3n b\u1EDFi c\xF4ng ty c\xF4ng ngh\u1EC7 Anh Qu\xE2n." }) {
|
|
100
|
-
return /* @__PURE__ */ React.createElement("div", { className: "h-[100vh] relative w-full overflow-hidden bg-slate-900 flex flex-col items-center justify-center rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 w-full h-full bg-slate-900 z-20 [mask-image:radial-gradient(transparent,white)] pointer-events-none" }), /* @__PURE__ */ React.createElement(MyBoxesCore, null), /* @__PURE__ */ React.createElement(
|
|
376
|
+
import { Center as Center2, Space, Text as Text2 } from "@mantine/core";
|
|
377
|
+
function MyBoxesBackground({ title: title3, desc = "\u0110\u01B0\u1EE3c ph\xE1t tri\u1EC3n b\u1EDFi c\xF4ng ty c\xF4ng ngh\u1EC7 Anh Qu\xE2n." }) {
|
|
378
|
+
return /* @__PURE__ */ React.createElement("div", { className: "h-[100vh] relative w-full overflow-hidden bg-slate-900 flex flex-col items-center justify-center rounded-lg" }, /* @__PURE__ */ React.createElement("div", { className: "absolute inset-0 w-full h-full bg-slate-900 z-20 [mask-image:radial-gradient(transparent,white)] pointer-events-none" }), /* @__PURE__ */ React.createElement(MyBoxesCore, null), /* @__PURE__ */ React.createElement(Center2, { className: "z-20" }, /* @__PURE__ */ React.createElement(MyCardioLoader, null)), /* @__PURE__ */ React.createElement(Space, { my: 7 }), /* @__PURE__ */ React.createElement(Center2, null, /* @__PURE__ */ React.createElement(Text2, { className: "z-20", fs: "italic", fw: "bold", c: "white" }, "\u0110ang t\u1EA3i...")), /* @__PURE__ */ React.createElement(Space, { my: 7 }), /* @__PURE__ */ React.createElement("h1", { className: cn("md:text-4xl text-xl text-white relative z-20") }, title3), /* @__PURE__ */ React.createElement("p", { className: "text-center mt-2 text-neutral-300 relative z-20" }, desc));
|
|
101
379
|
}
|
|
102
380
|
|
|
103
381
|
// src/components/ActionIcons/ActionIcon/MyActionIcon.tsx
|
|
104
|
-
import { ActionIcon } from "@mantine/core";
|
|
382
|
+
import { ActionIcon as ActionIcon2 } from "@mantine/core";
|
|
105
383
|
import { IconDeviceFloppy, IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
|
106
384
|
function MyActionIcon(_a) {
|
|
107
385
|
var _b = _a, { children, crudType = "delete" } = _b, rest = __objRest(_b, ["children", "crudType"]);
|
|
108
386
|
if (crudType == "default") {
|
|
109
|
-
return /* @__PURE__ */ React.createElement(
|
|
387
|
+
return /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "indigo" }, rest), children);
|
|
110
388
|
}
|
|
111
389
|
if (crudType == "create") {
|
|
112
|
-
return /* @__PURE__ */ React.createElement(
|
|
390
|
+
return /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "indigo" }, rest), /* @__PURE__ */ React.createElement(IconPlus, null));
|
|
113
391
|
}
|
|
114
392
|
if (crudType == "delete") {
|
|
115
|
-
return /* @__PURE__ */ React.createElement(
|
|
393
|
+
return /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "red" }, rest), /* @__PURE__ */ React.createElement(IconTrash, null));
|
|
116
394
|
}
|
|
117
395
|
if (crudType == "update") {
|
|
118
|
-
return /* @__PURE__ */ React.createElement(
|
|
396
|
+
return /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "yellow" }, rest), /* @__PURE__ */ React.createElement(IconEdit, null));
|
|
119
397
|
}
|
|
120
398
|
if (crudType == "save") {
|
|
121
|
-
return /* @__PURE__ */ React.createElement(
|
|
399
|
+
return /* @__PURE__ */ React.createElement(ActionIcon2, __spreadValues({ color: "green" }, rest), /* @__PURE__ */ React.createElement(IconDeviceFloppy, null));
|
|
122
400
|
}
|
|
123
401
|
}
|
|
124
402
|
|
|
@@ -129,31 +407,24 @@ function MyTextInput(_a) {
|
|
|
129
407
|
return /* @__PURE__ */ React.createElement(TextInput, __spreadValues({ label, defaultValue, placeholder: label ? `Nh\u1EADp ${label == null ? void 0 : label.toLowerCase()}` : "" }, rest));
|
|
130
408
|
}
|
|
131
409
|
|
|
132
|
-
// src/components/Layouts/FlexColumn/MyFlexColumn.tsx
|
|
133
|
-
import { Flex } from "@mantine/core";
|
|
134
|
-
function MyFlexColumn(_a) {
|
|
135
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
136
|
-
return /* @__PURE__ */ React.createElement(Flex, __spreadValues({ direction: "column", gap: "md" }, rest), children);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
410
|
// src/components/ActionIcons/ActionIconCheck/MyActionIconCheck.tsx
|
|
140
|
-
import { ActionIcon as
|
|
141
|
-
import { useDisclosure } from "@mantine/hooks";
|
|
411
|
+
import { ActionIcon as ActionIcon3, Button as Button4, Checkbox, Modal as Modal2, Switch, Text as Text3, Tooltip as Tooltip2 } from "@mantine/core";
|
|
412
|
+
import { useDisclosure as useDisclosure2 } from "@mantine/hooks";
|
|
142
413
|
import { IconChecklist } from "@tabler/icons-react";
|
|
143
|
-
import { useState } from "react";
|
|
414
|
+
import { useState as useState2 } from "react";
|
|
144
415
|
function MyActionIconCheck(_a) {
|
|
145
416
|
var _b = _a, { modalSize = "50%", comment = "" } = _b, rest = __objRest(_b, ["modalSize", "comment"]);
|
|
146
|
-
const disc =
|
|
147
|
-
const fullScreen =
|
|
148
|
-
const hSize =
|
|
149
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
150
|
-
|
|
417
|
+
const disc = useDisclosure2(false);
|
|
418
|
+
const fullScreen = useState2(false);
|
|
419
|
+
const hSize = useState2("50vh");
|
|
420
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip2, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(ActionIcon3, __spreadValues({ color: "cyan", onClick: disc[1].open }, rest), /* @__PURE__ */ React.createElement(IconChecklist, { size: 24, color: "blue" }))), /* @__PURE__ */ React.createElement(
|
|
421
|
+
Modal2,
|
|
151
422
|
{
|
|
152
423
|
fullScreen: fullScreen[0],
|
|
153
424
|
opened: disc[0],
|
|
154
425
|
onClose: disc[1].close,
|
|
155
426
|
size: modalSize,
|
|
156
|
-
title: /* @__PURE__ */ React.createElement(
|
|
427
|
+
title: /* @__PURE__ */ React.createElement(Text3, null, "Ki\u1EC3m tra h\u1ED3 s\u01A1 \u0111\xE3 \u0111\u0103ng k\xFD")
|
|
157
428
|
},
|
|
158
429
|
/* @__PURE__ */ React.createElement(
|
|
159
430
|
Switch,
|
|
@@ -162,58 +433,58 @@ function MyActionIconCheck(_a) {
|
|
|
162
433
|
label: "\u0110\u1EA1t y\xEAu c\u1EA7u"
|
|
163
434
|
}
|
|
164
435
|
),
|
|
165
|
-
/* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(MyTextInput, { label: "Nh\u1EADn x\xE9t" }), /* @__PURE__ */ React.createElement(Checkbox, { label: "G\u1EEDi mail th\xF4ng b\xE1o" }), /* @__PURE__ */ React.createElement(
|
|
436
|
+
/* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(MyTextInput, { label: "Nh\u1EADn x\xE9t" }), /* @__PURE__ */ React.createElement(Checkbox, { label: "G\u1EEDi mail th\xF4ng b\xE1o" }), /* @__PURE__ */ React.createElement(Button4, null, "C\u1EADp nh\u1EADp"))
|
|
166
437
|
));
|
|
167
438
|
}
|
|
168
439
|
|
|
169
440
|
// src/components/Buttons/Button/MyButton.tsx
|
|
170
|
-
import { Button as
|
|
441
|
+
import { Button as Button5 } from "@mantine/core";
|
|
171
442
|
import { IconDeviceFloppy as IconDeviceFloppy2, IconEdit as IconEdit2, IconFileExport, IconFileImport, IconPlus as IconPlus2, IconPrinter, IconTrash as IconTrash2, IconX } from "@tabler/icons-react";
|
|
172
443
|
function MyButton(_a) {
|
|
173
444
|
var _b = _a, { children, crudType = "delete" } = _b, rest = __objRest(_b, ["children", "crudType"]);
|
|
174
445
|
if (crudType == "default") {
|
|
175
|
-
return /* @__PURE__ */ React.createElement(
|
|
446
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "indigo" }, rest), children);
|
|
176
447
|
}
|
|
177
448
|
if (crudType == "create") {
|
|
178
|
-
return /* @__PURE__ */ React.createElement(
|
|
449
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "indigo", type: "submit", leftSection: /* @__PURE__ */ React.createElement(IconPlus2, null) }, rest), children ? children : "L\u01B0u");
|
|
179
450
|
}
|
|
180
451
|
if (crudType == "createMultiple") {
|
|
181
|
-
return /* @__PURE__ */ React.createElement(
|
|
452
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "green", type: "submit", leftSection: /* @__PURE__ */ React.createElement(IconPlus2, null) }, rest), children ? children : "Th\xEAm danh s\xE1ch");
|
|
182
453
|
}
|
|
183
454
|
if (crudType == "delete") {
|
|
184
|
-
return /* @__PURE__ */ React.createElement(
|
|
455
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "red", leftSection: /* @__PURE__ */ React.createElement(IconTrash2, null) }, rest), children ? children : "X\xE1c nh\u1EADn x\xF3a");
|
|
185
456
|
}
|
|
186
457
|
if (crudType == "update") {
|
|
187
|
-
return /* @__PURE__ */ React.createElement(
|
|
458
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "yellow", type: "submit", leftSection: /* @__PURE__ */ React.createElement(IconEdit2, null) }, rest), children ? children : "Ch\u1EC9nh s\u1EEDa");
|
|
188
459
|
}
|
|
189
460
|
if (crudType == "save") {
|
|
190
|
-
return /* @__PURE__ */ React.createElement(
|
|
461
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "blue", type: "submit", leftSection: /* @__PURE__ */ React.createElement(IconDeviceFloppy2, null) }, rest), children ? children : "L\u01B0u");
|
|
191
462
|
}
|
|
192
463
|
if (crudType == "import") {
|
|
193
|
-
return /* @__PURE__ */ React.createElement(
|
|
464
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "green.8", leftSection: /* @__PURE__ */ React.createElement(IconFileImport, null) }, rest), children ? children : "Import");
|
|
194
465
|
}
|
|
195
466
|
if (crudType == "print") {
|
|
196
|
-
return /* @__PURE__ */ React.createElement(
|
|
467
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "orange.7", leftSection: /* @__PURE__ */ React.createElement(IconPrinter, null) }, rest), children ? children : "In");
|
|
197
468
|
}
|
|
198
469
|
if (crudType == "export") {
|
|
199
|
-
return /* @__PURE__ */ React.createElement(
|
|
470
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "green.8", leftSection: /* @__PURE__ */ React.createElement(IconFileExport, null) }, rest), children ? children : "In");
|
|
200
471
|
}
|
|
201
472
|
if (crudType == "cancel") {
|
|
202
|
-
return /* @__PURE__ */ React.createElement(
|
|
473
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({ color: "gray", leftSection: /* @__PURE__ */ React.createElement(IconX, null) }, rest), children ? children : "H\u1EE7y thao t\xE1c");
|
|
203
474
|
}
|
|
204
475
|
if (crudType == "select") {
|
|
205
|
-
return /* @__PURE__ */ React.createElement(
|
|
476
|
+
return /* @__PURE__ */ React.createElement(Button5, __spreadValues({}, rest), children ? children : "Ch\u1ECDn");
|
|
206
477
|
}
|
|
207
478
|
}
|
|
208
479
|
|
|
209
480
|
// src/components/ActionIcons/ActionIconCRUD/MyActionIconDelete.tsx
|
|
210
|
-
import { Group, Highlight } from "@mantine/core";
|
|
211
|
-
import { useDisclosure as
|
|
481
|
+
import { Group as Group5, Highlight } from "@mantine/core";
|
|
482
|
+
import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
|
|
212
483
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
213
|
-
import { useState as
|
|
484
|
+
import { useState as useState3 } from "react";
|
|
214
485
|
|
|
215
486
|
// src/components/ActionIcons/ActionIconModal/MyActionIconModal.tsx
|
|
216
|
-
import { ActionIcon as
|
|
487
|
+
import { ActionIcon as ActionIcon4, Modal as Modal3 } from "@mantine/core";
|
|
217
488
|
import { IconEdit as IconEdit3, IconPlus as IconPlus3, IconTrash as IconTrash3 } from "@tabler/icons-react";
|
|
218
489
|
function MyActionIconModal(_a) {
|
|
219
490
|
var _b = _a, {
|
|
@@ -221,7 +492,7 @@ function MyActionIconModal(_a) {
|
|
|
221
492
|
crudType = "default",
|
|
222
493
|
disclosure,
|
|
223
494
|
modalSize,
|
|
224
|
-
title,
|
|
495
|
+
title: title3,
|
|
225
496
|
children,
|
|
226
497
|
icon
|
|
227
498
|
} = _b, rest = __objRest(_b, [
|
|
@@ -234,12 +505,12 @@ function MyActionIconModal(_a) {
|
|
|
234
505
|
"icon"
|
|
235
506
|
]);
|
|
236
507
|
if (crudType == "default") {
|
|
237
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
238
|
-
|
|
508
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionIcon4, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "indigo" }, rest), icon), /* @__PURE__ */ React.createElement(
|
|
509
|
+
Modal3,
|
|
239
510
|
{
|
|
240
511
|
fullScreen,
|
|
241
512
|
size: modalSize,
|
|
242
|
-
title,
|
|
513
|
+
title: title3,
|
|
243
514
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
244
515
|
onClose: disclosure[1].close
|
|
245
516
|
},
|
|
@@ -247,12 +518,12 @@ function MyActionIconModal(_a) {
|
|
|
247
518
|
));
|
|
248
519
|
}
|
|
249
520
|
if (crudType == "create") {
|
|
250
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
251
|
-
|
|
521
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionIcon4, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open }, rest), icon ? icon : /* @__PURE__ */ React.createElement(IconPlus3, null)), /* @__PURE__ */ React.createElement(
|
|
522
|
+
Modal3,
|
|
252
523
|
{
|
|
253
524
|
fullScreen,
|
|
254
525
|
size: modalSize,
|
|
255
|
-
title:
|
|
526
|
+
title: title3 ? title3 : "T\u1EA1o d\u1EEF li\u1EC7u m\u1EDBi",
|
|
256
527
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
257
528
|
onClose: disclosure[1].close
|
|
258
529
|
},
|
|
@@ -260,12 +531,12 @@ function MyActionIconModal(_a) {
|
|
|
260
531
|
));
|
|
261
532
|
}
|
|
262
533
|
if (crudType == "update") {
|
|
263
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
264
|
-
|
|
534
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionIcon4, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "yellow" }, rest), icon ? icon : /* @__PURE__ */ React.createElement(IconEdit3, null)), /* @__PURE__ */ React.createElement(
|
|
535
|
+
Modal3,
|
|
265
536
|
{
|
|
266
537
|
fullScreen,
|
|
267
538
|
size: modalSize,
|
|
268
|
-
title:
|
|
539
|
+
title: title3 ? title3 : "S\u1EEDa d\u1EEF li\u1EC7u",
|
|
269
540
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
270
541
|
onClose: disclosure[1].close
|
|
271
542
|
},
|
|
@@ -273,12 +544,12 @@ function MyActionIconModal(_a) {
|
|
|
273
544
|
));
|
|
274
545
|
}
|
|
275
546
|
if (crudType == "delete") {
|
|
276
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
277
|
-
|
|
547
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionIcon4, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "red" }, rest), icon ? icon : /* @__PURE__ */ React.createElement(IconTrash3, null)), /* @__PURE__ */ React.createElement(
|
|
548
|
+
Modal3,
|
|
278
549
|
{
|
|
279
550
|
fullScreen,
|
|
280
551
|
size: modalSize,
|
|
281
|
-
title:
|
|
552
|
+
title: title3 ? title3 : "X\xF3a d\u1EEF li\u1EC7u",
|
|
282
553
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
283
554
|
onClose: disclosure[1].close
|
|
284
555
|
},
|
|
@@ -286,12 +557,12 @@ function MyActionIconModal(_a) {
|
|
|
286
557
|
));
|
|
287
558
|
}
|
|
288
559
|
if (crudType == "check") {
|
|
289
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
290
|
-
|
|
560
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ActionIcon4, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "green" }, rest), icon ? icon : /* @__PURE__ */ React.createElement(IconTrash3, null)), /* @__PURE__ */ React.createElement(
|
|
561
|
+
Modal3,
|
|
291
562
|
{
|
|
292
563
|
fullScreen,
|
|
293
564
|
size: modalSize,
|
|
294
|
-
title:
|
|
565
|
+
title: title3 ? title3 : "Ki\u1EC3m tra",
|
|
295
566
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
296
567
|
onClose: disclosure[1].close
|
|
297
568
|
},
|
|
@@ -314,8 +585,8 @@ function MyActionIconDelete(_a) {
|
|
|
314
585
|
"contextData"
|
|
315
586
|
]);
|
|
316
587
|
const queryClient = useQueryClient();
|
|
317
|
-
const disc =
|
|
318
|
-
const loadingState =
|
|
588
|
+
const disc = useDisclosure3();
|
|
589
|
+
const loadingState = useState3();
|
|
319
590
|
const mutation = useMutation({
|
|
320
591
|
mutationFn: async () => await onSubmit(),
|
|
321
592
|
onSuccess: () => {
|
|
@@ -357,7 +628,7 @@ function MyActionIconDelete(_a) {
|
|
|
357
628
|
},
|
|
358
629
|
`B\u1EA1n s\u1EAFp x\xF3a d\u1EEF li\u1EC7u ${contextData || ""}. H\xE0nh \u0111\u1ED9ng n\xE0y kh\xF4ng th\u1EC3 ho\xE0n t\xE1c. B\u1EA1n c\xF3 ch\u1EAFc ch\u1EAFn mu\u1ED1n ti\u1EBFp t\u1EE5c?`
|
|
359
630
|
),
|
|
360
|
-
/* @__PURE__ */ React.createElement(
|
|
631
|
+
/* @__PURE__ */ React.createElement(Group5, { grow: true }, /* @__PURE__ */ React.createElement(
|
|
361
632
|
MyButton,
|
|
362
633
|
{
|
|
363
634
|
crudType: "delete",
|
|
@@ -375,7 +646,7 @@ function MyActionIconDelete(_a) {
|
|
|
375
646
|
}
|
|
376
647
|
|
|
377
648
|
// src/components/ActionIcons/ActionIconCRUD/MyActionIconUpdate.tsx
|
|
378
|
-
import { useDisclosure as
|
|
649
|
+
import { useDisclosure as useDisclosure4 } from "@mantine/hooks";
|
|
379
650
|
import { useMutation as useMutation2, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
380
651
|
function MyActionIconUpdate(_a) {
|
|
381
652
|
var _b = _a, {
|
|
@@ -391,7 +662,7 @@ function MyActionIconUpdate(_a) {
|
|
|
391
662
|
"onError",
|
|
392
663
|
"children"
|
|
393
664
|
]);
|
|
394
|
-
const disc =
|
|
665
|
+
const disc = useDisclosure4();
|
|
395
666
|
const queryClient = useQueryClient2();
|
|
396
667
|
const mutation = useMutation2({
|
|
397
668
|
mutationFn: async (values) => {
|
|
@@ -415,14 +686,14 @@ function MyActionIconUpdate(_a) {
|
|
|
415
686
|
}
|
|
416
687
|
|
|
417
688
|
// src/components/ActionIcons/ActionIconDownloadPDF/MyActionIconDownloadPDF.tsx
|
|
418
|
-
import { ActionIcon as
|
|
419
|
-
import { IconDownload } from "@tabler/icons-react";
|
|
689
|
+
import { ActionIcon as ActionIcon5, Tooltip as Tooltip3 } from "@mantine/core";
|
|
690
|
+
import { IconDownload as IconDownload2 } from "@tabler/icons-react";
|
|
420
691
|
function MyActionIconDownloadPDF({ pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" }) {
|
|
421
|
-
return /* @__PURE__ */ React.createElement(
|
|
692
|
+
return /* @__PURE__ */ React.createElement(Tooltip3, { label: "Nh\u1EA5p \u0111\u1EC3 t\u1EA3i xu\u1ED1ng" }, /* @__PURE__ */ React.createElement(ActionIcon5, { onClick: async () => await utils_pdf_download(pdfLink), color: "red" }, /* @__PURE__ */ React.createElement(IconDownload2, null)));
|
|
422
693
|
}
|
|
423
694
|
|
|
424
695
|
// src/components/ActionIcons/ActionIconUpload/MyActionIconUpload.tsx
|
|
425
|
-
import { ActionIcon as
|
|
696
|
+
import { ActionIcon as ActionIcon6 } from "@mantine/core";
|
|
426
697
|
import { Dropzone, MIME_TYPES } from "@mantine/dropzone";
|
|
427
698
|
import { IconCloudUpload } from "@tabler/icons-react";
|
|
428
699
|
import { useRef } from "react";
|
|
@@ -437,53 +708,53 @@ function MyActionIconUpload() {
|
|
|
437
708
|
radius: "md",
|
|
438
709
|
accept: [MIME_TYPES.pdf]
|
|
439
710
|
},
|
|
440
|
-
/* @__PURE__ */ React.createElement(
|
|
711
|
+
/* @__PURE__ */ React.createElement(ActionIcon6, null, /* @__PURE__ */ React.createElement(IconCloudUpload, null))
|
|
441
712
|
);
|
|
442
713
|
}
|
|
443
714
|
|
|
444
715
|
// src/components/ActionIcons/ActionIconViewPdf/MyActionIconViewPDF.tsx
|
|
445
|
-
import { ActionIcon as
|
|
446
|
-
import { useDisclosure as
|
|
447
|
-
import { IconLivePhoto, IconMaximize, IconMinimize } from "@tabler/icons-react";
|
|
448
|
-
import { useState as
|
|
716
|
+
import { ActionIcon as ActionIcon7, Group as Group6, Modal as Modal4, Paper as Paper2, Text as Text4, Tooltip as Tooltip4 } from "@mantine/core";
|
|
717
|
+
import { useDisclosure as useDisclosure5 } from "@mantine/hooks";
|
|
718
|
+
import { IconLivePhoto as IconLivePhoto2, IconMaximize as IconMaximize2, IconMinimize as IconMinimize2 } from "@tabler/icons-react";
|
|
719
|
+
import { useState as useState4 } from "react";
|
|
449
720
|
function MyActionIconViewPDF(_a) {
|
|
450
721
|
var _b = _a, { modalSize = "80%", pdfLink = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2021/07/17-bgd.signed.pdf" } = _b, rest = __objRest(_b, ["modalSize", "pdfLink"]);
|
|
451
|
-
const disc =
|
|
452
|
-
const fullScreen =
|
|
453
|
-
const hSize =
|
|
454
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
455
|
-
|
|
722
|
+
const disc = useDisclosure5(false);
|
|
723
|
+
const fullScreen = useState4(false);
|
|
724
|
+
const hSize = useState4("80vh");
|
|
725
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip4, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(ActionIcon7, __spreadValues({ color: "cyan", onClick: disc[1].open }, rest), /* @__PURE__ */ React.createElement(IconLivePhoto2, null))), /* @__PURE__ */ React.createElement(
|
|
726
|
+
Modal4,
|
|
456
727
|
{
|
|
457
728
|
fullScreen: fullScreen[0],
|
|
458
729
|
opened: disc[0],
|
|
459
730
|
onClose: disc[1].close,
|
|
460
731
|
size: modalSize,
|
|
461
|
-
title: /* @__PURE__ */ React.createElement(
|
|
462
|
-
|
|
732
|
+
title: /* @__PURE__ */ React.createElement(Group6, null, /* @__PURE__ */ React.createElement(Text4, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
733
|
+
ActionIcon7,
|
|
463
734
|
{
|
|
464
735
|
onClick: () => {
|
|
465
736
|
fullScreen[1](false);
|
|
466
737
|
hSize[1]("80vh");
|
|
467
738
|
}
|
|
468
739
|
},
|
|
469
|
-
/* @__PURE__ */ React.createElement(
|
|
740
|
+
/* @__PURE__ */ React.createElement(IconMinimize2, null)
|
|
470
741
|
) : /* @__PURE__ */ React.createElement(
|
|
471
|
-
|
|
742
|
+
ActionIcon7,
|
|
472
743
|
{
|
|
473
744
|
onClick: () => {
|
|
474
745
|
fullScreen[1](true);
|
|
475
746
|
hSize[1]("90vh");
|
|
476
747
|
}
|
|
477
748
|
},
|
|
478
|
-
/* @__PURE__ */ React.createElement(
|
|
749
|
+
/* @__PURE__ */ React.createElement(IconMaximize2, null)
|
|
479
750
|
))
|
|
480
751
|
},
|
|
481
|
-
/* @__PURE__ */ React.createElement(
|
|
752
|
+
/* @__PURE__ */ React.createElement(Paper2, { h: hSize[0], p: "lg" }, /* @__PURE__ */ React.createElement("iframe", { src: pdfLink, width: "100%", height: "100%" }))
|
|
482
753
|
));
|
|
483
754
|
}
|
|
484
755
|
|
|
485
756
|
// src/components/ActionIcons/SwitchTheme/MySwitchTheme.tsx
|
|
486
|
-
import { ActionIcon as
|
|
757
|
+
import { ActionIcon as ActionIcon8, useComputedColorScheme, useMantineColorScheme } from "@mantine/core";
|
|
487
758
|
import { IconMoon, IconSun } from "@tabler/icons-react";
|
|
488
759
|
import cx from "clsx";
|
|
489
760
|
|
|
@@ -495,7 +766,7 @@ function MySwitchTheme() {
|
|
|
495
766
|
const { setColorScheme } = useMantineColorScheme();
|
|
496
767
|
const computedColorScheme = useComputedColorScheme("light", { getInitialValueInEffect: true });
|
|
497
768
|
return /* @__PURE__ */ React.createElement(
|
|
498
|
-
|
|
769
|
+
ActionIcon8,
|
|
499
770
|
{
|
|
500
771
|
onClick: () => setColorScheme(computedColorScheme === "light" ? "dark" : "light"),
|
|
501
772
|
variant: "default",
|
|
@@ -511,8 +782,8 @@ function MySwitchTheme() {
|
|
|
511
782
|
// src/components/AppSpotlight/MyAppSpotlight.tsx
|
|
512
783
|
import { Spotlight, spotlight } from "@mantine/spotlight";
|
|
513
784
|
import { IconSearch } from "@tabler/icons-react";
|
|
514
|
-
import { usePathname, useRouter } from "next/navigation";
|
|
515
|
-
import { useMemo, useState as
|
|
785
|
+
import { usePathname, useRouter as useRouter2 } from "next/navigation";
|
|
786
|
+
import { useMemo, useState as useState5 } from "react";
|
|
516
787
|
function convertMenuToSpotlightActions(items, router, parentPath = "", sideBarStore, pathName) {
|
|
517
788
|
let actions = [];
|
|
518
789
|
items.forEach((item) => {
|
|
@@ -539,8 +810,8 @@ function convertMenuToSpotlightActions(items, router, parentPath = "", sideBarSt
|
|
|
539
810
|
return actions;
|
|
540
811
|
}
|
|
541
812
|
function MyAppSpotlight({ menu }) {
|
|
542
|
-
const [query, setQuery] =
|
|
543
|
-
const router =
|
|
813
|
+
const [query, setQuery] = useState5("");
|
|
814
|
+
const router = useRouter2();
|
|
544
815
|
const pathName = usePathname();
|
|
545
816
|
const sideBarStore = useS_Sidebar();
|
|
546
817
|
const spotlightActions = useMemo(
|
|
@@ -586,54 +857,54 @@ function SpotlightTrigger() {
|
|
|
586
857
|
}
|
|
587
858
|
|
|
588
859
|
// src/components/Buttons/Anchor/MyAnchorViewPDF.tsx
|
|
589
|
-
import { ActionIcon as
|
|
590
|
-
import { useDisclosure as
|
|
591
|
-
import { IconMaximize as
|
|
592
|
-
import { useState as
|
|
860
|
+
import { ActionIcon as ActionIcon9, Anchor, Group as Group7, Modal as Modal5, Paper as Paper3, Text as Text5 } from "@mantine/core";
|
|
861
|
+
import { useDisclosure as useDisclosure6 } from "@mantine/hooks";
|
|
862
|
+
import { IconMaximize as IconMaximize3, IconMinimize as IconMinimize3 } from "@tabler/icons-react";
|
|
863
|
+
import { useState as useState6 } from "react";
|
|
593
864
|
function MyAnchorViewPDF({ label, pdfLink }) {
|
|
594
|
-
const disc =
|
|
595
|
-
const fullScreen =
|
|
596
|
-
const hSize =
|
|
865
|
+
const disc = useDisclosure6(false);
|
|
866
|
+
const fullScreen = useState6(false);
|
|
867
|
+
const hSize = useState6("80vh");
|
|
597
868
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Anchor, { onClick: disc[1].open }, label), /* @__PURE__ */ React.createElement(
|
|
598
|
-
|
|
869
|
+
Modal5,
|
|
599
870
|
{
|
|
600
871
|
fullScreen: fullScreen[0],
|
|
601
872
|
opened: disc[0],
|
|
602
873
|
onClose: disc[1].close,
|
|
603
874
|
size: "80%",
|
|
604
|
-
title: /* @__PURE__ */ React.createElement(
|
|
605
|
-
|
|
875
|
+
title: /* @__PURE__ */ React.createElement(Group7, null, /* @__PURE__ */ React.createElement(Text5, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
876
|
+
ActionIcon9,
|
|
606
877
|
{
|
|
607
878
|
onClick: () => {
|
|
608
879
|
fullScreen[1](false);
|
|
609
880
|
hSize[1]("80vh");
|
|
610
881
|
}
|
|
611
882
|
},
|
|
612
|
-
/* @__PURE__ */ React.createElement(
|
|
883
|
+
/* @__PURE__ */ React.createElement(IconMinimize3, null)
|
|
613
884
|
) : /* @__PURE__ */ React.createElement(
|
|
614
|
-
|
|
885
|
+
ActionIcon9,
|
|
615
886
|
{
|
|
616
887
|
onClick: () => {
|
|
617
888
|
fullScreen[1](true);
|
|
618
889
|
hSize[1]("90vh");
|
|
619
890
|
}
|
|
620
891
|
},
|
|
621
|
-
/* @__PURE__ */ React.createElement(
|
|
892
|
+
/* @__PURE__ */ React.createElement(IconMaximize3, null)
|
|
622
893
|
))
|
|
623
894
|
},
|
|
624
|
-
/* @__PURE__ */ React.createElement(
|
|
895
|
+
/* @__PURE__ */ React.createElement(Paper3, { h: hSize[0] }, /* @__PURE__ */ React.createElement("iframe", { src: pdfLink, width: "100%", height: "100%" }))
|
|
625
896
|
));
|
|
626
897
|
}
|
|
627
898
|
|
|
628
899
|
// src/components/Buttons/ButtonCRUD/AQButtonCreateByImportFile.tsx
|
|
629
900
|
import { FileInput } from "@mantine/core";
|
|
630
|
-
import { useDisclosure as
|
|
901
|
+
import { useDisclosure as useDisclosure7 } from "@mantine/hooks";
|
|
631
902
|
import { IconFileTypeXls } from "@tabler/icons-react";
|
|
632
903
|
import { useMutation as useMutation3, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
633
904
|
import * as XLSX from "xlsx";
|
|
634
905
|
|
|
635
906
|
// src/components/Buttons/ButtonModal/MyButtonModal.tsx
|
|
636
|
-
import { Button as
|
|
907
|
+
import { Button as Button6, Modal as Modal6 } from "@mantine/core";
|
|
637
908
|
import { IconEdit as IconEdit4, IconPlus as IconPlus4, IconTrash as IconTrash4 } from "@tabler/icons-react";
|
|
638
909
|
function MyButtonModal(_a) {
|
|
639
910
|
var _b = _a, {
|
|
@@ -641,7 +912,7 @@ function MyButtonModal(_a) {
|
|
|
641
912
|
crudType = "default",
|
|
642
913
|
disclosure,
|
|
643
914
|
modalSize,
|
|
644
|
-
title,
|
|
915
|
+
title: title3,
|
|
645
916
|
label,
|
|
646
917
|
children,
|
|
647
918
|
objectName = ""
|
|
@@ -657,12 +928,12 @@ function MyButtonModal(_a) {
|
|
|
657
928
|
]);
|
|
658
929
|
const objectNameLower = objectName == null ? void 0 : objectName.toLowerCase();
|
|
659
930
|
if (crudType == "default") {
|
|
660
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
661
|
-
|
|
931
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button6, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "indigo" }, rest), label), /* @__PURE__ */ React.createElement(
|
|
932
|
+
Modal6,
|
|
662
933
|
{
|
|
663
934
|
fullScreen,
|
|
664
935
|
size: modalSize,
|
|
665
|
-
title,
|
|
936
|
+
title: title3,
|
|
666
937
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
667
938
|
onClose: disclosure[1].close
|
|
668
939
|
},
|
|
@@ -670,12 +941,12 @@ function MyButtonModal(_a) {
|
|
|
670
941
|
));
|
|
671
942
|
}
|
|
672
943
|
if (crudType == "create") {
|
|
673
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
674
|
-
|
|
944
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button6, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, leftSection: /* @__PURE__ */ React.createElement(IconPlus4, null) }, rest), label ? label : `Th\xEAm`), /* @__PURE__ */ React.createElement(
|
|
945
|
+
Modal6,
|
|
675
946
|
{
|
|
676
947
|
fullScreen,
|
|
677
948
|
size: modalSize,
|
|
678
|
-
title:
|
|
949
|
+
title: title3 ? title3 : `T\u1EA1o ${objectNameLower} m\u1EDBi`,
|
|
679
950
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
680
951
|
onClose: disclosure[1].close
|
|
681
952
|
},
|
|
@@ -683,12 +954,12 @@ function MyButtonModal(_a) {
|
|
|
683
954
|
));
|
|
684
955
|
}
|
|
685
956
|
if (crudType == "createMultiple") {
|
|
686
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
687
|
-
|
|
957
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button6, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "green", leftSection: /* @__PURE__ */ React.createElement(IconPlus4, null) }, rest), label ? label : `Import ${objectNameLower}`), /* @__PURE__ */ React.createElement(
|
|
958
|
+
Modal6,
|
|
688
959
|
{
|
|
689
960
|
fullScreen,
|
|
690
961
|
size: modalSize,
|
|
691
|
-
title:
|
|
962
|
+
title: title3 ? title3 : `Th\xEAm danh s\xE1ch ${objectNameLower}`,
|
|
692
963
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
693
964
|
onClose: disclosure[1].close
|
|
694
965
|
},
|
|
@@ -696,12 +967,12 @@ function MyButtonModal(_a) {
|
|
|
696
967
|
));
|
|
697
968
|
}
|
|
698
969
|
if (crudType == "update") {
|
|
699
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
700
|
-
|
|
970
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button6, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "yellow", leftSection: /* @__PURE__ */ React.createElement(IconEdit4, null) }, rest), label ? label : `Ch\u1EC9nh s\u1EEDa ${objectNameLower}`), /* @__PURE__ */ React.createElement(
|
|
971
|
+
Modal6,
|
|
701
972
|
{
|
|
702
973
|
fullScreen,
|
|
703
974
|
size: modalSize,
|
|
704
|
-
title:
|
|
975
|
+
title: title3 ? title3 : `Ch\u1EC9nh s\u1EEDa ${objectNameLower}`,
|
|
705
976
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
706
977
|
onClose: disclosure[1].close
|
|
707
978
|
},
|
|
@@ -709,12 +980,12 @@ function MyButtonModal(_a) {
|
|
|
709
980
|
));
|
|
710
981
|
}
|
|
711
982
|
if (crudType == "delete") {
|
|
712
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
713
|
-
|
|
983
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button6, __spreadValues({ onClick: disclosure == null ? void 0 : disclosure[1].open, color: "red", leftSection: /* @__PURE__ */ React.createElement(IconTrash4, null) }, rest), label ? label : `X\xF3a ${objectNameLower}`), /* @__PURE__ */ React.createElement(
|
|
984
|
+
Modal6,
|
|
714
985
|
{
|
|
715
986
|
fullScreen,
|
|
716
987
|
size: modalSize,
|
|
717
|
-
title:
|
|
988
|
+
title: title3 ? title3 : `X\xF3a ${objectNameLower}`,
|
|
718
989
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
719
990
|
onClose: disclosure[1].close
|
|
720
991
|
},
|
|
@@ -739,7 +1010,7 @@ function AQButtonCreateByImportFile(_a) {
|
|
|
739
1010
|
// children,
|
|
740
1011
|
"setImportedData"
|
|
741
1012
|
]);
|
|
742
|
-
const disc =
|
|
1013
|
+
const disc = useDisclosure7();
|
|
743
1014
|
const queryClient = useQueryClient3();
|
|
744
1015
|
const mutation = useMutation3({
|
|
745
1016
|
mutationFn: async () => {
|
|
@@ -788,8 +1059,8 @@ function AQButtonCreateByImportFile(_a) {
|
|
|
788
1059
|
}
|
|
789
1060
|
|
|
790
1061
|
// src/components/Buttons/ButtonCRUD/AQButtonExportData.tsx
|
|
791
|
-
import { Button as
|
|
792
|
-
import { IconDownload as
|
|
1062
|
+
import { Button as Button7 } from "@mantine/core";
|
|
1063
|
+
import { IconDownload as IconDownload3 } from "@tabler/icons-react";
|
|
793
1064
|
import * as XLSX2 from "xlsx";
|
|
794
1065
|
function AQButtonExportData({
|
|
795
1066
|
isAllData,
|
|
@@ -817,7 +1088,7 @@ function AQButtonExportData({
|
|
|
817
1088
|
XLSX2.writeFile(workbook, `${objectName}.xlsx`);
|
|
818
1089
|
};
|
|
819
1090
|
return /* @__PURE__ */ React.createElement(
|
|
820
|
-
|
|
1091
|
+
Button7,
|
|
821
1092
|
{
|
|
822
1093
|
disabled: data.length === 0,
|
|
823
1094
|
variant: "filled",
|
|
@@ -826,14 +1097,14 @@ function AQButtonExportData({
|
|
|
826
1097
|
event.preventDefault();
|
|
827
1098
|
handleExport();
|
|
828
1099
|
},
|
|
829
|
-
leftSection: /* @__PURE__ */ React.createElement(
|
|
1100
|
+
leftSection: /* @__PURE__ */ React.createElement(IconDownload3, null)
|
|
830
1101
|
},
|
|
831
1102
|
"Export"
|
|
832
1103
|
);
|
|
833
1104
|
}
|
|
834
1105
|
|
|
835
1106
|
// src/components/Buttons/ButtonCRUD/MyButtonCreate.tsx
|
|
836
|
-
import { useDisclosure as
|
|
1107
|
+
import { useDisclosure as useDisclosure8 } from "@mantine/hooks";
|
|
837
1108
|
import { useMutation as useMutation4, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
838
1109
|
function MyButtonCreate(_a) {
|
|
839
1110
|
var _b = _a, {
|
|
@@ -855,7 +1126,7 @@ function MyButtonCreate(_a) {
|
|
|
855
1126
|
"children",
|
|
856
1127
|
"disclosure"
|
|
857
1128
|
]);
|
|
858
|
-
const defaultDisclosure =
|
|
1129
|
+
const defaultDisclosure = useDisclosure8();
|
|
859
1130
|
const disclosure = externalDisclosure != null ? externalDisclosure : defaultDisclosure;
|
|
860
1131
|
const queryClient = useQueryClient4();
|
|
861
1132
|
const mutation = useMutation4({
|
|
@@ -883,7 +1154,7 @@ function MyButtonCreate(_a) {
|
|
|
883
1154
|
}
|
|
884
1155
|
|
|
885
1156
|
// src/components/Buttons/ButtonImport/MyButtonImport.tsx
|
|
886
|
-
import { Button as
|
|
1157
|
+
import { Button as Button10, Modal as Modal9, useModalsStack as useModalsStack3 } from "@mantine/core";
|
|
887
1158
|
import { IconFileImport as IconFileImport2 } from "@tabler/icons-react";
|
|
888
1159
|
|
|
889
1160
|
// src/components/Combobox/Select/MySelect.tsx
|
|
@@ -894,18 +1165,18 @@ function MySelect(_a) {
|
|
|
894
1165
|
}
|
|
895
1166
|
|
|
896
1167
|
// src/components/Layouts/FlexEnd/MyFlexEnd.tsx
|
|
897
|
-
import { Group as
|
|
1168
|
+
import { Group as Group8 } from "@mantine/core";
|
|
898
1169
|
function MyFlexEnd(_a) {
|
|
899
1170
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
900
|
-
return /* @__PURE__ */ React.createElement(
|
|
1171
|
+
return /* @__PURE__ */ React.createElement(Group8, __spreadValues({ justify: "end", mt: "md" }, rest), children);
|
|
901
1172
|
}
|
|
902
1173
|
|
|
903
1174
|
// src/components/Buttons/ButtonImport/SelectFieldModal.tsx
|
|
904
|
-
import { Button as
|
|
1175
|
+
import { Button as Button8, Divider as Divider2, Fieldset, Group as Group9, Modal as Modal7, SimpleGrid, Space as Space2, Table } from "@mantine/core";
|
|
905
1176
|
import { IconArrowBackUp, IconArrowBigLeft, IconArrowBigRight, IconSquareRoundedX } from "@tabler/icons-react";
|
|
906
1177
|
|
|
907
1178
|
// src/components/Buttons/ButtonImport/useS_ButtonImport.ts
|
|
908
|
-
import { useEffect as
|
|
1179
|
+
import { useEffect as useEffect3, useMemo as useMemo2 } from "react";
|
|
909
1180
|
import * as XLSX3 from "xlsx";
|
|
910
1181
|
var useStore = createGenericStore({
|
|
911
1182
|
initialState: {
|
|
@@ -970,7 +1241,7 @@ function useS_ButtonImport() {
|
|
|
970
1241
|
});
|
|
971
1242
|
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
972
1243
|
} else {
|
|
973
|
-
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((
|
|
1244
|
+
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((title3) => title3 === fieldKey)) || fieldKey;
|
|
974
1245
|
const updatedFieldConfig = [
|
|
975
1246
|
...store.state.fieldConfig,
|
|
976
1247
|
{
|
|
@@ -997,7 +1268,7 @@ function useS_ButtonImport() {
|
|
|
997
1268
|
});
|
|
998
1269
|
store.setProperty("fieldConfig", updatedFieldConfig);
|
|
999
1270
|
} else {
|
|
1000
|
-
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((
|
|
1271
|
+
const fieldName = ((_a = store.state.title) == null ? void 0 : _a.find((title3) => title3 === fieldKey)) || fieldKey;
|
|
1001
1272
|
const updatedFieldConfig = [
|
|
1002
1273
|
...store.state.fieldConfig,
|
|
1003
1274
|
{
|
|
@@ -1018,7 +1289,7 @@ function useS_ButtonImport() {
|
|
|
1018
1289
|
}))) || []
|
|
1019
1290
|
];
|
|
1020
1291
|
}, [store.state.title]);
|
|
1021
|
-
|
|
1292
|
+
useEffect3(() => {
|
|
1022
1293
|
if (store.state.file == null) {
|
|
1023
1294
|
store.resetState();
|
|
1024
1295
|
}
|
|
@@ -1039,7 +1310,7 @@ function useS_ButtonImport() {
|
|
|
1039
1310
|
};
|
|
1040
1311
|
reader.readAsArrayBuffer(store.state.file);
|
|
1041
1312
|
}, [store.state.file]);
|
|
1042
|
-
|
|
1313
|
+
useEffect3(() => {
|
|
1043
1314
|
var _a;
|
|
1044
1315
|
if (((_a = store.state.data) == null ? void 0 : _a.length) == 0) return;
|
|
1045
1316
|
autoMap();
|
|
@@ -1058,7 +1329,7 @@ function useS_ButtonImport() {
|
|
|
1058
1329
|
function SelectFieldModal({ stack, onImport }) {
|
|
1059
1330
|
var _a, _b;
|
|
1060
1331
|
const store = useS_ButtonImport();
|
|
1061
|
-
return /* @__PURE__ */ React.createElement(
|
|
1332
|
+
return /* @__PURE__ */ React.createElement(Modal7, __spreadProps(__spreadValues({ fullScreen: true }, stack.register("select-field-page")), { title: "Import" }), /* @__PURE__ */ React.createElement(SimpleGrid, { cols: { base: 1, lg: 2 } }, /* @__PURE__ */ React.createElement(Fieldset, { legend: "Danh s\xE1ch tr\u01B0\u1EDDng th\xF4ng tin" }, /* @__PURE__ */ React.createElement(Table, { stickyHeader: true, stickyHeaderOffset: 60 }, /* @__PURE__ */ React.createElement(Table.Thead, { bg: "cyan" }, /* @__PURE__ */ React.createElement(Table.Tr, null, /* @__PURE__ */ React.createElement(Table.Th, null, "M\xE3 field"), /* @__PURE__ */ React.createElement(Table.Th, null, "T\xEAn field"))), /* @__PURE__ */ React.createElement(Table.Tbody, null, (_a = store.state.fieldConfig) == null ? void 0 : _a.filter((item) => item.isSelected == false || item.isSelected == void 0).map((item, idx) => /* @__PURE__ */ React.createElement(
|
|
1062
1333
|
Table.Tr,
|
|
1063
1334
|
{
|
|
1064
1335
|
key: idx,
|
|
@@ -1066,8 +1337,8 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1066
1337
|
},
|
|
1067
1338
|
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), true) }, item.fieldKey.toString()),
|
|
1068
1339
|
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), true) }, item.fieldName)
|
|
1069
|
-
)))), /* @__PURE__ */ React.createElement(Space2, null), /* @__PURE__ */ React.createElement(
|
|
1070
|
-
|
|
1340
|
+
)))), /* @__PURE__ */ React.createElement(Space2, null), /* @__PURE__ */ React.createElement(Group9, null, /* @__PURE__ */ React.createElement(
|
|
1341
|
+
Button8,
|
|
1071
1342
|
{
|
|
1072
1343
|
onClick: () => {
|
|
1073
1344
|
store.changeAllSelected(true);
|
|
@@ -1085,7 +1356,7 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1085
1356
|
/* @__PURE__ */ React.createElement(Table.Td, { onClick: () => store.changeSelected(item.fieldKey.toString(), false) }, item.fieldName),
|
|
1086
1357
|
/* @__PURE__ */ React.createElement(Table.Td, null, /* @__PURE__ */ React.createElement(MySelect, { data: store.state.title, value: item.fieldToMap, onChange: (e4) => store.setFieldToMap(item.fieldKey.toString(), e4) }))
|
|
1087
1358
|
)))), /* @__PURE__ */ React.createElement(Space2, null), /* @__PURE__ */ React.createElement(
|
|
1088
|
-
|
|
1359
|
+
Button8,
|
|
1089
1360
|
{
|
|
1090
1361
|
onClick: () => {
|
|
1091
1362
|
store.changeAllSelected(false);
|
|
@@ -1093,8 +1364,8 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1093
1364
|
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigLeft, null)
|
|
1094
1365
|
},
|
|
1095
1366
|
"Chuy\u1EC3n t\u1EA5t c\u1EA3 v\u1EC1"
|
|
1096
|
-
))), /* @__PURE__ */ React.createElement(
|
|
1097
|
-
|
|
1367
|
+
))), /* @__PURE__ */ React.createElement(Divider2, null), /* @__PURE__ */ React.createElement(MyFlexEnd, null, /* @__PURE__ */ React.createElement(
|
|
1368
|
+
Button8,
|
|
1098
1369
|
{
|
|
1099
1370
|
leftSection: /* @__PURE__ */ React.createElement(IconArrowBackUp, null),
|
|
1100
1371
|
onClick: () => stack.close("select-field-page"),
|
|
@@ -1102,7 +1373,7 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1102
1373
|
},
|
|
1103
1374
|
"Quay l\u1EA1i"
|
|
1104
1375
|
), /* @__PURE__ */ React.createElement(
|
|
1105
|
-
|
|
1376
|
+
Button8,
|
|
1106
1377
|
{
|
|
1107
1378
|
color: "blue.8",
|
|
1108
1379
|
leftSection: /* @__PURE__ */ React.createElement(IconArrowBigRight, null),
|
|
@@ -1110,7 +1381,7 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1110
1381
|
},
|
|
1111
1382
|
"Ti\u1EBFp t\u1EE5c / Import"
|
|
1112
1383
|
), /* @__PURE__ */ React.createElement(
|
|
1113
|
-
|
|
1384
|
+
Button8,
|
|
1114
1385
|
{
|
|
1115
1386
|
leftSection: /* @__PURE__ */ React.createElement(IconSquareRoundedX, null),
|
|
1116
1387
|
onClick: () => stack.closeAll(),
|
|
@@ -1120,123 +1391,14 @@ function SelectFieldModal({ stack, onImport }) {
|
|
|
1120
1391
|
)));
|
|
1121
1392
|
}
|
|
1122
1393
|
|
|
1123
|
-
// src/components/DataDisplay/DataTable/MyDataTable.tsx
|
|
1124
|
-
import { Button as Button6, Group as Group6 } from "@mantine/core";
|
|
1125
|
-
import { IconDownload as IconDownload3 } from "@tabler/icons-react";
|
|
1126
|
-
import { download, generateCsv, mkConfig } from "export-to-csv";
|
|
1127
|
-
import {
|
|
1128
|
-
MantineReactTable,
|
|
1129
|
-
useMantineReactTable
|
|
1130
|
-
} from "mantine-react-table";
|
|
1131
|
-
import { MRT_Localization_VI } from "mantine-react-table/locales/vi/index.cjs";
|
|
1132
|
-
import { useEffect as useEffect3 } from "react";
|
|
1133
|
-
function formatData(data, formats) {
|
|
1134
|
-
return data.map((row) => {
|
|
1135
|
-
const transformedRow = {};
|
|
1136
|
-
Object.entries(row).forEach(([key, value]) => {
|
|
1137
|
-
const formatFn = formats[key];
|
|
1138
|
-
if (value instanceof Date) {
|
|
1139
|
-
transformedRow[key] = formatFn ? formatFn(value.toISOString()) : value.toISOString();
|
|
1140
|
-
} else if (value !== null && typeof value === "object") {
|
|
1141
|
-
transformedRow[key] = formatFn ? formatFn(JSON.stringify(value)) : JSON.stringify(value);
|
|
1142
|
-
} else {
|
|
1143
|
-
transformedRow[key] = formatFn ? formatFn(value) : value;
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
return transformedRow;
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
function MyDataTable(_a) {
|
|
1150
|
-
var _b = _a, { formats = {}, exportAble = false, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow } = _b, rest = __objRest(_b, ["formats", "exportAble", "csvConfigProps", "rowActionSize", "columns", "data", "renderTopToolbarCustomActions", "setSelectedRow"]);
|
|
1151
|
-
const { renderRowActions } = __spreadValues({}, rest);
|
|
1152
|
-
const csvConfig = mkConfig(__spreadValues({
|
|
1153
|
-
fieldSeparator: ",",
|
|
1154
|
-
decimalSeparator: ".",
|
|
1155
|
-
useKeysAsHeaders: (csvConfigProps == null ? void 0 : csvConfigProps.columnHeaders) ? false : true
|
|
1156
|
-
}, csvConfigProps));
|
|
1157
|
-
const handleExport = (rows) => {
|
|
1158
|
-
if (rows.length == 0) {
|
|
1159
|
-
const transformedData = formatData(data, formats);
|
|
1160
|
-
const csv2 = generateCsv(csvConfig)(transformedData);
|
|
1161
|
-
download(csvConfig)(csv2);
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
const rowData = rows.map((row) => row.original);
|
|
1165
|
-
const transformedRows = formatData(rowData, formats);
|
|
1166
|
-
const csv = generateCsv(csvConfig)(transformedRows);
|
|
1167
|
-
download(csvConfig)(csv);
|
|
1168
|
-
};
|
|
1169
|
-
const table = useMantineReactTable(__spreadValues({
|
|
1170
|
-
columns,
|
|
1171
|
-
data,
|
|
1172
|
-
renderTopToolbarCustomActions: ({ table: table2 }) => {
|
|
1173
|
-
return /* @__PURE__ */ React.createElement(Group6, null, renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table: table2 }), exportAble && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1174
|
-
Button6,
|
|
1175
|
-
{
|
|
1176
|
-
color: "green.8",
|
|
1177
|
-
onClick: () => handleExport(table2.getSelectedRowModel().rows),
|
|
1178
|
-
leftSection: /* @__PURE__ */ React.createElement(IconDownload3, null),
|
|
1179
|
-
variant: "filled"
|
|
1180
|
-
},
|
|
1181
|
-
"Export"
|
|
1182
|
-
)));
|
|
1183
|
-
},
|
|
1184
|
-
enableRowNumbers: true,
|
|
1185
|
-
enableRowSelection: exportAble,
|
|
1186
|
-
enableEditing: renderRowActions ? true : false,
|
|
1187
|
-
positionActionsColumn: "last",
|
|
1188
|
-
enableColumnResizing: true,
|
|
1189
|
-
layoutMode: "semantic",
|
|
1190
|
-
displayColumnDefOptions: {
|
|
1191
|
-
"mrt-row-actions": {
|
|
1192
|
-
header: "Thao t\xE1c",
|
|
1193
|
-
size: rowActionSize
|
|
1194
|
-
},
|
|
1195
|
-
"mrt-row-numbers": {
|
|
1196
|
-
Header: "STT",
|
|
1197
|
-
size: 1
|
|
1198
|
-
}
|
|
1199
|
-
},
|
|
1200
|
-
enableColumnPinning: true,
|
|
1201
|
-
initialState: {
|
|
1202
|
-
density: "md",
|
|
1203
|
-
pagination: { pageIndex: 0, pageSize: 30 },
|
|
1204
|
-
columnPinning: { right: ["mrt-row-actions"] },
|
|
1205
|
-
columnVisibility: {
|
|
1206
|
-
nguoiCapNhat: false,
|
|
1207
|
-
ngayCapNhat: false
|
|
1208
|
-
}
|
|
1209
|
-
},
|
|
1210
|
-
mantineTableHeadCellProps: {
|
|
1211
|
-
style: {
|
|
1212
|
-
verticalAlign: "middle",
|
|
1213
|
-
paddingTop: "2px",
|
|
1214
|
-
paddingBottom: "2px"
|
|
1215
|
-
}
|
|
1216
|
-
},
|
|
1217
|
-
mantineTableBodyCellProps: {
|
|
1218
|
-
style: {
|
|
1219
|
-
paddingTop: "2px",
|
|
1220
|
-
paddingBottom: "2px"
|
|
1221
|
-
}
|
|
1222
|
-
},
|
|
1223
|
-
localization: MRT_Localization_VI
|
|
1224
|
-
}, rest));
|
|
1225
|
-
useEffect3(() => {
|
|
1226
|
-
setSelectedRow && setSelectedRow(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
1227
|
-
}, [table.getState().rowSelection]);
|
|
1228
|
-
if (data == void 0) return;
|
|
1229
|
-
return /* @__PURE__ */ React.createElement(MantineReactTable, { table });
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
1394
|
// src/components/Buttons/ButtonImport/SelectFileModal.tsx
|
|
1233
|
-
import { Button as
|
|
1395
|
+
import { Button as Button9, Fieldset as Fieldset2, FileInput as FileInput2, Modal as Modal8, NumberInput, Select as Select2, SimpleGrid as SimpleGrid2 } from "@mantine/core";
|
|
1234
1396
|
import { IconArrowBigRight as IconArrowBigRight2, IconSquareRoundedX as IconSquareRoundedX2 } from "@tabler/icons-react";
|
|
1235
1397
|
function SelectFileModal({ onExportStructure, stack }) {
|
|
1236
1398
|
var _a;
|
|
1237
1399
|
const store = useS_ButtonImport();
|
|
1238
1400
|
return /* @__PURE__ */ React.createElement(
|
|
1239
|
-
|
|
1401
|
+
Modal8,
|
|
1240
1402
|
__spreadValues({
|
|
1241
1403
|
title: "Import",
|
|
1242
1404
|
fullScreen: true
|
|
@@ -1290,14 +1452,14 @@ function SelectFileModal({ onExportStructure, stack }) {
|
|
|
1290
1452
|
}
|
|
1291
1453
|
)),
|
|
1292
1454
|
/* @__PURE__ */ React.createElement(MyFlexEnd, null, /* @__PURE__ */ React.createElement(
|
|
1293
|
-
|
|
1455
|
+
Button9,
|
|
1294
1456
|
{
|
|
1295
1457
|
color: "teal.8",
|
|
1296
1458
|
onClick: onExportStructure
|
|
1297
1459
|
},
|
|
1298
1460
|
"Xu\u1EA5t file c\u1EA5u tr\xFAc"
|
|
1299
1461
|
), /* @__PURE__ */ React.createElement(
|
|
1300
|
-
|
|
1462
|
+
Button9,
|
|
1301
1463
|
{
|
|
1302
1464
|
disabled: ((_a = store.state.data) == null ? void 0 : _a.length) == 0,
|
|
1303
1465
|
color: "blue.8",
|
|
@@ -1306,7 +1468,7 @@ function SelectFileModal({ onExportStructure, stack }) {
|
|
|
1306
1468
|
},
|
|
1307
1469
|
"Ti\u1EBFp t\u1EE5c"
|
|
1308
1470
|
), /* @__PURE__ */ React.createElement(
|
|
1309
|
-
|
|
1471
|
+
Button9,
|
|
1310
1472
|
{
|
|
1311
1473
|
color: "red.6",
|
|
1312
1474
|
leftSection: /* @__PURE__ */ React.createElement(IconSquareRoundedX2, null),
|
|
@@ -1324,12 +1486,12 @@ function MyButtonImport({
|
|
|
1324
1486
|
}) {
|
|
1325
1487
|
const stack = useModalsStack3(["select-file-page", "select-field-page", "implement-page"]);
|
|
1326
1488
|
const store = useS_ButtonImport();
|
|
1327
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1489
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button10, { color: "teal.8", onClick: () => stack.open("select-file-page"), leftSection: /* @__PURE__ */ React.createElement(IconFileImport2, null), title: "Import" }, "Import"), /* @__PURE__ */ React.createElement(Modal9.Stack, null, /* @__PURE__ */ React.createElement(SelectFileModal, { stack, onExportStructure }), /* @__PURE__ */ React.createElement(SelectFieldModal, { stack, onImport: () => onImport(store.getDataFinal()) })));
|
|
1328
1490
|
}
|
|
1329
1491
|
|
|
1330
1492
|
// src/components/Buttons/ButtonModal/AQSelectTableByOpenModal.tsx
|
|
1331
|
-
import { Button as
|
|
1332
|
-
import { useDisclosure as
|
|
1493
|
+
import { Button as Button11, Fieldset as Fieldset3, Modal as Modal10 } from "@mantine/core";
|
|
1494
|
+
import { useDisclosure as useDisclosure9 } from "@mantine/hooks";
|
|
1333
1495
|
function AQSelectTableByOpenModal(_a) {
|
|
1334
1496
|
var _b = _a, {
|
|
1335
1497
|
setSelectedData,
|
|
@@ -1337,7 +1499,7 @@ function AQSelectTableByOpenModal(_a) {
|
|
|
1337
1499
|
columns,
|
|
1338
1500
|
API,
|
|
1339
1501
|
modalSize,
|
|
1340
|
-
title,
|
|
1502
|
+
title: title3,
|
|
1341
1503
|
label,
|
|
1342
1504
|
listLabel,
|
|
1343
1505
|
objectName,
|
|
@@ -1356,19 +1518,19 @@ function AQSelectTableByOpenModal(_a) {
|
|
|
1356
1518
|
"fullScreen",
|
|
1357
1519
|
"closeAfterSelect"
|
|
1358
1520
|
]);
|
|
1359
|
-
const disclosure =
|
|
1521
|
+
const disclosure = useDisclosure9(false);
|
|
1360
1522
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1361
|
-
|
|
1523
|
+
Button11,
|
|
1362
1524
|
__spreadValues({
|
|
1363
1525
|
onClick: disclosure[1].open
|
|
1364
1526
|
}, rest),
|
|
1365
1527
|
label ? label : `Ch\u1ECDn t\u1EEB danh s\xE1ch`
|
|
1366
1528
|
), /* @__PURE__ */ React.createElement(
|
|
1367
|
-
|
|
1529
|
+
Modal10,
|
|
1368
1530
|
{
|
|
1369
1531
|
fullScreen,
|
|
1370
1532
|
size: modalSize,
|
|
1371
|
-
title,
|
|
1533
|
+
title: title3,
|
|
1372
1534
|
opened: disclosure == null ? void 0 : disclosure[0],
|
|
1373
1535
|
onClose: disclosure[1].close
|
|
1374
1536
|
},
|
|
@@ -1376,7 +1538,7 @@ function AQSelectTableByOpenModal(_a) {
|
|
|
1376
1538
|
MyDataTable,
|
|
1377
1539
|
__spreadValues({
|
|
1378
1540
|
renderTopToolbarCustomActions: ({ table }) => {
|
|
1379
|
-
return /* @__PURE__ */ React.createElement(
|
|
1541
|
+
return /* @__PURE__ */ React.createElement(Button11, { onClick: () => {
|
|
1380
1542
|
setSelectedData(table.getSelectedRowModel().rows.map((row) => row.original));
|
|
1381
1543
|
closeAfterSelect && disclosure[1].close();
|
|
1382
1544
|
} }, "Ch\u1ECDn");
|
|
@@ -1391,7 +1553,7 @@ function AQSelectTableByOpenModal(_a) {
|
|
|
1391
1553
|
|
|
1392
1554
|
// src/components/Buttons/ButtonPrintPDF/MyButtonPrintPDF.tsx
|
|
1393
1555
|
import { useRef as useRef2 } from "react";
|
|
1394
|
-
import { Button as
|
|
1556
|
+
import { Button as Button12 } from "@mantine/core";
|
|
1395
1557
|
import { IconPrinter as IconPrinter2 } from "@tabler/icons-react";
|
|
1396
1558
|
import { useReactToPrint } from "react-to-print";
|
|
1397
1559
|
function MyButtonPrintPDF(_a) {
|
|
@@ -1408,7 +1570,7 @@ function MyButtonPrintPDF(_a) {
|
|
|
1408
1570
|
handlePrint();
|
|
1409
1571
|
}
|
|
1410
1572
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { style: { display: "none" } }, /* @__PURE__ */ React.createElement("div", { ref: printRef }, contentToPrint)), /* @__PURE__ */ React.createElement(
|
|
1411
|
-
|
|
1573
|
+
Button12,
|
|
1412
1574
|
__spreadValues({
|
|
1413
1575
|
color: "orange",
|
|
1414
1576
|
onClick: handleClick,
|
|
@@ -1540,173 +1702,60 @@ function MyButtonPrintTablePDF({
|
|
|
1540
1702
|
);
|
|
1541
1703
|
}
|
|
1542
1704
|
|
|
1543
|
-
//
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
);
|
|
1705
|
+
// node_modules/preact/dist/preact.mjs
|
|
1706
|
+
var n;
|
|
1707
|
+
var l;
|
|
1708
|
+
var t;
|
|
1709
|
+
var u;
|
|
1710
|
+
var i;
|
|
1711
|
+
var r;
|
|
1712
|
+
var o;
|
|
1713
|
+
var e;
|
|
1714
|
+
var f;
|
|
1715
|
+
var c;
|
|
1716
|
+
var s;
|
|
1717
|
+
var a;
|
|
1718
|
+
var h;
|
|
1719
|
+
var p = {};
|
|
1720
|
+
var v = [];
|
|
1721
|
+
var y = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
1722
|
+
var d = Array.isArray;
|
|
1723
|
+
function w(n3, l4) {
|
|
1724
|
+
for (var t4 in l4) n3[t4] = l4[t4];
|
|
1725
|
+
return n3;
|
|
1565
1726
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1727
|
+
function g(n3) {
|
|
1728
|
+
n3 && n3.parentNode && n3.parentNode.removeChild(n3);
|
|
1729
|
+
}
|
|
1730
|
+
function _(l4, t4, u5) {
|
|
1731
|
+
var i5, r4, o4, e4 = {};
|
|
1732
|
+
for (o4 in t4) "key" == o4 ? i5 = t4[o4] : "ref" == o4 ? r4 = t4[o4] : e4[o4] = t4[o4];
|
|
1733
|
+
if (arguments.length > 2 && (e4.children = arguments.length > 3 ? n.call(arguments, 2) : u5), "function" == typeof l4 && null != l4.defaultProps) for (o4 in l4.defaultProps) void 0 === e4[o4] && (e4[o4] = l4.defaultProps[o4]);
|
|
1734
|
+
return m(l4, e4, i5, r4, null);
|
|
1735
|
+
}
|
|
1736
|
+
function m(n3, u5, i5, r4, o4) {
|
|
1737
|
+
var e4 = { type: n3, props: u5, key: i5, ref: r4, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o4 ? ++t : o4, __i: -1, __u: 0 };
|
|
1738
|
+
return null == o4 && null != l.vnode && l.vnode(e4), e4;
|
|
1739
|
+
}
|
|
1740
|
+
function k(n3) {
|
|
1741
|
+
return n3.children;
|
|
1742
|
+
}
|
|
1743
|
+
function x(n3, l4) {
|
|
1744
|
+
this.props = n3, this.context = l4;
|
|
1745
|
+
}
|
|
1746
|
+
function S(n3, l4) {
|
|
1747
|
+
if (null == l4) return n3.__ ? S(n3.__, n3.__i + 1) : null;
|
|
1748
|
+
for (var t4; l4 < n3.__k.length; l4++) if (null != (t4 = n3.__k[l4]) && null != t4.__e) return t4.__e;
|
|
1749
|
+
return "function" == typeof n3.type ? S(n3) : null;
|
|
1750
|
+
}
|
|
1751
|
+
function C(n3) {
|
|
1752
|
+
var l4, t4;
|
|
1753
|
+
if (null != (n3 = n3.__) && null != n3.__c) {
|
|
1754
|
+
for (n3.__e = n3.__c.base = null, l4 = 0; l4 < n3.__k.length; l4++) if (null != (t4 = n3.__k[l4]) && null != t4.__e) {
|
|
1755
|
+
n3.__e = n3.__c.base = t4.__e;
|
|
1756
|
+
break;
|
|
1582
1757
|
}
|
|
1583
|
-
return
|
|
1584
|
-
},
|
|
1585
|
-
(error) => {
|
|
1586
|
-
return Promise.reject(error);
|
|
1587
|
-
}
|
|
1588
|
-
);
|
|
1589
|
-
var baseAxios_default = baseAxios;
|
|
1590
|
-
|
|
1591
|
-
// src/components/Buttons/ButtonViewPDF/MyButtonViewPDF.tsx
|
|
1592
|
-
import { ActionIcon as ActionIcon9, Button as Button12, Group as Group7, LoadingOverlay, Modal as Modal10, Paper as Paper3, Text as Text5, Tooltip as Tooltip4 } from "@mantine/core";
|
|
1593
|
-
import { useDisclosure as useDisclosure9 } from "@mantine/hooks";
|
|
1594
|
-
import { IconLivePhoto as IconLivePhoto2, IconMaximize as IconMaximize3, IconMinimize as IconMinimize3 } from "@tabler/icons-react";
|
|
1595
|
-
import { useQuery } from "@tanstack/react-query";
|
|
1596
|
-
import { useState as useState6 } from "react";
|
|
1597
|
-
function MyButtonViewPDF({ id, modalSize = "80%", label = "Xem file", src = "https://datafiles.chinhphu.vn/cpp/files/vbpq/2016/07/85.signed.pdf" }) {
|
|
1598
|
-
var _a, _b;
|
|
1599
|
-
const disc = useDisclosure9(false);
|
|
1600
|
-
const fullScreen = useState6(false);
|
|
1601
|
-
const hSize = useState6("80vh");
|
|
1602
|
-
const query = useQuery({
|
|
1603
|
-
queryKey: ["MyButtonViewPDF", id],
|
|
1604
|
-
queryFn: async () => {
|
|
1605
|
-
return (await baseAxios_default.get("/Document/Get?id=" + id)).data.data;
|
|
1606
|
-
},
|
|
1607
|
-
enabled: id != void 0 && disc[0] == true
|
|
1608
|
-
});
|
|
1609
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Tooltip4, { label: "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp" }, /* @__PURE__ */ React.createElement(Button12, { color: "cyan", onClick: () => {
|
|
1610
|
-
disc[1].open();
|
|
1611
|
-
}, leftSection: /* @__PURE__ */ React.createElement(IconLivePhoto2, null) }, label)), /* @__PURE__ */ React.createElement(
|
|
1612
|
-
Modal10,
|
|
1613
|
-
{
|
|
1614
|
-
fullScreen: fullScreen[0],
|
|
1615
|
-
opened: disc[0],
|
|
1616
|
-
onClose: disc[1].close,
|
|
1617
|
-
size: modalSize,
|
|
1618
|
-
title: /* @__PURE__ */ React.createElement(Group7, null, /* @__PURE__ */ React.createElement(Text5, null, "Xem t\xE0i li\u1EC7u tr\u1EF1c ti\u1EBFp"), fullScreen[0] ? /* @__PURE__ */ React.createElement(
|
|
1619
|
-
ActionIcon9,
|
|
1620
|
-
{
|
|
1621
|
-
onClick: () => {
|
|
1622
|
-
fullScreen[1](false);
|
|
1623
|
-
hSize[1]("80vh");
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
/* @__PURE__ */ React.createElement(IconMinimize3, null)
|
|
1627
|
-
) : /* @__PURE__ */ React.createElement(
|
|
1628
|
-
ActionIcon9,
|
|
1629
|
-
{
|
|
1630
|
-
onClick: () => {
|
|
1631
|
-
fullScreen[1](true);
|
|
1632
|
-
hSize[1]("90vh");
|
|
1633
|
-
}
|
|
1634
|
-
},
|
|
1635
|
-
/* @__PURE__ */ React.createElement(IconMaximize3, null)
|
|
1636
|
-
))
|
|
1637
|
-
},
|
|
1638
|
-
/* @__PURE__ */ React.createElement(Paper3, { h: hSize[0], p: "lg", pos: "relative" }, /* @__PURE__ */ React.createElement(LoadingOverlay, { visible: query.isLoading, zIndex: 1e3, overlayProps: { radius: "sm", blur: 2 } }), query.data ? /* @__PURE__ */ React.createElement(
|
|
1639
|
-
"iframe",
|
|
1640
|
-
{
|
|
1641
|
-
src: `data:application/pdf;base64, ${(_b = (_a = query.data) == null ? void 0 : _a.fileDetail) == null ? void 0 : _b.fileBase64String}`,
|
|
1642
|
-
width: "100%",
|
|
1643
|
-
height: "100%"
|
|
1644
|
-
}
|
|
1645
|
-
) : /* @__PURE__ */ React.createElement(
|
|
1646
|
-
"iframe",
|
|
1647
|
-
{
|
|
1648
|
-
src,
|
|
1649
|
-
width: "100%",
|
|
1650
|
-
height: "100%"
|
|
1651
|
-
}
|
|
1652
|
-
))
|
|
1653
|
-
));
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
// node_modules/preact/dist/preact.mjs
|
|
1657
|
-
var n;
|
|
1658
|
-
var l;
|
|
1659
|
-
var t;
|
|
1660
|
-
var u;
|
|
1661
|
-
var i;
|
|
1662
|
-
var r;
|
|
1663
|
-
var o;
|
|
1664
|
-
var e;
|
|
1665
|
-
var f;
|
|
1666
|
-
var c;
|
|
1667
|
-
var s;
|
|
1668
|
-
var a;
|
|
1669
|
-
var h;
|
|
1670
|
-
var p = {};
|
|
1671
|
-
var v = [];
|
|
1672
|
-
var y = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
1673
|
-
var d = Array.isArray;
|
|
1674
|
-
function w(n3, l4) {
|
|
1675
|
-
for (var t4 in l4) n3[t4] = l4[t4];
|
|
1676
|
-
return n3;
|
|
1677
|
-
}
|
|
1678
|
-
function g(n3) {
|
|
1679
|
-
n3 && n3.parentNode && n3.parentNode.removeChild(n3);
|
|
1680
|
-
}
|
|
1681
|
-
function _(l4, t4, u5) {
|
|
1682
|
-
var i5, r4, o4, e4 = {};
|
|
1683
|
-
for (o4 in t4) "key" == o4 ? i5 = t4[o4] : "ref" == o4 ? r4 = t4[o4] : e4[o4] = t4[o4];
|
|
1684
|
-
if (arguments.length > 2 && (e4.children = arguments.length > 3 ? n.call(arguments, 2) : u5), "function" == typeof l4 && null != l4.defaultProps) for (o4 in l4.defaultProps) void 0 === e4[o4] && (e4[o4] = l4.defaultProps[o4]);
|
|
1685
|
-
return m(l4, e4, i5, r4, null);
|
|
1686
|
-
}
|
|
1687
|
-
function m(n3, u5, i5, r4, o4) {
|
|
1688
|
-
var e4 = { type: n3, props: u5, key: i5, ref: r4, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: null == o4 ? ++t : o4, __i: -1, __u: 0 };
|
|
1689
|
-
return null == o4 && null != l.vnode && l.vnode(e4), e4;
|
|
1690
|
-
}
|
|
1691
|
-
function k(n3) {
|
|
1692
|
-
return n3.children;
|
|
1693
|
-
}
|
|
1694
|
-
function x(n3, l4) {
|
|
1695
|
-
this.props = n3, this.context = l4;
|
|
1696
|
-
}
|
|
1697
|
-
function S(n3, l4) {
|
|
1698
|
-
if (null == l4) return n3.__ ? S(n3.__, n3.__i + 1) : null;
|
|
1699
|
-
for (var t4; l4 < n3.__k.length; l4++) if (null != (t4 = n3.__k[l4]) && null != t4.__e) return t4.__e;
|
|
1700
|
-
return "function" == typeof n3.type ? S(n3) : null;
|
|
1701
|
-
}
|
|
1702
|
-
function C(n3) {
|
|
1703
|
-
var l4, t4;
|
|
1704
|
-
if (null != (n3 = n3.__) && null != n3.__c) {
|
|
1705
|
-
for (n3.__e = n3.__c.base = null, l4 = 0; l4 < n3.__k.length; l4++) if (null != (t4 = n3.__k[l4]) && null != t4.__e) {
|
|
1706
|
-
n3.__e = n3.__c.base = t4.__e;
|
|
1707
|
-
break;
|
|
1708
|
-
}
|
|
1709
|
-
return C(n3);
|
|
1758
|
+
return C(n3);
|
|
1710
1759
|
}
|
|
1711
1760
|
}
|
|
1712
1761
|
function M(n3) {
|
|
@@ -2955,7 +3004,7 @@ var WeekDay;
|
|
|
2955
3004
|
var DEFAULT_FIRST_DAY_OF_WEEK = WeekDay.MONDAY;
|
|
2956
3005
|
var DEFAULT_EVENT_COLOR_NAME = "primary";
|
|
2957
3006
|
var CalendarEventImpl = class {
|
|
2958
|
-
constructor(_config, id, start, end,
|
|
3007
|
+
constructor(_config, id, start, end, title3, people, location, description, calendarId, _options = void 0, _customContent = {}, _foreignProperties = {}) {
|
|
2959
3008
|
Object.defineProperty(this, "_config", {
|
|
2960
3009
|
enumerable: true,
|
|
2961
3010
|
configurable: true,
|
|
@@ -2984,7 +3033,7 @@ var CalendarEventImpl = class {
|
|
|
2984
3033
|
enumerable: true,
|
|
2985
3034
|
configurable: true,
|
|
2986
3035
|
writable: true,
|
|
2987
|
-
value:
|
|
3036
|
+
value: title3
|
|
2988
3037
|
});
|
|
2989
3038
|
Object.defineProperty(this, "people", {
|
|
2990
3039
|
enumerable: true,
|
|
@@ -3187,8 +3236,8 @@ var CalendarEventBuilder = class {
|
|
|
3187
3236
|
build() {
|
|
3188
3237
|
return new CalendarEventImpl(this._config, this.id, this.start, this.end, this.title, this.people, this.location, this.description, this.calendarId, this._options, this._customContent, this._foreignProperties);
|
|
3189
3238
|
}
|
|
3190
|
-
withTitle(
|
|
3191
|
-
this.title =
|
|
3239
|
+
withTitle(title3) {
|
|
3240
|
+
this.title = title3;
|
|
3192
3241
|
return this;
|
|
3193
3242
|
}
|
|
3194
3243
|
withPeople(people) {
|
|
@@ -5680,12 +5729,6 @@ function MyCalendar() {
|
|
|
5680
5729
|
} }));
|
|
5681
5730
|
}
|
|
5682
5731
|
|
|
5683
|
-
// src/components/CenterFull/MyCenterFull.tsx
|
|
5684
|
-
import { Center as Center2, Group as Group8 } from "@mantine/core";
|
|
5685
|
-
function MyCenterFull({ children }) {
|
|
5686
|
-
return /* @__PURE__ */ React.createElement(Center2, { w: "100%" }, /* @__PURE__ */ React.createElement(Group8, null, children));
|
|
5687
|
-
}
|
|
5688
|
-
|
|
5689
5732
|
// src/components/Checkbox/MyCheckbox.tsx
|
|
5690
5733
|
import { Checkbox as Checkbox2 } from "@mantine/core";
|
|
5691
5734
|
function MyCheckbox(_a) {
|
|
@@ -5705,7 +5748,7 @@ import { Badge, Card, Center as Center3, Image, Text as Text7 } from "@mantine/c
|
|
|
5705
5748
|
import Link from "next/link";
|
|
5706
5749
|
function AQCard({
|
|
5707
5750
|
imgSrc = "https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/images/bg-8.png",
|
|
5708
|
-
title,
|
|
5751
|
+
title: title3,
|
|
5709
5752
|
description,
|
|
5710
5753
|
date,
|
|
5711
5754
|
children,
|
|
@@ -5721,13 +5764,13 @@ function AQCard({
|
|
|
5721
5764
|
fallbackSrc: "https://placehold.co/600x400?text=Placeholder",
|
|
5722
5765
|
alt: "Norway"
|
|
5723
5766
|
}
|
|
5724
|
-
))), /* @__PURE__ */ React.createElement(MyFlexRow, { justify: "space-between", mt: "md", mb: "xs" }, /* @__PURE__ */ React.createElement(Text7, { fw: 500 },
|
|
5767
|
+
))), /* @__PURE__ */ React.createElement(MyFlexRow, { justify: "space-between", mt: "md", mb: "xs" }, /* @__PURE__ */ React.createElement(Text7, { fw: 500 }, title3), status && /* @__PURE__ */ React.createElement(Badge, { color: "violet.5", w: "150px" }, status)), /* @__PURE__ */ React.createElement(Text7, { size: "sm", c: "dimmed", lineClamp: 2 }, description), children);
|
|
5725
5768
|
}
|
|
5726
5769
|
|
|
5727
5770
|
// src/components/DataDisplay/KeyLabel/MyKeyLabel.tsx
|
|
5728
|
-
import { Group as
|
|
5771
|
+
import { Group as Group10, Text as Text8 } from "@mantine/core";
|
|
5729
5772
|
function MyKeyLabel({ keyLabel, label }) {
|
|
5730
|
-
return /* @__PURE__ */ React.createElement(
|
|
5773
|
+
return /* @__PURE__ */ React.createElement(Group10, { gap: 5 }, /* @__PURE__ */ React.createElement(Text8, { fw: "bold" }, keyLabel, ":"), /* @__PURE__ */ React.createElement(Text8, null, label));
|
|
5731
5774
|
}
|
|
5732
5775
|
|
|
5733
5776
|
// src/components/DataDisplay/NumberFormatter/MyNumberFormatter.tsx
|
|
@@ -5738,28 +5781,28 @@ function MyNumberFormatter(_a) {
|
|
|
5738
5781
|
}
|
|
5739
5782
|
|
|
5740
5783
|
// src/components/DataDisplay/StatCard/AQStatCard1.tsx
|
|
5741
|
-
import { Box as Box2, Button as Button13, Flex as Flex3, Group as
|
|
5784
|
+
import { Box as Box2, Button as Button13, Flex as Flex3, Group as Group11, Paper as Paper5, Text as Text9 } from "@mantine/core";
|
|
5742
5785
|
import { IconArrowDownRight, IconArrowUpRight } from "@tabler/icons-react";
|
|
5743
|
-
function AQStatCard1({ title, value, unit = "", description, icons, diff }) {
|
|
5786
|
+
function AQStatCard1({ title: title3, value, unit = "", description, icons, diff }) {
|
|
5744
5787
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5745
5788
|
Paper5,
|
|
5746
5789
|
{
|
|
5747
5790
|
withBorder: true,
|
|
5748
5791
|
p: "md",
|
|
5749
5792
|
radius: "md",
|
|
5750
|
-
key:
|
|
5793
|
+
key: title3
|
|
5751
5794
|
},
|
|
5752
|
-
/* @__PURE__ */ React.createElement(
|
|
5795
|
+
/* @__PURE__ */ React.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Flex3, { direction: "column" }, /* @__PURE__ */ React.createElement(
|
|
5753
5796
|
Text9,
|
|
5754
5797
|
{
|
|
5755
5798
|
tt: "uppercase",
|
|
5756
5799
|
size: "lg",
|
|
5757
5800
|
c: "dimmed"
|
|
5758
5801
|
},
|
|
5759
|
-
|
|
5802
|
+
title3
|
|
5760
5803
|
), unit == "" ? /* @__PURE__ */ React.createElement(Text9, { size: "xs", style: { visibility: "hidden" } }, "\u0110\u01A1n v\u1ECB: ", /* @__PURE__ */ React.createElement("strong", null, unit)) : /* @__PURE__ */ React.createElement(Text9, { size: "xs" }, "\u0110\u01A1n v\u1ECB: ", /* @__PURE__ */ React.createElement("strong", null, unit))), /* @__PURE__ */ React.createElement(Box2, null, icons)),
|
|
5761
5804
|
/* @__PURE__ */ React.createElement(
|
|
5762
|
-
|
|
5805
|
+
Group11,
|
|
5763
5806
|
{
|
|
5764
5807
|
mt: "5",
|
|
5765
5808
|
align: "flex-end",
|
|
@@ -5785,7 +5828,7 @@ function AQStatCard1({ title, value, unit = "", description, icons, diff }) {
|
|
|
5785
5828
|
diff > 0 ? /* @__PURE__ */ React.createElement(IconArrowUpRight, null) : /* @__PURE__ */ React.createElement(IconArrowDownRight, null)
|
|
5786
5829
|
)
|
|
5787
5830
|
),
|
|
5788
|
-
/* @__PURE__ */ React.createElement(
|
|
5831
|
+
/* @__PURE__ */ React.createElement(Group11, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Text9, { tt: "uppercase", fz: "xs", c: "dimmed" }, description), /* @__PURE__ */ React.createElement(
|
|
5789
5832
|
Button13,
|
|
5790
5833
|
{
|
|
5791
5834
|
variant: "light",
|
|
@@ -5808,7 +5851,7 @@ import { Box as Box3, Fieldset as Fieldset4, Text as Text10 } from "@mantine/cor
|
|
|
5808
5851
|
function MyFieldset(_a) {
|
|
5809
5852
|
var _b = _a, {
|
|
5810
5853
|
children,
|
|
5811
|
-
title
|
|
5854
|
+
title: title3
|
|
5812
5855
|
} = _b, rest = __objRest(_b, [
|
|
5813
5856
|
"children",
|
|
5814
5857
|
"title"
|
|
@@ -5824,7 +5867,7 @@ function MyFieldset(_a) {
|
|
|
5824
5867
|
py: 2,
|
|
5825
5868
|
style: { borderRadius: 4 }
|
|
5826
5869
|
},
|
|
5827
|
-
/* @__PURE__ */ React.createElement(Text10, { c: "white", fw: 500 },
|
|
5870
|
+
/* @__PURE__ */ React.createElement(Text10, { c: "white", fw: 500 }, title3)
|
|
5828
5871
|
)
|
|
5829
5872
|
}),
|
|
5830
5873
|
children
|
|
@@ -5986,40 +6029,13 @@ function MyTextEditor(_a) {
|
|
|
5986
6029
|
)));
|
|
5987
6030
|
}
|
|
5988
6031
|
|
|
5989
|
-
// src/modules-features/authenticate/F_authenticate_Logout.tsx
|
|
5990
|
-
import { Button as Button14 } from "@mantine/core";
|
|
5991
|
-
import { IconLogout } from "@tabler/icons-react";
|
|
5992
|
-
import { useRouter as useRouter3 } from "next/navigation";
|
|
5993
|
-
|
|
5994
|
-
// src/modules-features/authenticate/useS_authenticate.ts
|
|
5995
|
-
var useStore2 = createGenericStore({
|
|
5996
|
-
initialState: { token: "" },
|
|
5997
|
-
storageKey: "useS_authenticate"
|
|
5998
|
-
});
|
|
5999
|
-
function useS_authenticate() {
|
|
6000
|
-
const store = useStore2();
|
|
6001
|
-
function logOut() {
|
|
6002
|
-
}
|
|
6003
|
-
return __spreadValues({}, store);
|
|
6004
|
-
}
|
|
6005
|
-
|
|
6006
|
-
// src/modules-features/authenticate/F_authenticate_Logout.tsx
|
|
6007
|
-
function F_authenticate_Logout() {
|
|
6008
|
-
const router = useRouter3();
|
|
6009
|
-
const S_Authenticate = useS_authenticate();
|
|
6010
|
-
return /* @__PURE__ */ React.createElement(Button14, { onClick: () => {
|
|
6011
|
-
S_Authenticate.setProperty("token", "");
|
|
6012
|
-
router.replace("/authenticate/login");
|
|
6013
|
-
}, leftSection: /* @__PURE__ */ React.createElement(IconLogout, null), fullWidth: true, justify: "start", variant: "subtle" }, "\u0110\u0103ng xu\u1EA5t");
|
|
6014
|
-
}
|
|
6015
|
-
|
|
6016
6032
|
// src/components/Layouts/BasicAppShell/BasicAppShell.tsx
|
|
6017
6033
|
import {
|
|
6018
6034
|
ActionIcon as ActionIcon10,
|
|
6019
6035
|
AppShell,
|
|
6020
6036
|
Badge as Badge2,
|
|
6021
|
-
Divider as
|
|
6022
|
-
Group as
|
|
6037
|
+
Divider as Divider3,
|
|
6038
|
+
Group as Group12,
|
|
6023
6039
|
Image as Image3,
|
|
6024
6040
|
NavLink,
|
|
6025
6041
|
ScrollArea as ScrollArea3,
|
|
@@ -6128,7 +6144,7 @@ function BasicAppShell({ children, menu }) {
|
|
|
6128
6144
|
},
|
|
6129
6145
|
padding: "md"
|
|
6130
6146
|
},
|
|
6131
|
-
/* @__PURE__ */ React.createElement(AppShell.Header, null, /* @__PURE__ */ React.createElement(MyAppSpotlight, { menu }), media ? /* @__PURE__ */ React.createElement(
|
|
6147
|
+
/* @__PURE__ */ React.createElement(AppShell.Header, null, /* @__PURE__ */ React.createElement(MyAppSpotlight, { menu }), media ? /* @__PURE__ */ React.createElement(Group12, { h: "100%", px: "md", justify: "space-between", align: "center" }, /* @__PURE__ */ React.createElement(Group12, { h: "100%" }, /* @__PURE__ */ React.createElement(Tooltip5, { label: sidebarStore.state.opened ? "\u1EA8n thanh menu" : "Hi\u1EC7n thanh menu" }, /* @__PURE__ */ React.createElement(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: sidebarStore.toggle }, sidebarStore.state.opened ? /* @__PURE__ */ React.createElement(IconLayoutSidebarLeftExpand, null) : /* @__PURE__ */ React.createElement(IconLayoutSidebarLeftCollapse, null))), /* @__PURE__ */ React.createElement(Tooltip5, { label: "\u0110\xF3ng t\u1EA5t c\u1EA3 menu" }, /* @__PURE__ */ React.createElement(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: () => sidebarStore.clearGroupMenuOpenId() }, /* @__PURE__ */ React.createElement(IconLibraryMinus, null)))), /* @__PURE__ */ React.createElement(Group12, { style: { position: "absolute", left: "50%", transform: "translateX(-50%)" } }, /* @__PURE__ */ React.createElement(Text11, { c: "green", fw: "bold" }, "AQ EduCourseEvaluation - Ph\u1EA7n m\u1EC1m \u0111\xE1nh gi\xE1 chu\u1EA9n \u0111\u1EA7u ra")), /* @__PURE__ */ React.createElement(Group12, null, /* @__PURE__ */ React.createElement(Text11, null, "H\u1ECDc k\u1EF3 l\xE0m vi\u1EC7c"), /* @__PURE__ */ React.createElement(
|
|
6132
6148
|
Select3,
|
|
6133
6149
|
{
|
|
6134
6150
|
w: selectMedia ? 245 : 150,
|
|
@@ -6141,7 +6157,7 @@ function BasicAppShell({ children, menu }) {
|
|
|
6141
6157
|
}
|
|
6142
6158
|
), /* @__PURE__ */ React.createElement(MySwitchTheme, null))) : (
|
|
6143
6159
|
// For mobile screens - simplified layout
|
|
6144
|
-
/* @__PURE__ */ React.createElement(
|
|
6160
|
+
/* @__PURE__ */ React.createElement(Group12, { h: "100%", px: "md", justify: "space-between" }, /* @__PURE__ */ React.createElement(ActionIcon10, { size: "lg", radius: "md", variant: "default", onClick: sidebarStore.toggle }, sidebarStore.state.opened ? /* @__PURE__ */ React.createElement(IconLayoutSidebarLeftExpand, null) : /* @__PURE__ */ React.createElement(IconLayoutSidebarLeftCollapse, null)), /* @__PURE__ */ React.createElement(Text11, { c: "green", fw: "bold", size: "sm" }, "AQ EduCourseEvaluation"), /* @__PURE__ */ React.createElement(Group12, null, /* @__PURE__ */ React.createElement(
|
|
6145
6161
|
Select3,
|
|
6146
6162
|
{
|
|
6147
6163
|
w: 100,
|
|
@@ -6155,7 +6171,7 @@ function BasicAppShell({ children, menu }) {
|
|
|
6155
6171
|
}
|
|
6156
6172
|
), /* @__PURE__ */ React.createElement(MySwitchTheme, null)))
|
|
6157
6173
|
)),
|
|
6158
|
-
/* @__PURE__ */ React.createElement(AppShell.Navbar, null, /* @__PURE__ */ React.createElement(TextInput2, { mt: "md", placeholder: "T\xECm menu (Ctrl + K)", mx: 10, component: "button", onClick: spotlight2.open, leftSection: /* @__PURE__ */ React.createElement(IconSearch2, null) }, "T\xECm ki\u1EBFm (Ctrl + K)"), /* @__PURE__ */ React.createElement(AppShell.Section, { grow: true, component: ScrollArea3, p: 5 }, /* @__PURE__ */ React.createElement(RenderNavLinks, { items: menu }), /* @__PURE__ */ React.createElement(
|
|
6174
|
+
/* @__PURE__ */ React.createElement(AppShell.Navbar, null, /* @__PURE__ */ React.createElement(TextInput2, { mt: "md", placeholder: "T\xECm menu (Ctrl + K)", mx: 10, component: "button", onClick: spotlight2.open, leftSection: /* @__PURE__ */ React.createElement(IconSearch2, null) }, "T\xECm ki\u1EBFm (Ctrl + K)"), /* @__PURE__ */ React.createElement(AppShell.Section, { grow: true, component: ScrollArea3, p: 5 }, /* @__PURE__ */ React.createElement(RenderNavLinks, { items: menu }), /* @__PURE__ */ React.createElement(Divider3, null), /* @__PURE__ */ React.createElement(F_authenticate_Logout, null)), /* @__PURE__ */ React.createElement(AppShell.Section, { p: "md" }, /* @__PURE__ */ React.createElement(Divider3, null), /* @__PURE__ */ React.createElement(Image3, { src: "/imgs/0/IMG0LogoAQTech.png", h: 50, alt: "", w: "auto" }))),
|
|
6159
6175
|
/* @__PURE__ */ React.createElement(AppShell.Main, { bg: "light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-8))" }, children)
|
|
6160
6176
|
);
|
|
6161
6177
|
}
|
|
@@ -6202,10 +6218,10 @@ function utils_layout_getItemsWithoutLinks(menu) {
|
|
|
6202
6218
|
}
|
|
6203
6219
|
|
|
6204
6220
|
// src/components/Layouts/Container/MyContainer.tsx
|
|
6205
|
-
import { Container, Flex as Flex4 } from "@mantine/core";
|
|
6221
|
+
import { Container as Container2, Flex as Flex4 } from "@mantine/core";
|
|
6206
6222
|
function MyContainer(_a) {
|
|
6207
6223
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
6208
|
-
return /* @__PURE__ */ React.createElement(
|
|
6224
|
+
return /* @__PURE__ */ React.createElement(Container2, __spreadValues({ fluid: true }, rest), /* @__PURE__ */ React.createElement(Flex4, { direction: "column" }, children));
|
|
6209
6225
|
}
|
|
6210
6226
|
|
|
6211
6227
|
// src/constants/object/color.ts
|
|
@@ -6219,11 +6235,11 @@ var OBJECT_COlORS = {
|
|
|
6219
6235
|
import {
|
|
6220
6236
|
Box as Box4,
|
|
6221
6237
|
Burger,
|
|
6222
|
-
Button as
|
|
6223
|
-
Container as
|
|
6224
|
-
Divider as
|
|
6238
|
+
Button as Button14,
|
|
6239
|
+
Container as Container3,
|
|
6240
|
+
Divider as Divider4,
|
|
6225
6241
|
Drawer,
|
|
6226
|
-
Group as
|
|
6242
|
+
Group as Group13,
|
|
6227
6243
|
Image as Image4,
|
|
6228
6244
|
ScrollArea as ScrollArea4,
|
|
6229
6245
|
Text as Text12,
|
|
@@ -6248,12 +6264,12 @@ import Link4 from "next/link";
|
|
|
6248
6264
|
var css_default2 = {};
|
|
6249
6265
|
|
|
6250
6266
|
// src/components/Layouts/HeaderMegaMenu/HeaderMegaMenuStore.ts
|
|
6251
|
-
var
|
|
6267
|
+
var useStore2 = createGenericStore({
|
|
6252
6268
|
initialState: { name: "\u0110\u0103ng k\xFD kh\xF3a h\u1ECDc" },
|
|
6253
6269
|
storageKey: "HeaderMegaMenuStore"
|
|
6254
6270
|
});
|
|
6255
6271
|
function useHeaderMegaMenuStore() {
|
|
6256
|
-
const store =
|
|
6272
|
+
const store = useStore2();
|
|
6257
6273
|
return __spreadValues({}, store);
|
|
6258
6274
|
}
|
|
6259
6275
|
|
|
@@ -6295,8 +6311,8 @@ function HeaderMegaMenu({ children, menus }) {
|
|
|
6295
6311
|
const [linksOpened, { toggle: toggleLinks }] = useDisclosure10(false);
|
|
6296
6312
|
const HeaderMegaMenuStore = useHeaderMegaMenuStore();
|
|
6297
6313
|
const theme = useMantineTheme();
|
|
6298
|
-
const links = mockdata.map((item) => /* @__PURE__ */ React.createElement(UnstyledButton, { className: css_default2.subLink, key: item.title }, /* @__PURE__ */ React.createElement(
|
|
6299
|
-
return /* @__PURE__ */ React.createElement(Box4, null, /* @__PURE__ */ React.createElement("header", { className: css_default2.header }, /* @__PURE__ */ React.createElement(
|
|
6314
|
+
const links = mockdata.map((item) => /* @__PURE__ */ React.createElement(UnstyledButton, { className: css_default2.subLink, key: item.title }, /* @__PURE__ */ React.createElement(Group13, { wrap: "nowrap", align: "flex-start" }, /* @__PURE__ */ React.createElement(ThemeIcon, { size: 34, variant: "default", radius: "md" }, /* @__PURE__ */ React.createElement(item.icon, { size: 22, color: theme.colors.blue[6] })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text12, { size: "sm", fw: 500 }, item.title), /* @__PURE__ */ React.createElement(Text12, { size: "xs", c: "dimmed" }, item.description)))));
|
|
6315
|
+
return /* @__PURE__ */ React.createElement(Box4, null, /* @__PURE__ */ React.createElement("header", { className: css_default2.header }, /* @__PURE__ */ React.createElement(Group13, { justify: "space-between", h: "100%" }, /* @__PURE__ */ React.createElement(Group13, null, /* @__PURE__ */ React.createElement(Image4, { src: "/imgs/0/IMG0LogoAQTech.png", h: 30, alt: "", w: "auto" }), /* @__PURE__ */ React.createElement(Group13, { h: "100%", gap: 5, visibleFrom: "sm" }, menus == null ? void 0 : menus.map((item, idx) => /* @__PURE__ */ React.createElement(Button14, { key: idx, component: Link4, href: item.href, variant: HeaderMegaMenuStore.state.name == item.label ? "light" : "subtle", onClick: () => HeaderMegaMenuStore.setState({ name: item.label }) }, item.label)))), /* @__PURE__ */ React.createElement(Group13, null, /* @__PURE__ */ React.createElement(TextInput3, { placeholder: "T\xECm ki\u1EBFm", leftSection: /* @__PURE__ */ React.createElement(IconSearch3, null), radius: "xl", w: "250px" }), /* @__PURE__ */ React.createElement(MySwitchTheme, null)), /* @__PURE__ */ React.createElement(Burger, { opened: drawerOpened, onClick: toggleDrawer, hiddenFrom: "sm" }))), /* @__PURE__ */ React.createElement(Container3, { fluid: true, pt: "sm", pb: "md", bg: OBJECT_COlORS.mantineBackgroundSecondary, mih: "93vh" }, children), /* @__PURE__ */ React.createElement(
|
|
6300
6316
|
Drawer,
|
|
6301
6317
|
{
|
|
6302
6318
|
opened: drawerOpened,
|
|
@@ -6307,32 +6323,10 @@ function HeaderMegaMenu({ children, menus }) {
|
|
|
6307
6323
|
hiddenFrom: "sm",
|
|
6308
6324
|
zIndex: 1e6
|
|
6309
6325
|
},
|
|
6310
|
-
/* @__PURE__ */ React.createElement(ScrollArea4, { h: "calc(100vh - 80px", mx: "-md" }, /* @__PURE__ */ React.createElement(
|
|
6326
|
+
/* @__PURE__ */ React.createElement(ScrollArea4, { h: "calc(100vh - 80px", mx: "-md" }, /* @__PURE__ */ React.createElement(Divider4, { my: "sm" }), /* @__PURE__ */ React.createElement(MyFlexColumn, { h: "100%", gap: 0 }, menus == null ? void 0 : menus.map((item, idx) => /* @__PURE__ */ React.createElement(Button14, { key: idx, component: Link4, href: item.href, variant: HeaderMegaMenuStore.state.name == item.label ? "light" : "subtle", onClick: () => HeaderMegaMenuStore.setState({ name: item.label }) }, item.label))), /* @__PURE__ */ React.createElement(Divider4, { my: "sm" }))
|
|
6311
6327
|
));
|
|
6312
6328
|
}
|
|
6313
6329
|
|
|
6314
|
-
// src/components/Layouts/PageContent/MyPageContent.tsx
|
|
6315
|
-
import { Code, Container as Container3, Divider as Divider4, Group as Group13, Indicator, Title } from "@mantine/core";
|
|
6316
|
-
var getStatusColor = (status) => {
|
|
6317
|
-
switch (status) {
|
|
6318
|
-
case "Prototype":
|
|
6319
|
-
return "blue";
|
|
6320
|
-
case "Beta":
|
|
6321
|
-
return "orange";
|
|
6322
|
-
default:
|
|
6323
|
-
return "gray";
|
|
6324
|
-
}
|
|
6325
|
-
};
|
|
6326
|
-
var PageTitle = ({ title, status }) => {
|
|
6327
|
-
const color = getStatusColor(status);
|
|
6328
|
-
return /* @__PURE__ */ React.createElement(Indicator, { label: status, size: 16, inline: true, color, disabled: !status, pt: 6 }, /* @__PURE__ */ React.createElement(Title, null, title));
|
|
6329
|
-
};
|
|
6330
|
-
function MyPageContent({ leftTopBar, title, canBack = false, rightTopBar, status, children }) {
|
|
6331
|
-
const SidebarStore = useS_Sidebar();
|
|
6332
|
-
const finalTitle = title || SidebarStore.state.title;
|
|
6333
|
-
return /* @__PURE__ */ React.createElement(Container3, { p: 0, fluid: true }, /* @__PURE__ */ React.createElement(Group13, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Group13, null, canBack && /* @__PURE__ */ React.createElement(MyButtonRouterBack, null), /* @__PURE__ */ React.createElement(PageTitle, { title: finalTitle, status }), leftTopBar), /* @__PURE__ */ React.createElement(Group13, null, rightTopBar, /* @__PURE__ */ React.createElement(Code, { color: "var(--mantine-color-blue-light)" }, SidebarStore.state.menuCode))), /* @__PURE__ */ React.createElement(Divider4, null), children);
|
|
6334
|
-
}
|
|
6335
|
-
|
|
6336
6330
|
// src/components/Layouts/Tab/MyTab.tsx
|
|
6337
6331
|
import { rem, Space as Space3, Tabs } from "@mantine/core";
|
|
6338
6332
|
import React3 from "react";
|
|
@@ -6345,7 +6339,7 @@ function MyTab(_a) {
|
|
|
6345
6339
|
}
|
|
6346
6340
|
|
|
6347
6341
|
// src/components/RESTAPIComponents/DataTableSelect/MyDataTableSelect.tsx
|
|
6348
|
-
import { ActionIcon as ActionIcon11, Button as
|
|
6342
|
+
import { ActionIcon as ActionIcon11, Button as Button15, Fieldset as Fieldset5, Group as Group14, Modal as Modal11 } from "@mantine/core";
|
|
6349
6343
|
import { useDisclosure as useDisclosure11 } from "@mantine/hooks";
|
|
6350
6344
|
import { IconX as IconX2 } from "@tabler/icons-react";
|
|
6351
6345
|
function MyDataTableSelect(_a) {
|
|
@@ -6356,7 +6350,7 @@ function MyDataTableSelect(_a) {
|
|
|
6356
6350
|
MyDataTable,
|
|
6357
6351
|
__spreadValues({
|
|
6358
6352
|
renderTopToolbarCustomActions: ({ table }) => {
|
|
6359
|
-
return /* @__PURE__ */ React.createElement(Group14, null, renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table }), /* @__PURE__ */ React.createElement(
|
|
6353
|
+
return /* @__PURE__ */ React.createElement(Group14, null, renderTopToolbarCustomActions && renderTopToolbarCustomActions({ table }), /* @__PURE__ */ React.createElement(Button15, { onClick: disc[1].open }, selectButtonlabel || "Ch\u1ECDn t\u1EEB danh s\xE1ch"));
|
|
6360
6354
|
},
|
|
6361
6355
|
columns,
|
|
6362
6356
|
data: listState[0],
|
|
@@ -6368,7 +6362,7 @@ function MyDataTableSelect(_a) {
|
|
|
6368
6362
|
MyDataTable,
|
|
6369
6363
|
__spreadValues({
|
|
6370
6364
|
renderTopToolbarCustomActions: ({ table }) => {
|
|
6371
|
-
return /* @__PURE__ */ React.createElement(
|
|
6365
|
+
return /* @__PURE__ */ React.createElement(Button15, { onClick: () => {
|
|
6372
6366
|
table.getSelectedRowModel().rows.map((item) => listState[1].append(item.original));
|
|
6373
6367
|
disc[1].close();
|
|
6374
6368
|
} }, "Ch\u1ECDn");
|
|
@@ -6417,68 +6411,2680 @@ function MySkeletonTable({ h: h4 = 500 }) {
|
|
|
6417
6411
|
return /* @__PURE__ */ React.createElement(Skeleton, { h: h4 });
|
|
6418
6412
|
}
|
|
6419
6413
|
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
MyFileInput,
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6414
|
+
// src/modules-features/admin/core/core18256/F_core18256_Select.tsx
|
|
6415
|
+
import { Select as Select5 } from "@mantine/core";
|
|
6416
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
6417
|
+
function F_core18256_Select(_a) {
|
|
6418
|
+
var _b = _a, { documentTypeId, label = "", dataMapper } = _b, rest = __objRest(_b, ["documentTypeId", "label", "dataMapper"]);
|
|
6419
|
+
var _a2, _b2;
|
|
6420
|
+
const query = useQuery3({
|
|
6421
|
+
queryKey: [`/DocumentAttribute/GetByType?documentType=${documentTypeId}`],
|
|
6422
|
+
queryFn: async () => {
|
|
6423
|
+
const result = (await baseAxios_default.get(`/DocumentAttribute/GetByType?documentType=${documentTypeId}`)).data.data;
|
|
6424
|
+
return result;
|
|
6425
|
+
}
|
|
6426
|
+
});
|
|
6427
|
+
if (query.isLoading) return "Loading...";
|
|
6428
|
+
const data = (_a2 = query.data) == null ? void 0 : _a2.map((item) => {
|
|
6429
|
+
var _a3;
|
|
6430
|
+
if (dataMapper) return dataMapper(item);
|
|
6431
|
+
return {
|
|
6432
|
+
value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
|
|
6433
|
+
label: `${item.code}-${item.name}`
|
|
6434
|
+
};
|
|
6435
|
+
});
|
|
6436
|
+
return /* @__PURE__ */ React.createElement(
|
|
6437
|
+
Select5,
|
|
6438
|
+
__spreadProps(__spreadValues({
|
|
6439
|
+
label,
|
|
6440
|
+
placeholder: `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}`,
|
|
6441
|
+
data
|
|
6442
|
+
}, rest), {
|
|
6443
|
+
value: (_b2 = rest.value) == null ? void 0 : _b2.toString()
|
|
6444
|
+
})
|
|
6445
|
+
);
|
|
6446
|
+
}
|
|
6447
|
+
|
|
6448
|
+
// src/modules-features/admin/core/core12196/F_core12196_Create.tsx
|
|
6449
|
+
import { useForm } from "@mantine/form";
|
|
6450
|
+
function F_core12196_Create() {
|
|
6451
|
+
const form = useForm({
|
|
6452
|
+
mode: "uncontrolled"
|
|
6453
|
+
});
|
|
6454
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
|
|
6455
|
+
return await baseAxios_default.post(
|
|
6456
|
+
"/Document/create",
|
|
6457
|
+
__spreadProps(__spreadValues({}, values), {
|
|
6458
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Form,
|
|
6459
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
6460
|
+
})
|
|
6461
|
+
);
|
|
6462
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Form }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6463
|
+
}
|
|
6464
|
+
|
|
6465
|
+
// src/modules-features/admin/core/core12196/F_core12196_Delete.tsx
|
|
6466
|
+
function F_core12196_Delete({ id }) {
|
|
6467
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
|
|
6468
|
+
}
|
|
6469
|
+
|
|
6470
|
+
// src/modules-features/admin/core/core12196/F_core12196_Update.tsx
|
|
6471
|
+
import { useForm as useForm2 } from "@mantine/form";
|
|
6472
|
+
function F_core12196_Update({ values }) {
|
|
6473
|
+
var _a;
|
|
6474
|
+
const form = useForm2({
|
|
6475
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
6476
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
6477
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
6478
|
+
})
|
|
6479
|
+
});
|
|
6480
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
6481
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
6482
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
6483
|
+
}));
|
|
6484
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Form }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6485
|
+
}
|
|
6486
|
+
|
|
6487
|
+
// src/modules-features/admin/core/core12196/F_core12196.tsx
|
|
6488
|
+
function F_core12196() {
|
|
6489
|
+
var _a, _b, _c;
|
|
6490
|
+
const documentAttributeQuery = useQuery4({
|
|
6491
|
+
queryKey: ["F_core12196_Read", OBJECT_DOCUMENT_TYPES.Regulations],
|
|
6492
|
+
queryFn: async () => {
|
|
6493
|
+
var _a2;
|
|
6494
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Form } });
|
|
6495
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
|
6496
|
+
}
|
|
6497
|
+
});
|
|
6498
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
|
6499
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
6500
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0) return /* @__PURE__ */ React.createElement(Blockquote, { color: "yellow" }, "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n");
|
|
6501
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, { rightTopBar: /* @__PURE__ */ React.createElement(F_core12196_Create, null) }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Accordion, { defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map((item) => {
|
|
6502
|
+
var _a2;
|
|
6503
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
|
6504
|
+
}), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead, { key: idx, name: item.name, documentType: item.id })))));
|
|
6505
|
+
}
|
|
6506
|
+
function SubRead({ name, documentType }) {
|
|
6507
|
+
const documentQuery = useQuery4({
|
|
6508
|
+
queryKey: ["SF2_3Read" + documentType],
|
|
6509
|
+
queryFn: async () => {
|
|
6510
|
+
const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
|
|
6511
|
+
return result.data.data;
|
|
6512
|
+
}
|
|
6513
|
+
});
|
|
6514
|
+
const columns = useMemo3(
|
|
6515
|
+
() => [
|
|
6516
|
+
{
|
|
6517
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
|
6518
|
+
accessorKey: "decisionCode"
|
|
6519
|
+
},
|
|
6520
|
+
{
|
|
6521
|
+
header: "Ng\xE0y ban h\xE0nh",
|
|
6522
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
|
6523
|
+
},
|
|
6524
|
+
{
|
|
6525
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
|
6526
|
+
accessorKey: "name"
|
|
6527
|
+
},
|
|
6528
|
+
{
|
|
6529
|
+
header: "File",
|
|
6530
|
+
accessorFn: (row) => {
|
|
6531
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
|
|
6532
|
+
}
|
|
6533
|
+
}
|
|
6534
|
+
],
|
|
6535
|
+
[]
|
|
6536
|
+
);
|
|
6537
|
+
if (documentQuery.isLoading) return "Loading...";
|
|
6538
|
+
if (documentQuery.isError) return "Error!";
|
|
6539
|
+
return /* @__PURE__ */ React.createElement(Accordion.Item, { value: documentType.toString() }, /* @__PURE__ */ React.createElement(Accordion.Control, null, name), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
|
|
6540
|
+
MyDataTable,
|
|
6541
|
+
{
|
|
6542
|
+
columns,
|
|
6543
|
+
data: documentQuery.data,
|
|
6544
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core12196_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core12196_Delete, { id: row.original.id }))
|
|
6545
|
+
}
|
|
6546
|
+
)));
|
|
6547
|
+
}
|
|
6548
|
+
|
|
6549
|
+
// src/modules-features/admin/core/core16209/F_core16209.tsx
|
|
6550
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
6551
|
+
import { useMemo as useMemo4 } from "react";
|
|
6552
|
+
|
|
6553
|
+
// src/modules-features/admin/core/core16209/F_core16209_Create.tsx
|
|
6554
|
+
import { FileInput as FileInput4 } from "@mantine/core";
|
|
6555
|
+
import { useForm as useForm3 } from "@mantine/form";
|
|
6556
|
+
function F_core16209_Create() {
|
|
6557
|
+
const form = useForm3({
|
|
6558
|
+
mode: "uncontrolled"
|
|
6559
|
+
});
|
|
6560
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
|
|
6561
|
+
return await baseAxios_default.post(
|
|
6562
|
+
"/Document/create",
|
|
6563
|
+
__spreadProps(__spreadValues({}, values), {
|
|
6564
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Refinement,
|
|
6565
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
|
6566
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
6567
|
+
})
|
|
6568
|
+
);
|
|
6569
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u" }, form.getInputProps("departmentName"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "N\u1ED9i dung c\u1EA3i ti\u1EBFn" }, form.getInputProps("description"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y b\u1EAFt \u0111\u1EA7u" }, form.getInputProps("startDate"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y k\u1EBFt th\xFAc" }, form.getInputProps("endDate"))), /* @__PURE__ */ React.createElement(FileInput4, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
|
|
6570
|
+
}
|
|
6571
|
+
|
|
6572
|
+
// src/modules-features/admin/core/core16209/F_core16209_Delete.tsx
|
|
6573
|
+
function F_core16209_Delete({ id }) {
|
|
6574
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
// src/modules-features/admin/core/core16209/F_core16209_Update.tsx
|
|
6578
|
+
import { FileInput as FileInput5, TextInput as TextInput4 } from "@mantine/core";
|
|
6579
|
+
import { useForm as useForm4 } from "@mantine/form";
|
|
6580
|
+
function F_core16209_Update({ values }) {
|
|
6581
|
+
var _a;
|
|
6582
|
+
const form = useForm4({
|
|
6583
|
+
mode: "uncontrolled",
|
|
6584
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
6585
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
6586
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
6587
|
+
})
|
|
6588
|
+
});
|
|
6589
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
6590
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
6591
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
6592
|
+
}));
|
|
6593
|
+
} }, /* @__PURE__ */ React.createElement(TextInput4, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(TextInput4, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput5, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
|
|
6594
|
+
}
|
|
6595
|
+
|
|
6596
|
+
// src/modules-features/admin/core/core16209/F_core16209.tsx
|
|
6597
|
+
function F_core16209() {
|
|
6598
|
+
const query = useQuery5({
|
|
6599
|
+
queryKey: ["F_core16209_Read"],
|
|
6600
|
+
queryFn: async () => {
|
|
6601
|
+
var _a;
|
|
6602
|
+
const result = await baseAxios_default.get(`/Document/GetByType?documentType=${OBJECT_DOCUMENT_TYPES.Refinement}`);
|
|
6603
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
6604
|
+
}
|
|
6605
|
+
});
|
|
6606
|
+
const columns = useMemo4(
|
|
6607
|
+
() => [
|
|
6608
|
+
{
|
|
6609
|
+
header: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u",
|
|
6610
|
+
accessorKey: "departmentName"
|
|
6611
|
+
},
|
|
6612
|
+
{
|
|
6613
|
+
header: "N\u1ED9i dung c\u1EA3i ti\u1EBFn",
|
|
6614
|
+
accessorKey: "description"
|
|
6615
|
+
},
|
|
6616
|
+
{
|
|
6617
|
+
header: "Ng\xE0y b\u1EAFt \u0111\u1EA7u",
|
|
6618
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.startDate))
|
|
6619
|
+
},
|
|
6620
|
+
{
|
|
6621
|
+
header: "Ng\xE0y k\u1EBFt th\xFAc",
|
|
6622
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.endDate))
|
|
6623
|
+
},
|
|
6624
|
+
{
|
|
6625
|
+
header: "File",
|
|
6626
|
+
accessorFn: (row) => {
|
|
6627
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
|
|
6628
|
+
}
|
|
6629
|
+
}
|
|
6630
|
+
],
|
|
6631
|
+
[]
|
|
6632
|
+
);
|
|
6633
|
+
if (query.isLoading) return "Loading...";
|
|
6634
|
+
if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
6635
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(
|
|
6636
|
+
MyDataTable,
|
|
6637
|
+
{
|
|
6638
|
+
columns,
|
|
6639
|
+
data: query.data,
|
|
6640
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core16209_Create, null),
|
|
6641
|
+
renderRowActions: ({ row }) => {
|
|
6642
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core16209_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core16209_Delete, { id: row.original.id }));
|
|
6643
|
+
}
|
|
6644
|
+
}
|
|
6645
|
+
));
|
|
6646
|
+
}
|
|
6647
|
+
|
|
6648
|
+
// src/modules-features/admin/core/core18256/F_core18256.tsx
|
|
6649
|
+
import { Tabs as Tabs2 } from "@mantine/core";
|
|
6650
|
+
|
|
6651
|
+
// src/modules-features/admin/core/core18256/F_core18256_Read.tsx
|
|
6652
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
6653
|
+
import { useMemo as useMemo5 } from "react";
|
|
6654
|
+
|
|
6655
|
+
// src/modules-features/admin/core/core18256/F_core18256_Create.tsx
|
|
6656
|
+
import { useForm as useForm5 } from "@mantine/form";
|
|
6657
|
+
function F_core18256_Create({ documentType }) {
|
|
6658
|
+
const form = useForm5({
|
|
6659
|
+
mode: "uncontrolled",
|
|
6660
|
+
initialValues: {
|
|
6661
|
+
name: "",
|
|
6662
|
+
code: "",
|
|
6663
|
+
documentType
|
|
6664
|
+
},
|
|
6665
|
+
validate: {
|
|
6666
|
+
name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
|
6667
|
+
}
|
|
6668
|
+
});
|
|
6669
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "Lo\u1EA1i v\u0103n b\u1EA3n", form, onSubmit: (values) => baseAxios_default.post("/DocumentAttribute/Create", values) }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("name"))));
|
|
6670
|
+
}
|
|
6671
|
+
|
|
6672
|
+
// src/modules-features/admin/core/core18256/F_core18256_Delete.tsx
|
|
6673
|
+
function F_core18256_Delete({ id }) {
|
|
6674
|
+
return /* @__PURE__ */ React.createElement(
|
|
6675
|
+
MyActionIconDelete,
|
|
6676
|
+
{
|
|
6677
|
+
onSubmit: async () => await baseAxios_default.post("/DocumentAttribute/Delete", { id })
|
|
6678
|
+
}
|
|
6679
|
+
);
|
|
6680
|
+
}
|
|
6681
|
+
|
|
6682
|
+
// src/modules-features/admin/core/core18256/F_core18256_Update.tsx
|
|
6683
|
+
import { useForm as useForm6 } from "@mantine/form";
|
|
6684
|
+
function F_core18256_Update({ values }) {
|
|
6685
|
+
const form = useForm6({
|
|
6686
|
+
initialValues: values
|
|
6687
|
+
});
|
|
6688
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => await baseAxios_default.post("/DocumentAttribute/Update", values2) }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("name"))));
|
|
6689
|
+
}
|
|
6690
|
+
|
|
6691
|
+
// src/modules-features/admin/core/core18256/F_core18256_Read.tsx
|
|
6692
|
+
function F_core18256_Read({ documentType }) {
|
|
6693
|
+
const documentAttributeQuery = useQuery6({
|
|
6694
|
+
queryKey: ["F_core18256_Read", documentType],
|
|
6695
|
+
queryFn: async () => {
|
|
6696
|
+
var _a;
|
|
6697
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType } });
|
|
6698
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
6699
|
+
}
|
|
6700
|
+
});
|
|
6701
|
+
const columns = useMemo5(
|
|
6702
|
+
() => [
|
|
6703
|
+
{
|
|
6704
|
+
header: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n",
|
|
6705
|
+
accessorKey: "code"
|
|
6706
|
+
},
|
|
6707
|
+
{
|
|
6708
|
+
header: "T\xEAn Lo\u1EA1i V\u0103n B\u1EA3n",
|
|
6709
|
+
accessorKey: "name"
|
|
6710
|
+
}
|
|
6711
|
+
],
|
|
6712
|
+
[]
|
|
6713
|
+
);
|
|
6714
|
+
if (documentAttributeQuery.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
|
|
6715
|
+
if (documentAttributeQuery.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
6716
|
+
return /* @__PURE__ */ React.createElement(
|
|
6717
|
+
MyDataTable,
|
|
6718
|
+
{
|
|
6719
|
+
columns,
|
|
6720
|
+
enableRowNumbers: true,
|
|
6721
|
+
data: documentAttributeQuery.data,
|
|
6722
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core18256_Create, { documentType }),
|
|
6723
|
+
renderRowActions: ({ row }) => {
|
|
6724
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core18256_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core18256_Delete, { id: row.original.id }));
|
|
6725
|
+
}
|
|
6726
|
+
}
|
|
6727
|
+
);
|
|
6728
|
+
}
|
|
6729
|
+
|
|
6730
|
+
// src/modules-features/admin/core/core18256/F_core18256.tsx
|
|
6731
|
+
var tabData = [
|
|
6732
|
+
{ label: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh" },
|
|
6733
|
+
{ label: "2. Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c" },
|
|
6734
|
+
{ label: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu" }
|
|
6735
|
+
];
|
|
6736
|
+
function F_core18256() {
|
|
6737
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(MyTab, { tabList: tabData }, /* @__PURE__ */ React.createElement(Tabs2.Panel, { value: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh" }, /* @__PURE__ */ React.createElement(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Regulations })), /* @__PURE__ */ React.createElement(Tabs2.Panel, { value: "2. Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c" }, /* @__PURE__ */ React.createElement(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Workflow })), /* @__PURE__ */ React.createElement(Tabs2.Panel, { value: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu" }, /* @__PURE__ */ React.createElement(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Form }))));
|
|
6738
|
+
}
|
|
6739
|
+
|
|
6740
|
+
// src/modules-features/admin/core/core26965/F_core26965_Create.tsx
|
|
6741
|
+
import { useForm as useForm7 } from "@mantine/form";
|
|
6742
|
+
function F_core26965_Create() {
|
|
6743
|
+
const form = useForm7({
|
|
6744
|
+
mode: "uncontrolled"
|
|
6745
|
+
});
|
|
6746
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
|
|
6747
|
+
return await baseAxios_default.post(
|
|
6748
|
+
"/Document/create",
|
|
6749
|
+
__spreadProps(__spreadValues({}, values), {
|
|
6750
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Regulations,
|
|
6751
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
6752
|
+
})
|
|
6753
|
+
);
|
|
6754
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Regulations }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
// src/modules-features/admin/core/core26965/F_core26965_Read.tsx
|
|
6758
|
+
import { Accordion as Accordion2, Blockquote as Blockquote2 } from "@mantine/core";
|
|
6759
|
+
import { useQuery as useQuery7 } from "@tanstack/react-query";
|
|
6760
|
+
import { useMemo as useMemo6 } from "react";
|
|
6761
|
+
|
|
6762
|
+
// src/modules-features/admin/core/core26965/F_core26965_Delete.tsx
|
|
6763
|
+
function F_core26965_Delete({ id }) {
|
|
6764
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
|
|
6765
|
+
}
|
|
6766
|
+
|
|
6767
|
+
// src/modules-features/admin/core/core26965/F_core26965_Update.tsx
|
|
6768
|
+
import { useForm as useForm8 } from "@mantine/form";
|
|
6769
|
+
function F_core26965_Update({ values }) {
|
|
6770
|
+
var _a;
|
|
6771
|
+
const form = useForm8({
|
|
6772
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
6773
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
6774
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
6775
|
+
})
|
|
6776
|
+
});
|
|
6777
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
6778
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
6779
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
6780
|
+
}));
|
|
6781
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Regulations }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6782
|
+
}
|
|
6783
|
+
|
|
6784
|
+
// src/modules-features/admin/core/core26965/F_core26965_Read.tsx
|
|
6785
|
+
function F_core26965_Read() {
|
|
6786
|
+
var _a, _b, _c;
|
|
6787
|
+
const documentAttributeQuery = useQuery7({
|
|
6788
|
+
queryKey: ["F_core26965_Read", OBJECT_DOCUMENT_TYPES.Regulations],
|
|
6789
|
+
queryFn: async () => {
|
|
6790
|
+
var _a2;
|
|
6791
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Regulations } });
|
|
6792
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
|
6793
|
+
}
|
|
6794
|
+
});
|
|
6795
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
|
6796
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
6797
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0) return /* @__PURE__ */ React.createElement(Blockquote2, { color: "yellow" }, "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n");
|
|
6798
|
+
return /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Accordion2, { defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map((item) => {
|
|
6799
|
+
var _a2;
|
|
6800
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
|
6801
|
+
}), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead2, { key: idx, name: item.name, documentType: item.id }))));
|
|
6802
|
+
}
|
|
6803
|
+
function SubRead2({ name, documentType }) {
|
|
6804
|
+
const documentQuery = useQuery7({
|
|
6805
|
+
queryKey: ["SubRead" + documentType],
|
|
6806
|
+
queryFn: async () => {
|
|
6807
|
+
const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
|
|
6808
|
+
return result.data.data;
|
|
6809
|
+
}
|
|
6810
|
+
});
|
|
6811
|
+
const columns = useMemo6(
|
|
6812
|
+
() => [
|
|
6813
|
+
{
|
|
6814
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
|
6815
|
+
accessorKey: "decisionCode"
|
|
6816
|
+
},
|
|
6817
|
+
{
|
|
6818
|
+
header: "Ng\xE0y ban h\xE0nh",
|
|
6819
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
|
6820
|
+
},
|
|
6821
|
+
{
|
|
6822
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
|
6823
|
+
accessorKey: "name"
|
|
6824
|
+
},
|
|
6825
|
+
{
|
|
6826
|
+
header: "File",
|
|
6827
|
+
accessorFn: (row) => {
|
|
6828
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
],
|
|
6832
|
+
[]
|
|
6833
|
+
);
|
|
6834
|
+
if (documentQuery.isLoading) return "Loading...";
|
|
6835
|
+
if (documentQuery.isError) return "Error!";
|
|
6836
|
+
return /* @__PURE__ */ React.createElement(Accordion2.Item, { value: documentType.toString() }, /* @__PURE__ */ React.createElement(Accordion2.Control, null, name), /* @__PURE__ */ React.createElement(Accordion2.Panel, null, /* @__PURE__ */ React.createElement(
|
|
6837
|
+
MyDataTable,
|
|
6838
|
+
{
|
|
6839
|
+
columns,
|
|
6840
|
+
data: documentQuery.data,
|
|
6841
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core26965_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core26965_Delete, { id: row.original.id }))
|
|
6842
|
+
}
|
|
6843
|
+
)));
|
|
6844
|
+
}
|
|
6845
|
+
|
|
6846
|
+
// src/modules-features/admin/core/core26965/F_core26965.tsx
|
|
6847
|
+
function F_core26965() {
|
|
6848
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, { rightTopBar: /* @__PURE__ */ React.createElement(F_core26965_Create, null) }, /* @__PURE__ */ React.createElement(F_core26965_Read, null));
|
|
6849
|
+
}
|
|
6850
|
+
|
|
6851
|
+
// src/modules-features/admin/core/core27311/F_core27311_Create.tsx
|
|
6852
|
+
import { useForm as useForm9 } from "@mantine/form";
|
|
6853
|
+
function F_core27311_Create() {
|
|
6854
|
+
const form = useForm9({
|
|
6855
|
+
mode: "uncontrolled"
|
|
6856
|
+
});
|
|
6857
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
|
|
6858
|
+
return await baseAxios_default.post(
|
|
6859
|
+
"/Document/create",
|
|
6860
|
+
__spreadProps(__spreadValues({}, values), {
|
|
6861
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Workflow,
|
|
6862
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
6863
|
+
})
|
|
6864
|
+
);
|
|
6865
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Workflow }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6866
|
+
}
|
|
6867
|
+
|
|
6868
|
+
// src/modules-features/admin/core/core27311/F_core27311_Read.tsx
|
|
6869
|
+
import { Accordion as Accordion3, Blockquote as Blockquote3 } from "@mantine/core";
|
|
6870
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
6871
|
+
import { useMemo as useMemo7 } from "react";
|
|
6872
|
+
|
|
6873
|
+
// src/modules-features/admin/core/core27311/F_core27311_Delete.tsx
|
|
6874
|
+
function F_core27311_Delete({ id }) {
|
|
6875
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
|
|
6876
|
+
}
|
|
6877
|
+
|
|
6878
|
+
// src/modules-features/admin/core/core27311/F_core27311_Update.tsx
|
|
6879
|
+
import { useForm as useForm10 } from "@mantine/form";
|
|
6880
|
+
function F_core27311_Update({ values }) {
|
|
6881
|
+
var _a;
|
|
6882
|
+
const form = useForm10({
|
|
6883
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
6884
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
6885
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
6886
|
+
})
|
|
6887
|
+
});
|
|
6888
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
6889
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
6890
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
6891
|
+
}));
|
|
6892
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(F_core18256_Select, __spreadValues({ label: "Lo\u1EA1i v\u0103n b\u1EA3n", documentTypeId: OBJECT_DOCUMENT_TYPES.Regulations }, form.getInputProps("documentAttributeId"))), /* @__PURE__ */ React.createElement(MyFileInput, __spreadValues({ label: "V\u0103n b\u1EA3n" }, form.getInputProps("file"))), /* @__PURE__ */ React.createElement(MyNumberInput, __spreadValues({ label: "Th\u1EE9 t\u1EF1 hi\u1EC3n th\u1ECB tr\xEAn danh s\xE1ch" }, form.getInputProps("orderBy"))));
|
|
6893
|
+
}
|
|
6894
|
+
|
|
6895
|
+
// src/modules-features/admin/core/core27311/F_core27311_Read.tsx
|
|
6896
|
+
function F_core27311_Read() {
|
|
6897
|
+
var _a, _b, _c;
|
|
6898
|
+
const documentAttributeQuery = useQuery8({
|
|
6899
|
+
queryKey: ["F_core27311_Read", OBJECT_DOCUMENT_TYPES.Workflow],
|
|
6900
|
+
queryFn: async () => {
|
|
6901
|
+
var _a2;
|
|
6902
|
+
const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Workflow } });
|
|
6903
|
+
return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
|
|
6904
|
+
}
|
|
6905
|
+
});
|
|
6906
|
+
if (documentAttributeQuery.isLoading) return "Loading...";
|
|
6907
|
+
if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
6908
|
+
if (((_a = documentAttributeQuery.data) == null ? void 0 : _a.length) == 0) return /* @__PURE__ */ React.createElement(Blockquote3, { color: "yellow" }, "Ch\u01B0a c\xF3 lo\u1EA1i v\u0103n b\u1EA3n");
|
|
6909
|
+
return /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Accordion3, { defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map((item) => {
|
|
6910
|
+
var _a2;
|
|
6911
|
+
return (_a2 = item.id) == null ? void 0 : _a2.toString();
|
|
6912
|
+
}), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead3, { key: idx, name: item.name, documentType: item.id }))));
|
|
6913
|
+
}
|
|
6914
|
+
function SubRead3({ name, documentType }) {
|
|
6915
|
+
const documentQuery = useQuery8({
|
|
6916
|
+
queryKey: ["SubRead" + documentType],
|
|
6917
|
+
queryFn: async () => {
|
|
6918
|
+
const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
|
|
6919
|
+
return result.data.data;
|
|
6920
|
+
}
|
|
6921
|
+
});
|
|
6922
|
+
const columns = useMemo7(
|
|
6923
|
+
() => [
|
|
6924
|
+
{
|
|
6925
|
+
header: "S\u1ED1 quy \u0111\u1ECBnh",
|
|
6926
|
+
accessorKey: "decisionCode"
|
|
6927
|
+
},
|
|
6928
|
+
{
|
|
6929
|
+
header: "Ng\xE0y ban h\xE0nh",
|
|
6930
|
+
accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
|
|
6931
|
+
},
|
|
6932
|
+
{
|
|
6933
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
|
6934
|
+
accessorKey: "name"
|
|
6935
|
+
},
|
|
6936
|
+
{
|
|
6937
|
+
header: "File",
|
|
6938
|
+
accessorFn: (row) => {
|
|
6939
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
|
|
6940
|
+
}
|
|
6941
|
+
}
|
|
6942
|
+
],
|
|
6943
|
+
[]
|
|
6944
|
+
);
|
|
6945
|
+
if (documentQuery.isLoading) return "Loading...";
|
|
6946
|
+
if (documentQuery.isError) return "Error!";
|
|
6947
|
+
return /* @__PURE__ */ React.createElement(Accordion3.Item, { value: documentType.toString() }, /* @__PURE__ */ React.createElement(Accordion3.Control, null, name), /* @__PURE__ */ React.createElement(Accordion3.Panel, null, /* @__PURE__ */ React.createElement(
|
|
6948
|
+
MyDataTable,
|
|
6949
|
+
{
|
|
6950
|
+
columns,
|
|
6951
|
+
data: documentQuery.data,
|
|
6952
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core27311_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core27311_Delete, { id: row.original.id }))
|
|
6953
|
+
}
|
|
6954
|
+
)));
|
|
6955
|
+
}
|
|
6956
|
+
|
|
6957
|
+
// src/modules-features/admin/core/core27311/F_core27311.tsx
|
|
6958
|
+
function F_core27311() {
|
|
6959
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, { rightTopBar: /* @__PURE__ */ React.createElement(F_core27311_Create, null) }, /* @__PURE__ */ React.createElement(F_core27311_Read, null));
|
|
6960
|
+
}
|
|
6961
|
+
|
|
6962
|
+
// src/modules-features/admin/core/core38677/F_core38677.tsx
|
|
6963
|
+
import { Grid, Paper as Paper6, ScrollArea as ScrollArea6 } from "@mantine/core";
|
|
6964
|
+
|
|
6965
|
+
// src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
|
|
6966
|
+
import { Container as Container4 } from "@mantine/core";
|
|
6967
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
6968
|
+
import { useEffect as useEffect6, useMemo as useMemo8, useState as useState8 } from "react";
|
|
6969
|
+
|
|
6970
|
+
// src/modules-features/admin/core/core83092/useS_core83092.tsx
|
|
6971
|
+
var useStore3 = createGenericStore({
|
|
6972
|
+
initialState: { roleId: 0 },
|
|
6973
|
+
storageKey: "useS_core83092"
|
|
6974
|
+
});
|
|
6975
|
+
function useS_core83092() {
|
|
6976
|
+
const store = useStore3();
|
|
6977
|
+
function toogleAllPermissionWithType(field, isCheck) {
|
|
6978
|
+
var _a;
|
|
6979
|
+
const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
6980
|
+
[field]: isCheck
|
|
6981
|
+
}));
|
|
6982
|
+
store.setProperty("rolePermissions", updatedData);
|
|
6983
|
+
}
|
|
6984
|
+
function findByPageId(pageId) {
|
|
6985
|
+
var _a;
|
|
6986
|
+
const rolePermission = (_a = store.state.rolePermissions) == null ? void 0 : _a.find((item) => item.pageId == pageId);
|
|
6987
|
+
return rolePermission;
|
|
6988
|
+
}
|
|
6989
|
+
function updatePermission(pageId, updatedPermission) {
|
|
6990
|
+
var _a;
|
|
6991
|
+
const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map(
|
|
6992
|
+
(item) => item.pageId === pageId ? __spreadValues(__spreadValues({}, item), updatedPermission) : item
|
|
6993
|
+
);
|
|
6994
|
+
store.setProperty("rolePermissions", updatedData);
|
|
6995
|
+
}
|
|
6996
|
+
function isAllPermission(field) {
|
|
6997
|
+
var _a, _b;
|
|
6998
|
+
return (_b = (_a = store.state.rolePermissions) == null ? void 0 : _a.every((item) => item[field] === true)) != null ? _b : false;
|
|
6999
|
+
}
|
|
7000
|
+
return __spreadProps(__spreadValues({}, store), {
|
|
7001
|
+
toogleAllPermissionWithType,
|
|
7002
|
+
findByPageId,
|
|
7003
|
+
updatePermission,
|
|
7004
|
+
isAllPermission
|
|
7005
|
+
});
|
|
7006
|
+
}
|
|
7007
|
+
function utils_core83092_mergePage(arr1, arr2) {
|
|
7008
|
+
const pageMap = /* @__PURE__ */ new Map();
|
|
7009
|
+
arr1.forEach((page) => pageMap.set(page.pageId, page));
|
|
7010
|
+
arr2.forEach((page) => {
|
|
7011
|
+
if (pageMap.has(page.pageId)) {
|
|
7012
|
+
pageMap.set(page.pageId, page);
|
|
7013
|
+
}
|
|
7014
|
+
});
|
|
7015
|
+
return Array.from(pageMap.values());
|
|
7016
|
+
}
|
|
7017
|
+
|
|
7018
|
+
// src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
|
|
7019
|
+
function F_core38677_ReadUser() {
|
|
7020
|
+
const store = useS_core83092();
|
|
7021
|
+
const query = useQ_Account_GetAdminAccount();
|
|
7022
|
+
const [rowSelection, setRowSelection] = useState8({});
|
|
7023
|
+
const columns = useMemo8(
|
|
7024
|
+
() => [
|
|
7025
|
+
{
|
|
7026
|
+
header: "M\xE3",
|
|
7027
|
+
accessorKey: "code",
|
|
7028
|
+
size: 60
|
|
7029
|
+
},
|
|
7030
|
+
{
|
|
7031
|
+
header: "T\xEAn quy\u1EC1n",
|
|
7032
|
+
accessorKey: "name"
|
|
7033
|
+
}
|
|
7034
|
+
],
|
|
7035
|
+
[]
|
|
7036
|
+
);
|
|
7037
|
+
const handleRowClick = (rowId) => {
|
|
7038
|
+
setRowSelection({ [rowId]: true });
|
|
7039
|
+
store.setProperty("roleId", parseInt(rowId));
|
|
7040
|
+
};
|
|
7041
|
+
useEffect6(() => {
|
|
7042
|
+
if (store.state.roleId == 0) return;
|
|
7043
|
+
setRowSelection({ [store.state.roleId]: true });
|
|
7044
|
+
}, [store.state.roleId]);
|
|
7045
|
+
useEffect6(() => {
|
|
7046
|
+
if (!query.data) return;
|
|
7047
|
+
store.setProperty("roleId", query.data[0].id);
|
|
7048
|
+
}, [query.data]);
|
|
7049
|
+
if (query.isLoading) return "Loading...";
|
|
7050
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
7051
|
+
return /* @__PURE__ */ React.createElement(Container4, { fluid: true }, /* @__PURE__ */ React.createElement(
|
|
7052
|
+
MyDataTable,
|
|
7053
|
+
{
|
|
7054
|
+
columns,
|
|
7055
|
+
data: query.data,
|
|
7056
|
+
getRowId: (row) => {
|
|
7057
|
+
var _a;
|
|
7058
|
+
return (_a = row.id) == null ? void 0 : _a.toString();
|
|
7059
|
+
},
|
|
7060
|
+
mantineTableBodyRowProps: ({ row }) => ({
|
|
7061
|
+
onClick: () => handleRowClick(row.id),
|
|
7062
|
+
style: {
|
|
7063
|
+
cursor: "pointer",
|
|
7064
|
+
backgroundColor: rowSelection[row.id] ? "var(--mantine-color-blue-light)" : "transparent"
|
|
7065
|
+
}
|
|
7066
|
+
}),
|
|
7067
|
+
state: rowSelection
|
|
7068
|
+
}
|
|
7069
|
+
));
|
|
7070
|
+
}
|
|
7071
|
+
function useQ_Account_GetAdminAccount() {
|
|
7072
|
+
const query = useQuery9({
|
|
7073
|
+
queryKey: ["useQ_Role_GetAdminRole"],
|
|
7074
|
+
queryFn: async () => {
|
|
7075
|
+
var _a;
|
|
7076
|
+
const result = await baseAxios_default.get(`/Role/GetAdminRole`);
|
|
7077
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
7078
|
+
},
|
|
7079
|
+
refetchOnWindowFocus: false
|
|
7080
|
+
});
|
|
7081
|
+
return query;
|
|
7082
|
+
}
|
|
7083
|
+
|
|
7084
|
+
// src/modules-features/admin/core/core38677/F_core38677_Save.tsx
|
|
7085
|
+
import { useMutation as useMutation5 } from "@tanstack/react-query";
|
|
7086
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
7087
|
+
function F_core38677_Save() {
|
|
7088
|
+
const store = useS_core83092();
|
|
7089
|
+
const disable = useState9(false);
|
|
7090
|
+
const mutation = useMutation5({
|
|
7091
|
+
mutationFn: async (body) => {
|
|
7092
|
+
const res = await baseAxios_default.put("/Role/UpdatePermission", body);
|
|
7093
|
+
return res;
|
|
7094
|
+
}
|
|
7095
|
+
});
|
|
7096
|
+
function handleSave() {
|
|
7097
|
+
mutation.mutate({
|
|
7098
|
+
pagePermissions: store.state.rolePermissions,
|
|
7099
|
+
roleId: store.state.roleId
|
|
7100
|
+
}, {
|
|
7101
|
+
onSuccess: () => {
|
|
7102
|
+
utils_notification_show({
|
|
7103
|
+
crudType: "update"
|
|
7104
|
+
});
|
|
7105
|
+
}
|
|
7106
|
+
});
|
|
7107
|
+
}
|
|
7108
|
+
useEffect7(() => {
|
|
7109
|
+
if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
|
|
7110
|
+
disable[1](true);
|
|
7111
|
+
return;
|
|
7112
|
+
}
|
|
7113
|
+
disable[1](false);
|
|
7114
|
+
}, [store.state.rolePermissions]);
|
|
7115
|
+
return /* @__PURE__ */ React.createElement(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7118
|
+
// src/data/menuData.ts
|
|
7119
|
+
var menuData = [
|
|
7120
|
+
{
|
|
7121
|
+
label: "Qu\u1EA3n l\xED h\u1EC7 th\u1ED1ng",
|
|
7122
|
+
links: [
|
|
7123
|
+
{ pageId: 1, name: "Account management", label: "Qu\u1EA3n l\xED t\xE0i kho\u1EA3n", link: "core71678" },
|
|
7124
|
+
// { label: "Danh mục quyền", link: "47643", status: "Prototype" },
|
|
7125
|
+
{ pageId: 2, name: "Access control level", label: "Ph\xE2n quy\u1EC1n c\u1EA5p \u0111\u01A1n v\u1ECB", link: "core38677" },
|
|
7126
|
+
{ pageId: 3, name: "Access control", label: "Ph\xE2n quy\u1EC1n s\u1EED d\u1EE5ng", link: "core83092" },
|
|
7127
|
+
{ name: "Document categories", label: "Danh m\u1EE5c lo\u1EA1i v\u0103n b\u1EA3n", link: "core18256" },
|
|
7128
|
+
{ pageId: 4, name: "Security regulations", label: "Quy \u0111\u1ECBnh an to\xE0n/ b\u1EA3o m\u1EADt th\xF4ng tin", link: "core76318", status: "Default" },
|
|
7129
|
+
{ pageId: 5, name: "System updates", label: "Th\xF4ng tin x\xE2y d\u1EF1ng, c\u1EA3i ti\u1EBFn, b\u1EA3o tr\xEC h\u1EC7 th\u1ED1ng", link: "core16209", status: "Default" },
|
|
7130
|
+
{ pageId: 6, name: "User guide", label: "T\xE0i li\u1EC7u h\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng", link: "core40207", status: "Default" },
|
|
7131
|
+
{ pageId: 0, name: "Ch\u01B0a \u0111\u1EB7t", label: "Danh m\u1EE5c c\u1EA5u h\xECnh mail", link: "core64229", status: "Default" }
|
|
7132
|
+
]
|
|
7133
|
+
},
|
|
7134
|
+
{
|
|
7135
|
+
label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh",
|
|
7136
|
+
links: [
|
|
7137
|
+
{ pageId: 7, name: "Organizational regulations", label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", link: "core26965", status: "Default" },
|
|
7138
|
+
{ pageId: 8, name: "Workflow process", label: "Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", link: "core27311", status: "Default" },
|
|
7139
|
+
{ pageId: 9, name: "Form templates", label: "T\xE0i li\u1EC7u bi\u1EC3u m\u1EABu", link: "core12196", status: "Default" }
|
|
7140
|
+
]
|
|
7141
|
+
},
|
|
7142
|
+
{
|
|
7143
|
+
label: "Qu\u1EA3n l\xFD ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o ",
|
|
7144
|
+
links: [
|
|
7145
|
+
{
|
|
7146
|
+
label: "\u0110\u1ECBnh ngh\u0129a d\u1EEF li\u1EC7u",
|
|
7147
|
+
links: [
|
|
7148
|
+
{ pageId: 609, name: "Training Level Catalog", label: "Danh m\u1EE5c b\u1EADc \u0111\xE0o t\u1EA1o", link: "vf2cwmibmh" },
|
|
7149
|
+
{ pageId: 610, name: "Training systems Catalog", label: "Danh m\u1EE5c h\u1EC7 \u0111\xE0o t\u1EA1o", link: "4hi65qkj5n" },
|
|
7150
|
+
{ pageId: 611, name: "Regulation Catalog", label: "Danh m\u1EE5c quy ch\u1EBF", link: "j9ul1u9c2n", status: "Default" },
|
|
7151
|
+
{ pageId: 612, name: "Degree levels Catalog", label: "Danh m\u1EE5c b\u1EADc h\u1EC7", link: "zvib1md6z9" },
|
|
7152
|
+
{ pageId: 613, name: "Program Catalog", label: "Danh m\u1EE5c ch\u01B0\u01A1ng tr\xECnh", link: "h7op7f4nav", status: "Default" },
|
|
7153
|
+
{ pageId: 614, name: "Grade Catalog", label: "Danh m\u1EE5c Kh\xF3a", link: "ukagvjshxgy" },
|
|
7154
|
+
{ pageId: 615, name: "Subject group Catalog", label: "Danh m\u1EE5c nh\xF3m m\xF4n h\u1ECDc", link: "zudcgcvda8", status: "Default" },
|
|
7155
|
+
{ pageId: 616, name: "Subject Catalog", label: "Danh m\u1EE5c m\xF4n h\u1ECDc", link: "rdrmqcfvux" },
|
|
7156
|
+
{ pageId: 617, name: "Subject group MIT", label: "Quan h\u1EC7 nh\xF3m m\xF4n h\u1ECDc v\xE0 thang MIT", link: "wfl5pwciof" }
|
|
7157
|
+
]
|
|
7158
|
+
},
|
|
7159
|
+
{
|
|
7160
|
+
label: "Ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o",
|
|
7161
|
+
links: [
|
|
7162
|
+
{ pageId: 618, name: "Training program", label: "Ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o", link: "hlnya90qi9" },
|
|
7163
|
+
{ pageId: 619, name: "Program Learning Outcomes", label: "Chu\u1EA9n \u0111\u1EA7u ra ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o (PLO)", link: "lz8rrabyws", status: "Prototype" },
|
|
7164
|
+
{ pageId: 620, name: "Course Learning Outcomes", label: "Chu\u1EA9n \u0111\u1EA7u ra m\xF4n h\u1ECDc (CLO)", link: "upgwbnmsn8", status: "Default" },
|
|
7165
|
+
{ pageId: 621, name: "CLO PIs relation", label: "Quan h\u1EC7 CLO v\xE0 Pis", link: "hxrvhadcfm" },
|
|
7166
|
+
{ pageId: 622, name: "Evaluation unit assignment", label: "Ph\xE2n c\xF4ng \u0111\u01A1n v\u1ECB \u0111\xE1nh gi\xE1", link: "rb55trm19d", status: "Prototype" }
|
|
7167
|
+
]
|
|
7168
|
+
}
|
|
7169
|
+
]
|
|
7170
|
+
},
|
|
7171
|
+
{
|
|
7172
|
+
label: "Khung \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
|
|
7173
|
+
links: [
|
|
7174
|
+
{ pageId: 623, name: "Core courses measuring PLOs", label: "Danh m\u1EE5c m\xF4n h\u1ECDc c\u1ED1t l\xF5i \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T", link: "t5sip6yyka" },
|
|
7175
|
+
{ pageId: 624, name: "PLO measurement framework", label: "Khung \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T", link: "PLOFramework/CLOCoreSubject" },
|
|
7176
|
+
{ pageId: 625, name: "PLO measurement by CLOs", label: "\u0110o l\u01B0\u1EDDng C\u0110R CT\u0110T theo C\u0110R m\xF4n h\u1ECDc", link: "PLOFramework/ManageGroupCoreSubject" }
|
|
7177
|
+
]
|
|
7178
|
+
},
|
|
7179
|
+
{
|
|
7180
|
+
label: "X\xE2y d\u1EF1ng k\u1EBF ho\u1EA1ch \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
|
|
7181
|
+
links: [
|
|
7182
|
+
{ pageId: 626, name: "Unit PLO assessment plan", label: "K\u1EBF ho\u1EA1ch \u0111o chu\u1EA9n \u0111\u1EA7u ra theo \u0111\u01A1n v\u1ECB", link: "afqdc7uf8b" },
|
|
7183
|
+
{ pageId: 627, name: "Program PLO assessment plan", label: "K\u1EBF ho\u1EA1ch \u0111o chu\u1EA9n \u0111\u1EA7u ra theo CT\u0110T", link: "g2" }
|
|
7184
|
+
]
|
|
7185
|
+
},
|
|
7186
|
+
{
|
|
7187
|
+
label: "\u0110\xE1nh gi\xE1 k\u1EBFt qu\u1EA3 h\u1ECDc t\u1EADp m\xF4n h\u1ECDc ",
|
|
7188
|
+
links: [
|
|
7189
|
+
{
|
|
7190
|
+
label: "\u0110\xE1nh gi\xE1 CLO m\xF4n h\u1ECDc ",
|
|
7191
|
+
links: [
|
|
7192
|
+
{ pageId: 628, name: "Course required competencies", label: "N\u0103ng l\u1EF1c y\xEAu c\u1EA7u c\u1EE7a m\xF4n h\u1ECDc", link: "licl7ube7d" },
|
|
7193
|
+
{ pageId: 629, name: "CLO assessment methods", label: "Ph\u01B0\u01A1ng ph\xE1p \u0111\xE1nh gi\xE1 CLO", link: "subjectAssessment/CLOAssessment/config" },
|
|
7194
|
+
{ pageId: 630, name: "Exam structure", label: "C\u1EA5u tr\xFAc \u0111\u1EC1 thi", link: "vq720hj9jx" }
|
|
7195
|
+
]
|
|
7196
|
+
},
|
|
7197
|
+
{
|
|
7198
|
+
label: "D\u1EEF li\u1EC7u \u0111i\u1EC3m sinh vi\xEAn \u0111\xE1nh gi\xE1 ",
|
|
7199
|
+
links: [
|
|
7200
|
+
{ pageId: 631, name: "Student database", label: "C\u01A1 s\u1EDF d\u1EEF li\u1EC7u sinh vi\xEAn", link: "4ltk4f68a8" },
|
|
7201
|
+
{ pageId: 632, name: "Student course registration", label: "Sinh vi\xEAn \u0111\u0103ng k\xFD m\xF4n h\u1ECDc", link: "nugmpmukta" },
|
|
7202
|
+
{ pageId: 633, name: "Course grade entry", label: "Nh\u1EADp \u0111i\u1EC3m theo nh\xF3m h\u1ECDc", link: "l9bml18o7p", status: "Prototype" },
|
|
7203
|
+
{ pageId: 634, name: "Student grade entry", label: "Nh\u1EADp \u0111i\u1EC3m t\u1EEBng sinh vi\xEAn", link: "clzixswvmy", status: "Prototype" }
|
|
7204
|
+
]
|
|
7205
|
+
},
|
|
7206
|
+
{
|
|
7207
|
+
label: "T\u1ED5ng h\u1EE3p \u0111i\u1EC3m CLO m\xF4n h\u1ECDc ",
|
|
7208
|
+
links: [
|
|
7209
|
+
{ pageId: 635, name: "Class CLO grade summary", label: "T\u1ED5ng h\u1EE3p \u0111i\u1EC3m CLO m\xF4n h\u1ECDc theo l\u1EDBp" },
|
|
7210
|
+
{ pageId: 636, name: "Course wide CLO chart", label: "Bi\u1EC3u \u0111\u1ED3 CLO to\xE0n m\xF4n h\u1ECDc", link: "6cnw99q4zo", status: "Prototype" }
|
|
7211
|
+
]
|
|
7212
|
+
}
|
|
7213
|
+
]
|
|
7214
|
+
},
|
|
7215
|
+
{
|
|
7216
|
+
label: "Tri\u1EC3n khai k\u1EBF ho\u1EA1ch \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
|
|
7217
|
+
link: "zz2",
|
|
7218
|
+
status: "Menu"
|
|
7219
|
+
},
|
|
7220
|
+
{
|
|
7221
|
+
label: "K\u1EBFt qu\u1EA3 th\u1EF1c hi\u1EC7n \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
|
|
7222
|
+
link: "8",
|
|
7223
|
+
links: [
|
|
7224
|
+
{ pageId: 637, name: "Program wide PLO summary", label: "T\u1ED5ng h\u1EE3p PLO to\xE0n kh\xF3a", link: "5bmex2c6in", status: "Prototype" },
|
|
7225
|
+
{ pageId: 638, name: "PLO achievement report", label: "B\xE1o c\xE1o k\u1EBFt qu\u1EA3 \u0111o l\u01B0\u1EDDng m\u1EE9c \u0111\u1ED9 \u0111\u1EA1t C\u0110R CT\u0110T", link: "jsnsipqfgt", status: "Prototype" },
|
|
7226
|
+
{ pageId: 639, name: "Unit PLO achievement report", label: "B\xE1o c\xE1o k\u1EBFt qu\u1EA3 \u0111o l\u01B0\u1EDDng m\u1EE9c \u0111\u1ED9 \u0111\u1EA1t C\u0110R \u0110\u01A1n v\u1ECB", link: "qgpxxmcfjh", status: "Prototype" }
|
|
7227
|
+
]
|
|
7228
|
+
},
|
|
7229
|
+
{
|
|
7230
|
+
label: "B\xE1o c\xE1o v\xE0 \u0111\u1EC1 xu\u1EA5t c\u1EA3i ti\u1EBFn ",
|
|
7231
|
+
link: "i1",
|
|
7232
|
+
status: "Menu"
|
|
7233
|
+
},
|
|
7234
|
+
{
|
|
7235
|
+
label: "H\u1ECDp h\u1ED9i \u0111\u1ED3ng \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
|
|
7236
|
+
link: "j1",
|
|
7237
|
+
status: "Menu"
|
|
7238
|
+
},
|
|
7239
|
+
{
|
|
7240
|
+
label: "Danh m\u1EE5c h\u1EC7 th\u1ED1ng ",
|
|
7241
|
+
links: [
|
|
7242
|
+
{ pageId: 640, name: "Unit list", label: "Danh m\u1EE5c \u0111\u01A1n v\u1ECB", link: "14w3vwnnfy" },
|
|
7243
|
+
{ pageId: 641, name: "MIT scale", label: "Thang \u0111o MIT", link: "umg0mq7o3x" },
|
|
7244
|
+
{ pageId: 642, name: "Rubric scale", label: "Thang \u0111o Rubrics", link: "fmc2n1ftq1" },
|
|
7245
|
+
{ pageId: 643, name: "PLO ranking table", label: "B\u1EA3ng x\u1EBFp lo\u1EA1i PLO", link: "f0oia066vb" },
|
|
7246
|
+
{ pageId: 644, name: "Academic year list", label: "Danh m\u1EE5c n\u0103m h\u1ECDc", link: "omhcfkliwa" },
|
|
7247
|
+
{ pageId: 645, name: "Academic year semester list", label: "Danh m\u1EE5c n\u0103m h\u1ECDc h\u1ECDc k\u1EF3", link: "cw38zkpvg4" }
|
|
7248
|
+
]
|
|
7249
|
+
}
|
|
7250
|
+
];
|
|
7251
|
+
|
|
7252
|
+
// src/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx
|
|
7253
|
+
import { Checkbox as Checkbox3, Flex as Flex5, ScrollArea as ScrollArea5, Table as Table3, Text as Text13 } from "@mantine/core";
|
|
7254
|
+
import { IconEdit as IconEdit5, IconEyeUp, IconFileExport as IconFileExport2, IconPlus as IconPlus5, IconPrinter as IconPrinter3, IconTrash as IconTrash5 } from "@tabler/icons-react";
|
|
7255
|
+
import { useQuery as useQuery10 } from "@tanstack/react-query";
|
|
7256
|
+
import React4, { useEffect as useEffect8, useState as useState10 } from "react";
|
|
7257
|
+
var title = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
|
|
7258
|
+
function F_core38677_ViewMenuPermissions() {
|
|
7259
|
+
var _a, _b;
|
|
7260
|
+
const store = useS_core83092();
|
|
7261
|
+
const query = useGetUserPermission();
|
|
7262
|
+
const list = useState10([]);
|
|
7263
|
+
useEffect8(() => {
|
|
7264
|
+
list[1](groupToTwoLevels(menuData));
|
|
7265
|
+
}, []);
|
|
7266
|
+
useEffect8(() => {
|
|
7267
|
+
if (!query.data) return;
|
|
7268
|
+
store.setProperty("rolePermissions", query.data);
|
|
7269
|
+
}, [query.data]);
|
|
7270
|
+
if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
|
|
7271
|
+
return /* @__PURE__ */ React4.createElement(ScrollArea5.Autosize, { h: "70vh" }, /* @__PURE__ */ React4.createElement(Table3, null, /* @__PURE__ */ React4.createElement(
|
|
7272
|
+
Table3.Thead,
|
|
7273
|
+
{
|
|
7274
|
+
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
|
|
7275
|
+
style: {
|
|
7276
|
+
position: "sticky",
|
|
7277
|
+
top: 0,
|
|
7278
|
+
zIndex: 1,
|
|
7279
|
+
boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
|
|
7280
|
+
border: "1px solid var(--mantine-color-gray-4)"
|
|
7281
|
+
}
|
|
7282
|
+
},
|
|
7283
|
+
/* @__PURE__ */ React4.createElement(Table3.Tr, null, /* @__PURE__ */ React4.createElement(Table3.Th, null, title), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isRead"), onChange: (e4) => {
|
|
7284
|
+
store.toogleAllPermissionWithType("isRead", e4.target.checked);
|
|
7285
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "Xem", /* @__PURE__ */ React4.createElement(IconEyeUp, { color: "gray" })))), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isCreate"), onChange: (e4) => {
|
|
7286
|
+
store.toogleAllPermissionWithType("isCreate", e4.target.checked);
|
|
7287
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "Th\xEAm", /* @__PURE__ */ React4.createElement(IconPlus5, { color: "blue" })))), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isUpdate"), onChange: (e4) => {
|
|
7288
|
+
store.toogleAllPermissionWithType("isUpdate", e4.target.checked);
|
|
7289
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "S\u1EEDa", /* @__PURE__ */ React4.createElement(IconEdit5, { color: "var(--mantine-color-yellow-8)" })))), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isDelete"), onChange: (e4) => {
|
|
7290
|
+
store.toogleAllPermissionWithType("isDelete", e4.target.checked);
|
|
7291
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "X\xF3a", /* @__PURE__ */ React4.createElement(IconTrash5, { color: "var(--mantine-color-red-8)" })))), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isPrint"), onChange: (e4) => {
|
|
7292
|
+
store.toogleAllPermissionWithType("isPrint", e4.target.checked);
|
|
7293
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "In", /* @__PURE__ */ React4.createElement(IconPrinter3, { color: "var(--mantine-color-cyan-8)" })))), /* @__PURE__ */ React4.createElement(Table3.Th, null, /* @__PURE__ */ React4.createElement(Flex5, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React4.createElement(Checkbox3, { checked: store.isAllPermission("isExport"), onChange: (e4) => {
|
|
7294
|
+
store.toogleAllPermissionWithType("isExport", e4.target.checked);
|
|
7295
|
+
} }), /* @__PURE__ */ React4.createElement(MyFlexRow, { gap: 3 }, "Xu\u1EA5t", /* @__PURE__ */ React4.createElement(IconFileExport2, { color: "var(--mantine-color-green-8)" })))))
|
|
7296
|
+
), /* @__PURE__ */ React4.createElement(Table3.Tbody, { bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))" }, (_b = list[0]) == null ? void 0 : _b.map((item, idx) => {
|
|
7297
|
+
if (item.links == void 0) return /* @__PURE__ */ React4.createElement(Table3.Tr, { key: idx }, /* @__PURE__ */ React4.createElement(Table3.Td, null, item.label), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(Checkbox3, null))));
|
|
7298
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, { key: idx }, /* @__PURE__ */ React4.createElement(Table3.Tr, { key: item.label }, /* @__PURE__ */ React4.createElement(
|
|
7299
|
+
Table3.Td,
|
|
7300
|
+
{
|
|
7301
|
+
colSpan: 7,
|
|
7302
|
+
bg: OBJECT_COlORS.mantineBackgroundBlueLight
|
|
7303
|
+
},
|
|
7304
|
+
/* @__PURE__ */ React4.createElement(Text13, { fs: "oblique", size: "sm", fw: "bold" }, item.label)
|
|
7305
|
+
)), item.links.map(
|
|
7306
|
+
(item2, idx2) => {
|
|
7307
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
7308
|
+
return /* @__PURE__ */ React4.createElement(Table3.Tr, { key: idx2 }, /* @__PURE__ */ React4.createElement(Table3.Td, null, item2.label), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7309
|
+
Checkbox3,
|
|
7310
|
+
{
|
|
7311
|
+
checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
|
|
7312
|
+
onChange: (e4) => {
|
|
7313
|
+
store.updatePermission(item2.pageId, {
|
|
7314
|
+
isRead: e4.target.checked
|
|
7315
|
+
});
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7319
|
+
Checkbox3,
|
|
7320
|
+
{
|
|
7321
|
+
checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
|
|
7322
|
+
onChange: (e4) => {
|
|
7323
|
+
store.updatePermission(item2.pageId, {
|
|
7324
|
+
isCreate: e4.target.checked
|
|
7325
|
+
});
|
|
7326
|
+
}
|
|
7327
|
+
}
|
|
7328
|
+
))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7329
|
+
Checkbox3,
|
|
7330
|
+
{
|
|
7331
|
+
checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
|
|
7332
|
+
onChange: (e4) => {
|
|
7333
|
+
store.updatePermission(item2.pageId, {
|
|
7334
|
+
isUpdate: e4.target.checked
|
|
7335
|
+
});
|
|
7336
|
+
}
|
|
7337
|
+
}
|
|
7338
|
+
))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7339
|
+
Checkbox3,
|
|
7340
|
+
{
|
|
7341
|
+
checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
|
|
7342
|
+
onChange: (e4) => {
|
|
7343
|
+
store.updatePermission(item2.pageId, {
|
|
7344
|
+
isDelete: e4.target.checked
|
|
7345
|
+
});
|
|
7346
|
+
}
|
|
7347
|
+
}
|
|
7348
|
+
))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7349
|
+
Checkbox3,
|
|
7350
|
+
{
|
|
7351
|
+
checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
|
|
7352
|
+
onChange: (e4) => {
|
|
7353
|
+
store.updatePermission(item2.pageId, {
|
|
7354
|
+
isPrint: e4.target.checked
|
|
7355
|
+
});
|
|
7356
|
+
}
|
|
7357
|
+
}
|
|
7358
|
+
))), /* @__PURE__ */ React4.createElement(Table3.Td, null, /* @__PURE__ */ React4.createElement(MyCenterFull, null, /* @__PURE__ */ React4.createElement(
|
|
7359
|
+
Checkbox3,
|
|
7360
|
+
{
|
|
7361
|
+
checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
|
|
7362
|
+
onChange: (e4) => {
|
|
7363
|
+
store.updatePermission(item2.pageId, {
|
|
7364
|
+
isExport: e4.target.checked
|
|
7365
|
+
});
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7368
|
+
))));
|
|
7369
|
+
}
|
|
7370
|
+
));
|
|
7371
|
+
}))));
|
|
7372
|
+
}
|
|
7373
|
+
function useGetUserPermission() {
|
|
7374
|
+
const store = useS_core83092();
|
|
7375
|
+
const query = useQuery10({
|
|
7376
|
+
queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
|
|
7377
|
+
queryFn: async () => {
|
|
7378
|
+
const result = await baseAxios_default.get("/Role/GetRolePermission?roleId=" + store.state.roleId);
|
|
7379
|
+
const menudataFinal = utils_layout_getItemsWithoutLinks(menuData);
|
|
7380
|
+
if (result.data.data.length == 0) {
|
|
7381
|
+
const final = menudataFinal.map((item) => ({
|
|
7382
|
+
pageId: item.pageId,
|
|
7383
|
+
isRead: false,
|
|
7384
|
+
isCreate: false,
|
|
7385
|
+
isUpdate: false,
|
|
7386
|
+
isDelete: false,
|
|
7387
|
+
isExport: false,
|
|
7388
|
+
isPrint: false
|
|
7389
|
+
}));
|
|
7390
|
+
return final.filter((item) => item.pageId != void 0);
|
|
7391
|
+
}
|
|
7392
|
+
const menuDataFromAPI = result.data.data;
|
|
7393
|
+
const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
|
|
7394
|
+
pageId: item.pageId,
|
|
7395
|
+
isCreate: item.isCreate || false,
|
|
7396
|
+
isRead: item.isRead || false,
|
|
7397
|
+
isUpdate: item.isUpdate || false || false,
|
|
7398
|
+
isDelete: item.isDelete,
|
|
7399
|
+
isPrint: item.isPrint || false,
|
|
7400
|
+
isExport: item.isExport || false
|
|
7401
|
+
})).filter((item) => item.pageId != void 0);
|
|
7402
|
+
return mergedArray;
|
|
7403
|
+
},
|
|
7404
|
+
enabled: store.state.roleId != 0,
|
|
7405
|
+
refetchOnWindowFocus: false
|
|
7406
|
+
});
|
|
7407
|
+
return query;
|
|
7408
|
+
}
|
|
7409
|
+
|
|
7410
|
+
// src/modules-features/admin/core/core40207/F_core40207_Read.tsx
|
|
7411
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
7412
|
+
import { useMemo as useMemo9 } from "react";
|
|
7413
|
+
|
|
7414
|
+
// src/modules-features/admin/core/core40207/F_core40207_Create.tsx
|
|
7415
|
+
import { FileInput as FileInput6 } from "@mantine/core";
|
|
7416
|
+
import { useForm as useForm11 } from "@mantine/form";
|
|
7417
|
+
function F_core40207_Create() {
|
|
7418
|
+
const form = useForm11({
|
|
7419
|
+
mode: "uncontrolled"
|
|
7420
|
+
});
|
|
7421
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
|
|
7422
|
+
return await baseAxios_default.post(
|
|
7423
|
+
"/Document/create",
|
|
7424
|
+
__spreadProps(__spreadValues({}, values), {
|
|
7425
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Guideline,
|
|
7426
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
|
7427
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
7428
|
+
})
|
|
7429
|
+
);
|
|
7430
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3 t\xE0i li\u1EC7u" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput6, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
|
|
7431
|
+
}
|
|
7432
|
+
|
|
7433
|
+
// src/modules-features/admin/core/core40207/F_core40207_Delete.tsx
|
|
7434
|
+
function F_core40207_Delete({ id }) {
|
|
7435
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
|
|
7436
|
+
}
|
|
7437
|
+
|
|
7438
|
+
// src/modules-features/admin/core/core40207/F_core40207_Update.tsx
|
|
7439
|
+
import { FileInput as FileInput7 } from "@mantine/core";
|
|
7440
|
+
import { useForm as useForm12 } from "@mantine/form";
|
|
7441
|
+
function F_core40207_Update({ values }) {
|
|
7442
|
+
var _a;
|
|
7443
|
+
const form = useForm12({
|
|
7444
|
+
mode: "uncontrolled",
|
|
7445
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
7446
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
7447
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
7448
|
+
})
|
|
7449
|
+
});
|
|
7450
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
7451
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
7452
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
7453
|
+
}));
|
|
7454
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3 t\xE0i li\u1EC7u" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput7, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7457
|
+
// src/modules-features/admin/core/core40207/F_core40207_Read.tsx
|
|
7458
|
+
function F_core40207_Read() {
|
|
7459
|
+
const query = useQuery11({
|
|
7460
|
+
queryKey: ["F_core40207_Read"],
|
|
7461
|
+
queryFn: async () => {
|
|
7462
|
+
var _a;
|
|
7463
|
+
const result = await baseAxios_default.get(`/Document/GetByType?documentType=${OBJECT_DOCUMENT_TYPES.Guideline}`);
|
|
7464
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
7465
|
+
}
|
|
7466
|
+
});
|
|
7467
|
+
const columns = useMemo9(
|
|
7468
|
+
() => [
|
|
7469
|
+
{
|
|
7470
|
+
header: "M\xE3 t\xE0i li\u1EC7u",
|
|
7471
|
+
accessorKey: "code"
|
|
7472
|
+
},
|
|
7473
|
+
{
|
|
7474
|
+
header: "T\xEAn t\xE0i li\u1EC7u",
|
|
7475
|
+
accessorKey: "name"
|
|
7476
|
+
},
|
|
7477
|
+
{
|
|
7478
|
+
header: "File",
|
|
7479
|
+
accessorFn: (row) => {
|
|
7480
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
|
|
7481
|
+
}
|
|
7482
|
+
}
|
|
7483
|
+
],
|
|
7484
|
+
[]
|
|
7485
|
+
);
|
|
7486
|
+
if (query.isLoading) return "Loading...";
|
|
7487
|
+
if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
7488
|
+
return /* @__PURE__ */ React.createElement(
|
|
7489
|
+
MyDataTable,
|
|
7490
|
+
{
|
|
7491
|
+
columns,
|
|
7492
|
+
data: query.data,
|
|
7493
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core40207_Create, null),
|
|
7494
|
+
renderRowActions: ({ row }) => {
|
|
7495
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core40207_Update, { values: row.original }), /* @__PURE__ */ React.createElement(F_core40207_Delete, { id: row.original.id }));
|
|
7496
|
+
}
|
|
7497
|
+
}
|
|
7498
|
+
);
|
|
7499
|
+
}
|
|
7500
|
+
|
|
7501
|
+
// src/modules-features/admin/core/core40207/F_core40207.tsx
|
|
7502
|
+
function F_core40207() {
|
|
7503
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(F_core40207_Read, null));
|
|
7504
|
+
}
|
|
7505
|
+
|
|
7506
|
+
// src/modules-features/admin/core/core47643/F_core47643_Read.tsx
|
|
7507
|
+
import { Group as Group15 } from "@mantine/core";
|
|
7508
|
+
import { useQuery as useQuery12 } from "@tanstack/react-query";
|
|
7509
|
+
import { useMemo as useMemo10 } from "react";
|
|
7510
|
+
|
|
7511
|
+
// src/modules-features/admin/core/core47643/F_core47643_Delete.tsx
|
|
7512
|
+
var ENDPOINT = "/Role/Delete";
|
|
7513
|
+
function F_core47643_Delete({ values }) {
|
|
7514
|
+
return /* @__PURE__ */ React.createElement(
|
|
7515
|
+
MyActionIconDelete,
|
|
7516
|
+
{
|
|
7517
|
+
contextData: values.code,
|
|
7518
|
+
onSubmit: () => baseAxios_default.post(ENDPOINT, { id: values.id })
|
|
7519
|
+
}
|
|
7520
|
+
);
|
|
7521
|
+
}
|
|
7522
|
+
|
|
7523
|
+
// src/modules-features/admin/core/core47643/F_core47643_Form.tsx
|
|
7524
|
+
import { useForm as useForm13 } from "@mantine/form";
|
|
7525
|
+
function F_core47643_Form({ values }) {
|
|
7526
|
+
const form = useForm13({
|
|
7527
|
+
mode: "uncontrolled",
|
|
7528
|
+
initialValues: values
|
|
7529
|
+
});
|
|
7530
|
+
if (values) return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async () => {
|
|
7531
|
+
return await baseAxios_default.post("/Role/Update", form.getValues());
|
|
7532
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ readOnly: true, variant: "filled", label: "M\xE3" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "Quy\u1EC1n" }, form.getInputProps("name"))));
|
|
7533
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { form, onSubmit: async () => {
|
|
7534
|
+
return await baseAxios_default.post("/Role/Create", form.getValues());
|
|
7535
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "Quy\u1EC1n" }, form.getInputProps("name"))));
|
|
7536
|
+
}
|
|
7537
|
+
|
|
7538
|
+
// src/modules-features/admin/core/core47643/F_core47643_Read.tsx
|
|
7539
|
+
function F_core47643_Read() {
|
|
7540
|
+
const query = useQ_core47643_GetAdminRole();
|
|
7541
|
+
const columns = useMemo10(() => [
|
|
7542
|
+
{
|
|
7543
|
+
header: "M\xE3",
|
|
7544
|
+
accessorKey: "code"
|
|
7545
|
+
},
|
|
7546
|
+
{
|
|
7547
|
+
header: "Quy\u1EC1n",
|
|
7548
|
+
accessorKey: "name"
|
|
7549
|
+
}
|
|
7550
|
+
], []);
|
|
7551
|
+
if (query.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
|
|
7552
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
7553
|
+
return /* @__PURE__ */ React.createElement(
|
|
7554
|
+
MyDataTable,
|
|
7555
|
+
{
|
|
7556
|
+
data: query.data,
|
|
7557
|
+
columns,
|
|
7558
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(Group15, null, /* @__PURE__ */ React.createElement(F_core47643_Form, null)),
|
|
7559
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core47643_Form, { values: row.original }), /* @__PURE__ */ React.createElement(F_core47643_Delete, { values: row.original }))
|
|
7560
|
+
}
|
|
7561
|
+
);
|
|
7562
|
+
}
|
|
7563
|
+
function useQ_core47643_GetAdminRole() {
|
|
7564
|
+
const query = useQuery12({
|
|
7565
|
+
queryKey: ["useQ_core47643_GetAdminRole"],
|
|
7566
|
+
queryFn: async () => {
|
|
7567
|
+
const res = await baseAxios_default.get("/Role/GetAdminRole");
|
|
7568
|
+
return res.data.data;
|
|
7569
|
+
}
|
|
7570
|
+
});
|
|
7571
|
+
return query;
|
|
7572
|
+
}
|
|
7573
|
+
|
|
7574
|
+
// src/modules-features/admin/core/core47643/F_core47643.tsx
|
|
7575
|
+
function F_core47643() {
|
|
7576
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, { title: "Danh m\u1EE5c quy\u1EC1n", canBack: true }, /* @__PURE__ */ React.createElement(F_core47643_Read, null));
|
|
7577
|
+
}
|
|
7578
|
+
|
|
7579
|
+
// src/modules-features/admin/core/core64229/F_core64229_Delete.tsx
|
|
7580
|
+
import React5 from "react";
|
|
7581
|
+
function F_core64229_Delete({ values }) {
|
|
7582
|
+
return /* @__PURE__ */ React5.createElement(
|
|
7583
|
+
MyActionIconDelete,
|
|
7584
|
+
{
|
|
7585
|
+
contextData: values == null ? void 0 : values.code,
|
|
7586
|
+
onSubmit: () => {
|
|
7587
|
+
return baseAxios_default.post("/EmailConfig/Delete", {
|
|
7588
|
+
id: values == null ? void 0 : values.id
|
|
7589
|
+
});
|
|
7590
|
+
}
|
|
7591
|
+
}
|
|
7592
|
+
);
|
|
7593
|
+
}
|
|
7594
|
+
|
|
7595
|
+
// src/constants/enum/ENUM_EMAILCONFIG.ts
|
|
7596
|
+
var ENUM_EMAILCONFIG_MODULE = /* @__PURE__ */ ((ENUM_EMAILCONFIG_MODULE2) => {
|
|
7597
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["\u0110\xE0o t\u1EA1o"] = 1] = "\u0110\xE0o t\u1EA1o";
|
|
7598
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Tuy\u1EC3n sinh"] = 2] = "Tuy\u1EC3n sinh";
|
|
7599
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Sinh vi\xEAn"] = 3] = "Sinh vi\xEAn";
|
|
7600
|
+
ENUM_EMAILCONFIG_MODULE2[ENUM_EMAILCONFIG_MODULE2["Kh\u1EA3o th\xED"] = 4] = "Kh\u1EA3o th\xED";
|
|
7601
|
+
return ENUM_EMAILCONFIG_MODULE2;
|
|
7602
|
+
})(ENUM_EMAILCONFIG_MODULE || {});
|
|
7603
|
+
|
|
7604
|
+
// src/modules-features/admin/core/core64229/F_core64229_Form.tsx
|
|
7605
|
+
import { PasswordInput } from "@mantine/core";
|
|
7606
|
+
import { useForm as useForm14 } from "@mantine/form";
|
|
7607
|
+
import React6 from "react";
|
|
7608
|
+
function F_core64229_Form({ values }) {
|
|
7609
|
+
const form = useForm14({
|
|
7610
|
+
mode: "uncontrolled",
|
|
7611
|
+
initialValues: values ? values : {
|
|
7612
|
+
emailModule: 1 /* Đào tạo */
|
|
7613
|
+
}
|
|
7614
|
+
});
|
|
7615
|
+
function handleSubmit() {
|
|
7616
|
+
const formValues = form.getValues();
|
|
7617
|
+
return baseAxios_default.post(`/EmailConfig/${values ? "update" : "create"}`, {
|
|
7618
|
+
"id": values ? formValues.id : 0,
|
|
7619
|
+
"code": "string",
|
|
7620
|
+
"name": "string",
|
|
7621
|
+
"concurrencyStamp": "string",
|
|
7622
|
+
"isEnabled": true,
|
|
7623
|
+
"order": 0,
|
|
7624
|
+
"emailModule": formValues.emailModule,
|
|
7625
|
+
"hostMailServer": formValues.hostMailServer,
|
|
7626
|
+
"outgoingPort": formValues.outgoingPort,
|
|
7627
|
+
"incomingPort": formValues.incomingPort,
|
|
7628
|
+
"sll": formValues.sll,
|
|
7629
|
+
"userName": formValues.userName,
|
|
7630
|
+
"password": formValues.password
|
|
7631
|
+
});
|
|
7632
|
+
}
|
|
7633
|
+
if (values) return /* @__PURE__ */ React6.createElement(
|
|
7634
|
+
MyActionIconUpdate,
|
|
7635
|
+
{
|
|
7636
|
+
form,
|
|
7637
|
+
onSubmit: handleSubmit
|
|
7638
|
+
},
|
|
7639
|
+
/* @__PURE__ */ React6.createElement(FormInput, { form })
|
|
7640
|
+
);
|
|
7641
|
+
return /* @__PURE__ */ React6.createElement(
|
|
7642
|
+
MyButtonCreate,
|
|
7643
|
+
{
|
|
7644
|
+
form,
|
|
7645
|
+
onSubmit: handleSubmit
|
|
7646
|
+
},
|
|
7647
|
+
/* @__PURE__ */ React6.createElement(FormInput, { form })
|
|
7648
|
+
);
|
|
7649
|
+
}
|
|
7650
|
+
function FormInput({ form }) {
|
|
7651
|
+
var _a, _b;
|
|
7652
|
+
return /* @__PURE__ */ React6.createElement(MyFlexColumn, null, /* @__PURE__ */ React6.createElement(
|
|
7653
|
+
MySelect,
|
|
7654
|
+
__spreadProps(__spreadValues({
|
|
7655
|
+
label: "Ph\xE2n h\u1EC7",
|
|
7656
|
+
data: utils_converter_enumToSelectOptions(ENUM_EMAILCONFIG_MODULE)
|
|
7657
|
+
}, form.getInputProps("emailModule")), {
|
|
7658
|
+
value: (_a = form.getValues().emailModule) == null ? void 0 : _a.toString()
|
|
7659
|
+
})
|
|
7660
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7661
|
+
MyTextInput,
|
|
7662
|
+
__spreadValues({
|
|
7663
|
+
label: "Host mail server"
|
|
7664
|
+
}, form.getInputProps("hostMailServer"))
|
|
7665
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7666
|
+
MyNumberInput,
|
|
7667
|
+
__spreadValues({
|
|
7668
|
+
label: "Outgoing port"
|
|
7669
|
+
}, form.getInputProps("outgoingPort"))
|
|
7670
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7671
|
+
MyNumberInput,
|
|
7672
|
+
__spreadValues({
|
|
7673
|
+
label: "Incoming port"
|
|
7674
|
+
}, form.getInputProps("incomingPort"))
|
|
7675
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7676
|
+
MySelect,
|
|
7677
|
+
{
|
|
7678
|
+
label: "SSL",
|
|
7679
|
+
data: ["true", "false"],
|
|
7680
|
+
value: (_b = form.getValues().sll) == null ? void 0 : _b.toString(),
|
|
7681
|
+
onChange: (e4) => form.setFieldValue("sll", e4 == "true" ? true : false)
|
|
7682
|
+
}
|
|
7683
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7684
|
+
MyTextInput,
|
|
7685
|
+
__spreadValues({
|
|
7686
|
+
label: "Username"
|
|
7687
|
+
}, form.getInputProps("userName"))
|
|
7688
|
+
), /* @__PURE__ */ React6.createElement(
|
|
7689
|
+
PasswordInput,
|
|
7690
|
+
__spreadValues({
|
|
7691
|
+
label: "Password",
|
|
7692
|
+
placeholder: "Nh\u1EADp password"
|
|
7693
|
+
}, form.getInputProps("password"))
|
|
7694
|
+
));
|
|
7695
|
+
}
|
|
7696
|
+
|
|
7697
|
+
// src/modules-features/admin/core/core64229/F_core64229_Read.tsx
|
|
7698
|
+
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
7699
|
+
import React7, { useMemo as useMemo11 } from "react";
|
|
7700
|
+
function F_core64229_Read() {
|
|
7701
|
+
const query = useQuery13({
|
|
7702
|
+
queryKey: ["F_core64229_Read"],
|
|
7703
|
+
queryFn: async () => {
|
|
7704
|
+
const res = await baseAxios_default.get("/EmailConfig/GetAll");
|
|
7705
|
+
return res.data.data;
|
|
7706
|
+
}
|
|
7707
|
+
});
|
|
7708
|
+
const columns = useMemo11(() => [
|
|
7709
|
+
{
|
|
7710
|
+
header: "Ph\xE2n h\u1EC7",
|
|
7711
|
+
accessorFn: (row) => {
|
|
7712
|
+
return ENUM_EMAILCONFIG_MODULE[row.emailModule];
|
|
7713
|
+
}
|
|
7714
|
+
},
|
|
7715
|
+
{
|
|
7716
|
+
header: "Host mail server",
|
|
7717
|
+
accessorKey: "hostMailServer"
|
|
7718
|
+
},
|
|
7719
|
+
{
|
|
7720
|
+
header: "Outgoing port",
|
|
7721
|
+
accessorKey: "outgoingPort"
|
|
7722
|
+
},
|
|
7723
|
+
{
|
|
7724
|
+
header: "Incoming port",
|
|
7725
|
+
accessorKey: "incomingPort"
|
|
7726
|
+
},
|
|
7727
|
+
{
|
|
7728
|
+
header: "SSL",
|
|
7729
|
+
accessorFn: (row) => {
|
|
7730
|
+
var _a;
|
|
7731
|
+
return (_a = row.sll) == null ? void 0 : _a.toString();
|
|
7732
|
+
}
|
|
7733
|
+
},
|
|
7734
|
+
{
|
|
7735
|
+
header: "Username",
|
|
7736
|
+
accessorKey: "userName"
|
|
7737
|
+
},
|
|
7738
|
+
{
|
|
7739
|
+
header: "Password",
|
|
7740
|
+
accessorFn: () => "*******"
|
|
7741
|
+
}
|
|
7742
|
+
], []);
|
|
7743
|
+
if (query.isLoading) return "\u0110ang t\u1EA3i";
|
|
7744
|
+
return /* @__PURE__ */ React7.createElement(
|
|
7745
|
+
MyDataTable,
|
|
7746
|
+
{
|
|
7747
|
+
columns,
|
|
7748
|
+
data: query.data,
|
|
7749
|
+
renderTopToolbarCustomActions: () => /* @__PURE__ */ React7.createElement(F_core64229_Form, null),
|
|
7750
|
+
renderRowActions: ({ row }) => /* @__PURE__ */ React7.createElement(MyCenterFull, null, /* @__PURE__ */ React7.createElement(F_core64229_Form, { values: row.original }), /* @__PURE__ */ React7.createElement(F_core64229_Delete, { values: row.original }))
|
|
7751
|
+
}
|
|
7752
|
+
);
|
|
7753
|
+
}
|
|
7754
|
+
|
|
7755
|
+
// src/modules-features/admin/core/core71678/F_core71678_Read.tsx
|
|
7756
|
+
import { Button as Button17, Group as Group17 } from "@mantine/core";
|
|
7757
|
+
import { IconShield } from "@tabler/icons-react";
|
|
7758
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
7759
|
+
import { useRouter as useRouter3 } from "next/navigation";
|
|
7760
|
+
import { useMemo as useMemo13, useState as useState12 } from "react";
|
|
7761
|
+
|
|
7762
|
+
// src/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx
|
|
7763
|
+
import { Button as Button16, Fieldset as Fieldset6, Group as Group16, Table as Table4 } from "@mantine/core";
|
|
7764
|
+
import { useDisclosure as useDisclosure12 } from "@mantine/hooks";
|
|
7765
|
+
import { useMutation as useMutation6, useQuery as useQuery14, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
|
|
7766
|
+
import { useEffect as useEffect9, useMemo as useMemo12, useState as useState11 } from "react";
|
|
7767
|
+
function F_core71678_ChangePermission({ user }) {
|
|
7768
|
+
const disc = useDisclosure12();
|
|
7769
|
+
const queryClient = useQueryClient5();
|
|
7770
|
+
const [rowSelection, setRowSelection] = useState11({});
|
|
7771
|
+
const rowSelect = useState11();
|
|
7772
|
+
const query = useQuery14({
|
|
7773
|
+
queryKey: [`F1_1ChangePermission`],
|
|
7774
|
+
queryFn: async () => {
|
|
7775
|
+
const response = await baseAxios_default.get("/Role/GetAdminRole");
|
|
7776
|
+
return response.data.data;
|
|
7777
|
+
}
|
|
7778
|
+
});
|
|
7779
|
+
const mutation = useMutation6({
|
|
7780
|
+
mutationFn: async (roleIds) => {
|
|
7781
|
+
const res = await baseAxios_default.post("/Role/AddUser?userId=" + user.id, roleIds);
|
|
7782
|
+
return res;
|
|
7783
|
+
}
|
|
7784
|
+
});
|
|
7785
|
+
const permissionColumns = useMemo12(
|
|
7786
|
+
() => [
|
|
7787
|
+
{
|
|
7788
|
+
header: "Quy\u1EC1n",
|
|
7789
|
+
accessorKey: "name"
|
|
7790
|
+
}
|
|
7791
|
+
],
|
|
7792
|
+
[]
|
|
7793
|
+
);
|
|
7794
|
+
function handleSave() {
|
|
7795
|
+
mutation.mutate(Object.keys(rowSelection).map(Number), {
|
|
7796
|
+
onSuccess: () => {
|
|
7797
|
+
utils_notification_show({ crudType: "update" });
|
|
7798
|
+
disc[1].close();
|
|
7799
|
+
queryClient.invalidateQueries();
|
|
7800
|
+
}
|
|
7801
|
+
});
|
|
7802
|
+
}
|
|
7803
|
+
useEffect9(() => {
|
|
7804
|
+
var _a;
|
|
7805
|
+
const result = (_a = user.roles) == null ? void 0 : _a.reduce((acc, item) => {
|
|
7806
|
+
if (item.id !== void 0) {
|
|
7807
|
+
acc[item.id] = true;
|
|
7808
|
+
}
|
|
7809
|
+
return acc;
|
|
7810
|
+
}, {});
|
|
7811
|
+
setRowSelection(result);
|
|
7812
|
+
}, []);
|
|
7813
|
+
return /* @__PURE__ */ React.createElement(MyButtonModal, { modalSize: "xl", disclosure: disc, title: "Ch\u1ECDn quy\u1EC1n cho ng\u01B0\u1EDDi d\xF9ng", label: "S\u1EEDa quy\u1EC1n" }, /* @__PURE__ */ React.createElement(
|
|
7814
|
+
Table4,
|
|
7815
|
+
{
|
|
7816
|
+
w: "100%",
|
|
7817
|
+
variant: "vertical",
|
|
7818
|
+
layout: "fixed"
|
|
7819
|
+
},
|
|
7820
|
+
/* @__PURE__ */ React.createElement(Table4.Tbody, null, /* @__PURE__ */ React.createElement(Table4.Tr, null, /* @__PURE__ */ React.createElement(Table4.Th, { w: 160 }, "H\u1ECD v\xE0 t\xEAn:"), /* @__PURE__ */ React.createElement(Table4.Td, null, user.fullName)), /* @__PURE__ */ React.createElement(Table4.Tr, null, /* @__PURE__ */ React.createElement(Table4.Th, null, "T\xEAn \u0111\u0103ng nh\u1EADp:"), /* @__PURE__ */ React.createElement(Table4.Td, null, user.userName)), /* @__PURE__ */ React.createElement(Table4.Tr, null, /* @__PURE__ */ React.createElement(Table4.Th, null, "Email:"), /* @__PURE__ */ React.createElement(Table4.Td, null, user.email)))
|
|
7821
|
+
), query.isLoading && "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...", query.isError && "L\u1ED7i khi t\u1EA3i d\u1EEF li\u1EC7u...", /* @__PURE__ */ React.createElement(Fieldset6, { legend: "Ch\u1ECDn quy\u1EC1n" }, /* @__PURE__ */ React.createElement(
|
|
7822
|
+
MyDataTable,
|
|
7823
|
+
{
|
|
7824
|
+
enableRowSelection: true,
|
|
7825
|
+
onRowSelectionChange: setRowSelection,
|
|
7826
|
+
state: { rowSelection },
|
|
7827
|
+
setSelectedRow: rowSelect[1],
|
|
7828
|
+
getRowId: (originalRow) => {
|
|
7829
|
+
var _a;
|
|
7830
|
+
return (_a = originalRow.id) == null ? void 0 : _a.toString();
|
|
7831
|
+
},
|
|
7832
|
+
initialState: {
|
|
7833
|
+
density: "xs",
|
|
7834
|
+
pagination: { pageIndex: 0, pageSize: 10 },
|
|
7835
|
+
columnPinning: { right: ["mrt-row-actions"] },
|
|
7836
|
+
columnVisibility: {
|
|
7837
|
+
nguoiCapNhat: false,
|
|
7838
|
+
ngayCapNhat: false
|
|
7839
|
+
}
|
|
7840
|
+
},
|
|
7841
|
+
columns: permissionColumns,
|
|
7842
|
+
data: query.data
|
|
7843
|
+
}
|
|
7844
|
+
)), /* @__PURE__ */ React.createElement(Group16, { justify: "flex-end", mt: 24 }, /* @__PURE__ */ React.createElement(Button16, { onClick: handleSave }, "L\u01B0u")));
|
|
7845
|
+
}
|
|
7846
|
+
|
|
7847
|
+
// src/modules-features/admin/core/core71678/F_core71678_Create.tsx
|
|
7848
|
+
import { useForm as useForm15 } from "@mantine/form";
|
|
7849
|
+
var ENDPOINT2 = "/Account/create";
|
|
7850
|
+
function F_core71678_Create() {
|
|
7851
|
+
const form = useForm15({
|
|
7852
|
+
initialValues: {
|
|
7853
|
+
fullName: "",
|
|
7854
|
+
code: "",
|
|
7855
|
+
userName: "",
|
|
7856
|
+
password: "",
|
|
7857
|
+
email: "",
|
|
7858
|
+
phoneNumber: ""
|
|
7859
|
+
},
|
|
7860
|
+
validate: {
|
|
7861
|
+
email: (value) => U0MyValidateEmail(value)
|
|
7862
|
+
}
|
|
7863
|
+
});
|
|
7864
|
+
async function handleSubmit() {
|
|
7865
|
+
return await baseAxios_default.post(ENDPOINT2, __spreadProps(__spreadValues({}, form.getValues()), {
|
|
7866
|
+
passwordHash: "",
|
|
7867
|
+
id: 0,
|
|
7868
|
+
address: "",
|
|
7869
|
+
concurrencyStamp: "",
|
|
7870
|
+
isBlocked: false,
|
|
7871
|
+
isEnabled: true,
|
|
7872
|
+
workingUnitId: void 0,
|
|
7873
|
+
AQModuleId: 1002
|
|
7874
|
+
}));
|
|
7875
|
+
}
|
|
7876
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { form, onSubmit: handleSubmit, objectName: "ng\u01B0\u1EDDi d\xF9ng" }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3 t\xE0i kho\u1EA3n" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i kho\u1EA3n" }, form.getInputProps("userName"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\u1EADt kh\u1EA9u" }, form.getInputProps("password"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber"))));
|
|
7877
|
+
}
|
|
7878
|
+
|
|
7879
|
+
// src/modules-features/admin/core/core71678/F_core71678_Delete.tsx
|
|
7880
|
+
var ENDPOINT3 = "/Account/delete";
|
|
7881
|
+
function F_core71678_Delete({ id, code }) {
|
|
7882
|
+
return /* @__PURE__ */ React.createElement(
|
|
7883
|
+
MyActionIconDelete,
|
|
7884
|
+
{
|
|
7885
|
+
contextData: code,
|
|
7886
|
+
onSubmit: async () => await baseAxios_default.post(ENDPOINT3, { id })
|
|
7887
|
+
}
|
|
7888
|
+
);
|
|
7889
|
+
}
|
|
7890
|
+
|
|
7891
|
+
// src/modules-features/admin/core/core71678/F_core71678_Update.tsx
|
|
7892
|
+
import { useForm as useForm16 } from "@mantine/form";
|
|
7893
|
+
import { useEffect as useEffect10 } from "react";
|
|
7894
|
+
function F_core71678_Update({ user }) {
|
|
7895
|
+
const form = useForm16({
|
|
7896
|
+
initialValues: user
|
|
7897
|
+
});
|
|
7898
|
+
useEffect10(() => {
|
|
7899
|
+
console.log(form.values);
|
|
7900
|
+
}, [form.values]);
|
|
7901
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values) => {
|
|
7902
|
+
return await baseAxios_default.post(
|
|
7903
|
+
"/Account/update",
|
|
7904
|
+
__spreadProps(__spreadValues({}, values), {
|
|
7905
|
+
id: values.id,
|
|
7906
|
+
address: "",
|
|
7907
|
+
concurrencyStamp: "",
|
|
7908
|
+
isBlocked: false,
|
|
7909
|
+
isEnabled: true,
|
|
7910
|
+
workingUnitId: null
|
|
7911
|
+
})
|
|
7912
|
+
);
|
|
7913
|
+
} }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ disabled: true, label: "M\xE3 t\xE0i kho\u1EA3n" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ disabled: true, label: "T\xEAn t\xE0i kho\u1EA3n" }, form.getInputProps("userName"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber")))));
|
|
7914
|
+
}
|
|
7915
|
+
|
|
7916
|
+
// src/modules-features/admin/core/core71678/F_core71678_Read.tsx
|
|
7917
|
+
var ENDPOINT4 = "/Account/GetAdminAccount";
|
|
7918
|
+
function F_core71678_Read() {
|
|
7919
|
+
const router = useRouter3();
|
|
7920
|
+
const [rowSelection, setRowSelection] = useState12({});
|
|
7921
|
+
const AllUserQuery = useQuery15({
|
|
7922
|
+
queryKey: ["F_core71678_Read"],
|
|
7923
|
+
queryFn: async () => {
|
|
7924
|
+
var _a;
|
|
7925
|
+
const result = await baseAxios_default.get(
|
|
7926
|
+
ENDPOINT4,
|
|
7927
|
+
{ params: { page: 5, pageNumber: 1 } }
|
|
7928
|
+
);
|
|
7929
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
7930
|
+
}
|
|
7931
|
+
});
|
|
7932
|
+
const columns = useMemo13(
|
|
7933
|
+
() => [
|
|
7934
|
+
{
|
|
7935
|
+
header: "T\xEAn t\xE0i kho\u1EA3n",
|
|
7936
|
+
accessorKey: "userName"
|
|
7937
|
+
},
|
|
7938
|
+
{
|
|
7939
|
+
header: "H\u1ECD v\xE0 t\xEAn",
|
|
7940
|
+
accessorKey: "fullName"
|
|
7941
|
+
},
|
|
7942
|
+
{
|
|
7943
|
+
header: "Email",
|
|
7944
|
+
accessorKey: "email"
|
|
7945
|
+
},
|
|
7946
|
+
{
|
|
7947
|
+
header: "Quy\u1EC1n",
|
|
7948
|
+
accessorFn: (row) => /* @__PURE__ */ React.createElement(F_core71678_ChangePermission, { user: row })
|
|
7949
|
+
}
|
|
7950
|
+
],
|
|
7951
|
+
[]
|
|
7952
|
+
);
|
|
7953
|
+
if (AllUserQuery.isLoading) return "Loading...";
|
|
7954
|
+
return /* @__PURE__ */ React.createElement(
|
|
7955
|
+
MyDataTable,
|
|
7956
|
+
{
|
|
7957
|
+
columns,
|
|
7958
|
+
data: AllUserQuery.data,
|
|
7959
|
+
renderTopToolbarCustomActions: () => {
|
|
7960
|
+
return /* @__PURE__ */ React.createElement(Group17, null, /* @__PURE__ */ React.createElement(F_core71678_Create, null), /* @__PURE__ */ React.createElement(
|
|
7961
|
+
Button17,
|
|
7962
|
+
{
|
|
7963
|
+
color: "violet",
|
|
7964
|
+
leftSection: /* @__PURE__ */ React.createElement(IconShield, null),
|
|
7965
|
+
onClick: () => {
|
|
7966
|
+
router.push("core47643");
|
|
7967
|
+
}
|
|
7968
|
+
},
|
|
7969
|
+
"Danh m\u1EE5c quy\u1EC1n"
|
|
7970
|
+
));
|
|
7971
|
+
},
|
|
7972
|
+
renderRowActions: ({ row }) => {
|
|
7973
|
+
return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(F_core71678_Update, { user: row.original }), /* @__PURE__ */ React.createElement(F_core71678_Delete, { id: row.original.id, code: row.original.code }));
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
);
|
|
7977
|
+
}
|
|
7978
|
+
|
|
7979
|
+
// src/modules-features/admin/core/core76318/F_core76318_Read.tsx
|
|
7980
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
7981
|
+
import { useMemo as useMemo14 } from "react";
|
|
7982
|
+
|
|
7983
|
+
// src/modules-features/admin/core/core76318/F_core76318_Create.tsx
|
|
7984
|
+
import { FileInput as FileInput8 } from "@mantine/core";
|
|
7985
|
+
import { useForm as useForm17 } from "@mantine/form";
|
|
7986
|
+
function F_core76318_Create() {
|
|
7987
|
+
const form = useForm17({
|
|
7988
|
+
mode: "uncontrolled"
|
|
7989
|
+
});
|
|
7990
|
+
return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
|
|
7991
|
+
return await baseAxios_default.post(
|
|
7992
|
+
"/Document/create",
|
|
7993
|
+
__spreadProps(__spreadValues({}, values), {
|
|
7994
|
+
DocumentType: OBJECT_DOCUMENT_TYPES.Security,
|
|
7995
|
+
//1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
|
|
7996
|
+
fileDetail: await utils_file_fileToAQDocumentType(values.file)
|
|
7997
|
+
})
|
|
7998
|
+
);
|
|
7999
|
+
} }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput8, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
|
|
8000
|
+
}
|
|
8001
|
+
|
|
8002
|
+
// src/modules-features/admin/core/core76318/F_core76318_Delete.tsx
|
|
8003
|
+
function F_core76318_Delete({ id }) {
|
|
8004
|
+
return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
|
|
8005
|
+
}
|
|
8006
|
+
|
|
8007
|
+
// src/modules-features/admin/core/core76318/F_core76318_Update.tsx
|
|
8008
|
+
import { FileInput as FileInput9, TextInput as TextInput5 } from "@mantine/core";
|
|
8009
|
+
import { useForm as useForm18 } from "@mantine/form";
|
|
8010
|
+
function F_core76318_Update({ values }) {
|
|
8011
|
+
var _a;
|
|
8012
|
+
const form = useForm18({
|
|
8013
|
+
mode: "uncontrolled",
|
|
8014
|
+
initialValues: __spreadProps(__spreadValues({}, values), {
|
|
8015
|
+
file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
|
|
8016
|
+
promulgateDate: new Date(values.promulgateDate)
|
|
8017
|
+
})
|
|
8018
|
+
});
|
|
8019
|
+
return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
|
|
8020
|
+
return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
|
|
8021
|
+
fileDetail: await utils_file_fileToAQDocumentType(values2.file)
|
|
8022
|
+
}));
|
|
8023
|
+
} }, /* @__PURE__ */ React.createElement(TextInput5, __spreadValues({ label: "S\u1ED1 quy \u0111\u1ECBnh" }, form.getInputProps("decisionCode"))), /* @__PURE__ */ React.createElement(MyDateInput, __spreadValues({ label: "Ng\xE0y ban h\xE0nh" }, form.getInputProps("promulgateDate"))), /* @__PURE__ */ React.createElement(TextInput5, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput9, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
|
|
8024
|
+
}
|
|
8025
|
+
|
|
8026
|
+
// src/modules-features/admin/core/core83092/F_core83092.tsx
|
|
8027
|
+
import { Grid as Grid2, Paper as Paper7, ScrollArea as ScrollArea8 } from "@mantine/core";
|
|
8028
|
+
|
|
8029
|
+
// src/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx
|
|
8030
|
+
import { Container as Container5 } from "@mantine/core";
|
|
8031
|
+
import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
8032
|
+
import { useEffect as useEffect11, useMemo as useMemo15, useState as useState13 } from "react";
|
|
8033
|
+
function F_core83092_ReadUser() {
|
|
8034
|
+
const store = useS_core83092();
|
|
8035
|
+
const query = useQ_core83092_Account_GetAdminAccount();
|
|
8036
|
+
const [rowSelection, setRowSelection] = useState13({});
|
|
8037
|
+
const columns = useMemo15(
|
|
8038
|
+
() => [
|
|
8039
|
+
{
|
|
8040
|
+
header: "H\u1ECD v\xE0 t\xEAn",
|
|
8041
|
+
accessorKey: "fullName",
|
|
8042
|
+
size: 60
|
|
8043
|
+
},
|
|
8044
|
+
{
|
|
8045
|
+
header: "Email",
|
|
8046
|
+
accessorKey: "email"
|
|
8047
|
+
}
|
|
8048
|
+
],
|
|
8049
|
+
[]
|
|
8050
|
+
);
|
|
8051
|
+
const handleRowClick = (rowId) => {
|
|
8052
|
+
setRowSelection({ [rowId]: true });
|
|
8053
|
+
store.setProperty("roleId", parseInt(rowId));
|
|
8054
|
+
};
|
|
8055
|
+
useEffect11(() => {
|
|
8056
|
+
if (store.state.roleId == 0) return;
|
|
8057
|
+
setRowSelection({ [store.state.roleId]: true });
|
|
8058
|
+
}, [store.state.roleId]);
|
|
8059
|
+
useEffect11(() => {
|
|
8060
|
+
if (!query.data) return;
|
|
8061
|
+
store.setProperty("roleId", query.data[0].id);
|
|
8062
|
+
}, [query.data]);
|
|
8063
|
+
if (query.isLoading) return "Loading...";
|
|
8064
|
+
if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
|
|
8065
|
+
return /* @__PURE__ */ React.createElement(Container5, { fluid: true, w: "100%" }, /* @__PURE__ */ React.createElement(
|
|
8066
|
+
MyDataTable,
|
|
8067
|
+
{
|
|
8068
|
+
columns,
|
|
8069
|
+
data: query.data,
|
|
8070
|
+
getRowId: (row) => {
|
|
8071
|
+
var _a;
|
|
8072
|
+
return (_a = row.id) == null ? void 0 : _a.toString();
|
|
8073
|
+
},
|
|
8074
|
+
mantineTableBodyRowProps: ({ row }) => ({
|
|
8075
|
+
onClick: () => handleRowClick(row.id),
|
|
8076
|
+
style: {
|
|
8077
|
+
cursor: "pointer",
|
|
8078
|
+
backgroundColor: rowSelection[row.id] ? "#d0e7ff" : "transparent"
|
|
8079
|
+
}
|
|
8080
|
+
}),
|
|
8081
|
+
state: rowSelection
|
|
8082
|
+
}
|
|
8083
|
+
));
|
|
8084
|
+
}
|
|
8085
|
+
function useQ_core83092_Account_GetAdminAccount() {
|
|
8086
|
+
const query = useQuery17({
|
|
8087
|
+
queryKey: ["useQ_core83092_Account_GetAdminAccount"],
|
|
8088
|
+
queryFn: async () => {
|
|
8089
|
+
var _a;
|
|
8090
|
+
const result = await baseAxios_default.get(`/Account/GetAdminAccount`, { params: { page: 5, pageNumber: 1 } });
|
|
8091
|
+
return ((_a = result.data) == null ? void 0 : _a.data) || [];
|
|
8092
|
+
},
|
|
8093
|
+
refetchOnWindowFocus: false
|
|
8094
|
+
});
|
|
8095
|
+
return query;
|
|
8096
|
+
}
|
|
8097
|
+
|
|
8098
|
+
// src/modules-features/admin/core/core83092/F_core83092_Save.tsx
|
|
8099
|
+
import { useMutation as useMutation7 } from "@tanstack/react-query";
|
|
8100
|
+
import { useEffect as useEffect12, useState as useState14 } from "react";
|
|
8101
|
+
function F_core83092_Save() {
|
|
8102
|
+
const store = useS_core83092();
|
|
8103
|
+
const disable = useState14(false);
|
|
8104
|
+
const mutation = useMutation7({
|
|
8105
|
+
mutationFn: async (body) => {
|
|
8106
|
+
const res = await baseAxios_default.put("/Role/UpdateUserPermission", body);
|
|
8107
|
+
return res;
|
|
8108
|
+
}
|
|
8109
|
+
});
|
|
8110
|
+
function handleSave() {
|
|
8111
|
+
mutation.mutate({
|
|
8112
|
+
pagePermissions: store.state.rolePermissions,
|
|
8113
|
+
userId: store.state.roleId
|
|
8114
|
+
}, {
|
|
8115
|
+
onSuccess: () => {
|
|
8116
|
+
utils_notification_show({
|
|
8117
|
+
crudType: "update"
|
|
8118
|
+
});
|
|
8119
|
+
}
|
|
8120
|
+
});
|
|
8121
|
+
}
|
|
8122
|
+
useEffect12(() => {
|
|
8123
|
+
if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
|
|
8124
|
+
disable[1](true);
|
|
8125
|
+
return;
|
|
8126
|
+
}
|
|
8127
|
+
disable[1](false);
|
|
8128
|
+
}, [store.state.rolePermissions]);
|
|
8129
|
+
return /* @__PURE__ */ React.createElement(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
|
|
8130
|
+
}
|
|
8131
|
+
|
|
8132
|
+
// src/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx
|
|
8133
|
+
import { Checkbox as Checkbox4, Flex as Flex6, ScrollArea as ScrollArea7, Table as Table5, Text as Text14 } from "@mantine/core";
|
|
8134
|
+
import { IconEdit as IconEdit6, IconEyeUp as IconEyeUp2, IconFileExport as IconFileExport3, IconPlus as IconPlus6, IconPrinter as IconPrinter4, IconTrash as IconTrash6 } from "@tabler/icons-react";
|
|
8135
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
8136
|
+
import React8, { useEffect as useEffect13, useState as useState15 } from "react";
|
|
8137
|
+
var title2 = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
|
|
8138
|
+
function F_core83092_ViewMenuPermissions() {
|
|
8139
|
+
var _a, _b;
|
|
8140
|
+
const store = useS_core83092();
|
|
8141
|
+
const query = useGetUserPermission2();
|
|
8142
|
+
const list = useState15([]);
|
|
8143
|
+
useEffect13(() => {
|
|
8144
|
+
list[1](groupToTwoLevels(menuData));
|
|
8145
|
+
}, []);
|
|
8146
|
+
useEffect13(() => {
|
|
8147
|
+
if (!query.data) return;
|
|
8148
|
+
store.setProperty("rolePermissions", query.data);
|
|
8149
|
+
}, [query.data]);
|
|
8150
|
+
if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
|
|
8151
|
+
return /* @__PURE__ */ React8.createElement(ScrollArea7.Autosize, { h: "70vh" }, /* @__PURE__ */ React8.createElement(Table5, null, /* @__PURE__ */ React8.createElement(
|
|
8152
|
+
Table5.Thead,
|
|
8153
|
+
{
|
|
8154
|
+
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
|
|
8155
|
+
style: {
|
|
8156
|
+
position: "sticky",
|
|
8157
|
+
top: 0,
|
|
8158
|
+
zIndex: 1,
|
|
8159
|
+
boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
|
|
8160
|
+
border: "1px solid var(--mantine-color-gray-4)"
|
|
8161
|
+
}
|
|
8162
|
+
},
|
|
8163
|
+
/* @__PURE__ */ React8.createElement(Table5.Tr, null, /* @__PURE__ */ React8.createElement(Table5.Th, null, title2), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isRead"), onChange: (e4) => {
|
|
8164
|
+
store.toogleAllPermissionWithType("isRead", e4.target.checked);
|
|
8165
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "Xem", /* @__PURE__ */ React8.createElement(IconEyeUp2, { color: "gray" })))), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isCreate"), onChange: (e4) => {
|
|
8166
|
+
store.toogleAllPermissionWithType("isCreate", e4.target.checked);
|
|
8167
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "Th\xEAm", /* @__PURE__ */ React8.createElement(IconPlus6, { color: "blue" })))), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isUpdate"), onChange: (e4) => {
|
|
8168
|
+
store.toogleAllPermissionWithType("isUpdate", e4.target.checked);
|
|
8169
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "S\u1EEDa", /* @__PURE__ */ React8.createElement(IconEdit6, { color: "var(--mantine-color-yellow-8)" })))), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isDelete"), onChange: (e4) => {
|
|
8170
|
+
store.toogleAllPermissionWithType("isDelete", e4.target.checked);
|
|
8171
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "X\xF3a", /* @__PURE__ */ React8.createElement(IconTrash6, { color: "var(--mantine-color-red-8)" })))), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isPrint"), onChange: (e4) => {
|
|
8172
|
+
store.toogleAllPermissionWithType("isPrint", e4.target.checked);
|
|
8173
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "In", /* @__PURE__ */ React8.createElement(IconPrinter4, { color: "var(--mantine-color-cyan-8)" })))), /* @__PURE__ */ React8.createElement(Table5.Th, null, /* @__PURE__ */ React8.createElement(Flex6, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React8.createElement(Checkbox4, { checked: store.isAllPermission("isExport"), onChange: (e4) => {
|
|
8174
|
+
store.toogleAllPermissionWithType("isExport", e4.target.checked);
|
|
8175
|
+
} }), /* @__PURE__ */ React8.createElement(MyFlexRow, { gap: 3 }, "Xu\u1EA5t", /* @__PURE__ */ React8.createElement(IconFileExport3, { color: "var(--mantine-color-green-8)" })))))
|
|
8176
|
+
), /* @__PURE__ */ React8.createElement(Table5.Tbody, { bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))" }, (_b = list[0]) == null ? void 0 : _b.map((item, idx) => {
|
|
8177
|
+
if (item.links == void 0) return /* @__PURE__ */ React8.createElement(Table5.Tr, { key: idx }, /* @__PURE__ */ React8.createElement(Table5.Td, null, item.label), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(Checkbox4, null))));
|
|
8178
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, { key: idx }, /* @__PURE__ */ React8.createElement(Table5.Tr, { key: item.label }, /* @__PURE__ */ React8.createElement(
|
|
8179
|
+
Table5.Td,
|
|
8180
|
+
{
|
|
8181
|
+
colSpan: 7,
|
|
8182
|
+
bg: OBJECT_COlORS.mantineBackgroundBlueLight
|
|
8183
|
+
},
|
|
8184
|
+
/* @__PURE__ */ React8.createElement(Text14, { fs: "oblique", size: "sm", fw: "bold" }, item.label)
|
|
8185
|
+
)), item.links.map(
|
|
8186
|
+
(item2, idx2) => {
|
|
8187
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
8188
|
+
return /* @__PURE__ */ React8.createElement(Table5.Tr, { key: idx2 }, /* @__PURE__ */ React8.createElement(Table5.Td, null, item2.label), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8189
|
+
Checkbox4,
|
|
8190
|
+
{
|
|
8191
|
+
checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
|
|
8192
|
+
onChange: (e4) => {
|
|
8193
|
+
store.updatePermission(item2.pageId, {
|
|
8194
|
+
isRead: e4.target.checked
|
|
8195
|
+
});
|
|
8196
|
+
}
|
|
8197
|
+
}
|
|
8198
|
+
))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8199
|
+
Checkbox4,
|
|
8200
|
+
{
|
|
8201
|
+
checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
|
|
8202
|
+
onChange: (e4) => {
|
|
8203
|
+
store.updatePermission(item2.pageId, {
|
|
8204
|
+
isCreate: e4.target.checked
|
|
8205
|
+
});
|
|
8206
|
+
}
|
|
8207
|
+
}
|
|
8208
|
+
))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8209
|
+
Checkbox4,
|
|
8210
|
+
{
|
|
8211
|
+
checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
|
|
8212
|
+
onChange: (e4) => {
|
|
8213
|
+
store.updatePermission(item2.pageId, {
|
|
8214
|
+
isUpdate: e4.target.checked
|
|
8215
|
+
});
|
|
8216
|
+
}
|
|
8217
|
+
}
|
|
8218
|
+
))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8219
|
+
Checkbox4,
|
|
8220
|
+
{
|
|
8221
|
+
checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
|
|
8222
|
+
onChange: (e4) => {
|
|
8223
|
+
store.updatePermission(item2.pageId, {
|
|
8224
|
+
isDelete: e4.target.checked
|
|
8225
|
+
});
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8228
|
+
))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8229
|
+
Checkbox4,
|
|
8230
|
+
{
|
|
8231
|
+
checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
|
|
8232
|
+
onChange: (e4) => {
|
|
8233
|
+
store.updatePermission(item2.pageId, {
|
|
8234
|
+
isPrint: e4.target.checked
|
|
8235
|
+
});
|
|
8236
|
+
}
|
|
8237
|
+
}
|
|
8238
|
+
))), /* @__PURE__ */ React8.createElement(Table5.Td, null, /* @__PURE__ */ React8.createElement(MyCenterFull, null, /* @__PURE__ */ React8.createElement(
|
|
8239
|
+
Checkbox4,
|
|
8240
|
+
{
|
|
8241
|
+
checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
|
|
8242
|
+
onChange: (e4) => {
|
|
8243
|
+
store.updatePermission(item2.pageId, {
|
|
8244
|
+
isExport: e4.target.checked
|
|
8245
|
+
});
|
|
8246
|
+
}
|
|
8247
|
+
}
|
|
8248
|
+
))));
|
|
8249
|
+
}
|
|
8250
|
+
));
|
|
8251
|
+
}))));
|
|
8252
|
+
}
|
|
8253
|
+
function useGetUserPermission2() {
|
|
8254
|
+
const store = useS_core83092();
|
|
8255
|
+
const query = useQuery18({
|
|
8256
|
+
queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
|
|
8257
|
+
queryFn: async () => {
|
|
8258
|
+
const result = await baseAxios_default.get("/Role/GetUserPermission?userId=" + store.state.roleId);
|
|
8259
|
+
const menudataFinal = utils_layout_getItemsWithoutLinks(menuData);
|
|
8260
|
+
if (result.data.data.length == 0) {
|
|
8261
|
+
const final = menudataFinal.map((item) => ({
|
|
8262
|
+
pageId: item.pageId,
|
|
8263
|
+
isRead: false,
|
|
8264
|
+
isCreate: false,
|
|
8265
|
+
isUpdate: false,
|
|
8266
|
+
isDelete: false,
|
|
8267
|
+
isExport: false,
|
|
8268
|
+
isPrint: false
|
|
8269
|
+
}));
|
|
8270
|
+
return final.filter((item) => item.pageId != void 0);
|
|
8271
|
+
}
|
|
8272
|
+
const menuDataFromAPI = result.data.data;
|
|
8273
|
+
const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
|
|
8274
|
+
pageId: item.pageId,
|
|
8275
|
+
isCreate: item.isCreate || false,
|
|
8276
|
+
isRead: item.isRead || false,
|
|
8277
|
+
isUpdate: item.isUpdate || false || false,
|
|
8278
|
+
isDelete: item.isDelete,
|
|
8279
|
+
isPrint: item.isPrint || false,
|
|
8280
|
+
isExport: item.isExport || false
|
|
8281
|
+
})).filter((item) => item.pageId != void 0);
|
|
8282
|
+
return mergedArray;
|
|
8283
|
+
},
|
|
8284
|
+
enabled: store.state.roleId != 0,
|
|
8285
|
+
refetchOnWindowFocus: false
|
|
8286
|
+
});
|
|
8287
|
+
return query;
|
|
8288
|
+
}
|
|
8289
|
+
|
|
8290
|
+
// src/modules-features/admin/core/core83092/F_core83092.tsx
|
|
8291
|
+
function F_core83092() {
|
|
8292
|
+
return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(Grid2, { grow: true }, /* @__PURE__ */ React.createElement(Grid2.Col, { span: 4 }, /* @__PURE__ */ React.createElement(F_core83092_ReadUser, null)), /* @__PURE__ */ React.createElement(Grid2.Col, { span: 8 }, /* @__PURE__ */ React.createElement(MyFlexColumn, { h: "80vh", flex: 1 }, /* @__PURE__ */ React.createElement(ScrollArea8.Autosize, { h: "100%" }, /* @__PURE__ */ React.createElement(Paper7, { p: "md", bg: OBJECT_COlORS.mantineBackgroundSecondary }, /* @__PURE__ */ React.createElement(F_core83092_ViewMenuPermissions, null))), /* @__PURE__ */ React.createElement(F_core83092_Save, null)))));
|
|
8293
|
+
}
|
|
8294
|
+
|
|
8295
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx
|
|
8296
|
+
import { BarChart } from "@mantine/charts";
|
|
8297
|
+
import { Group as Group18, Paper as Paper8, Text as Text15, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
|
|
8298
|
+
|
|
8299
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx
|
|
8300
|
+
import { BarChart as BarChart2 } from "@mantine/charts";
|
|
8301
|
+
import { Group as Group19, Paper as Paper9, Text as Text16, useMantineColorScheme as useMantineColorScheme3 } from "@mantine/core";
|
|
8302
|
+
|
|
8303
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx
|
|
8304
|
+
import { BarChart as BarChart3 } from "@mantine/charts";
|
|
8305
|
+
import { Group as Group20, Paper as Paper10, Text as Text17, useMantineColorScheme as useMantineColorScheme4 } from "@mantine/core";
|
|
8306
|
+
|
|
8307
|
+
// src/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx
|
|
8308
|
+
import { BarChart as BarChart4 } from "@mantine/charts";
|
|
8309
|
+
import { Group as Group21, Paper as Paper11, Text as Text18, useMantineColorScheme as useMantineColorScheme5 } from "@mantine/core";
|
|
8310
|
+
|
|
8311
|
+
// src/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx
|
|
8312
|
+
import { BarChart as BarChart5 } from "@mantine/charts";
|
|
8313
|
+
import { Group as Group22, Paper as Paper12, Text as Text19, useMantineColorScheme as useMantineColorScheme6 } from "@mantine/core";
|
|
8314
|
+
|
|
8315
|
+
// src/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx
|
|
8316
|
+
import { BarChart as BarChart6 } from "@mantine/charts";
|
|
8317
|
+
import { Group as Group23, Paper as Paper13, Text as Text20, useMantineColorScheme as useMantineColorScheme7 } from "@mantine/core";
|
|
8318
|
+
|
|
8319
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx
|
|
8320
|
+
import { LineChart } from "@mantine/charts";
|
|
8321
|
+
import { Group as Group24, Paper as Paper14, Text as Text21 } from "@mantine/core";
|
|
8322
|
+
|
|
8323
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx
|
|
8324
|
+
import { LineChart as LineChart2 } from "@mantine/charts";
|
|
8325
|
+
import { Group as Group25, Paper as Paper15, Text as Text22 } from "@mantine/core";
|
|
8326
|
+
|
|
8327
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx
|
|
8328
|
+
import { LineChart as LineChart3 } from "@mantine/charts";
|
|
8329
|
+
import { Group as Group26, Paper as Paper16, Text as Text23 } from "@mantine/core";
|
|
8330
|
+
|
|
8331
|
+
// src/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx
|
|
8332
|
+
import { LineChart as LineChart4 } from "@mantine/charts";
|
|
8333
|
+
import { Group as Group27, Paper as Paper17, Text as Text24 } from "@mantine/core";
|
|
8334
|
+
|
|
8335
|
+
// src/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx
|
|
8336
|
+
import { Center as Center4, Progress, Space as Space4, Text as Text25 } from "@mantine/core";
|
|
8337
|
+
import { PieChart } from "@mantine/charts";
|
|
8338
|
+
import { useMemo as useMemo16 } from "react";
|
|
8339
|
+
function getRandomColor(seed) {
|
|
8340
|
+
const random = Math.sin(seed) * 1e4;
|
|
8341
|
+
const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
|
|
8342
|
+
return color;
|
|
8343
|
+
}
|
|
8344
|
+
var data_used_discountCode = [
|
|
8345
|
+
{ name: "DSC01", value: 54, color: getRandomColor(1) },
|
|
8346
|
+
{ name: "DSC02", value: 32, color: getRandomColor(2) },
|
|
8347
|
+
{ name: "DSC03", value: 5, color: getRandomColor(3) },
|
|
8348
|
+
{ name: "DSC04", value: 20, color: getRandomColor(4) },
|
|
8349
|
+
{ name: "DSC05", value: 12, color: getRandomColor(5) },
|
|
8350
|
+
{ name: "DSC06", value: 45, color: getRandomColor(6) },
|
|
8351
|
+
{ name: "DSC07", value: 23, color: getRandomColor(7) },
|
|
8352
|
+
{ name: "DSC08", value: 34, color: getRandomColor(8) },
|
|
8353
|
+
{ name: "DSC09", value: 29, color: getRandomColor(9) },
|
|
8354
|
+
{ name: "DSC10", value: 18, color: getRandomColor(10) },
|
|
8355
|
+
{ name: "DSC11", value: 37, color: getRandomColor(11) },
|
|
8356
|
+
{ name: "DSC12", value: 22, color: getRandomColor(12) },
|
|
8357
|
+
{ name: "DSC13", value: 41, color: getRandomColor(13) },
|
|
8358
|
+
{ name: "DSC14", value: 27, color: getRandomColor(14) },
|
|
8359
|
+
{ name: "DSC15", value: 33, color: getRandomColor(15) },
|
|
8360
|
+
{ name: "DSC16", value: 19, color: getRandomColor(16) },
|
|
8361
|
+
{ name: "DSC17", value: 25, color: getRandomColor(17) },
|
|
8362
|
+
{ name: "DSC18", value: 30, color: getRandomColor(18) },
|
|
8363
|
+
{ name: "DSC19", value: 21, color: getRandomColor(19) },
|
|
8364
|
+
{ name: "DSC20", value: 26, color: getRandomColor(20) }
|
|
8365
|
+
];
|
|
8366
|
+
var mockData = [
|
|
8367
|
+
{
|
|
8368
|
+
code: "DSC01",
|
|
8369
|
+
name: "Discount Code 1",
|
|
8370
|
+
total: 100,
|
|
8371
|
+
used: 54,
|
|
8372
|
+
color: getRandomColor(1)
|
|
8373
|
+
},
|
|
8374
|
+
{
|
|
8375
|
+
code: "DSC02",
|
|
8376
|
+
name: "Discount Code 2",
|
|
8377
|
+
total: 150,
|
|
8378
|
+
used: 32,
|
|
8379
|
+
color: getRandomColor(2)
|
|
8380
|
+
},
|
|
8381
|
+
{
|
|
8382
|
+
code: "DSC03",
|
|
8383
|
+
name: "Discount Code 3",
|
|
8384
|
+
total: 10,
|
|
8385
|
+
used: 5,
|
|
8386
|
+
color: getRandomColor(3)
|
|
8387
|
+
},
|
|
8388
|
+
{
|
|
8389
|
+
code: "DSC04",
|
|
8390
|
+
name: "Discount Code 4",
|
|
8391
|
+
total: 100,
|
|
8392
|
+
used: 20,
|
|
8393
|
+
color: getRandomColor(4)
|
|
8394
|
+
},
|
|
8395
|
+
{
|
|
8396
|
+
code: "DSC05",
|
|
8397
|
+
name: "Discount Code 5",
|
|
8398
|
+
total: 100,
|
|
8399
|
+
used: 12,
|
|
8400
|
+
color: getRandomColor(5)
|
|
8401
|
+
},
|
|
8402
|
+
{
|
|
8403
|
+
code: "DSC06",
|
|
8404
|
+
name: "Discount Code 6",
|
|
8405
|
+
total: 100,
|
|
8406
|
+
used: 45,
|
|
8407
|
+
color: getRandomColor(6)
|
|
8408
|
+
},
|
|
8409
|
+
{
|
|
8410
|
+
code: "DSC07",
|
|
8411
|
+
name: "Discount Code 7",
|
|
8412
|
+
total: 100,
|
|
8413
|
+
used: 23,
|
|
8414
|
+
color: getRandomColor(7)
|
|
8415
|
+
},
|
|
8416
|
+
{
|
|
8417
|
+
code: "DSC08",
|
|
8418
|
+
name: "Discount Code 8",
|
|
8419
|
+
total: 100,
|
|
8420
|
+
used: 34,
|
|
8421
|
+
color: getRandomColor(8)
|
|
8422
|
+
},
|
|
8423
|
+
{
|
|
8424
|
+
code: "DSC09",
|
|
8425
|
+
name: "Discount Code 9",
|
|
8426
|
+
total: 100,
|
|
8427
|
+
used: 29,
|
|
8428
|
+
color: getRandomColor(9)
|
|
8429
|
+
},
|
|
8430
|
+
{
|
|
8431
|
+
code: "DSC10",
|
|
8432
|
+
name: "Discount Code 10",
|
|
8433
|
+
total: 100,
|
|
8434
|
+
used: 18,
|
|
8435
|
+
color: getRandomColor(10)
|
|
8436
|
+
},
|
|
8437
|
+
{
|
|
8438
|
+
code: "DSC11",
|
|
8439
|
+
name: "Discount Code 11",
|
|
8440
|
+
total: 100,
|
|
8441
|
+
used: 37,
|
|
8442
|
+
color: getRandomColor(11)
|
|
8443
|
+
},
|
|
8444
|
+
{
|
|
8445
|
+
code: "DSC12",
|
|
8446
|
+
name: "Discount Code 12",
|
|
8447
|
+
total: 100,
|
|
8448
|
+
used: 22,
|
|
8449
|
+
color: getRandomColor(12)
|
|
8450
|
+
},
|
|
8451
|
+
{
|
|
8452
|
+
code: "DSC13",
|
|
8453
|
+
name: "Discount Code 13",
|
|
8454
|
+
total: 100,
|
|
8455
|
+
used: 41,
|
|
8456
|
+
color: getRandomColor(13)
|
|
8457
|
+
},
|
|
8458
|
+
{
|
|
8459
|
+
code: "DSC14",
|
|
8460
|
+
name: "Discount Code 14",
|
|
8461
|
+
total: 100,
|
|
8462
|
+
used: 27,
|
|
8463
|
+
color: getRandomColor(14)
|
|
8464
|
+
},
|
|
8465
|
+
{
|
|
8466
|
+
code: "DSC15",
|
|
8467
|
+
name: "Discount Code 15",
|
|
8468
|
+
total: 100,
|
|
8469
|
+
used: 33,
|
|
8470
|
+
color: getRandomColor(15)
|
|
8471
|
+
},
|
|
8472
|
+
{
|
|
8473
|
+
code: "DSC16",
|
|
8474
|
+
name: "Discount Code 16",
|
|
8475
|
+
total: 100,
|
|
8476
|
+
used: 19,
|
|
8477
|
+
color: getRandomColor(16)
|
|
8478
|
+
},
|
|
8479
|
+
{
|
|
8480
|
+
code: "DSC17",
|
|
8481
|
+
name: "Discount Code 17",
|
|
8482
|
+
total: 100,
|
|
8483
|
+
used: 25,
|
|
8484
|
+
color: getRandomColor(17)
|
|
8485
|
+
},
|
|
8486
|
+
{
|
|
8487
|
+
code: "DSC18",
|
|
8488
|
+
name: "Discount Code 18",
|
|
8489
|
+
total: 100,
|
|
8490
|
+
used: 30,
|
|
8491
|
+
color: getRandomColor(18)
|
|
8492
|
+
},
|
|
8493
|
+
{
|
|
8494
|
+
code: "DSC19",
|
|
8495
|
+
name: "Discount Code 19",
|
|
8496
|
+
total: 100,
|
|
8497
|
+
used: 21,
|
|
8498
|
+
color: getRandomColor(19)
|
|
8499
|
+
},
|
|
8500
|
+
{
|
|
8501
|
+
code: "DSC20",
|
|
8502
|
+
name: "Discount Code 20",
|
|
8503
|
+
total: 100,
|
|
8504
|
+
used: 26,
|
|
8505
|
+
color: getRandomColor(20)
|
|
8506
|
+
}
|
|
8507
|
+
];
|
|
8508
|
+
function PieChart_DiscountUsedPercentage() {
|
|
8509
|
+
const totalDisountCode = mockData.reduce((acc, cur) => acc + cur.used, 0);
|
|
8510
|
+
const columns = useMemo16(
|
|
8511
|
+
() => [
|
|
8512
|
+
{
|
|
8513
|
+
header: "M\xE0u",
|
|
8514
|
+
accessorKey: "color",
|
|
8515
|
+
accessorFn(originalRow) {
|
|
8516
|
+
return /* @__PURE__ */ React.createElement("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
|
|
8517
|
+
},
|
|
8518
|
+
minSize: 30,
|
|
8519
|
+
maxSize: 30
|
|
8520
|
+
},
|
|
8521
|
+
{
|
|
8522
|
+
header: "M\xE3",
|
|
8523
|
+
accessorKey: "code",
|
|
8524
|
+
minSize: 20,
|
|
8525
|
+
maxSize: 20
|
|
8526
|
+
},
|
|
8527
|
+
{
|
|
8528
|
+
header: "%",
|
|
8529
|
+
accessorKey: "used",
|
|
8530
|
+
accessorFn(originalRow) {
|
|
8531
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center4, null, /* @__PURE__ */ React.createElement(Text25, null, (originalRow.used / totalDisountCode * 100).toFixed(0), "%")));
|
|
8532
|
+
},
|
|
8533
|
+
minSize: 64,
|
|
8534
|
+
maxSize: 64
|
|
8535
|
+
},
|
|
8536
|
+
{
|
|
8537
|
+
header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
|
|
8538
|
+
accessorKey: "value",
|
|
8539
|
+
accessorFn(originalRow) {
|
|
8540
|
+
return originalRow.used;
|
|
8541
|
+
},
|
|
8542
|
+
Cell: ({ row }) => {
|
|
8543
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center4, null, /* @__PURE__ */ React.createElement(Text25, null, "\u0110\xE3 s\u1EED d\u1EE5ng: ", /* @__PURE__ */ React.createElement("strong", null, row.original.used, " / ", row.original.total), " - (", (row.original.used / row.original.total * 100).toFixed(2), "%)")), /* @__PURE__ */ React.createElement(Progress, { color: "yellow", radius: "xs", size: "lg", value: row.original.used / row.original.total * 100 }));
|
|
8544
|
+
},
|
|
8545
|
+
minSize: 50,
|
|
8546
|
+
maxSize: 50
|
|
8547
|
+
}
|
|
8548
|
+
],
|
|
8549
|
+
[]
|
|
8550
|
+
);
|
|
8551
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Text25, { mb: "20" }, "Bi\u1EC3u \u0111\u1ED3 ph\u1EA7n tr\u0103m s\u1EED d\u1EE5ng chi\u1EBFt kh\u1EA5u h\u1ECDc vi\xEAn trong 60 ng\xE0y qua"), /* @__PURE__ */ React.createElement(Center4, null, /* @__PURE__ */ React.createElement(
|
|
8552
|
+
PieChart,
|
|
8553
|
+
{
|
|
8554
|
+
startAngle: 90,
|
|
8555
|
+
endAngle: -270,
|
|
8556
|
+
strokeWidth: 0,
|
|
8557
|
+
withLabelsLine: true,
|
|
8558
|
+
labelsPosition: "outside",
|
|
8559
|
+
withLabels: true,
|
|
8560
|
+
labelsType: "percent",
|
|
8561
|
+
data: data_used_discountCode
|
|
8562
|
+
}
|
|
8563
|
+
)), /* @__PURE__ */ React.createElement(Space4, { mt: 5 }), /* @__PURE__ */ React.createElement(
|
|
8564
|
+
MyDataTable,
|
|
8565
|
+
{
|
|
8566
|
+
data: mockData,
|
|
8567
|
+
columns,
|
|
8568
|
+
initialState: {
|
|
8569
|
+
density: "xs",
|
|
8570
|
+
pagination: { pageIndex: 0, pageSize: 5 }
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8573
|
+
)));
|
|
8574
|
+
}
|
|
8575
|
+
|
|
8576
|
+
// src/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx
|
|
8577
|
+
import { Center as Center5, Progress as Progress2, Space as Space5, Text as Text26 } from "@mantine/core";
|
|
8578
|
+
import { PieChart as PieChart2 } from "@mantine/charts";
|
|
8579
|
+
import { useMemo as useMemo17 } from "react";
|
|
8580
|
+
function getRandomColor2(seed) {
|
|
8581
|
+
const random = Math.sin(seed) * 1e4;
|
|
8582
|
+
const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
|
|
8583
|
+
return color;
|
|
8584
|
+
}
|
|
8585
|
+
var data_used_discountCode2 = [
|
|
8586
|
+
{ name: "VOU01", value: 124, color: getRandomColor2(1) },
|
|
8587
|
+
{ name: "VOU02", value: 34, color: getRandomColor2(2) },
|
|
8588
|
+
{ name: "VOU03", value: 23, color: getRandomColor2(3) },
|
|
8589
|
+
{ name: "VOU04", value: 34, color: getRandomColor2(4) },
|
|
8590
|
+
{ name: "VOU05", value: 46, color: getRandomColor2(5) },
|
|
8591
|
+
{ name: "VOU06", value: 123, color: getRandomColor2(6) },
|
|
8592
|
+
{ name: "VOU07", value: 87, color: getRandomColor2(7) },
|
|
8593
|
+
{ name: "VOU08", value: 25, color: getRandomColor2(8) },
|
|
8594
|
+
{ name: "VOU09", value: 34, color: getRandomColor2(9) },
|
|
8595
|
+
{ name: "VOU10", value: 67, color: getRandomColor2(10) },
|
|
8596
|
+
{ name: "VOU11", value: 23, color: getRandomColor2(11) },
|
|
8597
|
+
{ name: "VOU12", value: 98, color: getRandomColor2(12) },
|
|
8598
|
+
{ name: "VOU13", value: 54, color: getRandomColor2(13) },
|
|
8599
|
+
{ name: "VOU14", value: 27, color: getRandomColor2(14) },
|
|
8600
|
+
{ name: "VOU15", value: 3, color: getRandomColor2(15) },
|
|
8601
|
+
{ name: "VOU16", value: 56, color: getRandomColor2(16) },
|
|
8602
|
+
{ name: "VOU17", value: 85, color: getRandomColor2(17) },
|
|
8603
|
+
{ name: "VOU18", value: 45, color: getRandomColor2(18) },
|
|
8604
|
+
{ name: "VOU19", value: 64, color: getRandomColor2(19) },
|
|
8605
|
+
{ name: "VOU20", value: 12, color: getRandomColor2(20) }
|
|
8606
|
+
];
|
|
8607
|
+
var mockData2 = [
|
|
8608
|
+
{
|
|
8609
|
+
code: "VOU01",
|
|
8610
|
+
name: "Voucher Code 1",
|
|
8611
|
+
total: 150,
|
|
8612
|
+
used: 124,
|
|
8613
|
+
color: getRandomColor2(1)
|
|
8614
|
+
},
|
|
8615
|
+
{
|
|
8616
|
+
code: "VOU02",
|
|
8617
|
+
name: "Voucher Code 2",
|
|
8618
|
+
total: 150,
|
|
8619
|
+
used: 34,
|
|
8620
|
+
color: getRandomColor2(2)
|
|
8621
|
+
},
|
|
8622
|
+
{
|
|
8623
|
+
code: "VOU03",
|
|
8624
|
+
name: "Voucher Code 3",
|
|
8625
|
+
total: 50,
|
|
8626
|
+
used: 23,
|
|
8627
|
+
color: getRandomColor2(3)
|
|
8628
|
+
},
|
|
8629
|
+
{
|
|
8630
|
+
code: "VOU04",
|
|
8631
|
+
name: "Voucher Code 4",
|
|
8632
|
+
total: 100,
|
|
8633
|
+
used: 34,
|
|
8634
|
+
color: getRandomColor2(4)
|
|
8635
|
+
},
|
|
8636
|
+
{
|
|
8637
|
+
code: "VOU05",
|
|
8638
|
+
name: "Voucher Code 5",
|
|
8639
|
+
total: 100,
|
|
8640
|
+
used: 46,
|
|
8641
|
+
color: getRandomColor2(5)
|
|
8642
|
+
},
|
|
8643
|
+
{
|
|
8644
|
+
code: "VOU06",
|
|
8645
|
+
name: "Voucher Code 6",
|
|
8646
|
+
total: 130,
|
|
8647
|
+
used: 123,
|
|
8648
|
+
color: getRandomColor2(6)
|
|
8649
|
+
},
|
|
8650
|
+
{
|
|
8651
|
+
code: "VOU07",
|
|
8652
|
+
name: "Voucher Code 7",
|
|
8653
|
+
total: 100,
|
|
8654
|
+
used: 87,
|
|
8655
|
+
color: getRandomColor2(7)
|
|
8656
|
+
},
|
|
8657
|
+
{
|
|
8658
|
+
code: "VOU08",
|
|
8659
|
+
name: "Voucher Code 8",
|
|
8660
|
+
total: 100,
|
|
8661
|
+
used: 25,
|
|
8662
|
+
color: getRandomColor2(8)
|
|
8663
|
+
},
|
|
8664
|
+
{
|
|
8665
|
+
code: "VOU09",
|
|
8666
|
+
name: "Voucher Code 9",
|
|
8667
|
+
total: 100,
|
|
8668
|
+
used: 34,
|
|
8669
|
+
color: getRandomColor2(9)
|
|
8670
|
+
},
|
|
8671
|
+
{
|
|
8672
|
+
code: "VOU10",
|
|
8673
|
+
name: "Voucher Code 10",
|
|
8674
|
+
total: 100,
|
|
8675
|
+
used: 67,
|
|
8676
|
+
color: getRandomColor2(10)
|
|
8677
|
+
},
|
|
8678
|
+
{
|
|
8679
|
+
code: "VOU11",
|
|
8680
|
+
name: "Voucher Code 11",
|
|
8681
|
+
total: 100,
|
|
8682
|
+
used: 23,
|
|
8683
|
+
color: getRandomColor2(11)
|
|
8684
|
+
},
|
|
8685
|
+
{
|
|
8686
|
+
code: "VOU12",
|
|
8687
|
+
name: "Voucher Code 12",
|
|
8688
|
+
total: 100,
|
|
8689
|
+
used: 98,
|
|
8690
|
+
color: getRandomColor2(12)
|
|
8691
|
+
},
|
|
8692
|
+
{
|
|
8693
|
+
code: "VOU13",
|
|
8694
|
+
name: "Voucher Code 13",
|
|
8695
|
+
total: 100,
|
|
8696
|
+
used: 54,
|
|
8697
|
+
color: getRandomColor2(13)
|
|
8698
|
+
},
|
|
8699
|
+
{
|
|
8700
|
+
code: "VOU14",
|
|
8701
|
+
name: "Voucher Code 14",
|
|
8702
|
+
total: 100,
|
|
8703
|
+
used: 27,
|
|
8704
|
+
color: getRandomColor2(14)
|
|
8705
|
+
},
|
|
8706
|
+
{
|
|
8707
|
+
code: "VOU15",
|
|
8708
|
+
name: "Voucher Code 15",
|
|
8709
|
+
total: 100,
|
|
8710
|
+
used: 3,
|
|
8711
|
+
color: getRandomColor2(15)
|
|
8712
|
+
},
|
|
8713
|
+
{
|
|
8714
|
+
code: "VOU16",
|
|
8715
|
+
name: "Voucher Code 16",
|
|
8716
|
+
total: 100,
|
|
8717
|
+
used: 56,
|
|
8718
|
+
color: getRandomColor2(16)
|
|
8719
|
+
},
|
|
8720
|
+
{
|
|
8721
|
+
code: "VOU17",
|
|
8722
|
+
name: "Voucher Code 17",
|
|
8723
|
+
total: 100,
|
|
8724
|
+
used: 85,
|
|
8725
|
+
color: getRandomColor2(17)
|
|
8726
|
+
},
|
|
8727
|
+
{
|
|
8728
|
+
code: "VOU18",
|
|
8729
|
+
name: "Voucher Code 18",
|
|
8730
|
+
total: 100,
|
|
8731
|
+
used: 45,
|
|
8732
|
+
color: getRandomColor2(18)
|
|
8733
|
+
},
|
|
8734
|
+
{
|
|
8735
|
+
code: "VOU19",
|
|
8736
|
+
name: "Voucher Code 19",
|
|
8737
|
+
total: 100,
|
|
8738
|
+
used: 64,
|
|
8739
|
+
color: getRandomColor2(19)
|
|
8740
|
+
},
|
|
8741
|
+
{
|
|
8742
|
+
code: "VOU20",
|
|
8743
|
+
name: "Voucher Code 20",
|
|
8744
|
+
total: 100,
|
|
8745
|
+
used: 12,
|
|
8746
|
+
color: getRandomColor2(20)
|
|
8747
|
+
}
|
|
8748
|
+
];
|
|
8749
|
+
function PieChart_VoucherUsedPercentage() {
|
|
8750
|
+
const totalVoucherCode = mockData2.reduce((acc, cur) => acc + cur.used, 0);
|
|
8751
|
+
const columns = useMemo17(
|
|
8752
|
+
() => [
|
|
8753
|
+
{
|
|
8754
|
+
header: "M\xE0u",
|
|
8755
|
+
accessorKey: "color",
|
|
8756
|
+
accessorFn(originalRow) {
|
|
8757
|
+
return /* @__PURE__ */ React.createElement("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
|
|
8758
|
+
},
|
|
8759
|
+
minSize: 30,
|
|
8760
|
+
maxSize: 30
|
|
8761
|
+
},
|
|
8762
|
+
{
|
|
8763
|
+
header: "M\xE3",
|
|
8764
|
+
accessorKey: "code",
|
|
8765
|
+
minSize: 20,
|
|
8766
|
+
maxSize: 20
|
|
8767
|
+
},
|
|
8768
|
+
{
|
|
8769
|
+
header: "%",
|
|
8770
|
+
accessorKey: "used",
|
|
8771
|
+
accessorFn(originalRow) {
|
|
8772
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center5, null, /* @__PURE__ */ React.createElement(Text26, null, (originalRow.used / totalVoucherCode * 100).toFixed(0), "%")));
|
|
8773
|
+
},
|
|
8774
|
+
minSize: 64,
|
|
8775
|
+
maxSize: 64
|
|
8776
|
+
},
|
|
8777
|
+
{
|
|
8778
|
+
header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
|
|
8779
|
+
accessorKey: "value",
|
|
8780
|
+
accessorFn(originalRow) {
|
|
8781
|
+
return originalRow.used;
|
|
8782
|
+
},
|
|
8783
|
+
Cell: ({ row }) => {
|
|
8784
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center5, null, /* @__PURE__ */ React.createElement(Text26, null, "\u0110\xE3 s\u1EED d\u1EE5ng: ", /* @__PURE__ */ React.createElement("strong", null, row.original.used, " / ", row.original.total), " - (", (row.original.used / row.original.total * 100).toFixed(2), "%)")), /* @__PURE__ */ React.createElement(Progress2, { color: "yellow", radius: "xs", size: "lg", value: row.original.used / row.original.total * 100 }));
|
|
8785
|
+
},
|
|
8786
|
+
minSize: 50,
|
|
8787
|
+
maxSize: 50
|
|
8788
|
+
}
|
|
8789
|
+
],
|
|
8790
|
+
[]
|
|
8791
|
+
);
|
|
8792
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Text26, { mb: "20" }, "Bi\u1EC3u \u0111\u1ED3 ph\u1EA7n tr\u0103m s\u1EED d\u1EE5ng m\xE3 gi\u1EA3m gi\xE1 h\u1ECDc vi\xEAn trong 60 ng\xE0y qua"), /* @__PURE__ */ React.createElement(Center5, null, /* @__PURE__ */ React.createElement(
|
|
8793
|
+
PieChart2,
|
|
8794
|
+
{
|
|
8795
|
+
startAngle: 90,
|
|
8796
|
+
endAngle: -270,
|
|
8797
|
+
strokeWidth: 0,
|
|
8798
|
+
withLabelsLine: true,
|
|
8799
|
+
labelsPosition: "outside",
|
|
8800
|
+
withLabels: true,
|
|
8801
|
+
labelsType: "percent",
|
|
8802
|
+
data: data_used_discountCode2
|
|
8803
|
+
}
|
|
8804
|
+
)), /* @__PURE__ */ React.createElement(Space5, { mt: 5 }), /* @__PURE__ */ React.createElement(
|
|
8805
|
+
MyDataTable,
|
|
8806
|
+
{
|
|
8807
|
+
data: mockData2,
|
|
8808
|
+
columns,
|
|
8809
|
+
initialState: {
|
|
8810
|
+
density: "xs",
|
|
8811
|
+
pagination: { pageIndex: 0, pageSize: 5 }
|
|
8812
|
+
}
|
|
8813
|
+
}
|
|
8814
|
+
)));
|
|
8815
|
+
}
|
|
8816
|
+
|
|
8817
|
+
// src/modules-features/authenticate/F_authenticate_Logout.tsx
|
|
8818
|
+
import { Button as Button18 } from "@mantine/core";
|
|
8819
|
+
import { IconLogout } from "@tabler/icons-react";
|
|
8820
|
+
import { useRouter as useRouter4 } from "next/navigation";
|
|
8821
|
+
|
|
8822
|
+
// src/modules-features/authenticate/useS_authenticate.ts
|
|
8823
|
+
var useStore4 = createGenericStore({
|
|
8824
|
+
initialState: { token: "" },
|
|
8825
|
+
storageKey: "useS_authenticate"
|
|
8826
|
+
});
|
|
8827
|
+
function useS_authenticate() {
|
|
8828
|
+
const store = useStore4();
|
|
8829
|
+
function logOut() {
|
|
8830
|
+
}
|
|
8831
|
+
return __spreadValues({}, store);
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
// src/modules-features/authenticate/F_authenticate_Logout.tsx
|
|
8835
|
+
function F_authenticate_Logout() {
|
|
8836
|
+
const router = useRouter4();
|
|
8837
|
+
const S_Authenticate = useS_authenticate();
|
|
8838
|
+
return /* @__PURE__ */ React.createElement(Button18, { onClick: () => {
|
|
8839
|
+
S_Authenticate.setProperty("token", "");
|
|
8840
|
+
router.replace("/authenticate/login");
|
|
8841
|
+
}, leftSection: /* @__PURE__ */ React.createElement(IconLogout, null), fullWidth: true, justify: "start", variant: "subtle" }, "\u0110\u0103ng xu\u1EA5t");
|
|
8842
|
+
}
|
|
8843
|
+
|
|
8844
|
+
// src/modules-features/authenticate/F_authenticate_SplashPage.tsx
|
|
8845
|
+
import { useRouter as useRouter5 } from "next/navigation";
|
|
8846
|
+
import { useEffect as useEffect14 } from "react";
|
|
8847
|
+
function F_authenticate_SplashPage() {
|
|
8848
|
+
const router = useRouter5();
|
|
8849
|
+
const S_Authenticate = useS_authenticate();
|
|
8850
|
+
useEffect14(() => {
|
|
8851
|
+
if (S_Authenticate.state.token == "") {
|
|
8852
|
+
router.push("/authenticate/login");
|
|
8853
|
+
return;
|
|
8854
|
+
}
|
|
8855
|
+
router.push("/admin/core71678");
|
|
8856
|
+
}, [S_Authenticate.state.token]);
|
|
8857
|
+
return /* @__PURE__ */ React.createElement(MyBoxesBackground, { title: "H\u1EC7 th\u1ED1ng th\xF4ng tin qu\u1EA3n l\xED \u0111\xE0o t\u1EA1o ng\u1EAFn h\u1EA1n" });
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8860
|
+
// src/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx
|
|
8861
|
+
import {
|
|
8862
|
+
Anchor as Anchor2,
|
|
8863
|
+
BackgroundImage,
|
|
8864
|
+
Button as Button19,
|
|
8865
|
+
Center as Center6,
|
|
8866
|
+
Checkbox as Checkbox5,
|
|
8867
|
+
Flex as Flex7,
|
|
8868
|
+
Group as Group28,
|
|
8869
|
+
Paper as Paper18,
|
|
8870
|
+
PasswordInput as PasswordInput2,
|
|
8871
|
+
Text as Text27,
|
|
8872
|
+
TextInput as TextInput6,
|
|
8873
|
+
Title as Title2
|
|
8874
|
+
} from "@mantine/core";
|
|
8875
|
+
import { useForm as useForm19 } from "@mantine/form";
|
|
8876
|
+
import { useMutation as useMutation8 } from "@tanstack/react-query";
|
|
8877
|
+
import axios2 from "axios";
|
|
8878
|
+
import Link5 from "next/link";
|
|
8879
|
+
import { useRouter as useRouter6 } from "next/navigation";
|
|
8880
|
+
import { useState as useState16 } from "react";
|
|
8881
|
+
|
|
8882
|
+
// src/modules-features/authenticate/F_authenticate_Login/css.module.css
|
|
8883
|
+
var css_default3 = {};
|
|
8884
|
+
|
|
8885
|
+
// src/modules-features/authenticate/F_authenticate_Login/F_authenticate_Login.tsx
|
|
8886
|
+
function F_authenticate_Login({
|
|
8887
|
+
loginInfo,
|
|
8888
|
+
redirectUrlAfterLogin = "/admin/dashboard",
|
|
8889
|
+
additionalActions,
|
|
8890
|
+
backgroundImage = "/imgs/0/IMG0AuthBackground.png"
|
|
8891
|
+
}) {
|
|
8892
|
+
const router = useRouter6();
|
|
8893
|
+
const authStore = useS_authenticate();
|
|
8894
|
+
const loadingState = useState16(false);
|
|
8895
|
+
const mutation = useM_Account_Sigin();
|
|
8896
|
+
const form = useForm19({
|
|
8897
|
+
mode: "uncontrolled",
|
|
8898
|
+
initialValues: {
|
|
8899
|
+
username: (loginInfo == null ? void 0 : loginInfo.username) || "admincoe",
|
|
8900
|
+
password: (loginInfo == null ? void 0 : loginInfo.password) || "123456"
|
|
8901
|
+
},
|
|
8902
|
+
validate: {
|
|
8903
|
+
username: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
|
|
8904
|
+
password: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
|
|
8905
|
+
}
|
|
8906
|
+
});
|
|
8907
|
+
function handleSubmit(userName, passWord) {
|
|
8908
|
+
loadingState[1](true);
|
|
8909
|
+
mutation.mutate({
|
|
8910
|
+
"userName": userName,
|
|
8911
|
+
"passWord": passWord
|
|
8912
|
+
}, {
|
|
8913
|
+
onSuccess: (data) => {
|
|
8914
|
+
if (data.isSuccess === false) {
|
|
8915
|
+
form.setFieldError("username", "T\xE0i kho\u1EA3n kh\xF4ng t\u1ED3n t\u1EA1i!");
|
|
8916
|
+
loadingState[1](false);
|
|
8917
|
+
return;
|
|
8918
|
+
}
|
|
8919
|
+
if (data.isSuccess == 0) {
|
|
8920
|
+
form.setFieldError("password", "M\u1EADt kh\u1EA9u \u0111\u0103ng nh\u1EADp kh\xF4ng ch\xEDnh x\xE1c!");
|
|
8921
|
+
loadingState[1](false);
|
|
8922
|
+
return;
|
|
8923
|
+
}
|
|
8924
|
+
authStore.setProperty("token", data.data.token);
|
|
8925
|
+
router.replace(redirectUrlAfterLogin);
|
|
8926
|
+
}
|
|
8927
|
+
});
|
|
8928
|
+
}
|
|
8929
|
+
return /* @__PURE__ */ React.createElement(
|
|
8930
|
+
BackgroundImage,
|
|
8931
|
+
{
|
|
8932
|
+
src: backgroundImage,
|
|
8933
|
+
h: "100vh"
|
|
8934
|
+
},
|
|
8935
|
+
/* @__PURE__ */ React.createElement(Center6, { h: "100vh" }, /* @__PURE__ */ React.createElement(Paper18, { withBorder: true, w: 400, m: "md", shadow: "md", p: 30, mt: 30, radius: "md" }, /* @__PURE__ */ React.createElement(Flex7, { direction: "column", mb: "md" }, /* @__PURE__ */ React.createElement(Title2, { ta: "center", className: css_default3.title }, "\u0110\u0103ng nh\u1EADp!"), /* @__PURE__ */ React.createElement(Text27, { c: "dimmed", size: "sm", ta: "center", mt: 5 }, "B\u1EA1n g\u1EB7p v\u1EA5n \u0111\u1EC1 k\u1EF9 thu\u1EADt?\xA0", /* @__PURE__ */ React.createElement(Anchor2, { size: "sm", component: "button" }, "V\xE0o link n\xE0y"))), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(async (values) => handleSubmit(values.username, values.password)) }, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(
|
|
8936
|
+
TextInput6,
|
|
8937
|
+
__spreadProps(__spreadValues({}, form.getInputProps("username")), {
|
|
8938
|
+
label: "T\xE0i kho\u1EA3n",
|
|
8939
|
+
placeholder: "Nh\u1EADp t\xE0i kho\u1EA3n c\u1EE7a b\u1EA1n",
|
|
8940
|
+
withAsterisk: true
|
|
8941
|
+
})
|
|
8942
|
+
), /* @__PURE__ */ React.createElement(
|
|
8943
|
+
PasswordInput2,
|
|
8944
|
+
__spreadProps(__spreadValues({}, form.getInputProps("password")), {
|
|
8945
|
+
label: "M\u1EADt kh\u1EA9u",
|
|
8946
|
+
placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u c\u1EE7a b\u1EA1n",
|
|
8947
|
+
withAsterisk: true
|
|
8948
|
+
})
|
|
8949
|
+
), /* @__PURE__ */ React.createElement(Group28, { justify: "space-between" }, /* @__PURE__ */ React.createElement(Checkbox5, { label: "L\u01B0u \u0111\u0103ng nh\u1EADp" }), /* @__PURE__ */ React.createElement(Anchor2, { component: Link5, href: "quen-mat-khau", size: "sm" }, "Qu\xEAn m\u1EADt kh\u1EA9u?")), /* @__PURE__ */ React.createElement(
|
|
8950
|
+
Button19,
|
|
8951
|
+
{
|
|
8952
|
+
loading: loadingState[0],
|
|
8953
|
+
type: "submit",
|
|
8954
|
+
fullWidth: true
|
|
8955
|
+
},
|
|
8956
|
+
"\u0110\u0103ng nh\u1EADp"
|
|
8957
|
+
), additionalActions))))
|
|
8958
|
+
);
|
|
8959
|
+
}
|
|
8960
|
+
function useM_Account_Sigin() {
|
|
8961
|
+
const ENDPOINT5 = process.env.NEXT_PUBLIC_API + "/Account/SignIn";
|
|
8962
|
+
const mutation = useMutation8({
|
|
8963
|
+
mutationFn: async (values) => {
|
|
8964
|
+
const result = await axios2.post(ENDPOINT5, values);
|
|
8965
|
+
return result.data;
|
|
8966
|
+
}
|
|
8967
|
+
});
|
|
8968
|
+
return mutation;
|
|
8969
|
+
}
|
|
8970
|
+
|
|
8971
|
+
export {
|
|
8972
|
+
MyBoxesCore,
|
|
8973
|
+
Boxes,
|
|
8974
|
+
MyCardioLoader,
|
|
8975
|
+
MyBoxesBackground,
|
|
8976
|
+
MyActionIcon,
|
|
8977
|
+
MyTextInput,
|
|
8978
|
+
MyFlexColumn,
|
|
8979
|
+
MyActionIconCheck,
|
|
8980
|
+
MyButton,
|
|
8981
|
+
MyActionIconModal,
|
|
8982
|
+
MyActionIconDelete,
|
|
8983
|
+
MyActionIconUpdate,
|
|
8984
|
+
MyActionIconDownloadPDF,
|
|
8985
|
+
MyActionIconUpload,
|
|
8986
|
+
MyActionIconViewPDF,
|
|
8987
|
+
MySwitchTheme,
|
|
8988
|
+
MyAppSpotlight,
|
|
8989
|
+
SpotlightTrigger,
|
|
8990
|
+
MyAnchorViewPDF,
|
|
8991
|
+
MyButtonModal,
|
|
8992
|
+
AQButtonCreateByImportFile,
|
|
8993
|
+
AQButtonExportData,
|
|
8994
|
+
MyButtonCreate,
|
|
8995
|
+
MySelect,
|
|
8996
|
+
MyFlexEnd,
|
|
8997
|
+
useS_ButtonImport,
|
|
8998
|
+
SelectFieldModal,
|
|
8999
|
+
MyDataTable,
|
|
9000
|
+
SelectFileModal,
|
|
9001
|
+
MyButtonImport,
|
|
9002
|
+
AQSelectTableByOpenModal,
|
|
9003
|
+
MyButtonPrintPDF,
|
|
9004
|
+
MyHtmlWrapper,
|
|
9005
|
+
MyButtonPrintTablePDF,
|
|
9006
|
+
MyButtonRouterBack,
|
|
9007
|
+
MyButtonViewPDF,
|
|
9008
|
+
MyCalendar,
|
|
9009
|
+
MyCenterFull,
|
|
9010
|
+
MyCheckbox,
|
|
9011
|
+
MyFlexRow,
|
|
9012
|
+
AQCard,
|
|
9013
|
+
MyKeyLabel,
|
|
9014
|
+
MyNumberFormatter,
|
|
9015
|
+
AQStatCard1,
|
|
9016
|
+
MyDateInput,
|
|
9017
|
+
MyFieldset,
|
|
9018
|
+
MyFileInput,
|
|
9019
|
+
MyNumberInput,
|
|
9020
|
+
MyTextArea,
|
|
9021
|
+
MyTextEditor,
|
|
9022
|
+
MyPageContent,
|
|
9023
|
+
F_core18256_Select,
|
|
9024
|
+
F_core12196_Create,
|
|
9025
|
+
F_core12196_Delete,
|
|
9026
|
+
F_core12196_Update,
|
|
9027
|
+
F_core12196,
|
|
9028
|
+
F_core16209_Create,
|
|
9029
|
+
F_core16209_Delete,
|
|
9030
|
+
F_core16209_Update,
|
|
9031
|
+
F_core16209,
|
|
9032
|
+
F_core18256_Create,
|
|
9033
|
+
F_core18256_Delete,
|
|
9034
|
+
F_core18256_Update,
|
|
9035
|
+
F_core18256_Read,
|
|
9036
|
+
F_core18256,
|
|
9037
|
+
F_core26965_Create,
|
|
9038
|
+
F_core26965_Delete,
|
|
9039
|
+
F_core26965_Update,
|
|
9040
|
+
F_core26965,
|
|
9041
|
+
F_core27311_Create,
|
|
9042
|
+
F_core27311_Delete,
|
|
9043
|
+
F_core27311_Update,
|
|
9044
|
+
F_core27311_Read,
|
|
9045
|
+
F_core27311,
|
|
9046
|
+
useS_core83092,
|
|
9047
|
+
utils_core83092_mergePage,
|
|
9048
|
+
F_core38677_ReadUser,
|
|
9049
|
+
F_core38677_Save,
|
|
9050
|
+
F_core38677_ViewMenuPermissions,
|
|
9051
|
+
F_core40207_Create,
|
|
9052
|
+
F_core40207_Delete,
|
|
9053
|
+
F_core40207_Update,
|
|
9054
|
+
F_core40207_Read,
|
|
9055
|
+
F_core40207,
|
|
9056
|
+
F_core47643_Delete,
|
|
9057
|
+
F_core47643_Form,
|
|
9058
|
+
F_core47643_Read,
|
|
9059
|
+
F_core47643,
|
|
9060
|
+
F_core64229_Delete,
|
|
9061
|
+
F_core64229_Form,
|
|
9062
|
+
F_core64229_Read,
|
|
9063
|
+
F_core71678_ChangePermission,
|
|
9064
|
+
F_core71678_Create,
|
|
9065
|
+
F_core71678_Delete,
|
|
9066
|
+
F_core71678_Update,
|
|
9067
|
+
F_core71678_Read,
|
|
9068
|
+
F_core76318_Create,
|
|
9069
|
+
F_core76318_Delete,
|
|
9070
|
+
F_core76318_Update,
|
|
9071
|
+
F_core83092_ReadUser,
|
|
9072
|
+
F_core83092_Save,
|
|
9073
|
+
F_core83092_ViewMenuPermissions,
|
|
9074
|
+
F_core83092,
|
|
9075
|
+
PieChart_DiscountUsedPercentage,
|
|
9076
|
+
PieChart_VoucherUsedPercentage,
|
|
9077
|
+
useS_authenticate,
|
|
9078
|
+
F_authenticate_Logout,
|
|
9079
|
+
F_authenticate_SplashPage,
|
|
9080
|
+
F_authenticate_Login,
|
|
9081
|
+
BasicAppShell_transformMenuToEnum,
|
|
9082
|
+
BasicAppShell,
|
|
9083
|
+
groupToTwoLevels,
|
|
9084
|
+
utils_layout_getItemsWithoutLinks,
|
|
9085
|
+
MyContainer,
|
|
9086
|
+
useHeaderMegaMenuStore,
|
|
9087
|
+
HeaderMegaMenu,
|
|
6482
9088
|
MyTab,
|
|
6483
9089
|
MyDataTableSelect,
|
|
6484
9090
|
MySelectAPIGet,
|