@opengis/surveyor 0.0.2 → 0.0.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/chunks/{AppealDetailField-CI-1qhs3.js → AppealDetailField-DNRGpnyD.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-CSXnfarR.js → AppealStatusBadge-CefimzY3.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-DYBe9hqP.js → AppealStatusBadge-Cu-UzdzA.js} +1 -1
- package/dist/chunks/{ApplicationHistorySection-C0wwhwA4.js → ApplicationHistorySection-PwToBfej.js} +4 -4
- package/dist/chunks/BaseModal-SQXvRRNW.js +90 -0
- package/dist/chunks/{FormFilePicker-C3XQw50i.js → FormFilePicker-CKVdZJU9.js} +2 -2
- package/dist/chunks/{MapLayerMenu-DjYCxEc3.js → MapLayerMenu-AUeTqgEp.js} +1 -1
- package/dist/chunks/{RegistryForm-CEUqFmsF.js → RegistryForm-wG-c8GKf.js} +1 -1
- package/dist/chunks/{RegistryFormModal-DfY4z_7r.js → RegistryFormModal-R_iZYqGE.js} +3 -3
- package/dist/chunks/{RegistryToolbar-BV4mYVAc.js → RegistryToolbar-322DKUXi.js} +6 -6
- package/dist/chunks/SurveyorTeleport-CnSF0Ptl.js +23 -0
- package/dist/chunks/{UserAccessBadge-D8JfgGfN.js → UserAccessBadge-DyZDv7Oo.js} +1 -1
- package/dist/chunks/{UserTypeBadge-YIwwoCho.js → UserTypeBadge-LvnMuKGo.js} +1 -1
- package/dist/chunks/{VerifiedBadge-Bba8WnuB.js → VerifiedBadge-bk0n-rlC.js} +2 -2
- package/dist/chunks/{applications-BB9JRcgl.js → applications-CsCsndMV.js} +1 -1
- package/dist/chunks/{card-fL26_Gvc.js → card-B_SfARf7.js} +358 -357
- package/dist/chunks/card-C3y-j2TA.js +298 -0
- package/dist/chunks/{card-CKD1N0QD.js → card-CWqi1K-x.js} +107 -106
- package/dist/chunks/{card-DUtDfwMk.js → card-DCyBFoDZ.js} +6 -6
- package/dist/chunks/card-DWpAv92l.js +539 -0
- package/dist/chunks/{card-B-ftozcq.js → card-X9UVFgdR.js} +256 -250
- package/dist/chunks/{certificates-BSd1i0un.js → certificates-Cwch72-o.js} +131 -130
- package/dist/chunks/{create-DxMC_IL1.js → create-DTP9x2uS.js} +283 -270
- package/dist/chunks/dom-BSjFG3O0.js +7 -0
- package/dist/chunks/{map-layers-DnmkOEld.js → map-layers-sT-gTiD_.js} +130 -125
- package/dist/chunks/{map-Z57iMvFb.js → map-qXQe_qam.js} +645 -632
- package/dist/chunks/{organizations-BbYipLwk.js → organizations-BtuMZ5s_.js} +1 -1
- package/dist/chunks/{organizations-BO1_JETm.js → organizations-ByVE2f0c.js} +128 -123
- package/dist/chunks/{profile-Dwwn_4Pr.js → profile-CuxlkEev.js} +3 -3
- package/dist/chunks/{profile-ByahbF4B.js → profile-DxZHxGum.js} +1 -1
- package/dist/chunks/requests-BTpLXrNj.js +233 -0
- package/dist/chunks/{requests-CFv5wwAN.js → requests-Bt8fEdRc.js} +7 -7
- package/dist/chunks/useEntityPath-C5Owtidc.js +98 -0
- package/dist/chunks/{users-DtTYsgMb.js → users-U1P6xCP4.js} +105 -99
- package/dist/index.css +1 -1
- package/dist/index.js +154 -114
- package/package.json +2 -5
- package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -41
- package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -79
- package/surveyor-types.d.ts +5 -0
- package/dist/chunks/AppIcon-CIR6y5uE.js +0 -85
- package/dist/chunks/BaseModal-C7PVYz0m.js +0 -85
- package/dist/chunks/card-BctFHFZe.js +0 -538
- package/dist/chunks/card-CiNZxAd5.js +0 -297
- package/dist/chunks/requests-BCin936Z.js +0 -232
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { a as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { i as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
|
|
3
|
+
import { a as r, i, o as a } from "./resources-2e8RFqWR.js";
|
|
4
|
+
import { t as o } from "./VerifiedBadge-bk0n-rlC.js";
|
|
5
|
+
import { t as s } from "./UserAccessBadge-DyZDv7Oo.js";
|
|
6
|
+
import { n as c, t as l } from "./AppealDetailField-DNRGpnyD.js";
|
|
7
|
+
import { i as u, r as d, t as f } from "./surveyorAccount-C7UiiIYg.js";
|
|
8
|
+
import { t as p } from "./SurveyorTeleport-CnSF0Ptl.js";
|
|
9
|
+
import { t as m } from "./BaseModal-SQXvRRNW.js";
|
|
10
|
+
import { t as h } from "./RegistryForm-wG-c8GKf.js";
|
|
11
|
+
import { n as g, t as _ } from "./resendSurveyorRegistration-BHTTVIw1.js";
|
|
12
|
+
import { t as v } from "./form-DDjELqZ9.js";
|
|
13
|
+
import { Fragment as y, computed as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, defineComponent as D, normalizeClass as O, normalizeStyle as k, onMounted as ee, onUnmounted as te, openBlock as A, ref as j, renderList as M, toDisplayString as N, vModelText as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
|
|
14
|
+
import { RouterLink as z, useRoute as ne, useRouter as B } from "vue-router";
|
|
15
|
+
import { confirm as V, notify as H } from "@opengis/core";
|
|
15
16
|
//#region admin/src/pages/organizations/components/OrganizationUsers.vue?vue&type=script&setup=true&lang.ts
|
|
16
17
|
var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", U = /*@__PURE__*/ D({
|
|
17
18
|
__name: "OrganizationUsers",
|
|
@@ -30,133 +31,133 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
emits: ["changed"],
|
|
33
|
-
setup(e, { expose:
|
|
34
|
-
|
|
35
|
-
let c = e,
|
|
34
|
+
setup(e, { expose: n, emit: o }) {
|
|
35
|
+
n();
|
|
36
|
+
let c = e, l = o, h = j(null), v = j({
|
|
36
37
|
top: "0px",
|
|
37
38
|
left: "0px"
|
|
38
|
-
}),
|
|
39
|
+
}), y = j(null), x = j(null), S = j(!1), C = j(null), w = j(""), T = j(""), E = j([]), D = j(!1), O = j(null), k = j(null), A = j(""), M = j(""), N = j({
|
|
39
40
|
last_name: "",
|
|
40
41
|
first_name: "",
|
|
41
42
|
middle_name: "",
|
|
42
43
|
phone: ""
|
|
43
|
-
}),
|
|
44
|
-
function
|
|
44
|
+
}), P = 0, F = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : "");
|
|
45
|
+
function I(e) {
|
|
45
46
|
return [
|
|
46
47
|
e.last_name,
|
|
47
48
|
e.first_name,
|
|
48
49
|
e.middle_name
|
|
49
50
|
].filter(Boolean).join(" ") || "—";
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function L(e) {
|
|
52
53
|
let t = e.certificate_id_data?.text;
|
|
53
54
|
return t ? `№ ${t}` : "—";
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function R(e) {
|
|
56
57
|
let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
|
|
57
58
|
return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function z(e) {
|
|
60
61
|
return e.membership_enabled !== !1;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
function ne(e, t) {
|
|
64
|
+
if (h.value === e) {
|
|
65
|
+
h.value = null;
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
let n = t.currentTarget.getBoundingClientRect(), r = c.users.find((t) => t.surveyor_id === e), i = (2 + (r &&
|
|
68
|
-
|
|
68
|
+
let n = t.currentTarget.getBoundingClientRect(), r = c.users.find((t) => t.surveyor_id === e), i = (2 + (r && _(r) ? 1 : 0) + (r && f(r) ? 1 : 0)) * 44 + 8, a = window.innerHeight - n.bottom < i + 8 ? n.top - i - 4 : n.bottom + 4, o = Math.min(Math.max(8, n.right - 256), window.innerWidth - 256 - 8);
|
|
69
|
+
v.value = {
|
|
69
70
|
top: `${a}px`,
|
|
70
71
|
left: `${o}px`
|
|
71
|
-
},
|
|
72
|
+
}, h.value = e;
|
|
72
73
|
}
|
|
73
74
|
function B(e) {
|
|
74
75
|
let t = e?.target;
|
|
75
|
-
t instanceof Element && t.closest("[data-user-menu]") || (
|
|
76
|
-
}
|
|
77
|
-
function V() {
|
|
78
|
-
v.value = null, b.value = null, C.value = "";
|
|
76
|
+
t instanceof Element && t.closest("[data-user-menu]") || (h.value = null);
|
|
79
77
|
}
|
|
80
78
|
function U() {
|
|
81
|
-
|
|
79
|
+
y.value = null, x.value = null, w.value = "";
|
|
80
|
+
}
|
|
81
|
+
function W() {
|
|
82
|
+
T.value = "", E.value = [], q.value = !1, O.value = null, k.value = null, A.value = "", M.value = "", w.value = "", y.value = "add";
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
84
|
+
function G(e) {
|
|
85
|
+
h.value = null, x.value = e, N.value = {
|
|
85
86
|
last_name: e.last_name ?? "",
|
|
86
87
|
first_name: e.first_name ?? "",
|
|
87
88
|
middle_name: e.middle_name ?? "",
|
|
88
89
|
phone: e.phone ?? ""
|
|
89
|
-
},
|
|
90
|
+
}, w.value = "", y.value = "edit";
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
92
|
+
function K(e, t) {
|
|
93
|
+
w.value = e instanceof Error ? e.message : t;
|
|
93
94
|
}
|
|
94
|
-
let
|
|
95
|
-
async function
|
|
96
|
-
let e =
|
|
97
|
-
if (
|
|
98
|
-
|
|
95
|
+
let q = j(!1), J = 0;
|
|
96
|
+
async function Y() {
|
|
97
|
+
let e = T.value.trim(), t = ++J;
|
|
98
|
+
if (O.value = null, k.value = null, q.value = e.length >= 2, e.length < 2) {
|
|
99
|
+
E.value = [], D.value = !1;
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
|
-
|
|
102
|
+
D.value = !0;
|
|
102
103
|
try {
|
|
103
|
-
let
|
|
104
|
-
if (t !==
|
|
105
|
-
|
|
104
|
+
let n = await r(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
|
|
105
|
+
if (t !== J) return;
|
|
106
|
+
E.value = (n.data ?? []).map((e) => ({
|
|
106
107
|
...e,
|
|
107
108
|
certificate_id: e.id
|
|
108
109
|
}));
|
|
109
110
|
} catch (e) {
|
|
110
|
-
if (t !==
|
|
111
|
-
|
|
111
|
+
if (t !== J) return;
|
|
112
|
+
E.value = [], K(e, "Не вдалося знайти сертифікати");
|
|
112
113
|
} finally {
|
|
113
|
-
t ===
|
|
114
|
+
t === J && (D.value = !1);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
window.clearTimeout(
|
|
117
|
+
function X() {
|
|
118
|
+
window.clearTimeout(P), P = window.setTimeout(() => void Y(), 300);
|
|
118
119
|
}
|
|
119
|
-
async function
|
|
120
|
-
|
|
120
|
+
async function Z(e) {
|
|
121
|
+
O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "", A.value = e.surveyor_email ?? "", M.value = e.surveyor_phone ?? "", k.value = null, w.value = "";
|
|
121
122
|
try {
|
|
122
|
-
let t = await
|
|
123
|
+
let t = await i("surveyors", {
|
|
123
124
|
page: 1,
|
|
124
125
|
limit: 1,
|
|
125
126
|
filters: { certificate_id: e.certificate_id }
|
|
126
127
|
});
|
|
127
|
-
|
|
128
|
+
k.value = t.rows[0] ?? null, k.value?.registered_at ? M.value = "" : k.value && (A.value = k.value.email || A.value, M.value = k.value.phone || M.value);
|
|
128
129
|
} catch (e) {
|
|
129
|
-
|
|
130
|
+
K(e, "Не вдалося перевірити сертифікат");
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
|
-
async function
|
|
133
|
-
if (!
|
|
134
|
-
if (
|
|
135
|
-
|
|
133
|
+
async function Q() {
|
|
134
|
+
if (!O.value || S.value) return;
|
|
135
|
+
if (k.value && c.users.some((e) => e.surveyor_id === k.value?.surveyor_id)) {
|
|
136
|
+
w.value = "Цей користувач уже є в організації";
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
|
-
let e =
|
|
139
|
+
let e = A.value.trim().toLowerCase();
|
|
139
140
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
140
|
-
|
|
141
|
+
w.value = "Вкажіть коректний email";
|
|
141
142
|
return;
|
|
142
143
|
}
|
|
143
|
-
let t =
|
|
144
|
+
let t = k.value?.registered_at ? k.value : null;
|
|
144
145
|
if (t && e !== (t.email ?? "").trim().toLowerCase()) {
|
|
145
|
-
|
|
146
|
+
w.value = "Email не збігається з email облікового запису цього сертифіката";
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
|
-
|
|
149
|
+
S.value = !0, w.value = "";
|
|
149
150
|
try {
|
|
150
|
-
let
|
|
151
|
+
let n = await r("/api/surveyor/surveyors", {
|
|
151
152
|
method: "POST",
|
|
152
153
|
body: JSON.stringify({
|
|
153
154
|
organization_id: c.orgId,
|
|
154
|
-
certificate_id:
|
|
155
|
+
certificate_id: O.value.certificate_id,
|
|
155
156
|
email: e,
|
|
156
|
-
...t ? {} : { phone:
|
|
157
|
+
...t ? {} : { phone: M.value.trim() }
|
|
157
158
|
})
|
|
158
159
|
});
|
|
159
|
-
H(
|
|
160
|
+
H(n.registration_status === "attached" ? {
|
|
160
161
|
type: "success",
|
|
161
162
|
title: "Користувача додано",
|
|
162
163
|
message: "Наявний обліковий запис прикріплено до організації"
|
|
@@ -164,132 +165,133 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
164
165
|
type: "success",
|
|
165
166
|
title: "Користувача додано",
|
|
166
167
|
message: "На email надіслано лист для завершення реєстрації"
|
|
167
|
-
}),
|
|
168
|
+
}), U(), l("changed");
|
|
168
169
|
} catch (e) {
|
|
169
|
-
|
|
170
|
+
K(e, "Не вдалося додати користувача");
|
|
170
171
|
} finally {
|
|
171
|
-
|
|
172
|
+
S.value = !1;
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
|
-
async function
|
|
175
|
-
if (!
|
|
176
|
-
|
|
175
|
+
async function ie(e) {
|
|
176
|
+
if (!C.value) {
|
|
177
|
+
h.value = null, C.value = e.surveyor_id;
|
|
177
178
|
try {
|
|
178
|
-
await
|
|
179
|
+
await g(e.surveyor_id);
|
|
179
180
|
} finally {
|
|
180
|
-
|
|
181
|
+
C.value = null;
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
185
|
+
function ae(e) {
|
|
186
|
+
f(e) && (h.value = null, V({
|
|
186
187
|
title: "Зміна пароля",
|
|
187
188
|
type: "warning",
|
|
188
|
-
message: `Згенерувати новий пароль для «${
|
|
189
|
+
message: `Згенерувати новий пароль для «${I(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
|
|
189
190
|
confirmButtonText: "Згенерувати",
|
|
190
191
|
cancelButtonText: "Скасувати",
|
|
191
|
-
onConfirm: () =>
|
|
192
|
+
onConfirm: () => d(e.surveyor_id)
|
|
192
193
|
}));
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
let t = !
|
|
197
|
-
|
|
195
|
+
function oe(e) {
|
|
196
|
+
h.value = null;
|
|
197
|
+
let t = !z(e);
|
|
198
|
+
V({
|
|
198
199
|
title: t ? "Активація" : "Деактивація",
|
|
199
200
|
type: t ? "warning" : "error",
|
|
200
|
-
message: t ? `Активувати користувача «${
|
|
201
|
+
message: t ? `Активувати користувача «${I(e)}»?` : `Деактивувати користувача «${I(e)}» в організації «${c.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
|
|
201
202
|
confirmButtonText: t ? "Активувати" : "Деактивувати",
|
|
202
203
|
cancelButtonText: "Скасувати",
|
|
203
204
|
onConfirm: async () => {
|
|
204
|
-
await
|
|
205
|
+
await u(e.surveyor_id, c.orgId, t) && l("changed");
|
|
205
206
|
}
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
|
-
async function
|
|
209
|
-
if (!
|
|
209
|
+
async function se() {
|
|
210
|
+
if (!x.value || S.value) return;
|
|
210
211
|
let e = {
|
|
211
|
-
last_name:
|
|
212
|
-
first_name:
|
|
213
|
-
middle_name:
|
|
214
|
-
phone:
|
|
212
|
+
last_name: N.value.last_name.trim(),
|
|
213
|
+
first_name: N.value.first_name.trim(),
|
|
214
|
+
middle_name: N.value.middle_name.trim(),
|
|
215
|
+
phone: N.value.phone.trim()
|
|
215
216
|
};
|
|
216
217
|
if (!e.last_name || !e.first_name) {
|
|
217
|
-
|
|
218
|
+
w.value = "Прізвище та імʼя обовʼязкові";
|
|
218
219
|
return;
|
|
219
220
|
}
|
|
220
|
-
|
|
221
|
+
S.value = !0, w.value = "";
|
|
221
222
|
try {
|
|
222
|
-
await
|
|
223
|
+
await a("surveyors", x.value.surveyor_id, e), U(), l("changed");
|
|
223
224
|
} catch (e) {
|
|
224
|
-
|
|
225
|
+
K(e, "Не вдалося зберегти користувача");
|
|
225
226
|
} finally {
|
|
226
|
-
|
|
227
|
+
S.value = !1;
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
ee(() => {
|
|
230
231
|
document.addEventListener("click", B), window.addEventListener("resize", B), window.addEventListener("scroll", B, !0);
|
|
231
232
|
}), te(() => {
|
|
232
|
-
window.clearTimeout(
|
|
233
|
+
window.clearTimeout(P), document.removeEventListener("click", B), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0);
|
|
233
234
|
});
|
|
234
235
|
let $ = {
|
|
235
236
|
props: c,
|
|
236
|
-
emit:
|
|
237
|
+
emit: l,
|
|
237
238
|
fieldClass: re,
|
|
238
|
-
openMenuId:
|
|
239
|
-
menuStyle:
|
|
240
|
-
dialog:
|
|
241
|
-
activeUser:
|
|
242
|
-
saving:
|
|
243
|
-
resendingId:
|
|
244
|
-
formError:
|
|
245
|
-
certificateQuery:
|
|
246
|
-
certificates:
|
|
247
|
-
certificatesLoading:
|
|
248
|
-
selectedCertificate:
|
|
249
|
-
existingSurveyor:
|
|
250
|
-
addEmail:
|
|
251
|
-
addPhone:
|
|
252
|
-
editDraft:
|
|
239
|
+
openMenuId: h,
|
|
240
|
+
menuStyle: v,
|
|
241
|
+
dialog: y,
|
|
242
|
+
activeUser: x,
|
|
243
|
+
saving: S,
|
|
244
|
+
resendingId: C,
|
|
245
|
+
formError: w,
|
|
246
|
+
certificateQuery: T,
|
|
247
|
+
certificates: E,
|
|
248
|
+
certificatesLoading: D,
|
|
249
|
+
selectedCertificate: O,
|
|
250
|
+
existingSurveyor: k,
|
|
251
|
+
addEmail: A,
|
|
252
|
+
addPhone: M,
|
|
253
|
+
editDraft: N,
|
|
253
254
|
get searchTimer() {
|
|
254
|
-
return
|
|
255
|
+
return P;
|
|
255
256
|
},
|
|
256
257
|
set searchTimer(e) {
|
|
257
|
-
|
|
258
|
+
P = e;
|
|
258
259
|
},
|
|
259
|
-
dialogTitle:
|
|
260
|
-
personName:
|
|
261
|
-
certificateLabel:
|
|
262
|
-
certificatePerson:
|
|
263
|
-
membershipEnabled:
|
|
264
|
-
toggleMenu:
|
|
260
|
+
dialogTitle: F,
|
|
261
|
+
personName: I,
|
|
262
|
+
certificateLabel: L,
|
|
263
|
+
certificatePerson: R,
|
|
264
|
+
membershipEnabled: z,
|
|
265
|
+
toggleMenu: ne,
|
|
265
266
|
closeMenu: B,
|
|
266
|
-
closeDialog:
|
|
267
|
-
openAdd:
|
|
268
|
-
openEdit:
|
|
269
|
-
fail:
|
|
270
|
-
searched:
|
|
267
|
+
closeDialog: U,
|
|
268
|
+
openAdd: W,
|
|
269
|
+
openEdit: G,
|
|
270
|
+
fail: K,
|
|
271
|
+
searched: q,
|
|
271
272
|
get searchSeq() {
|
|
272
|
-
return
|
|
273
|
+
return J;
|
|
273
274
|
},
|
|
274
275
|
set searchSeq(e) {
|
|
275
|
-
|
|
276
|
+
J = e;
|
|
276
277
|
},
|
|
277
|
-
searchCertificates:
|
|
278
|
-
onCertificateInput:
|
|
279
|
-
chooseCertificate:
|
|
280
|
-
submitAdd:
|
|
281
|
-
resendRegistrationInvite:
|
|
282
|
-
resetPassword:
|
|
283
|
-
toggleAccess:
|
|
284
|
-
submitEdit:
|
|
278
|
+
searchCertificates: Y,
|
|
279
|
+
onCertificateInput: X,
|
|
280
|
+
chooseCertificate: Z,
|
|
281
|
+
submitAdd: Q,
|
|
282
|
+
resendRegistrationInvite: ie,
|
|
283
|
+
resetPassword: ae,
|
|
284
|
+
toggleAccess: oe,
|
|
285
|
+
submitEdit: se,
|
|
285
286
|
AppIcon: t,
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
SurveyorTeleport: p,
|
|
288
|
+
BaseModal: m,
|
|
289
|
+
UserAccessBadge: s,
|
|
288
290
|
get canResendSurveyorRegistration() {
|
|
289
|
-
return
|
|
291
|
+
return _;
|
|
290
292
|
},
|
|
291
293
|
get canResetSurveyorPassword() {
|
|
292
|
-
return
|
|
294
|
+
return f;
|
|
293
295
|
}
|
|
294
296
|
};
|
|
295
297
|
return Object.defineProperty($, "__isScriptSetup", {
|
|
@@ -300,7 +302,7 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
300
302
|
}), W = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, G = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, K = { class: "flex items-center gap-2.5" }, q = { class: "text-brand-600" }, J = { class: "overflow-x-auto" }, Y = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, X = { class: "divide-y divide-slate-100" }, Z = { class: "px-5 py-3.5" }, Q = { class: "font-semibold text-slate-800" }, ie = {
|
|
301
303
|
key: 0,
|
|
302
304
|
class: "mt-1 text-xs text-slate-400"
|
|
303
|
-
}, ae = { class: "px-5 py-3.5 leading-snug text-slate-600" }, oe = { class: "px-5 py-3.5 leading-snug text-slate-600" },
|
|
305
|
+
}, ae = { class: "px-5 py-3.5 leading-snug text-slate-600" }, oe = { class: "px-5 py-3.5 leading-snug text-slate-600" }, se = { class: "px-5 py-3.5 text-slate-600" }, $ = { class: "px-5 py-3.5" }, ce = { class: "px-5 py-3.5 text-center" }, le = [
|
|
304
306
|
"aria-label",
|
|
305
307
|
"aria-expanded",
|
|
306
308
|
"onClick"
|
|
@@ -362,15 +364,15 @@ function Ie(e, t, n, r, i, a) {
|
|
|
362
364
|
C("th", { class: "px-5 py-3" }, "Статус"),
|
|
363
365
|
C("th", { class: "px-5 py-3 text-center" }, "Дії")
|
|
364
366
|
])], -1),
|
|
365
|
-
C("tbody", X, [(A(!0), S(
|
|
367
|
+
C("tbody", X, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
|
|
366
368
|
key: e.surveyor_id,
|
|
367
369
|
class: "align-top transition-colors hover:bg-brand-50/40"
|
|
368
370
|
}, [
|
|
369
371
|
C("td", Z, [C("p", Q, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ie, "Реєстрацію не завершено"))]),
|
|
370
372
|
C("td", ae, N(r.certificateLabel(e)), 1),
|
|
371
373
|
C("td", oe, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
|
|
372
|
-
C("td",
|
|
373
|
-
C("td",
|
|
374
|
+
C("td", se, N(n.orgName), 1),
|
|
375
|
+
C("td", $, [E(r.UserAccessBadge, {
|
|
374
376
|
"account-blocked": e.enabled === !1,
|
|
375
377
|
"membership-disabled": !r.membershipEnabled(e)
|
|
376
378
|
}, null, 8, ["account-blocked", "membership-disabled"])]),
|
|
@@ -384,48 +386,51 @@ function Ie(e, t, n, r, i, a) {
|
|
|
384
386
|
}, [E(r.AppIcon, {
|
|
385
387
|
name: "more-vertical",
|
|
386
388
|
class: "h-4 w-4"
|
|
387
|
-
})], 8, le), (
|
|
388
|
-
|
|
389
|
-
"data-user-menu": "",
|
|
390
|
-
class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
|
|
391
|
-
style: k(r.menuStyle)
|
|
392
|
-
}, [
|
|
393
|
-
C("button", {
|
|
394
|
-
type: "button",
|
|
395
|
-
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
|
|
396
|
-
onClick: (t) => r.openEdit(e)
|
|
397
|
-
}, [E(r.AppIcon, {
|
|
398
|
-
name: "pencil",
|
|
399
|
-
class: "h-4 w-4 text-slate-400"
|
|
400
|
-
}), t[11] ||= T(" Редагувати ", -1)], 8, ue),
|
|
401
|
-
r.canResendSurveyorRegistration(e) ? (A(), S("button", {
|
|
389
|
+
})], 8, le), E(r.SurveyorTeleport, null, {
|
|
390
|
+
default: I(() => [r.openMenuId === e.surveyor_id ? (A(), S("div", {
|
|
402
391
|
key: 0,
|
|
403
|
-
|
|
404
|
-
class: "
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
392
|
+
"data-user-menu": "",
|
|
393
|
+
class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
|
|
394
|
+
style: k(r.menuStyle)
|
|
395
|
+
}, [
|
|
396
|
+
C("button", {
|
|
397
|
+
type: "button",
|
|
398
|
+
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
|
|
399
|
+
onClick: (t) => r.openEdit(e)
|
|
400
|
+
}, [E(r.AppIcon, {
|
|
401
|
+
name: "pencil",
|
|
402
|
+
class: "h-4 w-4 text-slate-400"
|
|
403
|
+
}), t[11] ||= T(" Редагувати ", -1)], 8, ue),
|
|
404
|
+
r.canResendSurveyorRegistration(e) ? (A(), S("button", {
|
|
405
|
+
key: 0,
|
|
406
|
+
type: "button",
|
|
407
|
+
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
|
|
408
|
+
disabled: r.resendingId === e.surveyor_id,
|
|
409
|
+
onClick: (t) => r.resendRegistrationInvite(e)
|
|
410
|
+
}, [E(r.AppIcon, {
|
|
411
|
+
name: "send",
|
|
412
|
+
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
413
|
+
}), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, de)) : x("", !0),
|
|
414
|
+
r.canResetSurveyorPassword(e) ? (A(), S("button", {
|
|
415
|
+
key: 1,
|
|
416
|
+
type: "button",
|
|
417
|
+
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
|
|
418
|
+
onClick: (t) => r.resetPassword(e)
|
|
419
|
+
}, [E(r.AppIcon, {
|
|
420
|
+
name: "key-round",
|
|
421
|
+
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
422
|
+
}), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, fe)) : x("", !0),
|
|
423
|
+
C("button", {
|
|
424
|
+
type: "button",
|
|
425
|
+
class: O(["flex w-full items-center gap-2 px-3 py-2.5 text-sm transition-colors", r.membershipEnabled(e) ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
|
|
426
|
+
onClick: (t) => r.toggleAccess(e)
|
|
427
|
+
}, [E(r.AppIcon, {
|
|
428
|
+
name: r.membershipEnabled(e) ? "user-x" : "power",
|
|
429
|
+
class: O(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
|
|
430
|
+
}, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, pe)
|
|
431
|
+
], 4)) : x("", !0)]),
|
|
432
|
+
_: 2
|
|
433
|
+
}, 1024)])
|
|
429
434
|
]))), 128)), n.users.length === 0 ? (A(), S("tr", me, [...t[13] ||= [C("td", {
|
|
430
435
|
colspan: "6",
|
|
431
436
|
class: "px-5 py-12 text-center text-sm text-slate-400"
|
|
@@ -458,12 +463,12 @@ function Ie(e, t, n, r, i, a) {
|
|
|
458
463
|
placeholder: "Номер або прізвище",
|
|
459
464
|
onInput: r.onCertificateInput
|
|
460
465
|
}, null, 544), [[P, r.certificateQuery]])]),
|
|
461
|
-
r.certificatesLoading ? (A(), S("p", _e, "Пошук…")) : r.certificates.length ? (A(), S("ul", ve, [(A(!0), S(
|
|
466
|
+
r.certificatesLoading ? (A(), S("p", _e, "Пошук…")) : r.certificates.length ? (A(), S("ul", ve, [(A(!0), S(y, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
|
|
462
467
|
type: "button",
|
|
463
468
|
class: "flex w-full flex-col px-3 py-2 text-left text-sm hover:bg-slate-50",
|
|
464
469
|
onClick: (t) => r.chooseCertificate(e)
|
|
465
470
|
}, [C("span", be, "№ " + N(e.number_certificate || "—"), 1), C("span", xe, N(r.certificatePerson(e)), 1)], 8, ye)]))), 128))])) : r.searched && !r.selectedCertificate ? (A(), S("p", Se, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : x("", !0),
|
|
466
|
-
r.selectedCertificate ? (A(), S(
|
|
471
|
+
r.selectedCertificate ? (A(), S(y, { key: 3 }, [
|
|
467
472
|
r.existingSurveyor?.registered_at ? (A(), S("p", Ce, " Обліковий запис уже є: " + N(r.personName(r.existingSurveyor)) + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
|
|
468
473
|
C("label", we, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
|
|
469
474
|
"onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
|
|
@@ -505,18 +510,18 @@ function Ie(e, t, n, r, i, a) {
|
|
|
505
510
|
}, 8, ["model-value", "title"])
|
|
506
511
|
]);
|
|
507
512
|
}
|
|
508
|
-
var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "
|
|
513
|
+
var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Re = /*@__PURE__*/ D({
|
|
509
514
|
__name: "card",
|
|
510
|
-
setup(e, { expose:
|
|
511
|
-
|
|
512
|
-
let
|
|
513
|
-
let e =
|
|
515
|
+
setup(e, { expose: i }) {
|
|
516
|
+
i();
|
|
517
|
+
let a = ne(), { listPath: s } = n(), u = B(), d = j(null), f = j(!1), p = j(""), m = j(null), g = b(() => a.query.edit === "1"), _ = b(() => d.value?.surveyors ?? []), y = b(() => {
|
|
518
|
+
let e = d.value;
|
|
514
519
|
return e ? {
|
|
515
520
|
...e,
|
|
516
521
|
id: e.org_id
|
|
517
522
|
} : null;
|
|
518
523
|
});
|
|
519
|
-
function
|
|
524
|
+
function x(e) {
|
|
520
525
|
let t = e.split(".")[0] ?? "", n = t.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - t.length % 4) % 4);
|
|
521
526
|
try {
|
|
522
527
|
return atob(n).split(/[/\\]/).pop() || "Скан-копія";
|
|
@@ -524,24 +529,24 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "D:/Softpro/surveyor/adm
|
|
|
524
529
|
return "Скан-копія";
|
|
525
530
|
}
|
|
526
531
|
}
|
|
527
|
-
function
|
|
532
|
+
function S(e, t = !1) {
|
|
528
533
|
let n = `/api/file/${encodeURIComponent(e)}`;
|
|
529
534
|
return t ? `${n}?download=true` : n;
|
|
530
535
|
}
|
|
531
|
-
function
|
|
532
|
-
|
|
533
|
-
...
|
|
536
|
+
function C() {
|
|
537
|
+
u.replace({ query: {
|
|
538
|
+
...a.query,
|
|
534
539
|
edit: "1"
|
|
535
540
|
} });
|
|
536
541
|
}
|
|
537
|
-
function
|
|
538
|
-
let e = { ...
|
|
539
|
-
delete e.edit,
|
|
542
|
+
function w() {
|
|
543
|
+
let e = { ...a.query };
|
|
544
|
+
delete e.edit, u.replace({ query: e });
|
|
540
545
|
}
|
|
541
|
-
async function
|
|
542
|
-
let e =
|
|
543
|
-
if (
|
|
544
|
-
await
|
|
546
|
+
async function T() {
|
|
547
|
+
let e = d.value?.org_id;
|
|
548
|
+
if (w(), e) try {
|
|
549
|
+
await E(e);
|
|
545
550
|
} catch (e) {
|
|
546
551
|
H({
|
|
547
552
|
type: "error",
|
|
@@ -550,23 +555,23 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "D:/Softpro/surveyor/adm
|
|
|
550
555
|
});
|
|
551
556
|
}
|
|
552
557
|
}
|
|
553
|
-
async function
|
|
554
|
-
|
|
558
|
+
async function E(e) {
|
|
559
|
+
d.value = await r(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
|
|
555
560
|
}
|
|
556
|
-
async function
|
|
557
|
-
|
|
561
|
+
async function D(e) {
|
|
562
|
+
f.value = !0, p.value = "", d.value = null;
|
|
558
563
|
try {
|
|
559
|
-
await
|
|
564
|
+
await E(e);
|
|
560
565
|
} catch (e) {
|
|
561
|
-
|
|
566
|
+
d.value = null, p.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
|
|
562
567
|
} finally {
|
|
563
|
-
|
|
568
|
+
f.value = !1;
|
|
564
569
|
}
|
|
565
570
|
}
|
|
566
|
-
async function
|
|
567
|
-
let e =
|
|
571
|
+
async function O() {
|
|
572
|
+
let e = d.value?.org_id;
|
|
568
573
|
if (e) try {
|
|
569
|
-
await
|
|
574
|
+
await E(e);
|
|
570
575
|
} catch (e) {
|
|
571
576
|
H({
|
|
572
577
|
type: "error",
|
|
@@ -575,44 +580,45 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "D:/Softpro/surveyor/adm
|
|
|
575
580
|
});
|
|
576
581
|
}
|
|
577
582
|
}
|
|
578
|
-
F(() => String(
|
|
579
|
-
e &&
|
|
583
|
+
F(() => String(a.params.id), (e) => {
|
|
584
|
+
e && D(e);
|
|
580
585
|
}, { immediate: !0 });
|
|
581
|
-
let
|
|
582
|
-
route:
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
586
|
+
let k = {
|
|
587
|
+
route: a,
|
|
588
|
+
listPath: s,
|
|
589
|
+
router: u,
|
|
590
|
+
organization: d,
|
|
591
|
+
loading: f,
|
|
592
|
+
error: p,
|
|
593
|
+
formRef: m,
|
|
594
|
+
editing: g,
|
|
595
|
+
users: _,
|
|
596
|
+
editRecord: y,
|
|
597
|
+
fileName: x,
|
|
598
|
+
fileUrl: S,
|
|
599
|
+
startEdit: C,
|
|
600
|
+
cancelEdit: w,
|
|
601
|
+
onFormSaved: T,
|
|
602
|
+
fetchOrganization: E,
|
|
603
|
+
loadOrganization: D,
|
|
604
|
+
refreshOrganization: O,
|
|
599
605
|
AppIcon: t,
|
|
600
606
|
get RouterLink() {
|
|
601
607
|
return z;
|
|
602
608
|
},
|
|
603
|
-
RegistryForm:
|
|
604
|
-
VerifiedBadge:
|
|
605
|
-
AppealDetailSection:
|
|
606
|
-
AppealDetailField:
|
|
609
|
+
RegistryForm: h,
|
|
610
|
+
VerifiedBadge: o,
|
|
611
|
+
AppealDetailSection: c,
|
|
612
|
+
AppealDetailField: l,
|
|
607
613
|
OrganizationUsers: Le,
|
|
608
614
|
get organizationForm() {
|
|
609
|
-
return
|
|
615
|
+
return v;
|
|
610
616
|
}
|
|
611
617
|
};
|
|
612
|
-
return Object.defineProperty(
|
|
618
|
+
return Object.defineProperty(k, "__isScriptSetup", {
|
|
613
619
|
enumerable: !1,
|
|
614
620
|
value: !0
|
|
615
|
-
}),
|
|
621
|
+
}), k;
|
|
616
622
|
}
|
|
617
623
|
}), ze = {
|
|
618
624
|
key: 0,
|
|
@@ -630,7 +636,7 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "D:/Softpro/surveyor/adm
|
|
|
630
636
|
function nt(e, t, n, r, i, a) {
|
|
631
637
|
return r.loading ? (A(), S("div", ze, " Завантаження… ")) : r.organization ? (A(), S("div", Be, [C("header", Ve, [C("nav", He, [
|
|
632
638
|
E(r.RouterLink, {
|
|
633
|
-
to:
|
|
639
|
+
to: r.listPath,
|
|
634
640
|
class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
|
|
635
641
|
}, {
|
|
636
642
|
default: I(() => [E(r.AppIcon, {
|
|
@@ -638,7 +644,7 @@ function nt(e, t, n, r, i, a) {
|
|
|
638
644
|
class: "h-3.5 w-3.5"
|
|
639
645
|
}), t[1] ||= T(" Організації ", -1)]),
|
|
640
646
|
_: 1
|
|
641
|
-
}),
|
|
647
|
+
}, 8, ["to"]),
|
|
642
648
|
t[2] ||= C("span", { class: "text-slate-300" }, "/", -1),
|
|
643
649
|
C("span", Ue, N(r.organization.name), 1)
|
|
644
650
|
]), C("div", We, [C("h1", Ge, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
|
|
@@ -664,7 +670,7 @@ function nt(e, t, n, r, i, a) {
|
|
|
664
670
|
type: "button",
|
|
665
671
|
class: "inline-flex h-10 items-center rounded-lg bg-brand-600 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-700",
|
|
666
672
|
onClick: t[0] ||= (e) => r.formRef?.submit()
|
|
667
|
-
}, " Зберегти зміни ")])])) : (A(), S(
|
|
673
|
+
}, " Зберегти зміни ")])])) : (A(), S(y, { key: 1 }, [E(r.AppealDetailSection, { title: "Інформація про організацію" }, {
|
|
668
674
|
icon: I(() => [E(r.AppIcon, {
|
|
669
675
|
name: "building-2",
|
|
670
676
|
class: "h-[18px] w-[18px]"
|
|
@@ -727,13 +733,13 @@ function nt(e, t, n, r, i, a) {
|
|
|
727
733
|
"org-name",
|
|
728
734
|
"users"
|
|
729
735
|
])])])) : (A(), S("div", et, [C("p", tt, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
|
|
730
|
-
to:
|
|
736
|
+
to: r.listPath,
|
|
731
737
|
class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
|
|
732
738
|
}, {
|
|
733
739
|
default: I(() => [...t[8] ||= [T(" Повернутися до реєстру ", -1)]]),
|
|
734
740
|
_: 1
|
|
735
|
-
})]));
|
|
741
|
+
}, 8, ["to"])]));
|
|
736
742
|
}
|
|
737
|
-
var rt = /*#__PURE__*/ e(Re, [["render", nt], ["__file", "
|
|
743
|
+
var rt = /*#__PURE__*/ e(Re, [["render", nt], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
|
|
738
744
|
//#endregion
|
|
739
745
|
export { rt as default };
|