@feedmepos/mf-hrm-portal 2.0.20-dev.2 → 2.0.20-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/{AuditLogList-ChxAzO74.js → AuditLogList-7E8iWQWx.js} +4 -4
- package/dist/{EmployeeList-Cs-Mn6UA.js → EmployeeList-DyNW3cUo.js} +214 -206
- package/dist/{Main-DcvmP7s-.js → Main-BLJyOcEv.js} +4 -4
- package/dist/{Main-B9_TyRDo.js → Main-BZjZxFHp.js} +9 -9
- package/dist/{Main-CdHW4UkN.js → Main-C9lMH4EN.js} +5 -5
- package/dist/{PermissionSetList-VFVS0g0v.js → PermissionSetList-BuCp14Os.js} +115 -107
- package/dist/{PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Dr3R9JjS.js → PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BQSDnH-Z.js} +608 -595
- package/dist/{RoleList-BZ6RZvm2.js → RoleList-L8L1xmJ2.js} +201 -193
- package/dist/{TeamMemberList-C-zhFauD.js → TeamMemberList-DEN9rHqb.js} +421 -412
- package/dist/{TimesheetList-CZex54an.js → TimesheetList-D88u0GFn.js} +6 -6
- package/dist/{app-CLL3p27X.js → app-g_SrJtfC.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-CDt1i9vl.js → dayjs.min-BGHzwXCt.js} +1 -1
- package/dist/{employee-BpRvjWNh.js → employee-Dep-q_aU.js} +3 -3
- package/dist/{iteration-BVjUzYL5.js → iteration-Dc-Bz5bA.js} +1 -1
- package/dist/{lodash-CrwgACp2.js → lodash-Cxw1GZ6L.js} +1 -1
- package/dist/{rule-BlQ5YZ9Z.js → rule-ClRtpdqO.js} +2 -2
- package/dist/{timesheet-jFs4GTAL.js → timesheet-CZoSvFYT.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{useAppStore-DMAL8VFY.js → useAppStore-CTBRpqmO.js} +1 -1
- package/dist/{useLoading-AFTjRLyO.js → useLoading-XvrLj1VM.js} +1 -1
- package/dist/{useReportPermissions-hODG0Xx3.js → useReportPermissions-nivbQm9V.js} +3 -3
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { toRaw as Te, defineComponent as $e, ref as v, computed as
|
|
1
|
+
import { toRaw as Te, defineComponent as $e, ref as v, computed as k, watch as X, resolveComponent as g, createElementBlock as P, openBlock as h, Fragment as de, renderSlot as je, createVNode as n, unref as o, withCtx as b, createElementVNode as m, createBlock as j, createCommentVNode as G, toDisplayString as K, renderList as Me, withKeys as ke, withModifiers as ee, normalizeClass as Le, onUnmounted as Ge, isRef as Ee, createTextVNode as qe, h as ue } from "vue";
|
|
2
2
|
import { useI18n as Ae, useCoreStore as He } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as Pe, components as De, useDialog as Je, useBreakpoints as We } from "@feedmepos/ui-library";
|
|
4
|
-
import { S as
|
|
5
|
-
import { _ as Ye, a as Ze } from "./app-
|
|
4
|
+
import { S as ce, _ as Qe } from "./SelectFilter-DUj7GBtT.js";
|
|
5
|
+
import { _ as Ye, a as Ze } from "./app-g_SrJtfC.js";
|
|
6
6
|
import { _ as Fe, u as Xe, H as ea } from "./FormItem.vue_vue_type_script_setup_true_lang-D3MOFOUI.js";
|
|
7
7
|
import { u as aa, _ as ta } from "./useDiscardConfirm-DPhEV6v0.js";
|
|
8
8
|
import { _ as la } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
9
9
|
import { u as sa, _ as Ve } from "./useDebounce-CWb5QR9G.js";
|
|
10
|
-
import { u as Ne, E as oa } from "./employee-
|
|
11
|
-
import { u as
|
|
12
|
-
import { l as ra } from "./lodash-
|
|
10
|
+
import { u as Ne, E as oa } from "./employee-Dep-q_aU.js";
|
|
11
|
+
import { u as ze } from "./iteration-Dc-Bz5bA.js";
|
|
12
|
+
import { l as ra } from "./lodash-Cxw1GZ6L.js";
|
|
13
13
|
import { _ as Se } from "./FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js";
|
|
14
|
-
import { u as
|
|
15
|
-
import { u as we } from "./useAppStore-
|
|
14
|
+
import { u as Oe } from "./useLoading-XvrLj1VM.js";
|
|
15
|
+
import { u as we } from "./useAppStore-CTBRpqmO.js";
|
|
16
16
|
/* empty css */
|
|
17
17
|
function Ce(B) {
|
|
18
18
|
return JSON.parse(JSON.stringify(B));
|
|
@@ -26,7 +26,7 @@ function Re(B) {
|
|
|
26
26
|
return Ce(B);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" },
|
|
29
|
+
const na = { class: "flex w-full items-center justify-between" }, ia = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, ca = { class: "flex flex-row gap-16" }, da = { class: "space-y-16" }, ma = { class: "rounded-lg border border-fm-color-neutral-gray-200 p-16 space-y-16" }, pa = { class: "fm-typo-en-title-sm-600" }, fa = { class: "space-y-16" }, va = { class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-16" }, ya = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ha = { class: "text-sm font-semibold text-fm-color-typo-primary" }, ga = { class: "flex justify-self-end" }, _a = ["tabindex", "aria-disabled", "aria-label", "onClick", "onKeydown"], ba = { class: "flex gap-8 items-center justify-start" }, Ue = 4, wa = /* @__PURE__ */ $e({
|
|
30
30
|
__name: "EmployeeForm",
|
|
31
31
|
props: {
|
|
32
32
|
roleErrorMessage: {
|
|
@@ -35,8 +35,8 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
emits: ["submitted"],
|
|
38
|
-
setup(B, { expose: me, emit:
|
|
39
|
-
const
|
|
38
|
+
setup(B, { expose: me, emit: i }) {
|
|
39
|
+
const E = we(), f = ze(), R = Ne(), pe = Pe(), D = Oe(pe), fe = i, { t: c } = Ae(), U = v(!1), N = v(!0);
|
|
40
40
|
function T() {
|
|
41
41
|
return {
|
|
42
42
|
restaurantId: "",
|
|
@@ -51,14 +51,14 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
51
51
|
isMasterUser: t.isMasterUser ?? !1,
|
|
52
52
|
name: t.name ?? "",
|
|
53
53
|
passcode: t.passcode ?? "",
|
|
54
|
-
restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId:
|
|
55
|
-
restaurantId:
|
|
54
|
+
restaurants: t.restaurants.length > 0 ? t.restaurants.map(({ restaurantId: d, roleId: y }) => ({
|
|
55
|
+
restaurantId: d,
|
|
56
56
|
roleId: y
|
|
57
57
|
})) : [T()]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
const ae = (r) => {
|
|
61
|
-
s.value = ve(r), F.value = Re(s.value), te.value = r == null ? void 0 : r._id, S.value = [], s.value.passcode && (S.value = s.value.passcode.split(""), M.value = !0),
|
|
61
|
+
s.value = ve(r), F.value = Re(s.value), te.value = r == null ? void 0 : r._id, S.value = [], s.value.passcode && (S.value = s.value.passcode.split(""), M.value = !0), N.value = !r, U.value = !0;
|
|
62
62
|
};
|
|
63
63
|
function w() {
|
|
64
64
|
return {
|
|
@@ -69,33 +69,33 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
69
69
|
restaurants: [T()]
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const q =
|
|
72
|
+
const q = k(() => N.value ? c("hr.employee.form.add") : c("hr.employee.form.update")), H = k(() => N.value ? c("common.create") : c("common.update")), F = v(w()), s = v(w()), te = v(void 0), z = k(
|
|
73
73
|
() => s.value.restaurants.map((r) => r.restaurantId).filter(Boolean)
|
|
74
74
|
);
|
|
75
75
|
function V(r) {
|
|
76
76
|
var t;
|
|
77
|
-
return r ? !((t = f.restaurants.value.find((
|
|
77
|
+
return r ? !((t = f.restaurants.value.find((d) => d._id === r)) != null && t.managable) : !1;
|
|
78
78
|
}
|
|
79
79
|
function le(r = "") {
|
|
80
80
|
return f.restaurants.value.filter((t) => t.managable || t._id === r).map((t) => ({
|
|
81
81
|
label: `${t.profile.code ? `${t.profile.code} - ` : ""}${t.profile.name}`,
|
|
82
82
|
value: t._id,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: z.value.includes(t._id) && t._id !== r
|
|
84
84
|
}));
|
|
85
85
|
}
|
|
86
86
|
function se(r, t = "") {
|
|
87
|
-
return r ?
|
|
88
|
-
label:
|
|
89
|
-
value:
|
|
90
|
-
disabled: !
|
|
87
|
+
return r ? E.roles.value.filter((d) => d.restaurants.some((y) => y.id == r)).map((d) => ({
|
|
88
|
+
label: d.name,
|
|
89
|
+
value: d._id,
|
|
90
|
+
disabled: !d.isUsable && d._id !== t
|
|
91
91
|
})) : [];
|
|
92
92
|
}
|
|
93
93
|
function ye(r, t) {
|
|
94
|
-
var
|
|
95
|
-
const
|
|
94
|
+
var x, C, L;
|
|
95
|
+
const d = ((x = s.value.restaurants[r]) == null ? void 0 : x.roleId) ?? "", y = se(t, d), _ = ((C = y.find((A) => A.value === d && !A.disabled)) == null ? void 0 : C.value) ?? ((L = y.find((A) => !A.disabled)) == null ? void 0 : L.value) ?? "";
|
|
96
96
|
s.value.restaurants[r] = {
|
|
97
97
|
restaurantId: t,
|
|
98
|
-
roleId:
|
|
98
|
+
roleId: _
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
function he(r, t) {
|
|
@@ -108,23 +108,23 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
108
108
|
];
|
|
109
109
|
}
|
|
110
110
|
function $(r) {
|
|
111
|
-
var
|
|
112
|
-
const t = ((
|
|
111
|
+
var d;
|
|
112
|
+
const t = ((d = s.value.restaurants[r]) == null ? void 0 : d.restaurantId) ?? "";
|
|
113
113
|
if (!V(t)) {
|
|
114
114
|
if (s.value.restaurants.length === 1) {
|
|
115
115
|
s.value.restaurants = [T()];
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
s.value.restaurants = s.value.restaurants.filter(
|
|
119
|
-
(y,
|
|
119
|
+
(y, _) => _ !== r
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
const oe =
|
|
123
|
+
const oe = k(() => {
|
|
124
124
|
const r = f.restaurants.value.some(
|
|
125
|
-
(
|
|
125
|
+
(d) => d.managable && !z.value.includes(d._id)
|
|
126
126
|
), t = s.value.restaurants.every(
|
|
127
|
-
(
|
|
127
|
+
(d) => d.restaurantId && d.roleId
|
|
128
128
|
);
|
|
129
129
|
return r && t;
|
|
130
130
|
}), S = v([]), M = v(!1);
|
|
@@ -159,51 +159,51 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
159
159
|
s.value.isMasterUser ? await R.createMasterEmployee(r) : (delete r.user.code, await R.createEmployee(r));
|
|
160
160
|
}
|
|
161
161
|
async function ne() {
|
|
162
|
-
var y,
|
|
163
|
-
const r = F.value, t = te.value,
|
|
162
|
+
var y, _;
|
|
163
|
+
const r = F.value, t = te.value, d = {
|
|
164
164
|
user: {
|
|
165
165
|
name: s.value.name,
|
|
166
166
|
passcode: s.value.passcode
|
|
167
167
|
},
|
|
168
168
|
roles: s.value.restaurants,
|
|
169
|
-
previousRoles: (y = r.restaurants) == null ? void 0 : y.map((
|
|
170
|
-
restaurantId:
|
|
171
|
-
roleId:
|
|
169
|
+
previousRoles: (y = r.restaurants) == null ? void 0 : y.map((x) => ({
|
|
170
|
+
restaurantId: x.restaurantId,
|
|
171
|
+
roleId: x.roleId
|
|
172
172
|
}))
|
|
173
173
|
};
|
|
174
174
|
if (!s.value.isMasterUser)
|
|
175
|
-
await R.updateEmployee(t,
|
|
175
|
+
await R.updateEmployee(t, d);
|
|
176
176
|
else {
|
|
177
|
-
const
|
|
177
|
+
const x = {
|
|
178
178
|
user: {
|
|
179
179
|
name: s.value.name,
|
|
180
180
|
passcode: s.value.passcode,
|
|
181
181
|
code: s.value.code
|
|
182
182
|
},
|
|
183
183
|
roles: s.value.restaurants,
|
|
184
|
-
previousRoles: (
|
|
184
|
+
previousRoles: (_ = r.restaurants) == null ? void 0 : _.map((C) => ({
|
|
185
185
|
restaurantId: C.restaurantId,
|
|
186
186
|
roleId: C.roleId
|
|
187
187
|
}))
|
|
188
188
|
};
|
|
189
|
-
F.value.isMasterUser ? await R.updateMasterEmployee(t,
|
|
189
|
+
F.value.isMasterUser ? await R.updateMasterEmployee(t, x) : await R.migrateToMasterUser(t, x);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
async function _e() {
|
|
193
|
-
|
|
193
|
+
N.value ? await D.minor(
|
|
194
194
|
async () => {
|
|
195
195
|
await re();
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
|
-
successMessage:
|
|
198
|
+
successMessage: c("hr.employee.create.successMessage"),
|
|
199
199
|
isLoading: O
|
|
200
200
|
}
|
|
201
|
-
) : await
|
|
201
|
+
) : await D.minor(
|
|
202
202
|
async () => {
|
|
203
203
|
await ne();
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
|
-
successMessage:
|
|
206
|
+
successMessage: c("hr.employee.update.successMessage"),
|
|
207
207
|
isLoading: O
|
|
208
208
|
}
|
|
209
209
|
), fe("submitted"), U.value = !1;
|
|
@@ -216,8 +216,8 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
216
216
|
show: U,
|
|
217
217
|
trigger: ae
|
|
218
218
|
}), (r, t) => {
|
|
219
|
-
const
|
|
220
|
-
return h(),
|
|
219
|
+
const d = g("FmIcon"), y = g("FmSwitch"), _ = g("FmTextField"), x = g("FmPinField"), C = g("FmFormGroup"), L = g("FmButton"), A = g("FmSelect"), e = g("fm-button"), l = g("fm-side-sheet");
|
|
220
|
+
return h(), P(de, null, [
|
|
221
221
|
je(r.$slots, "default", { trigger: ae }),
|
|
222
222
|
n(l, {
|
|
223
223
|
id: "unit-form",
|
|
@@ -228,14 +228,22 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
228
228
|
blameFormChildOnValidationFailed: !0
|
|
229
229
|
},
|
|
230
230
|
"max-width": 960,
|
|
231
|
-
"
|
|
232
|
-
"onOn:
|
|
231
|
+
"close-button": !1,
|
|
232
|
+
"onOn:clickedAway": o(Q)
|
|
233
233
|
}, {
|
|
234
234
|
"side-sheet-header": b(() => [
|
|
235
|
-
m("
|
|
235
|
+
m("div", na, [
|
|
236
|
+
m("p", ia, K(q.value), 1),
|
|
237
|
+
n(d, {
|
|
238
|
+
name: "close",
|
|
239
|
+
size: "md",
|
|
240
|
+
class: "cursor-pointer",
|
|
241
|
+
onClick: o(Q)
|
|
242
|
+
}, null, 8, ["onClick"])
|
|
243
|
+
])
|
|
236
244
|
]),
|
|
237
245
|
"side-sheet-footer": b(() => [
|
|
238
|
-
m("div",
|
|
246
|
+
m("div", ba, [
|
|
239
247
|
n(e, {
|
|
240
248
|
label: H.value,
|
|
241
249
|
size: "lg",
|
|
@@ -244,7 +252,7 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
244
252
|
disabled: O.value
|
|
245
253
|
}, null, 8, ["label", "disabled"]),
|
|
246
254
|
n(e, {
|
|
247
|
-
label: o(
|
|
255
|
+
label: o(c)("common.cancel"),
|
|
248
256
|
size: "lg",
|
|
249
257
|
variant: "tertiary",
|
|
250
258
|
disabled: O.value,
|
|
@@ -255,49 +263,49 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
255
263
|
default: b(() => [
|
|
256
264
|
m("div", ua, [
|
|
257
265
|
n(Se, {
|
|
258
|
-
title: o(
|
|
266
|
+
title: o(c)("hr.employee.form.employeeSetting")
|
|
259
267
|
}, {
|
|
260
268
|
default: b(() => [
|
|
261
269
|
n(Fe, {
|
|
262
|
-
label: o(
|
|
270
|
+
label: o(c)("hr.employee.form.masterUserConfig")
|
|
263
271
|
}, {
|
|
264
272
|
default: b(() => [
|
|
265
|
-
n(
|
|
273
|
+
n(y, {
|
|
266
274
|
modelValue: s.value.isMasterUser,
|
|
267
275
|
"onUpdate:modelValue": t[0] || (t[0] = (a) => s.value.isMasterUser = a),
|
|
268
276
|
value: "masterUser",
|
|
269
|
-
label: o(
|
|
270
|
-
sublabel: o(
|
|
277
|
+
label: o(c)("hr.employee.form.masterUser"),
|
|
278
|
+
sublabel: o(c)("hr.employee.form.masterUserSublabel"),
|
|
271
279
|
"label-placement": "right"
|
|
272
280
|
}, null, 8, ["modelValue", "label", "sublabel"])
|
|
273
281
|
]),
|
|
274
282
|
_: 1
|
|
275
283
|
}, 8, ["label"]),
|
|
276
|
-
m("div",
|
|
277
|
-
s.value.isMasterUser ? (h(), j(
|
|
284
|
+
m("div", ca, [
|
|
285
|
+
s.value.isMasterUser ? (h(), j(_, {
|
|
278
286
|
key: 0,
|
|
279
287
|
modelValue: s.value.code,
|
|
280
288
|
"onUpdate:modelValue": t[1] || (t[1] = (a) => s.value.code = a),
|
|
281
|
-
label: o(
|
|
289
|
+
label: o(c)("hr.employee.form.code")
|
|
282
290
|
}, null, 8, ["modelValue", "label"])) : G("", !0),
|
|
283
|
-
n(
|
|
291
|
+
n(_, {
|
|
284
292
|
modelValue: s.value.name,
|
|
285
293
|
"onUpdate:modelValue": t[2] || (t[2] = (a) => s.value.name = a),
|
|
286
294
|
class: "w-full",
|
|
287
|
-
label: o(
|
|
288
|
-
rules: [(a) => !!a || o(
|
|
295
|
+
label: o(c)("hr.employee.form.name"),
|
|
296
|
+
rules: [(a) => !!a || o(c)("hr.employee.form.required")]
|
|
289
297
|
}, null, 8, ["modelValue", "label", "rules"])
|
|
290
298
|
]),
|
|
291
299
|
n(Fe, {
|
|
292
|
-
label: o(
|
|
300
|
+
label: o(c)("hr.employee.form.passcode")
|
|
293
301
|
}, {
|
|
294
302
|
default: b(() => [
|
|
295
303
|
m("div", da, [
|
|
296
|
-
n(
|
|
304
|
+
n(C, {
|
|
297
305
|
modelValue: S.value,
|
|
298
306
|
"onUpdate:modelValue": t[5] || (t[5] = (a) => S.value = a),
|
|
299
307
|
rules: [
|
|
300
|
-
(a) => (a == null ? void 0 : a.filter((
|
|
308
|
+
(a) => (a == null ? void 0 : a.filter((u) => !!u).length) !== Ue ? o(c)("hr.employee.form.passcodeRequired") : !0
|
|
301
309
|
]
|
|
302
310
|
}, {
|
|
303
311
|
default: b(() => [
|
|
@@ -312,11 +320,11 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
312
320
|
]),
|
|
313
321
|
_: 1
|
|
314
322
|
}, 8, ["modelValue", "rules"]),
|
|
315
|
-
n(
|
|
323
|
+
n(L, {
|
|
316
324
|
variant: "secondary",
|
|
317
325
|
"text-color": "primary",
|
|
318
326
|
"border-color": "primary",
|
|
319
|
-
label: o(
|
|
327
|
+
label: o(c)("hr.employee.form.passcodeGenerate"),
|
|
320
328
|
size: "md",
|
|
321
329
|
loading: W.value,
|
|
322
330
|
onClick: Z
|
|
@@ -330,48 +338,48 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
330
338
|
}, 8, ["title"]),
|
|
331
339
|
n(Se, null, {
|
|
332
340
|
default: b(() => [
|
|
333
|
-
n(
|
|
341
|
+
n(C, {
|
|
334
342
|
modelValue: s.value.restaurants,
|
|
335
343
|
"onUpdate:modelValue": t[6] || (t[6] = (a) => s.value.restaurants = a),
|
|
336
344
|
tag: "div",
|
|
337
345
|
rules: [
|
|
338
|
-
(a) => a.length > 0 || o(
|
|
339
|
-
(a) => a.every((
|
|
346
|
+
(a) => a.length > 0 || o(c)("hr.employee.form.atLeastOneRestaurant"),
|
|
347
|
+
(a) => a.every((u) => u.restaurantId && u.roleId) || o(c)("hr.employee.form.roleRequired")
|
|
340
348
|
]
|
|
341
349
|
}, {
|
|
342
350
|
default: b(() => [
|
|
343
|
-
m("div",
|
|
344
|
-
m("div",
|
|
345
|
-
m("div",
|
|
346
|
-
m("div",
|
|
347
|
-
m("div",
|
|
348
|
-
m("div",
|
|
351
|
+
m("div", ma, [
|
|
352
|
+
m("div", pa, K(o(c)("hr.employee.form.assignmentSection")), 1),
|
|
353
|
+
m("div", fa, [
|
|
354
|
+
m("div", va, [
|
|
355
|
+
m("div", ya, K(o(c)("hr.employee.columns.restaurants")), 1),
|
|
356
|
+
m("div", ha, K(o(c)("hr.employee.form.role")), 1),
|
|
349
357
|
t[7] || (t[7] = m("div", null, null, -1))
|
|
350
358
|
]),
|
|
351
|
-
(h(!0),
|
|
352
|
-
key: `${a.restaurantId || "new"}-${
|
|
359
|
+
(h(!0), P(de, null, Me(s.value.restaurants, (a, u) => (h(), P("div", {
|
|
360
|
+
key: `${a.restaurantId || "new"}-${u}`,
|
|
353
361
|
class: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-16"
|
|
354
362
|
}, [
|
|
355
|
-
n(
|
|
363
|
+
n(A, {
|
|
356
364
|
class: "min-w-0",
|
|
357
365
|
"model-value": a.restaurantId,
|
|
358
366
|
items: le(a.restaurantId),
|
|
359
367
|
multiselect: !1,
|
|
360
|
-
placeholder: o(
|
|
368
|
+
placeholder: o(c)("hr.employee.columns.restaurants"),
|
|
361
369
|
disabled: V(a.restaurantId),
|
|
362
|
-
"onUpdate:modelValue": (I) => ye(
|
|
370
|
+
"onUpdate:modelValue": (I) => ye(u, I)
|
|
363
371
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
364
|
-
n(
|
|
372
|
+
n(A, {
|
|
365
373
|
class: "min-w-0",
|
|
366
374
|
"model-value": a.roleId,
|
|
367
375
|
items: se(a.restaurantId, a.roleId),
|
|
368
376
|
multiselect: !1,
|
|
369
|
-
placeholder: o(
|
|
377
|
+
placeholder: o(c)("hr.employee.form.role"),
|
|
370
378
|
disabled: !a.restaurantId || V(a.restaurantId),
|
|
371
|
-
"onUpdate:modelValue": (I) => he(
|
|
379
|
+
"onUpdate:modelValue": (I) => he(u, I)
|
|
372
380
|
}, null, 8, ["model-value", "items", "placeholder", "disabled", "onUpdate:modelValue"]),
|
|
373
|
-
m("div",
|
|
374
|
-
s.value.restaurants.length > 1 ? (h(),
|
|
381
|
+
m("div", ga, [
|
|
382
|
+
s.value.restaurants.length > 1 ? (h(), P("div", {
|
|
375
383
|
key: 0,
|
|
376
384
|
role: "button",
|
|
377
385
|
tabindex: V(a.restaurantId) ? -1 : 0,
|
|
@@ -380,28 +388,28 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
380
388
|
"cursor-pointer": !V(a.restaurantId),
|
|
381
389
|
"pointer-events-none": V(a.restaurantId)
|
|
382
390
|
}]),
|
|
383
|
-
"aria-label": o(
|
|
384
|
-
onClick: ee((I) => $(
|
|
391
|
+
"aria-label": o(c)("common.remove"),
|
|
392
|
+
onClick: ee((I) => $(u), ["stop"]),
|
|
385
393
|
onKeydown: [
|
|
386
|
-
|
|
387
|
-
|
|
394
|
+
ke(ee((I) => $(u), ["prevent", "stop"]), ["enter"]),
|
|
395
|
+
ke(ee((I) => $(u), ["prevent", "stop"]), ["space"])
|
|
388
396
|
]
|
|
389
397
|
}, [
|
|
390
|
-
n(
|
|
398
|
+
n(d, {
|
|
391
399
|
name: "delete",
|
|
392
400
|
size: "md"
|
|
393
401
|
})
|
|
394
|
-
], 42,
|
|
402
|
+
], 42, _a)) : G("", !0)
|
|
395
403
|
])
|
|
396
404
|
]))), 128))
|
|
397
405
|
]),
|
|
398
|
-
n(
|
|
406
|
+
n(L, {
|
|
399
407
|
type: "button",
|
|
400
408
|
variant: "secondary",
|
|
401
409
|
"text-color": "primary",
|
|
402
410
|
"border-color": "primary",
|
|
403
411
|
"prepend-icon": "add",
|
|
404
|
-
label: o(
|
|
412
|
+
label: o(c)("hr.employee.form.addAnother"),
|
|
405
413
|
size: "md",
|
|
406
414
|
disabled: !oe.value,
|
|
407
415
|
onClick: ee(ge, ["stop"])
|
|
@@ -416,91 +424,91 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
416
424
|
])
|
|
417
425
|
]),
|
|
418
426
|
_: 1
|
|
419
|
-
}, 8, ["model-value", "is-container", "is-container-props", "onOn:clickedAway"
|
|
427
|
+
}, 8, ["model-value", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
420
428
|
], 64);
|
|
421
429
|
};
|
|
422
430
|
}
|
|
423
|
-
}),
|
|
431
|
+
}), xa = {
|
|
424
432
|
class: "space-y-8"
|
|
425
|
-
},
|
|
433
|
+
}, Ia = {
|
|
426
434
|
key: 0,
|
|
427
435
|
class: "flex w-full items-start justify-between"
|
|
428
|
-
},
|
|
436
|
+
}, ka = {
|
|
429
437
|
class: "flex items-start gap-8"
|
|
430
438
|
}, Ea = {
|
|
431
439
|
class: "flex"
|
|
432
|
-
},
|
|
440
|
+
}, Fa = {
|
|
433
441
|
key: 1,
|
|
434
442
|
class: "space-y-4"
|
|
435
|
-
}, Fa = {
|
|
436
|
-
class: "px-16"
|
|
437
443
|
}, Va = {
|
|
438
|
-
class: "px-16
|
|
444
|
+
class: "px-16"
|
|
439
445
|
}, Sa = {
|
|
440
|
-
class: "
|
|
446
|
+
class: "px-16 flex items-start gap-8"
|
|
441
447
|
}, Ca = {
|
|
442
|
-
class: "
|
|
448
|
+
class: "flex h-full flex-col overflow-auto"
|
|
443
449
|
}, Ra = {
|
|
444
|
-
class: "
|
|
450
|
+
class: "pb-64 sm:hidden md:hidden lg:hidden"
|
|
445
451
|
}, Ua = {
|
|
446
|
-
class: "
|
|
452
|
+
class: "space-y-4"
|
|
447
453
|
}, $a = {
|
|
454
|
+
class: "fm-typo-en-body-lg-600"
|
|
455
|
+
}, Ma = {
|
|
448
456
|
key: 0,
|
|
449
457
|
class: "mr-4"
|
|
450
|
-
},
|
|
458
|
+
}, La = {
|
|
451
459
|
class: "text-fm-color-typo-secondary"
|
|
452
|
-
}, Y = 200,
|
|
460
|
+
}, Y = 200, Aa = /* @__PURE__ */ $e({
|
|
453
461
|
__name: "EmployeeList",
|
|
454
462
|
setup(B, {
|
|
455
463
|
expose: me
|
|
456
464
|
}) {
|
|
457
465
|
const {
|
|
458
|
-
t:
|
|
459
|
-
} = Ae(),
|
|
460
|
-
currentBusiness:
|
|
466
|
+
t: i
|
|
467
|
+
} = Ae(), E = v(), f = Ne(), R = ze(), pe = He(), {
|
|
468
|
+
currentBusiness: D,
|
|
461
469
|
sessionUser: fe
|
|
462
|
-
} = pe,
|
|
470
|
+
} = pe, c = we(), U = k(() => R.isLoading.value), N = v(c.roles.value.length === 0);
|
|
463
471
|
X(R.restaurants, (e) => {
|
|
464
472
|
if (e.length > 0 && f.listEmployees.value.length > 0) {
|
|
465
473
|
const l = new Map(e.map((a) => [a._id, a]));
|
|
466
474
|
f.listEmployees.value = f.listEmployees.value.map((a) => ({
|
|
467
475
|
...a,
|
|
468
|
-
restaurants: a.restaurants.map((
|
|
469
|
-
var I,
|
|
476
|
+
restaurants: a.restaurants.map((u) => {
|
|
477
|
+
var I, ie;
|
|
470
478
|
return {
|
|
471
|
-
...
|
|
472
|
-
restaurantName: ((I = l.get(
|
|
473
|
-
restaurantCode: ((
|
|
479
|
+
...u,
|
|
480
|
+
restaurantName: ((I = l.get(u.restaurantId)) == null ? void 0 : I.profile.name) || u.restaurantName,
|
|
481
|
+
restaurantCode: ((ie = l.get(u.restaurantId)) == null ? void 0 : ie.profile.code) ?? void 0
|
|
474
482
|
};
|
|
475
483
|
})
|
|
476
484
|
}));
|
|
477
485
|
}
|
|
478
486
|
});
|
|
479
|
-
const T =
|
|
487
|
+
const T = k(() => R.restaurants.value.map((e) => ({
|
|
480
488
|
label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
|
|
481
489
|
value: e._id
|
|
482
|
-
}))), ve = X(
|
|
490
|
+
}))), ve = X(c.roles, (e) => {
|
|
483
491
|
if (e.length > 0) {
|
|
484
|
-
if (
|
|
492
|
+
if (N.value = !1, f.listEmployees.value.length > 0) {
|
|
485
493
|
const l = new Map(e.map((a) => [a._id, a.name]));
|
|
486
494
|
f.listEmployees.value = f.listEmployees.value.map((a) => ({
|
|
487
495
|
...a,
|
|
488
|
-
restaurants: a.restaurants.map((
|
|
489
|
-
...
|
|
490
|
-
roleName: l.get(
|
|
496
|
+
restaurants: a.restaurants.map((u) => ({
|
|
497
|
+
...u,
|
|
498
|
+
roleName: l.get(u.roleId) || u.roleName
|
|
491
499
|
}))
|
|
492
500
|
}));
|
|
493
501
|
}
|
|
494
502
|
ve();
|
|
495
503
|
}
|
|
496
|
-
}), ae =
|
|
504
|
+
}), ae = k(() => f.listEmployees.value), {
|
|
497
505
|
searchKey: w
|
|
498
|
-
} = Xe(), q = v(""), H =
|
|
506
|
+
} = Xe(), q = v(""), H = k(() => ae.value), F = k(() => f.totalEmployees.value), s = v(1), te = k(() => f.isLoading.value), z = v(!1), V = k(() => {
|
|
499
507
|
var e;
|
|
500
508
|
return JSON.stringify({
|
|
501
|
-
businessId: ((e =
|
|
509
|
+
businessId: ((e = D.value) == null ? void 0 : e._id) ?? "",
|
|
502
510
|
search: q.value.trim(),
|
|
503
|
-
restaurantIds: [...
|
|
511
|
+
restaurantIds: [...E.value ?? []].sort(),
|
|
504
512
|
roleIds: [...t.value ?? []].sort()
|
|
505
513
|
});
|
|
506
514
|
}), le = (e) => {
|
|
@@ -509,10 +517,10 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
509
517
|
}, se = (e) => e.roleName || "-";
|
|
510
518
|
function ye(e) {
|
|
511
519
|
return [{
|
|
512
|
-
label:
|
|
520
|
+
label: i("hr.employee.form.update"),
|
|
513
521
|
onClick: () => Z(e)
|
|
514
522
|
}, {
|
|
515
|
-
label:
|
|
523
|
+
label: i("hr.employee.remove.title"),
|
|
516
524
|
onClick: () => re(e),
|
|
517
525
|
itemClass: "text-fm-color-typo-error"
|
|
518
526
|
}];
|
|
@@ -530,10 +538,10 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
530
538
|
}, null)]), ge = [{
|
|
531
539
|
accessorKey: "code",
|
|
532
540
|
size: 100,
|
|
533
|
-
header: () =>
|
|
541
|
+
header: () => i("hr.employee.columns.code")
|
|
534
542
|
}, {
|
|
535
543
|
accessorKey: "name",
|
|
536
|
-
header: () =>
|
|
544
|
+
header: () => i("hr.employee.columns.name"),
|
|
537
545
|
enableSorting: !1,
|
|
538
546
|
cell(e) {
|
|
539
547
|
const l = e.row.original;
|
|
@@ -550,36 +558,36 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
550
558
|
}, {
|
|
551
559
|
accessorKey: "restaurants",
|
|
552
560
|
align: "center",
|
|
553
|
-
header: () =>
|
|
561
|
+
header: () => i("hr.employee.columns.restaurants"),
|
|
554
562
|
enableSorting: !1,
|
|
555
563
|
cell(e) {
|
|
556
|
-
return U.value ||
|
|
557
|
-
const
|
|
558
|
-
return
|
|
564
|
+
return U.value || N.value ? ue(Ve) : e.row.original.restaurants.map((l, a) => {
|
|
565
|
+
const u = le(l);
|
|
566
|
+
return ue("div", {
|
|
559
567
|
key: l.restaurantId || a
|
|
560
568
|
}, (a ? `
|
|
561
|
-
` : "") +
|
|
569
|
+
` : "") + u);
|
|
562
570
|
});
|
|
563
571
|
}
|
|
564
572
|
}, {
|
|
565
573
|
accessorKey: "assignedRole",
|
|
566
574
|
align: "center",
|
|
567
|
-
header: () =>
|
|
575
|
+
header: () => i("hr.employee.columns.assignedRole"),
|
|
568
576
|
enableSorting: !1,
|
|
569
577
|
cell(e) {
|
|
570
|
-
return U.value ||
|
|
578
|
+
return U.value || N.value ? ue(Ve, {
|
|
571
579
|
width: "120px"
|
|
572
580
|
}) : e.row.original.restaurants.map((l, a) => {
|
|
573
|
-
const
|
|
574
|
-
return
|
|
581
|
+
const u = se(l);
|
|
582
|
+
return ue("div", {
|
|
575
583
|
key: l.restaurantId || a
|
|
576
584
|
}, (a ? `
|
|
577
|
-
` : "") +
|
|
585
|
+
` : "") + u);
|
|
578
586
|
});
|
|
579
587
|
}
|
|
580
588
|
}, {
|
|
581
589
|
accessorKey: "since",
|
|
582
|
-
header: () =>
|
|
590
|
+
header: () => i("hr.employee.columns.since"),
|
|
583
591
|
enableSorting: !1
|
|
584
592
|
}, {
|
|
585
593
|
id: "action",
|
|
@@ -594,11 +602,11 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
594
602
|
className: "flex w-full items-center justify-end"
|
|
595
603
|
});
|
|
596
604
|
}
|
|
597
|
-
}], $ = Pe(), oe = Je(), S =
|
|
605
|
+
}], $ = Pe(), oe = Je(), S = Oe($), M = v(!1), J = v(), O = v();
|
|
598
606
|
function W(e) {
|
|
599
607
|
const l = e.isRestricted;
|
|
600
608
|
return l && $.open({
|
|
601
|
-
message:
|
|
609
|
+
message: i("hr.employee.cannotUpdateMasterUser", {
|
|
602
610
|
name: e.name
|
|
603
611
|
}),
|
|
604
612
|
type: "error"
|
|
@@ -611,29 +619,29 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
611
619
|
breakpoints: Q
|
|
612
620
|
} = We(), re = (e) => {
|
|
613
621
|
W(e) || oe.open({
|
|
614
|
-
title:
|
|
615
|
-
message:
|
|
622
|
+
title: i("hr.employee.remove.title"),
|
|
623
|
+
message: i("hr.employee.remove.message", {
|
|
616
624
|
name: e.name
|
|
617
625
|
}),
|
|
618
626
|
minWidth: Q.value.lg ? 588 : 0,
|
|
619
627
|
primaryActions: {
|
|
620
|
-
text:
|
|
628
|
+
text: i("common.remove"),
|
|
621
629
|
close: !1,
|
|
622
630
|
variant: "destructive",
|
|
623
631
|
isLoading: M
|
|
624
632
|
},
|
|
625
633
|
secondaryActions: {
|
|
626
|
-
text:
|
|
634
|
+
text: i("common.cancel"),
|
|
627
635
|
close: !0
|
|
628
636
|
}
|
|
629
637
|
}).onPrimary(async () => {
|
|
630
638
|
if (M.value) return;
|
|
631
639
|
const a = e.isMasterUser ? f.deleteMasterEmployee : f.deleteEmployee;
|
|
632
640
|
await S.minor(async () => {
|
|
633
|
-
await a(e), await
|
|
641
|
+
await a(e), await _();
|
|
634
642
|
}, {
|
|
635
643
|
isLoading: M,
|
|
636
|
-
successMessage:
|
|
644
|
+
successMessage: i("hr.employee.remove.successMessage", {
|
|
637
645
|
name: e.name
|
|
638
646
|
})
|
|
639
647
|
}).catch(() => {
|
|
@@ -644,19 +652,19 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
644
652
|
var e;
|
|
645
653
|
(e = O.value) == null || e.trigger();
|
|
646
654
|
}
|
|
647
|
-
const r =
|
|
655
|
+
const r = k(() => we().roles.value.map((e) => ({
|
|
648
656
|
label: e.name,
|
|
649
657
|
value: e._id
|
|
650
658
|
}))), t = v();
|
|
651
|
-
async function
|
|
659
|
+
async function d() {
|
|
652
660
|
try {
|
|
653
|
-
await f.syncUsersMeta(), await
|
|
654
|
-
message:
|
|
661
|
+
await f.syncUsersMeta(), await _(), $.open({
|
|
662
|
+
message: i("hr.employee.sync.successMessage"),
|
|
655
663
|
type: "success"
|
|
656
664
|
});
|
|
657
665
|
} catch (e) {
|
|
658
666
|
console.error("Error syncing users:", e), $.open({
|
|
659
|
-
message:
|
|
667
|
+
message: i("hr.employee.sync.errorMessage"),
|
|
660
668
|
type: "error"
|
|
661
669
|
});
|
|
662
670
|
}
|
|
@@ -668,28 +676,28 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
668
676
|
limit: Y,
|
|
669
677
|
offset: (e - 1) * Y,
|
|
670
678
|
search: q.value.trim() || void 0,
|
|
671
|
-
restaurantIds: (l =
|
|
679
|
+
restaurantIds: (l = E.value) != null && l.length ? E.value : void 0,
|
|
672
680
|
roleIds: (a = t.value) != null && a.length ? t.value : void 0
|
|
673
681
|
});
|
|
674
|
-
} catch (
|
|
675
|
-
console.error("Failed to load employees:",
|
|
676
|
-
message:
|
|
682
|
+
} catch (u) {
|
|
683
|
+
console.error("Failed to load employees:", u), $.open({
|
|
684
|
+
message: u instanceof Error ? u.message : String(u),
|
|
677
685
|
type: "error"
|
|
678
686
|
});
|
|
679
687
|
}
|
|
680
688
|
}
|
|
681
|
-
async function
|
|
689
|
+
async function _() {
|
|
682
690
|
var l;
|
|
683
|
-
if (!((l =
|
|
691
|
+
if (!((l = D.value) != null && l._id)) return;
|
|
684
692
|
await y(s.value);
|
|
685
693
|
const e = Math.max(1, Math.ceil(F.value / Y));
|
|
686
694
|
s.value > e && (s.value = e, await y(s.value));
|
|
687
695
|
}
|
|
688
|
-
async function
|
|
696
|
+
async function x() {
|
|
689
697
|
var e, l;
|
|
690
698
|
return await f.readAllEmployeesPage({
|
|
691
699
|
search: q.value.trim() || void 0,
|
|
692
|
-
restaurantIds: (e =
|
|
700
|
+
restaurantIds: (e = E.value) != null && e.length ? E.value : void 0,
|
|
693
701
|
roleIds: (l = t.value) != null && l.length ? t.value : void 0
|
|
694
702
|
}, F.value);
|
|
695
703
|
}
|
|
@@ -698,11 +706,11 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
698
706
|
}, 300);
|
|
699
707
|
Ge(C);
|
|
700
708
|
let L = !1;
|
|
701
|
-
async function
|
|
709
|
+
async function A({
|
|
702
710
|
pageIndex: e
|
|
703
711
|
}) {
|
|
704
712
|
var l;
|
|
705
|
-
if ((l =
|
|
713
|
+
if ((l = D.value) != null && l._id && !L && !(e === 0 && s.value === 1 && H.value.length > 0)) {
|
|
706
714
|
L = !0, s.value = e + 1;
|
|
707
715
|
try {
|
|
708
716
|
await y(s.value);
|
|
@@ -713,7 +721,7 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
713
721
|
}
|
|
714
722
|
return X(V, async () => {
|
|
715
723
|
var e;
|
|
716
|
-
s.value = 1,
|
|
724
|
+
s.value = 1, z.value = !1, (e = D.value) != null && e._id && (await y(1), z.value = !0);
|
|
717
725
|
}, {
|
|
718
726
|
immediate: !0
|
|
719
727
|
}), X(() => J.value && J.value.restaurants, (e) => {
|
|
@@ -721,83 +729,83 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
721
729
|
}), me({
|
|
722
730
|
create: _e,
|
|
723
731
|
filteredEmployees: H,
|
|
724
|
-
exportEmployees:
|
|
732
|
+
exportEmployees: x
|
|
725
733
|
}), (e, l) => {
|
|
726
734
|
var xe, Ie;
|
|
727
|
-
const a = g("FmButton"),
|
|
728
|
-
return h(),
|
|
735
|
+
const a = g("FmButton"), u = g("FmTooltip"), I = g("FmSearch"), ie = g("FmTable"), Ke = g("FmListItem"), Be = g("FmList");
|
|
736
|
+
return h(), P(de, null, [n(wa, {
|
|
729
737
|
ref_key: "employeeFormRef",
|
|
730
738
|
ref: O,
|
|
731
739
|
modelValue: J.value,
|
|
732
740
|
"onUpdate:modelValue": l[0] || (l[0] = (p) => J.value = p),
|
|
733
741
|
"role-error-message": ne.value,
|
|
734
742
|
class: "gap-8",
|
|
735
|
-
onSubmitted:
|
|
736
|
-
}, null, 8, ["modelValue", "role-error-message"]), m("div",
|
|
743
|
+
onSubmitted: _
|
|
744
|
+
}, null, 8, ["modelValue", "role-error-message"]), m("div", xa, [o(Q).xs ? (h(), P("div", Fa, [m("div", Va, [n(I, {
|
|
737
745
|
modelValue: o(w),
|
|
738
|
-
"onUpdate:modelValue": l[4] || (l[4] = (p) =>
|
|
739
|
-
placeholder: o(
|
|
740
|
-
}, null, 8, ["modelValue", "placeholder"])]), n(ea), m("div",
|
|
741
|
-
modelValue:
|
|
742
|
-
"onUpdate:modelValue": l[5] || (l[5] = (p) =>
|
|
746
|
+
"onUpdate:modelValue": l[4] || (l[4] = (p) => Ee(w) ? w.value = p : null),
|
|
747
|
+
placeholder: o(i)("hr.employee.search.placeholder")
|
|
748
|
+
}, null, 8, ["modelValue", "placeholder"])]), n(ea), m("div", Sa, [n(ce, {
|
|
749
|
+
modelValue: E.value,
|
|
750
|
+
"onUpdate:modelValue": l[5] || (l[5] = (p) => E.value = p),
|
|
743
751
|
multiple: "",
|
|
744
752
|
items: T.value,
|
|
745
753
|
variant: "dark",
|
|
746
|
-
"selected-prefix": o(
|
|
747
|
-
placeholder: o(
|
|
754
|
+
"selected-prefix": o(i)("hr.role.columns.restaurants"),
|
|
755
|
+
placeholder: o(i)("hr.role.columns.restaurants"),
|
|
748
756
|
class: "!w-auto"
|
|
749
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(
|
|
757
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(ce, {
|
|
750
758
|
modelValue: t.value,
|
|
751
759
|
"onUpdate:modelValue": l[6] || (l[6] = (p) => t.value = p),
|
|
752
760
|
multiple: "",
|
|
753
761
|
items: r.value,
|
|
754
762
|
variant: "dark",
|
|
755
|
-
"selected-prefix": o(
|
|
756
|
-
placeholder: o(
|
|
757
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (h(),
|
|
758
|
-
modelValue:
|
|
759
|
-
"onUpdate:modelValue": l[1] || (l[1] = (p) =>
|
|
763
|
+
"selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
|
|
764
|
+
placeholder: o(i)("hr.employee.filter.role_placeholder")
|
|
765
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])])) : (h(), P("div", Ia, [m("div", ka, [n(ce, {
|
|
766
|
+
modelValue: E.value,
|
|
767
|
+
"onUpdate:modelValue": l[1] || (l[1] = (p) => E.value = p),
|
|
760
768
|
multiple: "",
|
|
761
769
|
items: T.value,
|
|
762
770
|
variant: "dark",
|
|
763
|
-
"selected-prefix": o(
|
|
764
|
-
placeholder: o(
|
|
771
|
+
"selected-prefix": o(i)("hr.role.columns.restaurants"),
|
|
772
|
+
placeholder: o(i)("hr.role.columns.restaurants"),
|
|
765
773
|
class: "!w-auto"
|
|
766
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(
|
|
774
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"]), n(ce, {
|
|
767
775
|
modelValue: t.value,
|
|
768
776
|
"onUpdate:modelValue": l[2] || (l[2] = (p) => t.value = p),
|
|
769
777
|
multiple: "",
|
|
770
778
|
variant: "dark",
|
|
771
779
|
items: r.value,
|
|
772
|
-
"selected-prefix": o(
|
|
773
|
-
placeholder: o(
|
|
774
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), m("div", Ea, [(xe = o(fe)) != null && xe.role.isAdmin ? (h(), j(
|
|
780
|
+
"selected-prefix": o(i)("hr.employee.filter.selected_role_prefix"),
|
|
781
|
+
placeholder: o(i)("hr.employee.filter.role_placeholder")
|
|
782
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), m("div", Ea, [(xe = o(fe)) != null && xe.role.isAdmin ? (h(), j(u, {
|
|
775
783
|
key: 0,
|
|
776
|
-
content: o(
|
|
784
|
+
content: o(i)("hr.employee.sync.tooltip")
|
|
777
785
|
}, {
|
|
778
786
|
default: b(() => [n(a, {
|
|
779
787
|
icon: "refresh",
|
|
780
|
-
label: o(
|
|
788
|
+
label: o(i)("hr.employee.sync.tooltip"),
|
|
781
789
|
variant: "tertiary",
|
|
782
|
-
onClick:
|
|
790
|
+
onClick: d
|
|
783
791
|
}, null, 8, ["label"])]),
|
|
784
792
|
_: 1
|
|
785
793
|
}, 8, ["content"])) : G("", !0), n(I, {
|
|
786
794
|
modelValue: o(w),
|
|
787
|
-
"onUpdate:modelValue": l[3] || (l[3] = (p) =>
|
|
795
|
+
"onUpdate:modelValue": l[3] || (l[3] = (p) => Ee(w) ? w.value = p : null),
|
|
788
796
|
autofocus: "",
|
|
789
797
|
class: "pl-4 w-[320px]",
|
|
790
|
-
placeholder: o(
|
|
791
|
-
}, null, 8, ["modelValue", "placeholder"])])])), (Ie = o(
|
|
798
|
+
placeholder: o(i)("hr.employee.search.placeholder")
|
|
799
|
+
}, null, 8, ["modelValue", "placeholder"])])])), (Ie = o(D)) != null && Ie._id ? (h(), j(Ye, {
|
|
792
800
|
key: 2
|
|
793
801
|
}, {
|
|
794
|
-
default: b(() => [m("div",
|
|
802
|
+
default: b(() => [m("div", Ca, [!z.value && o(f).isLoading.value ? (h(), j(Ze, {
|
|
795
803
|
key: 0
|
|
796
|
-
})) : !
|
|
804
|
+
})) : !z.value || F.value === 0 ? (h(), j(o(la), {
|
|
797
805
|
key: 1,
|
|
798
|
-
title: o(
|
|
799
|
-
subtitle: o(
|
|
800
|
-
}, null, 8, ["title", "subtitle"])) : G("", !0),
|
|
806
|
+
title: o(i)("hr.employee.noData.title"),
|
|
807
|
+
subtitle: o(i)("hr.employee.noData.subtitle")
|
|
808
|
+
}, null, 8, ["title", "subtitle"])) : G("", !0), z.value ? (h(), j(ie, {
|
|
801
809
|
key: V.value,
|
|
802
810
|
class: Le(["xs:hidden employee-list-table min-h-0 flex-1", {
|
|
803
811
|
"employee-list-table--pagination-loading": te.value
|
|
@@ -807,21 +815,21 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
807
815
|
"page-size": Y,
|
|
808
816
|
"page-count": Math.ceil(F.value / Y),
|
|
809
817
|
"row-count": F.value,
|
|
810
|
-
"fetch-fn":
|
|
818
|
+
"fetch-fn": A,
|
|
811
819
|
"hide-footer": F.value <= Y,
|
|
812
820
|
loading: o(f).isLoading.value,
|
|
813
821
|
virtual: !1,
|
|
814
822
|
"pin-header-row": "",
|
|
815
823
|
onRowClick: l[7] || (l[7] = (p) => Z(p.original))
|
|
816
|
-
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : G("", !0), m("div",
|
|
824
|
+
}, null, 8, ["class", "row-data", "page-count", "row-count", "hide-footer", "loading"])) : G("", !0), m("div", Ra, [n(Be, {
|
|
817
825
|
separator: ""
|
|
818
826
|
}, {
|
|
819
|
-
default: b(() => [(h(!0),
|
|
827
|
+
default: b(() => [(h(!0), P(de, null, Me(H.value, (p) => (h(), j(Ke, {
|
|
820
828
|
key: p._id,
|
|
821
829
|
class: "py-12 px-16 items-center justify-between",
|
|
822
830
|
onClick: (be) => Z(p)
|
|
823
831
|
}, {
|
|
824
|
-
default: b(() => [m("div",
|
|
832
|
+
default: b(() => [m("div", Ua, [m("p", $a, [p.code ? (h(), P("span", Ma, K(p.code) + ".", 1)) : G("", !0), qe(K(p.name), 1)]), m("div", La, [m("p", null, K(o(i)("hr.employee.restaurants", {
|
|
825
833
|
restaurants: p.restaurants.map((be) => le(be)).join(", ")
|
|
826
834
|
})), 1), m("p", null, " Since: " + K(p.since), 1)])]), n(a, {
|
|
827
835
|
icon: "delete",
|
|
@@ -837,7 +845,7 @@ const na = { class: "fm-typo-en-title-md-600" }, ua = { class: "space-y-40" }, i
|
|
|
837
845
|
})) : G("", !0)])], 64);
|
|
838
846
|
};
|
|
839
847
|
}
|
|
840
|
-
}),
|
|
848
|
+
}), Za = /* @__PURE__ */ Qe(Aa, [["__scopeId", "data-v-cefb09f9"]]);
|
|
841
849
|
export {
|
|
842
|
-
|
|
850
|
+
Za as default
|
|
843
851
|
};
|