@feedmepos/mf-hrm-portal 2.0.20-dev.1 → 2.0.20-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuditLogList-Bsj-qg8n.js → AuditLogList-ChxAzO74.js} +4 -4
- package/dist/EmployeeList-Cs-Mn6UA.js +843 -0
- package/dist/{Main-BGc6kNaR.js → Main-B9_TyRDo.js} +2008 -2001
- package/dist/Main-CdHW4UkN.js +90 -0
- package/dist/{Main-CSMAtoMj.js → Main-DcvmP7s-.js} +184 -176
- package/dist/PermissionSetList-VFVS0g0v.js +347 -0
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CdWgTjZw.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js} +771 -770
- package/dist/{RoleList-e0WUqt4Y.js → RoleList-BZ6RZvm2.js} +199 -188
- package/dist/TeamMemberList-C-zhFauD.js +1115 -0
- package/dist/{TimesheetList-tFjvFHqH.js → TimesheetList-CZex54an.js} +61 -53
- package/dist/{app-CL7rUfL3.js → app-CLL3p27X.js} +191 -193
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-ChdFPuFV.js → dayjs.min-CDt1i9vl.js} +1 -1
- package/dist/employee-BpRvjWNh.js +200 -0
- package/dist/{iteration-BbD0nOgO.js → iteration-BVjUzYL5.js} +173 -175
- package/dist/{lodash-CDf3aG6G.js → lodash-CrwgACp2.js} +1 -1
- package/dist/{rule-BJ-y3Sp8.js → rule-BlQ5YZ9Z.js} +27 -26
- package/dist/src/types/team.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{timesheet-BmV02Rkz.js → timesheet-jFs4GTAL.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-D8QAGZ02.js → useAppStore-DMAL8VFY.js} +36 -38
- package/dist/{useLoading-KpcQw0p4.js → useLoading-AFTjRLyO.js} +1 -1
- package/dist/{useReportPermissions-CmGJAz_N.js → useReportPermissions-hODG0Xx3.js} +3 -3
- package/package.json +1 -1
- package/dist/EmployeeList-Cy2ayCko.js +0 -824
- package/dist/Main-D7bV8EuC.js +0 -86
- package/dist/PermissionSetList-CuHhDqWl.js +0 -347
- package/dist/TeamMemberList-CpPa1KyV.js +0 -1097
- package/dist/employee-kKV7UnHU.js +0 -204
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { ref as d, computed as g, defineComponent as me, onMounted as pe, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as _, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as
|
|
2
|
-
import { d as v } from "./dayjs.min-
|
|
3
|
-
import { useI18n as
|
|
1
|
+
import { ref as d, computed as g, defineComponent as me, onMounted as pe, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as _, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as Y, createCommentVNode as ve, toDisplayString as O, createTextVNode as fe, createBlock as N, isRef as he, renderList as ge, nextTick as ye } from "vue";
|
|
2
|
+
import { d as v } from "./dayjs.min-CDt1i9vl.js";
|
|
3
|
+
import { useI18n as we } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as be, components as _e } from "@feedmepos/ui-library";
|
|
5
5
|
import { S as xe } from "./SelectFilter-DUj7GBtT.js";
|
|
6
|
-
import { _ as De } from "./app-
|
|
6
|
+
import { _ as De } from "./app-CLL3p27X.js";
|
|
7
7
|
import { _ as Se } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
8
|
-
import { u as ke } from "./useLoading-
|
|
9
|
-
import { u as Ve, c as Ce, s as Fe } from "./iteration-
|
|
8
|
+
import { u as ke } from "./useLoading-AFTjRLyO.js";
|
|
9
|
+
import { u as Ve, c as Ce, s as Fe } from "./iteration-BVjUzYL5.js";
|
|
10
10
|
import { f as Ye } from "./utils-BZkjJbju.js";
|
|
11
|
-
import { u as Le } from "./employee-
|
|
12
|
-
import { u as Me } from "./timesheet-
|
|
11
|
+
import { u as Le } from "./employee-BpRvjWNh.js";
|
|
12
|
+
import { u as Me } from "./timesheet-jFs4GTAL.js";
|
|
13
13
|
function Te(x, a) {
|
|
14
|
-
return ["years", "months"].find((
|
|
15
|
-
const
|
|
16
|
-
return x.isSame(
|
|
14
|
+
return ["years", "months"].find((S) => {
|
|
15
|
+
const k = x.startOf(S), f = x.endOf(S);
|
|
16
|
+
return x.isSame(k, "day") && a.isSame(f, "day");
|
|
17
17
|
}) || "days";
|
|
18
18
|
}
|
|
19
19
|
function Re() {
|
|
20
20
|
const x = {
|
|
21
21
|
startDate: v().format("YYYY-MM-DD"),
|
|
22
22
|
endDate: v().format("YYYY-MM-DD")
|
|
23
|
-
}, a = d(x),
|
|
23
|
+
}, a = d(x), D = g(() => {
|
|
24
24
|
if (!a.value) return "No dates selected.";
|
|
25
25
|
const f = a.value.startDate ?? "Start", b = a.value.endDate ?? "End";
|
|
26
26
|
return `${f} - ${b}`;
|
|
27
|
-
}),
|
|
27
|
+
}), S = g(() => ({
|
|
28
28
|
startDate: new Date(a.value.startDate),
|
|
29
29
|
endDate: new Date(a.value.endDate)
|
|
30
30
|
}));
|
|
31
|
-
function
|
|
32
|
-
const b = v(a.value.startDate), c = v(a.value.endDate), h = Te(b, c),
|
|
31
|
+
function k(f) {
|
|
32
|
+
const b = v(a.value.startDate), c = v(a.value.endDate), h = Te(b, c), V = h === "days" ? c.diff(b, "days") + 1 : 1, C = f === "subtract" ? (F) => F.subtract(V, h) : (F) => F.add(V, h);
|
|
33
33
|
a.value = {
|
|
34
|
-
startDate:
|
|
35
|
-
endDate:
|
|
34
|
+
startDate: C(b).startOf(h).format("YYYY-MM-DD"),
|
|
35
|
+
endDate: C(c).endOf(h).format("YYYY-MM-DD")
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
return { dateRange: a, parsedDateRange:
|
|
38
|
+
return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: k };
|
|
39
39
|
}
|
|
40
40
|
const $e = {
|
|
41
41
|
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
42
42
|
}, Ie = {
|
|
43
43
|
class: "flex gap-16"
|
|
44
|
-
}, Oe = {
|
|
45
|
-
class: "flex flex-col gap-4"
|
|
46
44
|
}, Ee = {
|
|
45
|
+
class: "flex flex-col gap-4"
|
|
46
|
+
}, Oe = {
|
|
47
47
|
class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
|
|
48
48
|
}, Ae = {
|
|
49
49
|
class: "fm-typo-body-md-700 text-fm-color-typo-primary"
|
|
@@ -75,7 +75,7 @@ const $e = {
|
|
|
75
75
|
setup(x) {
|
|
76
76
|
const {
|
|
77
77
|
t: a
|
|
78
|
-
} =
|
|
78
|
+
} = we(), D = be(), S = ke(D), k = [{
|
|
79
79
|
label: a("hr.timesheet.listView"),
|
|
80
80
|
value: "listView"
|
|
81
81
|
}, {
|
|
@@ -83,16 +83,16 @@ const $e = {
|
|
|
83
83
|
value: "userView"
|
|
84
84
|
}], f = d("listView"), b = g(() => {
|
|
85
85
|
var t;
|
|
86
|
-
return (t =
|
|
87
|
-
}), c = d(""), h = Me(),
|
|
88
|
-
var
|
|
89
|
-
const r = (
|
|
86
|
+
return (t = k.find((e) => e.value === f.value)) == null ? void 0 : t.label;
|
|
87
|
+
}), c = d(""), h = Me(), V = Le(), C = Ve(), F = g(() => V.employees.value), A = g(() => h.timesheets.value.filter((s) => !K.value || K.value.includes(s.restaurantId)).map((s) => {
|
|
88
|
+
var w;
|
|
89
|
+
const r = (w = C.restaurants.value.find((p) => p._id === s.restaurantId)) == null ? void 0 : w.profile.code, y = F.value.find((p) => p._id === s.user.id);
|
|
90
90
|
return {
|
|
91
91
|
...s,
|
|
92
92
|
restaurantCode: r,
|
|
93
93
|
user: {
|
|
94
94
|
...s.user,
|
|
95
|
-
code:
|
|
95
|
+
code: y ? y.code : ""
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
})), j = g(() => A.value.filter((t) => {
|
|
@@ -100,13 +100,13 @@ const $e = {
|
|
|
100
100
|
return t.user.name.toLowerCase().includes(c.value.toLowerCase()) || t.restaurantName.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.restaurantCode) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase())) || ((s = t.user.code) == null ? void 0 : s.toLowerCase().includes(c.value.toLowerCase()));
|
|
101
101
|
})), H = g(() => {
|
|
102
102
|
const t = Ce(A.value, (s) => s.user.name), e = Object.entries(t).map(([s, r]) => {
|
|
103
|
-
const
|
|
103
|
+
const y = F.value.find((w) => w._id === r[0].user.id);
|
|
104
104
|
return {
|
|
105
105
|
key: s,
|
|
106
106
|
user: r[0].user.name,
|
|
107
|
-
code:
|
|
107
|
+
code: y ? y.code : "",
|
|
108
108
|
timesheets: r,
|
|
109
|
-
total: Ye(r.reduce((
|
|
109
|
+
total: Ye(r.reduce((w, p) => w + p.totalMin, 0))
|
|
110
110
|
};
|
|
111
111
|
});
|
|
112
112
|
return Fe(e, {
|
|
@@ -122,9 +122,9 @@ const $e = {
|
|
|
122
122
|
} = M.value;
|
|
123
123
|
L.value = !0;
|
|
124
124
|
try {
|
|
125
|
-
await h.readTimesheet(new Date(t), new Date(e)), await
|
|
125
|
+
await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
|
|
126
126
|
} catch (s) {
|
|
127
|
-
|
|
127
|
+
D.open({
|
|
128
128
|
title: s instanceof Error ? s.message : `${s}`,
|
|
129
129
|
type: "error"
|
|
130
130
|
});
|
|
@@ -133,9 +133,17 @@ const $e = {
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
pe(async () => {
|
|
136
|
-
|
|
136
|
+
try {
|
|
137
|
+
await C.readRestaurants(), V.employees.value.length === 0 && await V.readEmployees();
|
|
138
|
+
} catch (t) {
|
|
139
|
+
console.error("Failed to load timesheet dependencies:", t), D.open({
|
|
140
|
+
message: t instanceof Error ? t.message : String(t),
|
|
141
|
+
type: "error"
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
U();
|
|
137
145
|
});
|
|
138
|
-
const K = d(), te = g(() =>
|
|
146
|
+
const K = d(), te = g(() => C.restaurants.value.filter((t) => t.managable).map((t) => ({
|
|
139
147
|
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
140
148
|
value: t._id
|
|
141
149
|
}))), {
|
|
@@ -234,33 +242,33 @@ const $e = {
|
|
|
234
242
|
enableSorting: !1
|
|
235
243
|
}], T = d(!1);
|
|
236
244
|
function J(t) {
|
|
237
|
-
m.value = t, R.value = v(m.value.startedAt).format("YYYY-MM-DD"), I.value = v(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), $.value = v(m.value.startedAt).format("HH:mm"),
|
|
245
|
+
m.value = t, R.value = v(m.value.startedAt).format("YYYY-MM-DD"), I.value = v(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), $.value = v(m.value.startedAt).format("HH:mm"), E.value = v(m.value.endedAt || m.value.startedAt).format("HH:mm"), T.value = !0;
|
|
238
246
|
}
|
|
239
|
-
const R = d(), $ = d(), I = d(),
|
|
247
|
+
const R = d(), $ = d(), I = d(), E = d(), m = d(), z = d("");
|
|
240
248
|
async function le() {
|
|
241
|
-
const t = Q(R.value, $.value), e = Q(I.value,
|
|
249
|
+
const t = Q(R.value, $.value), e = Q(I.value, E.value);
|
|
242
250
|
if (v(t).isAfter(e)) {
|
|
243
251
|
z.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
244
252
|
return;
|
|
245
253
|
}
|
|
246
|
-
|
|
254
|
+
S.minor(async () => {
|
|
247
255
|
await h.updateTimesheet(m.value, t, e);
|
|
248
256
|
}, {
|
|
249
257
|
successMessage: a("hr.timesheet.update.successMessage")
|
|
250
258
|
}), U(), T.value = !1;
|
|
251
259
|
}
|
|
252
260
|
const Q = (t, e) => v(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
|
|
253
|
-
return Z([R, I, $,
|
|
261
|
+
return Z([R, I, $, E], ([t, e, s, r]) => {
|
|
254
262
|
(t || e || s || r) && (z.value = "");
|
|
255
263
|
}), (t, e) => {
|
|
256
|
-
const s = u("FmAvatar"), r = u("FmDatePicker"),
|
|
264
|
+
const s = u("FmAvatar"), r = u("FmDatePicker"), y = u("FmTimePicker"), w = u("FmIcon"), p = u("FmButton"), ne = u("FmSideSheet"), W = u("FmChip"), re = u("FmDateRangePicker"), ie = u("FmMenuItem"), ue = u("FmMenu"), de = u("FmSpacer"), ce = u("FmSearch"), X = u("FmTable");
|
|
257
265
|
return _(), P(ee, null, [l(ne, {
|
|
258
266
|
modelValue: T.value,
|
|
259
267
|
"onUpdate:modelValue": e[5] || (e[5] = (o) => T.value = o),
|
|
260
268
|
"dismiss-away": "",
|
|
261
269
|
header: n(a)("hr.timesheet.update.title")
|
|
262
270
|
}, {
|
|
263
|
-
"side-sheet-footer":
|
|
271
|
+
"side-sheet-footer": Y(() => [i("div", He, [l(p, {
|
|
264
272
|
label: n(a)("common.update"),
|
|
265
273
|
size: "md",
|
|
266
274
|
variant: "primary",
|
|
@@ -271,32 +279,32 @@ const $e = {
|
|
|
271
279
|
variant: "secondary",
|
|
272
280
|
onClick: e[4] || (e[4] = (o) => T.value = !1)
|
|
273
281
|
}, null, 8, ["label"])])]),
|
|
274
|
-
default:
|
|
282
|
+
default: Y(() => [i("div", $e, [i("div", Ie, [l(s, {
|
|
275
283
|
initials: m.value.user.name,
|
|
276
284
|
size: "lg"
|
|
277
|
-
}, null, 8, ["initials"]), i("div",
|
|
285
|
+
}, null, 8, ["initials"]), i("div", Ee, [i("div", Oe, O(n(a)("hr.timesheet.employeeName")), 1), i("div", Ae, O(m.value.user.name), 1)])]), i("div", Ke, [i("div", ze, O(n(a)("hr.timesheet.update.checkIn")), 1), i("div", Ne, [l(r, {
|
|
278
286
|
modelValue: R.value,
|
|
279
287
|
"onUpdate:modelValue": e[0] || (e[0] = (o) => R.value = o),
|
|
280
288
|
disabled: !1,
|
|
281
289
|
label: n(a)("hr.timesheet.update.date")
|
|
282
|
-
}, null, 8, ["modelValue", "label"]), l(
|
|
290
|
+
}, null, 8, ["modelValue", "label"]), l(y, {
|
|
283
291
|
modelValue: $.value,
|
|
284
292
|
"onUpdate:modelValue": e[1] || (e[1] = (o) => $.value = o),
|
|
285
293
|
label: n(a)("hr.timesheet.update.time")
|
|
286
|
-
}, null, 8, ["modelValue", "label"])])]), i("div", Ue, [i("div", Be,
|
|
294
|
+
}, null, 8, ["modelValue", "label"])])]), i("div", Ue, [i("div", Be, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", Pe, [l(r, {
|
|
287
295
|
modelValue: I.value,
|
|
288
296
|
"onUpdate:modelValue": e[2] || (e[2] = (o) => I.value = o),
|
|
289
297
|
disabled: !1,
|
|
290
298
|
label: n(a)("hr.timesheet.update.date")
|
|
291
|
-
}, null, 8, ["modelValue", "label"]), l(
|
|
292
|
-
modelValue:
|
|
293
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) =>
|
|
299
|
+
}, null, 8, ["modelValue", "label"]), l(y, {
|
|
300
|
+
modelValue: E.value,
|
|
301
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => E.value = o),
|
|
294
302
|
label: n(a)("hr.timesheet.update.time")
|
|
295
|
-
}, null, 8, ["modelValue", "label"])])]), z.value ? (_(), P("div", je, [l(
|
|
303
|
+
}, null, 8, ["modelValue", "label"])])]), z.value ? (_(), P("div", je, [l(w, {
|
|
296
304
|
color: "#FF3B30",
|
|
297
305
|
name: "error",
|
|
298
306
|
size: "sm"
|
|
299
|
-
}), fe(" " +
|
|
307
|
+
}), fe(" " + O(z.value), 1)])) : ve("", !0)])]),
|
|
300
308
|
_: 1
|
|
301
309
|
}, 8, ["modelValue", "header"]), i("div", Ge, [i("div", qe, [l(xe, {
|
|
302
310
|
modelValue: K.value,
|
|
@@ -312,7 +320,7 @@ const $e = {
|
|
|
312
320
|
"onUpdate:modelValue": e[7] || (e[7] = (o) => he(M) ? M.value = o : null),
|
|
313
321
|
"show-predefined-range": ""
|
|
314
322
|
}, {
|
|
315
|
-
"trigger-button":
|
|
323
|
+
"trigger-button": Y(() => [l(W, {
|
|
316
324
|
label: n(ae)
|
|
317
325
|
}, null, 8, ["label"])]),
|
|
318
326
|
_: 1
|
|
@@ -327,11 +335,11 @@ const $e = {
|
|
|
327
335
|
})]), l(ue, {
|
|
328
336
|
class: "pt-[3px]"
|
|
329
337
|
}, {
|
|
330
|
-
"menu-button":
|
|
338
|
+
"menu-button": Y(() => [l(W, {
|
|
331
339
|
label: b.value,
|
|
332
340
|
"right-icon": "keyboard_arrow_down"
|
|
333
341
|
}, null, 8, ["label"])]),
|
|
334
|
-
default:
|
|
342
|
+
default: Y(() => [(_(), P(ee, null, ge(k, (o) => l(ie, {
|
|
335
343
|
key: o.value,
|
|
336
344
|
label: o.label,
|
|
337
345
|
onClick: (Qe) => f.value = o.value
|
|
@@ -350,7 +358,7 @@ const $e = {
|
|
|
350
358
|
key: 1,
|
|
351
359
|
class: "w-full xs:px-16 overflow-auto"
|
|
352
360
|
}, {
|
|
353
|
-
default:
|
|
361
|
+
default: Y(() => [f.value === "listView" ? (_(), N(X, {
|
|
354
362
|
key: 0,
|
|
355
363
|
class: "min-w-[640px]",
|
|
356
364
|
"column-defs": oe,
|