@feedmepos/mf-hrm-portal 2.1.1-dev.2 → 2.1.1-dev.3
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/ApprovalCodeList-BH5sgVMU.js +638 -0
- package/dist/AuditLogList-Q4L5Te8O.js +1145 -0
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
- package/dist/EmployeeList-GtKmJZbf.js +899 -0
- package/dist/GrantUserList-CnLjOi5_.js +468 -0
- package/dist/Main-Cn7Dawg4.js +120 -0
- package/dist/{Main-B_L5flWT.js → Main-DLlpEU3j.js} +11 -9
- package/dist/{Main-DgemO-iy.js → Main-cskEZ3k_.js} +1033 -1035
- package/dist/PermissionSetList-C2fK2pTz.js +357 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js +3458 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-DbPzVpnG.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +1 -2
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/RoleList-CcuT1ERb.js +567 -0
- package/dist/TeamMemberList-Dfs2iNdC.js +1131 -0
- package/dist/{TimesheetList-C_IMtsTH.js → TimesheetList-B1H_6zfP.js} +136 -141
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-DGwteHIL.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js} +14 -13
- package/dist/{app-BW91YDke.js → app-DX-PG6wx.js} +2725 -5281
- package/dist/app.js +1 -1
- package/dist/approval-code-Q4666xp5.js +58 -0
- package/dist/{dayjs.min-DwQTpnVK.js → dayjs.min-BJrHE7oz.js} +1 -1
- package/dist/{employee-yM0kdY70.js → employee-BJcqtqLM.js} +27 -26
- package/dist/grant-user-CQZaTzVt.js +67 -0
- package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
- package/dist/iteration-Cfaqt-0s.js +7682 -0
- package/dist/{lodash-DLReQyP0.js → lodash-ClKqCmlZ.js} +1 -1
- package/dist/restaurant-YOVMuuFY.js +1876 -0
- package/dist/role-CR_-nBDY.js +82 -0
- package/dist/rule-BB-3S-2R.js +996 -0
- package/dist/src/api/approval-code/index.d.ts +7 -0
- package/dist/src/api/audit-log/index.d.ts +0 -6
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
- package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
- package/dist/src/composables/useBasePermission.d.ts +1 -2
- package/dist/src/helpers/permission-set.d.ts +4 -8
- package/dist/src/helpers/rule.d.ts +1 -2
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +140 -0
- package/dist/src/stores/permission-set.d.ts +3 -12
- package/dist/src/types/approval-code.d.ts +99 -0
- package/dist/src/types/audit-log.d.ts +1 -1
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +17 -0
- package/dist/src/views/approval-code/locales/index.d.ts +320 -0
- package/dist/src/views/audit-log/locales/index.d.ts +0 -296
- package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
- package/dist/src/views/pos-access/locales/index.d.ts +48 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
- package/dist/src/views/team/locales/index.d.ts +0 -72
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useAppStore-DNTlIeMv.js +93 -0
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/{useLoading-B89K5XKO.js → useLoading-BH02lYns.js} +1 -1
- package/dist/{useReportPermissions-Bjfhr6FD.js → useReportPermissions-ybHA26cJ.js} +3 -3
- package/package.json +2 -2
- package/dist/AuditLogList-DHiqs9G0.js +0 -1611
- package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-CWqNWNdD.js +0 -387
- package/dist/EmployeeList-CUd3VH5h.js +0 -884
- package/dist/Main-DUbLeLlK.js +0 -577
- package/dist/PermissionSetList-BaC4lKV5.js +0 -392
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DddOxcG_.js +0 -4121
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
- package/dist/RoleList-CThb6VEd.js +0 -684
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-CAw4jr1b.js +0 -1186
- package/dist/iteration-Dj50K6I7.js +0 -9556
- package/dist/rule-BJ-o-PKi.js +0 -1057
- package/dist/src/composables/useConditionDraft.d.ts +0 -40
- package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
- package/dist/src/helpers/business-timezone.d.ts +0 -22
- package/dist/src/helpers/filter.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
- package/dist/src/views/audit-log/event-line.d.ts +0 -13
- package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
- package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
- package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
- package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
- package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
- package/dist/useAppStore-CHkGWiai.js +0 -169
- package/dist/useDebounce-B8ZPVS5C.js +0 -15
- /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as
|
|
2
|
-
import { d as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { useSnackbar as
|
|
1
|
+
import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as ee, resolveComponent as u, createElementBlock as P, openBlock as _, Fragment as te, createVNode as l, createElementVNode as i, unref as r, withCtx as Y, createCommentVNode as ve, toDisplayString as O, createTextVNode as he, createBlock as z, isRef as ge, renderList as we, nextTick as ye } from "vue";
|
|
2
|
+
import { d as f } from "./dayjs.min-BJrHE7oz.js";
|
|
3
|
+
import { useI18n as be } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as _e, components as xe } from "@feedmepos/ui-library";
|
|
5
5
|
import { S as De, _ as Se } from "./SelectFilter-ATOm0hdn.js";
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { u as Ce } from "./useLoading-
|
|
9
|
-
import {
|
|
10
|
-
import { f as
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
6
|
+
import { _ as ke } from "./app-DX-PG6wx.js";
|
|
7
|
+
import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
|
|
8
|
+
import { u as Ce } from "./useLoading-BH02lYns.js";
|
|
9
|
+
import { g as Fe, s as Ye } from "./iteration-Cfaqt-0s.js";
|
|
10
|
+
import { f as Le } from "./utils-BZkjJbju.js";
|
|
11
|
+
import { u as Me } from "./employee-BJcqtqLM.js";
|
|
12
|
+
import { u as Te } from "./restaurant-YOVMuuFY.js";
|
|
13
|
+
import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js";
|
|
13
14
|
function Ie(x, a) {
|
|
14
15
|
return ["years", "months"].find((S) => {
|
|
15
|
-
const
|
|
16
|
-
return x.isSame(
|
|
16
|
+
const k = x.startOf(S), v = x.endOf(S);
|
|
17
|
+
return x.isSame(k, "day") && a.isSame(v, "day");
|
|
17
18
|
}) || "days";
|
|
18
19
|
}
|
|
19
20
|
function $e() {
|
|
20
21
|
const x = {
|
|
21
|
-
startDate:
|
|
22
|
-
endDate:
|
|
22
|
+
startDate: f().format("YYYY-MM-DD"),
|
|
23
|
+
endDate: f().format("YYYY-MM-DD")
|
|
23
24
|
}, a = d(x), D = g(() => {
|
|
24
25
|
if (!a.value) return "No dates selected.";
|
|
25
|
-
const
|
|
26
|
-
return `${
|
|
26
|
+
const v = a.value.startDate ?? "Start", b = a.value.endDate ?? "End";
|
|
27
|
+
return `${v} - ${b}`;
|
|
27
28
|
}), S = g(() => ({
|
|
28
29
|
startDate: new Date(a.value.startDate),
|
|
29
30
|
endDate: new Date(a.value.endDate)
|
|
30
31
|
}));
|
|
31
|
-
function
|
|
32
|
-
const
|
|
32
|
+
function k(v) {
|
|
33
|
+
const b = f(a.value.startDate), c = f(a.value.endDate), h = Ie(b, c), V = h === "days" ? c.diff(b, "days") + 1 : 1, C = v === "subtract" ? (F) => F.subtract(V, h) : (F) => F.add(V, h);
|
|
33
34
|
a.value = {
|
|
34
|
-
startDate: C(
|
|
35
|
+
startDate: C(b).startOf(h).format("YYYY-MM-DD"),
|
|
35
36
|
endDate: C(c).endOf(h).format("YYYY-MM-DD")
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange:
|
|
39
|
+
return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: k };
|
|
39
40
|
}
|
|
40
41
|
const Ee = {
|
|
41
42
|
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
@@ -70,59 +71,57 @@ const Ee = {
|
|
|
70
71
|
class: "flex items-start gap-8 flex-wrap xs:px-16"
|
|
71
72
|
}, We = {
|
|
72
73
|
class: "flex items-center gap-8"
|
|
73
|
-
}, Xe = {
|
|
74
|
-
class: "flex h-full flex-col overflow-auto"
|
|
75
|
-
}, Ze = /* @__PURE__ */ pe({
|
|
74
|
+
}, Xe = /* @__PURE__ */ pe({
|
|
76
75
|
__name: "TimesheetList",
|
|
77
76
|
setup(x) {
|
|
78
77
|
const {
|
|
79
78
|
t: a
|
|
80
|
-
} =
|
|
79
|
+
} = be(), D = _e(), S = Ce(D), k = [{
|
|
81
80
|
label: a("hr.timesheet.listView"),
|
|
82
81
|
value: "listView"
|
|
83
82
|
}, {
|
|
84
83
|
label: a("hr.timesheet.userView"),
|
|
85
84
|
value: "userView"
|
|
86
|
-
}],
|
|
85
|
+
}], v = d("listView"), b = g(() => {
|
|
87
86
|
var t;
|
|
88
|
-
return (t =
|
|
89
|
-
}), c = d(""), h = Re(),
|
|
87
|
+
return (t = k.find((e) => e.value === v.value)) == null ? void 0 : t.label;
|
|
88
|
+
}), c = d(""), h = Re(), V = Me(), C = Te(), F = g(() => V.employees.value), N = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
|
|
90
89
|
var y;
|
|
91
|
-
const
|
|
90
|
+
const n = (y = C.restaurants.value.find((p) => p._id === s.restaurantId)) == null ? void 0 : y.profile.code, w = F.value.find((p) => p._id === s.user.id);
|
|
92
91
|
return {
|
|
93
92
|
...s,
|
|
94
|
-
restaurantCode:
|
|
93
|
+
restaurantCode: n,
|
|
95
94
|
user: {
|
|
96
95
|
...s.user,
|
|
97
96
|
code: w ? w.code : ""
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
|
-
})),
|
|
99
|
+
})), j = g(() => N.value.filter((t) => {
|
|
101
100
|
var e, s;
|
|
102
101
|
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()));
|
|
103
102
|
})), H = g(() => {
|
|
104
|
-
const t =
|
|
105
|
-
const w = F.value.find((y) => y._id ===
|
|
103
|
+
const t = Fe(N.value, (s) => s.user.name), e = Object.entries(t).map(([s, n]) => {
|
|
104
|
+
const w = F.value.find((y) => y._id === n[0].user.id);
|
|
106
105
|
return {
|
|
107
106
|
key: s,
|
|
108
|
-
user:
|
|
109
|
-
code: w ? w.code :
|
|
110
|
-
timesheets:
|
|
111
|
-
total:
|
|
107
|
+
user: n[0].user.name,
|
|
108
|
+
code: w ? w.code : n[0].user.code || "",
|
|
109
|
+
timesheets: n,
|
|
110
|
+
total: Le(n.reduce((y, p) => y + p.totalMin, 0))
|
|
112
111
|
};
|
|
113
112
|
});
|
|
114
|
-
return
|
|
113
|
+
return Ye(e, {
|
|
115
114
|
selector: "user"
|
|
116
115
|
});
|
|
117
|
-
}),
|
|
116
|
+
}), G = g(() => H.value.filter((t) => {
|
|
118
117
|
var e;
|
|
119
118
|
return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
|
|
120
|
-
})),
|
|
119
|
+
})), L = d(!1), U = async () => {
|
|
121
120
|
const {
|
|
122
121
|
startDate: t,
|
|
123
122
|
endDate: e
|
|
124
|
-
} =
|
|
125
|
-
|
|
123
|
+
} = M.value;
|
|
124
|
+
L.value = !0;
|
|
126
125
|
try {
|
|
127
126
|
await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
|
|
128
127
|
} catch (s) {
|
|
@@ -131,12 +130,12 @@ const Ee = {
|
|
|
131
130
|
type: "error"
|
|
132
131
|
});
|
|
133
132
|
} finally {
|
|
134
|
-
|
|
133
|
+
L.value = !1;
|
|
135
134
|
}
|
|
136
135
|
};
|
|
137
136
|
fe(async () => {
|
|
138
137
|
try {
|
|
139
|
-
await C.readRestaurants(),
|
|
138
|
+
await C.readRestaurants(), V.employees.value.length === 0 && await V.readEmployees();
|
|
140
139
|
} catch (t) {
|
|
141
140
|
console.error("Failed to load timesheet dependencies:", t), D.open({
|
|
142
141
|
message: t instanceof Error ? t.message : String(t),
|
|
@@ -149,11 +148,11 @@ const Ee = {
|
|
|
149
148
|
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
150
149
|
value: t._id
|
|
151
150
|
}))), {
|
|
152
|
-
dateRange:
|
|
151
|
+
dateRange: M,
|
|
153
152
|
dateRangeLabel: oe,
|
|
154
|
-
setRange:
|
|
153
|
+
setRange: q
|
|
155
154
|
} = $e();
|
|
156
|
-
|
|
155
|
+
ee(M, async () => {
|
|
157
156
|
U();
|
|
158
157
|
});
|
|
159
158
|
const se = [{
|
|
@@ -207,8 +206,8 @@ const Ee = {
|
|
|
207
206
|
return l("div", {
|
|
208
207
|
class: "flex items-center gap-8"
|
|
209
208
|
}, [l("div", {
|
|
210
|
-
onClick: (
|
|
211
|
-
|
|
209
|
+
onClick: (n) => {
|
|
210
|
+
n.stopPropagation(), t.row.getToggleExpandedHandler()(n);
|
|
212
211
|
}
|
|
213
212
|
}, [l(xe.FmButton, {
|
|
214
213
|
variant: "tertiary",
|
|
@@ -242,67 +241,67 @@ const Ee = {
|
|
|
242
241
|
return e.total ? `Total: ${e.total}` : e.duration;
|
|
243
242
|
},
|
|
244
243
|
enableSorting: !1
|
|
245
|
-
}],
|
|
246
|
-
function
|
|
247
|
-
|
|
244
|
+
}], T = d(!1);
|
|
245
|
+
function J(t) {
|
|
246
|
+
m.value = t, R.value = f(m.value.startedAt).format("YYYY-MM-DD"), $.value = f(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), I.value = f(m.value.startedAt).format("HH:mm"), E.value = f(m.value.endedAt || m.value.startedAt).format("HH:mm"), T.value = !0;
|
|
248
247
|
}
|
|
249
|
-
const
|
|
250
|
-
async function
|
|
251
|
-
const t =
|
|
252
|
-
if (
|
|
248
|
+
const R = d(), I = d(), $ = d(), E = d(), m = d(), K = d("");
|
|
249
|
+
async function re() {
|
|
250
|
+
const t = Q(R.value, I.value), e = Q($.value, E.value);
|
|
251
|
+
if (f(t).isAfter(e)) {
|
|
253
252
|
K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
254
253
|
return;
|
|
255
254
|
}
|
|
256
255
|
S.minor(async () => {
|
|
257
|
-
await h.updateTimesheet(
|
|
256
|
+
await h.updateTimesheet(m.value, t, e);
|
|
258
257
|
}, {
|
|
259
258
|
successMessage: a("hr.timesheet.update.successMessage")
|
|
260
|
-
}), U(),
|
|
259
|
+
}), U(), T.value = !1;
|
|
261
260
|
}
|
|
262
|
-
const
|
|
263
|
-
return
|
|
264
|
-
(t || e || s ||
|
|
261
|
+
const Q = (t, e) => f(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
|
|
262
|
+
return ee([R, $, I, E], ([t, e, s, n]) => {
|
|
263
|
+
(t || e || s || n) && (K.value = "");
|
|
265
264
|
}), (t, e) => {
|
|
266
|
-
const s = u("FmAvatar"),
|
|
267
|
-
return
|
|
268
|
-
modelValue:
|
|
269
|
-
"onUpdate:modelValue": e[5] || (e[5] = (o) =>
|
|
265
|
+
const s = u("FmAvatar"), n = u("FmDatePicker"), w = u("FmTimePicker"), y = u("FmIcon"), p = u("FmButton"), ne = u("FmSideSheet"), W = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), X = u("FmTable");
|
|
266
|
+
return _(), P(te, null, [l(ne, {
|
|
267
|
+
modelValue: T.value,
|
|
268
|
+
"onUpdate:modelValue": e[5] || (e[5] = (o) => T.value = o),
|
|
270
269
|
"dismiss-away": "",
|
|
271
|
-
header:
|
|
270
|
+
header: r(a)("hr.timesheet.update.title")
|
|
272
271
|
}, {
|
|
273
|
-
"side-sheet-footer":
|
|
274
|
-
label:
|
|
272
|
+
"side-sheet-footer": Y(() => [i("div", qe, [l(p, {
|
|
273
|
+
label: r(a)("common.update"),
|
|
275
274
|
size: "md",
|
|
276
275
|
variant: "primary",
|
|
277
|
-
onClick:
|
|
278
|
-
}, null, 8, ["label"]), l(
|
|
279
|
-
label:
|
|
276
|
+
onClick: re
|
|
277
|
+
}, null, 8, ["label"]), l(p, {
|
|
278
|
+
label: r(a)("common.cancel"),
|
|
280
279
|
size: "md",
|
|
281
280
|
variant: "secondary",
|
|
282
|
-
onClick: e[4] || (e[4] = (o) =>
|
|
281
|
+
onClick: e[4] || (e[4] = (o) => T.value = !1)
|
|
283
282
|
}, null, 8, ["label"])])]),
|
|
284
|
-
default:
|
|
285
|
-
name:
|
|
283
|
+
default: Y(() => [i("div", Ee, [i("div", Oe, [l(s, {
|
|
284
|
+
name: m.value.user.name,
|
|
286
285
|
size: "lg"
|
|
287
|
-
}, null, 8, ["name"]), i("div", Ae, [i("div", Ke, O(
|
|
288
|
-
modelValue:
|
|
289
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) =>
|
|
286
|
+
}, null, 8, ["name"]), i("div", Ae, [i("div", Ke, O(r(a)("hr.timesheet.employeeName")), 1), i("div", ze, O(m.value.user.name), 1)])]), i("div", Ne, [i("div", Ue, O(r(a)("hr.timesheet.update.checkIn")), 1), i("div", Be, [l(n, {
|
|
287
|
+
modelValue: R.value,
|
|
288
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => R.value = o),
|
|
290
289
|
disabled: !1,
|
|
291
|
-
label:
|
|
290
|
+
label: r(a)("hr.timesheet.update.date")
|
|
292
291
|
}, null, 8, ["modelValue", "label"]), l(w, {
|
|
293
|
-
modelValue: R.value,
|
|
294
|
-
"onUpdate:modelValue": e[1] || (e[1] = (o) => R.value = o),
|
|
295
|
-
label: n(a)("hr.timesheet.update.time")
|
|
296
|
-
}, null, 8, ["modelValue", "label"])])]), i("div", Pe, [i("div", je, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", He, [l(r, {
|
|
297
292
|
modelValue: I.value,
|
|
298
|
-
"onUpdate:modelValue": e[
|
|
293
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => I.value = o),
|
|
294
|
+
label: r(a)("hr.timesheet.update.time")
|
|
295
|
+
}, null, 8, ["modelValue", "label"])])]), i("div", Pe, [i("div", je, O(r(a)("hr.timesheet.update.checkOut")), 1), i("div", He, [l(n, {
|
|
296
|
+
modelValue: $.value,
|
|
297
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => $.value = o),
|
|
299
298
|
disabled: !1,
|
|
300
|
-
label:
|
|
299
|
+
label: r(a)("hr.timesheet.update.date")
|
|
301
300
|
}, null, 8, ["modelValue", "label"]), l(w, {
|
|
302
|
-
modelValue:
|
|
303
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) =>
|
|
304
|
-
label:
|
|
305
|
-
}, null, 8, ["modelValue", "label"])])]), K.value ? (
|
|
301
|
+
modelValue: E.value,
|
|
302
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => E.value = o),
|
|
303
|
+
label: r(a)("hr.timesheet.update.time")
|
|
304
|
+
}, null, 8, ["modelValue", "label"])])]), K.value ? (_(), P("div", Ge, [l(y, {
|
|
306
305
|
color: "#FF3B30",
|
|
307
306
|
name: "error",
|
|
308
307
|
size: "sm"
|
|
@@ -314,86 +313,82 @@ const Ee = {
|
|
|
314
313
|
multiple: "",
|
|
315
314
|
items: ae.value,
|
|
316
315
|
variant: "dark",
|
|
317
|
-
"selected-prefix":
|
|
318
|
-
placeholder:
|
|
316
|
+
"selected-prefix": r(a)("hr.role.columns.restaurants"),
|
|
317
|
+
placeholder: r(a)("hr.role.columns.restaurants"),
|
|
319
318
|
class: "!w-auto pt-[3px]"
|
|
320
319
|
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", We, [l(ie, {
|
|
321
|
-
modelValue:
|
|
322
|
-
"onUpdate:modelValue": e[7] || (e[7] = (o) => ge(
|
|
320
|
+
modelValue: r(M),
|
|
321
|
+
"onUpdate:modelValue": e[7] || (e[7] = (o) => ge(M) ? M.value = o : null),
|
|
323
322
|
"show-predefined-range": ""
|
|
324
323
|
}, {
|
|
325
|
-
"trigger-button":
|
|
326
|
-
label:
|
|
324
|
+
"trigger-button": Y(() => [l(W, {
|
|
325
|
+
label: r(oe)
|
|
327
326
|
}, null, 8, ["label"])]),
|
|
328
327
|
_: 1
|
|
329
|
-
}, 8, ["modelValue"]), l(
|
|
328
|
+
}, 8, ["modelValue"]), l(p, {
|
|
330
329
|
icon: "chevron_left",
|
|
331
330
|
variant: "tertiary",
|
|
332
|
-
onClick: e[8] || (e[8] = (o) =>
|
|
333
|
-
}), l(
|
|
331
|
+
onClick: e[8] || (e[8] = (o) => r(q)("subtract"))
|
|
332
|
+
}), l(p, {
|
|
334
333
|
icon: "chevron_right",
|
|
335
334
|
variant: "tertiary",
|
|
336
|
-
onClick: e[9] || (e[9] = (o) =>
|
|
335
|
+
onClick: e[9] || (e[9] = (o) => r(q)("add"))
|
|
337
336
|
})]), l(de, {
|
|
338
337
|
class: "pt-[3px]"
|
|
339
338
|
}, {
|
|
340
|
-
"menu-button":
|
|
341
|
-
label:
|
|
339
|
+
"menu-button": Y(() => [l(W, {
|
|
340
|
+
label: b.value,
|
|
342
341
|
"right-icon": "keyboard_arrow_down"
|
|
343
342
|
}, null, 8, ["label"])]),
|
|
344
|
-
default:
|
|
343
|
+
default: Y(() => [(_(), P(te, null, we(k, (o) => l(ue, {
|
|
345
344
|
key: o.value,
|
|
346
345
|
label: o.label,
|
|
347
|
-
onClick: (
|
|
346
|
+
onClick: (Z) => v.value = o.value
|
|
348
347
|
}, null, 8, ["label", "onClick"])), 64))]),
|
|
349
348
|
_: 1
|
|
350
349
|
}), l(ce), l(me, {
|
|
351
350
|
modelValue: c.value,
|
|
352
351
|
"onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
|
|
353
352
|
class: "w-[320px]",
|
|
354
|
-
placeholder:
|
|
355
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
356
|
-
|
|
353
|
+
placeholder: r(a)("hr.timesheet.search.placeholder")
|
|
354
|
+
}, null, 8, ["modelValue", "placeholder"])]), N.value.length === 0 && !L.value ? (_(), z(r(Ve), {
|
|
355
|
+
key: 0,
|
|
356
|
+
title: r(a)("hr.timesheet.noData.title"),
|
|
357
|
+
subtitle: ""
|
|
358
|
+
}, null, 8, ["title"])) : (_(), z(ke, {
|
|
359
|
+
key: 1,
|
|
360
|
+
class: "w-full xs:px-16 overflow-auto"
|
|
357
361
|
}, {
|
|
358
|
-
default:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
"
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
"pin-header-row": "",
|
|
384
|
-
"shrink-at": !1,
|
|
385
|
-
"expanded-state": B.value,
|
|
386
|
-
"get-sub-row": (o) => o.timesheets,
|
|
387
|
-
"onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
|
|
388
|
-
onRowClick: e[13] || (e[13] = (o) => q(o.original))
|
|
389
|
-
}, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
|
|
390
|
-
_: 1
|
|
391
|
-
}, 8, ["is-loading", "is-empty", "title"])])]),
|
|
362
|
+
default: Y(() => [v.value === "listView" ? (_(), z(X, {
|
|
363
|
+
key: 0,
|
|
364
|
+
class: "min-w-[640px]",
|
|
365
|
+
"column-defs": se,
|
|
366
|
+
"row-data": j.value,
|
|
367
|
+
"page-size": j.value.length,
|
|
368
|
+
loading: L.value,
|
|
369
|
+
"pin-header-row": "",
|
|
370
|
+
"hide-footer": "",
|
|
371
|
+
"shrink-at": !1,
|
|
372
|
+
onRowClick: e[11] || (e[11] = (o) => J(o.original))
|
|
373
|
+
}, null, 8, ["row-data", "page-size", "loading"])) : (_(), z(X, {
|
|
374
|
+
key: 1,
|
|
375
|
+
class: "min-w-[640px] timesheet-user-view",
|
|
376
|
+
"column-defs": le,
|
|
377
|
+
"row-data": G.value,
|
|
378
|
+
"page-size": G.value.reduce((o, Z) => o + 1 + Z.timesheets.length, 0),
|
|
379
|
+
loading: L.value,
|
|
380
|
+
"pin-header-row": "",
|
|
381
|
+
"shrink-at": !1,
|
|
382
|
+
"expanded-state": B.value,
|
|
383
|
+
"get-sub-row": (o) => o.timesheets,
|
|
384
|
+
"onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
|
|
385
|
+
onRowClick: e[13] || (e[13] = (o) => J(o.original))
|
|
386
|
+
}, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
|
|
392
387
|
_: 1
|
|
393
|
-
})])], 64);
|
|
388
|
+
}))])], 64);
|
|
394
389
|
};
|
|
395
390
|
}
|
|
396
|
-
}), mt = /* @__PURE__ */ Se(
|
|
391
|
+
}), mt = /* @__PURE__ */ Se(Xe, [["__scopeId", "data-v-91afda4e"]]);
|
|
397
392
|
export {
|
|
398
393
|
mt as default
|
|
399
394
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { d as i } from "./dayjs.min-
|
|
1
|
+
import { d as i } from "./dayjs.min-BJrHE7oz.js";
|
|
2
2
|
import { defineStore as p, storeToRefs as T } from "pinia";
|
|
3
3
|
import { ref as l } from "vue";
|
|
4
|
-
import { b as c, g as y
|
|
4
|
+
import { b as c, g as y } from "./restaurant-YOVMuuFY.js";
|
|
5
|
+
import { s as S } from "./iteration-Cfaqt-0s.js";
|
|
5
6
|
import { i as f, f as g } from "./utils-BZkjJbju.js";
|
|
6
7
|
const u = {
|
|
7
8
|
async readTimesheets(t, e) {
|
|
@@ -13,10 +14,10 @@ const u = {
|
|
|
13
14
|
};
|
|
14
15
|
function A(t) {
|
|
15
16
|
const e = t.map((n) => {
|
|
16
|
-
const { startedAt: s, endedAt:
|
|
17
|
+
const { startedAt: s, endedAt: r } = n, a = i(f(s)), o = r ? i(f(r)) : null, m = (o == null ? void 0 : o.diff(a, "minute", !1)) || 0, h = o ? g(m) : "", d = "YYYY-MM-DD hh:mm a";
|
|
17
18
|
return {
|
|
18
19
|
...n,
|
|
19
|
-
start:
|
|
20
|
+
start: a.format(d),
|
|
20
21
|
end: o ? o.format(d) : "",
|
|
21
22
|
totalMin: m,
|
|
22
23
|
duration: h
|
|
@@ -26,18 +27,18 @@ function A(t) {
|
|
|
26
27
|
}
|
|
27
28
|
const D = p("timesheet", () => {
|
|
28
29
|
const t = l([]);
|
|
29
|
-
async function e(s,
|
|
30
|
-
const
|
|
30
|
+
async function e(s, r) {
|
|
31
|
+
const a = await u.readTimesheets(
|
|
31
32
|
i(s).startOf("day").toISOString(),
|
|
32
|
-
i(
|
|
33
|
+
i(r).endOf("day").toISOString()
|
|
33
34
|
);
|
|
34
|
-
t.value = A(
|
|
35
|
+
t.value = A(a);
|
|
35
36
|
}
|
|
36
|
-
async function n(s,
|
|
37
|
+
async function n(s, r, a) {
|
|
37
38
|
await u.updateTimesheet(s.restaurantId, {
|
|
38
39
|
id: s._id,
|
|
39
|
-
startAt:
|
|
40
|
-
endAt:
|
|
40
|
+
startAt: r,
|
|
41
|
+
endAt: a
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
return {
|
|
@@ -45,7 +46,7 @@ const D = p("timesheet", () => {
|
|
|
45
46
|
readTimesheet: e,
|
|
46
47
|
updateTimesheet: n
|
|
47
48
|
};
|
|
48
|
-
}),
|
|
49
|
+
}), b = () => {
|
|
49
50
|
const t = D();
|
|
50
51
|
return {
|
|
51
52
|
...t,
|
|
@@ -53,5 +54,5 @@ const D = p("timesheet", () => {
|
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
b as u
|
|
57
58
|
};
|