@opengis/surveyor 0.0.0-stage → 0.0.2

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.
Files changed (139) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +188 -3
  3. package/dist/chunks/AppIcon-CIR6y5uE.js +85 -0
  4. package/dist/chunks/AppealDetailField-CI-1qhs3.js +58 -0
  5. package/dist/chunks/AppealStatusBadge-CSXnfarR.js +132 -0
  6. package/dist/chunks/AppealStatusBadge-DYBe9hqP.js +171 -0
  7. package/dist/chunks/ApplicationHistorySection-C0wwhwA4.js +769 -0
  8. package/dist/chunks/BaseModal-C7PVYz0m.js +85 -0
  9. package/dist/chunks/FormFilePicker-C3XQw50i.js +76 -0
  10. package/dist/chunks/MapLayerMenu-DjYCxEc3.js +145 -0
  11. package/dist/chunks/RegistryForm-CEUqFmsF.js +99 -0
  12. package/dist/chunks/RegistryFormModal-DfY4z_7r.js +85 -0
  13. package/dist/chunks/RegistryToolbar-BV4mYVAc.js +452 -0
  14. package/dist/chunks/UserAccessBadge-D8JfgGfN.js +44 -0
  15. package/dist/chunks/UserTypeBadge-YIwwoCho.js +188 -0
  16. package/dist/chunks/VerifiedBadge-Bba8WnuB.js +34 -0
  17. package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  18. package/dist/chunks/account-types-Br7gx_D_.js +35 -0
  19. package/dist/chunks/account_types-DLL1w122.js +25 -0
  20. package/dist/chunks/appealMapLayers-CQMK3rrz.js +115 -0
  21. package/dist/chunks/application_status-BhNGiY2I.js +45 -0
  22. package/dist/chunks/applications-BB9JRcgl.js +132 -0
  23. package/dist/chunks/buildSchema-CccjX9TJ.js +37 -0
  24. package/dist/chunks/card-B-ftozcq.js +739 -0
  25. package/dist/chunks/card-BctFHFZe.js +538 -0
  26. package/dist/chunks/card-CKD1N0QD.js +330 -0
  27. package/dist/chunks/card-CiNZxAd5.js +297 -0
  28. package/dist/chunks/card-DUtDfwMk.js +607 -0
  29. package/dist/chunks/card-fL26_Gvc.js +1189 -0
  30. package/dist/chunks/certificates-BSd1i0un.js +424 -0
  31. package/dist/chunks/create-DxMC_IL1.js +1033 -0
  32. package/dist/chunks/filterQuery-CvfZrkTC.js +99 -0
  33. package/dist/chunks/form-Bh6i5n1U.js +315 -0
  34. package/dist/chunks/form-DDjELqZ9.js +89 -0
  35. package/dist/chunks/geometry-DyhIVRcw.js +67 -0
  36. package/dist/chunks/map-Z57iMvFb.js +2763 -0
  37. package/dist/chunks/map-layers-DnmkOEld.js +400 -0
  38. package/dist/chunks/mapLayersApi-CWoQ2be-.js +251 -0
  39. package/dist/chunks/organizations-BO1_JETm.js +476 -0
  40. package/dist/chunks/organizations-BbYipLwk.js +14 -0
  41. package/dist/chunks/profile-ByahbF4B.js +164 -0
  42. package/dist/chunks/profile-Dwwn_4Pr.js +243 -0
  43. package/dist/chunks/requests-BCin936Z.js +232 -0
  44. package/dist/chunks/requests-CFv5wwAN.js +530 -0
  45. package/dist/chunks/resendSurveyorRegistration-BHTTVIw1.js +27 -0
  46. package/dist/chunks/resources-2e8RFqWR.js +129 -0
  47. package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +11 -0
  48. package/dist/chunks/surveyorAccount-C7UiiIYg.js +78 -0
  49. package/dist/chunks/users-DtTYsgMb.js +291 -0
  50. package/dist/chunks/work_types-Hwme-FEX.js +34 -0
  51. package/dist/index.css +3 -0
  52. package/dist/index.js +336 -0
  53. package/migrations/20260924120000_surveyor_schema.sql +450 -0
  54. package/migrations/20261008170000_address_lookup.sql +20 -0
  55. package/migrations/20261016120000_map_layers.sql +156 -0
  56. package/migrations/20261016150000_password_reset.sql +15 -0
  57. package/migrations/20261016170000_address_lookup_format.sql +37 -0
  58. package/migrations/20261016180000_settlement_lookup.sql +16 -0
  59. package/migrations/20261019170000_actor_lookup.sql +15 -0
  60. package/package.json +86 -6
  61. package/plugin.d.ts +15 -0
  62. package/plugin.js +8 -0
  63. package/server/app.ts +51 -0
  64. package/server/dictionaries/index.ts +17 -0
  65. package/server/dictionaries/surveyor/account_types.ts +12 -0
  66. package/server/dictionaries/surveyor/application_status.ts +16 -0
  67. package/server/dictionaries/surveyor/map_layer_components.ts +11 -0
  68. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -0
  69. package/server/dictionaries/surveyor/map_layer_types.ts +11 -0
  70. package/server/dictionaries/surveyor/work_types.ts +15 -0
  71. package/server/dictionaries/surveyor/yes_no.ts +11 -0
  72. package/server/fastify.d.ts +12 -0
  73. package/server/index.ts +23 -0
  74. package/server/modules/surveyor/route.ts +410 -0
  75. package/server/modules/surveyor/schema.ts +439 -0
  76. package/server/modules/surveyor/services/applicationTile.ts +53 -0
  77. package/server/modules/surveyor/services/cancelApplication.ts +74 -0
  78. package/server/modules/surveyor/services/changeSurveyorPassword.ts +52 -0
  79. package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -0
  80. package/server/modules/surveyor/services/completeApplication.ts +46 -0
  81. package/server/modules/surveyor/services/completeSurveyorRegistration.ts +48 -0
  82. package/server/modules/surveyor/services/createApplication.ts +169 -0
  83. package/server/modules/surveyor/services/geometryExport.ts +34 -0
  84. package/server/modules/surveyor/services/geometryImport.ts +66 -0
  85. package/server/modules/surveyor/services/getSurveyorUser.ts +56 -0
  86. package/server/modules/surveyor/services/identifyApplications.ts +82 -0
  87. package/server/modules/surveyor/services/issueSourceData.ts +55 -0
  88. package/server/modules/surveyor/services/loginSurveyor.ts +67 -0
  89. package/server/modules/surveyor/services/mapLayers.ts +61 -0
  90. package/server/modules/surveyor/services/rasterExport.ts +15 -0
  91. package/server/modules/surveyor/services/registerSurveyor.ts +161 -0
  92. package/server/modules/surveyor/services/requestPasswordReset.ts +49 -0
  93. package/server/modules/surveyor/services/resendRegistration.ts +42 -0
  94. package/server/modules/surveyor/services/resetSurveyorPassword.ts +53 -0
  95. package/server/modules/surveyor/services/searchApplications.ts +63 -0
  96. package/server/modules/surveyor/services/submitSurvey.ts +70 -0
  97. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -0
  98. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -0
  99. package/server/modules/surveyor/services/vectorExport.ts +86 -0
  100. package/server/modules/surveyor/services/verifyApplication.ts +59 -0
  101. package/server/modules/surveyor/utils/accessibleApplication.ts +37 -0
  102. package/server/modules/surveyor/utils/application.ts +68 -0
  103. package/server/modules/surveyor/utils/export.ts +39 -0
  104. package/server/modules/surveyor/utils/firstBoundary.ts +48 -0
  105. package/server/modules/surveyor/utils/mail.ts +161 -0
  106. package/server/modules/surveyor/utils/permissions.ts +29 -0
  107. package/server/modules/surveyor/utils/registration.ts +33 -0
  108. package/server/modules/surveyor/utils/shared.ts +305 -0
  109. package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -0
  110. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -0
  111. package/server/modules/surveyor/utils/templates/ds.surveyor_registration.pt.hbs +80 -0
  112. package/server/modules/surveyor/utils/templates/ds.surveyor_send_mail.pt.hbs +79 -0
  113. package/server/modules/surveyor/utils/vectorLayer.ts +41 -0
  114. package/server/plugins/convertVector.ts +74 -0
  115. package/server/plugins/proto/convertVector.proto +21 -0
  116. package/server/plugins/swagger.ts +54 -0
  117. package/server/plugins/vite.dev.ts +52 -0
  118. package/server/plugins/vite.prod.ts +55 -0
  119. package/server/resources/helpers/actor_lookup.ts +5 -0
  120. package/server/resources/helpers/address_lookup.ts +8 -0
  121. package/server/resources/helpers/settlement_lookup.ts +7 -0
  122. package/server/resources/helpers/user_lookup.ts +5 -0
  123. package/server/resources/index.ts +30 -0
  124. package/server/resources/surveyor-admin/application_comments.ts +24 -0
  125. package/server/resources/surveyor-admin/application_status_history.ts +46 -0
  126. package/server/resources/surveyor-admin/applications.ts +125 -0
  127. package/server/resources/surveyor-admin/certificates.ts +87 -0
  128. package/server/resources/surveyor-admin/map_layers.ts +69 -0
  129. package/server/resources/surveyor-admin/organization_surveyors.ts +32 -0
  130. package/server/resources/surveyor-admin/organizations.ts +61 -0
  131. package/server/resources/surveyor-admin/surveyors.ts +71 -0
  132. package/server/resources/surveyor-user/application_status_history.ts +52 -0
  133. package/server/resources/surveyor-user/applications.ts +131 -0
  134. package/server/resources/surveyor-user/certificates.ts +67 -0
  135. package/server/resources/surveyor-user/organizations.ts +40 -0
  136. package/server/resources/surveyor-user/surveyors.ts +69 -0
  137. package/server/suggests/index.ts +17 -0
  138. package/server/tsconfig.json +3 -0
  139. package/surveyor-types.d.ts +30 -0
@@ -0,0 +1,330 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { t } from "./AppIcon-CIR6y5uE.js";
3
+ import { r as n } from "./resources-2e8RFqWR.js";
4
+ import { n as r, t as i } from "./AppealDetailField-CI-1qhs3.js";
5
+ import { t as a } from "./RegistryForm-CEUqFmsF.js";
6
+ import { a as o, i as s, n as c, o as l, r as u, s as d, t as f } from "./form-Bh6i5n1U.js";
7
+ import { l as p } from "./appealMapLayers-CQMK3rrz.js";
8
+ import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as b, createVNode as x, defineComponent as S, normalizeClass as C, normalizeStyle as w, openBlock as T, ref as E, renderList as D, toDisplayString as O, watch as k, withCtx as A } from "vue";
9
+ import { RouterLink as ee, useRoute as j, useRouter as M } from "vue-router";
10
+ import { notify as N } from "@opengis/core";
11
+ //#region admin/src/pages/map-layers/card.vue?vue&type=script&setup=true&lang.ts
12
+ var P = /*@__PURE__*/ S({
13
+ __name: "card",
14
+ setup(e, { expose: m }) {
15
+ m();
16
+ let g = j(), _ = M(), v = E(null), y = E(!1), b = E(""), x = E(null), S = h(() => g.query.edit === "1"), C = h(() => v.value?.layer_group === "base"), w = h(() => v.value ? {
17
+ ...v.value,
18
+ id: v.value.layer_id
19
+ } : null), T = h(() => v.value?.tiles ?? []), D = h(() => {
20
+ let e = v.value;
21
+ return !e || e.layer_group !== "base" ? "" : p({
22
+ id: e.code,
23
+ label: e.name,
24
+ tiles: T.value,
25
+ attribution: e.attribution ?? "",
26
+ scheme: e.scheme ?? "xyz",
27
+ ...e.preview ? { preview: e.preview } : {}
28
+ });
29
+ }), O = h(() => {
30
+ let e = v.value?.minzoom, t = v.value?.maxzoom;
31
+ return e == null && t == null ? "Без обмежень" : `${e ?? 0} – ${t ?? "…"}`;
32
+ }), A = h(() => `${Math.round(Number(v.value?.opacity ?? 1) * 100)}%`), P = h(() => {
33
+ let e = v.value?.legend?.color;
34
+ return typeof e == "string" && e ? e : "";
35
+ }), F = h(() => {
36
+ let e = v.value?.style;
37
+ if (!e) return [];
38
+ let t = {
39
+ fillColor: "Колір заливки",
40
+ fillOpacity: "Непрозорість заливки",
41
+ lineColor: "Колір лінії",
42
+ lineWidth: "Товщина лінії"
43
+ };
44
+ return Object.entries(e).map(([e, n]) => ({
45
+ key: e,
46
+ label: t[e] ?? e,
47
+ value: String(n)
48
+ }));
49
+ }), I = h(() => {
50
+ let e = v.value?.components ?? [];
51
+ return e.length ? e.map((e) => l(c, e)).join(", ") : "Не використовується";
52
+ });
53
+ function L() {
54
+ _.replace({ query: {
55
+ ...g.query,
56
+ edit: "1"
57
+ } });
58
+ }
59
+ function R() {
60
+ let e = { ...g.query };
61
+ delete e.edit, _.replace({ query: e });
62
+ }
63
+ async function z(e) {
64
+ v.value = await n(d, encodeURIComponent(e));
65
+ }
66
+ async function B(e) {
67
+ y.value = !0, b.value = "", v.value = null;
68
+ try {
69
+ await z(e);
70
+ } catch (e) {
71
+ b.value = e instanceof Error ? e.message : "Не вдалося завантажити шар";
72
+ } finally {
73
+ y.value = !1;
74
+ }
75
+ }
76
+ async function V() {
77
+ let e = v.value?.layer_id;
78
+ if (R(), e) try {
79
+ await z(e);
80
+ } catch (e) {
81
+ N({
82
+ type: "error",
83
+ title: "Помилка",
84
+ message: e instanceof Error ? e.message : "Не вдалося оновити шар"
85
+ });
86
+ }
87
+ }
88
+ k(() => String(g.params.id), (e) => {
89
+ e && B(e);
90
+ }, { immediate: !0 });
91
+ let H = {
92
+ route: g,
93
+ router: _,
94
+ layer: v,
95
+ loading: y,
96
+ error: b,
97
+ formRef: x,
98
+ editing: S,
99
+ isBase: C,
100
+ editRecord: w,
101
+ tiles: T,
102
+ preview: D,
103
+ zoomText: O,
104
+ opacityText: A,
105
+ legendColor: P,
106
+ styleEntries: F,
107
+ componentsText: I,
108
+ startEdit: L,
109
+ cancelEdit: R,
110
+ fetchLayer: z,
111
+ loadLayer: B,
112
+ onFormSaved: V,
113
+ AppIcon: t,
114
+ get RouterLink() {
115
+ return ee;
116
+ },
117
+ RegistryForm: a,
118
+ AppealDetailSection: r,
119
+ AppealDetailField: i,
120
+ get mapLayerForm() {
121
+ return f;
122
+ },
123
+ get LAYER_GROUP_OPTIONS() {
124
+ return u;
125
+ },
126
+ get LAYER_TYPE_OPTIONS() {
127
+ return s;
128
+ },
129
+ get TILE_SCHEME_OPTIONS() {
130
+ return o;
131
+ },
132
+ get optionText() {
133
+ return l;
134
+ }
135
+ };
136
+ return Object.defineProperty(H, "__isScriptSetup", {
137
+ enumerable: !1,
138
+ value: !0
139
+ }), H;
140
+ }
141
+ }), F = {
142
+ key: 0,
143
+ class: "px-4 py-16 text-center text-sm text-slate-400"
144
+ }, I = {
145
+ key: 1,
146
+ class: "pl-0"
147
+ }, L = { class: "mb-6" }, R = { class: "mb-4 flex items-center gap-1.5 text-sm" }, z = { class: "font-medium text-slate-700" }, B = { class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" }, V = { class: "flex items-center gap-3" }, H = { class: "text-xl font-bold tracking-tight text-slate-900" }, U = { class: "flex flex-col gap-5" }, W = {
148
+ key: 0,
149
+ class: "rounded-xl border border-slate-200 bg-white p-5 shadow-card"
150
+ }, G = { class: "mt-4 flex justify-end gap-3 border-t border-slate-100 pt-4" }, K = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, q = { class: "text-xs" }, J = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, Y = {
151
+ key: 0,
152
+ class: "space-y-1"
153
+ }, X = {
154
+ key: 1,
155
+ class: "text-amber-700"
156
+ }, Z = {
157
+ key: 0,
158
+ class: "flex items-center gap-4"
159
+ }, Q = ["src", "alt"], te = { class: "text-xs text-slate-400" }, $ = {
160
+ key: 1,
161
+ class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2"
162
+ }, ne = {
163
+ key: 0,
164
+ class: "inline-flex items-center gap-2"
165
+ }, re = { key: 1 }, ie = {
166
+ key: 2,
167
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
168
+ }, ae = { class: "text-sm text-slate-500" };
169
+ function oe(e, t, n, r, i, a) {
170
+ return r.loading ? (T(), v("div", F, " Завантаження… ")) : r.layer ? (T(), v("div", I, [y("header", L, [y("nav", R, [
171
+ x(r.RouterLink, {
172
+ to: "/map-layers",
173
+ class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
174
+ }, {
175
+ default: A(() => [x(r.AppIcon, {
176
+ name: "home",
177
+ class: "h-3.5 w-3.5"
178
+ }), t[1] ||= b(" Шари карти ", -1)]),
179
+ _: 1
180
+ }),
181
+ t[2] ||= y("span", { class: "text-slate-300" }, "/", -1),
182
+ y("span", z, O(r.layer.name), 1)
183
+ ]), y("div", B, [y("div", V, [y("h1", H, O(r.layer.name), 1), y("span", { class: C(["inline-flex rounded-full px-2 py-0.5 text-xs font-medium", r.layer.enabled ? "bg-emerald-50 text-emerald-700" : "bg-slate-100 text-slate-500"]) }, O(r.layer.enabled ? "Увімкнено" : "Вимкнено"), 3)]), r.editing ? _("", !0) : (T(), v("button", {
184
+ key: 0,
185
+ type: "button",
186
+ 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",
187
+ onClick: r.startEdit
188
+ }, [x(r.AppIcon, {
189
+ name: "pencil",
190
+ class: "h-4 w-4"
191
+ }), t[3] ||= b(" Редагувати ", -1)]))])]), y("div", U, [r.editing ? (T(), v("div", W, [x(r.RegistryForm, {
192
+ ref: "formRef",
193
+ config: r.mapLayerForm,
194
+ record: r.editRecord,
195
+ "hide-actions": "",
196
+ onSaved: r.onFormSaved,
197
+ onCancel: r.cancelEdit
198
+ }, null, 8, ["config", "record"]), y("div", G, [y("button", {
199
+ type: "button",
200
+ 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",
201
+ onClick: r.cancelEdit
202
+ }, " Скасувати "), y("button", {
203
+ type: "button",
204
+ 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",
205
+ onClick: t[0] ||= (e) => r.formRef?.submit()
206
+ }, " Зберегти зміни ")])])) : (T(), v(m, { key: 1 }, [
207
+ x(r.AppealDetailSection, { title: "Загальна інформація" }, {
208
+ icon: A(() => [x(r.AppIcon, {
209
+ name: "layers",
210
+ class: "h-[18px] w-[18px]"
211
+ })]),
212
+ default: A(() => [y("dl", K, [
213
+ x(r.AppealDetailField, { label: "Код" }, {
214
+ default: A(() => [y("code", q, O(r.layer.code), 1)]),
215
+ _: 1
216
+ }),
217
+ x(r.AppealDetailField, { label: "Група" }, {
218
+ default: A(() => [b(O(r.optionText(r.LAYER_GROUP_OPTIONS, r.layer.layer_group)), 1)]),
219
+ _: 1
220
+ }),
221
+ x(r.AppealDetailField, { label: "Тип джерела" }, {
222
+ default: A(() => [b(O(r.optionText(r.LAYER_TYPE_OPTIONS, r.layer.layer_type)), 1)]),
223
+ _: 1
224
+ }),
225
+ x(r.AppealDetailField, { label: "Порядок" }, {
226
+ default: A(() => [b(O(r.layer.sort_order ?? 0), 1)]),
227
+ _: 1
228
+ }),
229
+ x(r.AppealDetailField, { label: r.isBase ? "Активна підложка за замовчуванням" : "Увімкнений за замовчуванням" }, {
230
+ default: A(() => [b(O(r.layer.is_default ? "Так" : "Ні"), 1)]),
231
+ _: 1
232
+ }, 8, ["label"]),
233
+ r.isBase ? _("", !0) : (T(), g(r.AppealDetailField, {
234
+ key: 0,
235
+ label: "Фільтри"
236
+ }, {
237
+ default: A(() => [b(O(r.layer.has_filters ? "Є" : "Немає"), 1)]),
238
+ _: 1
239
+ })),
240
+ x(r.AppealDetailField, {
241
+ label: "Де використовується",
242
+ full: ""
243
+ }, {
244
+ default: A(() => [b(O(r.componentsText), 1)]),
245
+ _: 1
246
+ })
247
+ ])]),
248
+ _: 1
249
+ }),
250
+ x(r.AppealDetailSection, { title: "Джерело даних" }, {
251
+ icon: A(() => [x(r.AppIcon, {
252
+ name: "external-link",
253
+ class: "h-[18px] w-[18px]"
254
+ })]),
255
+ default: A(() => [y("dl", J, [
256
+ x(r.AppealDetailField, {
257
+ label: "URL тайлів",
258
+ full: ""
259
+ }, {
260
+ default: A(() => [r.tiles.length ? (T(), v("ul", Y, [(T(!0), v(m, null, D(r.tiles, (e) => (T(), v("li", {
261
+ key: e,
262
+ class: "break-all font-mono text-xs text-slate-600"
263
+ }, O(e), 1))), 128))])) : (T(), v("span", X, "Не налаштовано — шар не відображається на карті"))]),
264
+ _: 1
265
+ }),
266
+ x(r.AppealDetailField, { label: "Схема тайлів" }, {
267
+ default: A(() => [b(O(r.optionText(r.TILE_SCHEME_OPTIONS, r.layer.scheme ?? "xyz")), 1)]),
268
+ _: 1
269
+ }),
270
+ x(r.AppealDetailField, { label: "Масштаби" }, {
271
+ default: A(() => [b(O(r.zoomText), 1)]),
272
+ _: 1
273
+ }),
274
+ r.layer.layer_type === "raster" ? _("", !0) : (T(), g(r.AppealDetailField, {
275
+ key: 0,
276
+ label: "Source-layer"
277
+ }, {
278
+ default: A(() => [b(O(r.layer.source_layer || "—"), 1)]),
279
+ _: 1
280
+ })),
281
+ x(r.AppealDetailField, { label: "Атрибуція" }, {
282
+ default: A(() => [b(O(r.layer.attribution || "—"), 1)]),
283
+ _: 1
284
+ })
285
+ ])]),
286
+ _: 1
287
+ }),
288
+ x(r.AppealDetailSection, { title: "Відображення" }, {
289
+ icon: A(() => [x(r.AppIcon, {
290
+ name: "eye",
291
+ class: "h-[18px] w-[18px]"
292
+ })]),
293
+ default: A(() => [r.isBase ? (T(), v("div", Z, [r.preview ? (T(), v("img", {
294
+ key: 0,
295
+ src: r.preview,
296
+ alt: r.layer.name,
297
+ class: "h-24 w-32 shrink-0 rounded-lg border border-slate-200 object-cover"
298
+ }, null, 8, Q)) : _("", !0), y("p", te, O(r.layer.preview ? "Задане прев'ю" : "Прев'ю з першого URL тайлів"), 1)])) : (T(), v("dl", $, [
299
+ x(r.AppealDetailField, { label: "Непрозорість" }, {
300
+ default: A(() => [b(O(r.opacityText), 1)]),
301
+ _: 1
302
+ }),
303
+ x(r.AppealDetailField, { label: "Легенда" }, {
304
+ default: A(() => [r.legendColor ? (T(), v("span", ne, [y("span", {
305
+ class: "h-3 w-3 rounded-sm border border-slate-200",
306
+ style: w({ backgroundColor: r.legendColor })
307
+ }, null, 4), b(" " + O(r.legendColor), 1)])) : (T(), v("span", re, "—"))]),
308
+ _: 1
309
+ }),
310
+ (T(!0), v(m, null, D(r.styleEntries, (e) => (T(), g(r.AppealDetailField, {
311
+ key: e.key,
312
+ label: e.label
313
+ }, {
314
+ default: A(() => [b(O(e.value), 1)]),
315
+ _: 2
316
+ }, 1032, ["label"]))), 128))
317
+ ]))]),
318
+ _: 1
319
+ })
320
+ ], 64))])])) : (T(), v("div", ie, [y("p", ae, O(r.error || "Шар не знайдено."), 1), x(r.RouterLink, {
321
+ to: "/map-layers",
322
+ class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
323
+ }, {
324
+ default: A(() => [...t[4] ||= [b(" Повернутися до реєстру ", -1)]]),
325
+ _: 1
326
+ })]));
327
+ }
328
+ var se = /*#__PURE__*/ e(P, [["render", oe], ["__file", "D:/Softpro/surveyor/admin/src/pages/map-layers/card.vue"]]);
329
+ //#endregion
330
+ export { se as default };
@@ -0,0 +1,297 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { t } from "./AppIcon-CIR6y5uE.js";
3
+ import { a as n, i as r } from "./resources-2e8RFqWR.js";
4
+ import { t as i } from "./VerifiedBadge-Bba8WnuB.js";
5
+ import { t as a } from "./UserTypeBadge-YIwwoCho.js";
6
+ import { t as o } from "./UserAccessBadge-D8JfgGfN.js";
7
+ import { n as s, t as c } from "./AppealDetailField-CI-1qhs3.js";
8
+ import { a as l } from "./surveyorAccount-C7UiiIYg.js";
9
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, normalizeClass as y, openBlock as b, ref as x, renderList as S, toDisplayString as C, watch as w, withCtx as T } from "vue";
10
+ import { RouterLink as E, useRoute as D } from "vue-router";
11
+ //#region admin/src/pages/certificates/card.vue?vue&type=script&setup=true&lang.ts
12
+ var O = /*@__PURE__*/ v({
13
+ __name: "card",
14
+ setup(e, { expose: u }) {
15
+ u();
16
+ let f = D(), p = x(null), m = x([]), h = x(!1), g = x(""), _ = d(() => {
17
+ let e = p.value;
18
+ return e ? e.surveyor_name || [
19
+ e.last_name,
20
+ e.first_name,
21
+ e.middle_name
22
+ ].filter(Boolean).join(" ") || e.number_certificate || "Сертифікат" : "";
23
+ }), v = d(() => String(p.value?.certificate_type ?? "")), y = d(() => {
24
+ let e = p.value;
25
+ return e ? e.membership ? e.membership : e.is_membership === !0 ? "Так" : e.is_membership === !1 ? "Ні" : "—" : "—";
26
+ });
27
+ function b(e) {
28
+ return [
29
+ e.last_name,
30
+ e.first_name,
31
+ e.middle_name
32
+ ].filter(Boolean).join(" ") || "—";
33
+ }
34
+ function S(e) {
35
+ if (!e) return "";
36
+ let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
37
+ return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
38
+ }
39
+ async function C(e) {
40
+ h.value = !0, g.value = "", p.value = null, m.value = [];
41
+ try {
42
+ let [t, i] = await Promise.all([n(`/api/resource/certificates/${encodeURIComponent(e)}`), r("surveyors", {
43
+ page: 1,
44
+ limit: 100,
45
+ filters: { certificate_id: e }
46
+ }).catch(() => ({ rows: [] }))]);
47
+ p.value = t, m.value = i.rows ?? [];
48
+ } catch (e) {
49
+ p.value = null, m.value = [], g.value = e instanceof Error ? e.message : "Не вдалося завантажити сертифікат";
50
+ } finally {
51
+ h.value = !1;
52
+ }
53
+ }
54
+ w(() => String(f.params.id), (e) => {
55
+ e && C(e);
56
+ }, { immediate: !0 });
57
+ let T = {
58
+ route: f,
59
+ certificate: p,
60
+ surveyors: m,
61
+ loading: h,
62
+ error: g,
63
+ fullName: _,
64
+ registryType: v,
65
+ membershipText: y,
66
+ personName: b,
67
+ formatDate: S,
68
+ loadCertificate: C,
69
+ AppIcon: t,
70
+ get RouterLink() {
71
+ return E;
72
+ },
73
+ VerifiedBadge: i,
74
+ UserTypeBadge: a,
75
+ UserAccessBadge: o,
76
+ AppealDetailSection: s,
77
+ AppealDetailField: c,
78
+ get surveyorEnabled() {
79
+ return l;
80
+ }
81
+ };
82
+ return Object.defineProperty(T, "__isScriptSetup", {
83
+ enumerable: !1,
84
+ value: !0
85
+ }), T;
86
+ }
87
+ }), k = {
88
+ key: 0,
89
+ class: "px-4 py-16 text-center text-sm text-slate-400"
90
+ }, A = {
91
+ key: 1,
92
+ class: "pl-0"
93
+ }, j = { class: "mb-6" }, M = { class: "mb-4 flex items-center gap-1.5 text-sm" }, N = { class: "font-medium text-slate-700" }, P = { class: "flex min-w-0 flex-wrap items-center gap-3" }, F = { class: "text-xl font-bold tracking-tight text-slate-900" }, ee = {
94
+ key: 1,
95
+ class: "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2 py-0.5 text-xs font-medium text-slate-600"
96
+ }, I = { class: "flex flex-col gap-5" }, L = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, R = {
97
+ key: 1,
98
+ class: "text-[14px] font-medium text-slate-700"
99
+ }, z = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, B = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, V = {
100
+ key: 0,
101
+ class: "py-6 text-center text-sm text-slate-400"
102
+ }, H = {
103
+ key: 1,
104
+ class: "overflow-x-auto"
105
+ }, U = { class: "min-w-full table-fixed text-left text-[13px]" }, W = { class: "divide-y divide-slate-100" }, G = { class: "px-1 py-3" }, K = {
106
+ key: 0,
107
+ class: "mt-1 text-xs text-slate-400"
108
+ }, q = { class: "break-all px-1 py-3 text-slate-600" }, J = { class: "whitespace-nowrap px-1 py-3 text-slate-600" }, Y = { class: "px-1 py-3" }, X = {
109
+ key: 2,
110
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
111
+ }, Z = { class: "text-sm text-slate-500" };
112
+ function Q(e, t, n, r, i, a) {
113
+ return r.loading ? (b(), m("div", k, " Завантаження… ")) : r.certificate ? (b(), m("div", A, [h("header", j, [h("nav", M, [
114
+ _(r.RouterLink, {
115
+ to: "/certificates",
116
+ class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
117
+ }, {
118
+ default: T(() => [_(r.AppIcon, {
119
+ name: "home",
120
+ class: "h-3.5 w-3.5"
121
+ }), t[0] ||= g(" Реєстр сертифікатів ", -1)]),
122
+ _: 1
123
+ }),
124
+ t[1] ||= h("span", { class: "text-slate-300" }, "/", -1),
125
+ h("span", N, C(r.fullName), 1)
126
+ ]), h("div", P, [h("h1", F, C(r.fullName), 1), r.registryType ? (b(), f(r.UserTypeBadge, {
127
+ key: 0,
128
+ type: r.registryType
129
+ }, null, 8, ["type"])) : r.certificate.certificate_type_data?.text ? (b(), m("span", ee, C(r.certificate.certificate_type_data.text), 1)) : p("", !0)])]), h("div", I, [
130
+ _(r.AppealDetailSection, { title: "Інформація про сертифікат" }, {
131
+ icon: T(() => [_(r.AppIcon, {
132
+ name: "award",
133
+ class: "h-[18px] w-[18px]"
134
+ })]),
135
+ default: T(() => [h("dl", L, [
136
+ _(r.AppealDetailField, {
137
+ label: "Номер кваліфікаційного сертифіката",
138
+ highlight: ""
139
+ }, {
140
+ default: T(() => [g(C(r.certificate.number_certificate || "—"), 1)]),
141
+ _: 1
142
+ }),
143
+ _(r.AppealDetailField, { label: "Дата видачі кваліфікаційного сертифіката" }, {
144
+ default: T(() => [g(C(r.formatDate(r.certificate.date_certificate) || "—"), 1)]),
145
+ _: 1
146
+ }),
147
+ _(r.AppealDetailField, { label: "Реєстр" }, {
148
+ default: T(() => [g(C(r.certificate.certificate_type_data?.text || "—"), 1)]),
149
+ _: 1
150
+ }),
151
+ h("div", null, [t[2] ||= h("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифікація", -1), h("dd", null, [typeof r.certificate.isvalid == "boolean" ? (b(), f(r.VerifiedBadge, {
152
+ key: 0,
153
+ verified: r.certificate.isvalid
154
+ }, null, 8, ["verified"])) : (b(), m("span", R, "—"))])]),
155
+ _(r.AppealDetailField, {
156
+ label: "Назва навчального закладу",
157
+ full: ""
158
+ }, {
159
+ default: T(() => [g(C(r.certificate.name_school || "—"), 1)]),
160
+ _: 1
161
+ }),
162
+ _(r.AppealDetailField, { label: "Місце роботи інженера-геодезиста" }, {
163
+ default: T(() => [g(C(r.certificate.work_place || "—"), 1)]),
164
+ _: 1
165
+ }),
166
+ _(r.AppealDetailField, { label: "Місце провадження господарської діяльності" }, {
167
+ default: T(() => [g(C(r.certificate.economic_activity || "—"), 1)]),
168
+ _: 1
169
+ }),
170
+ _(r.AppealDetailField, {
171
+ label: "Членство",
172
+ full: ""
173
+ }, {
174
+ default: T(() => [g(C(r.membershipText), 1)]),
175
+ _: 1
176
+ })
177
+ ])]),
178
+ _: 1
179
+ }),
180
+ _(r.AppealDetailSection, { title: "Геодезист" }, {
181
+ icon: T(() => [_(r.AppIcon, {
182
+ name: "user",
183
+ class: "h-[18px] w-[18px]"
184
+ })]),
185
+ default: T(() => [h("dl", z, [
186
+ _(r.AppealDetailField, {
187
+ label: "ПІБ",
188
+ highlight: ""
189
+ }, {
190
+ default: T(() => [g(C(r.fullName), 1)]),
191
+ _: 1
192
+ }),
193
+ _(r.AppealDetailField, { label: "Email геодезиста" }, {
194
+ default: T(() => [g(C(r.certificate.surveyor_email || "—"), 1)]),
195
+ _: 1
196
+ }),
197
+ _(r.AppealDetailField, { label: "Номер телефону геодезиста" }, {
198
+ default: T(() => [g(C(r.certificate.surveyor_phone || "—"), 1)]),
199
+ _: 1
200
+ })
201
+ ])]),
202
+ _: 1
203
+ }),
204
+ _(r.AppealDetailSection, { title: "Кваліфікація та обмеження" }, {
205
+ icon: T(() => [_(r.AppIcon, {
206
+ name: "calendar-days",
207
+ class: "h-[18px] w-[18px]"
208
+ })]),
209
+ default: T(() => [h("dl", B, [
210
+ _(r.AppealDetailField, { label: "Підвищення кваліфікації" }, {
211
+ default: T(() => [g(C(r.formatDate(r.certificate.last_qualification_date) || "—"), 1)]),
212
+ _: 1
213
+ }),
214
+ _(r.AppealDetailField, { label: "Кваліфікаційний рівень" }, {
215
+ default: T(() => [g(C(r.certificate.qualification_level || "—"), 1)]),
216
+ _: 1
217
+ }),
218
+ _(r.AppealDetailField, { label: "Дата протоколу" }, {
219
+ default: T(() => [g(C(r.formatDate(r.certificate.date_protocol) || "—"), 1)]),
220
+ _: 1
221
+ }),
222
+ _(r.AppealDetailField, { label: "Номер протоколу" }, {
223
+ default: T(() => [g(C(r.certificate.number_protocol || "—"), 1)]),
224
+ _: 1
225
+ }),
226
+ _(r.AppealDetailField, {
227
+ label: "Інформація про підвищення кваліфікації",
228
+ full: ""
229
+ }, {
230
+ default: T(() => [g(C(r.certificate.certificate_increase || "—"), 1)]),
231
+ _: 1
232
+ }),
233
+ _(r.AppealDetailField, {
234
+ label: "Підстава для поновлення",
235
+ full: ""
236
+ }, {
237
+ default: T(() => [g(C(r.certificate.certificate_renewal || "—"), 1)]),
238
+ _: 1
239
+ }),
240
+ _(r.AppealDetailField, { label: "Дата призупинення" }, {
241
+ default: T(() => [h("span", { class: y(r.certificate.certificate_suspension ? "text-danger-700" : "") }, C(r.formatDate(r.certificate.certificate_suspension) || "—"), 3)]),
242
+ _: 1
243
+ }),
244
+ _(r.AppealDetailField, { label: "Дата припинення" }, {
245
+ default: T(() => [h("span", { class: y(r.certificate.certificate_stopping ? "text-danger-700" : "") }, C(r.certificate.certificate_stopping || "—"), 3)]),
246
+ _: 1
247
+ })
248
+ ])]),
249
+ _: 1
250
+ }),
251
+ _(r.AppealDetailSection, { title: "Користувачі" }, {
252
+ icon: T(() => [_(r.AppIcon, {
253
+ name: "users",
254
+ class: "h-[18px] w-[18px]"
255
+ })]),
256
+ default: T(() => [r.surveyors.length === 0 ? (b(), m("p", V, " Користувачів за цим сертифікатом не знайдено. ")) : (b(), m("div", H, [h("table", U, [
257
+ t[3] ||= h("colgroup", null, [
258
+ h("col", { class: "w-[32%]" }),
259
+ h("col", { class: "w-[28%]" }),
260
+ h("col", { class: "w-[22%]" }),
261
+ h("col", { class: "w-[18%]" })
262
+ ], -1),
263
+ t[4] ||= h("thead", { class: "text-xs font-semibold text-slate-500" }, [h("tr", { class: "border-b border-slate-100" }, [
264
+ h("th", { class: "px-1 py-2.5" }, "ПІБ"),
265
+ h("th", { class: "px-1 py-2.5" }, "Email"),
266
+ h("th", { class: "px-1 py-2.5" }, "Телефон"),
267
+ h("th", { class: "px-1 py-2.5" }, "Доступ")
268
+ ])], -1),
269
+ h("tbody", W, [(b(!0), m(u, null, S(r.surveyors, (e) => (b(), m("tr", {
270
+ key: e.surveyor_id,
271
+ class: "transition-colors hover:bg-brand-50/40"
272
+ }, [
273
+ h("td", G, [_(r.RouterLink, {
274
+ to: `/users/${e.surveyor_id}`,
275
+ class: "font-semibold text-brand-700 hover:text-brand-900 hover:underline"
276
+ }, {
277
+ default: T(() => [g(C(r.personName(e)), 1)]),
278
+ _: 2
279
+ }, 1032, ["to"]), e.registered_at ? p("", !0) : (b(), m("p", K, "Реєстрацію не завершено"))]),
280
+ h("td", q, C(e.email || "—"), 1),
281
+ h("td", J, C(e.phone || "—"), 1),
282
+ h("td", Y, [_(r.UserAccessBadge, { "account-blocked": !r.surveyorEnabled(e) }, null, 8, ["account-blocked"])])
283
+ ]))), 128))])
284
+ ])]))]),
285
+ _: 1
286
+ })
287
+ ])])) : (b(), m("div", X, [h("p", Z, C(r.error || "Сертифікат не знайдено."), 1), _(r.RouterLink, {
288
+ to: "/certificates",
289
+ class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
290
+ }, {
291
+ default: T(() => [...t[5] ||= [g(" Повернутися до реєстру ", -1)]]),
292
+ _: 1
293
+ })]));
294
+ }
295
+ var $ = /*#__PURE__*/ e(O, [["render", Q], ["__file", "D:/Softpro/surveyor/admin/src/pages/certificates/card.vue"]]);
296
+ //#endregion
297
+ export { $ as default };