@feedmepos/mf-hrm-portal 2.3.2-dev.5 → 2.3.2-dev.6
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-NYJNwdDZ.js → ApprovalCodeList-ix9OeJEQ.js} +7 -7
- package/dist/{AuditLogList-Ghn4aBnn.js → AuditLogList-D5H_O9Q0.js} +5 -5
- package/dist/{ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BxZ9t3MZ.js → ConditionBuilderForm.vue_vue_type_script_setup_true_lang-CuELLYY4.js} +10 -10
- package/dist/{EmployeeList-jc8LTznV.js → EmployeeList-DICzZjVM.js} +8 -8
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-DLgm6oCz.js → FormSection.vue_vue_type_script_setup_true_lang-BQzSWAqC.js} +1 -1
- package/dist/{GrantUserList-BtPTpypR.js → GrantUserList-DoMN7Eks.js} +8 -8
- package/dist/{Main-McMZU_cR.js → Main-CHIExpOV.js} +5 -5
- package/dist/{Main-BizCV-_x.js → Main-CQ42sYi9.js} +11 -11
- package/dist/{Main-BF8hlYeV.js → Main-DwYh9cxQ.js} +10 -10
- package/dist/{MyPosProfile-BjeCnBvL.js → MyPosProfile-DaUdREQX.js} +1 -1
- package/dist/{PermissionSetList-NWLoqFHC.js → PermissionSetList-B7WM9N-p.js} +66 -66
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BSVtyLlL.js +4207 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-nwpdr7T7.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-C7fnnbme.js} +19 -19
- package/dist/{RoleForm.vue_vue_type_script_setup_true_lang-eT-dPsOX.js → RoleForm.vue_vue_type_script_setup_true_lang-AbQIllkX.js} +30 -30
- package/dist/{RoleList-CIfN10zu.js → RoleList-vQsHxlNc.js} +96 -105
- package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CMTXC_UR.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-D52LhvGG.js} +1 -1
- package/dist/{ScheduleGeneralPage-8vS1DUrk.js → ScheduleGeneralPage-BLqh7jH6.js} +2 -2
- package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-Br4AcF1g.js → ScheduleModal.vue_vue_type_script_setup_true_lang-C9doSgov.js} +4 -4
- package/dist/{SchedulePage-DqbE1PoV.js → SchedulePage-YADV_6w9.js} +9 -9
- package/dist/{SchedulePositionPage-DUnkT0Tp.js → SchedulePositionPage-BowDQMG_.js} +3 -3
- package/dist/{SelectFilter-voMj4_j1.js → SelectFilter-CBp1qxLd.js} +2 -3
- package/dist/{TeamMemberList-DoEOWNDC.js → TeamMemberList-BoJ87moU.js} +184 -184
- package/dist/TimesheetList-BULw75oo.js +401 -0
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-h-bWBmpI.js → TimesheetList.vue_vue_type_style_index_0_scoped_c98b0b84_lang-VlnjH9aQ.js} +3 -3
- package/dist/{app-CDCO87ji.js → app-DOFDND9j.js} +5444 -4624
- package/dist/app.js +1 -1
- package/dist/{approval-code-CLE9s5dL.js → approval-code-Dgj6S82q.js} +1 -1
- package/dist/{dayjs.min-BW6-XAUB.js → dayjs.min-AoirQCgL.js} +1 -1
- package/dist/{employee-BaCU-FLC.js → employee-VB6YmuSS.js} +5 -5
- package/dist/{grant-user-DMtilLJx.js → grant-user-C-ptrq7l.js} +1 -1
- package/dist/{iteration-CPLGGFBb.js → iteration-DmuDXP8U.js} +1 -1
- package/dist/{lodash-snXoiw60.js → lodash-CBFO-xTu.js} +1 -1
- package/dist/member-grant-CHOB8eQ_.js +54 -0
- package/dist/restaurant-DH2Fxzi7.js +52 -0
- package/dist/role-DUpHwRiY.js +97 -0
- package/dist/rule-aUPH1VOW.js +842 -0
- package/dist/src/helpers/permission-set.d.ts +1 -102
- package/dist/src/helpers/rule.d.ts +2 -2
- package/dist/src/stores/restaurant.d.ts +61 -1
- package/dist/src/views/audit-log/locales/index.d.ts +12 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-pKAGQL6q.js → useAppStore-DwmJbpf-.js} +1 -1
- package/dist/{useLoading-D67DIqfk.js → useLoading-Dmlm4oSU.js} +1 -1
- package/dist/{useReportPermissions-CfgnE0NY.js → useReportPermissions-XPn-p57R.js} +5 -5
- package/package.json +3 -3
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-UPcpeVD5.js +0 -4243
- package/dist/TimesheetList-BBv2SV96.js +0 -402
- package/dist/member-grant-CJyOr-q0.js +0 -55
- package/dist/restaurant-BMlLIUqe.js +0 -51
- package/dist/role-DqcBOWHL.js +0 -93
- package/dist/rule-B5YNhGJ4.js +0 -788
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
import { ref as d, computed as g, defineComponent as pe, onMounted as fe, watch as Z, resolveComponent as u, createElementBlock as P, openBlock as E, Fragment as ee, createVNode as l, createElementVNode as i, unref as n, withCtx as b, createCommentVNode as ve, toDisplayString as O, createTextVNode as he, isRef as ge, renderList as we, createBlock as te, nextTick as ye } from "vue";
|
|
2
|
-
import { d as v } from "./dayjs.min-BW6-XAUB.js";
|
|
3
|
-
import { useI18n as _e } from "@feedmepos/mf-common";
|
|
4
|
-
import { useSnackbar as be, components as xe } from "@feedmepos/ui-library";
|
|
5
|
-
import { S as De } from "./SelectFilter-voMj4_j1.js";
|
|
6
|
-
import { _ as Se, a as Ve } from "./app-CDCO87ji.js";
|
|
7
|
-
import { _ as ke } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
|
|
8
|
-
import { u as Ce } from "./useLoading-D67DIqfk.js";
|
|
9
|
-
import { g as Fe, s as Ye } from "./iteration-CPLGGFBb.js";
|
|
10
|
-
import { f as Le } from "./utils-BZkjJbju.js";
|
|
11
|
-
import { n as Me } from "./string-DZQ1uNjn.js";
|
|
12
|
-
import { u as Te } from "./employee-BaCU-FLC.js";
|
|
13
|
-
import { u as Ie } from "./restaurant-BMlLIUqe.js";
|
|
14
|
-
import { u as Re } from "./TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-h-bWBmpI.js";
|
|
15
|
-
function $e(x, a) {
|
|
16
|
-
return ["years", "months"].find((S) => {
|
|
17
|
-
const V = x.startOf(S), p = x.endOf(S);
|
|
18
|
-
return x.isSame(V, "day") && a.isSame(p, "day");
|
|
19
|
-
}) || "days";
|
|
20
|
-
}
|
|
21
|
-
function Ee() {
|
|
22
|
-
const x = {
|
|
23
|
-
startDate: v().format("YYYY-MM-DD"),
|
|
24
|
-
endDate: v().format("YYYY-MM-DD")
|
|
25
|
-
}, a = d(x), D = g(() => {
|
|
26
|
-
if (!a.value) return "No dates selected.";
|
|
27
|
-
const p = a.value.startDate ?? "Start", _ = a.value.endDate ?? "End";
|
|
28
|
-
return `${p} - ${_}`;
|
|
29
|
-
}), S = g(() => ({
|
|
30
|
-
startDate: new Date(a.value.startDate),
|
|
31
|
-
endDate: new Date(a.value.endDate)
|
|
32
|
-
}));
|
|
33
|
-
function V(p) {
|
|
34
|
-
const _ = v(a.value.startDate), c = v(a.value.endDate), h = $e(_, c), k = h === "days" ? c.diff(_, "days") + 1 : 1, C = p === "subtract" ? (F) => F.subtract(k, h) : (F) => F.add(k, h);
|
|
35
|
-
a.value = {
|
|
36
|
-
startDate: C(_).startOf(h).format("YYYY-MM-DD"),
|
|
37
|
-
endDate: C(c).endOf(h).format("YYYY-MM-DD")
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
return { dateRange: a, parsedDateRange: S, dateRangeLabel: D, setRange: V };
|
|
41
|
-
}
|
|
42
|
-
const Oe = {
|
|
43
|
-
class: "my-16 flex w-[350px] flex-col gap-40"
|
|
44
|
-
}, Ae = {
|
|
45
|
-
class: "flex gap-16"
|
|
46
|
-
}, Ke = {
|
|
47
|
-
class: "flex flex-col gap-4"
|
|
48
|
-
}, ze = {
|
|
49
|
-
class: "fm-typo-body-md-400 text-fm-color-typo-secondary"
|
|
50
|
-
}, Ne = {
|
|
51
|
-
class: "fm-typo-body-md-700 text-fm-color-typo-primary"
|
|
52
|
-
}, Ue = {
|
|
53
|
-
class: "flex flex-col gap-8"
|
|
54
|
-
}, Be = {
|
|
55
|
-
class: "fm-typo-body-xl-700"
|
|
56
|
-
}, Pe = {
|
|
57
|
-
class: "flex flex-col gap-24"
|
|
58
|
-
}, je = {
|
|
59
|
-
class: "flex flex-col gap-8"
|
|
60
|
-
}, He = {
|
|
61
|
-
class: "fm-typo-body-xl-700"
|
|
62
|
-
}, Ge = {
|
|
63
|
-
class: "flex flex-col gap-24"
|
|
64
|
-
}, qe = {
|
|
65
|
-
key: 0,
|
|
66
|
-
class: "fm-typo-body-sm-400 text-fm-color-typo-error mt-1 flex items-center gap-4"
|
|
67
|
-
}, Je = {
|
|
68
|
-
class: "flex items-center justify-start gap-8"
|
|
69
|
-
}, Qe = {
|
|
70
|
-
class: "space-y-8"
|
|
71
|
-
}, We = {
|
|
72
|
-
class: "flex items-start gap-8 flex-wrap xs:px-16"
|
|
73
|
-
}, Xe = {
|
|
74
|
-
class: "flex items-center gap-8"
|
|
75
|
-
}, Ze = {
|
|
76
|
-
class: "flex h-full flex-col overflow-auto"
|
|
77
|
-
}, et = /* @__PURE__ */ pe({
|
|
78
|
-
__name: "TimesheetList",
|
|
79
|
-
setup(x) {
|
|
80
|
-
const {
|
|
81
|
-
t: a
|
|
82
|
-
} = _e(), D = be(), S = Ce(D), V = [{
|
|
83
|
-
label: a("hr.timesheet.listView"),
|
|
84
|
-
value: "listView"
|
|
85
|
-
}, {
|
|
86
|
-
label: a("hr.timesheet.userView"),
|
|
87
|
-
value: "userView"
|
|
88
|
-
}], p = d("listView"), _ = g(() => {
|
|
89
|
-
var t;
|
|
90
|
-
return (t = V.find((e) => e.value === p.value)) == null ? void 0 : t.label;
|
|
91
|
-
}), c = d(""), h = Re(), k = Te(), C = Ie(), F = g(() => k.employees.value), j = g(() => h.timesheets.value.filter((s) => !A.value || A.value.includes(s.restaurantId)).map((s) => {
|
|
92
|
-
var y;
|
|
93
|
-
const r = (y = C.restaurants.value.find((f) => f._id === s.restaurantId)) == null ? void 0 : y.profile.code, w = F.value.find((f) => f._id === s.user.id);
|
|
94
|
-
return {
|
|
95
|
-
...s,
|
|
96
|
-
restaurantCode: r,
|
|
97
|
-
user: {
|
|
98
|
-
...s.user,
|
|
99
|
-
code: w ? w.code : ""
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
})), z = g(() => j.value.filter((t) => {
|
|
103
|
-
var e, s;
|
|
104
|
-
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()));
|
|
105
|
-
})), H = g(() => {
|
|
106
|
-
const t = Fe(j.value, (s) => s.user.name), e = Object.entries(t).map(([s, r]) => {
|
|
107
|
-
const w = F.value.find((y) => y._id === r[0].user.id);
|
|
108
|
-
return {
|
|
109
|
-
key: s,
|
|
110
|
-
user: r[0].user.name,
|
|
111
|
-
code: w ? w.code : r[0].user.code || "",
|
|
112
|
-
timesheets: r,
|
|
113
|
-
total: Le(r.reduce((y, f) => y + f.totalMin, 0))
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
return Ye(e, {
|
|
117
|
-
selector: "user"
|
|
118
|
-
});
|
|
119
|
-
}), N = g(() => H.value.filter((t) => {
|
|
120
|
-
var e;
|
|
121
|
-
return t.user.toLowerCase().includes(c.value.toLowerCase()) || ((e = t.code) == null ? void 0 : e.toLowerCase().includes(c.value.toLowerCase()));
|
|
122
|
-
})), Y = d(!1), U = async () => {
|
|
123
|
-
const {
|
|
124
|
-
startDate: t,
|
|
125
|
-
endDate: e
|
|
126
|
-
} = L.value;
|
|
127
|
-
Y.value = !0;
|
|
128
|
-
try {
|
|
129
|
-
await h.readTimesheet(new Date(t), new Date(e)), await ye(), B.value = Object.fromEntries(Object.entries(new Array(H.value.length).fill(!0)));
|
|
130
|
-
} catch (s) {
|
|
131
|
-
D.open({
|
|
132
|
-
title: s instanceof Error ? s.message : `${s}`,
|
|
133
|
-
type: "error"
|
|
134
|
-
});
|
|
135
|
-
} finally {
|
|
136
|
-
Y.value = !1;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
fe(async () => {
|
|
140
|
-
try {
|
|
141
|
-
await C.readRestaurants(), k.employees.value.length === 0 && await k.readEmployees();
|
|
142
|
-
} catch (t) {
|
|
143
|
-
console.error("Failed to load timesheet dependencies:", t), D.open({
|
|
144
|
-
message: t instanceof Error ? t.message : String(t),
|
|
145
|
-
type: "error"
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
U();
|
|
149
|
-
});
|
|
150
|
-
const A = d(), ae = g(() => C.restaurants.value.filter((t) => t.managable).map((t) => ({
|
|
151
|
-
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
152
|
-
value: t._id
|
|
153
|
-
}))), {
|
|
154
|
-
dateRange: L,
|
|
155
|
-
dateRangeLabel: oe,
|
|
156
|
-
setRange: G
|
|
157
|
-
} = Ee();
|
|
158
|
-
Z(L, async () => {
|
|
159
|
-
U();
|
|
160
|
-
});
|
|
161
|
-
const se = [{
|
|
162
|
-
accessorKey: "user.code",
|
|
163
|
-
size: 100,
|
|
164
|
-
header: () => a("hr.employee.columns.code"),
|
|
165
|
-
cell: (t) => t.row.original.user.code || "--",
|
|
166
|
-
enableSorting: !0
|
|
167
|
-
}, {
|
|
168
|
-
accessorKey: "user",
|
|
169
|
-
header: () => a("hr.timesheet.columns.name"),
|
|
170
|
-
cell: (t) => t.row.original.user.name,
|
|
171
|
-
enableSorting: !1
|
|
172
|
-
}, {
|
|
173
|
-
accessorKey: "restaurantName",
|
|
174
|
-
header: () => a("hr.timesheet.columns.restaurant"),
|
|
175
|
-
cell: (t) => {
|
|
176
|
-
const e = t.row.original.restaurantCode, s = t.row.original.restaurantName;
|
|
177
|
-
return `${e ? e + " - " : ""}${s}`;
|
|
178
|
-
},
|
|
179
|
-
enableSorting: !0
|
|
180
|
-
}, {
|
|
181
|
-
accessorKey: "start",
|
|
182
|
-
header: () => a("hr.timesheet.columns.start"),
|
|
183
|
-
cell: (t) => t.row.original.start || "--",
|
|
184
|
-
enableSorting: !0
|
|
185
|
-
}, {
|
|
186
|
-
accessorKey: "end",
|
|
187
|
-
header: () => a("hr.timesheet.columns.end"),
|
|
188
|
-
cell: (t) => t.row.original.end || "--",
|
|
189
|
-
enableSorting: !0
|
|
190
|
-
}, {
|
|
191
|
-
name: "duration",
|
|
192
|
-
accessorKey: "duration",
|
|
193
|
-
header: () => a("hr.timesheet.columns.duration"),
|
|
194
|
-
cell: (t) => t.row.original.duration || "--",
|
|
195
|
-
enableSorting: !0
|
|
196
|
-
}], B = d({}), le = [{
|
|
197
|
-
accessorKey: "code",
|
|
198
|
-
size: 100,
|
|
199
|
-
header: () => a("hr.employee.columns.code"),
|
|
200
|
-
cell: (t) => t.row.original.code,
|
|
201
|
-
enableSorting: !1
|
|
202
|
-
}, {
|
|
203
|
-
accessorKey: "user",
|
|
204
|
-
header: () => a("hr.timesheet.columns.name"),
|
|
205
|
-
cell: (t) => {
|
|
206
|
-
const e = t.row.original;
|
|
207
|
-
if (typeof e.user == "string") {
|
|
208
|
-
const s = t.row.getIsExpanded();
|
|
209
|
-
return l("div", {
|
|
210
|
-
class: "flex items-center gap-8"
|
|
211
|
-
}, [l("div", {
|
|
212
|
-
onClick: (r) => {
|
|
213
|
-
r.stopPropagation(), t.row.getToggleExpandedHandler()(r);
|
|
214
|
-
}
|
|
215
|
-
}, [l(xe.FmButton, {
|
|
216
|
-
variant: "tertiary",
|
|
217
|
-
icon: s ? "keyboard_arrow_up" : "keyboard_arrow_down"
|
|
218
|
-
}, null)]), e.user]);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
enableSorting: !1
|
|
222
|
-
}, {
|
|
223
|
-
accessorKey: "start",
|
|
224
|
-
header: () => a("hr.timesheet.columns.start"),
|
|
225
|
-
cell: (t) => {
|
|
226
|
-
const e = t.row.original;
|
|
227
|
-
return (e == null ? void 0 : e.start) || "--";
|
|
228
|
-
},
|
|
229
|
-
enableSorting: !1
|
|
230
|
-
}, {
|
|
231
|
-
accessorKey: "end",
|
|
232
|
-
header: () => a("hr.timesheet.columns.end"),
|
|
233
|
-
cell: (t) => {
|
|
234
|
-
const e = t.row.original;
|
|
235
|
-
return (e == null ? void 0 : e.end) || "--";
|
|
236
|
-
},
|
|
237
|
-
enableSorting: !1
|
|
238
|
-
}, {
|
|
239
|
-
name: "duration",
|
|
240
|
-
accessorKey: "duration",
|
|
241
|
-
header: () => a("hr.timesheet.columns.hourMinute"),
|
|
242
|
-
cell: (t) => {
|
|
243
|
-
const e = t.row.original;
|
|
244
|
-
return e.total ? `Total: ${e.total}` : e.duration;
|
|
245
|
-
},
|
|
246
|
-
enableSorting: !1
|
|
247
|
-
}], M = d(!1);
|
|
248
|
-
function q(t) {
|
|
249
|
-
m.value = t, T.value = v(m.value.startedAt).format("YYYY-MM-DD"), R.value = v(m.value.endedAt || m.value.startedAt).format("YYYY-MM-DD"), I.value = v(m.value.startedAt).format("HH:mm"), $.value = v(m.value.endedAt || m.value.startedAt).format("HH:mm"), M.value = !0;
|
|
250
|
-
}
|
|
251
|
-
const T = d(), I = d(), R = d(), $ = d(), m = d(), K = d("");
|
|
252
|
-
async function ne() {
|
|
253
|
-
const t = J(T.value, I.value), e = J(R.value, $.value);
|
|
254
|
-
if (v(t).isAfter(e)) {
|
|
255
|
-
K.value = a("hr.timesheet.checkOutMustBeforeCheckIn");
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
S.minor(async () => {
|
|
259
|
-
await h.updateTimesheet(m.value, t, e);
|
|
260
|
-
}, {
|
|
261
|
-
successMessage: a("hr.timesheet.update.successMessage")
|
|
262
|
-
}), U(), M.value = !1;
|
|
263
|
-
}
|
|
264
|
-
const J = (t, e) => v(t).set("h", parseInt(e.split(":")[0])).set("m", parseInt(e.split(":")[1])).toISOString();
|
|
265
|
-
return Z([T, R, I, $], ([t, e, s, r]) => {
|
|
266
|
-
(t || e || s || r) && (K.value = "");
|
|
267
|
-
}), (t, e) => {
|
|
268
|
-
const s = u("FmAvatar"), r = u("FmDatePicker"), w = u("FmTimePicker"), y = u("FmIcon"), f = u("FmButton"), re = u("FmSideSheet"), Q = u("FmChip"), ie = u("FmDateRangePicker"), ue = u("FmMenuItem"), de = u("FmMenu"), ce = u("FmSpacer"), me = u("FmSearch"), W = u("FmTable");
|
|
269
|
-
return E(), P(ee, null, [l(re, {
|
|
270
|
-
modelValue: M.value,
|
|
271
|
-
"onUpdate:modelValue": e[5] || (e[5] = (o) => M.value = o),
|
|
272
|
-
"dismiss-away": "",
|
|
273
|
-
header: n(a)("hr.timesheet.update.title")
|
|
274
|
-
}, {
|
|
275
|
-
"side-sheet-footer": b(() => [i("div", Je, [l(f, {
|
|
276
|
-
label: n(a)("common.update"),
|
|
277
|
-
size: "md",
|
|
278
|
-
variant: "primary",
|
|
279
|
-
onClick: ne
|
|
280
|
-
}, null, 8, ["label"]), l(f, {
|
|
281
|
-
label: n(a)("common.cancel"),
|
|
282
|
-
size: "md",
|
|
283
|
-
variant: "secondary",
|
|
284
|
-
onClick: e[4] || (e[4] = (o) => M.value = !1)
|
|
285
|
-
}, null, 8, ["label"])])]),
|
|
286
|
-
default: b(() => [i("div", Oe, [i("div", Ae, [l(s, {
|
|
287
|
-
name: m.value.user.name,
|
|
288
|
-
initials: n(Me)(m.value.user.name),
|
|
289
|
-
size: "lg"
|
|
290
|
-
}, null, 8, ["name", "initials"]), i("div", Ke, [i("div", ze, O(n(a)("hr.timesheet.employeeName")), 1), i("div", Ne, O(m.value.user.name), 1)])]), i("div", Ue, [i("div", Be, O(n(a)("hr.timesheet.update.checkIn")), 1), i("div", Pe, [l(r, {
|
|
291
|
-
modelValue: T.value,
|
|
292
|
-
"onUpdate:modelValue": e[0] || (e[0] = (o) => T.value = o),
|
|
293
|
-
disabled: !1,
|
|
294
|
-
label: n(a)("hr.timesheet.update.date")
|
|
295
|
-
}, null, 8, ["modelValue", "label"]), l(w, {
|
|
296
|
-
modelValue: I.value,
|
|
297
|
-
"onUpdate:modelValue": e[1] || (e[1] = (o) => I.value = o),
|
|
298
|
-
label: n(a)("hr.timesheet.update.time")
|
|
299
|
-
}, null, 8, ["modelValue", "label"])])]), i("div", je, [i("div", He, O(n(a)("hr.timesheet.update.checkOut")), 1), i("div", Ge, [l(r, {
|
|
300
|
-
modelValue: R.value,
|
|
301
|
-
"onUpdate:modelValue": e[2] || (e[2] = (o) => R.value = o),
|
|
302
|
-
disabled: !1,
|
|
303
|
-
label: n(a)("hr.timesheet.update.date")
|
|
304
|
-
}, null, 8, ["modelValue", "label"]), l(w, {
|
|
305
|
-
modelValue: $.value,
|
|
306
|
-
"onUpdate:modelValue": e[3] || (e[3] = (o) => $.value = o),
|
|
307
|
-
label: n(a)("hr.timesheet.update.time")
|
|
308
|
-
}, null, 8, ["modelValue", "label"])])]), K.value ? (E(), P("div", qe, [l(y, {
|
|
309
|
-
color: "#FF3B30",
|
|
310
|
-
name: "error",
|
|
311
|
-
size: "sm"
|
|
312
|
-
}), he(" " + O(K.value), 1)])) : ve("", !0)])]),
|
|
313
|
-
_: 1
|
|
314
|
-
}, 8, ["modelValue", "header"]), i("div", Qe, [i("div", We, [l(De, {
|
|
315
|
-
modelValue: A.value,
|
|
316
|
-
"onUpdate:modelValue": e[6] || (e[6] = (o) => A.value = o),
|
|
317
|
-
multiple: "",
|
|
318
|
-
items: ae.value,
|
|
319
|
-
variant: "dark",
|
|
320
|
-
"selected-prefix": n(a)("hr.role.columns.restaurants"),
|
|
321
|
-
placeholder: n(a)("hr.role.columns.restaurants"),
|
|
322
|
-
class: "!w-auto pt-[3px]"
|
|
323
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), i("div", Xe, [l(ie, {
|
|
324
|
-
modelValue: n(L),
|
|
325
|
-
"onUpdate:modelValue": e[7] || (e[7] = (o) => ge(L) ? L.value = o : null),
|
|
326
|
-
"show-predefined-range": ""
|
|
327
|
-
}, {
|
|
328
|
-
"trigger-button": b(() => [l(Q, {
|
|
329
|
-
label: n(oe)
|
|
330
|
-
}, null, 8, ["label"])]),
|
|
331
|
-
_: 1
|
|
332
|
-
}, 8, ["modelValue"]), l(f, {
|
|
333
|
-
icon: "chevron_left",
|
|
334
|
-
variant: "tertiary",
|
|
335
|
-
onClick: e[8] || (e[8] = (o) => n(G)("subtract"))
|
|
336
|
-
}), l(f, {
|
|
337
|
-
icon: "chevron_right",
|
|
338
|
-
variant: "tertiary",
|
|
339
|
-
onClick: e[9] || (e[9] = (o) => n(G)("add"))
|
|
340
|
-
})]), l(de, {
|
|
341
|
-
class: "pt-[3px]"
|
|
342
|
-
}, {
|
|
343
|
-
"menu-button": b(() => [l(Q, {
|
|
344
|
-
label: _.value,
|
|
345
|
-
"right-icon": "keyboard_arrow_down"
|
|
346
|
-
}, null, 8, ["label"])]),
|
|
347
|
-
default: b(() => [(E(), P(ee, null, we(V, (o) => l(ue, {
|
|
348
|
-
key: o.value,
|
|
349
|
-
label: o.label,
|
|
350
|
-
onClick: (X) => p.value = o.value
|
|
351
|
-
}, null, 8, ["label", "onClick"])), 64))]),
|
|
352
|
-
_: 1
|
|
353
|
-
}), l(ce), l(me, {
|
|
354
|
-
modelValue: c.value,
|
|
355
|
-
"onUpdate:modelValue": e[10] || (e[10] = (o) => c.value = o),
|
|
356
|
-
class: "w-[320px]",
|
|
357
|
-
placeholder: n(a)("hr.timesheet.search.placeholder")
|
|
358
|
-
}, null, 8, ["modelValue", "placeholder"])]), l(Se, {
|
|
359
|
-
class: "w-full xs:px-16"
|
|
360
|
-
}, {
|
|
361
|
-
default: b(() => [i("div", Ze, [l(ke, {
|
|
362
|
-
"is-loading": Y.value,
|
|
363
|
-
"is-empty": p.value === "listView" ? z.value.length === 0 : N.value.length === 0,
|
|
364
|
-
"collapse-at": !1,
|
|
365
|
-
title: n(a)("hr.timesheet.noData.title"),
|
|
366
|
-
subtitle: ""
|
|
367
|
-
}, {
|
|
368
|
-
default: b(() => [p.value === "listView" ? (E(), te(W, {
|
|
369
|
-
key: 0,
|
|
370
|
-
class: "min-w-[640px]",
|
|
371
|
-
"column-defs": se,
|
|
372
|
-
"row-data": z.value,
|
|
373
|
-
"page-size": z.value.length,
|
|
374
|
-
loading: Y.value,
|
|
375
|
-
"pin-header-row": "",
|
|
376
|
-
"hide-footer": "",
|
|
377
|
-
"shrink-at": !1,
|
|
378
|
-
onRowClick: e[11] || (e[11] = (o) => q(o.original))
|
|
379
|
-
}, null, 8, ["row-data", "page-size", "loading"])) : (E(), te(W, {
|
|
380
|
-
key: 1,
|
|
381
|
-
class: "min-w-[640px] timesheet-user-view",
|
|
382
|
-
"column-defs": le,
|
|
383
|
-
"row-data": N.value,
|
|
384
|
-
"page-size": N.value.reduce((o, X) => o + 1 + X.timesheets.length, 0),
|
|
385
|
-
loading: Y.value,
|
|
386
|
-
"pin-header-row": "",
|
|
387
|
-
"shrink-at": !1,
|
|
388
|
-
"expanded-state": B.value,
|
|
389
|
-
"get-sub-row": (o) => o.timesheets,
|
|
390
|
-
"onUpdate:expandedState": e[12] || (e[12] = (o) => B.value = o),
|
|
391
|
-
onRowClick: e[13] || (e[13] = (o) => q(o.original))
|
|
392
|
-
}, null, 8, ["row-data", "page-size", "loading", "expanded-state", "get-sub-row"]))]),
|
|
393
|
-
_: 1
|
|
394
|
-
}, 8, ["is-loading", "is-empty", "title"])])]),
|
|
395
|
-
_: 1
|
|
396
|
-
})])], 64);
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
}), vt = /* @__PURE__ */ Ve(et, [["__scopeId", "data-v-63294af2"]]);
|
|
400
|
-
export {
|
|
401
|
-
vt as default
|
|
402
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { m as i, q as u } from "./app-CDCO87ji.js";
|
|
2
|
-
import { n as a, l as m, q as l, o as d, m as p } from "./rule-B5YNhGJ4.js";
|
|
3
|
-
const f = [
|
|
4
|
-
i.Subject.Business.restaurant,
|
|
5
|
-
i.Subject.Business.role,
|
|
6
|
-
i.Subject.Restaurant.restaurant,
|
|
7
|
-
i.Subject.Business.inventory_stock
|
|
8
|
-
], n = (s) => f.includes(s.subject);
|
|
9
|
-
function P(s, r) {
|
|
10
|
-
return r.length > 0 || s.some((e) => !e.inverted && !n(e));
|
|
11
|
-
}
|
|
12
|
-
function j(s) {
|
|
13
|
-
return s.filter(n);
|
|
14
|
-
}
|
|
15
|
-
const R = {
|
|
16
|
-
customPermissions: [],
|
|
17
|
-
permissions: [],
|
|
18
|
-
permissionSetIds: [],
|
|
19
|
-
posUser: void 0
|
|
20
|
-
};
|
|
21
|
-
function E(s) {
|
|
22
|
-
const r = a(
|
|
23
|
-
m(s.userPermissions, s.reportSubjects),
|
|
24
|
-
s.defaultReportSubjects
|
|
25
|
-
), { posUser: e, savedPosUser: o } = s;
|
|
26
|
-
return {
|
|
27
|
-
customPermissions: l(
|
|
28
|
-
p(s.inheritedPermissions),
|
|
29
|
-
d(r)
|
|
30
|
-
),
|
|
31
|
-
permissions: r.filter((t) => !t.inverted).map((t) => ({ ...t, subject: u(t.subject) })),
|
|
32
|
-
permissionSetIds: s.permissionSetIds,
|
|
33
|
-
posUser: e ? {
|
|
34
|
-
...e,
|
|
35
|
-
name: e.name || (o == null ? void 0 : o.name) || s.fallbackName,
|
|
36
|
-
code: e.code || (o == null ? void 0 : o.code) || "",
|
|
37
|
-
passcode: e.passcode,
|
|
38
|
-
roles: e.roles.filter((t) => !!t.roleId)
|
|
39
|
-
} : e === null ? null : void 0
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function h(s, r) {
|
|
43
|
-
const { posUser: e, ...o } = s;
|
|
44
|
-
if (!e || !r || e.passcode !== r.passcode) return { ...o, posUser: e };
|
|
45
|
-
const { passcode: t, ...c } = e;
|
|
46
|
-
return { ...o, posUser: c };
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
R as E,
|
|
50
|
-
f as W,
|
|
51
|
-
E as b,
|
|
52
|
-
P as h,
|
|
53
|
-
h as t,
|
|
54
|
-
j as w
|
|
55
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineStore as p, storeToRefs as m } from "pinia";
|
|
2
|
-
import { ref as o } from "vue";
|
|
3
|
-
import { useCoreStore as R } from "@feedmepos/mf-common";
|
|
4
|
-
import { b as d, g } from "./app-CDCO87ji.js";
|
|
5
|
-
const y = {
|
|
6
|
-
async readRestaurants() {
|
|
7
|
-
return g(await d().get("/hr-restaurants"));
|
|
8
|
-
},
|
|
9
|
-
async saveOperationalHours(e, n) {
|
|
10
|
-
await d(`restaurants/${e}/schedules`).patch(
|
|
11
|
-
"operational-hours",
|
|
12
|
-
{ operatingHours: n }
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
}, w = p("restaurant", () => {
|
|
16
|
-
const { currentBusiness: e } = R(), n = o([]), l = o(!1), u = o(null);
|
|
17
|
-
let a = null, t = null;
|
|
18
|
-
async function v(i = !1) {
|
|
19
|
-
var c, f;
|
|
20
|
-
const s = ((c = e.value) == null ? void 0 : c._id) ?? ((f = e.value) == null ? void 0 : f.id) ?? null;
|
|
21
|
-
if (!s) {
|
|
22
|
-
n.value = [], u.value = null, a = null, t = null;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (u.value && u.value !== s && (n.value = [], u.value = null), t && t !== s && (a = null, t = null), !i && u.value === s) return;
|
|
26
|
-
if (!i && a && t === s)
|
|
27
|
-
return await a;
|
|
28
|
-
let r = null;
|
|
29
|
-
try {
|
|
30
|
-
l.value = !0, r = (async () => {
|
|
31
|
-
n.value = await y.readRestaurants(), u.value = s;
|
|
32
|
-
})(), a = r, t = s, await r;
|
|
33
|
-
} finally {
|
|
34
|
-
a === r && (a = null, t = null), l.value = !1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
restaurants: n,
|
|
39
|
-
isLoading: l,
|
|
40
|
-
readRestaurants: v
|
|
41
|
-
};
|
|
42
|
-
}), B = () => {
|
|
43
|
-
const e = w();
|
|
44
|
-
return {
|
|
45
|
-
...e,
|
|
46
|
-
...m(e)
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
B as u
|
|
51
|
-
};
|
package/dist/role-DqcBOWHL.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { defineStore as x, storeToRefs as b } from "pinia";
|
|
2
|
-
import { ref as w } from "vue";
|
|
3
|
-
import { useCoreStore as B } from "@feedmepos/mf-common";
|
|
4
|
-
import { s as v } from "./iteration-CPLGGFBb.js";
|
|
5
|
-
import { g as f, b as p } from "./app-CDCO87ji.js";
|
|
6
|
-
import { u as I } from "./restaurant-BMlLIUqe.js";
|
|
7
|
-
const R = {
|
|
8
|
-
async readRoles() {
|
|
9
|
-
return f(await p().get("/pos-roles"));
|
|
10
|
-
},
|
|
11
|
-
async createRole(e) {
|
|
12
|
-
return f(await p().post("/pos-roles", e));
|
|
13
|
-
},
|
|
14
|
-
async updateRole(e, c) {
|
|
15
|
-
return f(await p().put(`/pos-roles/${e}`, c));
|
|
16
|
-
},
|
|
17
|
-
async deleteRole(e) {
|
|
18
|
-
return f(
|
|
19
|
-
await p().put(`/pos-roles/${e._id}`, {
|
|
20
|
-
restaurantIds: [],
|
|
21
|
-
role: e
|
|
22
|
-
})
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
async function m(e) {
|
|
27
|
-
const { restaurants: c } = I(), u = e.reduce((n, a) => {
|
|
28
|
-
var d;
|
|
29
|
-
const s = n.findIndex((o) => o._id === a._id), r = {
|
|
30
|
-
id: a.restaurantId,
|
|
31
|
-
name: ((d = c.value.find((o) => o._id === a.restaurantId)) == null ? void 0 : d.profile.name) || ""
|
|
32
|
-
};
|
|
33
|
-
return s < 0 ? n.push({
|
|
34
|
-
...a,
|
|
35
|
-
restaurants: [r]
|
|
36
|
-
}) : n[s].restaurants.some((o) => o.id === a.restaurantId) || (n[s].restaurants = v([...n[s].restaurants, r], { selector: "name" })), n;
|
|
37
|
-
}, []);
|
|
38
|
-
return v(u, { selector: "name" });
|
|
39
|
-
}
|
|
40
|
-
const A = x("role", () => {
|
|
41
|
-
const { currentBusiness: e } = B(), c = I(), u = w([]), n = w(!1), a = w(null);
|
|
42
|
-
let s = null, r = null;
|
|
43
|
-
async function d(l = !1) {
|
|
44
|
-
var y;
|
|
45
|
-
const t = ((y = e.value) == null ? void 0 : y._id) ?? null;
|
|
46
|
-
if (!t) {
|
|
47
|
-
u.value = [], a.value = null, s = null, r = null;
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (a.value && a.value !== t && (u.value = [], a.value = null), r && r !== t && (s = null, r = null), !l && a.value === t) return;
|
|
51
|
-
if (!l && s && r === t)
|
|
52
|
-
return await s;
|
|
53
|
-
let i = null;
|
|
54
|
-
try {
|
|
55
|
-
n.value = !0, i = (async () => {
|
|
56
|
-
await c.readRestaurants();
|
|
57
|
-
const _ = await R.readRoles();
|
|
58
|
-
u.value = await m(_), a.value = t;
|
|
59
|
-
})(), s = i, r = t, await i;
|
|
60
|
-
} finally {
|
|
61
|
-
s === i && (s = null, r = null), n.value = !1;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
async function o(l) {
|
|
65
|
-
const t = await R.createRole(l);
|
|
66
|
-
u.value = await m(t);
|
|
67
|
-
}
|
|
68
|
-
async function g(l, t) {
|
|
69
|
-
const i = await R.updateRole(l, t);
|
|
70
|
-
u.value = await m(i);
|
|
71
|
-
}
|
|
72
|
-
async function S(l) {
|
|
73
|
-
const t = await R.deleteRole(l);
|
|
74
|
-
u.value = await m(t);
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
roles: u,
|
|
78
|
-
isLoading: n,
|
|
79
|
-
readRoles: d,
|
|
80
|
-
createRole: o,
|
|
81
|
-
updateRole: g,
|
|
82
|
-
deleteRole: S
|
|
83
|
-
};
|
|
84
|
-
}), P = () => {
|
|
85
|
-
const e = A();
|
|
86
|
-
return {
|
|
87
|
-
...e,
|
|
88
|
-
...b(e)
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
export {
|
|
92
|
-
P as u
|
|
93
|
-
};
|