aq-fe-framework 0.1.29 → 0.1.32

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.
@@ -0,0 +1,2330 @@
1
+ import {
2
+ MyActionIconDelete,
3
+ MyActionIconUpdate,
4
+ MyButton,
5
+ MyButtonCreate,
6
+ MyButtonModal,
7
+ MyButtonViewPDF,
8
+ MyCenterFull,
9
+ MyDataTable,
10
+ MyDateInput,
11
+ MyFileInput,
12
+ MyFlexColumn,
13
+ MyFlexRow,
14
+ MyNumberInput,
15
+ MyPageContent,
16
+ MyTab,
17
+ MyTextInput,
18
+ OBJECT_COlORS,
19
+ baseAxios_default,
20
+ createGenericStore,
21
+ groupToTwoLevels,
22
+ utils_layout_getItemsWithoutLinks
23
+ } from "../../../chunk-SQDX26UQ.mjs";
24
+ import {
25
+ U0DateToDDMMYYYString,
26
+ U0MyValidateEmail,
27
+ utils_file_fileToAQDocumentType
28
+ } from "../../../chunk-GHGYRQUR.mjs";
29
+ import {
30
+ __objRest,
31
+ __spreadProps,
32
+ __spreadValues,
33
+ utils_notification_show
34
+ } from "../../../chunk-ZEQATKHS.mjs";
35
+
36
+ // src/modules-features/admin/core/core12196/F_core12196.tsx
37
+ import { Accordion, Blockquote } from "@mantine/core";
38
+ import { useQuery as useQuery2 } from "@tanstack/react-query";
39
+
40
+ // src/constants/object/documentTypes.ts
41
+ var OBJECT_DOCUMENT_TYPES = {
42
+ Security: 30,
43
+ Refinement: 31,
44
+ Guideline: 32,
45
+ Regulations: 33,
46
+ Workflow: 34,
47
+ Form: 35
48
+ };
49
+
50
+ // src/modules-features/admin/core/core12196/F_core12196.tsx
51
+ import { useMemo } from "react";
52
+
53
+ // src/modules-features/admin/core/core18256/F_core18256_Select.tsx
54
+ import { Select } from "@mantine/core";
55
+ import { useQuery } from "@tanstack/react-query";
56
+ function F_core18256_Select(_a) {
57
+ var _b = _a, { documentTypeId, label = "", dataMapper } = _b, rest = __objRest(_b, ["documentTypeId", "label", "dataMapper"]);
58
+ var _a2, _b2;
59
+ const query = useQuery({
60
+ queryKey: [`/DocumentAttribute/GetByType?documentType=${documentTypeId}`],
61
+ queryFn: async () => {
62
+ const result = (await baseAxios_default.get(`/DocumentAttribute/GetByType?documentType=${documentTypeId}`)).data.data;
63
+ return result;
64
+ }
65
+ });
66
+ if (query.isLoading) return "Loading...";
67
+ const data = (_a2 = query.data) == null ? void 0 : _a2.map((item) => {
68
+ var _a3;
69
+ if (dataMapper) return dataMapper(item);
70
+ return {
71
+ value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
72
+ label: `${item.code}-${item.name}`
73
+ };
74
+ });
75
+ return /* @__PURE__ */ React.createElement(
76
+ Select,
77
+ __spreadProps(__spreadValues({
78
+ label,
79
+ placeholder: `Ch\u1ECDn ${label == null ? void 0 : label.toLowerCase()}`,
80
+ data
81
+ }, rest), {
82
+ value: (_b2 = rest.value) == null ? void 0 : _b2.toString()
83
+ })
84
+ );
85
+ }
86
+
87
+ // src/modules-features/admin/core/core12196/F_core12196_Create.tsx
88
+ import { useForm } from "@mantine/form";
89
+ function F_core12196_Create() {
90
+ const form = useForm({
91
+ mode: "uncontrolled"
92
+ });
93
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
94
+ return await baseAxios_default.post(
95
+ "/Document/create",
96
+ __spreadProps(__spreadValues({}, values), {
97
+ DocumentType: OBJECT_DOCUMENT_TYPES.Form,
98
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
99
+ })
100
+ );
101
+ } }, /* @__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"))));
102
+ }
103
+
104
+ // src/modules-features/admin/core/core12196/F_core12196_Delete.tsx
105
+ function F_core12196_Delete({ id }) {
106
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
107
+ }
108
+
109
+ // src/modules-features/admin/core/core12196/F_core12196_Update.tsx
110
+ import { useForm as useForm2 } from "@mantine/form";
111
+ function F_core12196_Update({ values }) {
112
+ var _a;
113
+ const form = useForm2({
114
+ initialValues: __spreadProps(__spreadValues({}, values), {
115
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
116
+ promulgateDate: new Date(values.promulgateDate)
117
+ })
118
+ });
119
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
120
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
121
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
122
+ }));
123
+ } }, /* @__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"))));
124
+ }
125
+
126
+ // src/modules-features/admin/core/core12196/F_core12196.tsx
127
+ function F_core12196() {
128
+ var _a, _b, _c;
129
+ const documentAttributeQuery = useQuery2({
130
+ queryKey: ["F_core12196_Read", OBJECT_DOCUMENT_TYPES.Regulations],
131
+ queryFn: async () => {
132
+ var _a2;
133
+ const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Form } });
134
+ return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
135
+ }
136
+ });
137
+ if (documentAttributeQuery.isLoading) return "Loading...";
138
+ if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
139
+ 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");
140
+ 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) => {
141
+ var _a2;
142
+ return (_a2 = item.id) == null ? void 0 : _a2.toString();
143
+ }), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead, { key: idx, name: item.name, documentType: item.id })))));
144
+ }
145
+ function SubRead({ name, documentType }) {
146
+ const documentQuery = useQuery2({
147
+ queryKey: ["SF2_3Read" + documentType],
148
+ queryFn: async () => {
149
+ const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
150
+ return result.data.data;
151
+ }
152
+ });
153
+ const columns = useMemo(
154
+ () => [
155
+ {
156
+ header: "S\u1ED1 quy \u0111\u1ECBnh",
157
+ accessorKey: "decisionCode"
158
+ },
159
+ {
160
+ header: "Ng\xE0y ban h\xE0nh",
161
+ accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
162
+ },
163
+ {
164
+ header: "T\xEAn t\xE0i li\u1EC7u",
165
+ accessorKey: "name"
166
+ },
167
+ {
168
+ header: "File",
169
+ accessorFn: (row) => {
170
+ return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
171
+ }
172
+ }
173
+ ],
174
+ []
175
+ );
176
+ if (documentQuery.isLoading) return "Loading...";
177
+ if (documentQuery.isError) return "Error!";
178
+ 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(
179
+ MyDataTable,
180
+ {
181
+ columns,
182
+ data: documentQuery.data,
183
+ 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 }))
184
+ }
185
+ )));
186
+ }
187
+
188
+ // src/modules-features/admin/core/core16209/F_core16209.tsx
189
+ import { useQuery as useQuery3 } from "@tanstack/react-query";
190
+ import { useMemo as useMemo2 } from "react";
191
+
192
+ // src/modules-features/admin/core/core16209/F_core16209_Create.tsx
193
+ import { FileInput } from "@mantine/core";
194
+ import { useForm as useForm3 } from "@mantine/form";
195
+ function F_core16209_Create() {
196
+ const form = useForm3({
197
+ mode: "uncontrolled"
198
+ });
199
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
200
+ return await baseAxios_default.post(
201
+ "/Document/create",
202
+ __spreadProps(__spreadValues({}, values), {
203
+ DocumentType: OBJECT_DOCUMENT_TYPES.Refinement,
204
+ //1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
205
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
206
+ })
207
+ );
208
+ } }, /* @__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(FileInput, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
209
+ }
210
+
211
+ // src/modules-features/admin/core/core16209/F_core16209_Delete.tsx
212
+ function F_core16209_Delete({ id }) {
213
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
214
+ }
215
+
216
+ // src/modules-features/admin/core/core16209/F_core16209_Update.tsx
217
+ import { FileInput as FileInput2, TextInput } from "@mantine/core";
218
+ import { useForm as useForm4 } from "@mantine/form";
219
+ function F_core16209_Update({ values }) {
220
+ var _a;
221
+ const form = useForm4({
222
+ mode: "uncontrolled",
223
+ initialValues: __spreadProps(__spreadValues({}, values), {
224
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
225
+ promulgateDate: new Date(values.promulgateDate)
226
+ })
227
+ });
228
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
229
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
230
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
231
+ }));
232
+ } }, /* @__PURE__ */ React.createElement(TextInput, __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(TextInput, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput2, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
233
+ }
234
+
235
+ // src/modules-features/admin/core/core16209/F_core16209.tsx
236
+ function F_core16209() {
237
+ const query = useQuery3({
238
+ queryKey: ["F_core16209_Read"],
239
+ queryFn: async () => {
240
+ var _a;
241
+ const result = await baseAxios_default.get(`/Document/GetByType?documentType=${OBJECT_DOCUMENT_TYPES.Refinement}`);
242
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
243
+ }
244
+ });
245
+ const columns = useMemo2(
246
+ () => [
247
+ {
248
+ header: "\u0110\u01A1n v\u1ECB y\xEAu c\u1EA7u",
249
+ accessorKey: "departmentName"
250
+ },
251
+ {
252
+ header: "N\u1ED9i dung c\u1EA3i ti\u1EBFn",
253
+ accessorKey: "description"
254
+ },
255
+ {
256
+ header: "Ng\xE0y b\u1EAFt \u0111\u1EA7u",
257
+ accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.startDate))
258
+ },
259
+ {
260
+ header: "Ng\xE0y k\u1EBFt th\xFAc",
261
+ accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.endDate))
262
+ },
263
+ {
264
+ header: "File",
265
+ accessorFn: (row) => {
266
+ return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
267
+ }
268
+ }
269
+ ],
270
+ []
271
+ );
272
+ if (query.isLoading) return "Loading...";
273
+ if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
274
+ return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(
275
+ MyDataTable,
276
+ {
277
+ columns,
278
+ data: query.data,
279
+ renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core16209_Create, null),
280
+ renderRowActions: ({ row }) => {
281
+ 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 }));
282
+ }
283
+ }
284
+ ));
285
+ }
286
+
287
+ // src/modules-features/admin/core/core18256/F_core18256.tsx
288
+ import { Tabs } from "@mantine/core";
289
+
290
+ // src/modules-features/admin/core/core18256/F_core18256_Read.tsx
291
+ import { useQuery as useQuery4 } from "@tanstack/react-query";
292
+ import { useMemo as useMemo3 } from "react";
293
+
294
+ // src/modules-features/admin/core/core18256/F_core18256_Create.tsx
295
+ import { useForm as useForm5 } from "@mantine/form";
296
+ function F_core18256_Create({ documentType }) {
297
+ const form = useForm5({
298
+ mode: "uncontrolled",
299
+ initialValues: {
300
+ name: "",
301
+ code: "",
302
+ documentType
303
+ },
304
+ validate: {
305
+ name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
306
+ }
307
+ });
308
+ 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"))));
309
+ }
310
+
311
+ // src/modules-features/admin/core/core18256/F_core18256_Delete.tsx
312
+ function F_core18256_Delete({ id }) {
313
+ return /* @__PURE__ */ React.createElement(
314
+ MyActionIconDelete,
315
+ {
316
+ onSubmit: async () => await baseAxios_default.post("/DocumentAttribute/Delete", { id })
317
+ }
318
+ );
319
+ }
320
+
321
+ // src/modules-features/admin/core/core18256/F_core18256_Update.tsx
322
+ import { useForm as useForm6 } from "@mantine/form";
323
+ function F_core18256_Update({ values }) {
324
+ const form = useForm6({
325
+ initialValues: values
326
+ });
327
+ 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"))));
328
+ }
329
+
330
+ // src/modules-features/admin/core/core18256/F_core18256_Read.tsx
331
+ function F_core18256_Read({ documentType }) {
332
+ const documentAttributeQuery = useQuery4({
333
+ queryKey: ["F_core18256_Read", documentType],
334
+ queryFn: async () => {
335
+ var _a;
336
+ const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType } });
337
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
338
+ }
339
+ });
340
+ const columns = useMemo3(
341
+ () => [
342
+ {
343
+ header: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n",
344
+ accessorKey: "code"
345
+ },
346
+ {
347
+ header: "T\xEAn Lo\u1EA1i V\u0103n B\u1EA3n",
348
+ accessorKey: "name"
349
+ }
350
+ ],
351
+ []
352
+ );
353
+ if (documentAttributeQuery.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
354
+ if (documentAttributeQuery.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
355
+ return /* @__PURE__ */ React.createElement(
356
+ MyDataTable,
357
+ {
358
+ columns,
359
+ enableRowNumbers: true,
360
+ data: documentAttributeQuery.data,
361
+ renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core18256_Create, { documentType }),
362
+ renderRowActions: ({ row }) => {
363
+ 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 }));
364
+ }
365
+ }
366
+ );
367
+ }
368
+
369
+ // src/modules-features/admin/core/core18256/F_core18256.tsx
370
+ var tabData = [
371
+ { label: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh" },
372
+ { label: "2. Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c" },
373
+ { label: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu" }
374
+ ];
375
+ function F_core18256() {
376
+ return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(MyTab, { tabList: tabData }, /* @__PURE__ */ React.createElement(Tabs.Panel, { value: "1. V\u0103n b\u1EA3n quy \u0111\u1ECBnh" }, /* @__PURE__ */ React.createElement(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Regulations })), /* @__PURE__ */ React.createElement(Tabs.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(Tabs.Panel, { value: "3. Danh m\u1EE5c bi\u1EC3u m\u1EABu" }, /* @__PURE__ */ React.createElement(F_core18256_Read, { documentType: OBJECT_DOCUMENT_TYPES.Form }))));
377
+ }
378
+
379
+ // src/modules-features/admin/core/core26965/F_core26965_Create.tsx
380
+ import { useForm as useForm7 } from "@mantine/form";
381
+ function F_core26965_Create() {
382
+ const form = useForm7({
383
+ mode: "uncontrolled"
384
+ });
385
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
386
+ return await baseAxios_default.post(
387
+ "/Document/create",
388
+ __spreadProps(__spreadValues({}, values), {
389
+ DocumentType: OBJECT_DOCUMENT_TYPES.Regulations,
390
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
391
+ })
392
+ );
393
+ } }, /* @__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"))));
394
+ }
395
+
396
+ // src/modules-features/admin/core/core26965/F_core26965_Read.tsx
397
+ import { Accordion as Accordion2, Blockquote as Blockquote2 } from "@mantine/core";
398
+ import { useQuery as useQuery5 } from "@tanstack/react-query";
399
+ import { useMemo as useMemo4 } from "react";
400
+
401
+ // src/modules-features/admin/core/core26965/F_core26965_Delete.tsx
402
+ function F_core26965_Delete({ id }) {
403
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
404
+ }
405
+
406
+ // src/modules-features/admin/core/core26965/F_core26965_Update.tsx
407
+ import { useForm as useForm8 } from "@mantine/form";
408
+ function F_core26965_Update({ values }) {
409
+ var _a;
410
+ const form = useForm8({
411
+ initialValues: __spreadProps(__spreadValues({}, values), {
412
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
413
+ promulgateDate: new Date(values.promulgateDate)
414
+ })
415
+ });
416
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
417
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
418
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
419
+ }));
420
+ } }, /* @__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"))));
421
+ }
422
+
423
+ // src/modules-features/admin/core/core26965/F_core26965_Read.tsx
424
+ function F_core26965_Read() {
425
+ var _a, _b, _c;
426
+ const documentAttributeQuery = useQuery5({
427
+ queryKey: ["F_core26965_Read", OBJECT_DOCUMENT_TYPES.Regulations],
428
+ queryFn: async () => {
429
+ var _a2;
430
+ const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Regulations } });
431
+ return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
432
+ }
433
+ });
434
+ if (documentAttributeQuery.isLoading) return "Loading...";
435
+ if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
436
+ 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");
437
+ return /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Accordion2, { defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map((item) => {
438
+ var _a2;
439
+ return (_a2 = item.id) == null ? void 0 : _a2.toString();
440
+ }), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead2, { key: idx, name: item.name, documentType: item.id }))));
441
+ }
442
+ function SubRead2({ name, documentType }) {
443
+ const documentQuery = useQuery5({
444
+ queryKey: ["SubRead" + documentType],
445
+ queryFn: async () => {
446
+ const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
447
+ return result.data.data;
448
+ }
449
+ });
450
+ const columns = useMemo4(
451
+ () => [
452
+ {
453
+ header: "S\u1ED1 quy \u0111\u1ECBnh",
454
+ accessorKey: "decisionCode"
455
+ },
456
+ {
457
+ header: "Ng\xE0y ban h\xE0nh",
458
+ accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
459
+ },
460
+ {
461
+ header: "T\xEAn t\xE0i li\u1EC7u",
462
+ accessorKey: "name"
463
+ },
464
+ {
465
+ header: "File",
466
+ accessorFn: (row) => {
467
+ return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
468
+ }
469
+ }
470
+ ],
471
+ []
472
+ );
473
+ if (documentQuery.isLoading) return "Loading...";
474
+ if (documentQuery.isError) return "Error!";
475
+ 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(
476
+ MyDataTable,
477
+ {
478
+ columns,
479
+ data: documentQuery.data,
480
+ 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 }))
481
+ }
482
+ )));
483
+ }
484
+
485
+ // src/modules-features/admin/core/core26965/F_core26965.tsx
486
+ function F_core26965() {
487
+ return /* @__PURE__ */ React.createElement(MyPageContent, { rightTopBar: /* @__PURE__ */ React.createElement(F_core26965_Create, null) }, /* @__PURE__ */ React.createElement(F_core26965_Read, null));
488
+ }
489
+
490
+ // src/modules-features/admin/core/core27311/F_core27311_Create.tsx
491
+ import { useForm as useForm9 } from "@mantine/form";
492
+ function F_core27311_Create() {
493
+ const form = useForm9({
494
+ mode: "uncontrolled"
495
+ });
496
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "V\u0103n b\u1EA3n quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", form, onSubmit: async (values) => {
497
+ return await baseAxios_default.post(
498
+ "/Document/create",
499
+ __spreadProps(__spreadValues({}, values), {
500
+ DocumentType: OBJECT_DOCUMENT_TYPES.Workflow,
501
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
502
+ })
503
+ );
504
+ } }, /* @__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"))));
505
+ }
506
+
507
+ // src/modules-features/admin/core/core27311/F_core27311_Read.tsx
508
+ import { Accordion as Accordion3, Blockquote as Blockquote3 } from "@mantine/core";
509
+ import { useQuery as useQuery6 } from "@tanstack/react-query";
510
+ import { useMemo as useMemo5 } from "react";
511
+
512
+ // src/modules-features/admin/core/core27311/F_core27311_Delete.tsx
513
+ function F_core27311_Delete({ id }) {
514
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: async () => await baseAxios_default.post("/Document/delete", { id }) });
515
+ }
516
+
517
+ // src/modules-features/admin/core/core27311/F_core27311_Update.tsx
518
+ import { useForm as useForm10 } from "@mantine/form";
519
+ function F_core27311_Update({ values }) {
520
+ var _a;
521
+ const form = useForm10({
522
+ initialValues: __spreadProps(__spreadValues({}, values), {
523
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
524
+ promulgateDate: new Date(values.promulgateDate)
525
+ })
526
+ });
527
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
528
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
529
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
530
+ }));
531
+ } }, /* @__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"))));
532
+ }
533
+
534
+ // src/modules-features/admin/core/core27311/F_core27311_Read.tsx
535
+ function F_core27311_Read() {
536
+ var _a, _b, _c;
537
+ const documentAttributeQuery = useQuery6({
538
+ queryKey: ["F_core27311_Read", OBJECT_DOCUMENT_TYPES.Workflow],
539
+ queryFn: async () => {
540
+ var _a2;
541
+ const result = await baseAxios_default.get("/DocumentAttribute/GetByType?", { params: { documentType: OBJECT_DOCUMENT_TYPES.Workflow } });
542
+ return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
543
+ }
544
+ });
545
+ if (documentAttributeQuery.isLoading) return "Loading...";
546
+ if (documentAttributeQuery.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
547
+ 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");
548
+ return /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Accordion3, { defaultValue: (_b = documentAttributeQuery.data) == null ? void 0 : _b.map((item) => {
549
+ var _a2;
550
+ return (_a2 = item.id) == null ? void 0 : _a2.toString();
551
+ }), multiple: true }, (_c = documentAttributeQuery.data) == null ? void 0 : _c.map((item, idx) => /* @__PURE__ */ React.createElement(SubRead3, { key: idx, name: item.name, documentType: item.id }))));
552
+ }
553
+ function SubRead3({ name, documentType }) {
554
+ const documentQuery = useQuery6({
555
+ queryKey: ["SubRead" + documentType],
556
+ queryFn: async () => {
557
+ const result = await baseAxios_default.get(`/Document/GetByDocumentAttribute?id=${documentType}`);
558
+ return result.data.data;
559
+ }
560
+ });
561
+ const columns = useMemo5(
562
+ () => [
563
+ {
564
+ header: "S\u1ED1 quy \u0111\u1ECBnh",
565
+ accessorKey: "decisionCode"
566
+ },
567
+ {
568
+ header: "Ng\xE0y ban h\xE0nh",
569
+ accessorFn: (row) => U0DateToDDMMYYYString(new Date(row.promulgateDate))
570
+ },
571
+ {
572
+ header: "T\xEAn t\xE0i li\u1EC7u",
573
+ accessorKey: "name"
574
+ },
575
+ {
576
+ header: "File",
577
+ accessorFn: (row) => {
578
+ return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
579
+ }
580
+ }
581
+ ],
582
+ []
583
+ );
584
+ if (documentQuery.isLoading) return "Loading...";
585
+ if (documentQuery.isError) return "Error!";
586
+ 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(
587
+ MyDataTable,
588
+ {
589
+ columns,
590
+ data: documentQuery.data,
591
+ 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 }))
592
+ }
593
+ )));
594
+ }
595
+
596
+ // src/modules-features/admin/core/core27311/F_core27311.tsx
597
+ function F_core27311() {
598
+ return /* @__PURE__ */ React.createElement(MyPageContent, { rightTopBar: /* @__PURE__ */ React.createElement(F_core27311_Create, null) }, /* @__PURE__ */ React.createElement(F_core27311_Read, null));
599
+ }
600
+
601
+ // src/modules-features/admin/core/core38677/F_core38677.tsx
602
+ import { Grid, Paper, ScrollArea as ScrollArea2 } from "@mantine/core";
603
+
604
+ // src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
605
+ import { Container } from "@mantine/core";
606
+ import { useQuery as useQuery7 } from "@tanstack/react-query";
607
+ import { useEffect, useMemo as useMemo6, useState } from "react";
608
+
609
+ // src/modules-features/admin/core/core83092/useS_core83092.tsx
610
+ var useStore = createGenericStore({
611
+ initialState: { roleId: 0 },
612
+ storageKey: "useS_core83092"
613
+ });
614
+ function useS_core83092() {
615
+ const store = useStore();
616
+ function toogleAllPermissionWithType(field, isCheck) {
617
+ var _a;
618
+ const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map((item) => __spreadProps(__spreadValues({}, item), {
619
+ [field]: isCheck
620
+ }));
621
+ store.setProperty("rolePermissions", updatedData);
622
+ }
623
+ function findByPageId(pageId) {
624
+ var _a;
625
+ const rolePermission = (_a = store.state.rolePermissions) == null ? void 0 : _a.find((item) => item.pageId == pageId);
626
+ return rolePermission;
627
+ }
628
+ function updatePermission(pageId, updatedPermission) {
629
+ var _a;
630
+ const updatedData = (_a = store.state.rolePermissions) == null ? void 0 : _a.map(
631
+ (item) => item.pageId === pageId ? __spreadValues(__spreadValues({}, item), updatedPermission) : item
632
+ );
633
+ store.setProperty("rolePermissions", updatedData);
634
+ }
635
+ function isAllPermission(field) {
636
+ var _a, _b;
637
+ return (_b = (_a = store.state.rolePermissions) == null ? void 0 : _a.every((item) => item[field] === true)) != null ? _b : false;
638
+ }
639
+ return __spreadProps(__spreadValues({}, store), {
640
+ toogleAllPermissionWithType,
641
+ findByPageId,
642
+ updatePermission,
643
+ isAllPermission
644
+ });
645
+ }
646
+ function utils_core83092_mergePage(arr1, arr2) {
647
+ const pageMap = /* @__PURE__ */ new Map();
648
+ arr1.forEach((page) => pageMap.set(page.pageId, page));
649
+ arr2.forEach((page) => {
650
+ if (pageMap.has(page.pageId)) {
651
+ pageMap.set(page.pageId, page);
652
+ }
653
+ });
654
+ return Array.from(pageMap.values());
655
+ }
656
+
657
+ // src/modules-features/admin/core/core38677/F_core38677_ReadUser.tsx
658
+ function F_core38677_ReadUser() {
659
+ const store = useS_core83092();
660
+ const query = useQ_Account_GetAdminAccount();
661
+ const [rowSelection, setRowSelection] = useState({});
662
+ const columns = useMemo6(
663
+ () => [
664
+ {
665
+ header: "M\xE3",
666
+ accessorKey: "code",
667
+ size: 60
668
+ },
669
+ {
670
+ header: "T\xEAn quy\u1EC1n",
671
+ accessorKey: "name"
672
+ }
673
+ ],
674
+ []
675
+ );
676
+ const handleRowClick = (rowId) => {
677
+ setRowSelection({ [rowId]: true });
678
+ store.setProperty("roleId", parseInt(rowId));
679
+ };
680
+ useEffect(() => {
681
+ if (store.state.roleId == 0) return;
682
+ setRowSelection({ [store.state.roleId]: true });
683
+ }, [store.state.roleId]);
684
+ useEffect(() => {
685
+ if (!query.data) return;
686
+ store.setProperty("roleId", query.data[0].id);
687
+ }, [query.data]);
688
+ if (query.isLoading) return "Loading...";
689
+ if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
690
+ return /* @__PURE__ */ React.createElement(Container, { fluid: true }, /* @__PURE__ */ React.createElement(
691
+ MyDataTable,
692
+ {
693
+ columns,
694
+ data: query.data,
695
+ getRowId: (row) => {
696
+ var _a;
697
+ return (_a = row.id) == null ? void 0 : _a.toString();
698
+ },
699
+ mantineTableBodyRowProps: ({ row }) => ({
700
+ onClick: () => handleRowClick(row.id),
701
+ style: {
702
+ cursor: "pointer",
703
+ backgroundColor: rowSelection[row.id] ? "var(--mantine-color-blue-light)" : "transparent"
704
+ }
705
+ }),
706
+ state: rowSelection
707
+ }
708
+ ));
709
+ }
710
+ function useQ_Account_GetAdminAccount() {
711
+ const query = useQuery7({
712
+ queryKey: ["useQ_Role_GetAdminRole"],
713
+ queryFn: async () => {
714
+ var _a;
715
+ const result = await baseAxios_default.get(`/Role/GetAdminRole`);
716
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
717
+ },
718
+ refetchOnWindowFocus: false
719
+ });
720
+ return query;
721
+ }
722
+
723
+ // src/modules-features/admin/core/core38677/F_core38677_Save.tsx
724
+ import { useMutation } from "@tanstack/react-query";
725
+ import { useEffect as useEffect2, useState as useState2 } from "react";
726
+ function F_core38677_Save() {
727
+ const store = useS_core83092();
728
+ const disable = useState2(false);
729
+ const mutation = useMutation({
730
+ mutationFn: async (body) => {
731
+ const res = await baseAxios_default.put("/Role/UpdatePermission", body);
732
+ return res;
733
+ }
734
+ });
735
+ function handleSave() {
736
+ mutation.mutate({
737
+ pagePermissions: store.state.rolePermissions,
738
+ roleId: store.state.roleId
739
+ }, {
740
+ onSuccess: () => {
741
+ utils_notification_show({
742
+ crudType: "update"
743
+ });
744
+ }
745
+ });
746
+ }
747
+ useEffect2(() => {
748
+ if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
749
+ disable[1](true);
750
+ return;
751
+ }
752
+ disable[1](false);
753
+ }, [store.state.rolePermissions]);
754
+ return /* @__PURE__ */ React.createElement(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
755
+ }
756
+
757
+ // src/data/menuData.ts
758
+ var menuData = [
759
+ {
760
+ label: "Qu\u1EA3n l\xED h\u1EC7 th\u1ED1ng",
761
+ links: [
762
+ { pageId: 1, name: "Account management", label: "Qu\u1EA3n l\xED t\xE0i kho\u1EA3n", link: "core71678" },
763
+ // { label: "Danh mục quyền", link: "47643", status: "Prototype" },
764
+ { pageId: 2, name: "Access control level", label: "Ph\xE2n quy\u1EC1n c\u1EA5p \u0111\u01A1n v\u1ECB", link: "core38677" },
765
+ { pageId: 3, name: "Access control", label: "Ph\xE2n quy\u1EC1n s\u1EED d\u1EE5ng", link: "core83092" },
766
+ { name: "Document categories", label: "Danh m\u1EE5c lo\u1EA1i v\u0103n b\u1EA3n", link: "core18256" },
767
+ { pageId: 4, name: "Security regulations", label: "Quy \u0111\u1ECBnh an to\xE0n/ b\u1EA3o m\u1EADt th\xF4ng tin", link: "core76318", status: "Default" },
768
+ { 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" },
769
+ { pageId: 6, name: "User guide", label: "T\xE0i li\u1EC7u h\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng", link: "core40207", status: "Default" }
770
+ ]
771
+ },
772
+ {
773
+ label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh",
774
+ links: [
775
+ { pageId: 7, name: "Organizational regulations", label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", link: "core26965", status: "Default" },
776
+ { pageId: 8, name: "Workflow process", label: "Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", link: "core27311", status: "Default" },
777
+ { pageId: 9, name: "Form templates", label: "T\xE0i li\u1EC7u bi\u1EC3u m\u1EABu", link: "core12196", status: "Default" }
778
+ ]
779
+ },
780
+ {
781
+ label: "Qu\u1EA3n l\xFD ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o ",
782
+ links: [
783
+ {
784
+ label: "\u0110\u1ECBnh ngh\u0129a d\u1EEF li\u1EC7u",
785
+ links: [
786
+ { pageId: 609, name: "Training Level Catalog", label: "Danh m\u1EE5c b\u1EADc \u0111\xE0o t\u1EA1o", link: "vf2cwmibmh" },
787
+ { pageId: 610, name: "Training systems Catalog", label: "Danh m\u1EE5c h\u1EC7 \u0111\xE0o t\u1EA1o", link: "4hi65qkj5n" },
788
+ { pageId: 611, name: "Regulation Catalog", label: "Danh m\u1EE5c quy ch\u1EBF", link: "j9ul1u9c2n", status: "Default" },
789
+ { pageId: 612, name: "Degree levels Catalog", label: "Danh m\u1EE5c b\u1EADc h\u1EC7", link: "zvib1md6z9" },
790
+ { pageId: 613, name: "Program Catalog", label: "Danh m\u1EE5c ch\u01B0\u01A1ng tr\xECnh", link: "h7op7f4nav", status: "Default" },
791
+ { pageId: 614, name: "Grade Catalog", label: "Danh m\u1EE5c Kh\xF3a", link: "ukagvjshxgy" },
792
+ { pageId: 615, name: "Subject group Catalog", label: "Danh m\u1EE5c nh\xF3m m\xF4n h\u1ECDc", link: "zudcgcvda8", status: "Default" },
793
+ { pageId: 616, name: "Subject Catalog", label: "Danh m\u1EE5c m\xF4n h\u1ECDc", link: "rdrmqcfvux" },
794
+ { pageId: 617, name: "Subject group MIT", label: "Quan h\u1EC7 nh\xF3m m\xF4n h\u1ECDc v\xE0 thang MIT", link: "wfl5pwciof" }
795
+ ]
796
+ },
797
+ {
798
+ label: "Ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o",
799
+ links: [
800
+ { pageId: 618, name: "Training program", label: "Ch\u01B0\u01A1ng tr\xECnh \u0111\xE0o t\u1EA1o", link: "hlnya90qi9" },
801
+ { 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" },
802
+ { pageId: 620, name: "Course Learning Outcomes", label: "Chu\u1EA9n \u0111\u1EA7u ra m\xF4n h\u1ECDc (CLO)", link: "upgwbnmsn8", status: "Default" },
803
+ { pageId: 621, name: "CLO PIs relation", label: "Quan h\u1EC7 CLO v\xE0 Pis", link: "hxrvhadcfm" },
804
+ { pageId: 622, name: "Evaluation unit assignment", label: "Ph\xE2n c\xF4ng \u0111\u01A1n v\u1ECB \u0111\xE1nh gi\xE1", link: "rb55trm19d", status: "Prototype" }
805
+ ]
806
+ }
807
+ ]
808
+ },
809
+ {
810
+ label: "Khung \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
811
+ links: [
812
+ { 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" },
813
+ { pageId: 624, name: "PLO measurement framework", label: "Khung \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T", link: "PLOFramework/CLOCoreSubject" },
814
+ { 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" }
815
+ ]
816
+ },
817
+ {
818
+ label: "X\xE2y d\u1EF1ng k\u1EBF ho\u1EA1ch \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
819
+ links: [
820
+ { 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" },
821
+ { pageId: 627, name: "Program PLO assessment plan", label: "K\u1EBF ho\u1EA1ch \u0111o chu\u1EA9n \u0111\u1EA7u ra theo CT\u0110T", link: "g2" }
822
+ ]
823
+ },
824
+ {
825
+ label: "\u0110\xE1nh gi\xE1 k\u1EBFt qu\u1EA3 h\u1ECDc t\u1EADp m\xF4n h\u1ECDc ",
826
+ links: [
827
+ {
828
+ label: "\u0110\xE1nh gi\xE1 CLO m\xF4n h\u1ECDc ",
829
+ links: [
830
+ { pageId: 628, name: "Course required competencies", label: "N\u0103ng l\u1EF1c y\xEAu c\u1EA7u c\u1EE7a m\xF4n h\u1ECDc", link: "licl7ube7d" },
831
+ { pageId: 629, name: "CLO assessment methods", label: "Ph\u01B0\u01A1ng ph\xE1p \u0111\xE1nh gi\xE1 CLO", link: "subjectAssessment/CLOAssessment/config" },
832
+ { pageId: 630, name: "Exam structure", label: "C\u1EA5u tr\xFAc \u0111\u1EC1 thi", link: "vq720hj9jx" }
833
+ ]
834
+ },
835
+ {
836
+ label: "D\u1EEF li\u1EC7u \u0111i\u1EC3m sinh vi\xEAn \u0111\xE1nh gi\xE1 ",
837
+ links: [
838
+ { pageId: 631, name: "Student database", label: "C\u01A1 s\u1EDF d\u1EEF li\u1EC7u sinh vi\xEAn", link: "4ltk4f68a8" },
839
+ { pageId: 632, name: "Student course registration", label: "Sinh vi\xEAn \u0111\u0103ng k\xFD m\xF4n h\u1ECDc", link: "nugmpmukta" },
840
+ { pageId: 633, name: "Course grade entry", label: "Nh\u1EADp \u0111i\u1EC3m theo nh\xF3m h\u1ECDc", link: "l9bml18o7p", status: "Prototype" },
841
+ { pageId: 634, name: "Student grade entry", label: "Nh\u1EADp \u0111i\u1EC3m t\u1EEBng sinh vi\xEAn", link: "clzixswvmy", status: "Prototype" }
842
+ ]
843
+ },
844
+ {
845
+ label: "T\u1ED5ng h\u1EE3p \u0111i\u1EC3m CLO m\xF4n h\u1ECDc ",
846
+ links: [
847
+ { pageId: 635, name: "Class CLO grade summary", label: "T\u1ED5ng h\u1EE3p \u0111i\u1EC3m CLO m\xF4n h\u1ECDc theo l\u1EDBp" },
848
+ { pageId: 636, name: "Course wide CLO chart", label: "Bi\u1EC3u \u0111\u1ED3 CLO to\xE0n m\xF4n h\u1ECDc", link: "6cnw99q4zo", status: "Prototype" }
849
+ ]
850
+ }
851
+ ]
852
+ },
853
+ {
854
+ label: "Tri\u1EC3n khai k\u1EBF ho\u1EA1ch \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
855
+ link: "zz2",
856
+ status: "Menu"
857
+ },
858
+ {
859
+ label: "K\u1EBFt qu\u1EA3 th\u1EF1c hi\u1EC7n \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
860
+ link: "8",
861
+ links: [
862
+ { pageId: 637, name: "Program wide PLO summary", label: "T\u1ED5ng h\u1EE3p PLO to\xE0n kh\xF3a", link: "5bmex2c6in", status: "Prototype" },
863
+ { 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" },
864
+ { 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" }
865
+ ]
866
+ },
867
+ {
868
+ label: "B\xE1o c\xE1o v\xE0 \u0111\u1EC1 xu\u1EA5t c\u1EA3i ti\u1EBFn ",
869
+ link: "i1",
870
+ status: "Menu"
871
+ },
872
+ {
873
+ label: "H\u1ECDp h\u1ED9i \u0111\u1ED3ng \u0111o l\u01B0\u1EDDng C\u0110R CT\u0110T ",
874
+ link: "j1",
875
+ status: "Menu"
876
+ },
877
+ {
878
+ label: "Danh m\u1EE5c h\u1EC7 th\u1ED1ng ",
879
+ links: [
880
+ { pageId: 640, name: "Unit list", label: "Danh m\u1EE5c \u0111\u01A1n v\u1ECB", link: "14w3vwnnfy" },
881
+ { pageId: 641, name: "MIT scale", label: "Thang \u0111o MIT", link: "umg0mq7o3x" },
882
+ { pageId: 642, name: "Rubric scale", label: "Thang \u0111o Rubrics", link: "fmc2n1ftq1" },
883
+ { pageId: 643, name: "PLO ranking table", label: "B\u1EA3ng x\u1EBFp lo\u1EA1i PLO", link: "f0oia066vb" },
884
+ { pageId: 644, name: "Academic year list", label: "Danh m\u1EE5c n\u0103m h\u1ECDc", link: "omhcfkliwa" },
885
+ { pageId: 645, name: "Academic year semester list", label: "Danh m\u1EE5c n\u0103m h\u1ECDc h\u1ECDc k\u1EF3", link: "cw38zkpvg4" }
886
+ ]
887
+ }
888
+ ];
889
+
890
+ // src/modules-features/admin/core/core38677/F_core38677_ViewMenuPermissions.tsx
891
+ import { Checkbox, Flex, ScrollArea, Table, Text } from "@mantine/core";
892
+ import { IconEdit, IconEyeUp, IconFileExport, IconPlus, IconPrinter, IconTrash } from "@tabler/icons-react";
893
+ import { useQuery as useQuery8 } from "@tanstack/react-query";
894
+ import React2, { useEffect as useEffect3, useState as useState3 } from "react";
895
+ var title = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
896
+ function F_core38677_ViewMenuPermissions() {
897
+ var _a, _b;
898
+ const store = useS_core83092();
899
+ const query = useGetUserPermission();
900
+ const list = useState3([]);
901
+ useEffect3(() => {
902
+ list[1](groupToTwoLevels(menuData));
903
+ }, []);
904
+ useEffect3(() => {
905
+ if (!query.data) return;
906
+ store.setProperty("rolePermissions", query.data);
907
+ }, [query.data]);
908
+ if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
909
+ return /* @__PURE__ */ React2.createElement(ScrollArea.Autosize, { h: "70vh" }, /* @__PURE__ */ React2.createElement(Table, null, /* @__PURE__ */ React2.createElement(
910
+ Table.Thead,
911
+ {
912
+ bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
913
+ style: {
914
+ position: "sticky",
915
+ top: 0,
916
+ zIndex: 1,
917
+ boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
918
+ border: "1px solid var(--mantine-color-gray-4)"
919
+ }
920
+ },
921
+ /* @__PURE__ */ React2.createElement(Table.Tr, null, /* @__PURE__ */ React2.createElement(Table.Th, null, title), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isRead"), onChange: (e) => {
922
+ store.toogleAllPermissionWithType("isRead", e.target.checked);
923
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "Xem", /* @__PURE__ */ React2.createElement(IconEyeUp, { color: "gray" })))), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isCreate"), onChange: (e) => {
924
+ store.toogleAllPermissionWithType("isCreate", e.target.checked);
925
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "Th\xEAm", /* @__PURE__ */ React2.createElement(IconPlus, { color: "blue" })))), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isUpdate"), onChange: (e) => {
926
+ store.toogleAllPermissionWithType("isUpdate", e.target.checked);
927
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "S\u1EEDa", /* @__PURE__ */ React2.createElement(IconEdit, { color: "var(--mantine-color-yellow-8)" })))), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isDelete"), onChange: (e) => {
928
+ store.toogleAllPermissionWithType("isDelete", e.target.checked);
929
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "X\xF3a", /* @__PURE__ */ React2.createElement(IconTrash, { color: "var(--mantine-color-red-8)" })))), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isPrint"), onChange: (e) => {
930
+ store.toogleAllPermissionWithType("isPrint", e.target.checked);
931
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "In", /* @__PURE__ */ React2.createElement(IconPrinter, { color: "var(--mantine-color-cyan-8)" })))), /* @__PURE__ */ React2.createElement(Table.Th, null, /* @__PURE__ */ React2.createElement(Flex, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React2.createElement(Checkbox, { checked: store.isAllPermission("isExport"), onChange: (e) => {
932
+ store.toogleAllPermissionWithType("isExport", e.target.checked);
933
+ } }), /* @__PURE__ */ React2.createElement(MyFlexRow, { gap: 3 }, "Xu\u1EA5t", /* @__PURE__ */ React2.createElement(IconFileExport, { color: "var(--mantine-color-green-8)" })))))
934
+ ), /* @__PURE__ */ React2.createElement(Table.Tbody, { bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))" }, (_b = list[0]) == null ? void 0 : _b.map((item, idx) => {
935
+ if (item.links == void 0) return /* @__PURE__ */ React2.createElement(Table.Tr, { key: idx }, /* @__PURE__ */ React2.createElement(Table.Td, null, item.label), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(Checkbox, null))));
936
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, { key: idx }, /* @__PURE__ */ React2.createElement(Table.Tr, { key: item.label }, /* @__PURE__ */ React2.createElement(
937
+ Table.Td,
938
+ {
939
+ colSpan: 7,
940
+ bg: OBJECT_COlORS.mantineBackgroundBlueLight
941
+ },
942
+ /* @__PURE__ */ React2.createElement(Text, { fs: "oblique", size: "sm", fw: "bold" }, item.label)
943
+ )), item.links.map(
944
+ (item2, idx2) => {
945
+ var _a2, _b2, _c, _d, _e, _f;
946
+ return /* @__PURE__ */ React2.createElement(Table.Tr, { key: idx2 }, /* @__PURE__ */ React2.createElement(Table.Td, null, item2.label), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
947
+ Checkbox,
948
+ {
949
+ checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
950
+ onChange: (e) => {
951
+ store.updatePermission(item2.pageId, {
952
+ isRead: e.target.checked
953
+ });
954
+ }
955
+ }
956
+ ))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
957
+ Checkbox,
958
+ {
959
+ checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
960
+ onChange: (e) => {
961
+ store.updatePermission(item2.pageId, {
962
+ isCreate: e.target.checked
963
+ });
964
+ }
965
+ }
966
+ ))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
967
+ Checkbox,
968
+ {
969
+ checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
970
+ onChange: (e) => {
971
+ store.updatePermission(item2.pageId, {
972
+ isUpdate: e.target.checked
973
+ });
974
+ }
975
+ }
976
+ ))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
977
+ Checkbox,
978
+ {
979
+ checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
980
+ onChange: (e) => {
981
+ store.updatePermission(item2.pageId, {
982
+ isDelete: e.target.checked
983
+ });
984
+ }
985
+ }
986
+ ))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
987
+ Checkbox,
988
+ {
989
+ checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
990
+ onChange: (e) => {
991
+ store.updatePermission(item2.pageId, {
992
+ isPrint: e.target.checked
993
+ });
994
+ }
995
+ }
996
+ ))), /* @__PURE__ */ React2.createElement(Table.Td, null, /* @__PURE__ */ React2.createElement(MyCenterFull, null, /* @__PURE__ */ React2.createElement(
997
+ Checkbox,
998
+ {
999
+ checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
1000
+ onChange: (e) => {
1001
+ store.updatePermission(item2.pageId, {
1002
+ isExport: e.target.checked
1003
+ });
1004
+ }
1005
+ }
1006
+ ))));
1007
+ }
1008
+ ));
1009
+ }))));
1010
+ }
1011
+ function useGetUserPermission() {
1012
+ const store = useS_core83092();
1013
+ const query = useQuery8({
1014
+ queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
1015
+ queryFn: async () => {
1016
+ const result = await baseAxios_default.get("/Role/GetRolePermission?roleId=" + store.state.roleId);
1017
+ const menudataFinal = utils_layout_getItemsWithoutLinks(menuData);
1018
+ if (result.data.data.length == 0) {
1019
+ const final = menudataFinal.map((item) => ({
1020
+ pageId: item.pageId,
1021
+ isRead: false,
1022
+ isCreate: false,
1023
+ isUpdate: false,
1024
+ isDelete: false,
1025
+ isExport: false,
1026
+ isPrint: false
1027
+ }));
1028
+ return final.filter((item) => item.pageId != void 0);
1029
+ }
1030
+ const menuDataFromAPI = result.data.data;
1031
+ const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
1032
+ pageId: item.pageId,
1033
+ isCreate: item.isCreate || false,
1034
+ isRead: item.isRead || false,
1035
+ isUpdate: item.isUpdate || false || false,
1036
+ isDelete: item.isDelete,
1037
+ isPrint: item.isPrint || false,
1038
+ isExport: item.isExport || false
1039
+ })).filter((item) => item.pageId != void 0);
1040
+ return mergedArray;
1041
+ },
1042
+ enabled: store.state.roleId != 0,
1043
+ refetchOnWindowFocus: false
1044
+ });
1045
+ return query;
1046
+ }
1047
+
1048
+ // src/modules-features/admin/core/core40207/F_core40207_Read.tsx
1049
+ import { useQuery as useQuery9 } from "@tanstack/react-query";
1050
+ import { useMemo as useMemo7 } from "react";
1051
+
1052
+ // src/modules-features/admin/core/core40207/F_core40207_Create.tsx
1053
+ import { FileInput as FileInput3 } from "@mantine/core";
1054
+ import { useForm as useForm11 } from "@mantine/form";
1055
+ function F_core40207_Create() {
1056
+ const form = useForm11({
1057
+ mode: "uncontrolled"
1058
+ });
1059
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
1060
+ return await baseAxios_default.post(
1061
+ "/Document/create",
1062
+ __spreadProps(__spreadValues({}, values), {
1063
+ DocumentType: OBJECT_DOCUMENT_TYPES.Guideline,
1064
+ //1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
1065
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
1066
+ })
1067
+ );
1068
+ } }, /* @__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(FileInput3, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
1069
+ }
1070
+
1071
+ // src/modules-features/admin/core/core40207/F_core40207_Delete.tsx
1072
+ function F_core40207_Delete({ id }) {
1073
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
1074
+ }
1075
+
1076
+ // src/modules-features/admin/core/core40207/F_core40207_Update.tsx
1077
+ import { FileInput as FileInput4 } from "@mantine/core";
1078
+ import { useForm as useForm12 } from "@mantine/form";
1079
+ function F_core40207_Update({ values }) {
1080
+ var _a;
1081
+ const form = useForm12({
1082
+ mode: "uncontrolled",
1083
+ initialValues: __spreadProps(__spreadValues({}, values), {
1084
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
1085
+ promulgateDate: new Date(values.promulgateDate)
1086
+ })
1087
+ });
1088
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
1089
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
1090
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
1091
+ }));
1092
+ } }, /* @__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(FileInput4, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
1093
+ }
1094
+
1095
+ // src/modules-features/admin/core/core40207/F_core40207_Read.tsx
1096
+ function F_core40207_Read() {
1097
+ const query = useQuery9({
1098
+ queryKey: ["F_core40207_Read"],
1099
+ queryFn: async () => {
1100
+ var _a;
1101
+ const result = await baseAxios_default.get(`/Document/GetByType?documentType=${OBJECT_DOCUMENT_TYPES.Guideline}`);
1102
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
1103
+ }
1104
+ });
1105
+ const columns = useMemo7(
1106
+ () => [
1107
+ {
1108
+ header: "M\xE3 t\xE0i li\u1EC7u",
1109
+ accessorKey: "code"
1110
+ },
1111
+ {
1112
+ header: "T\xEAn t\xE0i li\u1EC7u",
1113
+ accessorKey: "name"
1114
+ },
1115
+ {
1116
+ header: "File",
1117
+ accessorFn: (row) => {
1118
+ return /* @__PURE__ */ React.createElement(MyCenterFull, null, /* @__PURE__ */ React.createElement(MyButtonViewPDF, { id: row.id }));
1119
+ }
1120
+ }
1121
+ ],
1122
+ []
1123
+ );
1124
+ if (query.isLoading) return "Loading...";
1125
+ if (query.isError) return "c\xF3 l\u1ED7i x\u1EA3y ra!";
1126
+ return /* @__PURE__ */ React.createElement(
1127
+ MyDataTable,
1128
+ {
1129
+ columns,
1130
+ data: query.data,
1131
+ renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(F_core40207_Create, null),
1132
+ renderRowActions: ({ row }) => {
1133
+ 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 }));
1134
+ }
1135
+ }
1136
+ );
1137
+ }
1138
+
1139
+ // src/modules-features/admin/core/core40207/F_core40207.tsx
1140
+ function F_core40207() {
1141
+ return /* @__PURE__ */ React.createElement(MyPageContent, null, /* @__PURE__ */ React.createElement(F_core40207_Read, null));
1142
+ }
1143
+
1144
+ // src/modules-features/admin/core/core47643/F_core47643_Read.tsx
1145
+ import { Group } from "@mantine/core";
1146
+ import { useQuery as useQuery10 } from "@tanstack/react-query";
1147
+ import { useMemo as useMemo8 } from "react";
1148
+
1149
+ // src/modules-features/admin/core/core47643/F_core47643_Delete.tsx
1150
+ var ENDPOINT = "/Role/Delete";
1151
+ function F_core47643_Delete({ values }) {
1152
+ return /* @__PURE__ */ React.createElement(
1153
+ MyActionIconDelete,
1154
+ {
1155
+ contextData: values.code,
1156
+ onSubmit: () => baseAxios_default.post(ENDPOINT, { id: values.id })
1157
+ }
1158
+ );
1159
+ }
1160
+
1161
+ // src/modules-features/admin/core/core47643/F_core47643_Form.tsx
1162
+ import { useForm as useForm13 } from "@mantine/form";
1163
+ function F_core47643_Form({ values }) {
1164
+ const form = useForm13({
1165
+ mode: "uncontrolled",
1166
+ initialValues: values
1167
+ });
1168
+ if (values) return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async () => {
1169
+ return await baseAxios_default.post("/Role/Update", form.getValues());
1170
+ } }, /* @__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"))));
1171
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { form, onSubmit: async () => {
1172
+ return await baseAxios_default.post("/Role/Create", form.getValues());
1173
+ } }, /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "M\xE3" }, form.getInputProps("code"))), /* @__PURE__ */ React.createElement(MyTextInput, __spreadValues({ label: "Quy\u1EC1n" }, form.getInputProps("name"))));
1174
+ }
1175
+
1176
+ // src/modules-features/admin/core/core47643/F_core47643_Read.tsx
1177
+ function F_core47643_Read() {
1178
+ const query = useQ_core47643_GetAdminRole();
1179
+ const columns = useMemo8(() => [
1180
+ {
1181
+ header: "M\xE3",
1182
+ accessorKey: "code"
1183
+ },
1184
+ {
1185
+ header: "Quy\u1EC1n",
1186
+ accessorKey: "name"
1187
+ }
1188
+ ], []);
1189
+ if (query.isLoading) return "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...";
1190
+ if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
1191
+ return /* @__PURE__ */ React.createElement(
1192
+ MyDataTable,
1193
+ {
1194
+ data: query.data,
1195
+ columns,
1196
+ renderTopToolbarCustomActions: () => /* @__PURE__ */ React.createElement(Group, null, /* @__PURE__ */ React.createElement(F_core47643_Form, null)),
1197
+ 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 }))
1198
+ }
1199
+ );
1200
+ }
1201
+ function useQ_core47643_GetAdminRole() {
1202
+ const query = useQuery10({
1203
+ queryKey: ["useQ_core47643_GetAdminRole"],
1204
+ queryFn: async () => {
1205
+ const res = await baseAxios_default.get("/Role/GetAdminRole");
1206
+ return res.data.data;
1207
+ }
1208
+ });
1209
+ return query;
1210
+ }
1211
+
1212
+ // src/modules-features/admin/core/core47643/F_core47643.tsx
1213
+ function F_core47643() {
1214
+ return /* @__PURE__ */ React.createElement(MyPageContent, { title: "Danh m\u1EE5c quy\u1EC1n", canBack: true }, /* @__PURE__ */ React.createElement(F_core47643_Read, null));
1215
+ }
1216
+
1217
+ // src/modules-features/admin/core/core71678/F_core71678_Read.tsx
1218
+ import { Button as Button2, Group as Group3 } from "@mantine/core";
1219
+ import { IconShield } from "@tabler/icons-react";
1220
+ import { useQuery as useQuery12 } from "@tanstack/react-query";
1221
+ import { useRouter } from "next/navigation";
1222
+ import { useMemo as useMemo10, useState as useState5 } from "react";
1223
+
1224
+ // src/modules-features/admin/core/core71678/F_core71678_ChangePermission.tsx
1225
+ import { Button, Fieldset, Group as Group2, Table as Table2 } from "@mantine/core";
1226
+ import { useDisclosure } from "@mantine/hooks";
1227
+ import { useMutation as useMutation2, useQuery as useQuery11, useQueryClient } from "@tanstack/react-query";
1228
+ import { useEffect as useEffect4, useMemo as useMemo9, useState as useState4 } from "react";
1229
+ function F_core71678_ChangePermission({ user }) {
1230
+ const disc = useDisclosure();
1231
+ const queryClient = useQueryClient();
1232
+ const [rowSelection, setRowSelection] = useState4({});
1233
+ const rowSelect = useState4();
1234
+ const query = useQuery11({
1235
+ queryKey: [`F1_1ChangePermission`],
1236
+ queryFn: async () => {
1237
+ const response = await baseAxios_default.get("/Role/GetAdminRole");
1238
+ return response.data.data;
1239
+ }
1240
+ });
1241
+ const mutation = useMutation2({
1242
+ mutationFn: async (roleIds) => {
1243
+ const res = await baseAxios_default.post("/Role/AddUser?userId=" + user.id, roleIds);
1244
+ return res;
1245
+ }
1246
+ });
1247
+ const permissionColumns = useMemo9(
1248
+ () => [
1249
+ {
1250
+ header: "Quy\u1EC1n",
1251
+ accessorKey: "name"
1252
+ }
1253
+ ],
1254
+ []
1255
+ );
1256
+ function handleSave() {
1257
+ mutation.mutate(Object.keys(rowSelection).map(Number), {
1258
+ onSuccess: () => {
1259
+ utils_notification_show({ crudType: "update" });
1260
+ disc[1].close();
1261
+ queryClient.invalidateQueries();
1262
+ }
1263
+ });
1264
+ }
1265
+ useEffect4(() => {
1266
+ var _a;
1267
+ const result = (_a = user.roles) == null ? void 0 : _a.reduce((acc, item) => {
1268
+ if (item.id !== void 0) {
1269
+ acc[item.id] = true;
1270
+ }
1271
+ return acc;
1272
+ }, {});
1273
+ setRowSelection(result);
1274
+ }, []);
1275
+ 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(
1276
+ Table2,
1277
+ {
1278
+ w: "100%",
1279
+ variant: "vertical",
1280
+ layout: "fixed"
1281
+ },
1282
+ /* @__PURE__ */ React.createElement(Table2.Tbody, null, /* @__PURE__ */ React.createElement(Table2.Tr, null, /* @__PURE__ */ React.createElement(Table2.Th, { w: 160 }, "H\u1ECD v\xE0 t\xEAn:"), /* @__PURE__ */ React.createElement(Table2.Td, null, user.fullName)), /* @__PURE__ */ React.createElement(Table2.Tr, null, /* @__PURE__ */ React.createElement(Table2.Th, null, "T\xEAn \u0111\u0103ng nh\u1EADp:"), /* @__PURE__ */ React.createElement(Table2.Td, null, user.userName)), /* @__PURE__ */ React.createElement(Table2.Tr, null, /* @__PURE__ */ React.createElement(Table2.Th, null, "Email:"), /* @__PURE__ */ React.createElement(Table2.Td, null, user.email)))
1283
+ ), query.isLoading && "\u0110ang t\u1EA3i d\u1EEF li\u1EC7u...", query.isError && "L\u1ED7i khi t\u1EA3i d\u1EEF li\u1EC7u...", /* @__PURE__ */ React.createElement(Fieldset, { legend: "Ch\u1ECDn quy\u1EC1n" }, /* @__PURE__ */ React.createElement(
1284
+ MyDataTable,
1285
+ {
1286
+ enableRowSelection: true,
1287
+ onRowSelectionChange: setRowSelection,
1288
+ state: { rowSelection },
1289
+ setSelectedRow: rowSelect[1],
1290
+ getRowId: (originalRow) => {
1291
+ var _a;
1292
+ return (_a = originalRow.id) == null ? void 0 : _a.toString();
1293
+ },
1294
+ initialState: {
1295
+ density: "xs",
1296
+ pagination: { pageIndex: 0, pageSize: 10 },
1297
+ columnPinning: { right: ["mrt-row-actions"] },
1298
+ columnVisibility: {
1299
+ nguoiCapNhat: false,
1300
+ ngayCapNhat: false
1301
+ }
1302
+ },
1303
+ columns: permissionColumns,
1304
+ data: query.data
1305
+ }
1306
+ )), /* @__PURE__ */ React.createElement(Group2, { justify: "flex-end", mt: 24 }, /* @__PURE__ */ React.createElement(Button, { onClick: handleSave }, "L\u01B0u")));
1307
+ }
1308
+
1309
+ // src/modules-features/admin/core/core71678/F_core71678_Create.tsx
1310
+ import { useForm as useForm14 } from "@mantine/form";
1311
+ var ENDPOINT2 = "/Account/create";
1312
+ function F_core71678_Create() {
1313
+ const form = useForm14({
1314
+ initialValues: {
1315
+ fullName: "",
1316
+ code: "",
1317
+ userName: "",
1318
+ password: "",
1319
+ email: "",
1320
+ phoneNumber: ""
1321
+ },
1322
+ validate: {
1323
+ email: (value) => U0MyValidateEmail(value)
1324
+ }
1325
+ });
1326
+ async function handleSubmit() {
1327
+ return await baseAxios_default.post(ENDPOINT2, __spreadProps(__spreadValues({}, form.getValues()), {
1328
+ passwordHash: "",
1329
+ id: 0,
1330
+ address: "",
1331
+ concurrencyStamp: "",
1332
+ isBlocked: false,
1333
+ isEnabled: true,
1334
+ workingUnitId: void 0,
1335
+ AQModuleId: 1002
1336
+ }));
1337
+ }
1338
+ 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"))));
1339
+ }
1340
+
1341
+ // src/modules-features/admin/core/core71678/F_core71678_Delete.tsx
1342
+ var ENDPOINT3 = "/Account/delete";
1343
+ function F_core71678_Delete({ id, code }) {
1344
+ return /* @__PURE__ */ React.createElement(
1345
+ MyActionIconDelete,
1346
+ {
1347
+ contextData: code,
1348
+ onSubmit: async () => await baseAxios_default.post(ENDPOINT3, { id })
1349
+ }
1350
+ );
1351
+ }
1352
+
1353
+ // src/modules-features/admin/core/core71678/F_core71678_Update.tsx
1354
+ import { useForm as useForm15 } from "@mantine/form";
1355
+ import { useEffect as useEffect5 } from "react";
1356
+ function F_core71678_Update({ user }) {
1357
+ const form = useForm15({
1358
+ initialValues: user
1359
+ });
1360
+ useEffect5(() => {
1361
+ console.log(form.values);
1362
+ }, [form.values]);
1363
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values) => {
1364
+ return await baseAxios_default.post(
1365
+ "/Account/update",
1366
+ __spreadProps(__spreadValues({}, values), {
1367
+ id: values.id,
1368
+ address: "",
1369
+ concurrencyStamp: "",
1370
+ isBlocked: false,
1371
+ isEnabled: true,
1372
+ workingUnitId: null
1373
+ })
1374
+ );
1375
+ } }, /* @__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")))));
1376
+ }
1377
+
1378
+ // src/modules-features/admin/core/core71678/F_core71678_Read.tsx
1379
+ var ENDPOINT4 = "/Account/GetAdminAccount";
1380
+ function F_core71678_Read() {
1381
+ const router = useRouter();
1382
+ const [rowSelection, setRowSelection] = useState5({});
1383
+ const AllUserQuery = useQuery12({
1384
+ queryKey: ["F_core71678_Read"],
1385
+ queryFn: async () => {
1386
+ var _a;
1387
+ const result = await baseAxios_default.get(
1388
+ ENDPOINT4,
1389
+ { params: { page: 5, pageNumber: 1 } }
1390
+ );
1391
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
1392
+ }
1393
+ });
1394
+ const columns = useMemo10(
1395
+ () => [
1396
+ {
1397
+ header: "T\xEAn t\xE0i kho\u1EA3n",
1398
+ accessorKey: "userName"
1399
+ },
1400
+ {
1401
+ header: "H\u1ECD v\xE0 t\xEAn",
1402
+ accessorKey: "fullName"
1403
+ },
1404
+ {
1405
+ header: "Email",
1406
+ accessorKey: "email"
1407
+ },
1408
+ {
1409
+ header: "Quy\u1EC1n",
1410
+ accessorFn: (row) => /* @__PURE__ */ React.createElement(F_core71678_ChangePermission, { user: row })
1411
+ }
1412
+ ],
1413
+ []
1414
+ );
1415
+ if (AllUserQuery.isLoading) return "Loading...";
1416
+ return /* @__PURE__ */ React.createElement(
1417
+ MyDataTable,
1418
+ {
1419
+ columns,
1420
+ data: AllUserQuery.data,
1421
+ renderTopToolbarCustomActions: () => {
1422
+ return /* @__PURE__ */ React.createElement(Group3, null, /* @__PURE__ */ React.createElement(F_core71678_Create, null), /* @__PURE__ */ React.createElement(
1423
+ Button2,
1424
+ {
1425
+ color: "violet",
1426
+ leftSection: /* @__PURE__ */ React.createElement(IconShield, null),
1427
+ onClick: () => {
1428
+ router.push("core47643");
1429
+ }
1430
+ },
1431
+ "Danh m\u1EE5c quy\u1EC1n"
1432
+ ));
1433
+ },
1434
+ renderRowActions: ({ row }) => {
1435
+ 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 }));
1436
+ }
1437
+ }
1438
+ );
1439
+ }
1440
+
1441
+ // src/modules-features/admin/core/core76318/F_core76318_Read.tsx
1442
+ import { useQuery as useQuery13 } from "@tanstack/react-query";
1443
+ import { useMemo as useMemo11 } from "react";
1444
+
1445
+ // src/modules-features/admin/core/core76318/F_core76318_Create.tsx
1446
+ import { FileInput as FileInput5 } from "@mantine/core";
1447
+ import { useForm as useForm16 } from "@mantine/form";
1448
+ function F_core76318_Create() {
1449
+ const form = useForm16({
1450
+ mode: "uncontrolled"
1451
+ });
1452
+ return /* @__PURE__ */ React.createElement(MyButtonCreate, { objectName: "v\u0103n b\u1EA3n", form, onSubmit: async (values) => {
1453
+ return await baseAxios_default.post(
1454
+ "/Document/create",
1455
+ __spreadProps(__spreadValues({}, values), {
1456
+ DocumentType: OBJECT_DOCUMENT_TYPES.Security,
1457
+ //1.4 Thông tin xây dựng, cải tiến, bảo trì hệ thống
1458
+ fileDetail: await utils_file_fileToAQDocumentType(values.file)
1459
+ })
1460
+ );
1461
+ } }, /* @__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(FileInput5, __spreadValues({ label: "T\xE0i li\u1EC7u" }, form.getInputProps("file"))));
1462
+ }
1463
+
1464
+ // src/modules-features/admin/core/core76318/F_core76318_Delete.tsx
1465
+ function F_core76318_Delete({ id }) {
1466
+ return /* @__PURE__ */ React.createElement(MyActionIconDelete, { onSubmit: () => baseAxios_default.post("/Document/delete", { id }) });
1467
+ }
1468
+
1469
+ // src/modules-features/admin/core/core76318/F_core76318_Update.tsx
1470
+ import { FileInput as FileInput6, TextInput as TextInput2 } from "@mantine/core";
1471
+ import { useForm as useForm17 } from "@mantine/form";
1472
+ function F_core76318_Update({ values }) {
1473
+ var _a;
1474
+ const form = useForm17({
1475
+ mode: "uncontrolled",
1476
+ initialValues: __spreadProps(__spreadValues({}, values), {
1477
+ file: new File([], (_a = values.path) == null ? void 0 : _a.split("/")[values.path.split("/").length - 1]),
1478
+ promulgateDate: new Date(values.promulgateDate)
1479
+ })
1480
+ });
1481
+ return /* @__PURE__ */ React.createElement(MyActionIconUpdate, { form, onSubmit: async (values2) => {
1482
+ return await baseAxios_default.post("/Document/Update", __spreadProps(__spreadValues({}, values2), {
1483
+ fileDetail: await utils_file_fileToAQDocumentType(values2.file)
1484
+ }));
1485
+ } }, /* @__PURE__ */ React.createElement(TextInput2, __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(TextInput2, __spreadValues({ label: "T\xEAn t\xE0i li\u1EC7u" }, form.getInputProps("name"))), /* @__PURE__ */ React.createElement(FileInput6, __spreadValues({ label: "Ch\u1ECDn file" }, form.getInputProps("file"))));
1486
+ }
1487
+
1488
+ // src/modules-features/admin/core/core83092/F_core83092.tsx
1489
+ import { Grid as Grid2, Paper as Paper2, ScrollArea as ScrollArea4 } from "@mantine/core";
1490
+
1491
+ // src/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx
1492
+ import { Container as Container2 } from "@mantine/core";
1493
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
1494
+ import { useEffect as useEffect6, useMemo as useMemo12, useState as useState6 } from "react";
1495
+ function F_core83092_ReadUser() {
1496
+ const store = useS_core83092();
1497
+ const query = useQ_core83092_Account_GetAdminAccount();
1498
+ const [rowSelection, setRowSelection] = useState6({});
1499
+ const columns = useMemo12(
1500
+ () => [
1501
+ {
1502
+ header: "H\u1ECD v\xE0 t\xEAn",
1503
+ accessorKey: "fullName",
1504
+ size: 60
1505
+ },
1506
+ {
1507
+ header: "Email",
1508
+ accessorKey: "email"
1509
+ }
1510
+ ],
1511
+ []
1512
+ );
1513
+ const handleRowClick = (rowId) => {
1514
+ setRowSelection({ [rowId]: true });
1515
+ store.setProperty("roleId", parseInt(rowId));
1516
+ };
1517
+ useEffect6(() => {
1518
+ if (store.state.roleId == 0) return;
1519
+ setRowSelection({ [store.state.roleId]: true });
1520
+ }, [store.state.roleId]);
1521
+ useEffect6(() => {
1522
+ if (!query.data) return;
1523
+ store.setProperty("roleId", query.data[0].id);
1524
+ }, [query.data]);
1525
+ if (query.isLoading) return "Loading...";
1526
+ if (query.isError) return "C\xF3 l\u1ED7i x\u1EA3y ra!";
1527
+ return /* @__PURE__ */ React.createElement(Container2, { fluid: true, w: "100%" }, /* @__PURE__ */ React.createElement(
1528
+ MyDataTable,
1529
+ {
1530
+ columns,
1531
+ data: query.data,
1532
+ getRowId: (row) => {
1533
+ var _a;
1534
+ return (_a = row.id) == null ? void 0 : _a.toString();
1535
+ },
1536
+ mantineTableBodyRowProps: ({ row }) => ({
1537
+ onClick: () => handleRowClick(row.id),
1538
+ style: {
1539
+ cursor: "pointer",
1540
+ backgroundColor: rowSelection[row.id] ? "#d0e7ff" : "transparent"
1541
+ }
1542
+ }),
1543
+ state: rowSelection
1544
+ }
1545
+ ));
1546
+ }
1547
+ function useQ_core83092_Account_GetAdminAccount() {
1548
+ const query = useQuery14({
1549
+ queryKey: ["useQ_core83092_Account_GetAdminAccount"],
1550
+ queryFn: async () => {
1551
+ var _a;
1552
+ const result = await baseAxios_default.get(`/Account/GetAdminAccount`, { params: { page: 5, pageNumber: 1 } });
1553
+ return ((_a = result.data) == null ? void 0 : _a.data) || [];
1554
+ },
1555
+ refetchOnWindowFocus: false
1556
+ });
1557
+ return query;
1558
+ }
1559
+
1560
+ // src/modules-features/admin/core/core83092/F_core83092_Save.tsx
1561
+ import { useMutation as useMutation3 } from "@tanstack/react-query";
1562
+ import { useEffect as useEffect7, useState as useState7 } from "react";
1563
+ function F_core83092_Save() {
1564
+ const store = useS_core83092();
1565
+ const disable = useState7(false);
1566
+ const mutation = useMutation3({
1567
+ mutationFn: async (body) => {
1568
+ const res = await baseAxios_default.put("/Role/UpdateUserPermission", body);
1569
+ return res;
1570
+ }
1571
+ });
1572
+ function handleSave() {
1573
+ mutation.mutate({
1574
+ pagePermissions: store.state.rolePermissions,
1575
+ userId: store.state.roleId
1576
+ }, {
1577
+ onSuccess: () => {
1578
+ utils_notification_show({
1579
+ crudType: "update"
1580
+ });
1581
+ }
1582
+ });
1583
+ }
1584
+ useEffect7(() => {
1585
+ if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
1586
+ disable[1](true);
1587
+ return;
1588
+ }
1589
+ disable[1](false);
1590
+ }, [store.state.rolePermissions]);
1591
+ return /* @__PURE__ */ React.createElement(MyButton, { disabled: disable[0], crudType: "save", onClick: handleSave });
1592
+ }
1593
+
1594
+ // src/modules-features/admin/core/core83092/F_core83092_ViewMenuPermissions.tsx
1595
+ import { Checkbox as Checkbox2, Flex as Flex2, ScrollArea as ScrollArea3, Table as Table3, Text as Text2 } from "@mantine/core";
1596
+ import { IconEdit as IconEdit2, IconEyeUp as IconEyeUp2, IconFileExport as IconFileExport2, IconPlus as IconPlus2, IconPrinter as IconPrinter2, IconTrash as IconTrash2 } from "@tabler/icons-react";
1597
+ import { useQuery as useQuery15 } from "@tanstack/react-query";
1598
+ import React3, { useEffect as useEffect8, useState as useState8 } from "react";
1599
+ var title2 = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
1600
+ function F_core83092_ViewMenuPermissions() {
1601
+ var _a, _b;
1602
+ const store = useS_core83092();
1603
+ const query = useGetUserPermission2();
1604
+ const list = useState8([]);
1605
+ useEffect8(() => {
1606
+ list[1](groupToTwoLevels(menuData));
1607
+ }, []);
1608
+ useEffect8(() => {
1609
+ if (!query.data) return;
1610
+ store.setProperty("rolePermissions", query.data);
1611
+ }, [query.data]);
1612
+ if (((_a = list[0]) == null ? void 0 : _a.length) == 0) return "\u0110ang t\u1EA3i...";
1613
+ return /* @__PURE__ */ React3.createElement(ScrollArea3.Autosize, { h: "70vh" }, /* @__PURE__ */ React3.createElement(Table3, null, /* @__PURE__ */ React3.createElement(
1614
+ Table3.Thead,
1615
+ {
1616
+ bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-8))",
1617
+ style: {
1618
+ position: "sticky",
1619
+ top: 0,
1620
+ zIndex: 1,
1621
+ boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",
1622
+ border: "1px solid var(--mantine-color-gray-4)"
1623
+ }
1624
+ },
1625
+ /* @__PURE__ */ React3.createElement(Table3.Tr, null, /* @__PURE__ */ React3.createElement(Table3.Th, null, title2), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isRead"), onChange: (e) => {
1626
+ store.toogleAllPermissionWithType("isRead", e.target.checked);
1627
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "Xem", /* @__PURE__ */ React3.createElement(IconEyeUp2, { color: "gray" })))), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isCreate"), onChange: (e) => {
1628
+ store.toogleAllPermissionWithType("isCreate", e.target.checked);
1629
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "Th\xEAm", /* @__PURE__ */ React3.createElement(IconPlus2, { color: "blue" })))), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isUpdate"), onChange: (e) => {
1630
+ store.toogleAllPermissionWithType("isUpdate", e.target.checked);
1631
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "S\u1EEDa", /* @__PURE__ */ React3.createElement(IconEdit2, { color: "var(--mantine-color-yellow-8)" })))), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isDelete"), onChange: (e) => {
1632
+ store.toogleAllPermissionWithType("isDelete", e.target.checked);
1633
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "X\xF3a", /* @__PURE__ */ React3.createElement(IconTrash2, { color: "var(--mantine-color-red-8)" })))), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isPrint"), onChange: (e) => {
1634
+ store.toogleAllPermissionWithType("isPrint", e.target.checked);
1635
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "In", /* @__PURE__ */ React3.createElement(IconPrinter2, { color: "var(--mantine-color-cyan-8)" })))), /* @__PURE__ */ React3.createElement(Table3.Th, null, /* @__PURE__ */ React3.createElement(Flex2, { gap: 3, direction: "column", justify: "center", align: "center" }, /* @__PURE__ */ React3.createElement(Checkbox2, { checked: store.isAllPermission("isExport"), onChange: (e) => {
1636
+ store.toogleAllPermissionWithType("isExport", e.target.checked);
1637
+ } }), /* @__PURE__ */ React3.createElement(MyFlexRow, { gap: 3 }, "Xu\u1EA5t", /* @__PURE__ */ React3.createElement(IconFileExport2, { color: "var(--mantine-color-green-8)" })))))
1638
+ ), /* @__PURE__ */ React3.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) => {
1639
+ if (item.links == void 0) return /* @__PURE__ */ React3.createElement(Table3.Tr, { key: idx }, /* @__PURE__ */ React3.createElement(Table3.Td, null, item.label), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(Checkbox2, null))));
1640
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, { key: idx }, /* @__PURE__ */ React3.createElement(Table3.Tr, { key: item.label }, /* @__PURE__ */ React3.createElement(
1641
+ Table3.Td,
1642
+ {
1643
+ colSpan: 7,
1644
+ bg: OBJECT_COlORS.mantineBackgroundBlueLight
1645
+ },
1646
+ /* @__PURE__ */ React3.createElement(Text2, { fs: "oblique", size: "sm", fw: "bold" }, item.label)
1647
+ )), item.links.map(
1648
+ (item2, idx2) => {
1649
+ var _a2, _b2, _c, _d, _e, _f;
1650
+ return /* @__PURE__ */ React3.createElement(Table3.Tr, { key: idx2 }, /* @__PURE__ */ React3.createElement(Table3.Td, null, item2.label), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1651
+ Checkbox2,
1652
+ {
1653
+ checked: ((_a2 = store.findByPageId(item2.pageId)) == null ? void 0 : _a2.isRead) || false,
1654
+ onChange: (e) => {
1655
+ store.updatePermission(item2.pageId, {
1656
+ isRead: e.target.checked
1657
+ });
1658
+ }
1659
+ }
1660
+ ))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1661
+ Checkbox2,
1662
+ {
1663
+ checked: ((_b2 = store.findByPageId(item2.pageId)) == null ? void 0 : _b2.isCreate) || false,
1664
+ onChange: (e) => {
1665
+ store.updatePermission(item2.pageId, {
1666
+ isCreate: e.target.checked
1667
+ });
1668
+ }
1669
+ }
1670
+ ))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1671
+ Checkbox2,
1672
+ {
1673
+ checked: ((_c = store.findByPageId(item2.pageId)) == null ? void 0 : _c.isUpdate) || false,
1674
+ onChange: (e) => {
1675
+ store.updatePermission(item2.pageId, {
1676
+ isUpdate: e.target.checked
1677
+ });
1678
+ }
1679
+ }
1680
+ ))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1681
+ Checkbox2,
1682
+ {
1683
+ checked: ((_d = store.findByPageId(item2.pageId)) == null ? void 0 : _d.isDelete) || false,
1684
+ onChange: (e) => {
1685
+ store.updatePermission(item2.pageId, {
1686
+ isDelete: e.target.checked
1687
+ });
1688
+ }
1689
+ }
1690
+ ))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1691
+ Checkbox2,
1692
+ {
1693
+ checked: ((_e = store.findByPageId(item2.pageId)) == null ? void 0 : _e.isPrint) || false,
1694
+ onChange: (e) => {
1695
+ store.updatePermission(item2.pageId, {
1696
+ isPrint: e.target.checked
1697
+ });
1698
+ }
1699
+ }
1700
+ ))), /* @__PURE__ */ React3.createElement(Table3.Td, null, /* @__PURE__ */ React3.createElement(MyCenterFull, null, /* @__PURE__ */ React3.createElement(
1701
+ Checkbox2,
1702
+ {
1703
+ checked: ((_f = store.findByPageId(item2.pageId)) == null ? void 0 : _f.isExport) || false,
1704
+ onChange: (e) => {
1705
+ store.updatePermission(item2.pageId, {
1706
+ isExport: e.target.checked
1707
+ });
1708
+ }
1709
+ }
1710
+ ))));
1711
+ }
1712
+ ));
1713
+ }))));
1714
+ }
1715
+ function useGetUserPermission2() {
1716
+ const store = useS_core83092();
1717
+ const query = useQuery15({
1718
+ queryKey: ["F_7p4mh9d75x_AuthorizationTable", store.state.roleId],
1719
+ queryFn: async () => {
1720
+ const result = await baseAxios_default.get("/Role/GetUserPermission?userId=" + store.state.roleId);
1721
+ const menudataFinal = utils_layout_getItemsWithoutLinks(menuData);
1722
+ if (result.data.data.length == 0) {
1723
+ const final = menudataFinal.map((item) => ({
1724
+ pageId: item.pageId,
1725
+ isRead: false,
1726
+ isCreate: false,
1727
+ isUpdate: false,
1728
+ isDelete: false,
1729
+ isExport: false,
1730
+ isPrint: false
1731
+ }));
1732
+ return final.filter((item) => item.pageId != void 0);
1733
+ }
1734
+ const menuDataFromAPI = result.data.data;
1735
+ const mergedArray = utils_core83092_mergePage(menudataFinal, menuDataFromAPI).map((item) => ({
1736
+ pageId: item.pageId,
1737
+ isCreate: item.isCreate || false,
1738
+ isRead: item.isRead || false,
1739
+ isUpdate: item.isUpdate || false || false,
1740
+ isDelete: item.isDelete,
1741
+ isPrint: item.isPrint || false,
1742
+ isExport: item.isExport || false
1743
+ })).filter((item) => item.pageId != void 0);
1744
+ return mergedArray;
1745
+ },
1746
+ enabled: store.state.roleId != 0,
1747
+ refetchOnWindowFocus: false
1748
+ });
1749
+ return query;
1750
+ }
1751
+
1752
+ // src/modules-features/admin/core/core83092/F_core83092.tsx
1753
+ function F_core83092() {
1754
+ 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(ScrollArea4.Autosize, { h: "100%" }, /* @__PURE__ */ React.createElement(Paper2, { p: "md", bg: OBJECT_COlORS.mantineBackgroundSecondary }, /* @__PURE__ */ React.createElement(F_core83092_ViewMenuPermissions, null))), /* @__PURE__ */ React.createElement(F_core83092_Save, null)))));
1755
+ }
1756
+
1757
+ // src/modules-features/admin/core/MainDashboard/BarChart_CourseStatus.tsx
1758
+ import { BarChart } from "@mantine/charts";
1759
+ import { Group as Group4, Paper as Paper3, Text as Text3, useMantineColorScheme } from "@mantine/core";
1760
+
1761
+ // src/modules-features/admin/core/MainDashboard/BarChart_ExamStatus.tsx
1762
+ import { BarChart as BarChart2 } from "@mantine/charts";
1763
+ import { Group as Group5, Paper as Paper4, Text as Text4, useMantineColorScheme as useMantineColorScheme2 } from "@mantine/core";
1764
+
1765
+ // src/modules-features/admin/core/MainDashboard/BarChart_RevenueByAcademicYear.tsx
1766
+ import { BarChart as BarChart3 } from "@mantine/charts";
1767
+ import { Group as Group6, Paper as Paper5, Text as Text5, useMantineColorScheme as useMantineColorScheme3 } from "@mantine/core";
1768
+
1769
+ // src/modules-features/admin/core/MainDashboard/BarChart_StudentStatusIn30Days.tsx
1770
+ import { BarChart as BarChart4 } from "@mantine/charts";
1771
+ import { Group as Group7, Paper as Paper6, Text as Text6, useMantineColorScheme as useMantineColorScheme4 } from "@mantine/core";
1772
+
1773
+ // src/modules-features/admin/core/MainDashboard/HBarChart_CourseDropOutPercentage.tsx
1774
+ import { BarChart as BarChart5 } from "@mantine/charts";
1775
+ import { Group as Group8, Paper as Paper7, Text as Text7, useMantineColorScheme as useMantineColorScheme5 } from "@mantine/core";
1776
+
1777
+ // src/modules-features/admin/core/MainDashboard/HBarChart_CourseProgressPercentage.tsx
1778
+ import { BarChart as BarChart6 } from "@mantine/charts";
1779
+ import { Group as Group9, Paper as Paper8, Text as Text8, useMantineColorScheme as useMantineColorScheme6 } from "@mantine/core";
1780
+
1781
+ // src/modules-features/admin/core/MainDashboard/LineChart_RevenueIn12Months.tsx
1782
+ import { LineChart } from "@mantine/charts";
1783
+ import { Group as Group10, Paper as Paper9, Text as Text9 } from "@mantine/core";
1784
+
1785
+ // src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByDiscountIn3Months.tsx
1786
+ import { LineChart as LineChart2 } from "@mantine/charts";
1787
+ import { Group as Group11, Paper as Paper10, Text as Text10 } from "@mantine/core";
1788
+
1789
+ // src/modules-features/admin/core/MainDashboard/LineChart_TotalRevenueByVoucherIn3Months.tsx
1790
+ import { LineChart as LineChart3 } from "@mantine/charts";
1791
+ import { Group as Group12, Paper as Paper11, Text as Text11 } from "@mantine/core";
1792
+
1793
+ // src/modules-features/admin/core/MainDashboard/LineChart_TotalStudentIn12Months.tsx
1794
+ import { LineChart as LineChart4 } from "@mantine/charts";
1795
+ import { Group as Group13, Paper as Paper12, Text as Text12 } from "@mantine/core";
1796
+
1797
+ // src/modules-features/admin/core/MainDashboard/ViewDiscountStat.tsx
1798
+ import { Center, Progress, Space, Text as Text13 } from "@mantine/core";
1799
+ import { PieChart } from "@mantine/charts";
1800
+ import { useMemo as useMemo13 } from "react";
1801
+ function getRandomColor(seed) {
1802
+ const random = Math.sin(seed) * 1e4;
1803
+ const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
1804
+ return color;
1805
+ }
1806
+ var data_used_discountCode = [
1807
+ { name: "DSC01", value: 54, color: getRandomColor(1) },
1808
+ { name: "DSC02", value: 32, color: getRandomColor(2) },
1809
+ { name: "DSC03", value: 5, color: getRandomColor(3) },
1810
+ { name: "DSC04", value: 20, color: getRandomColor(4) },
1811
+ { name: "DSC05", value: 12, color: getRandomColor(5) },
1812
+ { name: "DSC06", value: 45, color: getRandomColor(6) },
1813
+ { name: "DSC07", value: 23, color: getRandomColor(7) },
1814
+ { name: "DSC08", value: 34, color: getRandomColor(8) },
1815
+ { name: "DSC09", value: 29, color: getRandomColor(9) },
1816
+ { name: "DSC10", value: 18, color: getRandomColor(10) },
1817
+ { name: "DSC11", value: 37, color: getRandomColor(11) },
1818
+ { name: "DSC12", value: 22, color: getRandomColor(12) },
1819
+ { name: "DSC13", value: 41, color: getRandomColor(13) },
1820
+ { name: "DSC14", value: 27, color: getRandomColor(14) },
1821
+ { name: "DSC15", value: 33, color: getRandomColor(15) },
1822
+ { name: "DSC16", value: 19, color: getRandomColor(16) },
1823
+ { name: "DSC17", value: 25, color: getRandomColor(17) },
1824
+ { name: "DSC18", value: 30, color: getRandomColor(18) },
1825
+ { name: "DSC19", value: 21, color: getRandomColor(19) },
1826
+ { name: "DSC20", value: 26, color: getRandomColor(20) }
1827
+ ];
1828
+ var mockData = [
1829
+ {
1830
+ code: "DSC01",
1831
+ name: "Discount Code 1",
1832
+ total: 100,
1833
+ used: 54,
1834
+ color: getRandomColor(1)
1835
+ },
1836
+ {
1837
+ code: "DSC02",
1838
+ name: "Discount Code 2",
1839
+ total: 150,
1840
+ used: 32,
1841
+ color: getRandomColor(2)
1842
+ },
1843
+ {
1844
+ code: "DSC03",
1845
+ name: "Discount Code 3",
1846
+ total: 10,
1847
+ used: 5,
1848
+ color: getRandomColor(3)
1849
+ },
1850
+ {
1851
+ code: "DSC04",
1852
+ name: "Discount Code 4",
1853
+ total: 100,
1854
+ used: 20,
1855
+ color: getRandomColor(4)
1856
+ },
1857
+ {
1858
+ code: "DSC05",
1859
+ name: "Discount Code 5",
1860
+ total: 100,
1861
+ used: 12,
1862
+ color: getRandomColor(5)
1863
+ },
1864
+ {
1865
+ code: "DSC06",
1866
+ name: "Discount Code 6",
1867
+ total: 100,
1868
+ used: 45,
1869
+ color: getRandomColor(6)
1870
+ },
1871
+ {
1872
+ code: "DSC07",
1873
+ name: "Discount Code 7",
1874
+ total: 100,
1875
+ used: 23,
1876
+ color: getRandomColor(7)
1877
+ },
1878
+ {
1879
+ code: "DSC08",
1880
+ name: "Discount Code 8",
1881
+ total: 100,
1882
+ used: 34,
1883
+ color: getRandomColor(8)
1884
+ },
1885
+ {
1886
+ code: "DSC09",
1887
+ name: "Discount Code 9",
1888
+ total: 100,
1889
+ used: 29,
1890
+ color: getRandomColor(9)
1891
+ },
1892
+ {
1893
+ code: "DSC10",
1894
+ name: "Discount Code 10",
1895
+ total: 100,
1896
+ used: 18,
1897
+ color: getRandomColor(10)
1898
+ },
1899
+ {
1900
+ code: "DSC11",
1901
+ name: "Discount Code 11",
1902
+ total: 100,
1903
+ used: 37,
1904
+ color: getRandomColor(11)
1905
+ },
1906
+ {
1907
+ code: "DSC12",
1908
+ name: "Discount Code 12",
1909
+ total: 100,
1910
+ used: 22,
1911
+ color: getRandomColor(12)
1912
+ },
1913
+ {
1914
+ code: "DSC13",
1915
+ name: "Discount Code 13",
1916
+ total: 100,
1917
+ used: 41,
1918
+ color: getRandomColor(13)
1919
+ },
1920
+ {
1921
+ code: "DSC14",
1922
+ name: "Discount Code 14",
1923
+ total: 100,
1924
+ used: 27,
1925
+ color: getRandomColor(14)
1926
+ },
1927
+ {
1928
+ code: "DSC15",
1929
+ name: "Discount Code 15",
1930
+ total: 100,
1931
+ used: 33,
1932
+ color: getRandomColor(15)
1933
+ },
1934
+ {
1935
+ code: "DSC16",
1936
+ name: "Discount Code 16",
1937
+ total: 100,
1938
+ used: 19,
1939
+ color: getRandomColor(16)
1940
+ },
1941
+ {
1942
+ code: "DSC17",
1943
+ name: "Discount Code 17",
1944
+ total: 100,
1945
+ used: 25,
1946
+ color: getRandomColor(17)
1947
+ },
1948
+ {
1949
+ code: "DSC18",
1950
+ name: "Discount Code 18",
1951
+ total: 100,
1952
+ used: 30,
1953
+ color: getRandomColor(18)
1954
+ },
1955
+ {
1956
+ code: "DSC19",
1957
+ name: "Discount Code 19",
1958
+ total: 100,
1959
+ used: 21,
1960
+ color: getRandomColor(19)
1961
+ },
1962
+ {
1963
+ code: "DSC20",
1964
+ name: "Discount Code 20",
1965
+ total: 100,
1966
+ used: 26,
1967
+ color: getRandomColor(20)
1968
+ }
1969
+ ];
1970
+ function PieChart_DiscountUsedPercentage() {
1971
+ const totalDisountCode = mockData.reduce((acc, cur) => acc + cur.used, 0);
1972
+ const columns = useMemo13(
1973
+ () => [
1974
+ {
1975
+ header: "M\xE0u",
1976
+ accessorKey: "color",
1977
+ accessorFn(originalRow) {
1978
+ return /* @__PURE__ */ React.createElement("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
1979
+ },
1980
+ minSize: 30,
1981
+ maxSize: 30
1982
+ },
1983
+ {
1984
+ header: "M\xE3",
1985
+ accessorKey: "code",
1986
+ minSize: 20,
1987
+ maxSize: 20
1988
+ },
1989
+ {
1990
+ header: "%",
1991
+ accessorKey: "used",
1992
+ accessorFn(originalRow) {
1993
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Text13, null, (originalRow.used / totalDisountCode * 100).toFixed(0), "%")));
1994
+ },
1995
+ minSize: 64,
1996
+ maxSize: 64
1997
+ },
1998
+ {
1999
+ header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
2000
+ accessorKey: "value",
2001
+ accessorFn(originalRow) {
2002
+ return originalRow.used;
2003
+ },
2004
+ Cell: ({ row }) => {
2005
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Text13, 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 }));
2006
+ },
2007
+ minSize: 50,
2008
+ maxSize: 50
2009
+ }
2010
+ ],
2011
+ []
2012
+ );
2013
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Text13, { 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(Center, null, /* @__PURE__ */ React.createElement(
2014
+ PieChart,
2015
+ {
2016
+ startAngle: 90,
2017
+ endAngle: -270,
2018
+ strokeWidth: 0,
2019
+ withLabelsLine: true,
2020
+ labelsPosition: "outside",
2021
+ withLabels: true,
2022
+ labelsType: "percent",
2023
+ data: data_used_discountCode
2024
+ }
2025
+ )), /* @__PURE__ */ React.createElement(Space, { mt: 5 }), /* @__PURE__ */ React.createElement(
2026
+ MyDataTable,
2027
+ {
2028
+ data: mockData,
2029
+ columns,
2030
+ initialState: {
2031
+ density: "xs",
2032
+ pagination: { pageIndex: 0, pageSize: 5 }
2033
+ }
2034
+ }
2035
+ )));
2036
+ }
2037
+
2038
+ // src/modules-features/admin/core/MainDashboard/ViewVoucherStat.tsx
2039
+ import { Center as Center2, Progress as Progress2, Space as Space2, Text as Text14 } from "@mantine/core";
2040
+ import { PieChart as PieChart2 } from "@mantine/charts";
2041
+ import { useMemo as useMemo14 } from "react";
2042
+ function getRandomColor2(seed) {
2043
+ const random = Math.sin(seed) * 1e4;
2044
+ const color = `#${Math.floor((random - Math.floor(random)) * 16777215).toString(16).padStart(6, "0")}`;
2045
+ return color;
2046
+ }
2047
+ var data_used_discountCode2 = [
2048
+ { name: "VOU01", value: 124, color: getRandomColor2(1) },
2049
+ { name: "VOU02", value: 34, color: getRandomColor2(2) },
2050
+ { name: "VOU03", value: 23, color: getRandomColor2(3) },
2051
+ { name: "VOU04", value: 34, color: getRandomColor2(4) },
2052
+ { name: "VOU05", value: 46, color: getRandomColor2(5) },
2053
+ { name: "VOU06", value: 123, color: getRandomColor2(6) },
2054
+ { name: "VOU07", value: 87, color: getRandomColor2(7) },
2055
+ { name: "VOU08", value: 25, color: getRandomColor2(8) },
2056
+ { name: "VOU09", value: 34, color: getRandomColor2(9) },
2057
+ { name: "VOU10", value: 67, color: getRandomColor2(10) },
2058
+ { name: "VOU11", value: 23, color: getRandomColor2(11) },
2059
+ { name: "VOU12", value: 98, color: getRandomColor2(12) },
2060
+ { name: "VOU13", value: 54, color: getRandomColor2(13) },
2061
+ { name: "VOU14", value: 27, color: getRandomColor2(14) },
2062
+ { name: "VOU15", value: 3, color: getRandomColor2(15) },
2063
+ { name: "VOU16", value: 56, color: getRandomColor2(16) },
2064
+ { name: "VOU17", value: 85, color: getRandomColor2(17) },
2065
+ { name: "VOU18", value: 45, color: getRandomColor2(18) },
2066
+ { name: "VOU19", value: 64, color: getRandomColor2(19) },
2067
+ { name: "VOU20", value: 12, color: getRandomColor2(20) }
2068
+ ];
2069
+ var mockData2 = [
2070
+ {
2071
+ code: "VOU01",
2072
+ name: "Voucher Code 1",
2073
+ total: 150,
2074
+ used: 124,
2075
+ color: getRandomColor2(1)
2076
+ },
2077
+ {
2078
+ code: "VOU02",
2079
+ name: "Voucher Code 2",
2080
+ total: 150,
2081
+ used: 34,
2082
+ color: getRandomColor2(2)
2083
+ },
2084
+ {
2085
+ code: "VOU03",
2086
+ name: "Voucher Code 3",
2087
+ total: 50,
2088
+ used: 23,
2089
+ color: getRandomColor2(3)
2090
+ },
2091
+ {
2092
+ code: "VOU04",
2093
+ name: "Voucher Code 4",
2094
+ total: 100,
2095
+ used: 34,
2096
+ color: getRandomColor2(4)
2097
+ },
2098
+ {
2099
+ code: "VOU05",
2100
+ name: "Voucher Code 5",
2101
+ total: 100,
2102
+ used: 46,
2103
+ color: getRandomColor2(5)
2104
+ },
2105
+ {
2106
+ code: "VOU06",
2107
+ name: "Voucher Code 6",
2108
+ total: 130,
2109
+ used: 123,
2110
+ color: getRandomColor2(6)
2111
+ },
2112
+ {
2113
+ code: "VOU07",
2114
+ name: "Voucher Code 7",
2115
+ total: 100,
2116
+ used: 87,
2117
+ color: getRandomColor2(7)
2118
+ },
2119
+ {
2120
+ code: "VOU08",
2121
+ name: "Voucher Code 8",
2122
+ total: 100,
2123
+ used: 25,
2124
+ color: getRandomColor2(8)
2125
+ },
2126
+ {
2127
+ code: "VOU09",
2128
+ name: "Voucher Code 9",
2129
+ total: 100,
2130
+ used: 34,
2131
+ color: getRandomColor2(9)
2132
+ },
2133
+ {
2134
+ code: "VOU10",
2135
+ name: "Voucher Code 10",
2136
+ total: 100,
2137
+ used: 67,
2138
+ color: getRandomColor2(10)
2139
+ },
2140
+ {
2141
+ code: "VOU11",
2142
+ name: "Voucher Code 11",
2143
+ total: 100,
2144
+ used: 23,
2145
+ color: getRandomColor2(11)
2146
+ },
2147
+ {
2148
+ code: "VOU12",
2149
+ name: "Voucher Code 12",
2150
+ total: 100,
2151
+ used: 98,
2152
+ color: getRandomColor2(12)
2153
+ },
2154
+ {
2155
+ code: "VOU13",
2156
+ name: "Voucher Code 13",
2157
+ total: 100,
2158
+ used: 54,
2159
+ color: getRandomColor2(13)
2160
+ },
2161
+ {
2162
+ code: "VOU14",
2163
+ name: "Voucher Code 14",
2164
+ total: 100,
2165
+ used: 27,
2166
+ color: getRandomColor2(14)
2167
+ },
2168
+ {
2169
+ code: "VOU15",
2170
+ name: "Voucher Code 15",
2171
+ total: 100,
2172
+ used: 3,
2173
+ color: getRandomColor2(15)
2174
+ },
2175
+ {
2176
+ code: "VOU16",
2177
+ name: "Voucher Code 16",
2178
+ total: 100,
2179
+ used: 56,
2180
+ color: getRandomColor2(16)
2181
+ },
2182
+ {
2183
+ code: "VOU17",
2184
+ name: "Voucher Code 17",
2185
+ total: 100,
2186
+ used: 85,
2187
+ color: getRandomColor2(17)
2188
+ },
2189
+ {
2190
+ code: "VOU18",
2191
+ name: "Voucher Code 18",
2192
+ total: 100,
2193
+ used: 45,
2194
+ color: getRandomColor2(18)
2195
+ },
2196
+ {
2197
+ code: "VOU19",
2198
+ name: "Voucher Code 19",
2199
+ total: 100,
2200
+ used: 64,
2201
+ color: getRandomColor2(19)
2202
+ },
2203
+ {
2204
+ code: "VOU20",
2205
+ name: "Voucher Code 20",
2206
+ total: 100,
2207
+ used: 12,
2208
+ color: getRandomColor2(20)
2209
+ }
2210
+ ];
2211
+ function PieChart_VoucherUsedPercentage() {
2212
+ const totalVoucherCode = mockData2.reduce((acc, cur) => acc + cur.used, 0);
2213
+ const columns = useMemo14(
2214
+ () => [
2215
+ {
2216
+ header: "M\xE0u",
2217
+ accessorKey: "color",
2218
+ accessorFn(originalRow) {
2219
+ return /* @__PURE__ */ React.createElement("div", { style: { width: 20, height: 20, backgroundColor: originalRow.color } });
2220
+ },
2221
+ minSize: 30,
2222
+ maxSize: 30
2223
+ },
2224
+ {
2225
+ header: "M\xE3",
2226
+ accessorKey: "code",
2227
+ minSize: 20,
2228
+ maxSize: 20
2229
+ },
2230
+ {
2231
+ header: "%",
2232
+ accessorKey: "used",
2233
+ accessorFn(originalRow) {
2234
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center2, null, /* @__PURE__ */ React.createElement(Text14, null, (originalRow.used / totalVoucherCode * 100).toFixed(0), "%")));
2235
+ },
2236
+ minSize: 64,
2237
+ maxSize: 64
2238
+ },
2239
+ {
2240
+ header: "S\u1ED1 l\u01B0\u1EE3ng s\u1EED d\u1EE5ng",
2241
+ accessorKey: "value",
2242
+ accessorFn(originalRow) {
2243
+ return originalRow.used;
2244
+ },
2245
+ Cell: ({ row }) => {
2246
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Center2, null, /* @__PURE__ */ React.createElement(Text14, 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 }));
2247
+ },
2248
+ minSize: 50,
2249
+ maxSize: 50
2250
+ }
2251
+ ],
2252
+ []
2253
+ );
2254
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(MyFlexColumn, null, /* @__PURE__ */ React.createElement(Text14, { 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(Center2, null, /* @__PURE__ */ React.createElement(
2255
+ PieChart2,
2256
+ {
2257
+ startAngle: 90,
2258
+ endAngle: -270,
2259
+ strokeWidth: 0,
2260
+ withLabelsLine: true,
2261
+ labelsPosition: "outside",
2262
+ withLabels: true,
2263
+ labelsType: "percent",
2264
+ data: data_used_discountCode2
2265
+ }
2266
+ )), /* @__PURE__ */ React.createElement(Space2, { mt: 5 }), /* @__PURE__ */ React.createElement(
2267
+ MyDataTable,
2268
+ {
2269
+ data: mockData2,
2270
+ columns,
2271
+ initialState: {
2272
+ density: "xs",
2273
+ pagination: { pageIndex: 0, pageSize: 5 }
2274
+ }
2275
+ }
2276
+ )));
2277
+ }
2278
+ export {
2279
+ F_core12196,
2280
+ F_core12196_Create,
2281
+ F_core12196_Delete,
2282
+ F_core12196_Update,
2283
+ F_core16209,
2284
+ F_core16209_Create,
2285
+ F_core16209_Delete,
2286
+ F_core16209_Update,
2287
+ F_core18256,
2288
+ F_core18256_Create,
2289
+ F_core18256_Delete,
2290
+ F_core18256_Read,
2291
+ F_core18256_Select,
2292
+ F_core18256_Update,
2293
+ F_core26965,
2294
+ F_core26965_Create,
2295
+ F_core26965_Delete,
2296
+ F_core26965_Update,
2297
+ F_core27311,
2298
+ F_core27311_Create,
2299
+ F_core27311_Delete,
2300
+ F_core27311_Read,
2301
+ F_core27311_Update,
2302
+ F_core38677_ReadUser,
2303
+ F_core38677_Save,
2304
+ F_core38677_ViewMenuPermissions,
2305
+ F_core40207,
2306
+ F_core40207_Create,
2307
+ F_core40207_Delete,
2308
+ F_core40207_Read,
2309
+ F_core40207_Update,
2310
+ F_core47643,
2311
+ F_core47643_Delete,
2312
+ F_core47643_Form,
2313
+ F_core47643_Read,
2314
+ F_core71678_ChangePermission,
2315
+ F_core71678_Create,
2316
+ F_core71678_Delete,
2317
+ F_core71678_Read,
2318
+ F_core71678_Update,
2319
+ F_core76318_Create,
2320
+ F_core76318_Delete,
2321
+ F_core76318_Update,
2322
+ F_core83092,
2323
+ F_core83092_ReadUser,
2324
+ F_core83092_Save,
2325
+ F_core83092_ViewMenuPermissions,
2326
+ PieChart_DiscountUsedPercentage,
2327
+ PieChart_VoucherUsedPercentage,
2328
+ useS_core83092,
2329
+ utils_core83092_mergePage
2330
+ };