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