@opengis/surveyor 0.0.11 → 0.0.12
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/{AppIcon-CCLzEE-_.js → AppIcon-CO70tpMX.js} +1 -1
- package/dist/chunks/{AppealDetailField-CI-1qhs3.js → AppealDetailField-DNRGpnyD.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-CzzI6x8I.js → AppealStatusBadge-BlAaNUSK.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-DYBe9hqP.js → AppealStatusBadge-Ct3EcB4_.js} +15 -1
- package/dist/chunks/{ApplicationHistorySection-CPCU_DXH.js → ApplicationHistorySection-D7KPV2cX.js} +155 -141
- package/dist/chunks/{BaseModal-DnwqlJhc.js → BaseModal-SjP521X9.js} +2 -2
- package/dist/chunks/{FormFilePicker-Dss6pGmO.js → FormFilePicker-DxPQlxgy.js} +2 -2
- package/dist/chunks/{MapLayerMenu-DjYCxEc3.js → MapLayerMenu-AUeTqgEp.js} +1 -1
- package/dist/chunks/{RegistryForm-CEUqFmsF.js → RegistryForm-BlK1lExt.js} +2 -2
- package/dist/chunks/{RegistryFormModal-C-Z4MMHi.js → RegistryFormModal-DhzEpxys.js} +3 -3
- package/dist/chunks/{RegistryToolbar-CI1MRqzw.js → RegistryToolbar-DXOEcD84.js} +45 -154
- package/dist/chunks/{SurveyorTeleport-BLEO6we9.js → SurveyorTeleport-CnSF0Ptl.js} +1 -1
- package/dist/chunks/TablePagination-CUtnDQQ_.js +116 -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-B__Vs_ce.js → VerifiedBadge-bk0n-rlC.js} +2 -2
- package/dist/chunks/{buildSchema-CccjX9TJ.js → buildSchema-DEfhZEM8.js} +1 -1
- package/dist/chunks/{card-BElHsAFl.js → card-BBx1zR0E.js} +316 -306
- package/dist/chunks/{card-CUDo4kUH.js → card-Bj4zFzbe.js} +47 -44
- package/dist/chunks/{card-DL7yHB1C.js → card-C-ohjNkC.js} +5 -5
- package/dist/chunks/{card-UG1mWhcg.js → card-DEJs9IIP.js} +6 -6
- package/dist/chunks/card-VnUCFC7v.js +609 -0
- package/dist/chunks/{card-sDIYR6YI.js → card-_YyJbLNI.js} +13 -10
- package/dist/chunks/{certificates-BnseQylH.js → certificates-Be6u7Cix.js} +1 -1
- package/dist/chunks/{certificates-DKi9CSfc.js → certificates-DtfZTFN9.js} +13 -12
- package/dist/chunks/{create-DVZv77Uw.js → create-Cgeu7aKO.js} +348 -293
- package/dist/chunks/{filterQuery-CvfZrkTC.js → filterQuery-Dka-mIso.js} +7 -3
- package/dist/chunks/{forgot-BVzXMKGA.js → forgot-DoG6vXhq.js} +2 -2
- package/dist/chunks/{form-DDjELqZ9.js → form-CEfc_shb.js} +1 -1
- package/dist/chunks/{form-Bh6i5n1U.js → form-DZ3CbtkT.js} +1 -1
- package/dist/chunks/{login-BCib_dtl.js → login-BWGylcSU.js} +2 -2
- package/dist/chunks/{map-CNX1_COE.js → map-DkKsEnCM.js} +1126 -831
- package/dist/chunks/{map-layers-CCJ7G7ZK.js → map-layers-BmuIMLHa.js} +13 -12
- package/dist/chunks/{organizations-BuMFRKjw.js → organizations-BO1dIl7v.js} +15 -14
- package/dist/chunks/{profile-BI_RIHN1.js → profile-CkwMFh82.js} +3 -3
- package/dist/chunks/{registration-6nn7GgDS.js → registration-3GLgq-ae.js} +2 -2
- package/dist/chunks/{requests-DQRmDemb.js → requests-BZ2jrt5J.js} +12 -11
- package/dist/chunks/{requests-Dh5jxF06.js → requests-rWq8ok3C.js} +5 -5
- package/dist/chunks/{resendSurveyorRegistration-BHTTVIw1.js → resendSurveyorRegistration-BQjL9IgM.js} +1 -1
- package/dist/chunks/{reset-D2uXDfB6.js → reset-CP9LsLkC.js} +2 -2
- package/dist/chunks/{resources-2e8RFqWR.js → resources-Cj8BzrBX.js} +18 -13
- package/dist/chunks/{surveyorAccount-C7UiiIYg.js → surveyorAccount-Cfba7ZVZ.js} +1 -1
- package/dist/chunks/{useEntityPath-n7hCq8zh.js → useEntityPath-C5Owtidc.js} +1 -1
- package/dist/chunks/{users-LbXn1F2y.js → users-DOiQeVwn.js} +15 -14
- package/dist/index.css +1 -1
- package/dist/index.js +40 -40
- package/package.json +1 -1
- package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -41
- package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -79
- package/dist/chunks/card-CU2THiBT.js +0 -539
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
-
import { n as t, t as n } from "./useEntityPath-
|
|
3
|
-
import {
|
|
4
|
-
import { t as a } from "./VerifiedBadge-
|
|
5
|
-
import { t as o } from "./UserAccessBadge-
|
|
6
|
-
import { n as s, t as c } from "./AppealDetailField-
|
|
7
|
-
import { i as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { RouterLink as z, useRoute as B, useRouter as
|
|
16
|
-
import { confirm as
|
|
2
|
+
import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
|
|
3
|
+
import { c as r, s as i } from "./resources-Cj8BzrBX.js";
|
|
4
|
+
import { t as a } from "./VerifiedBadge-bk0n-rlC.js";
|
|
5
|
+
import { t as o } from "./UserAccessBadge-DyZDv7Oo.js";
|
|
6
|
+
import { n as s, t as c } from "./AppealDetailField-DNRGpnyD.js";
|
|
7
|
+
import { i as ee, r as l, t as u } from "./surveyorAccount-Cfba7ZVZ.js";
|
|
8
|
+
import { t as d } from "./SurveyorTeleport-CnSF0Ptl.js";
|
|
9
|
+
import { t as f } from "./BaseModal-SjP521X9.js";
|
|
10
|
+
import { t as p } from "./RegistryForm-BlK1lExt.js";
|
|
11
|
+
import { n as m } from "./certificates-Be6u7Cix.js";
|
|
12
|
+
import { n as h, t as g } from "./resendSurveyorRegistration-BQjL9IgM.js";
|
|
13
|
+
import { t as _ } from "./form-CEfc_shb.js";
|
|
14
|
+
import { Fragment as v, computed as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, defineComponent as E, normalizeClass as D, normalizeStyle as O, onMounted as te, onUnmounted as ne, openBlock as k, ref as A, renderList as j, resolveComponent as M, toDisplayString as N, vModelText as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
|
|
15
|
+
import { RouterLink as z, useRoute as B, useRouter as re } from "vue-router";
|
|
16
|
+
import { confirm as ie, notify as V } from "@opengis/core";
|
|
17
17
|
//#region admin/src/components/ui/ValidityBadge.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
-
var
|
|
18
|
+
var H = /*@__PURE__*/ E({
|
|
19
19
|
__name: "ValidityBadge",
|
|
20
20
|
props: { validity: {
|
|
21
21
|
type: [String, null],
|
|
@@ -25,7 +25,7 @@ var U = /*@__PURE__*/ D({
|
|
|
25
25
|
t();
|
|
26
26
|
let n = e, r = {
|
|
27
27
|
props: n,
|
|
28
|
-
config:
|
|
28
|
+
config: y(() => m[n.validity ?? ""] ?? m.no_data)
|
|
29
29
|
};
|
|
30
30
|
return Object.defineProperty(r, "__isScriptSetup", {
|
|
31
31
|
enumerable: !1,
|
|
@@ -35,14 +35,14 @@ var U = /*@__PURE__*/ D({
|
|
|
35
35
|
});
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region admin/src/components/ui/ValidityBadge.vue
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function U(e, t, n, r, i, a) {
|
|
39
|
+
return k(), x("span", { class: D(["inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium", [
|
|
40
40
|
r.config.bg,
|
|
41
41
|
r.config.text,
|
|
42
42
|
r.config.border
|
|
43
|
-
]]) }, [
|
|
43
|
+
]]) }, [S("span", { class: D(["h-1.5 w-1.5 rounded-full", r.config.dot]) }, null, 2), w(" " + N(r.config.label), 1)], 2);
|
|
44
44
|
}
|
|
45
|
-
var
|
|
45
|
+
var ae = /*#__PURE__*/ e(H, [["render", U], ["__file", "C:/softpro/surveyor/admin/src/components/ui/ValidityBadge.vue"]]), oe = "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", W = /*@__PURE__*/ E({
|
|
46
46
|
__name: "OrganizationUsers",
|
|
47
47
|
props: {
|
|
48
48
|
orgId: {
|
|
@@ -61,126 +61,126 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/Softpro/surveyor/admi
|
|
|
61
61
|
emits: ["changed"],
|
|
62
62
|
setup(e, { expose: n, emit: a }) {
|
|
63
63
|
n();
|
|
64
|
-
let s = e, c = a,
|
|
64
|
+
let s = e, c = a, p = A(null), _ = A({
|
|
65
65
|
top: "0px",
|
|
66
66
|
left: "0px"
|
|
67
|
-
}),
|
|
67
|
+
}), v = A(null), b = A(null), x = A(!1), S = A(null), C = A(""), w = A(""), T = A([]), E = A(!1), D = A(null), O = A(""), k = A(""), j = A({
|
|
68
68
|
last_name: "",
|
|
69
69
|
first_name: "",
|
|
70
70
|
middle_name: "",
|
|
71
71
|
phone: ""
|
|
72
|
-
}),
|
|
73
|
-
function
|
|
72
|
+
}), M = 0, N = y(() => v.value === "add" ? "Додати користувача" : v.value === "edit" ? "Редагувати користувача" : ""), P = y(() => D.value?.certificate_status === "valid"), F = y(() => m[D.value?.certificate_status ?? ""]?.label ?? ""), I = y(() => D.value?.account_registered_at ? D.value : null);
|
|
73
|
+
function L(e) {
|
|
74
74
|
return [
|
|
75
75
|
e.last_name,
|
|
76
76
|
e.first_name,
|
|
77
77
|
e.middle_name
|
|
78
78
|
].filter(Boolean).join(" ") || "—";
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function R(e) {
|
|
81
81
|
let t = e.certificate_id_data?.text;
|
|
82
82
|
return t ? `№ ${t}` : "—";
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function z(e) {
|
|
85
85
|
let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
|
|
86
86
|
return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function B(e) {
|
|
89
89
|
return e.membership_enabled !== !1;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
if (
|
|
93
|
-
|
|
91
|
+
function re(e, t) {
|
|
92
|
+
if (p.value === e) {
|
|
93
|
+
p.value = null;
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r &&
|
|
97
|
-
|
|
96
|
+
let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r && g(r) ? 1 : 0) + (r && u(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);
|
|
97
|
+
_.value = {
|
|
98
98
|
top: `${a}px`,
|
|
99
99
|
left: `${o}px`
|
|
100
|
-
},
|
|
100
|
+
}, p.value = e;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function H(e) {
|
|
103
103
|
let t = e?.target;
|
|
104
|
-
t instanceof Element && t.closest("[data-user-menu]") || (
|
|
104
|
+
t instanceof Element && t.closest("[data-user-menu]") || (p.value = null);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
106
|
+
function U() {
|
|
107
|
+
v.value = null, b.value = null, C.value = "";
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
109
|
+
function W() {
|
|
110
|
+
w.value = "", T.value = [], q.value = !1, D.value = null, O.value = "", k.value = "", C.value = "", v.value = "add";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
112
|
+
function G(e) {
|
|
113
|
+
p.value = null, b.value = e, j.value = {
|
|
114
114
|
last_name: e.last_name ?? "",
|
|
115
115
|
first_name: e.first_name ?? "",
|
|
116
116
|
middle_name: e.middle_name ?? "",
|
|
117
117
|
phone: e.phone ?? ""
|
|
118
|
-
},
|
|
118
|
+
}, C.value = "", v.value = "edit";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
|
|
120
|
+
function K(e, t) {
|
|
121
|
+
C.value = e instanceof Error ? e.message : t;
|
|
122
122
|
}
|
|
123
|
-
let
|
|
124
|
-
async function
|
|
125
|
-
let e =
|
|
126
|
-
if (
|
|
127
|
-
|
|
123
|
+
let q = A(!1), J = 0;
|
|
124
|
+
async function Y() {
|
|
125
|
+
let e = w.value.trim(), t = ++J;
|
|
126
|
+
if (D.value = null, q.value = e.length >= 2, e.length < 2) {
|
|
127
|
+
T.value = [], E.value = !1;
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
E.value = !0;
|
|
131
131
|
try {
|
|
132
|
-
let n = await
|
|
133
|
-
if (t !==
|
|
134
|
-
|
|
132
|
+
let n = await i(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
|
|
133
|
+
if (t !== J) return;
|
|
134
|
+
T.value = (n.data ?? []).map((e) => ({
|
|
135
135
|
...e,
|
|
136
136
|
certificate_id: e.id
|
|
137
137
|
}));
|
|
138
138
|
} catch (e) {
|
|
139
|
-
if (t !==
|
|
140
|
-
|
|
139
|
+
if (t !== J) return;
|
|
140
|
+
T.value = [], K(e, "Не вдалося знайти сертифікати");
|
|
141
141
|
} finally {
|
|
142
|
-
t ===
|
|
142
|
+
t === J && (E.value = !1);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
window.clearTimeout(
|
|
145
|
+
function X() {
|
|
146
|
+
window.clearTimeout(M), M = window.setTimeout(() => void Y(), 300);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
148
|
+
function Z(e) {
|
|
149
|
+
D.value = e, T.value = [], w.value = e.text?.trim() || e.number_certificate || "", O.value = e.account_email || e.surveyor_email || "", k.value = e.account_registered_at ? "" : e.account_phone || e.surveyor_phone || "", C.value = "";
|
|
150
150
|
}
|
|
151
151
|
async function se() {
|
|
152
|
-
let e =
|
|
153
|
-
if (!e ||
|
|
154
|
-
if (!
|
|
155
|
-
|
|
152
|
+
let e = D.value;
|
|
153
|
+
if (!e || x.value) return;
|
|
154
|
+
if (!P.value) {
|
|
155
|
+
C.value = "Додати користувача можна лише за дійсним сертифікатом";
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
if (e.account_id && s.users.some((t) => t.surveyor_id === e.account_id)) {
|
|
159
|
-
|
|
159
|
+
C.value = "Цей користувач уже є в організації";
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
let t =
|
|
162
|
+
let t = O.value.trim().toLowerCase();
|
|
163
163
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)) {
|
|
164
|
-
|
|
164
|
+
C.value = "Вкажіть коректний email";
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
let n =
|
|
167
|
+
let n = I.value;
|
|
168
168
|
if (n && t !== (n.account_email ?? "").trim().toLowerCase()) {
|
|
169
|
-
|
|
169
|
+
C.value = "Email не збігається з email облікового запису цього сертифіката";
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
x.value = !0, C.value = "";
|
|
173
173
|
try {
|
|
174
|
-
let
|
|
174
|
+
let r = await i("/api/surveyor/surveyors", {
|
|
175
175
|
method: "POST",
|
|
176
176
|
body: JSON.stringify({
|
|
177
177
|
organization_id: s.orgId,
|
|
178
178
|
certificate_id: e.certificate_id,
|
|
179
179
|
email: t,
|
|
180
|
-
...n ? {} : { phone:
|
|
180
|
+
...n ? {} : { phone: k.value.trim() }
|
|
181
181
|
})
|
|
182
182
|
});
|
|
183
|
-
|
|
183
|
+
V(r.registration_status === "attached" ? {
|
|
184
184
|
type: "success",
|
|
185
185
|
title: "Користувача додано",
|
|
186
186
|
message: "Наявний обліковий запис прикріплено до організації"
|
|
@@ -188,136 +188,136 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/Softpro/surveyor/admi
|
|
|
188
188
|
type: "success",
|
|
189
189
|
title: "Користувача додано",
|
|
190
190
|
message: "На email надіслано лист для завершення реєстрації"
|
|
191
|
-
}),
|
|
191
|
+
}), U(), c("changed");
|
|
192
192
|
} catch (e) {
|
|
193
|
-
|
|
193
|
+
K(e, "Не вдалося додати користувача");
|
|
194
194
|
} finally {
|
|
195
|
-
|
|
195
|
+
x.value = !1;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
async function ce(e) {
|
|
199
|
-
if (!
|
|
200
|
-
|
|
199
|
+
if (!S.value) {
|
|
200
|
+
p.value = null, S.value = e.surveyor_id;
|
|
201
201
|
try {
|
|
202
|
-
await
|
|
202
|
+
await h(e.surveyor_id);
|
|
203
203
|
} finally {
|
|
204
|
-
|
|
204
|
+
S.value = null;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
function le(e) {
|
|
209
|
-
|
|
209
|
+
u(e) && (p.value = null, ie({
|
|
210
210
|
title: "Зміна пароля",
|
|
211
211
|
type: "warning",
|
|
212
|
-
message: `Згенерувати новий пароль для «${
|
|
212
|
+
message: `Згенерувати новий пароль для «${L(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
|
|
213
213
|
confirmButtonText: "Згенерувати",
|
|
214
214
|
cancelButtonText: "Скасувати",
|
|
215
|
-
onConfirm: () =>
|
|
215
|
+
onConfirm: () => l(e.surveyor_id)
|
|
216
216
|
}));
|
|
217
217
|
}
|
|
218
218
|
function ue(e) {
|
|
219
|
-
|
|
220
|
-
let t = !
|
|
221
|
-
|
|
219
|
+
p.value = null;
|
|
220
|
+
let t = !B(e);
|
|
221
|
+
ie({
|
|
222
222
|
title: t ? "Активація" : "Деактивація",
|
|
223
223
|
type: t ? "warning" : "error",
|
|
224
|
-
message: t ? `Активувати користувача «${
|
|
224
|
+
message: t ? `Активувати користувача «${L(e)}»?` : `Деактивувати користувача «${L(e)}» в організації «${s.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
|
|
225
225
|
confirmButtonText: t ? "Активувати" : "Деактивувати",
|
|
226
226
|
cancelButtonText: "Скасувати",
|
|
227
227
|
onConfirm: async () => {
|
|
228
|
-
await
|
|
228
|
+
await ee(e.surveyor_id, s.orgId, t) && c("changed");
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
async function Q() {
|
|
233
|
-
if (!
|
|
233
|
+
if (!b.value || x.value) return;
|
|
234
234
|
let e = {
|
|
235
|
-
last_name:
|
|
236
|
-
first_name:
|
|
237
|
-
middle_name:
|
|
238
|
-
phone:
|
|
235
|
+
last_name: j.value.last_name.trim(),
|
|
236
|
+
first_name: j.value.first_name.trim(),
|
|
237
|
+
middle_name: j.value.middle_name.trim(),
|
|
238
|
+
phone: j.value.phone.trim()
|
|
239
239
|
};
|
|
240
240
|
if (!e.last_name || !e.first_name) {
|
|
241
|
-
|
|
241
|
+
C.value = "Прізвище та імʼя обовʼязкові";
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
x.value = !0, C.value = "";
|
|
245
245
|
try {
|
|
246
|
-
await
|
|
246
|
+
await r("surveyors", b.value.surveyor_id, e), U(), c("changed");
|
|
247
247
|
} catch (e) {
|
|
248
|
-
|
|
248
|
+
K(e, "Не вдалося зберегти користувача");
|
|
249
249
|
} finally {
|
|
250
|
-
|
|
250
|
+
x.value = !1;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
document.addEventListener("click",
|
|
255
|
-
}),
|
|
256
|
-
window.clearTimeout(
|
|
253
|
+
te(() => {
|
|
254
|
+
document.addEventListener("click", H), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0);
|
|
255
|
+
}), ne(() => {
|
|
256
|
+
window.clearTimeout(M), document.removeEventListener("click", H), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
|
|
257
257
|
});
|
|
258
258
|
let $ = {
|
|
259
259
|
props: s,
|
|
260
260
|
emit: c,
|
|
261
|
-
fieldClass:
|
|
262
|
-
openMenuId:
|
|
263
|
-
menuStyle:
|
|
264
|
-
dialog:
|
|
265
|
-
activeUser:
|
|
266
|
-
saving:
|
|
267
|
-
resendingId:
|
|
268
|
-
formError:
|
|
269
|
-
certificateQuery:
|
|
270
|
-
certificates:
|
|
271
|
-
certificatesLoading:
|
|
272
|
-
selectedCertificate:
|
|
273
|
-
addEmail:
|
|
274
|
-
addPhone:
|
|
275
|
-
editDraft:
|
|
261
|
+
fieldClass: oe,
|
|
262
|
+
openMenuId: p,
|
|
263
|
+
menuStyle: _,
|
|
264
|
+
dialog: v,
|
|
265
|
+
activeUser: b,
|
|
266
|
+
saving: x,
|
|
267
|
+
resendingId: S,
|
|
268
|
+
formError: C,
|
|
269
|
+
certificateQuery: w,
|
|
270
|
+
certificates: T,
|
|
271
|
+
certificatesLoading: E,
|
|
272
|
+
selectedCertificate: D,
|
|
273
|
+
addEmail: O,
|
|
274
|
+
addPhone: k,
|
|
275
|
+
editDraft: j,
|
|
276
276
|
get searchTimer() {
|
|
277
|
-
return
|
|
277
|
+
return M;
|
|
278
278
|
},
|
|
279
279
|
set searchTimer(e) {
|
|
280
|
-
|
|
280
|
+
M = e;
|
|
281
281
|
},
|
|
282
|
-
dialogTitle:
|
|
283
|
-
selectedAvailable:
|
|
284
|
-
selectedStatusLabel:
|
|
285
|
-
registeredAccount:
|
|
286
|
-
personName:
|
|
287
|
-
certificateLabel:
|
|
288
|
-
certificatePerson:
|
|
289
|
-
membershipEnabled:
|
|
290
|
-
toggleMenu:
|
|
291
|
-
closeMenu:
|
|
292
|
-
closeDialog:
|
|
293
|
-
openAdd:
|
|
294
|
-
openEdit:
|
|
295
|
-
fail:
|
|
296
|
-
searched:
|
|
282
|
+
dialogTitle: N,
|
|
283
|
+
selectedAvailable: P,
|
|
284
|
+
selectedStatusLabel: F,
|
|
285
|
+
registeredAccount: I,
|
|
286
|
+
personName: L,
|
|
287
|
+
certificateLabel: R,
|
|
288
|
+
certificatePerson: z,
|
|
289
|
+
membershipEnabled: B,
|
|
290
|
+
toggleMenu: re,
|
|
291
|
+
closeMenu: H,
|
|
292
|
+
closeDialog: U,
|
|
293
|
+
openAdd: W,
|
|
294
|
+
openEdit: G,
|
|
295
|
+
fail: K,
|
|
296
|
+
searched: q,
|
|
297
297
|
get searchSeq() {
|
|
298
|
-
return
|
|
298
|
+
return J;
|
|
299
299
|
},
|
|
300
300
|
set searchSeq(e) {
|
|
301
|
-
|
|
301
|
+
J = e;
|
|
302
302
|
},
|
|
303
|
-
searchCertificates:
|
|
304
|
-
onCertificateInput:
|
|
305
|
-
chooseCertificate:
|
|
303
|
+
searchCertificates: Y,
|
|
304
|
+
onCertificateInput: X,
|
|
305
|
+
chooseCertificate: Z,
|
|
306
306
|
submitAdd: se,
|
|
307
307
|
resendRegistrationInvite: ce,
|
|
308
308
|
resetPassword: le,
|
|
309
309
|
toggleAccess: ue,
|
|
310
310
|
submitEdit: Q,
|
|
311
311
|
AppIcon: t,
|
|
312
|
-
SurveyorTeleport:
|
|
313
|
-
BaseModal:
|
|
312
|
+
SurveyorTeleport: d,
|
|
313
|
+
BaseModal: f,
|
|
314
314
|
UserAccessBadge: o,
|
|
315
|
-
ValidityBadge:
|
|
315
|
+
ValidityBadge: ae,
|
|
316
316
|
get canResendSurveyorRegistration() {
|
|
317
|
-
return
|
|
317
|
+
return g;
|
|
318
318
|
},
|
|
319
319
|
get canResetSurveyorPassword() {
|
|
320
|
-
return
|
|
320
|
+
return u;
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
return Object.defineProperty($, "__isScriptSetup", {
|
|
@@ -325,7 +325,7 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/Softpro/surveyor/admi
|
|
|
325
325
|
value: !0
|
|
326
326
|
}), $;
|
|
327
327
|
}
|
|
328
|
-
}),
|
|
328
|
+
}), G = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, K = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, q = { class: "flex items-center gap-2.5" }, J = { class: "text-brand-600" }, Y = { class: "overflow-x-auto" }, X = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, Z = { class: "divide-y divide-slate-100" }, se = { class: "px-5 py-3.5" }, ce = {
|
|
329
329
|
key: 0,
|
|
330
330
|
class: "mt-1 text-xs text-slate-400"
|
|
331
331
|
}, le = { class: "px-5 py-3.5 leading-snug text-slate-600" }, ue = { class: "px-5 py-3.5 leading-snug text-slate-600" }, Q = { class: "px-5 py-3.5 text-slate-600" }, $ = { class: "px-5 py-3.5" }, de = { class: "px-5 py-3.5 text-center" }, fe = [
|
|
@@ -364,108 +364,118 @@ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/Softpro/surveyor/admi
|
|
|
364
364
|
class: "mt-3 text-sm text-red-600"
|
|
365
365
|
}, Re = { class: "flex justify-end gap-3" }, ze = ["disabled"], Be = ["disabled"];
|
|
366
366
|
function Ve(e, t, n, r, i, a) {
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
let o = M("RouterLink");
|
|
368
|
+
return k(), x("section", G, [
|
|
369
|
+
S("header", K, [S("div", q, [S("span", J, [T(r.AppIcon, {
|
|
369
370
|
name: "users",
|
|
370
371
|
class: "h-[18px] w-[18px]"
|
|
371
|
-
})]), t[9] ||=
|
|
372
|
+
})]), t[9] ||= S("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Користувачі", -1)]), S("button", {
|
|
372
373
|
type: "button",
|
|
373
374
|
class: "inline-flex h-8 items-center gap-1.5 rounded-lg bg-brand-600 px-3 text-[13px] font-semibold text-white shadow-sm transition-colors hover:bg-brand-700",
|
|
374
375
|
onClick: r.openAdd
|
|
375
|
-
}, [
|
|
376
|
+
}, [T(r.AppIcon, {
|
|
376
377
|
name: "plus",
|
|
377
378
|
class: "h-3.5 w-3.5"
|
|
378
|
-
}), t[10] ||=
|
|
379
|
-
|
|
380
|
-
t[14] ||=
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
379
|
+
}), t[10] ||= w(" Додати користувача ", -1)])]),
|
|
380
|
+
S("div", Y, [S("table", X, [
|
|
381
|
+
t[14] ||= S("colgroup", null, [
|
|
382
|
+
S("col", { class: "w-[24%]" }),
|
|
383
|
+
S("col", { class: "w-[17%]" }),
|
|
384
|
+
S("col", { class: "w-[20%]" }),
|
|
385
|
+
S("col", { class: "w-[15%]" }),
|
|
386
|
+
S("col", { class: "w-[12%]" }),
|
|
387
|
+
S("col", { class: "w-[12%]" })
|
|
387
388
|
], -1),
|
|
388
|
-
t[15] ||=
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
389
|
+
t[15] ||= S("thead", { class: "bg-slate-50 text-xs font-semibold text-slate-500" }, [S("tr", null, [
|
|
390
|
+
S("th", { class: "px-5 py-3" }, "ПІБ"),
|
|
391
|
+
S("th", { class: "px-5 py-3" }, "Дата видачі та номер сертифіката"),
|
|
392
|
+
S("th", { class: "px-5 py-3" }, "Email та номер телефону"),
|
|
393
|
+
S("th", { class: "px-5 py-3" }, "Місце роботи"),
|
|
394
|
+
S("th", { class: "px-5 py-3" }, "Статус"),
|
|
395
|
+
S("th", { class: "px-5 py-3 text-center" }, "Дії")
|
|
395
396
|
])], -1),
|
|
396
|
-
|
|
397
|
+
S("tbody", Z, [(k(!0), x(v, null, j(n.users, (e) => (k(), x("tr", {
|
|
397
398
|
key: e.surveyor_id,
|
|
398
399
|
class: "align-top transition-colors hover:bg-brand-50/40"
|
|
399
400
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
S("td", se, [T(o, {
|
|
402
|
+
to: {
|
|
403
|
+
name: "surveyor-detail",
|
|
404
|
+
params: { id: e.surveyor_id }
|
|
405
|
+
},
|
|
406
|
+
class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
|
|
407
|
+
}, {
|
|
408
|
+
default: I(() => [w(N(r.personName(e)), 1)]),
|
|
409
|
+
_: 2
|
|
410
|
+
}, 1032, ["to"]), e.registered_at ? b("", !0) : (k(), x("p", ce, "Реєстрацію не завершено"))]),
|
|
411
|
+
S("td", le, N(r.certificateLabel(e)), 1),
|
|
412
|
+
S("td", ue, [S("p", null, N(e.email || "—"), 1), S("p", null, N(e.phone || "—"), 1)]),
|
|
413
|
+
S("td", Q, N(n.orgName), 1),
|
|
414
|
+
S("td", $, [T(r.UserAccessBadge, {
|
|
405
415
|
"account-blocked": e.enabled === !1,
|
|
406
416
|
"membership-disabled": !r.membershipEnabled(e)
|
|
407
417
|
}, null, 8, ["account-blocked", "membership-disabled"])]),
|
|
408
|
-
|
|
418
|
+
S("td", de, [S("button", {
|
|
409
419
|
type: "button",
|
|
410
420
|
"data-user-menu": "",
|
|
411
421
|
class: "inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-brand-50 hover:text-brand-700",
|
|
412
422
|
"aria-label": `Дії для ${r.personName(e)}`,
|
|
413
423
|
"aria-expanded": r.openMenuId === e.surveyor_id,
|
|
414
424
|
onClick: R((t) => r.toggleMenu(e.surveyor_id, t), ["stop"])
|
|
415
|
-
}, [
|
|
425
|
+
}, [T(r.AppIcon, {
|
|
416
426
|
name: "more-vertical",
|
|
417
427
|
class: "h-4 w-4"
|
|
418
|
-
})], 8, fe),
|
|
419
|
-
default: I(() => [r.openMenuId === e.surveyor_id ? (
|
|
428
|
+
})], 8, fe), T(r.SurveyorTeleport, null, {
|
|
429
|
+
default: I(() => [r.openMenuId === e.surveyor_id ? (k(), x("div", {
|
|
420
430
|
key: 0,
|
|
421
431
|
"data-user-menu": "",
|
|
422
432
|
class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
|
|
423
|
-
style:
|
|
433
|
+
style: O(r.menuStyle)
|
|
424
434
|
}, [
|
|
425
|
-
|
|
435
|
+
S("button", {
|
|
426
436
|
type: "button",
|
|
427
437
|
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
|
|
428
438
|
onClick: (t) => r.openEdit(e)
|
|
429
|
-
}, [
|
|
439
|
+
}, [T(r.AppIcon, {
|
|
430
440
|
name: "pencil",
|
|
431
441
|
class: "h-4 w-4 text-slate-400"
|
|
432
|
-
}), t[11] ||=
|
|
433
|
-
r.canResendSurveyorRegistration(e) ? (
|
|
442
|
+
}), t[11] ||= w(" Редагувати ", -1)], 8, pe),
|
|
443
|
+
r.canResendSurveyorRegistration(e) ? (k(), x("button", {
|
|
434
444
|
key: 0,
|
|
435
445
|
type: "button",
|
|
436
446
|
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",
|
|
437
447
|
disabled: r.resendingId === e.surveyor_id,
|
|
438
448
|
onClick: (t) => r.resendRegistrationInvite(e)
|
|
439
|
-
}, [
|
|
449
|
+
}, [T(r.AppIcon, {
|
|
440
450
|
name: "send",
|
|
441
451
|
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
442
|
-
}),
|
|
443
|
-
r.canResetSurveyorPassword(e) ? (
|
|
452
|
+
}), w(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, me)) : b("", !0),
|
|
453
|
+
r.canResetSurveyorPassword(e) ? (k(), x("button", {
|
|
444
454
|
key: 1,
|
|
445
455
|
type: "button",
|
|
446
456
|
class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
|
|
447
457
|
onClick: (t) => r.resetPassword(e)
|
|
448
|
-
}, [
|
|
458
|
+
}, [T(r.AppIcon, {
|
|
449
459
|
name: "key-round",
|
|
450
460
|
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
451
|
-
}), t[12] ||=
|
|
452
|
-
|
|
461
|
+
}), t[12] ||= w(" Згенерувати новий пароль ", -1)], 8, he)) : b("", !0),
|
|
462
|
+
S("button", {
|
|
453
463
|
type: "button",
|
|
454
|
-
class:
|
|
464
|
+
class: D(["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"]),
|
|
455
465
|
onClick: (t) => r.toggleAccess(e)
|
|
456
|
-
}, [
|
|
466
|
+
}, [T(r.AppIcon, {
|
|
457
467
|
name: r.membershipEnabled(e) ? "user-x" : "power",
|
|
458
|
-
class:
|
|
459
|
-
}, null, 8, ["name", "class"]),
|
|
460
|
-
], 4)) :
|
|
468
|
+
class: D(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
|
|
469
|
+
}, null, 8, ["name", "class"]), w(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)
|
|
470
|
+
], 4)) : b("", !0)]),
|
|
461
471
|
_: 2
|
|
462
472
|
}, 1024)])
|
|
463
|
-
]))), 128)), n.users.length === 0 ? (
|
|
473
|
+
]))), 128)), n.users.length === 0 ? (k(), x("tr", _e, [...t[13] ||= [S("td", {
|
|
464
474
|
colspan: "6",
|
|
465
475
|
class: "px-5 py-12 text-center text-sm text-slate-400"
|
|
466
|
-
}, " Користувачів не знайдено. ", -1)]])) :
|
|
476
|
+
}, " Користувачів не знайдено. ", -1)]])) : b("", !0)])
|
|
467
477
|
])]),
|
|
468
|
-
|
|
478
|
+
T(r.BaseModal, {
|
|
469
479
|
"model-value": r.dialog !== null,
|
|
470
480
|
title: r.dialogTitle,
|
|
471
481
|
width: "max-w-lg",
|
|
@@ -474,87 +484,87 @@ function Ve(e, t, n, r, i, a) {
|
|
|
474
484
|
e || r.closeDialog();
|
|
475
485
|
}
|
|
476
486
|
}, {
|
|
477
|
-
footer: I(() => [
|
|
487
|
+
footer: I(() => [S("div", Re, [S("button", {
|
|
478
488
|
type: "button",
|
|
479
489
|
class: "rounded-lg px-4 py-2.5 text-sm font-medium text-slate-600 hover:bg-slate-100",
|
|
480
490
|
disabled: r.saving,
|
|
481
491
|
onClick: r.closeDialog
|
|
482
|
-
}, " Скасувати ", 8, ze),
|
|
492
|
+
}, " Скасувати ", 8, ze), S("button", {
|
|
483
493
|
type: "button",
|
|
484
494
|
class: "rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-700 disabled:opacity-60",
|
|
485
495
|
disabled: r.saving || r.dialog === "add" && !r.selectedAvailable,
|
|
486
496
|
onClick: t[7] ||= (e) => r.dialog === "add" ? r.submitAdd() : r.submitEdit()
|
|
487
497
|
}, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9, Be)])]),
|
|
488
|
-
default: I(() => [r.dialog === "add" ? (
|
|
489
|
-
|
|
498
|
+
default: I(() => [r.dialog === "add" ? (k(), x("div", ve, [
|
|
499
|
+
S("label", ye, [t[16] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(S("input", {
|
|
490
500
|
"onUpdate:modelValue": t[0] ||= (e) => r.certificateQuery = e,
|
|
491
501
|
type: "text",
|
|
492
|
-
class:
|
|
502
|
+
class: D(r.fieldClass),
|
|
493
503
|
placeholder: "Номер або прізвище",
|
|
494
504
|
onInput: r.onCertificateInput
|
|
495
505
|
}, null, 544), [[P, r.certificateQuery]])]),
|
|
496
|
-
r.certificatesLoading ? (
|
|
506
|
+
r.certificatesLoading ? (k(), x("p", be, "Пошук…")) : r.certificates.length ? (k(), x("ul", xe, [(k(!0), x(v, null, j(r.certificates, (e) => (k(), x("li", { key: e.certificate_id }, [S("button", {
|
|
497
507
|
type: "button",
|
|
498
508
|
class: "flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm hover:bg-slate-50",
|
|
499
509
|
onClick: (t) => r.chooseCertificate(e)
|
|
500
|
-
}, [
|
|
510
|
+
}, [S("span", Ce, [S("span", we, "№ " + N(e.number_certificate || "—"), 1), S("span", Te, N(r.certificatePerson(e)), 1)]), T(r.ValidityBadge, {
|
|
501
511
|
class: "shrink-0",
|
|
502
512
|
validity: e.certificate_status
|
|
503
|
-
}, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (
|
|
504
|
-
r.selectedCertificate && !r.selectedAvailable ? (
|
|
505
|
-
r.registeredAccount ? (
|
|
506
|
-
|
|
513
|
+
}, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (k(), x("p", Ee, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : b("", !0),
|
|
514
|
+
r.selectedCertificate && !r.selectedAvailable ? (k(), x("p", De, " Сертифікат має статус «" + N(r.selectedStatusLabel || "Невідомий") + "». Додати користувача можна лише за дійсним сертифікатом. ", 1)) : r.selectedCertificate ? (k(), x(v, { key: 4 }, [
|
|
515
|
+
r.registeredAccount ? (k(), x("p", Oe, " Обліковий запис уже є: " + N(r.registeredAccount.account_name || "—") + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : b("", !0),
|
|
516
|
+
S("label", ke, [t[17] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(S("input", {
|
|
507
517
|
"onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
|
|
508
518
|
type: "email",
|
|
509
|
-
class:
|
|
519
|
+
class: D(r.fieldClass),
|
|
510
520
|
placeholder: "user@example.com"
|
|
511
521
|
}, null, 512), [[P, r.addEmail]])]),
|
|
512
|
-
r.registeredAccount ?
|
|
522
|
+
r.registeredAccount ? b("", !0) : (k(), x("label", Ae, [t[18] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(S("input", {
|
|
513
523
|
"onUpdate:modelValue": t[2] ||= (e) => r.addPhone = e,
|
|
514
524
|
type: "text",
|
|
515
|
-
class:
|
|
525
|
+
class: D(r.fieldClass),
|
|
516
526
|
placeholder: "+380…"
|
|
517
527
|
}, null, 512), [[P, r.addPhone]])])),
|
|
518
|
-
r.registeredAccount ?
|
|
519
|
-
], 64)) :
|
|
520
|
-
])) : r.dialog === "edit" ? (
|
|
521
|
-
|
|
528
|
+
r.registeredAccount ? b("", !0) : (k(), x("p", je, "На email надійде лист для завершення реєстрації."))
|
|
529
|
+
], 64)) : b("", !0)
|
|
530
|
+
])) : r.dialog === "edit" ? (k(), x("div", Me, [
|
|
531
|
+
S("label", Ne, [t[19] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(S("input", {
|
|
522
532
|
"onUpdate:modelValue": t[3] ||= (e) => r.editDraft.last_name = e,
|
|
523
533
|
type: "text",
|
|
524
|
-
class:
|
|
534
|
+
class: D(r.fieldClass)
|
|
525
535
|
}, null, 512), [[P, r.editDraft.last_name]])]),
|
|
526
|
-
|
|
536
|
+
S("label", Pe, [t[20] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(S("input", {
|
|
527
537
|
"onUpdate:modelValue": t[4] ||= (e) => r.editDraft.first_name = e,
|
|
528
538
|
type: "text",
|
|
529
|
-
class:
|
|
539
|
+
class: D(r.fieldClass)
|
|
530
540
|
}, null, 512), [[P, r.editDraft.first_name]])]),
|
|
531
|
-
|
|
541
|
+
S("label", Fe, [t[21] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(S("input", {
|
|
532
542
|
"onUpdate:modelValue": t[5] ||= (e) => r.editDraft.middle_name = e,
|
|
533
543
|
type: "text",
|
|
534
|
-
class:
|
|
544
|
+
class: D(r.fieldClass)
|
|
535
545
|
}, null, 512), [[P, r.editDraft.middle_name]])]),
|
|
536
|
-
|
|
546
|
+
S("label", Ie, [t[22] ||= S("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(S("input", {
|
|
537
547
|
"onUpdate:modelValue": t[6] ||= (e) => r.editDraft.phone = e,
|
|
538
548
|
type: "text",
|
|
539
|
-
class:
|
|
549
|
+
class: D(r.fieldClass)
|
|
540
550
|
}, null, 512), [[P, r.editDraft.phone]])])
|
|
541
|
-
])) :
|
|
551
|
+
])) : b("", !0), r.formError ? (k(), x("p", Le, N(r.formError), 1)) : b("", !0)]),
|
|
542
552
|
_: 1
|
|
543
553
|
}, 8, ["model-value", "title"])
|
|
544
554
|
]);
|
|
545
555
|
}
|
|
546
|
-
var He = /*#__PURE__*/ e(
|
|
556
|
+
var He = /*#__PURE__*/ e(W, [["render", Ve], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Ue = /*@__PURE__*/ E({
|
|
547
557
|
__name: "card",
|
|
548
|
-
setup(e, { expose:
|
|
549
|
-
|
|
550
|
-
let o = B(), { listPath:
|
|
551
|
-
let e =
|
|
558
|
+
setup(e, { expose: r }) {
|
|
559
|
+
r();
|
|
560
|
+
let o = B(), { listPath: ee } = n(), l = re(), u = A(null), d = A(!1), f = A(""), m = A(null), h = y(() => o.query.edit === "1"), g = y(() => u.value?.surveyors ?? []), v = y(() => {
|
|
561
|
+
let e = u.value;
|
|
552
562
|
return e ? {
|
|
553
563
|
...e,
|
|
554
564
|
id: e.org_id
|
|
555
565
|
} : null;
|
|
556
566
|
});
|
|
557
|
-
function
|
|
567
|
+
function b(e) {
|
|
558
568
|
let t = e.split(".")[0] ?? "", n = t.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - t.length % 4) % 4);
|
|
559
569
|
try {
|
|
560
570
|
return atob(n).split(/[/\\]/).pop() || "Скан-копія";
|
|
@@ -562,51 +572,51 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/Softpro/surveyor/adm
|
|
|
562
572
|
return "Скан-копія";
|
|
563
573
|
}
|
|
564
574
|
}
|
|
565
|
-
function
|
|
575
|
+
function x(e, t = !1) {
|
|
566
576
|
let n = `/api/file/${encodeURIComponent(e)}`;
|
|
567
577
|
return t ? `${n}?download=true` : n;
|
|
568
578
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
579
|
+
function S() {
|
|
580
|
+
l.replace({ query: {
|
|
571
581
|
...o.query,
|
|
572
582
|
edit: "1"
|
|
573
583
|
} });
|
|
574
584
|
}
|
|
575
|
-
function
|
|
585
|
+
function C() {
|
|
576
586
|
let e = { ...o.query };
|
|
577
|
-
delete e.edit,
|
|
587
|
+
delete e.edit, l.replace({ query: e });
|
|
578
588
|
}
|
|
579
|
-
async function
|
|
580
|
-
let e =
|
|
581
|
-
if (
|
|
582
|
-
await
|
|
589
|
+
async function w() {
|
|
590
|
+
let e = u.value?.org_id;
|
|
591
|
+
if (C(), e) try {
|
|
592
|
+
await T(e);
|
|
583
593
|
} catch (e) {
|
|
584
|
-
|
|
594
|
+
V({
|
|
585
595
|
type: "error",
|
|
586
596
|
title: "Помилка",
|
|
587
597
|
message: e instanceof Error ? e.message : "Не вдалося оновити організацію"
|
|
588
598
|
});
|
|
589
599
|
}
|
|
590
600
|
}
|
|
591
|
-
async function
|
|
592
|
-
|
|
601
|
+
async function T(e) {
|
|
602
|
+
u.value = await i(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
|
|
593
603
|
}
|
|
594
|
-
async function
|
|
595
|
-
|
|
604
|
+
async function E(e) {
|
|
605
|
+
d.value = !0, f.value = "", u.value = null;
|
|
596
606
|
try {
|
|
597
|
-
await
|
|
607
|
+
await T(e);
|
|
598
608
|
} catch (e) {
|
|
599
|
-
|
|
609
|
+
u.value = null, f.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
|
|
600
610
|
} finally {
|
|
601
|
-
|
|
611
|
+
d.value = !1;
|
|
602
612
|
}
|
|
603
613
|
}
|
|
604
|
-
async function
|
|
605
|
-
let e =
|
|
614
|
+
async function D() {
|
|
615
|
+
let e = u.value?.org_id;
|
|
606
616
|
if (e) try {
|
|
607
|
-
await
|
|
617
|
+
await T(e);
|
|
608
618
|
} catch (e) {
|
|
609
|
-
|
|
619
|
+
V({
|
|
610
620
|
type: "error",
|
|
611
621
|
title: "Помилка",
|
|
612
622
|
message: e instanceof Error ? e.message : "Не вдалося оновити організацію"
|
|
@@ -614,44 +624,44 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/Softpro/surveyor/adm
|
|
|
614
624
|
}
|
|
615
625
|
}
|
|
616
626
|
F(() => String(o.params.id), (e) => {
|
|
617
|
-
e &&
|
|
627
|
+
e && E(e);
|
|
618
628
|
}, { immediate: !0 });
|
|
619
|
-
let
|
|
629
|
+
let O = {
|
|
620
630
|
route: o,
|
|
621
|
-
listPath:
|
|
622
|
-
router:
|
|
623
|
-
organization:
|
|
624
|
-
loading:
|
|
625
|
-
error:
|
|
626
|
-
formRef:
|
|
627
|
-
editing:
|
|
628
|
-
users:
|
|
629
|
-
editRecord:
|
|
630
|
-
fileName:
|
|
631
|
-
fileUrl:
|
|
632
|
-
startEdit:
|
|
633
|
-
cancelEdit:
|
|
634
|
-
onFormSaved:
|
|
635
|
-
fetchOrganization:
|
|
636
|
-
loadOrganization:
|
|
637
|
-
refreshOrganization:
|
|
631
|
+
listPath: ee,
|
|
632
|
+
router: l,
|
|
633
|
+
organization: u,
|
|
634
|
+
loading: d,
|
|
635
|
+
error: f,
|
|
636
|
+
formRef: m,
|
|
637
|
+
editing: h,
|
|
638
|
+
users: g,
|
|
639
|
+
editRecord: v,
|
|
640
|
+
fileName: b,
|
|
641
|
+
fileUrl: x,
|
|
642
|
+
startEdit: S,
|
|
643
|
+
cancelEdit: C,
|
|
644
|
+
onFormSaved: w,
|
|
645
|
+
fetchOrganization: T,
|
|
646
|
+
loadOrganization: E,
|
|
647
|
+
refreshOrganization: D,
|
|
638
648
|
AppIcon: t,
|
|
639
649
|
get RouterLink() {
|
|
640
650
|
return z;
|
|
641
651
|
},
|
|
642
|
-
RegistryForm:
|
|
652
|
+
RegistryForm: p,
|
|
643
653
|
VerifiedBadge: a,
|
|
644
654
|
AppealDetailSection: s,
|
|
645
655
|
AppealDetailField: c,
|
|
646
656
|
OrganizationUsers: He,
|
|
647
657
|
get organizationForm() {
|
|
648
|
-
return
|
|
658
|
+
return _;
|
|
649
659
|
}
|
|
650
660
|
};
|
|
651
|
-
return Object.defineProperty(
|
|
661
|
+
return Object.defineProperty(O, "__isScriptSetup", {
|
|
652
662
|
enumerable: !1,
|
|
653
663
|
value: !0
|
|
654
|
-
}),
|
|
664
|
+
}), O;
|
|
655
665
|
}
|
|
656
666
|
}), We = {
|
|
657
667
|
key: 0,
|
|
@@ -667,96 +677,96 @@ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/Softpro/surveyor/adm
|
|
|
667
677
|
class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
|
|
668
678
|
}, ot = { class: "text-sm text-slate-500" };
|
|
669
679
|
function st(e, t, n, r, i, a) {
|
|
670
|
-
return r.loading ? (
|
|
671
|
-
|
|
680
|
+
return r.loading ? (k(), x("div", We, " Завантаження… ")) : r.organization ? (k(), x("div", Ge, [S("header", Ke, [S("nav", qe, [
|
|
681
|
+
T(r.RouterLink, {
|
|
672
682
|
to: r.listPath,
|
|
673
683
|
class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
|
|
674
684
|
}, {
|
|
675
|
-
default: I(() => [
|
|
685
|
+
default: I(() => [T(r.AppIcon, {
|
|
676
686
|
name: "home",
|
|
677
687
|
class: "h-3.5 w-3.5"
|
|
678
|
-
}), t[1] ||=
|
|
688
|
+
}), t[1] ||= w(" Організації ", -1)]),
|
|
679
689
|
_: 1
|
|
680
690
|
}, 8, ["to"]),
|
|
681
|
-
t[2] ||=
|
|
682
|
-
|
|
683
|
-
]),
|
|
691
|
+
t[2] ||= S("span", { class: "text-slate-300" }, "/", -1),
|
|
692
|
+
S("span", Je, N(r.organization.name), 1)
|
|
693
|
+
]), S("div", Ye, [S("h1", Xe, N(r.organization.name), 1), r.editing ? b("", !0) : (k(), x("button", {
|
|
684
694
|
key: 0,
|
|
685
695
|
type: "button",
|
|
686
696
|
class: "inline-flex h-10 items-center gap-2 rounded-lg border border-slate-200 bg-white px-4 text-sm font-semibold text-slate-700 transition-colors hover:border-brand-300 hover:text-brand-700",
|
|
687
697
|
onClick: r.startEdit
|
|
688
|
-
}, [
|
|
698
|
+
}, [T(r.AppIcon, {
|
|
689
699
|
name: "pencil",
|
|
690
700
|
class: "h-4 w-4"
|
|
691
|
-
}), t[3] ||=
|
|
701
|
+
}), t[3] ||= w(" Редагувати ", -1)]))])]), S("div", Ze, [r.editing ? (k(), x("div", Qe, [T(r.RegistryForm, {
|
|
692
702
|
ref: "formRef",
|
|
693
703
|
config: r.organizationForm,
|
|
694
704
|
record: r.editRecord,
|
|
695
705
|
"hide-actions": "",
|
|
696
706
|
onSaved: r.onFormSaved,
|
|
697
707
|
onCancel: r.cancelEdit
|
|
698
|
-
}, null, 8, ["config", "record"]),
|
|
708
|
+
}, null, 8, ["config", "record"]), S("div", $e, [S("button", {
|
|
699
709
|
type: "button",
|
|
700
710
|
class: "inline-flex h-10 items-center rounded-lg bg-slate-100 px-4 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-200",
|
|
701
711
|
onClick: r.cancelEdit
|
|
702
|
-
}, " Скасувати "),
|
|
712
|
+
}, " Скасувати "), S("button", {
|
|
703
713
|
type: "button",
|
|
704
714
|
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",
|
|
705
715
|
onClick: t[0] ||= (e) => r.formRef?.submit()
|
|
706
|
-
}, " Зберегти зміни ")])])) : (
|
|
707
|
-
icon: I(() => [
|
|
716
|
+
}, " Зберегти зміни ")])])) : (k(), x(v, { key: 1 }, [T(r.AppealDetailSection, { title: "Інформація про організацію" }, {
|
|
717
|
+
icon: I(() => [T(r.AppIcon, {
|
|
708
718
|
name: "building-2",
|
|
709
719
|
class: "h-[18px] w-[18px]"
|
|
710
720
|
})]),
|
|
711
|
-
default: I(() => [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
default: I(() => [
|
|
721
|
+
default: I(() => [S("dl", et, [
|
|
722
|
+
S("div", null, [t[4] ||= S("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифіковано", -1), S("dd", null, [T(r.VerifiedBadge, { verified: !!r.organization.verified }, null, 8, ["verified"])])]),
|
|
723
|
+
T(r.AppealDetailField, { label: "Організація яка звернулась" }, {
|
|
724
|
+
default: I(() => [w(N(r.organization.name), 1)]),
|
|
715
725
|
_: 1
|
|
716
726
|
}),
|
|
717
|
-
|
|
718
|
-
default: I(() => [
|
|
727
|
+
T(r.AppealDetailField, { label: "Телефон організації" }, {
|
|
728
|
+
default: I(() => [w(N(r.organization.phone || "—"), 1)]),
|
|
719
729
|
_: 1
|
|
720
730
|
}),
|
|
721
|
-
|
|
722
|
-
default: I(() => [
|
|
731
|
+
T(r.AppealDetailField, { label: "Email організації" }, {
|
|
732
|
+
default: I(() => [w(N(r.organization.email || "—"), 1)]),
|
|
723
733
|
_: 1
|
|
724
734
|
}),
|
|
725
|
-
|
|
735
|
+
T(r.AppealDetailField, {
|
|
726
736
|
label: "Юридична адреса",
|
|
727
737
|
full: ""
|
|
728
738
|
}, {
|
|
729
|
-
default: I(() => [
|
|
739
|
+
default: I(() => [w(N(r.organization.legal_address || "—"), 1)]),
|
|
730
740
|
_: 1
|
|
731
741
|
})
|
|
732
742
|
])]),
|
|
733
743
|
_: 1
|
|
734
|
-
}),
|
|
735
|
-
icon: I(() => [
|
|
744
|
+
}), T(r.AppealDetailSection, { title: "Файли" }, C({
|
|
745
|
+
icon: I(() => [T(r.AppIcon, {
|
|
736
746
|
name: "file-check-2",
|
|
737
747
|
class: "h-[18px] w-[18px]"
|
|
738
748
|
})]),
|
|
739
|
-
default: I(() => [
|
|
749
|
+
default: I(() => [S("div", null, [t[7] ||= S("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), S("p", it, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
|
|
740
750
|
_: 2
|
|
741
751
|
}, [r.organization.scan_path ? {
|
|
742
752
|
name: "actions",
|
|
743
|
-
fn: I(() => [
|
|
753
|
+
fn: I(() => [S("div", tt, [S("a", {
|
|
744
754
|
href: r.fileUrl(r.organization.scan_path, !0),
|
|
745
755
|
class: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 px-2.5 text-[13px] font-medium text-slate-600 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700"
|
|
746
|
-
}, [
|
|
756
|
+
}, [T(r.AppIcon, {
|
|
747
757
|
name: "download",
|
|
748
758
|
class: "h-3.5 w-3.5"
|
|
749
|
-
}), t[5] ||=
|
|
759
|
+
}), t[5] ||= w(" Завантажити ", -1)], 8, nt), S("a", {
|
|
750
760
|
href: r.fileUrl(r.organization.scan_path),
|
|
751
761
|
target: "_blank",
|
|
752
762
|
rel: "noopener",
|
|
753
763
|
class: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 px-2.5 text-[13px] font-medium text-slate-600 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700"
|
|
754
|
-
}, [
|
|
764
|
+
}, [T(r.AppIcon, {
|
|
755
765
|
name: "eye",
|
|
756
766
|
class: "h-3.5 w-3.5"
|
|
757
|
-
}), t[6] ||=
|
|
767
|
+
}), t[6] ||= w(" Перегляд ", -1)], 8, rt)])]),
|
|
758
768
|
key: "0"
|
|
759
|
-
} : void 0]), 1024)], 64)),
|
|
769
|
+
} : void 0]), 1024)], 64)), T(r.OrganizationUsers, {
|
|
760
770
|
"org-id": r.organization.org_id,
|
|
761
771
|
"org-name": r.organization.name,
|
|
762
772
|
users: r.users,
|
|
@@ -765,14 +775,14 @@ function st(e, t, n, r, i, a) {
|
|
|
765
775
|
"org-id",
|
|
766
776
|
"org-name",
|
|
767
777
|
"users"
|
|
768
|
-
])])])) : (
|
|
778
|
+
])])])) : (k(), x("div", at, [S("p", ot, N(r.error || "Організацію не знайдено."), 1), T(r.RouterLink, {
|
|
769
779
|
to: r.listPath,
|
|
770
780
|
class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
|
|
771
781
|
}, {
|
|
772
|
-
default: I(() => [...t[8] ||= [
|
|
782
|
+
default: I(() => [...t[8] ||= [w(" Повернутися до реєстру ", -1)]]),
|
|
773
783
|
_: 1
|
|
774
784
|
}, 8, ["to"])]));
|
|
775
785
|
}
|
|
776
|
-
var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "
|
|
786
|
+
var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
|
|
777
787
|
//#endregion
|
|
778
788
|
export { ct as default };
|