@feedmepos/mf-hrm-portal 2.0.6-dev → 2.0.6-dev.1
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-BxigxQv3.js → AuditLogList-C23_MiyK.js} +31 -30
- package/dist/{EmployeeList-DyvqwZtw.js → EmployeeList-vXPEVqoh.js} +164 -169
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js +71 -0
- package/dist/HorizontalSplitter-o860F4xM.js +12 -0
- package/dist/Main-CQWe1-SW.js +599 -0
- package/dist/{Main-B8tSMq-U.js → Main-DC9H9bAs.js} +11 -10
- package/dist/{Main-CtH5MCty.js → Main-k56Iy_zg.js} +8 -7
- package/dist/PermissionSetList-B8tJCNpR.js +338 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BPJpVG8_.js +3356 -0
- package/dist/{RoleList-jykDD_zm.js → RoleList-C5WA3Kxu.js} +26 -24
- package/dist/TeamMemberList-Ic-iWBHd.js +989 -0
- package/dist/{TimesheetList-Bk1XF9xy.js → TimesheetList-DlGpcOUp.js} +11 -10
- package/dist/{app-BPlaahxK.js → app-D0xH_99A.js} +1310 -937
- package/dist/app.js +2 -2
- package/dist/{dayjs.min-LweNOSZ_.js → dayjs.min-C1rTVn8X.js} +1 -1
- package/dist/{employee-DPfiL6rd.js → employee-BK4sYiRy.js} +21 -20
- package/dist/index-C2ubYSVV.js +968 -0
- package/dist/{index-BAhsHYNv.js → index-DSAB4vz3.js} +1 -1
- package/dist/{index-CBxn7cxI.js → iteration-BSGKcAZm.js} +3416 -4256
- package/dist/{lodash-D1uG3PY3.js → lodash-CeTePH4O.js} +1 -1
- package/dist/src/api/grant-user/index.d.ts +8 -0
- package/dist/src/api/index.d.ts +3 -1
- package/dist/src/api/permission-assignment/index.d.ts +3 -0
- package/dist/src/api/report-query/index.d.ts +1 -0
- package/dist/src/composables/useCustomReportPermissions.d.ts +7 -0
- package/dist/src/helpers/permission-set.d.ts +32 -1
- package/dist/src/helpers/permission-set.test.d.ts +1 -0
- package/dist/src/helpers/rule.d.ts +4 -1
- package/dist/src/router/shared.d.ts +2 -1
- package/dist/src/stores/grant-user.d.ts +86 -0
- package/dist/src/types/grant-user.d.ts +27 -0
- package/dist/src/types/report-query.d.ts +1 -0
- package/dist/src/views/grant/GrantUserList.vue.d.ts +17 -0
- package/dist/src/views/grant/Main.vue.d.ts +2 -0
- package/dist/src/views/grant/components/GrantUserForm.vue.d.ts +17 -0
- package/dist/src/views/grant/locales/index.d.ts +232 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +17 -0
- package/dist/{team-B1osnB4U.js → team-B25hRkju.js} +1 -1
- package/dist/{timesheet-rte2utJf.js → timesheet-C8oy-bxz.js} +10 -9
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-CqrjwnF_.js → useAppStore-WGnUS7Wm.js} +1 -1
- package/dist/{useLoading-B5IjfVEP.js → useLoading-BCi2g_rf.js} +1 -1
- package/dist/useReportPermissions--LOfl1e-.js +60 -0
- package/dist/useRestaurantMap-e9fQJiLC.js +39 -0
- package/package.json +2 -2
- package/dist/PermissionSetList-DCONmOgn.js +0 -323
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-07Dsea27.js +0 -3092
- package/dist/TeamMemberList-DMrPgF1l.js +0 -973
- package/dist/useReportPermissions-C4Q29AQJ.js +0 -65
- package/dist/useRestaurantMap-D5BNPLKh.js +0 -107
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRaw as Me, defineComponent as _e, ref as g, computed as w, watch as be, resolveComponent as p, createElementBlock as B, openBlock as _, Fragment as K, renderSlot as Ie, createVNode as u, unref as o, withCtx as h, createElementVNode as d, createBlock as N, createCommentVNode as W, isRef as ne, renderList as Ve, toDisplayString as j, onMounted as $e, h as re, createTextVNode as Oe, withModifiers as Le } from "vue";
|
|
2
2
|
import { useCoreStore as Fe, useI18n as we, RestaurantSelector as ce } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as xe, components as Ue, useDialog as Ne, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
|
|
4
|
-
import {
|
|
5
|
-
import { _ as
|
|
4
|
+
import { S as pe } from "./SelectFilter-DUj7GBtT.js";
|
|
5
|
+
import { _ as Pe } from "./app-D0xH_99A.js";
|
|
6
|
+
import { H as Te } from "./HorizontalSplitter-o860F4xM.js";
|
|
6
7
|
import { _ as ze } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
7
8
|
import { u as ke } from "./useSearch-B6WK1LBB.js";
|
|
8
|
-
import { u as Se, E as Ae } from "./employee-
|
|
9
|
-
import { l as je } from "./lodash-
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
m("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
|
|
17
|
-
])]);
|
|
9
|
+
import { u as Se, E as Ae } from "./employee-BK4sYiRy.js";
|
|
10
|
+
import { l as je } from "./lodash-CeTePH4O.js";
|
|
11
|
+
import { _ as ve, a as fe } from "./FormSection.vue_vue_type_script_setup_true_lang-BVb8c4YU.js";
|
|
12
|
+
import { u as Ke, a as Ge } from "./useRestaurantMap-e9fQJiLC.js";
|
|
13
|
+
import { u as qe } from "./useLoading-BCi2g_rf.js";
|
|
14
|
+
import { u as ue } from "./useAppStore-WGnUS7Wm.js";
|
|
15
|
+
function ye(I) {
|
|
16
|
+
return JSON.parse(JSON.stringify(I));
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
function ye(S) {
|
|
21
|
-
return JSON.parse(JSON.stringify(S));
|
|
22
|
-
}
|
|
23
|
-
function he(S) {
|
|
18
|
+
function he(I) {
|
|
24
19
|
if (typeof structuredClone > "u")
|
|
25
|
-
return ye(
|
|
20
|
+
return ye(I);
|
|
26
21
|
try {
|
|
27
|
-
return structuredClone(Me(
|
|
22
|
+
return structuredClone(Me(I));
|
|
28
23
|
} catch {
|
|
29
|
-
return ye(
|
|
24
|
+
return ye(I);
|
|
30
25
|
}
|
|
31
26
|
}
|
|
32
|
-
const
|
|
27
|
+
const He = { class: "fm-typo-en-title-md-600" }, Je = { class: "space-y-40" }, We = { class: "flex flex-row gap-16" }, Qe = { class: "space-y-16" }, Xe = { class: "flex gap-8 items-center justify-start" }, ge = 4, Ye = /* @__PURE__ */ _e({
|
|
33
28
|
__name: "EmployeeForm",
|
|
34
29
|
props: {
|
|
35
30
|
roleErrorMessage: {
|
|
@@ -37,11 +32,11 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
37
32
|
default: ""
|
|
38
33
|
}
|
|
39
34
|
},
|
|
40
|
-
setup(
|
|
41
|
-
const i = ue(),
|
|
42
|
-
s.value = l ? he(l) :
|
|
35
|
+
setup(I, { expose: Q }) {
|
|
36
|
+
const i = ue(), S = Fe(), c = Se(), G = xe(), q = qe(G), { t: m } = we(), v = g(!1), $ = g(!0), E = (l) => {
|
|
37
|
+
s.value = l ? he(l) : D(), x.value = he(s.value), a.value = [], b.value = s.value.restaurants.map((e) => e.restaurantId), s.value.passcode && (a.value = s.value.passcode.split(""), t.value = !0), $.value = !l, v.value = !0;
|
|
43
38
|
};
|
|
44
|
-
function
|
|
39
|
+
function D() {
|
|
45
40
|
return {
|
|
46
41
|
code: "",
|
|
47
42
|
isMasterUser: !1,
|
|
@@ -50,18 +45,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
50
45
|
restaurants: []
|
|
51
46
|
};
|
|
52
47
|
}
|
|
53
|
-
const
|
|
48
|
+
const P = w(() => $.value ? m("hr.employee.form.add") : m("hr.employee.form.update")), X = w(() => $.value ? m("common.create") : m("common.update")), x = g(D()), s = g(D()), { searchKey: R, filter: T } = ke(), Y = w(() => {
|
|
54
49
|
const l = {};
|
|
55
50
|
return i.roles.value.forEach((e) => {
|
|
56
51
|
l[e._id] = e.name;
|
|
57
52
|
}), l;
|
|
58
53
|
});
|
|
59
|
-
function
|
|
60
|
-
const e =
|
|
54
|
+
function H(l) {
|
|
55
|
+
const e = z(l) ?? "";
|
|
61
56
|
return Y.value[e] || "";
|
|
62
57
|
}
|
|
63
|
-
const
|
|
64
|
-
const
|
|
58
|
+
const C = w(() => S.restaurants.value.filter(({ _id: e, profile: n, managable: M }) => M ? T([n.code, n.name, H(e)]) : b.value.includes(e)).map(({ _id: e, profile: n, managable: M }) => {
|
|
59
|
+
const L = i.roles.value.filter((V) => V.restaurants.some((F) => F.id == e)).map((V) => ({
|
|
65
60
|
label: V.name,
|
|
66
61
|
value: V._id,
|
|
67
62
|
disabled: !V.isUsable
|
|
@@ -69,15 +64,15 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
69
64
|
return {
|
|
70
65
|
value: e,
|
|
71
66
|
label: `${n.code ? n.code + "-" : ""}${n.name}`,
|
|
72
|
-
roleOptions:
|
|
73
|
-
disabled: !
|
|
67
|
+
roleOptions: L,
|
|
68
|
+
disabled: !M
|
|
74
69
|
};
|
|
75
70
|
})), Z = w(() => {
|
|
76
71
|
const l = {};
|
|
77
72
|
return s.value.restaurants.forEach((e) => {
|
|
78
73
|
l[e.restaurantId] = e.roleId;
|
|
79
74
|
}), l;
|
|
80
|
-
}),
|
|
75
|
+
}), z = (l) => Z.value[l] ?? null, J = (l, e) => {
|
|
81
76
|
s.value.restaurants = [
|
|
82
77
|
...s.value.restaurants.filter((n) => n.restaurantId !== l),
|
|
83
78
|
{
|
|
@@ -85,37 +80,37 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
85
80
|
roleId: e
|
|
86
81
|
}
|
|
87
82
|
];
|
|
88
|
-
}, b =
|
|
83
|
+
}, b = g(s.value.restaurants.map((l) => l.restaurantId)), O = w(
|
|
89
84
|
() => b.value.filter(
|
|
90
|
-
(l) =>
|
|
85
|
+
(l) => C.value.some((e) => e.value === l && !e.disabled)
|
|
91
86
|
)
|
|
92
87
|
), k = w(() => {
|
|
93
|
-
const l =
|
|
94
|
-
return l > 0 && l ===
|
|
88
|
+
const l = C.value.filter((e) => !e.disabled).length;
|
|
89
|
+
return l > 0 && l === O.value.length;
|
|
95
90
|
}), ee = () => {
|
|
96
|
-
const l = b.value.filter((e) => !
|
|
91
|
+
const l = b.value.filter((e) => !O.value.includes(e));
|
|
97
92
|
if (k.value === !0)
|
|
98
|
-
|
|
93
|
+
A(l);
|
|
99
94
|
else {
|
|
100
|
-
const e =
|
|
101
|
-
|
|
95
|
+
const e = C.value.filter((n) => !n.disabled).map((n) => n.value);
|
|
96
|
+
A([...e, ...l]);
|
|
102
97
|
}
|
|
103
|
-
},
|
|
98
|
+
}, A = (l) => {
|
|
104
99
|
b.value = l, s.value.restaurants = l.map((e) => {
|
|
105
|
-
var
|
|
106
|
-
const n =
|
|
100
|
+
var L, V;
|
|
101
|
+
const n = C.value.find((F) => F.value === e);
|
|
107
102
|
if (n != null && n.disabled)
|
|
108
103
|
return s.value.restaurants.find((F) => F.restaurantId === e) ?? {
|
|
109
104
|
restaurantId: e,
|
|
110
105
|
roleId: ""
|
|
111
106
|
};
|
|
112
|
-
const
|
|
107
|
+
const M = ((L = n == null ? void 0 : n.roleOptions.find((F) => !F.disabled)) == null ? void 0 : L.value) || "";
|
|
113
108
|
return {
|
|
114
109
|
restaurantId: e,
|
|
115
|
-
roleId: ((V = s.value.restaurants.find((F) => F.restaurantId === e)) == null ? void 0 : V.roleId) ||
|
|
110
|
+
roleId: ((V = s.value.restaurants.find((F) => F.restaurantId === e)) == null ? void 0 : V.roleId) || M
|
|
116
111
|
};
|
|
117
112
|
});
|
|
118
|
-
}, a =
|
|
113
|
+
}, a = g([]), t = g(!1);
|
|
119
114
|
function f() {
|
|
120
115
|
t.value && (t.value = !1, a.value = []);
|
|
121
116
|
}
|
|
@@ -163,19 +158,19 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
160
|
async function te() {
|
|
166
|
-
|
|
161
|
+
$.value ? await q.minor(
|
|
167
162
|
async () => {
|
|
168
163
|
await le();
|
|
169
164
|
},
|
|
170
165
|
{
|
|
171
|
-
successMessage:
|
|
166
|
+
successMessage: m("hr.employee.create.successMessage")
|
|
172
167
|
}
|
|
173
|
-
) : await
|
|
168
|
+
) : await q.minor(
|
|
174
169
|
async () => {
|
|
175
170
|
await ae();
|
|
176
171
|
},
|
|
177
172
|
{
|
|
178
|
-
successMessage:
|
|
173
|
+
successMessage: m("hr.employee.update.successMessage")
|
|
179
174
|
}
|
|
180
175
|
), v.value = !1;
|
|
181
176
|
}
|
|
@@ -183,13 +178,13 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
183
178
|
() => v.value,
|
|
184
179
|
(l) => {
|
|
185
180
|
}
|
|
186
|
-
),
|
|
181
|
+
), Q({
|
|
187
182
|
show: v,
|
|
188
|
-
trigger:
|
|
183
|
+
trigger: E
|
|
189
184
|
}), (l, e) => {
|
|
190
|
-
const n = p("FmSwitch"),
|
|
191
|
-
return
|
|
192
|
-
Ie(l.$slots, "default", { trigger:
|
|
185
|
+
const n = p("FmSwitch"), M = p("FmTextField"), L = p("FmPinField"), V = p("FmFormGroup"), F = p("FmButton"), Ee = p("FmSearch"), ie = p("FmCheckbox"), Re = p("FmSelect"), me = p("fm-button"), Ce = p("fm-side-sheet");
|
|
186
|
+
return _(), B(K, null, [
|
|
187
|
+
Ie(l.$slots, "default", { trigger: E }),
|
|
193
188
|
u(Ce, {
|
|
194
189
|
id: "unit-form",
|
|
195
190
|
modelValue: v.value,
|
|
@@ -203,18 +198,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
203
198
|
"onOn:clickedAway": o(y)
|
|
204
199
|
}, {
|
|
205
200
|
"side-sheet-header": h(() => [
|
|
206
|
-
|
|
201
|
+
d("p", He, j(P.value), 1)
|
|
207
202
|
]),
|
|
208
203
|
"side-sheet-footer": h(() => [
|
|
209
|
-
|
|
210
|
-
u(
|
|
204
|
+
d("div", Xe, [
|
|
205
|
+
u(me, {
|
|
211
206
|
label: X.value,
|
|
212
207
|
size: "lg",
|
|
213
208
|
type: "submit",
|
|
214
209
|
variant: "primary"
|
|
215
210
|
}, null, 8, ["label"]),
|
|
216
|
-
u(
|
|
217
|
-
label: o(
|
|
211
|
+
u(me, {
|
|
212
|
+
label: o(m)("common.cancel"),
|
|
218
213
|
size: "lg",
|
|
219
214
|
variant: "tertiary",
|
|
220
215
|
onClick: e[8] || (e[8] = () => v.value = !1)
|
|
@@ -222,55 +217,55 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
222
217
|
])
|
|
223
218
|
]),
|
|
224
219
|
default: h(() => [
|
|
225
|
-
|
|
220
|
+
d("div", Je, [
|
|
226
221
|
u(ve, {
|
|
227
|
-
title: o(
|
|
222
|
+
title: o(m)("hr.employee.form.employeeSetting")
|
|
228
223
|
}, {
|
|
229
224
|
default: h(() => [
|
|
230
225
|
u(fe, {
|
|
231
|
-
label: o(
|
|
226
|
+
label: o(m)("hr.employee.form.masterUserConfig")
|
|
232
227
|
}, {
|
|
233
228
|
default: h(() => [
|
|
234
229
|
u(n, {
|
|
235
230
|
modelValue: s.value.isMasterUser,
|
|
236
231
|
"onUpdate:modelValue": e[0] || (e[0] = (r) => s.value.isMasterUser = r),
|
|
237
232
|
value: "masterUser",
|
|
238
|
-
label: o(
|
|
239
|
-
sublabel: o(
|
|
233
|
+
label: o(m)("hr.employee.form.masterUser"),
|
|
234
|
+
sublabel: o(m)("hr.employee.form.masterUserSublabel"),
|
|
240
235
|
"label-placement": "right"
|
|
241
236
|
}, null, 8, ["modelValue", "label", "sublabel"])
|
|
242
237
|
]),
|
|
243
238
|
_: 1
|
|
244
239
|
}, 8, ["label"]),
|
|
245
|
-
|
|
246
|
-
s.value.isMasterUser ? (
|
|
240
|
+
d("div", We, [
|
|
241
|
+
s.value.isMasterUser ? (_(), N(M, {
|
|
247
242
|
key: 0,
|
|
248
243
|
modelValue: s.value.code,
|
|
249
244
|
"onUpdate:modelValue": e[1] || (e[1] = (r) => s.value.code = r),
|
|
250
|
-
label: o(
|
|
251
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
252
|
-
u(
|
|
245
|
+
label: o(m)("hr.employee.form.code")
|
|
246
|
+
}, null, 8, ["modelValue", "label"])) : W("", !0),
|
|
247
|
+
u(M, {
|
|
253
248
|
modelValue: s.value.name,
|
|
254
249
|
"onUpdate:modelValue": e[2] || (e[2] = (r) => s.value.name = r),
|
|
255
250
|
class: "w-full",
|
|
256
|
-
label: o(
|
|
257
|
-
rules: [(r) => !!r || o(
|
|
251
|
+
label: o(m)("hr.employee.form.name"),
|
|
252
|
+
rules: [(r) => !!r || o(m)("hr.employee.form.required")]
|
|
258
253
|
}, null, 8, ["modelValue", "label", "rules"])
|
|
259
254
|
]),
|
|
260
255
|
u(fe, {
|
|
261
|
-
label: o(
|
|
256
|
+
label: o(m)("hr.employee.form.passcode")
|
|
262
257
|
}, {
|
|
263
258
|
default: h(() => [
|
|
264
|
-
|
|
259
|
+
d("div", Qe, [
|
|
265
260
|
u(V, {
|
|
266
261
|
modelValue: a.value,
|
|
267
262
|
"onUpdate:modelValue": e[5] || (e[5] = (r) => a.value = r),
|
|
268
263
|
rules: [
|
|
269
|
-
(r) => (r == null ? void 0 : r.filter((oe) => !!oe).length) !== ge ? o(
|
|
264
|
+
(r) => (r == null ? void 0 : r.filter((oe) => !!oe).length) !== ge ? o(m)("hr.employee.form.passcodeRequired") : !0
|
|
270
265
|
]
|
|
271
266
|
}, {
|
|
272
267
|
default: h(() => [
|
|
273
|
-
u(
|
|
268
|
+
u(L, {
|
|
274
269
|
modelValue: a.value,
|
|
275
270
|
"onUpdate:modelValue": e[3] || (e[3] = (r) => a.value = r),
|
|
276
271
|
length: ge,
|
|
@@ -285,7 +280,7 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
285
280
|
variant: "secondary",
|
|
286
281
|
"text-color": "primary",
|
|
287
282
|
"border-color": "primary",
|
|
288
|
-
label: o(
|
|
283
|
+
label: o(m)("hr.employee.form.passcodeGenerate"),
|
|
289
284
|
size: "md",
|
|
290
285
|
onClick: U
|
|
291
286
|
}, null, 8, ["label"])
|
|
@@ -297,47 +292,47 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
297
292
|
_: 1
|
|
298
293
|
}, 8, ["title"]),
|
|
299
294
|
u(ve, {
|
|
300
|
-
title: o(
|
|
295
|
+
title: o(m)("hr.employee.form.role")
|
|
301
296
|
}, {
|
|
302
297
|
default: h(() => [
|
|
303
298
|
u(Ee, {
|
|
304
|
-
modelValue: o(
|
|
305
|
-
"onUpdate:modelValue": e[6] || (e[6] = (r) => ne(
|
|
306
|
-
placeholder: o(
|
|
299
|
+
modelValue: o(R),
|
|
300
|
+
"onUpdate:modelValue": e[6] || (e[6] = (r) => ne(R) ? R.value = r : null),
|
|
301
|
+
placeholder: o(m)("hr.restaurant.search.placeholder")
|
|
307
302
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
308
303
|
u(V, {
|
|
309
304
|
modelValue: b.value,
|
|
310
305
|
"onUpdate:modelValue": e[7] || (e[7] = (r) => b.value = r),
|
|
311
|
-
rules: [(r) => r.length > 0 || o(
|
|
306
|
+
rules: [(r) => r.length > 0 || o(m)("hr.employee.form.atLeastOneRestaurant")]
|
|
312
307
|
}, {
|
|
313
308
|
default: h(() => [
|
|
314
309
|
u(ie, {
|
|
315
310
|
"model-value": k.value,
|
|
316
|
-
label: o(
|
|
311
|
+
label: o(m)("hr.employee.form.all"),
|
|
317
312
|
value: "1",
|
|
318
|
-
indeterminate:
|
|
313
|
+
indeterminate: O.value.length > 0,
|
|
319
314
|
"onUpdate:modelValue": ee
|
|
320
315
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
321
|
-
(
|
|
322
|
-
var
|
|
323
|
-
return
|
|
316
|
+
(_(!0), B(K, null, Ve(C.value, (r, oe) => {
|
|
317
|
+
var de;
|
|
318
|
+
return _(), B(K, { key: oe }, [
|
|
324
319
|
u(ie, {
|
|
325
320
|
"model-value": b.value,
|
|
326
321
|
label: r.label,
|
|
327
322
|
value: r.value,
|
|
328
323
|
disabled: r.disabled,
|
|
329
|
-
"onUpdate:modelValue":
|
|
324
|
+
"onUpdate:modelValue": A
|
|
330
325
|
}, null, 8, ["model-value", "label", "value", "disabled"]),
|
|
331
|
-
b.value.includes(r.value) ? (
|
|
326
|
+
b.value.includes(r.value) ? (_(), N(Re, {
|
|
332
327
|
key: 0,
|
|
333
328
|
class: "ml-32 mr-8",
|
|
334
329
|
items: r.roleOptions,
|
|
335
|
-
"model-value":
|
|
330
|
+
"model-value": z(r.value),
|
|
336
331
|
multiselect: !1,
|
|
337
|
-
placeholder: ((
|
|
332
|
+
placeholder: ((de = r.roleOptions.find((se) => !se.disabled) ?? r.roleOptions[0]) == null ? void 0 : de.label) ?? "",
|
|
338
333
|
disabled: r.disabled,
|
|
339
|
-
"onUpdate:modelValue": (se) =>
|
|
340
|
-
}, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) :
|
|
334
|
+
"onUpdate:modelValue": (se) => J(r.value, se)
|
|
335
|
+
}, null, 8, ["items", "model-value", "placeholder", "disabled", "onUpdate:modelValue"])) : W("", !0)
|
|
341
336
|
], 64);
|
|
342
337
|
}), 128))
|
|
343
338
|
]),
|
|
@@ -353,51 +348,51 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
353
348
|
], 64);
|
|
354
349
|
};
|
|
355
350
|
}
|
|
356
|
-
}),
|
|
351
|
+
}), Ze = {
|
|
357
352
|
class: "space-y-8"
|
|
358
|
-
},
|
|
353
|
+
}, el = {
|
|
359
354
|
class: "xs:hidden flex w-full items-start justify-between"
|
|
360
|
-
},
|
|
355
|
+
}, ll = {
|
|
361
356
|
class: "flex items-start gap-8"
|
|
362
|
-
},
|
|
357
|
+
}, al = {
|
|
363
358
|
class: "flex"
|
|
364
|
-
},
|
|
359
|
+
}, tl = {
|
|
365
360
|
class: "space-y-4 sm:hidden md:hidden lg:hidden"
|
|
366
|
-
},
|
|
361
|
+
}, ol = {
|
|
367
362
|
class: "px-16"
|
|
368
|
-
},
|
|
363
|
+
}, sl = {
|
|
369
364
|
class: "px-16 flex items-start gap-8"
|
|
370
|
-
},
|
|
365
|
+
}, rl = {
|
|
371
366
|
class: "pb-64 sm:hidden md:hidden lg:hidden"
|
|
372
|
-
},
|
|
367
|
+
}, nl = {
|
|
373
368
|
class: "space-y-4"
|
|
374
|
-
},
|
|
369
|
+
}, ul = {
|
|
375
370
|
class: "fm-typo-en-body-lg-600"
|
|
376
|
-
},
|
|
371
|
+
}, il = {
|
|
377
372
|
key: 0,
|
|
378
373
|
class: "mr-4"
|
|
379
|
-
},
|
|
374
|
+
}, ml = {
|
|
380
375
|
class: "text-fm-color-typo-secondary"
|
|
381
|
-
},
|
|
376
|
+
}, Ul = /* @__PURE__ */ _e({
|
|
382
377
|
__name: "EmployeeList",
|
|
383
|
-
setup(
|
|
384
|
-
expose:
|
|
378
|
+
setup(I, {
|
|
379
|
+
expose: Q
|
|
385
380
|
}) {
|
|
386
381
|
const {
|
|
387
382
|
t: i
|
|
388
|
-
} = we(),
|
|
389
|
-
sessionUser:
|
|
390
|
-
} = Fe(),
|
|
383
|
+
} = we(), S = g(), c = Se(), G = ue(), {
|
|
384
|
+
sessionUser: q
|
|
385
|
+
} = Fe(), m = w(() => c.employees.value), {
|
|
391
386
|
searchKey: v,
|
|
392
|
-
filter:
|
|
393
|
-
} = ke(""),
|
|
387
|
+
filter: $
|
|
388
|
+
} = ke(""), E = w(() => {
|
|
394
389
|
var a;
|
|
395
|
-
return (a =
|
|
396
|
-
const f = !
|
|
397
|
-
return f && U &&
|
|
390
|
+
return (a = m.value) == null ? void 0 : a.filter((t) => {
|
|
391
|
+
const f = !S.value || t.restaurants.some((y) => S.value.includes(y.restaurantId)), U = !k.value || t.restaurants.some((y) => y.roleId && k.value.includes(y.roleId));
|
|
392
|
+
return f && U && $([t.code, t.name, `${t.restaurants.map((y) => P(y)).join(" ")}`]);
|
|
398
393
|
});
|
|
399
|
-
}),
|
|
400
|
-
const t =
|
|
394
|
+
}), D = Ge(), P = (a) => {
|
|
395
|
+
const t = D.value[a.restaurantId], f = t == null ? void 0 : t.profile.code;
|
|
401
396
|
let y = a.restaurantName || (t == null ? void 0 : t.profile.name) || "";
|
|
402
397
|
return a.roleName && (y = `${f ? f + " - " : ""}${y} (${a.roleName})`), y;
|
|
403
398
|
}, X = [{
|
|
@@ -415,7 +410,7 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
415
410
|
enableSorting: !1,
|
|
416
411
|
cell(a) {
|
|
417
412
|
return a.row.original.restaurants.map((t, f) => {
|
|
418
|
-
const U =
|
|
413
|
+
const U = P(t);
|
|
419
414
|
return re("div", (f ? `
|
|
420
415
|
` : "") + U);
|
|
421
416
|
});
|
|
@@ -438,11 +433,11 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
438
433
|
variant: De.Tertiary,
|
|
439
434
|
textColor: "neutral-gray-400",
|
|
440
435
|
onClick: (t) => {
|
|
441
|
-
t.stopPropagation(),
|
|
436
|
+
t.stopPropagation(), z(a.row.original);
|
|
442
437
|
}
|
|
443
438
|
})])
|
|
444
|
-
}], x = xe(), s = Ne(),
|
|
445
|
-
function
|
|
439
|
+
}], x = xe(), s = Ne(), R = g(), T = g(), Y = w(() => c.restrictEmployeeIds.value);
|
|
440
|
+
function H(a) {
|
|
446
441
|
const t = Y.value.includes(a._id);
|
|
447
442
|
return t && x.open({
|
|
448
443
|
message: i("hr.employee.cannotUpdateMasterUser", {
|
|
@@ -451,13 +446,13 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
451
446
|
type: "error"
|
|
452
447
|
}), t;
|
|
453
448
|
}
|
|
454
|
-
const
|
|
449
|
+
const C = (a) => {
|
|
455
450
|
var f;
|
|
456
|
-
a &&
|
|
451
|
+
a && H(a) || (f = T.value) == null || f.trigger(a);
|
|
457
452
|
}, {
|
|
458
453
|
breakpoints: Z
|
|
459
|
-
} = Be(),
|
|
460
|
-
|
|
454
|
+
} = Be(), z = (a) => {
|
|
455
|
+
H(a) || s.open({
|
|
461
456
|
title: i("hr.employee.remove.title"),
|
|
462
457
|
message: i("hr.employee.remove.message", {
|
|
463
458
|
name: a.name
|
|
@@ -483,18 +478,18 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
483
478
|
type: "error"
|
|
484
479
|
})), s.close();
|
|
485
480
|
});
|
|
486
|
-
},
|
|
487
|
-
be(() =>
|
|
488
|
-
a && a.length > 0 && (
|
|
481
|
+
}, J = g("");
|
|
482
|
+
be(() => R.value && R.value.restaurants, (a) => {
|
|
483
|
+
a && a.length > 0 && (J.value = "");
|
|
489
484
|
});
|
|
490
485
|
function b() {
|
|
491
486
|
var a;
|
|
492
|
-
(a =
|
|
487
|
+
(a = T.value) == null || a.trigger();
|
|
493
488
|
}
|
|
494
|
-
const
|
|
489
|
+
const O = w(() => ue().roles.value.map((a) => ({
|
|
495
490
|
label: a.name,
|
|
496
491
|
value: a._id
|
|
497
|
-
}))), k =
|
|
492
|
+
}))), k = g();
|
|
498
493
|
async function ee() {
|
|
499
494
|
try {
|
|
500
495
|
await c.syncUsersMeta(), await c.readEmployees(), x.open({
|
|
@@ -508,27 +503,27 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
508
503
|
});
|
|
509
504
|
}
|
|
510
505
|
}
|
|
511
|
-
async function
|
|
512
|
-
|
|
506
|
+
async function A() {
|
|
507
|
+
G.roles.value.length === 0 && await G.readRoles(), c.employees.value.length === 0 && await c.readEmployees();
|
|
513
508
|
}
|
|
514
509
|
return $e(() => {
|
|
515
|
-
|
|
516
|
-
}),
|
|
510
|
+
A();
|
|
511
|
+
}), Q({
|
|
517
512
|
create: b,
|
|
518
|
-
filteredEmployees:
|
|
513
|
+
filteredEmployees: E
|
|
519
514
|
}), (a, t) => {
|
|
520
515
|
var l;
|
|
521
516
|
const f = p("FmButton"), U = p("FmTooltip"), y = p("FmSearch"), le = p("FmTable"), ae = p("FmListItem"), te = p("FmList");
|
|
522
|
-
return
|
|
517
|
+
return _(), B(K, null, [u(Ye, {
|
|
523
518
|
ref_key: "employeeFormRef",
|
|
524
|
-
ref:
|
|
525
|
-
modelValue:
|
|
526
|
-
"onUpdate:modelValue": t[0] || (t[0] = (e) =>
|
|
527
|
-
"role-error-message":
|
|
519
|
+
ref: T,
|
|
520
|
+
modelValue: R.value,
|
|
521
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => R.value = e),
|
|
522
|
+
"role-error-message": J.value,
|
|
528
523
|
class: "gap-8"
|
|
529
|
-
}, null, 8, ["modelValue", "role-error-message"]),
|
|
530
|
-
modelValue:
|
|
531
|
-
"onUpdate:modelValue": t[1] || (t[1] = (e) =>
|
|
524
|
+
}, null, 8, ["modelValue", "role-error-message"]), d("div", Ze, [d("div", el, [d("div", ll, [u(o(ce), {
|
|
525
|
+
modelValue: S.value,
|
|
526
|
+
"onUpdate:modelValue": t[1] || (t[1] = (e) => S.value = e),
|
|
532
527
|
"managable-only": !1,
|
|
533
528
|
multiple: "",
|
|
534
529
|
variant: "dark",
|
|
@@ -538,10 +533,10 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
538
533
|
"onUpdate:modelValue": t[2] || (t[2] = (e) => k.value = e),
|
|
539
534
|
multiple: "",
|
|
540
535
|
variant: "dark",
|
|
541
|
-
items:
|
|
536
|
+
items: O.value,
|
|
542
537
|
"selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
|
|
543
538
|
placeholder: o(i)("hr.employee.filter.role_placeholder")
|
|
544
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]),
|
|
539
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), d("div", al, [(l = o(q)) != null && l.role.isAdmin ? (_(), N(U, {
|
|
545
540
|
key: 0,
|
|
546
541
|
content: o(i)("hr.employee.sync.tooltip")
|
|
547
542
|
}, {
|
|
@@ -552,20 +547,20 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
552
547
|
onClick: ee
|
|
553
548
|
}, null, 8, ["label"])]),
|
|
554
549
|
_: 1
|
|
555
|
-
}, 8, ["content"])) :
|
|
550
|
+
}, 8, ["content"])) : W("", !0), u(y, {
|
|
556
551
|
modelValue: o(v),
|
|
557
552
|
"onUpdate:modelValue": t[3] || (t[3] = (e) => ne(v) ? v.value = e : null),
|
|
558
553
|
autofocus: "",
|
|
559
554
|
class: "pl-4 w-[320px]",
|
|
560
555
|
placeholder: o(i)("hr.employee.search.placeholder")
|
|
561
|
-
}, null, 8, ["modelValue", "placeholder"])])]),
|
|
556
|
+
}, null, 8, ["modelValue", "placeholder"])])]), d("div", tl, [d("div", ol, [u(y, {
|
|
562
557
|
modelValue: o(v),
|
|
563
558
|
"onUpdate:modelValue": t[4] || (t[4] = (e) => ne(v) ? v.value = e : null),
|
|
564
559
|
autofocus: "",
|
|
565
560
|
placeholder: o(i)("hr.employee.search.placeholder")
|
|
566
|
-
}, null, 8, ["modelValue", "placeholder"])]), u(
|
|
567
|
-
modelValue:
|
|
568
|
-
"onUpdate:modelValue": t[5] || (t[5] = (e) =>
|
|
561
|
+
}, null, 8, ["modelValue", "placeholder"])]), u(Te), d("div", sl, [u(o(ce), {
|
|
562
|
+
modelValue: S.value,
|
|
563
|
+
"onUpdate:modelValue": t[5] || (t[5] = (e) => S.value = e),
|
|
569
564
|
"managable-only": !1,
|
|
570
565
|
multiple: "",
|
|
571
566
|
variant: "dark",
|
|
@@ -574,46 +569,46 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
574
569
|
modelValue: k.value,
|
|
575
570
|
"onUpdate:modelValue": t[6] || (t[6] = (e) => k.value = e),
|
|
576
571
|
multiple: "",
|
|
577
|
-
items:
|
|
572
|
+
items: O.value,
|
|
578
573
|
variant: "dark",
|
|
579
574
|
"selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
|
|
580
575
|
placeholder: o(i)("hr.employee.filter.role_placeholder")
|
|
581
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(c).employees.value.length > 0 || o(c).isLoading.value ? (
|
|
576
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(c).employees.value.length > 0 || o(c).isLoading.value ? (_(), N(Pe, {
|
|
582
577
|
key: 0,
|
|
583
578
|
class: "overflow-auto"
|
|
584
579
|
}, {
|
|
585
580
|
default: h(() => [u(le, {
|
|
586
581
|
class: "xs:hidden",
|
|
587
582
|
"column-defs": X,
|
|
588
|
-
"row-data":
|
|
589
|
-
"page-size":
|
|
583
|
+
"row-data": E.value,
|
|
584
|
+
"page-size": E.value.length,
|
|
590
585
|
loading: o(c).isLoading.value,
|
|
591
|
-
virtual:
|
|
586
|
+
virtual: E.value.length > 0,
|
|
592
587
|
"pin-header-row": "",
|
|
593
588
|
"hide-footer": "",
|
|
594
|
-
onRowClick: t[7] || (t[7] = (e) =>
|
|
595
|
-
}, null, 8, ["row-data", "page-size", "loading", "virtual"]),
|
|
589
|
+
onRowClick: t[7] || (t[7] = (e) => C(e.original))
|
|
590
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), d("div", rl, [u(te, {
|
|
596
591
|
separator: ""
|
|
597
592
|
}, {
|
|
598
|
-
default: h(() => [(
|
|
593
|
+
default: h(() => [(_(!0), B(K, null, Ve(E.value, (e) => (_(), N(ae, {
|
|
599
594
|
key: e._id,
|
|
600
595
|
class: "py-12 px-16 items-center justify-between",
|
|
601
|
-
onClick: (n) =>
|
|
596
|
+
onClick: (n) => C(e)
|
|
602
597
|
}, {
|
|
603
|
-
default: h(() => [
|
|
604
|
-
restaurants: e.restaurants.map((n) =>
|
|
605
|
-
})), 1),
|
|
598
|
+
default: h(() => [d("div", nl, [d("p", ul, [e.code ? (_(), B("span", il, j(e.code) + ".", 1)) : W("", !0), Oe(j(e.name), 1)]), d("div", ml, [d("p", null, j(o(i)("hr.employee.restaurants", {
|
|
599
|
+
restaurants: e.restaurants.map((n) => P(n)).join(", ")
|
|
600
|
+
})), 1), d("p", null, " Since: " + j(e.since), 1)])]), u(f, {
|
|
606
601
|
icon: "delete",
|
|
607
602
|
variant: "tertiary",
|
|
608
603
|
"text-color": "neutral-gray-400",
|
|
609
|
-
onClick: Le((n) =>
|
|
604
|
+
onClick: Le((n) => z(e), ["stop"])
|
|
610
605
|
}, null, 8, ["onClick"])]),
|
|
611
606
|
_: 2
|
|
612
607
|
}, 1032, ["onClick"]))), 128))]),
|
|
613
608
|
_: 1
|
|
614
609
|
})])]),
|
|
615
610
|
_: 1
|
|
616
|
-
})) : (
|
|
611
|
+
})) : (_(), N(o(ze), {
|
|
617
612
|
key: 1,
|
|
618
613
|
title: o(i)("hr.employee.noData.title"),
|
|
619
614
|
subtitle: o(i)("hr.employee.noData.subtitle")
|
|
@@ -622,5 +617,5 @@ const Qe = { class: "fm-typo-en-title-md-600" }, Xe = { class: "space-y-40" }, Y
|
|
|
622
617
|
}
|
|
623
618
|
});
|
|
624
619
|
export {
|
|
625
|
-
|
|
620
|
+
Ul as default
|
|
626
621
|
};
|