@opengis/surveyor 0.0.8 → 0.0.10
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/README.md +4 -3
- package/dist/chunks/{AppIcon-CO70tpMX.js → AppIcon-Di5F4Bu_.js} +1 -1
- package/dist/chunks/{AppealDetailField-DNRGpnyD.js → AppealDetailField-DNpsGpPY.js} +2 -2
- package/dist/chunks/{AppealStatusBadge-Cu-UzdzA.js → AppealStatusBadge-MP1qD952.js} +1 -1
- package/dist/chunks/{AppealStatusBadge-BlAaNUSK.js → AppealStatusBadge-z77wwkFD.js} +2 -2
- package/dist/chunks/{ApplicationHistorySection-Cwq0-Frd.js → ApplicationHistorySection-DIoFZwH6.js} +4 -4
- package/dist/chunks/{BaseModal-SQXvRRNW.js → BaseModal-DP_ilBdg.js} +21 -11
- package/dist/chunks/{FormFilePicker-DxPQlxgy.js → FormFilePicker-D5fAUE0Z.js} +2 -2
- package/dist/chunks/{MapLayerMenu-AUeTqgEp.js → MapLayerMenu-CI5cbLEC.js} +1 -1
- package/dist/chunks/{RegistryForm-wG-c8GKf.js → RegistryForm-DbCxZsr0.js} +1 -1
- package/dist/chunks/{RegistryFormModal-R_iZYqGE.js → RegistryFormModal-D_KLGj2d.js} +3 -3
- package/dist/chunks/{RegistryToolbar-322DKUXi.js → RegistryToolbar-DvbrASlj.js} +6 -6
- package/dist/chunks/{SurveyorTeleport-CnSF0Ptl.js → SurveyorTeleport-D6-KXe_5.js} +1 -1
- package/dist/chunks/{UserAccessBadge-DyZDv7Oo.js → UserAccessBadge-B5Q1LvNv.js} +1 -1
- package/dist/chunks/{UserTypeBadge-LvnMuKGo.js → UserTypeBadge-CuAMctTK.js} +1 -1
- package/dist/chunks/{VerifiedBadge-bk0n-rlC.js → VerifiedBadge-D6L7mCdp.js} +2 -2
- package/dist/chunks/{card-CWqi1K-x.js → card--XUb1kFK.js} +4 -4
- package/dist/chunks/{card-C3y-j2TA.js → card-BrjnXf1N.js} +6 -6
- package/dist/chunks/{card-6z-m7UkM.js → card-BsTSF6aL.js} +10 -10
- package/dist/chunks/{card-Dlp8_KhV.js → card-CI7ntIHf.js} +5 -5
- package/dist/chunks/{card-DWpAv92l.js → card-Cu8QOSIw.js} +4 -4
- package/dist/chunks/{card-X9UVFgdR.js → card-ylC5NYbz.js} +241 -208
- package/dist/chunks/certificates-BnseQylH.js +209 -0
- package/dist/chunks/certificates-aJ-hvaP-.js +236 -0
- package/dist/chunks/{create-CAVC1qXJ.js → create-Bi7-j9Ri.js} +413 -413
- package/dist/chunks/{forgot-DoG6vXhq.js → forgot-DnixBqdc.js} +2 -2
- package/dist/chunks/{login-BWGylcSU.js → login-BWCQdEkv.js} +2 -2
- package/dist/chunks/map-CwsVIW79.js +2872 -0
- package/dist/chunks/{map-layers-sT-gTiD_.js → map-layers-BLiEYC4C.js} +5 -5
- package/dist/chunks/{organizations-ByVE2f0c.js → organizations-mc6FlSwe.js} +6 -6
- package/dist/chunks/{profile-CkwMFh82.js → profile-F7mr0poI.js} +3 -3
- package/dist/chunks/{registration-3GLgq-ae.js → registration-BRF4985_.js} +2 -2
- package/dist/chunks/{requests-BTpLXrNj.js → requests-7pD2ckdx.js} +4 -4
- package/dist/chunks/{requests-rWq8ok3C.js → requests-BCJN-CNx.js} +5 -5
- package/dist/chunks/{reset-CP9LsLkC.js → reset-OZCgLi6f.js} +2 -2
- package/dist/chunks/{useEntityPath-C5Owtidc.js → useEntityPath-8s0Y1tjA.js} +1 -1
- package/dist/chunks/{users-U1P6xCP4.js → users-CAEjpaI1.js} +6 -6
- package/dist/index.css +1 -1
- package/dist/index.js +40 -40
- package/migrations/20261016120000_map_layers.sql +156 -156
- package/migrations/20261016150000_password_reset.sql +15 -15
- package/migrations/20261016180000_settlement_lookup.sql +16 -16
- package/package.json +1 -1
- package/server/dictionaries/index.ts +17 -17
- package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
- package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
- package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
- package/server/modules/surveyor/route.ts +4 -2
- package/server/modules/surveyor/schema.ts +18 -1
- package/server/modules/surveyor/services/applicationTile.ts +36 -8
- package/server/modules/surveyor/services/createApplication.ts +2 -3
- package/server/modules/surveyor/services/mapLayers.ts +61 -61
- package/server/modules/surveyor/services/registerSurveyor.ts +3 -4
- package/server/modules/surveyor/services/requestPasswordReset.ts +1 -0
- package/server/modules/surveyor/services/resetSurveyorPassword.ts +1 -0
- package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
- package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
- package/server/modules/surveyor/utils/certificateStatus.ts +15 -0
- package/server/modules/surveyor/utils/mail.ts +49 -20
- package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
- package/server/resources/helpers/settlement_lookup.ts +7 -7
- package/server/resources/surveyor-admin/certificates.ts +27 -1
- package/server/resources/surveyor-admin/map_layers.ts +69 -69
- package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
- package/server/resources/surveyor-admin/organizations.ts +61 -61
- package/server/resources/surveyor-user/applications.ts +1 -1
- package/dist/chunks/certificates-Cwch72-o.js +0 -425
- package/dist/chunks/map-UTBxwT7-.js +0 -2776
|
@@ -1,20 +1,48 @@
|
|
|
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 { a as r,
|
|
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 { t as
|
|
2
|
+
import { n as t, t as n } from "./useEntityPath-8s0Y1tjA.js";
|
|
3
|
+
import { a as r, o as i } from "./resources-2e8RFqWR.js";
|
|
4
|
+
import { t as a } from "./VerifiedBadge-D6L7mCdp.js";
|
|
5
|
+
import { t as o } from "./UserAccessBadge-B5Q1LvNv.js";
|
|
6
|
+
import { n as s, t as c } from "./AppealDetailField-DNpsGpPY.js";
|
|
7
|
+
import { i as l, r as u, t as d } from "./surveyorAccount-C7UiiIYg.js";
|
|
8
|
+
import { t as f } from "./SurveyorTeleport-D6-KXe_5.js";
|
|
9
|
+
import { t as p } from "./BaseModal-DP_ilBdg.js";
|
|
10
|
+
import { t as m } from "./RegistryForm-DbCxZsr0.js";
|
|
11
|
+
import { n as h } from "./certificates-BnseQylH.js";
|
|
11
12
|
import { n as g, t as _ } from "./resendSurveyorRegistration-BHTTVIw1.js";
|
|
12
13
|
import { t as v } from "./form-DDjELqZ9.js";
|
|
13
14
|
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
|
|
15
|
-
import { confirm as
|
|
16
|
-
//#region admin/src/
|
|
17
|
-
var
|
|
15
|
+
import { RouterLink as z, useRoute as B, useRouter as V } from "vue-router";
|
|
16
|
+
import { confirm as ne, notify as H } from "@opengis/core";
|
|
17
|
+
//#region admin/src/components/ui/ValidityBadge.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
+
var U = /*@__PURE__*/ D({
|
|
19
|
+
__name: "ValidityBadge",
|
|
20
|
+
props: { validity: {
|
|
21
|
+
type: [String, null],
|
|
22
|
+
required: !1
|
|
23
|
+
} },
|
|
24
|
+
setup(e, { expose: t }) {
|
|
25
|
+
t();
|
|
26
|
+
let n = e, r = {
|
|
27
|
+
props: n,
|
|
28
|
+
config: b(() => h[n.validity ?? ""] ?? h.no_data)
|
|
29
|
+
};
|
|
30
|
+
return Object.defineProperty(r, "__isScriptSetup", {
|
|
31
|
+
enumerable: !1,
|
|
32
|
+
value: !0
|
|
33
|
+
}), r;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region admin/src/components/ui/ValidityBadge.vue
|
|
38
|
+
function W(e, t, n, r, i, a) {
|
|
39
|
+
return A(), S("span", { class: O(["inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium", [
|
|
40
|
+
r.config.bg,
|
|
41
|
+
r.config.text,
|
|
42
|
+
r.config.border
|
|
43
|
+
]]) }, [C("span", { class: O(["h-1.5 w-1.5 rounded-full", r.config.dot]) }, null, 2), T(" " + N(r.config.label), 1)], 2);
|
|
44
|
+
}
|
|
45
|
+
var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admin/src/components/ui/ValidityBadge.vue"]]), ie = "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", G = /*@__PURE__*/ D({
|
|
18
46
|
__name: "OrganizationUsers",
|
|
19
47
|
props: {
|
|
20
48
|
orgId: {
|
|
@@ -31,133 +59,128 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
31
59
|
}
|
|
32
60
|
},
|
|
33
61
|
emits: ["changed"],
|
|
34
|
-
setup(e, { expose: n, emit:
|
|
62
|
+
setup(e, { expose: n, emit: a }) {
|
|
35
63
|
n();
|
|
36
|
-
let
|
|
64
|
+
let s = e, c = a, m = j(null), v = j({
|
|
37
65
|
top: "0px",
|
|
38
66
|
left: "0px"
|
|
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(
|
|
67
|
+
}), 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(""), A = j(""), M = j({
|
|
40
68
|
last_name: "",
|
|
41
69
|
first_name: "",
|
|
42
70
|
middle_name: "",
|
|
43
71
|
phone: ""
|
|
44
|
-
}),
|
|
45
|
-
function
|
|
72
|
+
}), N = 0, P = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : ""), F = b(() => O.value?.certificate_status === "valid"), I = b(() => h[O.value?.certificate_status ?? ""]?.label ?? ""), L = b(() => O.value?.account_registered_at ? O.value : null);
|
|
73
|
+
function R(e) {
|
|
46
74
|
return [
|
|
47
75
|
e.last_name,
|
|
48
76
|
e.first_name,
|
|
49
77
|
e.middle_name
|
|
50
78
|
].filter(Boolean).join(" ") || "—";
|
|
51
79
|
}
|
|
52
|
-
function
|
|
80
|
+
function z(e) {
|
|
53
81
|
let t = e.certificate_id_data?.text;
|
|
54
82
|
return t ? `№ ${t}` : "—";
|
|
55
83
|
}
|
|
56
|
-
function
|
|
84
|
+
function B(e) {
|
|
57
85
|
let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
|
|
58
86
|
return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
|
|
59
87
|
}
|
|
60
|
-
function
|
|
88
|
+
function V(e) {
|
|
61
89
|
return e.membership_enabled !== !1;
|
|
62
90
|
}
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
65
|
-
|
|
91
|
+
function U(e, t) {
|
|
92
|
+
if (m.value === e) {
|
|
93
|
+
m.value = null;
|
|
66
94
|
return;
|
|
67
95
|
}
|
|
68
|
-
let n = t.currentTarget.getBoundingClientRect(), r =
|
|
96
|
+
let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r && _(r) ? 1 : 0) + (r && d(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
97
|
v.value = {
|
|
70
98
|
top: `${a}px`,
|
|
71
99
|
left: `${o}px`
|
|
72
|
-
},
|
|
100
|
+
}, m.value = e;
|
|
73
101
|
}
|
|
74
|
-
function
|
|
102
|
+
function W(e) {
|
|
75
103
|
let t = e?.target;
|
|
76
|
-
t instanceof Element && t.closest("[data-user-menu]") || (
|
|
104
|
+
t instanceof Element && t.closest("[data-user-menu]") || (m.value = null);
|
|
77
105
|
}
|
|
78
|
-
function
|
|
106
|
+
function G() {
|
|
79
107
|
y.value = null, x.value = null, w.value = "";
|
|
80
108
|
}
|
|
81
|
-
function
|
|
82
|
-
T.value = "", E.value = [],
|
|
109
|
+
function K() {
|
|
110
|
+
T.value = "", E.value = [], Y.value = !1, O.value = null, k.value = "", A.value = "", w.value = "", y.value = "add";
|
|
83
111
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
112
|
+
function q(e) {
|
|
113
|
+
m.value = null, x.value = e, M.value = {
|
|
86
114
|
last_name: e.last_name ?? "",
|
|
87
115
|
first_name: e.first_name ?? "",
|
|
88
116
|
middle_name: e.middle_name ?? "",
|
|
89
117
|
phone: e.phone ?? ""
|
|
90
118
|
}, w.value = "", y.value = "edit";
|
|
91
119
|
}
|
|
92
|
-
function
|
|
120
|
+
function J(e, t) {
|
|
93
121
|
w.value = e instanceof Error ? e.message : t;
|
|
94
122
|
}
|
|
95
|
-
let
|
|
96
|
-
async function
|
|
97
|
-
let e = T.value.trim(), t = ++
|
|
98
|
-
if (O.value = null,
|
|
123
|
+
let Y = j(!1), X = 0;
|
|
124
|
+
async function Z() {
|
|
125
|
+
let e = T.value.trim(), t = ++X;
|
|
126
|
+
if (O.value = null, Y.value = e.length >= 2, e.length < 2) {
|
|
99
127
|
E.value = [], D.value = !1;
|
|
100
128
|
return;
|
|
101
129
|
}
|
|
102
130
|
D.value = !0;
|
|
103
131
|
try {
|
|
104
132
|
let n = await r(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
|
|
105
|
-
if (t !==
|
|
133
|
+
if (t !== X) return;
|
|
106
134
|
E.value = (n.data ?? []).map((e) => ({
|
|
107
135
|
...e,
|
|
108
136
|
certificate_id: e.id
|
|
109
137
|
}));
|
|
110
138
|
} catch (e) {
|
|
111
|
-
if (t !==
|
|
112
|
-
E.value = [],
|
|
139
|
+
if (t !== X) return;
|
|
140
|
+
E.value = [], J(e, "Не вдалося знайти сертифікати");
|
|
113
141
|
} finally {
|
|
114
|
-
t ===
|
|
142
|
+
t === X && (D.value = !1);
|
|
115
143
|
}
|
|
116
144
|
}
|
|
117
|
-
function
|
|
118
|
-
window.clearTimeout(
|
|
145
|
+
function ae() {
|
|
146
|
+
window.clearTimeout(N), N = window.setTimeout(() => void Z(), 300);
|
|
119
147
|
}
|
|
120
|
-
|
|
121
|
-
O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "",
|
|
122
|
-
try {
|
|
123
|
-
let t = await i("surveyors", {
|
|
124
|
-
page: 1,
|
|
125
|
-
limit: 1,
|
|
126
|
-
filters: { certificate_id: e.certificate_id }
|
|
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);
|
|
129
|
-
} catch (e) {
|
|
130
|
-
K(e, "Не вдалося перевірити сертифікат");
|
|
131
|
-
}
|
|
148
|
+
function oe(e) {
|
|
149
|
+
O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "", k.value = e.account_email || e.surveyor_email || "", A.value = e.account_registered_at ? "" : e.account_phone || e.surveyor_phone || "", w.value = "";
|
|
132
150
|
}
|
|
133
|
-
async function
|
|
134
|
-
|
|
135
|
-
if (
|
|
151
|
+
async function se() {
|
|
152
|
+
let e = O.value;
|
|
153
|
+
if (!e || S.value) return;
|
|
154
|
+
if (!F.value) {
|
|
155
|
+
w.value = "Додати користувача можна лише за дійсним сертифікатом";
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (e.account_id && s.users.some((t) => t.surveyor_id === e.account_id)) {
|
|
136
159
|
w.value = "Цей користувач уже є в організації";
|
|
137
160
|
return;
|
|
138
161
|
}
|
|
139
|
-
let
|
|
140
|
-
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
162
|
+
let t = k.value.trim().toLowerCase();
|
|
163
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)) {
|
|
141
164
|
w.value = "Вкажіть коректний email";
|
|
142
165
|
return;
|
|
143
166
|
}
|
|
144
|
-
let
|
|
145
|
-
if (
|
|
167
|
+
let n = L.value;
|
|
168
|
+
if (n && t !== (n.account_email ?? "").trim().toLowerCase()) {
|
|
146
169
|
w.value = "Email не збігається з email облікового запису цього сертифіката";
|
|
147
170
|
return;
|
|
148
171
|
}
|
|
149
172
|
S.value = !0, w.value = "";
|
|
150
173
|
try {
|
|
151
|
-
let
|
|
174
|
+
let i = await r("/api/surveyor/surveyors", {
|
|
152
175
|
method: "POST",
|
|
153
176
|
body: JSON.stringify({
|
|
154
|
-
organization_id:
|
|
155
|
-
certificate_id:
|
|
156
|
-
email:
|
|
157
|
-
...
|
|
177
|
+
organization_id: s.orgId,
|
|
178
|
+
certificate_id: e.certificate_id,
|
|
179
|
+
email: t,
|
|
180
|
+
...n ? {} : { phone: A.value.trim() }
|
|
158
181
|
})
|
|
159
182
|
});
|
|
160
|
-
H(
|
|
183
|
+
H(i.registration_status === "attached" ? {
|
|
161
184
|
type: "success",
|
|
162
185
|
title: "Користувача додано",
|
|
163
186
|
message: "Наявний обліковий запис прикріплено до організації"
|
|
@@ -165,16 +188,16 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
165
188
|
type: "success",
|
|
166
189
|
title: "Користувача додано",
|
|
167
190
|
message: "На email надіслано лист для завершення реєстрації"
|
|
168
|
-
}),
|
|
191
|
+
}), G(), c("changed");
|
|
169
192
|
} catch (e) {
|
|
170
|
-
|
|
193
|
+
J(e, "Не вдалося додати користувача");
|
|
171
194
|
} finally {
|
|
172
195
|
S.value = !1;
|
|
173
196
|
}
|
|
174
197
|
}
|
|
175
|
-
async function
|
|
198
|
+
async function ce(e) {
|
|
176
199
|
if (!C.value) {
|
|
177
|
-
|
|
200
|
+
m.value = null, C.value = e.surveyor_id;
|
|
178
201
|
try {
|
|
179
202
|
await g(e.surveyor_id);
|
|
180
203
|
} finally {
|
|
@@ -182,37 +205,37 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
182
205
|
}
|
|
183
206
|
}
|
|
184
207
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
208
|
+
function le(e) {
|
|
209
|
+
d(e) && (m.value = null, ne({
|
|
187
210
|
title: "Зміна пароля",
|
|
188
211
|
type: "warning",
|
|
189
|
-
message: `Згенерувати новий пароль для «${
|
|
212
|
+
message: `Згенерувати новий пароль для «${R(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
|
|
190
213
|
confirmButtonText: "Згенерувати",
|
|
191
214
|
cancelButtonText: "Скасувати",
|
|
192
|
-
onConfirm: () =>
|
|
215
|
+
onConfirm: () => u(e.surveyor_id)
|
|
193
216
|
}));
|
|
194
217
|
}
|
|
195
|
-
function
|
|
196
|
-
|
|
197
|
-
let t = !
|
|
198
|
-
|
|
218
|
+
function ue(e) {
|
|
219
|
+
m.value = null;
|
|
220
|
+
let t = !V(e);
|
|
221
|
+
ne({
|
|
199
222
|
title: t ? "Активація" : "Деактивація",
|
|
200
223
|
type: t ? "warning" : "error",
|
|
201
|
-
message: t ? `Активувати користувача «${
|
|
224
|
+
message: t ? `Активувати користувача «${R(e)}»?` : `Деактивувати користувача «${R(e)}» в організації «${s.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
|
|
202
225
|
confirmButtonText: t ? "Активувати" : "Деактивувати",
|
|
203
226
|
cancelButtonText: "Скасувати",
|
|
204
227
|
onConfirm: async () => {
|
|
205
|
-
await
|
|
228
|
+
await l(e.surveyor_id, s.orgId, t) && c("changed");
|
|
206
229
|
}
|
|
207
230
|
});
|
|
208
231
|
}
|
|
209
|
-
async function
|
|
232
|
+
async function Q() {
|
|
210
233
|
if (!x.value || S.value) return;
|
|
211
234
|
let e = {
|
|
212
|
-
last_name:
|
|
213
|
-
first_name:
|
|
214
|
-
middle_name:
|
|
215
|
-
phone:
|
|
235
|
+
last_name: M.value.last_name.trim(),
|
|
236
|
+
first_name: M.value.first_name.trim(),
|
|
237
|
+
middle_name: M.value.middle_name.trim(),
|
|
238
|
+
phone: M.value.phone.trim()
|
|
216
239
|
};
|
|
217
240
|
if (!e.last_name || !e.first_name) {
|
|
218
241
|
w.value = "Прізвище та імʼя обовʼязкові";
|
|
@@ -220,23 +243,23 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
220
243
|
}
|
|
221
244
|
S.value = !0, w.value = "";
|
|
222
245
|
try {
|
|
223
|
-
await
|
|
246
|
+
await i("surveyors", x.value.surveyor_id, e), G(), c("changed");
|
|
224
247
|
} catch (e) {
|
|
225
|
-
|
|
248
|
+
J(e, "Не вдалося зберегти користувача");
|
|
226
249
|
} finally {
|
|
227
250
|
S.value = !1;
|
|
228
251
|
}
|
|
229
252
|
}
|
|
230
253
|
ee(() => {
|
|
231
|
-
document.addEventListener("click",
|
|
254
|
+
document.addEventListener("click", W), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0);
|
|
232
255
|
}), te(() => {
|
|
233
|
-
window.clearTimeout(
|
|
256
|
+
window.clearTimeout(N), document.removeEventListener("click", W), window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
|
|
234
257
|
});
|
|
235
258
|
let $ = {
|
|
236
|
-
props:
|
|
237
|
-
emit:
|
|
238
|
-
fieldClass:
|
|
239
|
-
openMenuId:
|
|
259
|
+
props: s,
|
|
260
|
+
emit: c,
|
|
261
|
+
fieldClass: ie,
|
|
262
|
+
openMenuId: m,
|
|
240
263
|
menuStyle: v,
|
|
241
264
|
dialog: y,
|
|
242
265
|
activeUser: x,
|
|
@@ -247,51 +270,54 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
247
270
|
certificates: E,
|
|
248
271
|
certificatesLoading: D,
|
|
249
272
|
selectedCertificate: O,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
editDraft: N,
|
|
273
|
+
addEmail: k,
|
|
274
|
+
addPhone: A,
|
|
275
|
+
editDraft: M,
|
|
254
276
|
get searchTimer() {
|
|
255
|
-
return
|
|
277
|
+
return N;
|
|
256
278
|
},
|
|
257
279
|
set searchTimer(e) {
|
|
258
|
-
|
|
280
|
+
N = e;
|
|
259
281
|
},
|
|
260
|
-
dialogTitle:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
282
|
+
dialogTitle: P,
|
|
283
|
+
selectedAvailable: F,
|
|
284
|
+
selectedStatusLabel: I,
|
|
285
|
+
registeredAccount: L,
|
|
286
|
+
personName: R,
|
|
287
|
+
certificateLabel: z,
|
|
288
|
+
certificatePerson: B,
|
|
289
|
+
membershipEnabled: V,
|
|
290
|
+
toggleMenu: U,
|
|
291
|
+
closeMenu: W,
|
|
292
|
+
closeDialog: G,
|
|
293
|
+
openAdd: K,
|
|
294
|
+
openEdit: q,
|
|
295
|
+
fail: J,
|
|
296
|
+
searched: Y,
|
|
272
297
|
get searchSeq() {
|
|
273
|
-
return
|
|
298
|
+
return X;
|
|
274
299
|
},
|
|
275
300
|
set searchSeq(e) {
|
|
276
|
-
|
|
301
|
+
X = e;
|
|
277
302
|
},
|
|
278
|
-
searchCertificates:
|
|
279
|
-
onCertificateInput:
|
|
280
|
-
chooseCertificate:
|
|
281
|
-
submitAdd:
|
|
282
|
-
resendRegistrationInvite:
|
|
283
|
-
resetPassword:
|
|
284
|
-
toggleAccess:
|
|
285
|
-
submitEdit:
|
|
303
|
+
searchCertificates: Z,
|
|
304
|
+
onCertificateInput: ae,
|
|
305
|
+
chooseCertificate: oe,
|
|
306
|
+
submitAdd: se,
|
|
307
|
+
resendRegistrationInvite: ce,
|
|
308
|
+
resetPassword: le,
|
|
309
|
+
toggleAccess: ue,
|
|
310
|
+
submitEdit: Q,
|
|
286
311
|
AppIcon: t,
|
|
287
|
-
SurveyorTeleport:
|
|
288
|
-
BaseModal:
|
|
289
|
-
UserAccessBadge:
|
|
312
|
+
SurveyorTeleport: f,
|
|
313
|
+
BaseModal: p,
|
|
314
|
+
UserAccessBadge: o,
|
|
315
|
+
ValidityBadge: re,
|
|
290
316
|
get canResendSurveyorRegistration() {
|
|
291
317
|
return _;
|
|
292
318
|
},
|
|
293
319
|
get canResetSurveyorPassword() {
|
|
294
|
-
return
|
|
320
|
+
return d;
|
|
295
321
|
}
|
|
296
322
|
};
|
|
297
323
|
return Object.defineProperty($, "__isScriptSetup", {
|
|
@@ -299,44 +325,47 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
|
|
|
299
325
|
value: !0
|
|
300
326
|
}), $;
|
|
301
327
|
}
|
|
302
|
-
}),
|
|
328
|
+
}), K = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, q = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, J = { class: "flex items-center gap-2.5" }, Y = { class: "text-brand-600" }, X = { class: "overflow-x-auto" }, Z = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, ae = { class: "divide-y divide-slate-100" }, oe = { class: "px-5 py-3.5" }, se = { class: "font-semibold text-slate-800" }, ce = {
|
|
303
329
|
key: 0,
|
|
304
330
|
class: "mt-1 text-xs text-slate-400"
|
|
305
|
-
},
|
|
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 = [
|
|
306
332
|
"aria-label",
|
|
307
333
|
"aria-expanded",
|
|
308
334
|
"onClick"
|
|
309
|
-
],
|
|
335
|
+
], pe = ["onClick"], me = ["disabled", "onClick"], he = ["onClick"], ge = ["onClick"], _e = { key: 0 }, ve = {
|
|
310
336
|
key: 0,
|
|
311
337
|
class: "space-y-4"
|
|
312
|
-
},
|
|
338
|
+
}, ye = { class: "block" }, be = {
|
|
313
339
|
key: 0,
|
|
314
340
|
class: "text-xs text-slate-400"
|
|
315
|
-
},
|
|
341
|
+
}, xe = {
|
|
316
342
|
key: 1,
|
|
317
343
|
class: "max-h-48 overflow-y-auto rounded-lg border border-slate-200"
|
|
318
|
-
},
|
|
344
|
+
}, Se = ["onClick"], Ce = { class: "flex min-w-0 flex-col" }, we = { class: "font-medium text-slate-800" }, Te = { class: "truncate text-xs text-slate-500" }, Ee = {
|
|
319
345
|
key: 2,
|
|
320
346
|
class: "text-sm text-slate-500"
|
|
321
|
-
},
|
|
347
|
+
}, De = {
|
|
348
|
+
key: 3,
|
|
349
|
+
class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700"
|
|
350
|
+
}, Oe = {
|
|
322
351
|
key: 0,
|
|
323
352
|
class: "rounded-lg bg-amber-50 px-3 py-2 text-sm text-amber-800"
|
|
324
|
-
},
|
|
353
|
+
}, ke = { class: "block" }, Ae = {
|
|
325
354
|
key: 1,
|
|
326
355
|
class: "block"
|
|
327
|
-
},
|
|
356
|
+
}, je = {
|
|
328
357
|
key: 2,
|
|
329
358
|
class: "text-xs text-slate-400"
|
|
330
|
-
},
|
|
359
|
+
}, Me = {
|
|
331
360
|
key: 1,
|
|
332
361
|
class: "grid grid-cols-1 gap-4 sm:grid-cols-2"
|
|
333
|
-
},
|
|
362
|
+
}, Ne = { class: "block" }, Pe = { class: "block" }, Fe = { class: "block sm:col-span-2" }, Ie = { class: "block sm:col-span-2" }, Le = {
|
|
334
363
|
key: 2,
|
|
335
364
|
class: "mt-3 text-sm text-red-600"
|
|
336
|
-
},
|
|
337
|
-
function
|
|
338
|
-
return A(), S("section",
|
|
339
|
-
C("header",
|
|
365
|
+
}, Re = { class: "flex justify-end gap-3" }, ze = ["disabled"], Be = ["disabled"];
|
|
366
|
+
function Ve(e, t, n, r, i, a) {
|
|
367
|
+
return A(), S("section", K, [
|
|
368
|
+
C("header", q, [C("div", J, [C("span", Y, [E(r.AppIcon, {
|
|
340
369
|
name: "users",
|
|
341
370
|
class: "h-[18px] w-[18px]"
|
|
342
371
|
})]), t[9] ||= C("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Користувачі", -1)]), C("button", {
|
|
@@ -347,7 +376,7 @@ function Ie(e, t, n, r, i, a) {
|
|
|
347
376
|
name: "plus",
|
|
348
377
|
class: "h-3.5 w-3.5"
|
|
349
378
|
}), t[10] ||= T(" Додати користувача ", -1)])]),
|
|
350
|
-
C("div",
|
|
379
|
+
C("div", X, [C("table", Z, [
|
|
351
380
|
t[14] ||= C("colgroup", null, [
|
|
352
381
|
C("col", { class: "w-[24%]" }),
|
|
353
382
|
C("col", { class: "w-[17%]" }),
|
|
@@ -364,19 +393,19 @@ function Ie(e, t, n, r, i, a) {
|
|
|
364
393
|
C("th", { class: "px-5 py-3" }, "Статус"),
|
|
365
394
|
C("th", { class: "px-5 py-3 text-center" }, "Дії")
|
|
366
395
|
])], -1),
|
|
367
|
-
C("tbody",
|
|
396
|
+
C("tbody", ae, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
|
|
368
397
|
key: e.surveyor_id,
|
|
369
398
|
class: "align-top transition-colors hover:bg-brand-50/40"
|
|
370
399
|
}, [
|
|
371
|
-
C("td",
|
|
372
|
-
C("td",
|
|
373
|
-
C("td",
|
|
374
|
-
C("td",
|
|
400
|
+
C("td", oe, [C("p", se, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ce, "Реєстрацію не завершено"))]),
|
|
401
|
+
C("td", le, N(r.certificateLabel(e)), 1),
|
|
402
|
+
C("td", ue, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
|
|
403
|
+
C("td", Q, N(n.orgName), 1),
|
|
375
404
|
C("td", $, [E(r.UserAccessBadge, {
|
|
376
405
|
"account-blocked": e.enabled === !1,
|
|
377
406
|
"membership-disabled": !r.membershipEnabled(e)
|
|
378
407
|
}, null, 8, ["account-blocked", "membership-disabled"])]),
|
|
379
|
-
C("td",
|
|
408
|
+
C("td", de, [C("button", {
|
|
380
409
|
type: "button",
|
|
381
410
|
"data-user-menu": "",
|
|
382
411
|
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",
|
|
@@ -386,7 +415,7 @@ function Ie(e, t, n, r, i, a) {
|
|
|
386
415
|
}, [E(r.AppIcon, {
|
|
387
416
|
name: "more-vertical",
|
|
388
417
|
class: "h-4 w-4"
|
|
389
|
-
})], 8,
|
|
418
|
+
})], 8, fe), E(r.SurveyorTeleport, null, {
|
|
390
419
|
default: I(() => [r.openMenuId === e.surveyor_id ? (A(), S("div", {
|
|
391
420
|
key: 0,
|
|
392
421
|
"data-user-menu": "",
|
|
@@ -400,7 +429,7 @@ function Ie(e, t, n, r, i, a) {
|
|
|
400
429
|
}, [E(r.AppIcon, {
|
|
401
430
|
name: "pencil",
|
|
402
431
|
class: "h-4 w-4 text-slate-400"
|
|
403
|
-
}), t[11] ||= T(" Редагувати ", -1)], 8,
|
|
432
|
+
}), t[11] ||= T(" Редагувати ", -1)], 8, pe),
|
|
404
433
|
r.canResendSurveyorRegistration(e) ? (A(), S("button", {
|
|
405
434
|
key: 0,
|
|
406
435
|
type: "button",
|
|
@@ -410,7 +439,7 @@ function Ie(e, t, n, r, i, a) {
|
|
|
410
439
|
}, [E(r.AppIcon, {
|
|
411
440
|
name: "send",
|
|
412
441
|
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
413
|
-
}), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8,
|
|
442
|
+
}), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, me)) : x("", !0),
|
|
414
443
|
r.canResetSurveyorPassword(e) ? (A(), S("button", {
|
|
415
444
|
key: 1,
|
|
416
445
|
type: "button",
|
|
@@ -419,7 +448,7 @@ function Ie(e, t, n, r, i, a) {
|
|
|
419
448
|
}, [E(r.AppIcon, {
|
|
420
449
|
name: "key-round",
|
|
421
450
|
class: "h-4 w-4 shrink-0 text-slate-400"
|
|
422
|
-
}), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8,
|
|
451
|
+
}), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, he)) : x("", !0),
|
|
423
452
|
C("button", {
|
|
424
453
|
type: "button",
|
|
425
454
|
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"]),
|
|
@@ -427,11 +456,11 @@ function Ie(e, t, n, r, i, a) {
|
|
|
427
456
|
}, [E(r.AppIcon, {
|
|
428
457
|
name: r.membershipEnabled(e) ? "user-x" : "power",
|
|
429
458
|
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,
|
|
459
|
+
}, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)
|
|
431
460
|
], 4)) : x("", !0)]),
|
|
432
461
|
_: 2
|
|
433
462
|
}, 1024)])
|
|
434
|
-
]))), 128)), n.users.length === 0 ? (A(), S("tr",
|
|
463
|
+
]))), 128)), n.users.length === 0 ? (A(), S("tr", _e, [...t[13] ||= [C("td", {
|
|
435
464
|
colspan: "6",
|
|
436
465
|
class: "px-5 py-12 text-center text-sm text-slate-400"
|
|
437
466
|
}, " Користувачів не знайдено. ", -1)]])) : x("", !0)])
|
|
@@ -440,81 +469,85 @@ function Ie(e, t, n, r, i, a) {
|
|
|
440
469
|
"model-value": r.dialog !== null,
|
|
441
470
|
title: r.dialogTitle,
|
|
442
471
|
width: "max-w-lg",
|
|
472
|
+
"close-on-backdrop": !1,
|
|
443
473
|
"onUpdate:modelValue": t[8] ||= (e) => {
|
|
444
474
|
e || r.closeDialog();
|
|
445
475
|
}
|
|
446
476
|
}, {
|
|
447
|
-
footer: I(() => [C("div",
|
|
477
|
+
footer: I(() => [C("div", Re, [C("button", {
|
|
448
478
|
type: "button",
|
|
449
479
|
class: "rounded-lg px-4 py-2.5 text-sm font-medium text-slate-600 hover:bg-slate-100",
|
|
450
480
|
disabled: r.saving,
|
|
451
481
|
onClick: r.closeDialog
|
|
452
|
-
}, " Скасувати ", 8,
|
|
482
|
+
}, " Скасувати ", 8, ze), C("button", {
|
|
453
483
|
type: "button",
|
|
454
484
|
class: "rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-700 disabled:opacity-60",
|
|
455
|
-
disabled: r.saving || r.dialog === "add" && !r.
|
|
485
|
+
disabled: r.saving || r.dialog === "add" && !r.selectedAvailable,
|
|
456
486
|
onClick: t[7] ||= (e) => r.dialog === "add" ? r.submitAdd() : r.submitEdit()
|
|
457
|
-
}, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9,
|
|
458
|
-
default: I(() => [r.dialog === "add" ? (A(), S("div",
|
|
459
|
-
C("label",
|
|
487
|
+
}, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9, Be)])]),
|
|
488
|
+
default: I(() => [r.dialog === "add" ? (A(), S("div", ve, [
|
|
489
|
+
C("label", ye, [t[16] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(C("input", {
|
|
460
490
|
"onUpdate:modelValue": t[0] ||= (e) => r.certificateQuery = e,
|
|
461
491
|
type: "text",
|
|
462
492
|
class: O(r.fieldClass),
|
|
463
493
|
placeholder: "Номер або прізвище",
|
|
464
494
|
onInput: r.onCertificateInput
|
|
465
495
|
}, null, 544), [[P, r.certificateQuery]])]),
|
|
466
|
-
r.certificatesLoading ? (A(), S("p",
|
|
496
|
+
r.certificatesLoading ? (A(), S("p", be, "Пошук…")) : r.certificates.length ? (A(), S("ul", xe, [(A(!0), S(y, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
|
|
467
497
|
type: "button",
|
|
468
|
-
class: "flex w-full
|
|
498
|
+
class: "flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm hover:bg-slate-50",
|
|
469
499
|
onClick: (t) => r.chooseCertificate(e)
|
|
470
|
-
}, [C("span",
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
500
|
+
}, [C("span", Ce, [C("span", we, "№ " + N(e.number_certificate || "—"), 1), C("span", Te, N(r.certificatePerson(e)), 1)]), E(r.ValidityBadge, {
|
|
501
|
+
class: "shrink-0",
|
|
502
|
+
validity: e.certificate_status
|
|
503
|
+
}, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (A(), S("p", Ee, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : x("", !0),
|
|
504
|
+
r.selectedCertificate && !r.selectedAvailable ? (A(), S("p", De, " Сертифікат має статус «" + N(r.selectedStatusLabel || "Невідомий") + "». Додати користувача можна лише за дійсним сертифікатом. ", 1)) : r.selectedCertificate ? (A(), S(y, { key: 4 }, [
|
|
505
|
+
r.registeredAccount ? (A(), S("p", Oe, " Обліковий запис уже є: " + N(r.registeredAccount.account_name || "—") + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
|
|
506
|
+
C("label", ke, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
|
|
474
507
|
"onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
|
|
475
508
|
type: "email",
|
|
476
509
|
class: O(r.fieldClass),
|
|
477
510
|
placeholder: "user@example.com"
|
|
478
511
|
}, null, 512), [[P, r.addEmail]])]),
|
|
479
|
-
r.
|
|
512
|
+
r.registeredAccount ? x("", !0) : (A(), S("label", Ae, [t[18] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
|
|
480
513
|
"onUpdate:modelValue": t[2] ||= (e) => r.addPhone = e,
|
|
481
514
|
type: "text",
|
|
482
515
|
class: O(r.fieldClass),
|
|
483
516
|
placeholder: "+380…"
|
|
484
517
|
}, null, 512), [[P, r.addPhone]])])),
|
|
485
|
-
r.
|
|
518
|
+
r.registeredAccount ? x("", !0) : (A(), S("p", je, "На email надійде лист для завершення реєстрації."))
|
|
486
519
|
], 64)) : x("", !0)
|
|
487
|
-
])) : r.dialog === "edit" ? (A(), S("div",
|
|
488
|
-
C("label",
|
|
520
|
+
])) : r.dialog === "edit" ? (A(), S("div", Me, [
|
|
521
|
+
C("label", Ne, [t[19] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(C("input", {
|
|
489
522
|
"onUpdate:modelValue": t[3] ||= (e) => r.editDraft.last_name = e,
|
|
490
523
|
type: "text",
|
|
491
524
|
class: O(r.fieldClass)
|
|
492
525
|
}, null, 512), [[P, r.editDraft.last_name]])]),
|
|
493
|
-
C("label",
|
|
526
|
+
C("label", Pe, [t[20] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(C("input", {
|
|
494
527
|
"onUpdate:modelValue": t[4] ||= (e) => r.editDraft.first_name = e,
|
|
495
528
|
type: "text",
|
|
496
529
|
class: O(r.fieldClass)
|
|
497
530
|
}, null, 512), [[P, r.editDraft.first_name]])]),
|
|
498
|
-
C("label",
|
|
531
|
+
C("label", Fe, [t[21] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(C("input", {
|
|
499
532
|
"onUpdate:modelValue": t[5] ||= (e) => r.editDraft.middle_name = e,
|
|
500
533
|
type: "text",
|
|
501
534
|
class: O(r.fieldClass)
|
|
502
535
|
}, null, 512), [[P, r.editDraft.middle_name]])]),
|
|
503
|
-
C("label",
|
|
536
|
+
C("label", Ie, [t[22] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
|
|
504
537
|
"onUpdate:modelValue": t[6] ||= (e) => r.editDraft.phone = e,
|
|
505
538
|
type: "text",
|
|
506
539
|
class: O(r.fieldClass)
|
|
507
540
|
}, null, 512), [[P, r.editDraft.phone]])])
|
|
508
|
-
])) : x("", !0), r.formError ? (A(), S("p",
|
|
541
|
+
])) : x("", !0), r.formError ? (A(), S("p", Le, N(r.formError), 1)) : x("", !0)]),
|
|
509
542
|
_: 1
|
|
510
543
|
}, 8, ["model-value", "title"])
|
|
511
544
|
]);
|
|
512
545
|
}
|
|
513
|
-
var
|
|
546
|
+
var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Ue = /*@__PURE__*/ D({
|
|
514
547
|
__name: "card",
|
|
515
548
|
setup(e, { expose: i }) {
|
|
516
549
|
i();
|
|
517
|
-
let
|
|
550
|
+
let o = B(), { listPath: l } = n(), u = V(), d = j(null), f = j(!1), p = j(""), h = j(null), g = b(() => o.query.edit === "1"), _ = b(() => d.value?.surveyors ?? []), y = b(() => {
|
|
518
551
|
let e = d.value;
|
|
519
552
|
return e ? {
|
|
520
553
|
...e,
|
|
@@ -535,12 +568,12 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
|
|
|
535
568
|
}
|
|
536
569
|
function C() {
|
|
537
570
|
u.replace({ query: {
|
|
538
|
-
...
|
|
571
|
+
...o.query,
|
|
539
572
|
edit: "1"
|
|
540
573
|
} });
|
|
541
574
|
}
|
|
542
575
|
function w() {
|
|
543
|
-
let e = { ...
|
|
576
|
+
let e = { ...o.query };
|
|
544
577
|
delete e.edit, u.replace({ query: e });
|
|
545
578
|
}
|
|
546
579
|
async function T() {
|
|
@@ -580,17 +613,17 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
|
|
|
580
613
|
});
|
|
581
614
|
}
|
|
582
615
|
}
|
|
583
|
-
F(() => String(
|
|
616
|
+
F(() => String(o.params.id), (e) => {
|
|
584
617
|
e && D(e);
|
|
585
618
|
}, { immediate: !0 });
|
|
586
619
|
let k = {
|
|
587
|
-
route:
|
|
588
|
-
listPath:
|
|
620
|
+
route: o,
|
|
621
|
+
listPath: l,
|
|
589
622
|
router: u,
|
|
590
623
|
organization: d,
|
|
591
624
|
loading: f,
|
|
592
625
|
error: p,
|
|
593
|
-
formRef:
|
|
626
|
+
formRef: h,
|
|
594
627
|
editing: g,
|
|
595
628
|
users: _,
|
|
596
629
|
editRecord: y,
|
|
@@ -606,11 +639,11 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
|
|
|
606
639
|
get RouterLink() {
|
|
607
640
|
return z;
|
|
608
641
|
},
|
|
609
|
-
RegistryForm:
|
|
610
|
-
VerifiedBadge:
|
|
611
|
-
AppealDetailSection:
|
|
612
|
-
AppealDetailField:
|
|
613
|
-
OrganizationUsers:
|
|
642
|
+
RegistryForm: m,
|
|
643
|
+
VerifiedBadge: a,
|
|
644
|
+
AppealDetailSection: s,
|
|
645
|
+
AppealDetailField: c,
|
|
646
|
+
OrganizationUsers: He,
|
|
614
647
|
get organizationForm() {
|
|
615
648
|
return v;
|
|
616
649
|
}
|
|
@@ -620,21 +653,21 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
|
|
|
620
653
|
value: !0
|
|
621
654
|
}), k;
|
|
622
655
|
}
|
|
623
|
-
}),
|
|
656
|
+
}), We = {
|
|
624
657
|
key: 0,
|
|
625
658
|
class: "px-4 py-16 text-center text-sm text-slate-400"
|
|
626
|
-
},
|
|
659
|
+
}, Ge = {
|
|
627
660
|
key: 1,
|
|
628
661
|
class: "pl-0"
|
|
629
|
-
},
|
|
662
|
+
}, Ke = { class: "mb-6" }, qe = { class: "mb-4 flex items-center gap-1.5 text-sm" }, Je = { class: "font-medium text-slate-700" }, Ye = { class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" }, Xe = { class: "text-xl font-bold tracking-tight text-slate-900" }, Ze = { class: "flex flex-col gap-5" }, Qe = {
|
|
630
663
|
key: 0,
|
|
631
664
|
class: "rounded-xl border border-slate-200 bg-white p-5 shadow-card"
|
|
632
|
-
},
|
|
665
|
+
}, $e = { class: "mt-4 flex justify-end gap-3 border-t border-slate-100 pt-4" }, et = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, tt = { class: "flex items-center gap-2" }, nt = ["href"], rt = ["href"], it = { class: "mt-1 text-xs text-slate-400" }, at = {
|
|
633
666
|
key: 2,
|
|
634
667
|
class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
|
|
635
|
-
},
|
|
636
|
-
function
|
|
637
|
-
return r.loading ? (A(), S("div",
|
|
668
|
+
}, ot = { class: "text-sm text-slate-500" };
|
|
669
|
+
function st(e, t, n, r, i, a) {
|
|
670
|
+
return r.loading ? (A(), S("div", We, " Завантаження… ")) : r.organization ? (A(), S("div", Ge, [C("header", Ke, [C("nav", qe, [
|
|
638
671
|
E(r.RouterLink, {
|
|
639
672
|
to: r.listPath,
|
|
640
673
|
class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
|
|
@@ -646,8 +679,8 @@ function nt(e, t, n, r, i, a) {
|
|
|
646
679
|
_: 1
|
|
647
680
|
}, 8, ["to"]),
|
|
648
681
|
t[2] ||= C("span", { class: "text-slate-300" }, "/", -1),
|
|
649
|
-
C("span",
|
|
650
|
-
]), C("div",
|
|
682
|
+
C("span", Je, N(r.organization.name), 1)
|
|
683
|
+
]), C("div", Ye, [C("h1", Xe, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
|
|
651
684
|
key: 0,
|
|
652
685
|
type: "button",
|
|
653
686
|
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",
|
|
@@ -655,14 +688,14 @@ function nt(e, t, n, r, i, a) {
|
|
|
655
688
|
}, [E(r.AppIcon, {
|
|
656
689
|
name: "pencil",
|
|
657
690
|
class: "h-4 w-4"
|
|
658
|
-
}), t[3] ||= T(" Редагувати ", -1)]))])]), C("div",
|
|
691
|
+
}), t[3] ||= T(" Редагувати ", -1)]))])]), C("div", Ze, [r.editing ? (A(), S("div", Qe, [E(r.RegistryForm, {
|
|
659
692
|
ref: "formRef",
|
|
660
693
|
config: r.organizationForm,
|
|
661
694
|
record: r.editRecord,
|
|
662
695
|
"hide-actions": "",
|
|
663
696
|
onSaved: r.onFormSaved,
|
|
664
697
|
onCancel: r.cancelEdit
|
|
665
|
-
}, null, 8, ["config", "record"]), C("div",
|
|
698
|
+
}, null, 8, ["config", "record"]), C("div", $e, [C("button", {
|
|
666
699
|
type: "button",
|
|
667
700
|
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",
|
|
668
701
|
onClick: r.cancelEdit
|
|
@@ -675,7 +708,7 @@ function nt(e, t, n, r, i, a) {
|
|
|
675
708
|
name: "building-2",
|
|
676
709
|
class: "h-[18px] w-[18px]"
|
|
677
710
|
})]),
|
|
678
|
-
default: I(() => [C("dl",
|
|
711
|
+
default: I(() => [C("dl", et, [
|
|
679
712
|
C("div", null, [t[4] ||= C("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифіковано", -1), C("dd", null, [E(r.VerifiedBadge, { verified: !!r.organization.verified }, null, 8, ["verified"])])]),
|
|
680
713
|
E(r.AppealDetailField, { label: "Організація яка звернулась" }, {
|
|
681
714
|
default: I(() => [T(N(r.organization.name), 1)]),
|
|
@@ -703,17 +736,17 @@ function nt(e, t, n, r, i, a) {
|
|
|
703
736
|
name: "file-check-2",
|
|
704
737
|
class: "h-[18px] w-[18px]"
|
|
705
738
|
})]),
|
|
706
|
-
default: I(() => [C("div", null, [t[7] ||= C("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), C("p",
|
|
739
|
+
default: I(() => [C("div", null, [t[7] ||= C("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), C("p", it, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
|
|
707
740
|
_: 2
|
|
708
741
|
}, [r.organization.scan_path ? {
|
|
709
742
|
name: "actions",
|
|
710
|
-
fn: I(() => [C("div",
|
|
743
|
+
fn: I(() => [C("div", tt, [C("a", {
|
|
711
744
|
href: r.fileUrl(r.organization.scan_path, !0),
|
|
712
745
|
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"
|
|
713
746
|
}, [E(r.AppIcon, {
|
|
714
747
|
name: "download",
|
|
715
748
|
class: "h-3.5 w-3.5"
|
|
716
|
-
}), t[5] ||= T(" Завантажити ", -1)], 8,
|
|
749
|
+
}), t[5] ||= T(" Завантажити ", -1)], 8, nt), C("a", {
|
|
717
750
|
href: r.fileUrl(r.organization.scan_path),
|
|
718
751
|
target: "_blank",
|
|
719
752
|
rel: "noopener",
|
|
@@ -721,7 +754,7 @@ function nt(e, t, n, r, i, a) {
|
|
|
721
754
|
}, [E(r.AppIcon, {
|
|
722
755
|
name: "eye",
|
|
723
756
|
class: "h-3.5 w-3.5"
|
|
724
|
-
}), t[6] ||= T(" Перегляд ", -1)], 8,
|
|
757
|
+
}), t[6] ||= T(" Перегляд ", -1)], 8, rt)])]),
|
|
725
758
|
key: "0"
|
|
726
759
|
} : void 0]), 1024)], 64)), E(r.OrganizationUsers, {
|
|
727
760
|
"org-id": r.organization.org_id,
|
|
@@ -732,7 +765,7 @@ function nt(e, t, n, r, i, a) {
|
|
|
732
765
|
"org-id",
|
|
733
766
|
"org-name",
|
|
734
767
|
"users"
|
|
735
|
-
])])])) : (A(), S("div",
|
|
768
|
+
])])])) : (A(), S("div", at, [C("p", ot, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
|
|
736
769
|
to: r.listPath,
|
|
737
770
|
class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
|
|
738
771
|
}, {
|
|
@@ -740,6 +773,6 @@ function nt(e, t, n, r, i, a) {
|
|
|
740
773
|
_: 1
|
|
741
774
|
}, 8, ["to"])]));
|
|
742
775
|
}
|
|
743
|
-
var
|
|
776
|
+
var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
|
|
744
777
|
//#endregion
|
|
745
|
-
export {
|
|
778
|
+
export { ct as default };
|