@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,530 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { o as t } from "./profile-ByahbF4B.js";
3
+ import { n, r, t as i } from "./AppealStatusBadge-CSXnfarR.js";
4
+ import { o as a } from "./applications-BB9JRcgl.js";
5
+ import { i as o, n as s, r as c, t as l } from "./organizations-BbYipLwk.js";
6
+ 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, reactive as x, ref as S, renderList as C, toDisplayString as w, vModelText as T, watch as E, withCtx as D, withDirectives as O, withModifiers as k } from "vue";
7
+ import { RouterLink as ee, useRoute as te } from "vue-router";
8
+ //#region cabinet/src/components/table/TablePagination.vue?vue&type=script&setup=true&lang.ts
9
+ var A = /*@__PURE__*/ v({
10
+ __name: "TablePagination",
11
+ props: {
12
+ page: {
13
+ type: Number,
14
+ required: !0
15
+ },
16
+ pageSize: {
17
+ type: Number,
18
+ required: !0
19
+ },
20
+ total: {
21
+ type: Number,
22
+ required: !0
23
+ }
24
+ },
25
+ emits: ["update:page", "update:pageSize"],
26
+ setup(e, { expose: n, emit: r }) {
27
+ n();
28
+ let i = e, a = r, o = [
29
+ 10,
30
+ 25,
31
+ 50
32
+ ], s = d(() => Math.max(1, Math.ceil(i.total / i.pageSize))), c = d(() => i.total === 0 ? 0 : (i.page - 1) * i.pageSize + 1), l = d(() => Math.min(i.page * i.pageSize, i.total)), u = d(() => {
33
+ let e = s.value, t = Math.min(i.page, e), n = Array.from({ length: e }, (e, t) => t + 1).filter((n) => n === 1 || n === e || Math.abs(n - t) <= 1), r = [];
34
+ return n.forEach((e, t) => {
35
+ let i = n[t - 1];
36
+ t > 0 && i !== void 0 && e - i > 1 && r.push("..."), r.push(e);
37
+ }), r;
38
+ });
39
+ function f(e) {
40
+ a("update:page", Math.max(1, Math.min(e, s.value)));
41
+ }
42
+ let p = {
43
+ props: i,
44
+ emit: a,
45
+ pageSizes: o,
46
+ totalPages: s,
47
+ from: c,
48
+ to: l,
49
+ pages: u,
50
+ goTo: f,
51
+ AppIcon: t
52
+ };
53
+ return Object.defineProperty(p, "__isScriptSetup", {
54
+ enumerable: !1,
55
+ value: !0
56
+ }), p;
57
+ }
58
+ }), j = { class: "mt-4 flex flex-wrap items-center justify-between gap-4 border-t border-gray-200 py-3" }, M = { class: "flex items-center gap-2 text-sm text-gray-500" }, N = ["value"], P = ["value"], F = { class: "flex items-center gap-1" }, I = { class: "mr-2 text-sm text-gray-500" }, L = ["disabled"], R = ["disabled"], z = {
59
+ key: 0,
60
+ class: "px-1 text-sm text-gray-400"
61
+ }, B = ["onClick"], V = ["disabled"], H = ["disabled"];
62
+ function U(e, t, n, r, i, a) {
63
+ return b(), m("div", j, [h("label", M, [t[5] ||= h("span", null, "Рядків на сторінці:", -1), h("select", {
64
+ value: n.pageSize,
65
+ class: "rounded-lg border border-gray-200 bg-white px-2 py-1 text-sm text-gray-700 outline-none focus:border-[#2663EB] focus:ring-2 focus:ring-[#2663EB]/20",
66
+ onChange: t[0] ||= (e) => r.emit("update:pageSize", Number(e.target.value))
67
+ }, [(b(), m(u, null, C(r.pageSizes, (e) => h("option", {
68
+ key: e,
69
+ value: e
70
+ }, w(e), 9, P)), 64))], 40, N)]), h("div", F, [
71
+ h("span", I, w(r.from) + "–" + w(r.to) + " з " + w(n.total), 1),
72
+ h("button", {
73
+ type: "button",
74
+ class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-30",
75
+ disabled: n.page <= 1,
76
+ "aria-label": "Перша сторінка",
77
+ onClick: t[1] ||= (e) => r.goTo(1)
78
+ }, [_(r.AppIcon, {
79
+ name: "chevrons-left",
80
+ class: "h-[15px] w-[15px]"
81
+ })], 8, L),
82
+ h("button", {
83
+ type: "button",
84
+ class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-30",
85
+ disabled: n.page <= 1,
86
+ "aria-label": "Попередня сторінка",
87
+ onClick: t[2] ||= (e) => r.goTo(n.page - 1)
88
+ }, [_(r.AppIcon, {
89
+ name: "chevron-left",
90
+ class: "h-[15px] w-[15px]"
91
+ })], 8, R),
92
+ (b(!0), m(u, null, C(r.pages, (e, t) => (b(), m(u, { key: `${e}-${t}` }, [e === "..." ? (b(), m("span", z, "…")) : (b(), m("button", {
93
+ key: 1,
94
+ type: "button",
95
+ class: y(["h-8 min-w-[32px] rounded-lg px-2 text-sm font-medium transition-colors", n.page === e ? "bg-[#2663EB] text-white" : "text-gray-600 hover:bg-gray-100"]),
96
+ onClick: (t) => r.goTo(e)
97
+ }, w(e), 11, B))], 64))), 128)),
98
+ h("button", {
99
+ type: "button",
100
+ class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-30",
101
+ disabled: n.page >= r.totalPages,
102
+ "aria-label": "Наступна сторінка",
103
+ onClick: t[3] ||= (e) => r.goTo(n.page + 1)
104
+ }, [_(r.AppIcon, {
105
+ name: "chevron-right",
106
+ class: "h-[15px] w-[15px]"
107
+ })], 8, V),
108
+ h("button", {
109
+ type: "button",
110
+ class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-30",
111
+ disabled: n.page >= r.totalPages,
112
+ "aria-label": "Остання сторінка",
113
+ onClick: t[4] ||= (e) => r.goTo(r.totalPages)
114
+ }, [_(r.AppIcon, {
115
+ name: "chevrons-right",
116
+ class: "h-[15px] w-[15px]"
117
+ })], 8, H)
118
+ ])]);
119
+ }
120
+ var ne = /*#__PURE__*/ e(A, [["render", U], ["__file", "D:/Softpro/surveyor/cabinet/src/components/table/TablePagination.vue"]]), W = /*@__PURE__*/ v({
121
+ __name: "RequestFilters",
122
+ props: { filters: {
123
+ type: Object,
124
+ required: !0
125
+ } },
126
+ emits: ["apply", "close"],
127
+ setup(e, { expose: n, emit: r }) {
128
+ n();
129
+ let i = e, a = r, o = x({ ...i.filters }), s = [
130
+ ["year", "Рік подачі заявки"],
131
+ ["number", "Номер звернення"],
132
+ ["address", "Адреса"],
133
+ ["location", "Місцезнаходження"]
134
+ ], c = [
135
+ ["receiptDate", "Дата прийому заявки"],
136
+ ["dataReceiptDate", "Дата прийому даних"],
137
+ ["dataIssueDate", "Дата видачі даних"],
138
+ ["cancelDate", "Дата скасування"],
139
+ ["ectsoDate", "Дата внесення в ЄЦТО"]
140
+ ];
141
+ function l() {
142
+ return { ...o };
143
+ }
144
+ function u() {
145
+ for (let e of Object.keys(o)) o[e] = "";
146
+ a("apply", l());
147
+ }
148
+ let d = {
149
+ props: i,
150
+ emit: a,
151
+ local: o,
152
+ textFields: s,
153
+ dateFields: c,
154
+ snapshot: l,
155
+ clear: u,
156
+ AppIcon: t
157
+ };
158
+ return Object.defineProperty(d, "__isScriptSetup", {
159
+ enumerable: !1,
160
+ value: !0
161
+ }), d;
162
+ }
163
+ }), G = { class: "flex h-full w-[420px] max-w-full animate-[slide-in_0.2s_ease] flex-col overflow-hidden bg-white shadow-2xl" }, K = { class: "flex items-center justify-between border-b border-gray-100 px-6 py-4" }, q = { class: "flex flex-1 flex-col gap-5 overflow-y-auto px-6 py-5" }, J = { class: "mb-2 block text-sm font-semibold text-gray-800" }, Y = { class: "relative block" }, X = ["onUpdate:modelValue", "placeholder"], Z = { class: "mb-2 block text-sm font-semibold text-gray-800" }, re = ["onUpdate:modelValue"], ie = { class: "flex gap-3 border-t border-gray-100 px-6 py-4" };
164
+ function ae(e, t, n, r, i, a) {
165
+ return b(), m("div", {
166
+ class: "fixed inset-0 z-50 flex justify-end bg-slate-900/25",
167
+ onMousedown: t[2] ||= k((e) => r.emit("close"), ["self"])
168
+ }, [h("div", G, [
169
+ h("div", K, [t[3] ||= h("h2", { class: "text-base font-semibold text-gray-900" }, "Фільтри", -1), h("button", {
170
+ type: "button",
171
+ class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600",
172
+ "aria-label": "Закрити",
173
+ onClick: t[0] ||= (e) => r.emit("close")
174
+ }, [_(r.AppIcon, {
175
+ name: "x",
176
+ class: "h-[18px] w-[18px]"
177
+ })])]),
178
+ h("div", q, [(b(), m(u, null, C(r.textFields, ([e, t]) => h("label", {
179
+ key: e,
180
+ class: "block"
181
+ }, [h("span", J, w(t), 1), h("span", Y, [O(h("input", {
182
+ "onUpdate:modelValue": (t) => r.local[e] = t,
183
+ type: "text",
184
+ placeholder: t,
185
+ class: "w-full rounded-xl border border-gray-200 px-4 py-3 pr-10 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-[#2663EB]"
186
+ }, null, 8, X), [[T, r.local[e]]]), _(r.AppIcon, {
187
+ name: "search",
188
+ class: "pointer-events-none absolute right-3 top-1/2 h-[15px] w-[15px] -translate-y-1/2 text-gray-300"
189
+ })])])), 64)), (b(), m(u, null, C(r.dateFields, ([e, t]) => h("label", {
190
+ key: e,
191
+ class: "block"
192
+ }, [h("span", Z, w(t), 1), O(h("input", {
193
+ "onUpdate:modelValue": (t) => r.local[e] = t,
194
+ type: "date",
195
+ class: "w-full appearance-none rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-500 outline-none transition-colors focus:border-[#2663EB]"
196
+ }, null, 8, re), [[T, r.local[e]]])])), 64))]),
197
+ h("div", ie, [h("button", {
198
+ type: "button",
199
+ class: "flex-1 rounded-xl bg-gray-100 py-2.5 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200",
200
+ onClick: r.clear
201
+ }, " Очистити "), h("button", {
202
+ type: "button",
203
+ class: "flex-1 rounded-xl bg-[#2663EB] py-2.5 text-sm font-medium text-white transition-colors hover:bg-[#1d4fd8]",
204
+ onClick: t[1] ||= (e) => r.emit("apply", r.snapshot())
205
+ }, " Застосувати ")])
206
+ ])], 32);
207
+ }
208
+ var oe = /*#__PURE__*/ e(W, [["render", ae], ["__file", "D:/Softpro/surveyor/cabinet/src/pages/requests/components/RequestFilters.vue"]]), Q = S(""), se = /*@__PURE__*/ v({
209
+ __name: "index",
210
+ setup(e, { expose: u }) {
211
+ u();
212
+ let f = te(), p = d(() => {
213
+ let e = f.query.submitted;
214
+ return typeof e == "string" && e ? e : "";
215
+ }), m = S("all"), h = S("list"), g = S(1), _ = S(10), v = S(!1), y = S(null);
216
+ function b() {
217
+ return {
218
+ year: "",
219
+ number: "",
220
+ address: "",
221
+ location: "",
222
+ receiptDate: "",
223
+ dataReceiptDate: "",
224
+ dataIssueDate: "",
225
+ cancelDate: "",
226
+ ectsoDate: ""
227
+ };
228
+ }
229
+ let x = S(b()), C = S([]), w = S(0), T = S(null), D = S(!0), O = S(""), k = d(() => o.value.find((e) => e.id === l.value)?.shortName ?? ""), A = d(() => Object.values(x.value).filter((e) => e.trim()).length), j = d(() => {
230
+ let e = T.value, t = {};
231
+ for (let n of r) {
232
+ let r = n.key === "all" ? e?.count : e?.[n.key], i = Number(r ?? 0);
233
+ t[n.key] = Number.isFinite(i) ? i : 0;
234
+ }
235
+ return t;
236
+ }), M = d(() => C.value.reduce((e, t) => e + t.area, 0));
237
+ function N(e) {
238
+ return e?.text?.trim() ?? "";
239
+ }
240
+ function P(e) {
241
+ let t = e.location?.trim() ?? "";
242
+ return {
243
+ id: e.app_id,
244
+ number: e.number?.trim() || e.app_id,
245
+ organization: N(e.org_id_data) || "—",
246
+ address: N(e.address_id_data) || t || "—",
247
+ location: t,
248
+ status: e.status ?? "",
249
+ workType: N(e.work_type_data) || e.work_type || "—",
250
+ area: Number(e.area) || 0
251
+ };
252
+ }
253
+ function F() {
254
+ return [Q.value.trim(), [
255
+ x.value.number,
256
+ x.value.address,
257
+ x.value.location
258
+ ].map((e) => e.trim()).filter(Boolean).join(" ")].filter(Boolean).join(" ").trim() || void 0;
259
+ }
260
+ function I(e) {
261
+ let t = {};
262
+ return l.value && (t.org_id = l.value), e !== "all" && (t.status = e), t;
263
+ }
264
+ let L = 0;
265
+ async function R() {
266
+ let e = ++L;
267
+ D.value = !0, O.value = "";
268
+ try {
269
+ let t = m.value, n = await a({
270
+ page: g.value,
271
+ limit: _.value,
272
+ sort: "-created_at",
273
+ search: F(),
274
+ filters: I(t)
275
+ });
276
+ if (e !== L) return;
277
+ let r = Number(n.total ?? n.summary?.count ?? 0), i = Math.max(1, Math.ceil((Number.isFinite(r) ? r : 0) / _.value) || 1);
278
+ if (g.value > i) {
279
+ g.value = i;
280
+ return;
281
+ }
282
+ C.value = (n.rows ?? []).map(P), w.value = Number.isFinite(r) ? r : 0, t === "all" && (T.value = n.summary ?? null);
283
+ } catch (t) {
284
+ if (e !== L) return;
285
+ C.value = [], w.value = 0, T.value = null, O.value = t instanceof Error ? t.message : "Не вдалося завантажити звернення";
286
+ } finally {
287
+ e === L && (D.value = !1);
288
+ }
289
+ }
290
+ function z() {
291
+ (c.value || s.value) && (g.value === 1 ? R() : g.value = 1);
292
+ }
293
+ E([
294
+ c,
295
+ s,
296
+ l,
297
+ () => f.query.submitted
298
+ ], () => {
299
+ z();
300
+ }, { immediate: !0 }), E([
301
+ Q,
302
+ x,
303
+ m,
304
+ _
305
+ ], () => {
306
+ z();
307
+ }), E(g, () => {
308
+ (c.value || s.value) && R();
309
+ });
310
+ function B() {
311
+ v.value = !0;
312
+ }
313
+ function V(e) {
314
+ x.value = e, v.value = !1;
315
+ }
316
+ function H(e) {
317
+ return `/requests/${encodeURIComponent(e)}`;
318
+ }
319
+ let U = {
320
+ route: f,
321
+ submitSuccess: p,
322
+ activeStatus: m,
323
+ layout: h,
324
+ page: g,
325
+ pageSize: _,
326
+ filtersOpen: v,
327
+ hoveredId: y,
328
+ emptyFilters: b,
329
+ appliedFilters: x,
330
+ appeals: C,
331
+ total: w,
332
+ summary: T,
333
+ loading: D,
334
+ loadError: O,
335
+ orgName: k,
336
+ activeFilterCount: A,
337
+ statusCounts: j,
338
+ totalArea: M,
339
+ lookupText: N,
340
+ mapAppeal: P,
341
+ buildSearch: F,
342
+ listFilters: I,
343
+ get requestId() {
344
+ return L;
345
+ },
346
+ set requestId(e) {
347
+ L = e;
348
+ },
349
+ loadAppeals: R,
350
+ reloadFromFirstPage: z,
351
+ openFilters: B,
352
+ applyFilters: V,
353
+ requestPath: H,
354
+ get RouterLink() {
355
+ return ee;
356
+ },
357
+ AppealStatusBadge: i,
358
+ AppIcon: t,
359
+ TablePagination: ne,
360
+ RequestFilters: oe,
361
+ get APPEAL_STATUS() {
362
+ return n;
363
+ },
364
+ get REQUEST_STATUS_TABS() {
365
+ return r;
366
+ }
367
+ };
368
+ return Object.defineProperty(U, "__isScriptSetup", {
369
+ enumerable: !1,
370
+ value: !0
371
+ }), U;
372
+ }
373
+ }), ce = { class: "min-h-[calc(100vh-3.5rem)] bg-gray-50" }, le = { class: "border-b border-gray-200 bg-white pt-5 pb-0" }, ue = { class: "mx-auto max-w-[1400px] px-6" }, de = { class: "mb-4" }, fe = { class: "mt-0.5 flex items-center gap-1.5 text-sm text-gray-400" }, pe = { class: "mx-auto max-w-[1400px] px-6" }, me = { class: "flex flex-wrap items-center mb-1" }, he = ["onClick"], ge = { class: "flex items-center gap-2 pb-1 pt-1" }, _e = {
374
+ key: 0,
375
+ class: "absolute -right-1.5 -top-1.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-[#2663EB] px-1 text-[10px] font-bold text-white"
376
+ }, ve = { class: "flex items-center rounded-lg bg-gray-100 p-0.5" }, ye = { class: "mx-auto max-w-[1400px] px-6 py-4" }, be = {
377
+ key: 0,
378
+ class: "mb-4 rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800"
379
+ }, xe = {
380
+ key: 1,
381
+ class: "py-24 text-center"
382
+ }, Se = {
383
+ key: 2,
384
+ class: "py-24 text-center"
385
+ }, Ce = { class: "text-sm text-gray-500" }, we = {
386
+ key: 3,
387
+ class: "py-24 text-center"
388
+ }, Te = { class: "mb-3 flex flex-wrap items-center gap-4 text-sm text-gray-500" }, Ee = { class: "text-gray-900" }, De = { class: "font-semibold text-gray-900" }, Oe = {
389
+ class: "w-full border-separate border-spacing-y-1",
390
+ style: { "table-layout": "fixed" }
391
+ }, ke = ["onMouseenter"], Ae = { class: "h-[52px] px-4 align-middle" }, je = { class: "flex items-center justify-between gap-2" }, Me = { class: "h-[52px] px-4 align-middle" }, Ne = { class: "truncate text-sm font-medium text-gray-900" }, Pe = { class: "h-[52px] px-4 align-middle" }, $ = { class: "truncate text-sm text-gray-500" }, Fe = { class: "h-[52px] px-4 align-middle" }, Ie = { class: "h-[52px] px-4 align-middle" }, Le = { class: "truncate text-sm text-gray-700" }, Re = {
392
+ key: 1,
393
+ class: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3"
394
+ }, ze = { class: "p-4" }, Be = { class: "mb-3 flex items-start justify-between gap-2" }, Ve = { class: "mb-1 truncate text-sm font-semibold text-gray-900" }, He = { class: "mb-3 truncate text-xs text-gray-400" }, Ue = { class: "line-clamp-2 text-xs text-gray-500" };
395
+ function We(e, t, n, r, i, a) {
396
+ return b(), m("div", ce, [
397
+ h("div", le, [h("div", ue, [h("div", de, [t[6] ||= h("h1", { class: "text-xl font-semibold text-gray-900" }, "Звернення", -1), h("p", fe, [_(r.AppIcon, {
398
+ name: "building-2",
399
+ class: "h-[13px] w-[13px] text-gray-300"
400
+ }), g(" " + w(r.orgName), 1)])])]), h("div", pe, [h("div", me, [(b(!0), m(u, null, C(r.REQUEST_STATUS_TABS, (e) => (b(), m("button", {
401
+ key: e.key,
402
+ type: "button",
403
+ class: y(["flex items-center gap-1.5 whitespace-nowrap border-b-2 px-2.5 py-2.5 text-sm font-medium transition-colors", r.activeStatus === e.key ? "border-[#2663EB] text-[#2663EB]" : "border-transparent text-gray-500 hover:text-gray-700"]),
404
+ onClick: (t) => r.activeStatus = e.key
405
+ }, [g(w(e.label) + " ", 1), h("span", { class: y(["rounded-full px-1.5 py-0.5 text-xs font-medium", r.activeStatus === e.key ? "bg-[#2663EB] text-white" : "bg-gray-100 text-gray-500"]) }, w(r.statusCounts[e.key] || 0), 3)], 10, he))), 128))]), h("div", ge, [h("button", {
406
+ type: "button",
407
+ class: "relative flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-1.5 text-sm text-gray-600 transition-colors hover:border-gray-300",
408
+ onClick: r.openFilters
409
+ }, [
410
+ _(r.AppIcon, {
411
+ name: "sliders-horizontal",
412
+ class: "h-3.5 w-3.5"
413
+ }),
414
+ t[7] ||= g(" Фільтри ", -1),
415
+ r.activeFilterCount > 0 ? (b(), m("span", _e, w(r.activeFilterCount), 1)) : p("", !0)
416
+ ]), h("div", ve, [h("button", {
417
+ type: "button",
418
+ class: y(["rounded-md p-1.5 transition-all", r.layout === "list" ? "bg-white text-gray-900 shadow-sm" : "text-gray-400 hover:text-gray-600"]),
419
+ "aria-label": "Список",
420
+ onClick: t[0] ||= (e) => r.layout = "list"
421
+ }, [_(r.AppIcon, {
422
+ name: "list",
423
+ class: "h-[15px] w-[15px]"
424
+ })], 2), h("button", {
425
+ type: "button",
426
+ class: y(["rounded-md p-1.5 transition-all", r.layout === "grid" ? "bg-white text-gray-900 shadow-sm" : "text-gray-400 hover:text-gray-600"]),
427
+ "aria-label": "Картки",
428
+ onClick: t[1] ||= (e) => r.layout = "grid"
429
+ }, [_(r.AppIcon, {
430
+ name: "layout-grid",
431
+ class: "h-[15px] w-[15px]"
432
+ })], 2)])])])]),
433
+ h("div", ye, [r.submitSuccess ? (b(), m("p", be, " Звернення № " + w(r.submitSuccess) + " успішно подано. ", 1)) : p("", !0), r.loading && r.appeals.length === 0 ? (b(), m("div", xe, [...t[8] ||= [h("p", { class: "text-sm text-gray-500" }, "Завантаження…", -1)]])) : r.loadError ? (b(), m("div", Se, [_(r.AppIcon, {
434
+ name: "alert-circle",
435
+ class: "mx-auto mb-3 h-9 w-9 text-gray-300"
436
+ }), h("p", Ce, w(r.loadError), 1)])) : r.appeals.length === 0 ? (b(), m("div", we, [_(r.AppIcon, {
437
+ name: "alert-circle",
438
+ class: "mx-auto mb-3 h-9 w-9 text-gray-300"
439
+ }), t[9] ||= h("p", { class: "text-sm text-gray-500" }, "Звернень не знайдено", -1)])) : (b(), m("div", {
440
+ key: 4,
441
+ class: y(r.loading ? "opacity-60" : "")
442
+ }, [r.layout === "list" ? (b(), m(u, { key: 0 }, [h("div", Te, [h("span", null, [t[10] ||= g(" Об'єктів: ", -1), h("strong", Ee, w(r.appeals.length) + " із " + w(r.total), 1)]), h("span", null, [t[11] ||= g(" Активна площа на сторінці: ", -1), h("span", De, w(r.totalArea.toFixed(1)) + " га", 1)])]), h("table", Oe, [
443
+ t[12] ||= h("colgroup", null, [
444
+ h("col", { style: { width: "18%" } }),
445
+ h("col", { style: { width: "24%" } }),
446
+ h("col", { style: { width: "24%" } }),
447
+ h("col", { style: { width: "18%" } }),
448
+ h("col", { style: { width: "16%" } })
449
+ ], -1),
450
+ h("thead", null, [h("tr", null, [(b(), m(u, null, C([
451
+ "№",
452
+ "Організація / особа",
453
+ "Адреса",
454
+ "Статус",
455
+ "Вид робіт"
456
+ ], (e) => h("th", {
457
+ key: e,
458
+ class: "px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-gray-400"
459
+ }, w(e), 1)), 64))])]),
460
+ h("tbody", null, [(b(!0), m(u, null, C(r.appeals, (e) => (b(), m("tr", {
461
+ key: e.id,
462
+ class: "bg-white transition-shadow hover:shadow-sm",
463
+ onMouseenter: (t) => r.hoveredId = e.id,
464
+ onMouseleave: t[2] ||= (e) => r.hoveredId = null
465
+ }, [
466
+ h("td", Ae, [h("div", je, [_(r.RouterLink, {
467
+ to: r.requestPath(e.id),
468
+ class: "whitespace-nowrap text-sm font-medium text-[#2663EB] hover:underline"
469
+ }, {
470
+ default: D(() => [g(" #" + w(e.number), 1)]),
471
+ _: 2
472
+ }, 1032, ["to"]), _(r.RouterLink, {
473
+ to: r.requestPath(e.id),
474
+ class: y(["rounded-lg p-1.5 text-gray-400 transition-all hover:bg-gray-100 hover:text-gray-700", r.hoveredId === e.id ? "opacity-100" : "opacity-0"]),
475
+ title: "Переглянути"
476
+ }, {
477
+ default: D(() => [_(r.AppIcon, {
478
+ name: "eye",
479
+ class: "h-[13px] w-[13px]"
480
+ })]),
481
+ _: 1
482
+ }, 8, ["to", "class"])])]),
483
+ h("td", Me, [h("p", Ne, w(e.organization || "—"), 1)]),
484
+ h("td", Pe, [h("p", $, w(e.address), 1)]),
485
+ h("td", Fe, [_(r.AppealStatusBadge, {
486
+ status: e.status,
487
+ size: "sm"
488
+ }, null, 8, ["status"])]),
489
+ h("td", Ie, [h("p", Le, w(e.workType), 1)])
490
+ ], 40, ke))), 128))])
491
+ ])], 64)) : (b(), m("div", Re, [(b(!0), m(u, null, C(r.appeals, (e) => (b(), m("article", {
492
+ key: e.id,
493
+ class: "overflow-hidden rounded-2xl border border-gray-200 bg-white transition-all hover:border-gray-300 hover:shadow-md"
494
+ }, [h("div", { class: y(["h-1", r.APPEAL_STATUS[e.status]?.dot ?? "bg-gray-400"]) }, null, 2), h("div", ze, [
495
+ h("div", Be, [_(r.RouterLink, {
496
+ to: r.requestPath(e.id),
497
+ class: "font-mono text-xs font-semibold text-[#2663EB]"
498
+ }, {
499
+ default: D(() => [g(" #" + w(e.number), 1)]),
500
+ _: 2
501
+ }, 1032, ["to"]), _(r.AppealStatusBadge, {
502
+ status: e.status,
503
+ size: "sm",
504
+ chevron: ""
505
+ }, null, 8, ["status"])]),
506
+ h("p", Ve, w(e.organization || "Без організації"), 1),
507
+ h("p", He, w(e.address), 1),
508
+ h("p", Ue, w(e.workType), 1)
509
+ ])]))), 128))])), _(r.TablePagination, {
510
+ page: r.page,
511
+ "onUpdate:page": t[3] ||= (e) => r.page = e,
512
+ "page-size": r.pageSize,
513
+ "onUpdate:pageSize": t[4] ||= (e) => r.pageSize = e,
514
+ total: r.total
515
+ }, null, 8, [
516
+ "page",
517
+ "page-size",
518
+ "total"
519
+ ])], 2))]),
520
+ r.filtersOpen ? (b(), f(r.RequestFilters, {
521
+ key: 0,
522
+ filters: r.appliedFilters,
523
+ onApply: r.applyFilters,
524
+ onClose: t[5] ||= (e) => r.filtersOpen = !1
525
+ }, null, 8, ["filters"])) : p("", !0)
526
+ ]);
527
+ }
528
+ var Ge = /*#__PURE__*/ e(se, [["render", We], ["__file", "D:/Softpro/surveyor/cabinet/src/pages/requests/index.vue"]]);
529
+ //#endregion
530
+ export { Ge as default };
@@ -0,0 +1,27 @@
1
+ import { a as e } from "./resources-2e8RFqWR.js";
2
+ import { notify as t } from "@opengis/core";
3
+ //#region admin/src/utils/resendSurveyorRegistration.ts
4
+ function n(e) {
5
+ return !e.registered_at && e.enabled !== !1;
6
+ }
7
+ async function r(n) {
8
+ try {
9
+ return (await e(`/api/surveyor/surveyors/${encodeURIComponent(n)}/registration/resend`, { method: "POST" })).sent ? t({
10
+ type: "success",
11
+ title: "Лист надіслано",
12
+ message: "На email надіслано нове посилання для завершення реєстрації"
13
+ }) : t({
14
+ type: "warning",
15
+ title: "Лист не надіслано",
16
+ message: "Нове посилання сформовано, але надсилання email вимкнено або не налаштовано"
17
+ }), !0;
18
+ } catch (e) {
19
+ return t({
20
+ type: "error",
21
+ title: "Помилка",
22
+ message: e instanceof Error ? e.message : "Не вдалося надіслати лист"
23
+ }), !1;
24
+ }
25
+ }
26
+ //#endregion
27
+ export { r as n, n as t };
@@ -0,0 +1,129 @@
1
+ //#region admin/src/utils/auth.ts
2
+ var e = "user";
3
+ function t(e) {
4
+ let t = e.startsWith("/") ? e : `/${e}`, n = "".replace(/\/$/, "");
5
+ return n ? `${n}${t}` : typeof window < "u" && window.location?.origin ? `${window.location.origin}${t}` : t;
6
+ }
7
+ function n() {
8
+ try {
9
+ let t = localStorage.getItem(e);
10
+ return t ? JSON.parse(t) : null;
11
+ } catch {
12
+ return localStorage.removeItem(e), null;
13
+ }
14
+ }
15
+ function r(e, t) {
16
+ let n = e || `HTTP ${t}`;
17
+ try {
18
+ let t = JSON.parse(e);
19
+ n = (typeof t.error == "object" ? t.error.message : void 0) || t.message || n;
20
+ } catch {}
21
+ return n;
22
+ }
23
+ async function i(n, i) {
24
+ let a = await fetch(t("/api/auth/login"), {
25
+ method: "POST",
26
+ credentials: "include",
27
+ headers: { "Content-Type": "application/json" },
28
+ body: JSON.stringify({
29
+ user: n.trim(),
30
+ password: i
31
+ })
32
+ });
33
+ if (!a.ok) throw Error(r(await a.text(), a.status));
34
+ let o = await a.json();
35
+ localStorage.setItem(e, JSON.stringify(o.user));
36
+ }
37
+ async function a() {
38
+ try {
39
+ let n = await fetch(t("/api/auth/user"), { credentials: "include" });
40
+ if (!n.ok) return localStorage.removeItem(e), null;
41
+ let r = await n.json();
42
+ return r.id ? (localStorage.setItem(e, JSON.stringify(r)), r) : (localStorage.removeItem(e), null);
43
+ } catch {
44
+ return localStorage.removeItem(e), null;
45
+ }
46
+ }
47
+ async function o() {
48
+ try {
49
+ await fetch(t("/api/auth/logout"), {
50
+ method: "POST",
51
+ credentials: "include"
52
+ });
53
+ } finally {
54
+ localStorage.removeItem(e);
55
+ }
56
+ }
57
+ var s = {
58
+ get currentUser() {
59
+ return n();
60
+ },
61
+ get isAuthenticated() {
62
+ return !!n()?.id;
63
+ },
64
+ login: i,
65
+ checkUser: a,
66
+ logout: o
67
+ };
68
+ //#endregion
69
+ //#region admin/src/api/resources.ts
70
+ async function c(e, n) {
71
+ let r = await fetch(t(e), {
72
+ ...n,
73
+ credentials: "include",
74
+ headers: {
75
+ ...n?.body ? { "Content-Type": "application/json" } : {},
76
+ ...n?.headers ?? {}
77
+ }
78
+ });
79
+ if (!r.ok) {
80
+ let e = await r.text();
81
+ try {
82
+ let t = JSON.parse(e), n = typeof t.error == "object" ? t.error.message : void 0;
83
+ throw Error(n || t.message || e || `HTTP ${r.status}`);
84
+ } catch (t) {
85
+ throw t instanceof Error && t.message !== e ? t : Error(e || `HTTP ${r.status}`);
86
+ }
87
+ }
88
+ return r.status === 204 ? void 0 : r.json();
89
+ }
90
+ function l(e = {}) {
91
+ let t = new URLSearchParams();
92
+ e.page !== void 0 && t.set("page", String(e.page)), e.limit !== void 0 && t.set("limit", String(e.limit)), e.search && t.set("search", e.search), e.sort && t.set("sort", e.sort), e.order && t.set("order", e.order);
93
+ for (let [n, r] of Object.entries(e.filters ?? {})) if (r != null && r !== "") {
94
+ if (typeof r == "object" && !Array.isArray(r)) {
95
+ for (let [e, i] of Object.entries(r)) i != null && i !== "" && t.set(`filter[${n}][${e}]`, String(i));
96
+ continue;
97
+ }
98
+ t.set(`filter[${n}]`, String(r));
99
+ }
100
+ let n = t.toString();
101
+ return n ? `?${n}` : "";
102
+ }
103
+ async function u(e, t = {
104
+ page: 1,
105
+ limit: 100,
106
+ order: "asc"
107
+ }) {
108
+ return c(`/api/resource/${e}${l(t)}`);
109
+ }
110
+ function d(e, t) {
111
+ return c(`/api/resource/${e}/${t}`);
112
+ }
113
+ function f(e, t) {
114
+ return c(`/api/resource/${e}`, {
115
+ method: "POST",
116
+ body: JSON.stringify(t)
117
+ });
118
+ }
119
+ function p(e, t, n) {
120
+ return c(`/api/resource/${e}/${t}`, {
121
+ method: "PUT",
122
+ body: JSON.stringify(n)
123
+ });
124
+ }
125
+ async function m(e, t) {
126
+ await c(`/api/resource/${e}/${t}`, { method: "DELETE" });
127
+ }
128
+ //#endregion
129
+ export { c as a, s as c, u as i, r as l, m as n, p as o, d as r, t as s, f as t };