@feedmepos/mf-hrm-portal 1.1.0-dev → 1.1.1-dev
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-D62QRWN-.js +232 -0
- package/dist/{EmployeeList-tmUqs5a6.js → EmployeeList-CMUbRS7j.js} +156 -150
- package/dist/Main-BbZ-t-pu.js +85 -0
- package/dist/{main-DOtgCRZe.js → Main-un3v_g6p.js} +1500 -1532
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-DuwNwJDM.js → PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js} +2 -2
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CZKBfM_R.js +3119 -0
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/{RoleList-C5xG7LHg.js → RoleList-mlTepnhN.js} +52 -50
- package/dist/RolePermissionList-tR-Kmlu7.js +285 -0
- package/dist/TeamMemberList-BkRQl6x8.js +948 -0
- package/dist/{TimesheetList-CZfo4Dua.js → TimesheetList-i5yaAzhB.js} +21 -21
- package/dist/api/audit-log/index.d.ts +10 -0
- package/dist/api/index.d.ts +1 -3
- package/dist/api/permission-assignment/index.d.ts +10 -0
- package/dist/api/permission-set/index.d.ts +8 -0
- package/dist/api/team/index.d.ts +2 -1
- package/dist/app-4LaGLcWC.js +2305 -0
- package/dist/app.js +1 -1
- package/dist/components/AppForm.vue.d.ts +3 -2
- package/dist/components/CheckboxInput.vue.d.ts +10 -4
- package/dist/components/CollapsibleWrapper.vue.d.ts +3 -2
- package/dist/components/form/SelectFilter.vue.d.ts +3 -2
- package/dist/components/layout/FormColumn.vue.d.ts +6 -3
- package/dist/components/layout/FormItem.vue.d.ts +2 -1
- package/dist/components/layout/FormSection.vue.d.ts +2 -1
- package/dist/components/layout/FullWrapper.vue.d.ts +6 -3
- package/dist/components/layout/PageLayout.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenu.vue.d.ts +2 -1
- package/dist/components/menu/BottomSheetMenuItem.vue.d.ts +6 -3
- package/dist/components/table/EmptyDataTemplate/index.vue.d.ts +6 -3
- package/dist/composables/useAppStore.d.ts +6 -6
- package/dist/composables/useDateRange.d.ts +1 -1
- package/dist/composables/useRestaurantMap.d.ts +4 -8
- package/dist/composables/useSheet.d.ts +1 -1
- package/dist/{employee-BQc7Wgpu.js → employee-BZTntAR0.js} +9 -9
- package/dist/helpers/permission-set.d.ts +32 -0
- package/dist/helpers/portal-user.d.ts +8 -0
- package/dist/helpers/rule.d.ts +4 -3
- package/dist/index-BsEM84j5.js +8440 -0
- package/dist/{empty-placeholder-ey8LJtN1.js → index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js} +43 -2
- package/dist/{lodash-DNzKT_gG.js → lodash-DYaYvsmp.js} +326 -343
- package/dist/router/shared.d.ts +3 -1
- package/dist/stores/employee.d.ts +4 -4
- package/dist/stores/permission-assignment.d.ts +277 -0
- package/dist/stores/permission-set.d.ts +250 -0
- package/dist/stores/role.d.ts +4 -4
- package/dist/stores/team.d.ts +288 -0
- package/dist/stores/timesheet.d.ts +19 -19
- package/dist/team-eo_yQh1g.js +26 -0
- package/dist/{timesheet-B4M1nCIm.js → timesheet-CfPIK52Q.js} +14 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/types/audit-log.d.ts +18 -0
- package/dist/types/permission-assignment.d.ts +20 -0
- package/dist/types/permission-set.d.ts +20 -0
- package/dist/types/permission.d.ts +4 -3
- package/dist/types/team.d.ts +13 -3
- package/dist/useAppStore-D0F-tWJO.js +180 -0
- package/dist/useLoading-DpbOtToC.js +99 -0
- package/dist/useRestaurantMap-D5BNPLKh.js +107 -0
- package/dist/{useSearch-C25VELOk.js → useSearch-C6gRA62e.js} +8 -8
- package/dist/views/hr/employee/{components/EmployeeForm.vue.d.ts → EmployeeForm.vue.d.ts} +10 -7
- package/dist/views/hr/locales/index.d.ts +0 -214
- package/dist/views/team/components/BasePermission.vue.d.ts +76 -0
- package/dist/views/team/components/{TeamMemberConditionPermission.vue.d.ts → ConditionPermission.vue.d.ts} +14 -1
- package/dist/views/team/components/InheritPermissionTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PermissionWithTooltip.vue.d.ts +14 -0
- package/dist/views/team/components/PortalPermissionEditor.vue.d.ts +68 -28
- package/dist/views/team/components/{TeamMemberRolePermission.vue.d.ts → PosRolePermission.vue.d.ts} +14 -1
- package/dist/views/team/locales/index.d.ts +176 -4
- package/dist/views/team/{components → member}/AddMemberForm.vue.d.ts +1 -0
- package/dist/views/team/member/TeamMemberList.vue.d.ts +4 -0
- package/dist/views/team/member/TeamMemberMasterUser.vue.d.ts +55 -0
- package/dist/views/team/role/RolePermissionForm.vue.d.ts +19 -0
- package/dist/views/{hr/grant-user/GrantUserList.vue.d.ts → team/role/RolePermissionList.vue.d.ts} +0 -12
- package/package.json +14 -9
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-BY9VGOoM.js +0 -71
- package/dist/HorizontalSplitter-B9DVYJIM.js +0 -12
- package/dist/Main-ebQsujY3.js +0 -600
- package/dist/TeamMemberList-09_3YTHe.js +0 -1509
- package/dist/api/grant-user/index.d.ts +0 -8
- package/dist/app-B4KDGOw1.js +0 -1432
- package/dist/index-CSG8t9Dl.js +0 -58
- package/dist/role-DGAu9X1X.js +0 -9728
- package/dist/rule-CSj0p2P3.js +0 -450
- package/dist/stores/grant-user.d.ts +0 -86
- package/dist/types/grant-user.d.ts +0 -17
- package/dist/useAppStore-CKmMR-gI.js +0 -93
- package/dist/useLoading-v4m-6mEy.js +0 -141
- package/dist/useRestaurantMap-e9fQJiLC.js +0 -39
- package/dist/views/hr/grant-user/components/GrantUserForm.vue.d.ts +0 -14
- package/dist/views/team/components/TeamMemberBasePermission.vue.d.ts +0 -36
- package/dist/views/team/components/TeamMemberMasterUser.vue.d.ts +0 -718
- /package/dist/views/hr/{grant-user/Main.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/hr/{main.vue.d.ts → audit-log/AuditLogList.vue.d.ts} +0 -0
- /package/dist/views/team/{TeamMemberList.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/views/team/{components → member}/MemberInfo.vue.d.ts +0 -0
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
import { toRaw as Ce, defineComponent as he, ref as g, computed as F, watch as
|
|
1
|
+
import { createElementBlock as $, openBlock as h, createElementVNode as c, toRaw as Ce, defineComponent as he, ref as g, computed as F, watch as _e, resolveComponent as v, Fragment as G, renderSlot as Me, createVNode as n, unref as o, withCtx as y, createBlock as B, createCommentVNode as Q, isRef as re, renderList as ge, toDisplayString as K, onMounted as Ie, h as se, createTextVNode as $e, withModifiers as Oe } from "vue";
|
|
2
2
|
import { useCoreStore as be, useI18n as Ve, RestaurantSelector as me } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as Fe, components as
|
|
4
|
-
import { u as
|
|
5
|
-
import { _ as
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
return
|
|
3
|
+
import { useSnackbar as Fe, components as xe, useDialog as Le, useBreakpoints as Be, FmButtonVariant as De } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as Ne, u as we, S as ce } from "./useSearch-C6gRA62e.js";
|
|
5
|
+
import { _ as Pe } from "./app-4LaGLcWC.js";
|
|
6
|
+
import { _ as Te } from "./index.vue_vue_type_script_setup_true_lang-Vc5ARO29.js";
|
|
7
|
+
import { u as ke, E as ze } from "./employee-BZTntAR0.js";
|
|
8
|
+
import { l as Ae } from "./lodash-DYaYvsmp.js";
|
|
9
|
+
import { u as je, _ as de, a as pe, b as Ke } from "./useRestaurantMap-D5BNPLKh.js";
|
|
10
|
+
import { u as Ge } from "./useLoading-DpbOtToC.js";
|
|
11
|
+
import { u as ne } from "./useAppStore-D0F-tWJO.js";
|
|
12
|
+
const qe = {};
|
|
13
|
+
function He(S, O) {
|
|
14
|
+
return h(), $("div", null, [...O[0] || (O[0] = [
|
|
15
|
+
c("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
|
|
16
|
+
])]);
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
const Je = /* @__PURE__ */ Ne(qe, [["render", He]]);
|
|
19
|
+
function ve(S) {
|
|
20
|
+
return JSON.parse(JSON.stringify(S));
|
|
21
|
+
}
|
|
22
|
+
function fe(S) {
|
|
17
23
|
if (typeof structuredClone > "u")
|
|
18
|
-
return ve(
|
|
24
|
+
return ve(S);
|
|
19
25
|
try {
|
|
20
|
-
return structuredClone(Ce(
|
|
26
|
+
return structuredClone(Ce(S));
|
|
21
27
|
} catch {
|
|
22
|
-
return ve(
|
|
28
|
+
return ve(S);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
const
|
|
31
|
+
const We = { class: "fm-typo-en-title-md-600" }, Qe = { class: "space-y-40" }, Xe = { class: "flex flex-row gap-16" }, Ye = { class: "space-y-16" }, Ze = { class: "flex gap-8 items-center justify-start" }, ye = 4, el = /* @__PURE__ */ he({
|
|
26
32
|
__name: "EmployeeForm",
|
|
27
33
|
props: {
|
|
28
34
|
roleErrorMessage: {
|
|
@@ -30,11 +36,11 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
30
36
|
default: ""
|
|
31
37
|
}
|
|
32
38
|
},
|
|
33
|
-
setup(
|
|
34
|
-
const u = ne(),
|
|
35
|
-
s.value = a ? fe(a) :
|
|
39
|
+
setup(S, { expose: O }) {
|
|
40
|
+
const u = ne(), E = be(), d = ke(), q = Fe(), H = Ge(q), { t: i } = Ve(), f = g(!1), L = g(!0), R = (a) => {
|
|
41
|
+
s.value = a ? fe(a) : D(), x.value = fe(s.value), l.value = [], b.value = s.value.restaurants.map((e) => e.restaurantId), s.value.passcode && (l.value = s.value.passcode.split(""), t.value = !0), L.value = !a, f.value = !0;
|
|
36
42
|
};
|
|
37
|
-
function
|
|
43
|
+
function D() {
|
|
38
44
|
return {
|
|
39
45
|
code: "",
|
|
40
46
|
isMasterUser: !1,
|
|
@@ -43,21 +49,21 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
43
49
|
restaurants: []
|
|
44
50
|
};
|
|
45
51
|
}
|
|
46
|
-
const
|
|
52
|
+
const N = F(() => L.value ? i("hr.employee.form.add") : i("hr.employee.form.update")), X = F(() => L.value ? i("common.create") : i("common.update")), x = g(D()), s = g(D()), { searchKey: C, filter: P } = we(), Y = F(() => {
|
|
47
53
|
const a = {};
|
|
48
54
|
return u.roles.value.forEach((e) => {
|
|
49
55
|
a[e._id] = e.name;
|
|
50
56
|
}), a;
|
|
51
57
|
});
|
|
52
|
-
function
|
|
53
|
-
const e =
|
|
58
|
+
function J(a) {
|
|
59
|
+
const e = T(a) ?? "";
|
|
54
60
|
return Y.value[e] || "";
|
|
55
61
|
}
|
|
56
|
-
const k = F(() =>
|
|
57
|
-
const M = u.roles.value.filter((
|
|
58
|
-
label:
|
|
59
|
-
value:
|
|
60
|
-
disabled: !
|
|
62
|
+
const k = F(() => E.restaurants.value.filter(({ _id: e, profile: m }) => P([m.code, m.name, J(e)])).map(({ _id: e, profile: m }) => {
|
|
63
|
+
const M = u.roles.value.filter((w) => w.restaurants.some((I) => I.id == e)).map((w) => ({
|
|
64
|
+
label: w.name,
|
|
65
|
+
value: w._id,
|
|
66
|
+
disabled: !w.isUsable
|
|
61
67
|
}));
|
|
62
68
|
return {
|
|
63
69
|
value: e,
|
|
@@ -69,7 +75,7 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
69
75
|
return s.value.restaurants.forEach((e) => {
|
|
70
76
|
a[e.restaurantId] = e.roleId;
|
|
71
77
|
}), a;
|
|
72
|
-
}),
|
|
78
|
+
}), T = (a) => Z.value[a] ?? null, W = (a, e) => {
|
|
73
79
|
s.value.restaurants = [
|
|
74
80
|
...s.value.restaurants.filter((m) => m.restaurantId !== a),
|
|
75
81
|
{
|
|
@@ -77,32 +83,32 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
77
83
|
roleId: e
|
|
78
84
|
}
|
|
79
85
|
];
|
|
80
|
-
}, b = g(s.value.restaurants.map((a) => a.restaurantId)),
|
|
86
|
+
}, b = g(s.value.restaurants.map((a) => a.restaurantId)), z = F(
|
|
81
87
|
() => b.value.filter(
|
|
82
88
|
(a) => k.value.some((e) => e.value === a)
|
|
83
89
|
)
|
|
84
|
-
), U = F(() => k.value.length > 0 && k.value.length ===
|
|
85
|
-
const a = b.value.filter((e) => !
|
|
86
|
-
U.value === !0 ?
|
|
87
|
-
},
|
|
90
|
+
), U = F(() => k.value.length > 0 && k.value.length === z.value.length), ee = () => {
|
|
91
|
+
const a = b.value.filter((e) => !z.value.includes(e));
|
|
92
|
+
U.value === !0 ? A(a) : A(k.value.map((e) => e.value));
|
|
93
|
+
}, A = (a) => {
|
|
88
94
|
b.value = a, s.value.restaurants = a.map((e) => {
|
|
89
|
-
var M,
|
|
90
|
-
const m = ((
|
|
95
|
+
var M, w, I;
|
|
96
|
+
const m = ((w = (M = k.value.find((j) => j.value === e)) == null ? void 0 : M.roleOptions[0]) == null ? void 0 : w.value) || "";
|
|
91
97
|
return {
|
|
92
98
|
restaurantId: e,
|
|
93
|
-
roleId: ((I = s.value.restaurants.find((
|
|
99
|
+
roleId: ((I = s.value.restaurants.find((j) => j.restaurantId === e)) == null ? void 0 : I.roleId) || m
|
|
94
100
|
};
|
|
95
101
|
});
|
|
96
102
|
}, l = g([]), t = g(!1);
|
|
97
103
|
function p() {
|
|
98
104
|
t.value && (t.value = !1, l.value = []);
|
|
99
105
|
}
|
|
100
|
-
async function
|
|
101
|
-
const a = await
|
|
106
|
+
async function _() {
|
|
107
|
+
const a = await ze.generateEmployeePasscode();
|
|
102
108
|
t.value = !1, l.value = a.split("");
|
|
103
109
|
}
|
|
104
|
-
const V =
|
|
105
|
-
() => !
|
|
110
|
+
const V = je(
|
|
111
|
+
() => !Ae.isEqual(s.value, x.value),
|
|
106
112
|
() => {
|
|
107
113
|
f.value = !1;
|
|
108
114
|
}
|
|
@@ -119,7 +125,7 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
119
125
|
s.value.isMasterUser ? await d.createMasterEmployee(a) : (delete a.user.code, await d.createEmployee(a));
|
|
120
126
|
}
|
|
121
127
|
async function ae() {
|
|
122
|
-
const a =
|
|
128
|
+
const a = x.value, e = {
|
|
123
129
|
user: {
|
|
124
130
|
name: s.value.name,
|
|
125
131
|
passcode: s.value.passcode
|
|
@@ -137,18 +143,18 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
137
143
|
},
|
|
138
144
|
roles: s.value.restaurants
|
|
139
145
|
};
|
|
140
|
-
|
|
146
|
+
x.value.isMasterUser ? await d.updateMasterEmployee(a._id, m) : await d.migrateToMasterUser(a._id, m);
|
|
141
147
|
}
|
|
142
148
|
}
|
|
143
149
|
async function te() {
|
|
144
|
-
|
|
150
|
+
L.value ? await H.minor(
|
|
145
151
|
async () => {
|
|
146
152
|
await le();
|
|
147
153
|
},
|
|
148
154
|
{
|
|
149
155
|
successMessage: i("hr.employee.create.successMessage")
|
|
150
156
|
}
|
|
151
|
-
) : await
|
|
157
|
+
) : await H.minor(
|
|
152
158
|
async () => {
|
|
153
159
|
await ae();
|
|
154
160
|
},
|
|
@@ -157,22 +163,22 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
157
163
|
}
|
|
158
164
|
), f.value = !1;
|
|
159
165
|
}
|
|
160
|
-
return
|
|
166
|
+
return _e(
|
|
161
167
|
() => f.value,
|
|
162
168
|
(a) => {
|
|
163
169
|
}
|
|
164
|
-
),
|
|
170
|
+
), O({
|
|
165
171
|
show: f,
|
|
166
|
-
trigger:
|
|
172
|
+
trigger: R
|
|
167
173
|
}), (a, e) => {
|
|
168
|
-
const m = v("FmSwitch"), M = v("FmTextField"),
|
|
169
|
-
return
|
|
170
|
-
Me(a.$slots, "default", { trigger:
|
|
174
|
+
const m = v("FmSwitch"), M = v("FmTextField"), w = v("FmPinField"), I = v("FmFormGroup"), j = v("FmButton"), Ue = v("FmSearch"), ue = v("FmCheckbox"), Se = v("FmSelect"), ie = v("fm-button"), Ee = v("fm-side-sheet");
|
|
175
|
+
return h(), $(G, null, [
|
|
176
|
+
Me(a.$slots, "default", { trigger: R }),
|
|
171
177
|
n(Ee, {
|
|
172
178
|
id: "unit-form",
|
|
173
179
|
modelValue: f.value,
|
|
174
180
|
"onUpdate:modelValue": e[9] || (e[9] = (r) => f.value = r),
|
|
175
|
-
"is-container": o(
|
|
181
|
+
"is-container": o(xe).FmForm,
|
|
176
182
|
"is-container-props": {
|
|
177
183
|
onValidationSuccess: te,
|
|
178
184
|
blameFormChildOnValidationFailed: !0
|
|
@@ -181,10 +187,10 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
181
187
|
"onOn:clickedAway": o(V)
|
|
182
188
|
}, {
|
|
183
189
|
"side-sheet-header": y(() => [
|
|
184
|
-
c("p",
|
|
190
|
+
c("p", We, K(N.value), 1)
|
|
185
191
|
]),
|
|
186
192
|
"side-sheet-footer": y(() => [
|
|
187
|
-
c("div",
|
|
193
|
+
c("div", Ze, [
|
|
188
194
|
n(ie, {
|
|
189
195
|
label: X.value,
|
|
190
196
|
size: "lg",
|
|
@@ -200,7 +206,7 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
200
206
|
])
|
|
201
207
|
]),
|
|
202
208
|
default: y(() => [
|
|
203
|
-
c("div",
|
|
209
|
+
c("div", Qe, [
|
|
204
210
|
n(de, {
|
|
205
211
|
title: o(i)("hr.employee.form.employeeSetting")
|
|
206
212
|
}, {
|
|
@@ -220,13 +226,13 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
220
226
|
]),
|
|
221
227
|
_: 1
|
|
222
228
|
}, 8, ["label"]),
|
|
223
|
-
c("div",
|
|
224
|
-
s.value.isMasterUser ? (
|
|
229
|
+
c("div", Xe, [
|
|
230
|
+
s.value.isMasterUser ? (h(), B(M, {
|
|
225
231
|
key: 0,
|
|
226
232
|
modelValue: s.value.code,
|
|
227
233
|
"onUpdate:modelValue": e[1] || (e[1] = (r) => s.value.code = r),
|
|
228
234
|
label: o(i)("hr.employee.form.code")
|
|
229
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
235
|
+
}, null, 8, ["modelValue", "label"])) : Q("", !0),
|
|
230
236
|
n(M, {
|
|
231
237
|
modelValue: s.value.name,
|
|
232
238
|
"onUpdate:modelValue": e[2] || (e[2] = (r) => s.value.name = r),
|
|
@@ -239,7 +245,7 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
239
245
|
label: o(i)("hr.employee.form.passcode")
|
|
240
246
|
}, {
|
|
241
247
|
default: y(() => [
|
|
242
|
-
c("div",
|
|
248
|
+
c("div", Ye, [
|
|
243
249
|
n(I, {
|
|
244
250
|
modelValue: l.value,
|
|
245
251
|
"onUpdate:modelValue": e[5] || (e[5] = (r) => l.value = r),
|
|
@@ -248,7 +254,7 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
248
254
|
]
|
|
249
255
|
}, {
|
|
250
256
|
default: y(() => [
|
|
251
|
-
n(
|
|
257
|
+
n(w, {
|
|
252
258
|
modelValue: l.value,
|
|
253
259
|
"onUpdate:modelValue": e[3] || (e[3] = (r) => l.value = r),
|
|
254
260
|
length: ye,
|
|
@@ -259,13 +265,13 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
259
265
|
]),
|
|
260
266
|
_: 1
|
|
261
267
|
}, 8, ["modelValue", "rules"]),
|
|
262
|
-
n(
|
|
268
|
+
n(j, {
|
|
263
269
|
variant: "secondary",
|
|
264
270
|
"text-color": "primary",
|
|
265
271
|
"border-color": "primary",
|
|
266
272
|
label: o(i)("hr.employee.form.passcodeGenerate"),
|
|
267
273
|
size: "md",
|
|
268
|
-
onClick:
|
|
274
|
+
onClick: _
|
|
269
275
|
}, null, 8, ["label"])
|
|
270
276
|
])
|
|
271
277
|
]),
|
|
@@ -279,8 +285,8 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
279
285
|
}, {
|
|
280
286
|
default: y(() => [
|
|
281
287
|
n(Ue, {
|
|
282
|
-
modelValue: o(
|
|
283
|
-
"onUpdate:modelValue": e[6] || (e[6] = (r) => re(
|
|
288
|
+
modelValue: o(C),
|
|
289
|
+
"onUpdate:modelValue": e[6] || (e[6] = (r) => re(C) ? C.value = r : null),
|
|
284
290
|
placeholder: o(i)("hr.restaurant.search.placeholder")
|
|
285
291
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
286
292
|
n(I, {
|
|
@@ -296,22 +302,22 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
296
302
|
indeterminate: b.value.length > 0,
|
|
297
303
|
"onUpdate:modelValue": ee
|
|
298
304
|
}, null, 8, ["model-value", "label", "indeterminate"]),
|
|
299
|
-
(
|
|
305
|
+
(h(!0), $(G, null, ge(k.value, (r, oe) => (h(), $(G, { key: oe }, [
|
|
300
306
|
n(ue, {
|
|
301
307
|
"model-value": b.value,
|
|
302
308
|
label: r.label,
|
|
303
309
|
value: r.value,
|
|
304
|
-
"onUpdate:modelValue":
|
|
310
|
+
"onUpdate:modelValue": A
|
|
305
311
|
}, null, 8, ["model-value", "label", "value"]),
|
|
306
|
-
b.value.includes(r.value) ? (
|
|
312
|
+
b.value.includes(r.value) ? (h(), B(Se, {
|
|
307
313
|
key: 0,
|
|
308
314
|
class: "ml-32 mr-8",
|
|
309
315
|
items: r.roleOptions,
|
|
310
|
-
"model-value":
|
|
316
|
+
"model-value": T(r.value),
|
|
311
317
|
multiselect: !1,
|
|
312
318
|
placeholder: r.roleOptions[0] ? r.roleOptions[0].label : "",
|
|
313
|
-
"onUpdate:modelValue": (Re) =>
|
|
314
|
-
}, null, 8, ["items", "model-value", "placeholder", "onUpdate:modelValue"])) :
|
|
319
|
+
"onUpdate:modelValue": (Re) => W(r.value, Re)
|
|
320
|
+
}, null, 8, ["items", "model-value", "placeholder", "onUpdate:modelValue"])) : Q("", !0)
|
|
315
321
|
], 64))), 128))
|
|
316
322
|
]),
|
|
317
323
|
_: 1
|
|
@@ -326,52 +332,52 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
326
332
|
], 64);
|
|
327
333
|
};
|
|
328
334
|
}
|
|
329
|
-
}),
|
|
335
|
+
}), ll = {
|
|
330
336
|
class: "space-y-8"
|
|
331
|
-
},
|
|
337
|
+
}, al = {
|
|
332
338
|
class: "xs:hidden flex w-full items-start justify-between"
|
|
333
|
-
},
|
|
339
|
+
}, tl = {
|
|
334
340
|
class: "flex items-start gap-8"
|
|
335
|
-
},
|
|
341
|
+
}, ol = {
|
|
336
342
|
class: "flex"
|
|
337
|
-
},
|
|
343
|
+
}, sl = {
|
|
338
344
|
class: "space-y-4 hidden xs:block"
|
|
339
|
-
},
|
|
345
|
+
}, rl = {
|
|
340
346
|
class: "px-16"
|
|
341
|
-
},
|
|
347
|
+
}, nl = {
|
|
342
348
|
class: "px-16 flex items-start gap-8"
|
|
343
|
-
},
|
|
349
|
+
}, ul = {
|
|
344
350
|
class: "pb-64 hidden xs:block"
|
|
345
|
-
},
|
|
351
|
+
}, il = {
|
|
346
352
|
class: "space-y-4"
|
|
347
|
-
},
|
|
353
|
+
}, ml = {
|
|
348
354
|
class: "fm-typo-en-body-lg-600"
|
|
349
|
-
},
|
|
355
|
+
}, cl = {
|
|
350
356
|
key: 0,
|
|
351
357
|
class: "mr-4"
|
|
352
|
-
},
|
|
358
|
+
}, dl = {
|
|
353
359
|
class: "text-fm-color-typo-secondary"
|
|
354
|
-
},
|
|
360
|
+
}, wl = /* @__PURE__ */ he({
|
|
355
361
|
__name: "EmployeeList",
|
|
356
|
-
setup(
|
|
357
|
-
expose:
|
|
362
|
+
setup(S, {
|
|
363
|
+
expose: O
|
|
358
364
|
}) {
|
|
359
365
|
const {
|
|
360
366
|
t: u
|
|
361
|
-
} = Ve(),
|
|
362
|
-
sessionUser:
|
|
367
|
+
} = Ve(), E = g(), d = ke(), q = ne(), {
|
|
368
|
+
sessionUser: H
|
|
363
369
|
} = be(), i = F(() => d.employees.value), {
|
|
364
370
|
searchKey: f,
|
|
365
|
-
filter:
|
|
366
|
-
} =
|
|
371
|
+
filter: L
|
|
372
|
+
} = we(""), R = F(() => {
|
|
367
373
|
var l;
|
|
368
374
|
return (l = i.value) == null ? void 0 : l.filter((t) => {
|
|
369
|
-
const p = !
|
|
370
|
-
return p &&
|
|
375
|
+
const p = !E.value || t.restaurants.some((V) => E.value.includes(V.restaurantId)), _ = !U.value || t.restaurants.some((V) => V.roleId && U.value.includes(V.roleId));
|
|
376
|
+
return p && _ && L([t.code, t.name, `${t.restaurants.map((V) => N(V)).join(" ")}`]);
|
|
371
377
|
});
|
|
372
|
-
}),
|
|
373
|
-
var
|
|
374
|
-
const t = (
|
|
378
|
+
}), D = Ke(), N = (l) => {
|
|
379
|
+
var _;
|
|
380
|
+
const t = (_ = D.value[l.restaurantId]) == null ? void 0 : _.profile.code;
|
|
375
381
|
let p = l.restaurantName;
|
|
376
382
|
return l.roleName && (p = `${t ? t + " - " : ""}${p} (${l.roleName})`), p;
|
|
377
383
|
}, X = [{
|
|
@@ -389,9 +395,9 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
389
395
|
enableSorting: !1,
|
|
390
396
|
cell(l) {
|
|
391
397
|
return l.row.original.restaurants.map((t, p) => {
|
|
392
|
-
const
|
|
398
|
+
const _ = N(t);
|
|
393
399
|
return se("div", (p ? `
|
|
394
|
-
` : "") +
|
|
400
|
+
` : "") + _);
|
|
395
401
|
});
|
|
396
402
|
}
|
|
397
403
|
}, {
|
|
@@ -407,18 +413,18 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
407
413
|
},
|
|
408
414
|
cell: (l) => se("div", {
|
|
409
415
|
class: "w-full flex justify-end items-center"
|
|
410
|
-
}, [se(
|
|
416
|
+
}, [se(xe.FmButton, {
|
|
411
417
|
prependIcon: "delete",
|
|
412
418
|
variant: De.Tertiary,
|
|
413
419
|
textColor: "neutral-gray-400",
|
|
414
420
|
onClick: (t) => {
|
|
415
|
-
t.stopPropagation(),
|
|
421
|
+
t.stopPropagation(), T(l.row.original);
|
|
416
422
|
}
|
|
417
423
|
})])
|
|
418
|
-
}],
|
|
419
|
-
function
|
|
424
|
+
}], x = Fe(), s = Le(), C = g(), P = g(), Y = F(() => d.restrictEmployeeIds.value);
|
|
425
|
+
function J(l) {
|
|
420
426
|
const t = Y.value.includes(l._id);
|
|
421
|
-
return t &&
|
|
427
|
+
return t && x.open({
|
|
422
428
|
message: u("hr.employee.cannotUpdateMasterUser", {
|
|
423
429
|
name: l.name
|
|
424
430
|
}),
|
|
@@ -427,11 +433,11 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
427
433
|
}
|
|
428
434
|
const k = (l) => {
|
|
429
435
|
var p;
|
|
430
|
-
l &&
|
|
436
|
+
l && J(l) || (p = P.value) == null || p.trigger(l);
|
|
431
437
|
}, {
|
|
432
438
|
breakpoints: Z
|
|
433
|
-
} = Be(),
|
|
434
|
-
|
|
439
|
+
} = Be(), T = (l) => {
|
|
440
|
+
J(l) || s.open({
|
|
435
441
|
title: u("hr.employee.remove.title"),
|
|
436
442
|
message: u("hr.employee.remove.message", {
|
|
437
443
|
name: l.name
|
|
@@ -447,62 +453,62 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
447
453
|
close: !0
|
|
448
454
|
}
|
|
449
455
|
}).onPrimary(async () => {
|
|
450
|
-
await (l.isMasterUser ? d.deleteMasterEmployee : d.deleteEmployee)(l).then(() =>
|
|
456
|
+
await (l.isMasterUser ? d.deleteMasterEmployee : d.deleteEmployee)(l).then(() => x.open({
|
|
451
457
|
message: u("hr.employee.remove.successMessage", {
|
|
452
458
|
name: l.name
|
|
453
459
|
}),
|
|
454
460
|
type: "success"
|
|
455
|
-
})).catch((
|
|
456
|
-
message:
|
|
461
|
+
})).catch((_) => x.open({
|
|
462
|
+
message: _,
|
|
457
463
|
type: "error"
|
|
458
464
|
})), s.close();
|
|
459
465
|
});
|
|
460
|
-
},
|
|
461
|
-
|
|
462
|
-
l && l.length > 0 && (
|
|
466
|
+
}, W = g("");
|
|
467
|
+
_e(() => C.value && C.value.restaurants, (l) => {
|
|
468
|
+
l && l.length > 0 && (W.value = "");
|
|
463
469
|
});
|
|
464
470
|
function b() {
|
|
465
471
|
var l;
|
|
466
|
-
(l =
|
|
472
|
+
(l = P.value) == null || l.trigger();
|
|
467
473
|
}
|
|
468
|
-
const
|
|
474
|
+
const z = F(() => ne().roles.value.map((l) => ({
|
|
469
475
|
label: l.name,
|
|
470
476
|
value: l._id
|
|
471
477
|
}))), U = g();
|
|
472
478
|
async function ee() {
|
|
473
479
|
try {
|
|
474
|
-
await d.syncUsersMeta(), await d.readEmployees(),
|
|
480
|
+
await d.syncUsersMeta(), await d.readEmployees(), x.open({
|
|
475
481
|
message: u("hr.employee.sync.successMessage"),
|
|
476
482
|
type: "success"
|
|
477
483
|
});
|
|
478
484
|
} catch (l) {
|
|
479
|
-
console.error("Error syncing users:", l),
|
|
485
|
+
console.error("Error syncing users:", l), x.open({
|
|
480
486
|
message: u("hr.employee.sync.errorMessage"),
|
|
481
487
|
type: "error"
|
|
482
488
|
});
|
|
483
489
|
}
|
|
484
490
|
}
|
|
485
|
-
async function
|
|
486
|
-
|
|
491
|
+
async function A() {
|
|
492
|
+
q.roles.value.length === 0 && await q.readRoles(), d.employees.value.length === 0 && await d.readEmployees();
|
|
487
493
|
}
|
|
488
494
|
return Ie(() => {
|
|
489
|
-
|
|
490
|
-
}),
|
|
495
|
+
A();
|
|
496
|
+
}), O({
|
|
491
497
|
create: b,
|
|
492
|
-
filteredEmployees:
|
|
498
|
+
filteredEmployees: R
|
|
493
499
|
}), (l, t) => {
|
|
494
500
|
var a;
|
|
495
|
-
const p = v("FmButton"),
|
|
496
|
-
return
|
|
501
|
+
const p = v("FmButton"), _ = v("FmTooltip"), V = v("FmSearch"), le = v("FmTable"), ae = v("FmListItem"), te = v("FmList");
|
|
502
|
+
return h(), $(G, null, [n(el, {
|
|
497
503
|
ref_key: "employeeFormRef",
|
|
498
|
-
ref:
|
|
499
|
-
modelValue:
|
|
500
|
-
"onUpdate:modelValue": t[0] || (t[0] = (e) =>
|
|
501
|
-
"role-error-message":
|
|
504
|
+
ref: P,
|
|
505
|
+
modelValue: C.value,
|
|
506
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => C.value = e),
|
|
507
|
+
"role-error-message": W.value,
|
|
502
508
|
class: "gap-8"
|
|
503
|
-
}, null, 8, ["modelValue", "role-error-message"]), c("div",
|
|
504
|
-
modelValue:
|
|
505
|
-
"onUpdate:modelValue": t[1] || (t[1] = (e) =>
|
|
509
|
+
}, null, 8, ["modelValue", "role-error-message"]), c("div", ll, [c("div", al, [c("div", tl, [n(o(me), {
|
|
510
|
+
modelValue: E.value,
|
|
511
|
+
"onUpdate:modelValue": t[1] || (t[1] = (e) => E.value = e),
|
|
506
512
|
"managable-only": !1,
|
|
507
513
|
multiple: "",
|
|
508
514
|
variant: "dark",
|
|
@@ -512,10 +518,10 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
512
518
|
"onUpdate:modelValue": t[2] || (t[2] = (e) => U.value = e),
|
|
513
519
|
multiple: "",
|
|
514
520
|
variant: "dark",
|
|
515
|
-
items:
|
|
521
|
+
items: z.value,
|
|
516
522
|
"selected-prefix": o(u)("hr.employee.filter.selected_role_prefix"),
|
|
517
523
|
placeholder: o(u)("hr.employee.filter.role_placeholder")
|
|
518
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div",
|
|
524
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])]), c("div", ol, [(a = o(H)) != null && a.role.isAdmin ? (h(), B(_, {
|
|
519
525
|
key: 0,
|
|
520
526
|
content: o(u)("hr.employee.sync.tooltip")
|
|
521
527
|
}, {
|
|
@@ -526,20 +532,20 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
526
532
|
onClick: ee
|
|
527
533
|
}, null, 8, ["label"])]),
|
|
528
534
|
_: 1
|
|
529
|
-
}, 8, ["content"])) :
|
|
535
|
+
}, 8, ["content"])) : Q("", !0), n(V, {
|
|
530
536
|
modelValue: o(f),
|
|
531
537
|
"onUpdate:modelValue": t[3] || (t[3] = (e) => re(f) ? f.value = e : null),
|
|
532
538
|
autofocus: "",
|
|
533
539
|
class: "pl-4 w-[320px]",
|
|
534
540
|
placeholder: o(u)("hr.employee.search.placeholder")
|
|
535
|
-
}, null, 8, ["modelValue", "placeholder"])])]), c("div",
|
|
541
|
+
}, null, 8, ["modelValue", "placeholder"])])]), c("div", sl, [c("div", rl, [n(V, {
|
|
536
542
|
modelValue: o(f),
|
|
537
543
|
"onUpdate:modelValue": t[4] || (t[4] = (e) => re(f) ? f.value = e : null),
|
|
538
544
|
autofocus: "",
|
|
539
545
|
placeholder: o(u)("hr.employee.search.placeholder")
|
|
540
|
-
}, null, 8, ["modelValue", "placeholder"])]), n(
|
|
541
|
-
modelValue:
|
|
542
|
-
"onUpdate:modelValue": t[5] || (t[5] = (e) =>
|
|
546
|
+
}, null, 8, ["modelValue", "placeholder"])]), n(Je), c("div", nl, [n(o(me), {
|
|
547
|
+
modelValue: E.value,
|
|
548
|
+
"onUpdate:modelValue": t[5] || (t[5] = (e) => E.value = e),
|
|
543
549
|
"managable-only": !1,
|
|
544
550
|
multiple: "",
|
|
545
551
|
variant: "dark",
|
|
@@ -548,46 +554,46 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
548
554
|
modelValue: U.value,
|
|
549
555
|
"onUpdate:modelValue": t[6] || (t[6] = (e) => U.value = e),
|
|
550
556
|
multiple: "",
|
|
551
|
-
items:
|
|
557
|
+
items: z.value,
|
|
552
558
|
variant: "dark",
|
|
553
559
|
"selected-prefix": o(u)("hr.employee.filter.selected_role_prefix"),
|
|
554
560
|
placeholder: o(u)("hr.employee.filter.role_placeholder")
|
|
555
|
-
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(d).employees.value.length > 0 || o(d).isLoading.value ? (
|
|
561
|
+
}, null, 8, ["modelValue", "items", "selected-prefix", "placeholder"])])]), o(d).employees.value.length > 0 || o(d).isLoading.value ? (h(), B(Pe, {
|
|
556
562
|
key: 0,
|
|
557
563
|
class: "overflow-auto"
|
|
558
564
|
}, {
|
|
559
565
|
default: y(() => [n(le, {
|
|
560
566
|
class: "xs:hidden",
|
|
561
567
|
"column-defs": X,
|
|
562
|
-
"row-data":
|
|
563
|
-
"page-size":
|
|
568
|
+
"row-data": R.value,
|
|
569
|
+
"page-size": R.value.length,
|
|
564
570
|
loading: o(d).isLoading.value,
|
|
565
|
-
virtual:
|
|
571
|
+
virtual: R.value.length > 0,
|
|
566
572
|
"pin-header-row": "",
|
|
567
573
|
"hide-footer": "",
|
|
568
574
|
onRowClick: t[7] || (t[7] = (e) => k(e.original))
|
|
569
|
-
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div",
|
|
575
|
+
}, null, 8, ["row-data", "page-size", "loading", "virtual"]), c("div", ul, [n(te, {
|
|
570
576
|
separator: ""
|
|
571
577
|
}, {
|
|
572
|
-
default: y(() => [(
|
|
578
|
+
default: y(() => [(h(!0), $(G, null, ge(R.value, (e) => (h(), B(ae, {
|
|
573
579
|
key: e._id,
|
|
574
580
|
class: "py-12 px-16 items-center justify-between",
|
|
575
581
|
onClick: (m) => k(e)
|
|
576
582
|
}, {
|
|
577
|
-
default: y(() => [c("div",
|
|
578
|
-
restaurants: e.restaurants.map((m) =>
|
|
579
|
-
})), 1), c("p", null, " Since: " +
|
|
583
|
+
default: y(() => [c("div", il, [c("p", ml, [e.code ? (h(), $("span", cl, K(e.code) + ".", 1)) : Q("", !0), $e(K(e.name), 1)]), c("div", dl, [c("p", null, K(o(u)("hr.employee.restaurants", {
|
|
584
|
+
restaurants: e.restaurants.map((m) => N(m)).join(", ")
|
|
585
|
+
})), 1), c("p", null, " Since: " + K(e.since), 1)])]), n(p, {
|
|
580
586
|
icon: "delete",
|
|
581
587
|
variant: "tertiary",
|
|
582
588
|
"text-color": "neutral-gray-400",
|
|
583
|
-
onClick: Oe((m) =>
|
|
589
|
+
onClick: Oe((m) => T(e), ["stop"])
|
|
584
590
|
}, null, 8, ["onClick"])]),
|
|
585
591
|
_: 2
|
|
586
592
|
}, 1032, ["onClick"]))), 128))]),
|
|
587
593
|
_: 1
|
|
588
594
|
})])]),
|
|
589
595
|
_: 1
|
|
590
|
-
})) : (
|
|
596
|
+
})) : (h(), B(o(Te), {
|
|
591
597
|
key: 1,
|
|
592
598
|
title: o(u)("hr.employee.noData.title"),
|
|
593
599
|
subtitle: o(u)("hr.employee.noData.subtitle")
|
|
@@ -596,5 +602,5 @@ const qe = { class: "fm-typo-en-title-md-600" }, He = { class: "space-y-40" }, J
|
|
|
596
602
|
}
|
|
597
603
|
});
|
|
598
604
|
export {
|
|
599
|
-
|
|
605
|
+
wl as default
|
|
600
606
|
};
|