@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.
- package/CHANGELOG.md +42 -0
- package/README.md +188 -3
- package/dist/chunks/AppIcon-CIR6y5uE.js +85 -0
- package/dist/chunks/AppealDetailField-CI-1qhs3.js +58 -0
- package/dist/chunks/AppealStatusBadge-CSXnfarR.js +132 -0
- package/dist/chunks/AppealStatusBadge-DYBe9hqP.js +171 -0
- package/dist/chunks/ApplicationHistorySection-C0wwhwA4.js +769 -0
- package/dist/chunks/BaseModal-C7PVYz0m.js +85 -0
- package/dist/chunks/FormFilePicker-C3XQw50i.js +76 -0
- package/dist/chunks/MapLayerMenu-DjYCxEc3.js +145 -0
- package/dist/chunks/RegistryForm-CEUqFmsF.js +99 -0
- package/dist/chunks/RegistryFormModal-DfY4z_7r.js +85 -0
- package/dist/chunks/RegistryToolbar-BV4mYVAc.js +452 -0
- package/dist/chunks/UserAccessBadge-D8JfgGfN.js +44 -0
- package/dist/chunks/UserTypeBadge-YIwwoCho.js +188 -0
- package/dist/chunks/VerifiedBadge-Bba8WnuB.js +34 -0
- package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chunks/account-types-Br7gx_D_.js +35 -0
- package/dist/chunks/account_types-DLL1w122.js +25 -0
- package/dist/chunks/appealMapLayers-CQMK3rrz.js +115 -0
- package/dist/chunks/application_status-BhNGiY2I.js +45 -0
- package/dist/chunks/applications-BB9JRcgl.js +132 -0
- package/dist/chunks/buildSchema-CccjX9TJ.js +37 -0
- package/dist/chunks/card-B-ftozcq.js +739 -0
- package/dist/chunks/card-BctFHFZe.js +538 -0
- package/dist/chunks/card-CKD1N0QD.js +330 -0
- package/dist/chunks/card-CiNZxAd5.js +297 -0
- package/dist/chunks/card-DUtDfwMk.js +607 -0
- package/dist/chunks/card-fL26_Gvc.js +1189 -0
- package/dist/chunks/certificates-BSd1i0un.js +424 -0
- package/dist/chunks/create-DxMC_IL1.js +1033 -0
- package/dist/chunks/filterQuery-CvfZrkTC.js +99 -0
- package/dist/chunks/form-Bh6i5n1U.js +315 -0
- package/dist/chunks/form-DDjELqZ9.js +89 -0
- package/dist/chunks/geometry-DyhIVRcw.js +67 -0
- package/dist/chunks/map-Z57iMvFb.js +2763 -0
- package/dist/chunks/map-layers-DnmkOEld.js +400 -0
- package/dist/chunks/mapLayersApi-CWoQ2be-.js +251 -0
- package/dist/chunks/organizations-BO1_JETm.js +476 -0
- package/dist/chunks/organizations-BbYipLwk.js +14 -0
- package/dist/chunks/profile-ByahbF4B.js +164 -0
- package/dist/chunks/profile-Dwwn_4Pr.js +243 -0
- package/dist/chunks/requests-BCin936Z.js +232 -0
- package/dist/chunks/requests-CFv5wwAN.js +530 -0
- package/dist/chunks/resendSurveyorRegistration-BHTTVIw1.js +27 -0
- package/dist/chunks/resources-2e8RFqWR.js +129 -0
- package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/chunks/surveyorAccount-C7UiiIYg.js +78 -0
- package/dist/chunks/users-DtTYsgMb.js +291 -0
- package/dist/chunks/work_types-Hwme-FEX.js +34 -0
- package/dist/index.css +3 -0
- package/dist/index.js +336 -0
- package/migrations/20260924120000_surveyor_schema.sql +450 -0
- package/migrations/20261008170000_address_lookup.sql +20 -0
- package/migrations/20261016120000_map_layers.sql +156 -0
- package/migrations/20261016150000_password_reset.sql +15 -0
- package/migrations/20261016170000_address_lookup_format.sql +37 -0
- package/migrations/20261016180000_settlement_lookup.sql +16 -0
- package/migrations/20261019170000_actor_lookup.sql +15 -0
- package/package.json +86 -6
- package/plugin.d.ts +15 -0
- package/plugin.js +8 -0
- package/server/app.ts +51 -0
- package/server/dictionaries/index.ts +17 -0
- package/server/dictionaries/surveyor/account_types.ts +12 -0
- package/server/dictionaries/surveyor/application_status.ts +16 -0
- package/server/dictionaries/surveyor/map_layer_components.ts +11 -0
- package/server/dictionaries/surveyor/map_layer_groups.ts +10 -0
- package/server/dictionaries/surveyor/map_layer_types.ts +11 -0
- package/server/dictionaries/surveyor/work_types.ts +15 -0
- package/server/dictionaries/surveyor/yes_no.ts +11 -0
- package/server/fastify.d.ts +12 -0
- package/server/index.ts +23 -0
- package/server/modules/surveyor/route.ts +410 -0
- package/server/modules/surveyor/schema.ts +439 -0
- package/server/modules/surveyor/services/applicationTile.ts +53 -0
- package/server/modules/surveyor/services/cancelApplication.ts +74 -0
- package/server/modules/surveyor/services/changeSurveyorPassword.ts +52 -0
- package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -0
- package/server/modules/surveyor/services/completeApplication.ts +46 -0
- package/server/modules/surveyor/services/completeSurveyorRegistration.ts +48 -0
- package/server/modules/surveyor/services/createApplication.ts +169 -0
- package/server/modules/surveyor/services/geometryExport.ts +34 -0
- package/server/modules/surveyor/services/geometryImport.ts +66 -0
- package/server/modules/surveyor/services/getSurveyorUser.ts +56 -0
- package/server/modules/surveyor/services/identifyApplications.ts +82 -0
- package/server/modules/surveyor/services/issueSourceData.ts +55 -0
- package/server/modules/surveyor/services/loginSurveyor.ts +67 -0
- package/server/modules/surveyor/services/mapLayers.ts +61 -0
- package/server/modules/surveyor/services/rasterExport.ts +15 -0
- package/server/modules/surveyor/services/registerSurveyor.ts +161 -0
- package/server/modules/surveyor/services/requestPasswordReset.ts +49 -0
- package/server/modules/surveyor/services/resendRegistration.ts +42 -0
- package/server/modules/surveyor/services/resetSurveyorPassword.ts +53 -0
- package/server/modules/surveyor/services/searchApplications.ts +63 -0
- package/server/modules/surveyor/services/submitSurvey.ts +70 -0
- package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -0
- package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -0
- package/server/modules/surveyor/services/vectorExport.ts +86 -0
- package/server/modules/surveyor/services/verifyApplication.ts +59 -0
- package/server/modules/surveyor/utils/accessibleApplication.ts +37 -0
- package/server/modules/surveyor/utils/application.ts +68 -0
- package/server/modules/surveyor/utils/export.ts +39 -0
- package/server/modules/surveyor/utils/firstBoundary.ts +48 -0
- package/server/modules/surveyor/utils/mail.ts +161 -0
- package/server/modules/surveyor/utils/permissions.ts +29 -0
- package/server/modules/surveyor/utils/registration.ts +33 -0
- package/server/modules/surveyor/utils/shared.ts +305 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_registration.pt.hbs +80 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_send_mail.pt.hbs +79 -0
- package/server/modules/surveyor/utils/vectorLayer.ts +41 -0
- package/server/plugins/convertVector.ts +74 -0
- package/server/plugins/proto/convertVector.proto +21 -0
- package/server/plugins/swagger.ts +54 -0
- package/server/plugins/vite.dev.ts +52 -0
- package/server/plugins/vite.prod.ts +55 -0
- package/server/resources/helpers/actor_lookup.ts +5 -0
- package/server/resources/helpers/address_lookup.ts +8 -0
- package/server/resources/helpers/settlement_lookup.ts +7 -0
- package/server/resources/helpers/user_lookup.ts +5 -0
- package/server/resources/index.ts +30 -0
- package/server/resources/surveyor-admin/application_comments.ts +24 -0
- package/server/resources/surveyor-admin/application_status_history.ts +46 -0
- package/server/resources/surveyor-admin/applications.ts +125 -0
- package/server/resources/surveyor-admin/certificates.ts +87 -0
- package/server/resources/surveyor-admin/map_layers.ts +69 -0
- package/server/resources/surveyor-admin/organization_surveyors.ts +32 -0
- package/server/resources/surveyor-admin/organizations.ts +61 -0
- package/server/resources/surveyor-admin/surveyors.ts +71 -0
- package/server/resources/surveyor-user/application_status_history.ts +52 -0
- package/server/resources/surveyor-user/applications.ts +131 -0
- package/server/resources/surveyor-user/certificates.ts +67 -0
- package/server/resources/surveyor-user/organizations.ts +40 -0
- package/server/resources/surveyor-user/surveyors.ts +69 -0
- package/server/suggests/index.ts +17 -0
- package/server/tsconfig.json +3 -0
- package/surveyor-types.d.ts +30 -0
|
@@ -0,0 +1,2763 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { a as t, i as n, s as r } from "./resources-2e8RFqWR.js";
|
|
3
|
+
import { l as i, o as a } from "./filterQuery-CvfZrkTC.js";
|
|
4
|
+
import { c as o, d as s, f as c, l, m as u, p as d, t as f, u as p } from "./appealMapLayers-CQMK3rrz.js";
|
|
5
|
+
import { a as m, i as h, o as g, s as _, t as v } from "./AppealStatusBadge-DYBe9hqP.js";
|
|
6
|
+
import { a as y, c as b, d as x, i as ee, l as S, n as te, o as ne, r as re, s as C, t as ie, u as ae } from "./mapLayersApi-CWoQ2be-.js";
|
|
7
|
+
import { i as w, n as oe } from "./geometry-DyhIVRcw.js";
|
|
8
|
+
import { t as T } from "./work_types-Hwme-FEX.js";
|
|
9
|
+
import { Fragment as E, Teleport as D, computed as O, createBlock as k, createCommentVNode as A, createElementBlock as j, createElementVNode as M, createTextVNode as N, createVNode as P, defineComponent as F, nextTick as se, normalizeClass as I, normalizeStyle as L, onMounted as ce, onUnmounted as le, openBlock as R, ref as z, renderList as B, shallowRef as ue, toDisplayString as V, useTemplateRef as de, vModelText as H, watch as U, withCtx as fe, withDirectives as W, withModifiers as G } from "vue";
|
|
10
|
+
import { RouterLink as K, useRoute as q, useRouter as J } from "vue-router";
|
|
11
|
+
import { AlertTriangle as Y, Check as X, ChevronDown as Z, ChevronLeft as pe, Compass as Q, GripVertical as me, Layers2 as he, Loader2 as ge, Map as _e, Minus as ve, MoreHorizontal as ye, Plus as be, RotateCcw as xe, Search as Se, SlidersHorizontal as Ce, X as we, ZoomIn as Te } from "lucide-vue-next";
|
|
12
|
+
//#region admin/src/api/map.ts
|
|
13
|
+
var Ee = [
|
|
14
|
+
"search",
|
|
15
|
+
"dateFrom",
|
|
16
|
+
"dateTo",
|
|
17
|
+
"workType",
|
|
18
|
+
"verifiedBy",
|
|
19
|
+
"organization",
|
|
20
|
+
"address"
|
|
21
|
+
];
|
|
22
|
+
function De(e = {}) {
|
|
23
|
+
let t = new URLSearchParams();
|
|
24
|
+
for (let n of Ee) {
|
|
25
|
+
let r = e[n], i = Array.isArray(r) ? r.map((e) => e.trim()).filter(Boolean).join(",") : r?.trim();
|
|
26
|
+
i && t.set(n, i);
|
|
27
|
+
}
|
|
28
|
+
let n = t.toString(), i = r("/api/surveyor/vtile/applications/{z}/{x}/{y}");
|
|
29
|
+
return n ? `${i}?${n}` : i;
|
|
30
|
+
}
|
|
31
|
+
async function Oe() {
|
|
32
|
+
let e = await n(_, {
|
|
33
|
+
page: 1,
|
|
34
|
+
limit: 1
|
|
35
|
+
}), t = Object.fromEntries(h.map((e) => [e, 0]));
|
|
36
|
+
for (let n of h) {
|
|
37
|
+
let r = Number(e.summary?.[n] ?? 0);
|
|
38
|
+
t[n] = Number.isFinite(r) ? r : 0;
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
function ke(e) {
|
|
43
|
+
return t(`/api/resource/applications/${encodeURIComponent(e)}?include=organization,surveyor`);
|
|
44
|
+
}
|
|
45
|
+
function Ae(e, n, r = 1, i = []) {
|
|
46
|
+
let a = new URLSearchParams({
|
|
47
|
+
lng: String(e),
|
|
48
|
+
lat: String(n),
|
|
49
|
+
page: String(r),
|
|
50
|
+
limit: "10"
|
|
51
|
+
}), o = [...new Set(i)].filter(Boolean);
|
|
52
|
+
return o.length && a.set("statuses", o.join(",")), t(`/api/surveyor/applications/identify?${a}`);
|
|
53
|
+
}
|
|
54
|
+
function je(e, n = {}) {
|
|
55
|
+
let r = e.trim(), i = new URLSearchParams({
|
|
56
|
+
search: r,
|
|
57
|
+
page: String(n.page ?? 1),
|
|
58
|
+
limit: String(n.limit ?? 20)
|
|
59
|
+
});
|
|
60
|
+
return n.filter && i.set("filter", n.filter), t(`/api/surveyor/applications/search?${i}`, { signal: n.signal });
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region admin/src/api/mock-map-settings.ts
|
|
64
|
+
var Me = {
|
|
65
|
+
center: "49.8397, 24.0297",
|
|
66
|
+
zoom: 13,
|
|
67
|
+
bounds: "49.75, 23.90, 49.92, 24.20",
|
|
68
|
+
katottg: "UA4610100000",
|
|
69
|
+
collapseEmptyFields: !0,
|
|
70
|
+
configFileName: null,
|
|
71
|
+
links: {
|
|
72
|
+
publicCabinet: "https://cabinet.geodesist.gov.ua/public",
|
|
73
|
+
adminCabinet: "https://cabinet.geodesist.gov.ua/admin",
|
|
74
|
+
gis: "https://gis.geodesist.gov.ua"
|
|
75
|
+
}
|
|
76
|
+
}, Ne = "surveyor:map-settings", $ = z({ ...Me });
|
|
77
|
+
function Pe(e) {
|
|
78
|
+
let t = Number(e.trim().replace(",", "."));
|
|
79
|
+
return Number.isFinite(t) ? t : null;
|
|
80
|
+
}
|
|
81
|
+
function Fe(e) {
|
|
82
|
+
let t = e.split(",").map((e) => Pe(e));
|
|
83
|
+
return t.length !== 2 || t[0] == null || t[1] == null ? null : {
|
|
84
|
+
lat: t[0],
|
|
85
|
+
lng: t[1]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function Ie(e) {
|
|
89
|
+
let t = e.split(",").map((e) => Pe(e));
|
|
90
|
+
if (t.length !== 4 || t.some((e) => e == null)) return null;
|
|
91
|
+
let [n, r, i, a] = t;
|
|
92
|
+
return n >= i || r >= a ? null : {
|
|
93
|
+
minLat: n,
|
|
94
|
+
minLng: r,
|
|
95
|
+
maxLat: i,
|
|
96
|
+
maxLng: a
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function Le() {
|
|
100
|
+
try {
|
|
101
|
+
let e = localStorage.getItem(Ne);
|
|
102
|
+
if (!e) return;
|
|
103
|
+
$.value = {
|
|
104
|
+
...Me,
|
|
105
|
+
...JSON.parse(e)
|
|
106
|
+
};
|
|
107
|
+
} catch {
|
|
108
|
+
$.value = { ...Me };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
Le();
|
|
112
|
+
function Re() {
|
|
113
|
+
let e = O(() => Fe($.value.center)), t = O(() => Ie($.value.bounds)), n = O(() => e.value ? [e.value.lng, e.value.lat] : null), r = O(() => t.value ? [[t.value.minLng, t.value.minLat], [t.value.maxLng, t.value.maxLat]] : null);
|
|
114
|
+
function i(e) {
|
|
115
|
+
$.value = { ...e }, localStorage.setItem(Ne, JSON.stringify($.value));
|
|
116
|
+
}
|
|
117
|
+
function a() {
|
|
118
|
+
$.value = { ...Me }, localStorage.removeItem(Ne);
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
settings: $,
|
|
122
|
+
center: e,
|
|
123
|
+
bounds: t,
|
|
124
|
+
centerLngLat: n,
|
|
125
|
+
maxBounds: r,
|
|
126
|
+
zoom: O(() => $.value.zoom),
|
|
127
|
+
saveSettings: i,
|
|
128
|
+
resetSettings: a
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region admin/src/pages/map/components/map-styles.ts
|
|
133
|
+
var ze = "map-applications", Be = "applications", Ve = "map-applications-fill", He = "map-applications-line";
|
|
134
|
+
function Ue() {
|
|
135
|
+
return [
|
|
136
|
+
"match",
|
|
137
|
+
["get", "status"],
|
|
138
|
+
...Object.entries(m).flatMap(([e, t]) => [e, t]),
|
|
139
|
+
"#64748b"
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
function We(e) {
|
|
143
|
+
return [
|
|
144
|
+
"*",
|
|
145
|
+
e,
|
|
146
|
+
[
|
|
147
|
+
"case",
|
|
148
|
+
[
|
|
149
|
+
"boolean",
|
|
150
|
+
["feature-state", "selected"],
|
|
151
|
+
!1
|
|
152
|
+
],
|
|
153
|
+
.55,
|
|
154
|
+
[
|
|
155
|
+
"boolean",
|
|
156
|
+
["feature-state", "hover"],
|
|
157
|
+
!1
|
|
158
|
+
],
|
|
159
|
+
.42,
|
|
160
|
+
.26
|
|
161
|
+
]
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
function Ge(e) {
|
|
165
|
+
return e.size ? [
|
|
166
|
+
"in",
|
|
167
|
+
["get", "status"],
|
|
168
|
+
["literal", Array.from(e)]
|
|
169
|
+
] : ["boolean", !1];
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region admin/src/pages/map/components/MapView.vue?vue&type=script&setup=true&lang.ts
|
|
173
|
+
var Ke = 250, qe = /*@__PURE__*/ F({
|
|
174
|
+
__name: "MapView",
|
|
175
|
+
props: {
|
|
176
|
+
basemap: {
|
|
177
|
+
type: Object,
|
|
178
|
+
required: !0
|
|
179
|
+
},
|
|
180
|
+
overlays: {
|
|
181
|
+
type: Array,
|
|
182
|
+
required: !1,
|
|
183
|
+
default: () => []
|
|
184
|
+
},
|
|
185
|
+
activeOverlayIds: {
|
|
186
|
+
type: Array,
|
|
187
|
+
required: !1,
|
|
188
|
+
default: () => []
|
|
189
|
+
},
|
|
190
|
+
overlayOpacities: {
|
|
191
|
+
type: Object,
|
|
192
|
+
required: !1,
|
|
193
|
+
default: () => ({})
|
|
194
|
+
},
|
|
195
|
+
visibleStatuses: {
|
|
196
|
+
type: Set,
|
|
197
|
+
required: !0
|
|
198
|
+
},
|
|
199
|
+
selectedId: {
|
|
200
|
+
type: [String, null],
|
|
201
|
+
required: !1,
|
|
202
|
+
default: null
|
|
203
|
+
},
|
|
204
|
+
applicationsVisible: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
required: !1,
|
|
207
|
+
default: !0
|
|
208
|
+
},
|
|
209
|
+
applicationsOpacity: {
|
|
210
|
+
type: Number,
|
|
211
|
+
required: !1,
|
|
212
|
+
default: 100
|
|
213
|
+
},
|
|
214
|
+
filters: {
|
|
215
|
+
type: Object,
|
|
216
|
+
required: !1,
|
|
217
|
+
default: () => ({})
|
|
218
|
+
},
|
|
219
|
+
initialView: {
|
|
220
|
+
type: [Object, null],
|
|
221
|
+
required: !1,
|
|
222
|
+
default: null
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
emits: [
|
|
226
|
+
"pointHover",
|
|
227
|
+
"pointSelect",
|
|
228
|
+
"zoom",
|
|
229
|
+
"viewChange",
|
|
230
|
+
"overlayLoad"
|
|
231
|
+
],
|
|
232
|
+
setup(e, { expose: t, emit: n }) {
|
|
233
|
+
let r = {
|
|
234
|
+
padding: 48,
|
|
235
|
+
maxZoom: 18
|
|
236
|
+
}, i = e, a = n, { centerLngLat: o, maxBounds: c, zoom: l, settings: f } = Re(), m = z(null), h = ue(null), g = z(null), _ = z(""), v = /* @__PURE__ */ new Map(), ie = [], T = 0, E, D = null, O = null, k, A = null, j = !1, M = !1, N = [Ve, He];
|
|
237
|
+
function P() {
|
|
238
|
+
return i.initialView ? {
|
|
239
|
+
center: [i.initialView.lng, i.initialView.lat],
|
|
240
|
+
zoom: i.initialView.zoom
|
|
241
|
+
} : {
|
|
242
|
+
center: o.value ?? [24.0297, 49.8397],
|
|
243
|
+
zoom: l.value
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function F() {
|
|
247
|
+
if (M) return;
|
|
248
|
+
let e = h.value;
|
|
249
|
+
if (!e) return;
|
|
250
|
+
let t = e.getCenter(), n = {
|
|
251
|
+
lng: t.lng,
|
|
252
|
+
lat: t.lat,
|
|
253
|
+
zoom: e.getZoom()
|
|
254
|
+
};
|
|
255
|
+
a("viewChange", n), a("zoom", n.zoom);
|
|
256
|
+
}
|
|
257
|
+
function se(e, t = !1) {
|
|
258
|
+
let n = h.value;
|
|
259
|
+
n && (M = !0, t ? n.flyTo({
|
|
260
|
+
center: [e.lng, e.lat],
|
|
261
|
+
zoom: e.zoom,
|
|
262
|
+
bearing: 0,
|
|
263
|
+
pitch: 0,
|
|
264
|
+
duration: 500
|
|
265
|
+
}) : n.jumpTo({
|
|
266
|
+
center: [e.lng, e.lat],
|
|
267
|
+
zoom: e.zoom
|
|
268
|
+
}), a("zoom", e.zoom), window.setTimeout(() => {
|
|
269
|
+
M = !1;
|
|
270
|
+
}, 0));
|
|
271
|
+
}
|
|
272
|
+
function I(e) {
|
|
273
|
+
c.value ? e.setMaxBounds(c.value) : e.setMaxBounds(null);
|
|
274
|
+
}
|
|
275
|
+
function L(e) {
|
|
276
|
+
return e.isStyleLoaded() && !!e.getLayer("map-applications-fill");
|
|
277
|
+
}
|
|
278
|
+
function R(e) {
|
|
279
|
+
if (!L(e)) return;
|
|
280
|
+
let t = Ge(i.visibleStatuses);
|
|
281
|
+
for (let n of N) e.getLayer(n) && e.setFilter(n, t);
|
|
282
|
+
}
|
|
283
|
+
function B(e) {
|
|
284
|
+
if (!L(e)) return;
|
|
285
|
+
let t = i.applicationsVisible ? "visible" : "none", n = i.applicationsOpacity / 100;
|
|
286
|
+
for (let n of N) e.getLayer(n) && e.setLayoutProperty(n, "visibility", t);
|
|
287
|
+
e.setPaintProperty(Ve, "fill-opacity", We(n)), e.setPaintProperty(He, "line-opacity", n);
|
|
288
|
+
}
|
|
289
|
+
function V(e, t) {
|
|
290
|
+
y(e, t, ee(e, i.overlays, [Ve]));
|
|
291
|
+
}
|
|
292
|
+
function de(e) {
|
|
293
|
+
e.getSource("map-applications") || e.addSource(ze, {
|
|
294
|
+
type: "vector",
|
|
295
|
+
tiles: [De(i.filters)],
|
|
296
|
+
promoteId: "id"
|
|
297
|
+
});
|
|
298
|
+
let t = Ge(i.visibleStatuses);
|
|
299
|
+
e.getLayer("map-applications-fill") || e.addLayer({
|
|
300
|
+
id: Ve,
|
|
301
|
+
type: "fill",
|
|
302
|
+
source: ze,
|
|
303
|
+
"source-layer": Be,
|
|
304
|
+
filter: t,
|
|
305
|
+
paint: {
|
|
306
|
+
"fill-color": Ue(),
|
|
307
|
+
"fill-opacity": We(i.applicationsOpacity / 100)
|
|
308
|
+
}
|
|
309
|
+
}), e.getLayer("map-applications-line") || e.addLayer({
|
|
310
|
+
id: He,
|
|
311
|
+
type: "line",
|
|
312
|
+
source: ze,
|
|
313
|
+
"source-layer": Be,
|
|
314
|
+
filter: t,
|
|
315
|
+
paint: {
|
|
316
|
+
"line-color": Ue(),
|
|
317
|
+
"line-width": [
|
|
318
|
+
"case",
|
|
319
|
+
[
|
|
320
|
+
"boolean",
|
|
321
|
+
["feature-state", "selected"],
|
|
322
|
+
!1
|
|
323
|
+
],
|
|
324
|
+
3,
|
|
325
|
+
[
|
|
326
|
+
"boolean",
|
|
327
|
+
["feature-state", "hover"],
|
|
328
|
+
!1
|
|
329
|
+
],
|
|
330
|
+
2.5,
|
|
331
|
+
1.5
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
}), R(e), B(e);
|
|
335
|
+
}
|
|
336
|
+
function H(e) {
|
|
337
|
+
return i.overlayOpacities[e.id] ?? Math.round(u(e) * 100);
|
|
338
|
+
}
|
|
339
|
+
function fe(e) {
|
|
340
|
+
for (let t of i.overlays) te(e, t, H(t));
|
|
341
|
+
}
|
|
342
|
+
function W(e) {
|
|
343
|
+
C(e, i.overlays, i.activeOverlayIds, Ve), fe(e);
|
|
344
|
+
}
|
|
345
|
+
let G = /* @__PURE__ */ new Set();
|
|
346
|
+
function K(e) {
|
|
347
|
+
let t = e;
|
|
348
|
+
t.sourceId && t.isSourceLoaded && i.overlays.some((e) => e.id === t.sourceId) && (G.add(t.sourceId), a("overlayLoad", t.sourceId, "ready"));
|
|
349
|
+
}
|
|
350
|
+
function q(e) {
|
|
351
|
+
let t = e;
|
|
352
|
+
!t.sourceId || t.tile || G.has(t.sourceId) || i.overlays.some((e) => e.id === t.sourceId) && a("overlayLoad", t.sourceId, "error");
|
|
353
|
+
}
|
|
354
|
+
function J(e) {
|
|
355
|
+
de(e), W(e);
|
|
356
|
+
}
|
|
357
|
+
function Y(e) {
|
|
358
|
+
return {
|
|
359
|
+
source: ze,
|
|
360
|
+
sourceLayer: Be,
|
|
361
|
+
id: e
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function X(e) {
|
|
365
|
+
if (!ie.length || !e.getSource("map-applications")) {
|
|
366
|
+
ie.length = 0;
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
for (let t of ie) try {
|
|
370
|
+
e.setFeatureState(Y(t), { hover: !1 });
|
|
371
|
+
} catch {}
|
|
372
|
+
ie.length = 0;
|
|
373
|
+
}
|
|
374
|
+
function Z(e, t) {
|
|
375
|
+
let n = new Set(t);
|
|
376
|
+
if (e.getSource("map-applications")) {
|
|
377
|
+
for (let t of ie) if (!n.has(t)) try {
|
|
378
|
+
e.setFeatureState(Y(t), { hover: !1 });
|
|
379
|
+
} catch {}
|
|
380
|
+
for (let n of t) try {
|
|
381
|
+
e.setFeatureState(Y(n), { hover: !0 });
|
|
382
|
+
} catch {}
|
|
383
|
+
}
|
|
384
|
+
ie.length = 0, ie.push(...t);
|
|
385
|
+
}
|
|
386
|
+
function pe(e, t) {
|
|
387
|
+
let n = g.value;
|
|
388
|
+
if (n && n !== t && e.getSource("map-applications")) try {
|
|
389
|
+
e.setFeatureState(Y(n), { selected: !1 });
|
|
390
|
+
} catch {}
|
|
391
|
+
if (g.value = t, t && e.getSource("map-applications")) try {
|
|
392
|
+
e.setFeatureState(Y(t), { selected: !0 });
|
|
393
|
+
} catch {}
|
|
394
|
+
}
|
|
395
|
+
function Q(e, t) {
|
|
396
|
+
let n = e.queryRenderedFeatures(t, { layers: [Ve] }), r = [];
|
|
397
|
+
for (let e of n) {
|
|
398
|
+
let t = String(e.id ?? e.properties?.id ?? "");
|
|
399
|
+
t && !r.includes(t) && r.push(t);
|
|
400
|
+
}
|
|
401
|
+
return r;
|
|
402
|
+
}
|
|
403
|
+
function me(e) {
|
|
404
|
+
return {
|
|
405
|
+
id: e.app_id,
|
|
406
|
+
number: e.number ?? "—",
|
|
407
|
+
status: e.status ?? "",
|
|
408
|
+
workType: e.work_type_data?.text ?? "—",
|
|
409
|
+
organization: e.org_id_data?.text ?? "—"
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
function he(e, t) {
|
|
413
|
+
let n = Array.from(i.visibleStatuses).sort().join(",");
|
|
414
|
+
return `${e.toFixed(5)}:${t.toFixed(5)}:${n}`;
|
|
415
|
+
}
|
|
416
|
+
function ge(e, t) {
|
|
417
|
+
if (v.size > 40) {
|
|
418
|
+
let e = v.keys().next().value;
|
|
419
|
+
e && v.delete(e);
|
|
420
|
+
}
|
|
421
|
+
v.set(e, t);
|
|
422
|
+
}
|
|
423
|
+
function _e() {
|
|
424
|
+
clearTimeout(E), E = void 0, T += 1;
|
|
425
|
+
}
|
|
426
|
+
function ve(e) {
|
|
427
|
+
let t = h.value;
|
|
428
|
+
if (!t || !L(t)) return;
|
|
429
|
+
let n = Q(t, e.point);
|
|
430
|
+
if (t.getCanvas().style.cursor = n.length ? "pointer" : "", !n.length || !i.visibleStatuses.size) {
|
|
431
|
+
X(t), D = null, O = null, _e(), a("pointHover", null, null);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
Z(t, n);
|
|
435
|
+
let r = {
|
|
436
|
+
x: e.point.x,
|
|
437
|
+
y: e.point.y
|
|
438
|
+
};
|
|
439
|
+
D = r;
|
|
440
|
+
let o = e.lngLat.lng, s = e.lngLat.lat, c = he(o, s), l = v.get(c);
|
|
441
|
+
if (l) {
|
|
442
|
+
_e(), O = l, a("pointHover", l, r);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
O && a("pointHover", O, r), _e();
|
|
446
|
+
let u = T;
|
|
447
|
+
E = setTimeout(() => {
|
|
448
|
+
Ae(o, s, 1, i.visibleStatuses).then((e) => {
|
|
449
|
+
if (u !== T || !D) return;
|
|
450
|
+
let t = {
|
|
451
|
+
points: e.data.map(me),
|
|
452
|
+
total: e.total
|
|
453
|
+
};
|
|
454
|
+
ge(c, t), O = t, a("pointHover", t, D);
|
|
455
|
+
}).catch(() => {});
|
|
456
|
+
}, Ke);
|
|
457
|
+
}
|
|
458
|
+
function ye(e) {
|
|
459
|
+
let t = h.value;
|
|
460
|
+
if (t && L(t)) {
|
|
461
|
+
if (!Q(t, e.point).length) {
|
|
462
|
+
a("pointSelect", null);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
a("pointSelect", {
|
|
466
|
+
lng: e.lngLat.lng,
|
|
467
|
+
lat: e.lngLat.lat
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function be() {
|
|
472
|
+
let e = m.value;
|
|
473
|
+
if (!A || !e || h.value || e.clientWidth === 0 || e.clientHeight === 0) return;
|
|
474
|
+
let t = P(), n = new A.Map({
|
|
475
|
+
container: e,
|
|
476
|
+
style: p(i.basemap),
|
|
477
|
+
center: t.center,
|
|
478
|
+
zoom: t.zoom,
|
|
479
|
+
minZoom: 1,
|
|
480
|
+
maxZoom: 19,
|
|
481
|
+
attributionControl: !1,
|
|
482
|
+
locale: ae,
|
|
483
|
+
transformRequest: (e, t) => t === "Tile" && e.includes("/vtile/applications/") ? {
|
|
484
|
+
url: e,
|
|
485
|
+
credentials: "include"
|
|
486
|
+
} : { url: e }
|
|
487
|
+
});
|
|
488
|
+
n.on("load", () => {
|
|
489
|
+
I(n), n.resize(), J(n), pe(n, i.selectedId ?? null), F();
|
|
490
|
+
}), n.on("moveend", F), n.on("sourcedata", K), n.on("error", q), n.on("mousemove", (e) => ve(e)), n.on("click", (e) => ye(e)), h.value = n;
|
|
491
|
+
}
|
|
492
|
+
async function xe() {
|
|
493
|
+
try {
|
|
494
|
+
A = await x();
|
|
495
|
+
} catch (e) {
|
|
496
|
+
console.error(e), _.value = S;
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
!j && m.value && (k = new ResizeObserver(() => {
|
|
500
|
+
h.value ? h.value.resize() : be();
|
|
501
|
+
}), k.observe(m.value));
|
|
502
|
+
}
|
|
503
|
+
U(() => Array.from(i.visibleStatuses).sort().join(","), () => {
|
|
504
|
+
v.clear(), O = null, _e();
|
|
505
|
+
let e = h.value;
|
|
506
|
+
e && X(e), a("pointHover", null, null), e?.isStyleLoaded() && R(e);
|
|
507
|
+
}), U(() => De(i.filters), (e) => {
|
|
508
|
+
let t = h.value, n = t?.getSource(ze);
|
|
509
|
+
t && n && (X(t), D = null, O = null, _e(), t.getCanvas().style.cursor = "", a("pointHover", null, null), n.setTiles([e]));
|
|
510
|
+
}), U(() => [i.applicationsVisible, i.applicationsOpacity], () => {
|
|
511
|
+
let e = h.value;
|
|
512
|
+
e && (i.applicationsVisible || (X(e), D = null, O = null, _e(), e.getCanvas().style.cursor = "", a("pointHover", null, null)), B(e));
|
|
513
|
+
}), U(() => i.overlays, () => {
|
|
514
|
+
let e = h.value;
|
|
515
|
+
e?.isStyleLoaded() && W(e);
|
|
516
|
+
}), U(() => i.activeOverlayIds, () => {
|
|
517
|
+
let e = h.value;
|
|
518
|
+
e?.isStyleLoaded() && re(e, i.overlays, i.activeOverlayIds);
|
|
519
|
+
}), U(() => i.overlayOpacities, () => {
|
|
520
|
+
let e = h.value;
|
|
521
|
+
e?.isStyleLoaded() && fe(e);
|
|
522
|
+
}, { deep: !0 }), U(() => i.basemap, (e) => {
|
|
523
|
+
let t = h.value;
|
|
524
|
+
if (!t) return;
|
|
525
|
+
let n = () => V(t, e);
|
|
526
|
+
t.isStyleLoaded() ? n() : t.once("style.load", n);
|
|
527
|
+
}), U(() => i.selectedId ?? null, (e) => {
|
|
528
|
+
let t = h.value;
|
|
529
|
+
t?.getSource("map-applications") && pe(t, e);
|
|
530
|
+
}), U(() => [
|
|
531
|
+
f.value.center,
|
|
532
|
+
f.value.zoom,
|
|
533
|
+
f.value.bounds
|
|
534
|
+
].join("|"), () => {
|
|
535
|
+
let e = h.value;
|
|
536
|
+
if (!e?.isStyleLoaded()) return;
|
|
537
|
+
I(e);
|
|
538
|
+
let t = P();
|
|
539
|
+
e.flyTo({
|
|
540
|
+
center: t.center,
|
|
541
|
+
zoom: t.zoom,
|
|
542
|
+
bearing: 0,
|
|
543
|
+
pitch: 0,
|
|
544
|
+
duration: 500
|
|
545
|
+
});
|
|
546
|
+
});
|
|
547
|
+
function Se() {
|
|
548
|
+
h.value?.zoomIn({ duration: 250 });
|
|
549
|
+
}
|
|
550
|
+
function Ce() {
|
|
551
|
+
h.value?.zoomOut({ duration: 250 });
|
|
552
|
+
}
|
|
553
|
+
function we() {
|
|
554
|
+
let e = P();
|
|
555
|
+
h.value?.flyTo({
|
|
556
|
+
center: e.center,
|
|
557
|
+
zoom: e.zoom,
|
|
558
|
+
bearing: 0,
|
|
559
|
+
pitch: 0,
|
|
560
|
+
duration: 500
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
function Te(e) {
|
|
564
|
+
let t = h.value;
|
|
565
|
+
return !!(t?.isStyleLoaded() && t.isSourceLoaded(e));
|
|
566
|
+
}
|
|
567
|
+
function Ee(e) {
|
|
568
|
+
let t = h.value, n = i.overlays.find((t) => t.id === e);
|
|
569
|
+
if (!t || !n || !s(n)) return;
|
|
570
|
+
let r = t.getZoom(), a = d(n), o = n.kind === "raster" || n.kind === "vector" ? n.maxzoom ?? 18 : 18, c = a != null && r < a ? a : Math.min(o, r + 1), l = t.getCenter();
|
|
571
|
+
t.flyTo({
|
|
572
|
+
center: [l.lng, l.lat],
|
|
573
|
+
zoom: c,
|
|
574
|
+
duration: 600
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
function Oe(e) {
|
|
578
|
+
let t = w(e), n = h.value;
|
|
579
|
+
t && n && n.fitBounds(oe(t), {
|
|
580
|
+
...r,
|
|
581
|
+
duration: 500
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
function ke(e) {
|
|
585
|
+
let t = h.value, n = i.overlays.find((t) => t.id === e);
|
|
586
|
+
if (!t || !n) return;
|
|
587
|
+
let r = () => {
|
|
588
|
+
G.delete(e), b(t, n), ne(t, n, i.activeOverlayIds.includes(e), Ve), te(t, n, H(n));
|
|
589
|
+
};
|
|
590
|
+
t.isStyleLoaded() ? r() : t.once("load", r);
|
|
591
|
+
}
|
|
592
|
+
t({
|
|
593
|
+
zoomIn: Se,
|
|
594
|
+
zoomOut: Ce,
|
|
595
|
+
resetView: we,
|
|
596
|
+
setView: se,
|
|
597
|
+
overlaySourceReady: Te,
|
|
598
|
+
zoomToOverlay: Ee,
|
|
599
|
+
reloadOverlay: ke,
|
|
600
|
+
fitApplicationGeometry: Oe
|
|
601
|
+
}), ce(xe), le(() => {
|
|
602
|
+
j = !0, clearTimeout(E), k?.disconnect(), h.value?.remove(), h.value = null;
|
|
603
|
+
});
|
|
604
|
+
let je = {
|
|
605
|
+
FIT_APPLICATION_OPTIONS: r,
|
|
606
|
+
props: i,
|
|
607
|
+
emit: a,
|
|
608
|
+
HOVER_IDENTIFY_DELAY_MS: Ke,
|
|
609
|
+
centerLngLat: o,
|
|
610
|
+
maxBounds: c,
|
|
611
|
+
zoom: l,
|
|
612
|
+
settings: f,
|
|
613
|
+
containerRef: m,
|
|
614
|
+
mapRef: h,
|
|
615
|
+
selectedFeatureId: g,
|
|
616
|
+
mapLoadError: _,
|
|
617
|
+
identifyCache: v,
|
|
618
|
+
hoveredFeatureIds: ie,
|
|
619
|
+
get hoverRequestId() {
|
|
620
|
+
return T;
|
|
621
|
+
},
|
|
622
|
+
set hoverRequestId(e) {
|
|
623
|
+
T = e;
|
|
624
|
+
},
|
|
625
|
+
get hoverTimer() {
|
|
626
|
+
return E;
|
|
627
|
+
},
|
|
628
|
+
set hoverTimer(e) {
|
|
629
|
+
E = e;
|
|
630
|
+
},
|
|
631
|
+
get hoverAnchor() {
|
|
632
|
+
return D;
|
|
633
|
+
},
|
|
634
|
+
set hoverAnchor(e) {
|
|
635
|
+
D = e;
|
|
636
|
+
},
|
|
637
|
+
get hoverPayload() {
|
|
638
|
+
return O;
|
|
639
|
+
},
|
|
640
|
+
set hoverPayload(e) {
|
|
641
|
+
O = e;
|
|
642
|
+
},
|
|
643
|
+
get resizeObserver() {
|
|
644
|
+
return k;
|
|
645
|
+
},
|
|
646
|
+
set resizeObserver(e) {
|
|
647
|
+
k = e;
|
|
648
|
+
},
|
|
649
|
+
get ml() {
|
|
650
|
+
return A;
|
|
651
|
+
},
|
|
652
|
+
set ml(e) {
|
|
653
|
+
A = e;
|
|
654
|
+
},
|
|
655
|
+
get disposed() {
|
|
656
|
+
return j;
|
|
657
|
+
},
|
|
658
|
+
set disposed(e) {
|
|
659
|
+
j = e;
|
|
660
|
+
},
|
|
661
|
+
get suppressViewEmit() {
|
|
662
|
+
return M;
|
|
663
|
+
},
|
|
664
|
+
set suppressViewEmit(e) {
|
|
665
|
+
M = e;
|
|
666
|
+
},
|
|
667
|
+
interactiveLayers: N,
|
|
668
|
+
getViewOptions: P,
|
|
669
|
+
emitCurrentView: F,
|
|
670
|
+
setView: se,
|
|
671
|
+
applyMapConstraints: I,
|
|
672
|
+
applicationsLayersReady: L,
|
|
673
|
+
applyStatusFilter: R,
|
|
674
|
+
applyApplicationsAppearance: B,
|
|
675
|
+
replaceBasemap: V,
|
|
676
|
+
ensureApplicationsLayers: de,
|
|
677
|
+
overlayPercent: H,
|
|
678
|
+
paintOverlayOpacities: fe,
|
|
679
|
+
ensureOverlayLayers: W,
|
|
680
|
+
readyOverlaySources: G,
|
|
681
|
+
handleSourceData: K,
|
|
682
|
+
handleOverlayError: q,
|
|
683
|
+
ensureMapLayers: J,
|
|
684
|
+
featureTarget: Y,
|
|
685
|
+
clearHoverState: X,
|
|
686
|
+
setHoveredFeatures: Z,
|
|
687
|
+
applySelection: pe,
|
|
688
|
+
featureIdsAt: Q,
|
|
689
|
+
toMapPoint: me,
|
|
690
|
+
identifyCacheKey: he,
|
|
691
|
+
rememberIdentify: ge,
|
|
692
|
+
cancelHoverRequest: _e,
|
|
693
|
+
handleMouseMove: ve,
|
|
694
|
+
handleClick: ye,
|
|
695
|
+
initMap: be,
|
|
696
|
+
setupMap: xe,
|
|
697
|
+
zoomIn: Se,
|
|
698
|
+
zoomOut: Ce,
|
|
699
|
+
resetView: we,
|
|
700
|
+
overlaySourceReady: Te,
|
|
701
|
+
zoomToOverlay: Ee,
|
|
702
|
+
fitApplicationGeometry: Oe,
|
|
703
|
+
reloadOverlay: ke
|
|
704
|
+
};
|
|
705
|
+
return Object.defineProperty(je, "__isScriptSetup", {
|
|
706
|
+
enumerable: !1,
|
|
707
|
+
value: !0
|
|
708
|
+
}), je;
|
|
709
|
+
}
|
|
710
|
+
}), Je = {
|
|
711
|
+
ref: "containerRef",
|
|
712
|
+
class: "absolute inset-0 h-full w-full"
|
|
713
|
+
}, Ye = {
|
|
714
|
+
key: 0,
|
|
715
|
+
class: "absolute inset-0 z-[5] flex items-center justify-center bg-white/90 px-4 text-center text-sm text-red-600"
|
|
716
|
+
};
|
|
717
|
+
function Xe(e, t, n, r, i, a) {
|
|
718
|
+
return R(), j(E, null, [M("div", Je, null, 512), r.mapLoadError ? (R(), j("p", Ye, V(r.mapLoadError), 1)) : A("", !0)], 64);
|
|
719
|
+
}
|
|
720
|
+
var Ze = /*#__PURE__*/ e(qe, [
|
|
721
|
+
["render", Xe],
|
|
722
|
+
["__scopeId", "data-v-ea235a7a"],
|
|
723
|
+
["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapView.vue"]
|
|
724
|
+
]), Qe = 4, $e = 208, et = /*@__PURE__*/ F({
|
|
725
|
+
__name: "MapFilterSelect",
|
|
726
|
+
props: {
|
|
727
|
+
modelValue: {
|
|
728
|
+
type: Array,
|
|
729
|
+
required: !0
|
|
730
|
+
},
|
|
731
|
+
options: {
|
|
732
|
+
type: Array,
|
|
733
|
+
required: !0
|
|
734
|
+
},
|
|
735
|
+
label: {
|
|
736
|
+
type: String,
|
|
737
|
+
required: !0
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
emits: ["update:modelValue"],
|
|
741
|
+
setup(e, { expose: t, emit: n }) {
|
|
742
|
+
t();
|
|
743
|
+
let r = e, i = n, a = z(!1), o = z(null), s = de("buttonRef"), c = de("menuRef"), l = O(() => r.modelValue.length ? r.modelValue.map((e) => r.options.find((t) => t.value === e)?.label ?? e).join(", ") : "Усі значення");
|
|
744
|
+
function u() {
|
|
745
|
+
let e = s.value?.getBoundingClientRect();
|
|
746
|
+
if (!e) return;
|
|
747
|
+
let t = window.innerHeight - e.bottom - Qe - 8;
|
|
748
|
+
o.value = {
|
|
749
|
+
top: `${e.bottom + Qe}px`,
|
|
750
|
+
left: `${e.left}px`,
|
|
751
|
+
width: `${e.width}px`,
|
|
752
|
+
maxHeight: `${Math.max(Math.min($e, t), 80)}px`
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function d(e) {
|
|
756
|
+
let t = e.target;
|
|
757
|
+
s.value?.contains(t) || c.value?.contains(t) || (a.value = !1);
|
|
758
|
+
}
|
|
759
|
+
function f(e) {
|
|
760
|
+
e.key === "Escape" && (a.value = !1);
|
|
761
|
+
}
|
|
762
|
+
function p() {
|
|
763
|
+
window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0), document.removeEventListener("pointerdown", d), document.removeEventListener("keydown", f);
|
|
764
|
+
}
|
|
765
|
+
function m(e) {
|
|
766
|
+
if (!e) {
|
|
767
|
+
i("update:modelValue", []);
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
let t = new Set(r.modelValue);
|
|
771
|
+
t.has(e) ? t.delete(e) : t.add(e), i("update:modelValue", [...t]);
|
|
772
|
+
}
|
|
773
|
+
U(a, async (e) => {
|
|
774
|
+
if (p(), !e) {
|
|
775
|
+
o.value = null;
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
await se(), u(), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), document.addEventListener("pointerdown", d), document.addEventListener("keydown", f);
|
|
779
|
+
}), le(p);
|
|
780
|
+
let h = {
|
|
781
|
+
props: r,
|
|
782
|
+
emit: i,
|
|
783
|
+
MENU_GAP: Qe,
|
|
784
|
+
MENU_MAX_HEIGHT: $e,
|
|
785
|
+
open: a,
|
|
786
|
+
menuStyle: o,
|
|
787
|
+
buttonRef: s,
|
|
788
|
+
menuRef: c,
|
|
789
|
+
selectedLabel: l,
|
|
790
|
+
updateMenuPosition: u,
|
|
791
|
+
handleOutsidePointer: d,
|
|
792
|
+
handleEscape: f,
|
|
793
|
+
detachListeners: p,
|
|
794
|
+
toggle: m,
|
|
795
|
+
get Check() {
|
|
796
|
+
return X;
|
|
797
|
+
},
|
|
798
|
+
get ChevronDown() {
|
|
799
|
+
return Z;
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
return Object.defineProperty(h, "__isScriptSetup", {
|
|
803
|
+
enumerable: !1,
|
|
804
|
+
value: !0
|
|
805
|
+
}), h;
|
|
806
|
+
}
|
|
807
|
+
}), tt = ["aria-expanded", "aria-label"], nt = { class: "min-w-0 truncate" }, rt = ["aria-label"], it = ["aria-selected"], at = ["aria-selected", "onClick"], ot = { class: "min-w-0 truncate" };
|
|
808
|
+
function st(e, t, n, r, i, a) {
|
|
809
|
+
return R(), j(E, null, [M("button", {
|
|
810
|
+
ref: "buttonRef",
|
|
811
|
+
type: "button",
|
|
812
|
+
"data-map-filter-ui": "",
|
|
813
|
+
"aria-expanded": r.open,
|
|
814
|
+
"aria-label": n.label,
|
|
815
|
+
class: I(["flex h-9 w-full items-center justify-between gap-2 rounded-lg border bg-white px-2.5 text-left text-xs text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-100", r.open ? "border-brand-400 ring-1 ring-brand-100" : "border-slate-200"]),
|
|
816
|
+
onClick: t[0] ||= (e) => r.open = !r.open
|
|
817
|
+
}, [M("span", nt, V(r.selectedLabel), 1), P(r.ChevronDown, { class: I(["h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform", r.open ? "rotate-180" : ""]) }, null, 8, ["class"])], 10, tt), (R(), k(D, { to: "body" }, [r.open && r.menuStyle ? (R(), j("div", {
|
|
818
|
+
key: 0,
|
|
819
|
+
ref: "menuRef",
|
|
820
|
+
"data-map-filter-ui": "",
|
|
821
|
+
role: "listbox",
|
|
822
|
+
"aria-multiselectable": "true",
|
|
823
|
+
"aria-label": n.label,
|
|
824
|
+
class: "fixed z-[80] overflow-y-auto rounded-lg border border-slate-200 bg-white py-1 shadow-xl",
|
|
825
|
+
style: L(r.menuStyle)
|
|
826
|
+
}, [M("button", {
|
|
827
|
+
type: "button",
|
|
828
|
+
role: "option",
|
|
829
|
+
"aria-selected": !n.modelValue.length,
|
|
830
|
+
class: I(["flex w-full items-center gap-2 px-2.5 py-2 text-left text-xs transition-colors hover:bg-slate-50", n.modelValue.length ? "text-slate-700" : "bg-brand-50 font-medium text-brand-700"]),
|
|
831
|
+
onClick: t[1] ||= (e) => r.toggle("")
|
|
832
|
+
}, [M("span", { class: I(["flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border", n.modelValue.length ? "border-slate-300 bg-white" : "border-brand-600 bg-brand-600 text-white"]) }, [n.modelValue.length ? A("", !0) : (R(), k(r.Check, {
|
|
833
|
+
key: 0,
|
|
834
|
+
class: "h-2.5 w-2.5"
|
|
835
|
+
}))], 2), t[2] ||= M("span", { class: "min-w-0 truncate" }, "Усі значення", -1)], 10, it), (R(!0), j(E, null, B(n.options, (e) => (R(), j("button", {
|
|
836
|
+
key: e.value,
|
|
837
|
+
type: "button",
|
|
838
|
+
role: "option",
|
|
839
|
+
"aria-selected": n.modelValue.includes(e.value),
|
|
840
|
+
class: I(["flex w-full items-center gap-2 px-2.5 py-2 text-left text-xs transition-colors hover:bg-slate-50", n.modelValue.includes(e.value) ? "bg-brand-50 font-medium text-brand-700" : "text-slate-700"]),
|
|
841
|
+
onClick: (t) => r.toggle(e.value)
|
|
842
|
+
}, [M("span", { class: I(["flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border", n.modelValue.includes(e.value) ? "border-brand-600 bg-brand-600 text-white" : "border-slate-300 bg-white"]) }, [n.modelValue.includes(e.value) ? (R(), k(r.Check, {
|
|
843
|
+
key: 0,
|
|
844
|
+
class: "h-2.5 w-2.5"
|
|
845
|
+
})) : A("", !0)], 2), M("span", ot, V(e.label), 1)], 10, at))), 128))], 12, rt)) : A("", !0)]))], 64);
|
|
846
|
+
}
|
|
847
|
+
var ct = /*#__PURE__*/ e(et, [["render", st], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapFilterSelect.vue"]]), lt = 208, ut = 182, dt = 12, ft = /*@__PURE__*/ F({
|
|
848
|
+
__name: "OverlayLayerRow",
|
|
849
|
+
props: {
|
|
850
|
+
layer: {
|
|
851
|
+
type: Object,
|
|
852
|
+
required: !0
|
|
853
|
+
},
|
|
854
|
+
visible: {
|
|
855
|
+
type: Boolean,
|
|
856
|
+
required: !0
|
|
857
|
+
},
|
|
858
|
+
opacity: {
|
|
859
|
+
type: Number,
|
|
860
|
+
required: !0
|
|
861
|
+
},
|
|
862
|
+
mapZoom: {
|
|
863
|
+
type: Number,
|
|
864
|
+
required: !0
|
|
865
|
+
},
|
|
866
|
+
loadState: {
|
|
867
|
+
type: String,
|
|
868
|
+
required: !1
|
|
869
|
+
},
|
|
870
|
+
menuOpen: {
|
|
871
|
+
type: Boolean,
|
|
872
|
+
required: !0
|
|
873
|
+
},
|
|
874
|
+
legendOpen: {
|
|
875
|
+
type: Boolean,
|
|
876
|
+
required: !0
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
emits: [
|
|
880
|
+
"toggle",
|
|
881
|
+
"update:opacity",
|
|
882
|
+
"zoom",
|
|
883
|
+
"toggleMenu",
|
|
884
|
+
"closeMenu",
|
|
885
|
+
"toggleLegend",
|
|
886
|
+
"retry"
|
|
887
|
+
],
|
|
888
|
+
setup(e, { expose: t, emit: n }) {
|
|
889
|
+
t();
|
|
890
|
+
let r = e, i = n, a = de("menuButtonRef"), o = de("menuRef"), l = z(null), u = O(() => d(r.layer)), f = O(() => c(r.layer)), p = O(() => r.layer.legendLabel || r.layer.label), m = O(() => s(r.layer) ? u.value != null && r.mapZoom < u.value ? "unavailable" : r.loadState ?? "ready" : "missing"), h = O(() => m.value === "missing" || m.value === "unavailable" && !r.visible), g = O(() => s(r.layer)), _ = O(() => m.value === "missing" || m.value === "unavailable"), v = O(() => {
|
|
891
|
+
let e = u.value;
|
|
892
|
+
return e == null ? "" : `Доступний з ${Number.isInteger(e) ? String(e) : e.toFixed(1)} масштабу`;
|
|
893
|
+
}), y = O(() => {
|
|
894
|
+
let e = f.value ?? "#94a3b8";
|
|
895
|
+
return {
|
|
896
|
+
backgroundColor: `color-mix(in srgb, ${e} 22%, white)`,
|
|
897
|
+
borderColor: e
|
|
898
|
+
};
|
|
899
|
+
});
|
|
900
|
+
function b() {
|
|
901
|
+
let e = a.value?.getBoundingClientRect();
|
|
902
|
+
if (!e) return;
|
|
903
|
+
let t = e.right + dt + lt <= window.innerWidth - 8 ? e.right + dt : Math.max(8, e.left - lt - dt), n = Math.min(Math.max(8, e.top - 12), window.innerHeight - ut - 8);
|
|
904
|
+
l.value = {
|
|
905
|
+
top: n,
|
|
906
|
+
left: t
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
function x(e) {
|
|
910
|
+
let t = e.target;
|
|
911
|
+
t instanceof Node && (o.value?.contains(t) || a.value?.contains(t) || i("closeMenu"));
|
|
912
|
+
}
|
|
913
|
+
function ee(e) {
|
|
914
|
+
e.key === "Escape" && i("closeMenu");
|
|
915
|
+
}
|
|
916
|
+
function S() {
|
|
917
|
+
window.removeEventListener("resize", b), window.removeEventListener("scroll", b, !0), document.removeEventListener("pointerdown", x), document.removeEventListener("keydown", ee);
|
|
918
|
+
}
|
|
919
|
+
U(() => r.menuOpen, async (e) => {
|
|
920
|
+
if (S(), !e) {
|
|
921
|
+
l.value = null;
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
await se(), b(), window.addEventListener("resize", b), window.addEventListener("scroll", b, !0), document.addEventListener("pointerdown", x), document.addEventListener("keydown", ee);
|
|
925
|
+
}), le(S);
|
|
926
|
+
function te(e) {
|
|
927
|
+
i("update:opacity", Number(e.target.value));
|
|
928
|
+
}
|
|
929
|
+
let ne = {
|
|
930
|
+
MENU_WIDTH: lt,
|
|
931
|
+
MENU_HEIGHT: ut,
|
|
932
|
+
MENU_GAP: dt,
|
|
933
|
+
props: r,
|
|
934
|
+
emit: i,
|
|
935
|
+
menuButtonRef: a,
|
|
936
|
+
menuRef: o,
|
|
937
|
+
menuPosition: l,
|
|
938
|
+
minZoom: u,
|
|
939
|
+
legendColor: f,
|
|
940
|
+
legendText: p,
|
|
941
|
+
status: m,
|
|
942
|
+
toggleDisabled: h,
|
|
943
|
+
canZoom: g,
|
|
944
|
+
faded: _,
|
|
945
|
+
zoomText: v,
|
|
946
|
+
swatchStyle: y,
|
|
947
|
+
updateMenuPosition: b,
|
|
948
|
+
handleOutsidePointer: x,
|
|
949
|
+
handleEscape: ee,
|
|
950
|
+
detachMenuListeners: S,
|
|
951
|
+
onOpacityInput: te,
|
|
952
|
+
get AlertTriangle() {
|
|
953
|
+
return Y;
|
|
954
|
+
},
|
|
955
|
+
get GripVertical() {
|
|
956
|
+
return me;
|
|
957
|
+
},
|
|
958
|
+
get Loader2() {
|
|
959
|
+
return ge;
|
|
960
|
+
},
|
|
961
|
+
get MapIcon() {
|
|
962
|
+
return _e;
|
|
963
|
+
},
|
|
964
|
+
get MoreHorizontal() {
|
|
965
|
+
return ye;
|
|
966
|
+
},
|
|
967
|
+
get ZoomIn() {
|
|
968
|
+
return Te;
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
return Object.defineProperty(ne, "__isScriptSetup", {
|
|
972
|
+
enumerable: !1,
|
|
973
|
+
value: !0
|
|
974
|
+
}), ne;
|
|
975
|
+
}
|
|
976
|
+
}), pt = { class: "flex items-center gap-2.5" }, mt = [
|
|
977
|
+
"aria-checked",
|
|
978
|
+
"aria-label",
|
|
979
|
+
"disabled"
|
|
980
|
+
], ht = { class: "min-w-0 flex-1" }, gt = ["title"], _t = {
|
|
981
|
+
key: 0,
|
|
982
|
+
class: "mt-0.5 flex items-center gap-1 text-[10px] text-amber-600"
|
|
983
|
+
}, vt = {
|
|
984
|
+
key: 1,
|
|
985
|
+
class: "mt-0.5 flex items-center gap-1 text-[10px] text-amber-600"
|
|
986
|
+
}, yt = {
|
|
987
|
+
key: 2,
|
|
988
|
+
class: "mt-0.5 flex items-center gap-1 text-[10px] text-brand-600"
|
|
989
|
+
}, bt = {
|
|
990
|
+
key: 3,
|
|
991
|
+
class: "mt-0.5 flex items-center gap-1 text-[10px] text-red-600"
|
|
992
|
+
}, xt = {
|
|
993
|
+
key: 4,
|
|
994
|
+
class: "block text-[11px] text-slate-400"
|
|
995
|
+
}, St = ["aria-expanded", "aria-label"], Ct = { class: "mb-2 flex items-center justify-between text-xs font-semibold text-slate-600" }, wt = { class: "tabular-nums text-slate-400" }, Tt = ["value", "aria-label"], Et = ["disabled", "title"], Dt = {
|
|
996
|
+
key: 0,
|
|
997
|
+
class: "mt-2 rounded-lg border border-slate-100 bg-slate-50 px-3 py-2 text-[11px] text-slate-600"
|
|
998
|
+
}, Ot = { class: "flex items-center gap-2" };
|
|
999
|
+
function kt(e, t, n, r, i, a) {
|
|
1000
|
+
return R(), j("div", { class: I(["relative rounded-xl border border-slate-200 px-3 py-2.5 transition-colors", [n.visible ? "bg-white" : "bg-slate-50", r.faded ? "opacity-65" : ""]]) }, [
|
|
1001
|
+
M("div", pt, [
|
|
1002
|
+
P(r.GripVertical, {
|
|
1003
|
+
class: "h-4 w-4 shrink-0 text-slate-300",
|
|
1004
|
+
"aria-hidden": "true"
|
|
1005
|
+
}),
|
|
1006
|
+
M("button", {
|
|
1007
|
+
type: "button",
|
|
1008
|
+
role: "switch",
|
|
1009
|
+
"aria-checked": n.visible,
|
|
1010
|
+
"aria-label": `Показати шар ${n.layer.label}`,
|
|
1011
|
+
disabled: r.toggleDisabled,
|
|
1012
|
+
class: I(["relative h-5 w-9 shrink-0 rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-brand-200 focus:ring-offset-1 disabled:cursor-not-allowed", n.visible ? "bg-brand-600" : "bg-slate-200"]),
|
|
1013
|
+
onClick: t[0] ||= (e) => r.emit("toggle")
|
|
1014
|
+
}, [M("span", { class: I(["absolute left-0.5 top-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform", n.visible ? "translate-x-4" : ""]) }, null, 2)], 10, mt),
|
|
1015
|
+
M("span", {
|
|
1016
|
+
class: "h-2.5 w-8 shrink-0 rounded-sm border",
|
|
1017
|
+
style: L(r.swatchStyle),
|
|
1018
|
+
"aria-hidden": "true"
|
|
1019
|
+
}, null, 4),
|
|
1020
|
+
M("div", ht, [M("span", {
|
|
1021
|
+
class: "block truncate text-sm font-medium text-slate-700",
|
|
1022
|
+
title: n.layer.label
|
|
1023
|
+
}, V(n.layer.label), 9, gt), r.status === "unavailable" ? (R(), j("span", _t, [P(r.AlertTriangle, { class: "h-3 w-3 shrink-0" }), N(" " + V(r.zoomText), 1)])) : r.status === "missing" ? (R(), j("span", vt, [P(r.AlertTriangle, { class: "h-3 w-3 shrink-0" }), t[5] ||= N(" Джерело не налаштовано ", -1)])) : r.status === "loading" ? (R(), j("span", yt, [P(r.Loader2, { class: "h-3 w-3 shrink-0 animate-spin" }), t[6] ||= N(" Завантаження шару… ", -1)])) : r.status === "error" ? (R(), j("span", bt, [P(r.AlertTriangle, { class: "h-3 w-3 shrink-0" }), t[7] ||= N(" Помилка завантаження ", -1)])) : (R(), j("span", xt, V(n.opacity) + "% прозорості", 1))]),
|
|
1024
|
+
r.status === "error" ? (R(), j("button", {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
type: "button",
|
|
1027
|
+
class: "rounded-md px-1.5 py-1 text-[10px] font-semibold text-red-700 hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-200",
|
|
1028
|
+
onClick: t[1] ||= (e) => r.emit("retry")
|
|
1029
|
+
}, " Повторити ")) : A("", !0),
|
|
1030
|
+
M("button", {
|
|
1031
|
+
ref: "menuButtonRef",
|
|
1032
|
+
type: "button",
|
|
1033
|
+
"aria-expanded": n.menuOpen,
|
|
1034
|
+
"aria-label": `Меню шару ${n.layer.label}`,
|
|
1035
|
+
class: "rounded-md p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 focus:outline-none focus:ring-2 focus:ring-brand-200",
|
|
1036
|
+
onClick: t[2] ||= (e) => r.emit("toggleMenu")
|
|
1037
|
+
}, [P(r.MoreHorizontal, { class: "h-4 w-4" })], 8, St)
|
|
1038
|
+
]),
|
|
1039
|
+
(R(), k(D, { to: "body" }, [n.menuOpen && r.menuPosition ? (R(), j("div", {
|
|
1040
|
+
key: 0,
|
|
1041
|
+
ref: "menuRef",
|
|
1042
|
+
role: "menu",
|
|
1043
|
+
class: "fixed z-[70] w-52 rounded-xl border border-slate-200 bg-white p-3 shadow-xl",
|
|
1044
|
+
style: L({
|
|
1045
|
+
top: `${r.menuPosition.top}px`,
|
|
1046
|
+
left: `${r.menuPosition.left}px`
|
|
1047
|
+
})
|
|
1048
|
+
}, [
|
|
1049
|
+
M("div", Ct, [t[8] ||= M("span", null, "Прозорість", -1), M("span", wt, V(n.opacity) + "%", 1)]),
|
|
1050
|
+
M("input", {
|
|
1051
|
+
type: "range",
|
|
1052
|
+
min: "0",
|
|
1053
|
+
max: "100",
|
|
1054
|
+
value: n.opacity,
|
|
1055
|
+
"aria-label": `Прозорість шару ${n.layer.label}`,
|
|
1056
|
+
class: "mb-3 w-full accent-brand-600",
|
|
1057
|
+
onInput: r.onOpacityInput
|
|
1058
|
+
}, null, 40, Tt),
|
|
1059
|
+
M("button", {
|
|
1060
|
+
type: "button",
|
|
1061
|
+
disabled: !r.canZoom,
|
|
1062
|
+
title: r.canZoom ? void 0 : "Немає геометрії шару",
|
|
1063
|
+
class: "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-xs text-slate-600 hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-brand-200 disabled:cursor-not-allowed disabled:text-slate-300 disabled:hover:bg-transparent",
|
|
1064
|
+
onClick: t[3] ||= (e) => r.emit("zoom")
|
|
1065
|
+
}, [P(r.ZoomIn, { class: I(["h-3.5 w-3.5", r.canZoom ? "text-slate-400" : "text-slate-300"]) }, null, 8, ["class"]), t[9] ||= N(" Наблизити до шару ", -1)], 8, Et),
|
|
1066
|
+
M("button", {
|
|
1067
|
+
type: "button",
|
|
1068
|
+
class: "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-xs text-slate-600 hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-brand-200",
|
|
1069
|
+
onClick: t[4] ||= (e) => r.emit("toggleLegend")
|
|
1070
|
+
}, [P(r.MapIcon, { class: "h-3.5 w-3.5 text-slate-400" }), t[10] ||= N(" Переглянути легенду ", -1)])
|
|
1071
|
+
], 4)) : A("", !0)])),
|
|
1072
|
+
n.legendOpen ? (R(), j("div", Dt, [t[11] ||= M("div", { class: "mb-1 font-semibold text-slate-700" }, "Легенда шару", -1), M("div", Ot, [M("span", {
|
|
1073
|
+
class: "h-2.5 w-7 rounded-sm",
|
|
1074
|
+
style: L({ backgroundColor: r.legendColor ?? "#94a3b8" })
|
|
1075
|
+
}, null, 4), N(" " + V(r.legendText), 1)])])) : A("", !0)
|
|
1076
|
+
], 2);
|
|
1077
|
+
}
|
|
1078
|
+
var At = /*#__PURE__*/ e(ft, [["render", kt], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/OverlayLayerRow.vue"]]), jt = T.items.map((e) => ({
|
|
1079
|
+
code: e.code,
|
|
1080
|
+
label: e.name
|
|
1081
|
+
})), Mt = Object.fromEntries(T.items.map((e) => [e.code, e.name])), Nt = Object.entries(g).map(([e, t]) => ({
|
|
1082
|
+
key: e,
|
|
1083
|
+
label: t,
|
|
1084
|
+
color: m[e] ?? "#64748b"
|
|
1085
|
+
})), Pt = "Звернення на видачу вихідних даних", Ft = 208, It = 96, Lt = 12, Rt = /*@__PURE__*/ F({
|
|
1086
|
+
__name: "MapLayersPanel",
|
|
1087
|
+
props: {
|
|
1088
|
+
searchQuery: {
|
|
1089
|
+
type: String,
|
|
1090
|
+
required: !0
|
|
1091
|
+
},
|
|
1092
|
+
filters: {
|
|
1093
|
+
type: Object,
|
|
1094
|
+
required: !0
|
|
1095
|
+
},
|
|
1096
|
+
visibleStatuses: {
|
|
1097
|
+
type: Set,
|
|
1098
|
+
required: !0
|
|
1099
|
+
},
|
|
1100
|
+
statusCounts: {
|
|
1101
|
+
type: Object,
|
|
1102
|
+
required: !0
|
|
1103
|
+
},
|
|
1104
|
+
totalCount: {
|
|
1105
|
+
type: Number,
|
|
1106
|
+
required: !0
|
|
1107
|
+
},
|
|
1108
|
+
basemapId: {
|
|
1109
|
+
type: String,
|
|
1110
|
+
required: !0
|
|
1111
|
+
},
|
|
1112
|
+
baseLayers: {
|
|
1113
|
+
type: Array,
|
|
1114
|
+
required: !0
|
|
1115
|
+
},
|
|
1116
|
+
overlays: {
|
|
1117
|
+
type: Array,
|
|
1118
|
+
required: !0
|
|
1119
|
+
},
|
|
1120
|
+
activeOverlayIds: {
|
|
1121
|
+
type: Array,
|
|
1122
|
+
required: !0
|
|
1123
|
+
},
|
|
1124
|
+
overlayOpacities: {
|
|
1125
|
+
type: Object,
|
|
1126
|
+
required: !0
|
|
1127
|
+
},
|
|
1128
|
+
overlayLoad: {
|
|
1129
|
+
type: Object,
|
|
1130
|
+
required: !0
|
|
1131
|
+
},
|
|
1132
|
+
mapZoom: {
|
|
1133
|
+
type: Number,
|
|
1134
|
+
required: !0
|
|
1135
|
+
},
|
|
1136
|
+
applicationsName: {
|
|
1137
|
+
type: String,
|
|
1138
|
+
required: !1
|
|
1139
|
+
},
|
|
1140
|
+
applicationsVisible: {
|
|
1141
|
+
type: Boolean,
|
|
1142
|
+
required: !0
|
|
1143
|
+
},
|
|
1144
|
+
applicationsOpacity: {
|
|
1145
|
+
type: Number,
|
|
1146
|
+
required: !0
|
|
1147
|
+
},
|
|
1148
|
+
searchLoading: {
|
|
1149
|
+
type: Boolean,
|
|
1150
|
+
required: !1
|
|
1151
|
+
},
|
|
1152
|
+
searchResults: {
|
|
1153
|
+
type: Array,
|
|
1154
|
+
required: !1
|
|
1155
|
+
},
|
|
1156
|
+
searchEmpty: {
|
|
1157
|
+
type: Boolean,
|
|
1158
|
+
required: !1
|
|
1159
|
+
},
|
|
1160
|
+
searchError: {
|
|
1161
|
+
type: String,
|
|
1162
|
+
required: !1
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
emits: [
|
|
1166
|
+
"update:searchQuery",
|
|
1167
|
+
"update:filters",
|
|
1168
|
+
"update:applicationsVisible",
|
|
1169
|
+
"update:applicationsOpacity",
|
|
1170
|
+
"toggleStatus",
|
|
1171
|
+
"selectAllStatuses",
|
|
1172
|
+
"clearStatuses",
|
|
1173
|
+
"basemapChange",
|
|
1174
|
+
"toggleOverlay",
|
|
1175
|
+
"overlayOpacity",
|
|
1176
|
+
"zoomToOverlay",
|
|
1177
|
+
"retryOverlay",
|
|
1178
|
+
"selectSearchResult"
|
|
1179
|
+
],
|
|
1180
|
+
setup(e, { expose: t, emit: n }) {
|
|
1181
|
+
t();
|
|
1182
|
+
let r = {
|
|
1183
|
+
dateFrom: "Від",
|
|
1184
|
+
dateTo: "До",
|
|
1185
|
+
workType: "Вид робіт",
|
|
1186
|
+
verifiedBy: "Перевірив",
|
|
1187
|
+
organization: "Організація",
|
|
1188
|
+
address: "Адреса"
|
|
1189
|
+
}, i = e, a = n, o = z(!1), c = z(!0), d = z(!0), f = z(!1), p = z(!1), m = z({}), h = z(!1), g = z(null), _ = de("menuButtonRef"), v = de("menuRef"), y = z(null), b = z(null), x = z(null), ee = O({
|
|
1190
|
+
get: () => i.searchQuery,
|
|
1191
|
+
set: (e) => a("update:searchQuery", e)
|
|
1192
|
+
}), S = O(() => !!i.searchQuery.trim() && (i.searchLoading || i.searchError || i.searchEmpty || (i.searchResults?.length ?? 0) > 0)), te = O(() => i.applicationsName || Pt), ne = O(() => +!!i.applicationsVisible + i.overlays.filter((e) => i.activeOverlayIds.includes(e.id)).length), re = O(() => i.baseLayers.find((e) => e.id === i.basemapId) ?? i.baseLayers[0]), C = O(() => Nt.filter((e) => i.visibleStatuses.has(e.key)).reduce((e, t) => e + (i.statusCounts[t.key] ?? 0), 0));
|
|
1193
|
+
function ie(e) {
|
|
1194
|
+
let t = i.statusCounts[e] ?? 0;
|
|
1195
|
+
return C.value > 0 && i.visibleStatuses.has(e) ? Math.round(t / C.value * 100) : 0;
|
|
1196
|
+
}
|
|
1197
|
+
function ae(e) {
|
|
1198
|
+
return e.toLocaleString("uk-UA");
|
|
1199
|
+
}
|
|
1200
|
+
let w = O(() => Object.keys(r).filter((e) => {
|
|
1201
|
+
let t = i.filters[e];
|
|
1202
|
+
return Array.isArray(t) ? t.length > 0 : !!t;
|
|
1203
|
+
}).map((e) => ({
|
|
1204
|
+
key: e,
|
|
1205
|
+
label: `${r[e]}: ${E(e, i.filters[e] ?? "")}`
|
|
1206
|
+
}))), oe = O(() => w.value.length), T = O(() => !!(m.value.dateFrom && m.value.dateTo && m.value.dateFrom > m.value.dateTo));
|
|
1207
|
+
function E(e, t) {
|
|
1208
|
+
let n = Array.isArray(t) ? t : [t];
|
|
1209
|
+
return e === "workType" ? n.map((e) => Mt[e] ?? e).join(", ") : e === "dateFrom" || e === "dateTo" ? n[0]?.split("-").reverse().join(".") ?? "" : n.join(", ");
|
|
1210
|
+
}
|
|
1211
|
+
function D(e) {
|
|
1212
|
+
let t = {}, n = (e.workType ?? []).map((e) => e.trim()).filter(Boolean);
|
|
1213
|
+
n.length && (t.workType = n);
|
|
1214
|
+
for (let n of [
|
|
1215
|
+
"dateFrom",
|
|
1216
|
+
"dateTo",
|
|
1217
|
+
"verifiedBy",
|
|
1218
|
+
"organization",
|
|
1219
|
+
"address"
|
|
1220
|
+
]) {
|
|
1221
|
+
let r = e[n]?.trim();
|
|
1222
|
+
r && (t[n] = r);
|
|
1223
|
+
}
|
|
1224
|
+
return t;
|
|
1225
|
+
}
|
|
1226
|
+
function k() {
|
|
1227
|
+
return {
|
|
1228
|
+
dateFrom: "",
|
|
1229
|
+
dateTo: "",
|
|
1230
|
+
workType: [],
|
|
1231
|
+
verifiedBy: "",
|
|
1232
|
+
organization: "",
|
|
1233
|
+
address: ""
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
function A() {
|
|
1237
|
+
p.value || (m.value = {
|
|
1238
|
+
...k(),
|
|
1239
|
+
...i.filters,
|
|
1240
|
+
workType: [...i.filters.workType ?? []]
|
|
1241
|
+
}), p.value = !p.value;
|
|
1242
|
+
}
|
|
1243
|
+
function j() {
|
|
1244
|
+
T.value || (a("update:filters", D(m.value)), p.value = !1);
|
|
1245
|
+
}
|
|
1246
|
+
function M() {
|
|
1247
|
+
m.value = k(), a("update:filters", {});
|
|
1248
|
+
}
|
|
1249
|
+
function N(e) {
|
|
1250
|
+
let t = { ...i.filters };
|
|
1251
|
+
delete t[e], a("update:filters", t), p.value && (m.value = {
|
|
1252
|
+
...m.value,
|
|
1253
|
+
[e]: e === "workType" ? [] : ""
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
function P() {
|
|
1257
|
+
a("update:applicationsVisible", !i.applicationsVisible);
|
|
1258
|
+
}
|
|
1259
|
+
function F() {
|
|
1260
|
+
y.value = null, h.value = !h.value;
|
|
1261
|
+
}
|
|
1262
|
+
function I(e) {
|
|
1263
|
+
return i.overlayOpacities[e.id] ?? Math.round(u(e) * 100);
|
|
1264
|
+
}
|
|
1265
|
+
function L(e) {
|
|
1266
|
+
h.value = !1, y.value = y.value === e ? null : e;
|
|
1267
|
+
}
|
|
1268
|
+
function ce(e) {
|
|
1269
|
+
b.value = b.value === e ? null : e;
|
|
1270
|
+
}
|
|
1271
|
+
function R(e) {
|
|
1272
|
+
s(e) && (y.value = null, x.value = `Карту наближено до шару «${e.label}».`, a("zoomToOverlay", e.id));
|
|
1273
|
+
}
|
|
1274
|
+
function B() {
|
|
1275
|
+
let e = _.value?.getBoundingClientRect();
|
|
1276
|
+
if (!e) return;
|
|
1277
|
+
let t = e.right + Lt + Ft <= window.innerWidth - 8 ? e.right + Lt : Math.max(8, e.left - Ft - Lt), n = Math.min(Math.max(8, e.top - 12), window.innerHeight - It - 8);
|
|
1278
|
+
g.value = {
|
|
1279
|
+
top: n,
|
|
1280
|
+
left: t
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
function ue(e) {
|
|
1284
|
+
let t = e.target;
|
|
1285
|
+
v.value?.contains(t) || _.value?.contains(t) || (h.value = !1);
|
|
1286
|
+
}
|
|
1287
|
+
function V(e) {
|
|
1288
|
+
e.key === "Escape" && (h.value = !1);
|
|
1289
|
+
}
|
|
1290
|
+
function H() {
|
|
1291
|
+
window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0), document.removeEventListener("pointerdown", ue), document.removeEventListener("keydown", V);
|
|
1292
|
+
}
|
|
1293
|
+
U(h, async (e) => {
|
|
1294
|
+
if (H(), !e) {
|
|
1295
|
+
g.value = null;
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
await se(), B(), window.addEventListener("resize", B), window.addEventListener("scroll", B, !0), document.addEventListener("pointerdown", ue), document.addEventListener("keydown", V);
|
|
1299
|
+
});
|
|
1300
|
+
function fe(e) {
|
|
1301
|
+
e.key === "Escape" && (document.querySelector("[data-map-filter-ui][role=\"listbox\"]") || (p.value = !1));
|
|
1302
|
+
}
|
|
1303
|
+
U(p, (e) => {
|
|
1304
|
+
e ? document.addEventListener("keydown", fe) : document.removeEventListener("keydown", fe);
|
|
1305
|
+
}), U(o, (e) => {
|
|
1306
|
+
e && (h.value = !1, p.value = !1, y.value = null, b.value = null, x.value = null);
|
|
1307
|
+
}), le(() => {
|
|
1308
|
+
H(), document.removeEventListener("keydown", fe);
|
|
1309
|
+
});
|
|
1310
|
+
let W = {
|
|
1311
|
+
DEFAULT_APPLICATIONS_LAYER_NAME: Pt,
|
|
1312
|
+
MENU_WIDTH: Ft,
|
|
1313
|
+
MENU_HEIGHT: It,
|
|
1314
|
+
MENU_GAP: Lt,
|
|
1315
|
+
FILTER_LABELS: r,
|
|
1316
|
+
props: i,
|
|
1317
|
+
emit: a,
|
|
1318
|
+
collapsed: o,
|
|
1319
|
+
layersOpen: c,
|
|
1320
|
+
applicationsOpen: d,
|
|
1321
|
+
baseOpen: f,
|
|
1322
|
+
filtersOpen: p,
|
|
1323
|
+
draftFilters: m,
|
|
1324
|
+
menuOpen: h,
|
|
1325
|
+
menuPosition: g,
|
|
1326
|
+
menuButtonRef: _,
|
|
1327
|
+
menuRef: v,
|
|
1328
|
+
overlayMenuId: y,
|
|
1329
|
+
legendLayerId: b,
|
|
1330
|
+
layerNotice: x,
|
|
1331
|
+
searchModel: ee,
|
|
1332
|
+
searchDropdownOpen: S,
|
|
1333
|
+
applicationsLayerName: te,
|
|
1334
|
+
activeLayersCount: ne,
|
|
1335
|
+
activeBasemap: re,
|
|
1336
|
+
visibleStatusCount: C,
|
|
1337
|
+
statusPercent: ie,
|
|
1338
|
+
formatCount: ae,
|
|
1339
|
+
activeFilterChips: w,
|
|
1340
|
+
activeFilterCount: oe,
|
|
1341
|
+
dateRangeInvalid: T,
|
|
1342
|
+
filterValueText: E,
|
|
1343
|
+
cleanFilters: D,
|
|
1344
|
+
emptyDraft: k,
|
|
1345
|
+
toggleFilters: A,
|
|
1346
|
+
applyFilters: j,
|
|
1347
|
+
resetFilters: M,
|
|
1348
|
+
removeFilter: N,
|
|
1349
|
+
toggleApplications: P,
|
|
1350
|
+
toggleApplicationsMenu: F,
|
|
1351
|
+
overlayOpacity: I,
|
|
1352
|
+
toggleOverlayMenu: L,
|
|
1353
|
+
toggleLegend: ce,
|
|
1354
|
+
zoomToLayer: R,
|
|
1355
|
+
updateMenuPosition: B,
|
|
1356
|
+
handleOutsidePointer: ue,
|
|
1357
|
+
handleEscape: V,
|
|
1358
|
+
detachMenuListeners: H,
|
|
1359
|
+
handleFiltersEscape: fe,
|
|
1360
|
+
get Check() {
|
|
1361
|
+
return X;
|
|
1362
|
+
},
|
|
1363
|
+
get ChevronDown() {
|
|
1364
|
+
return Z;
|
|
1365
|
+
},
|
|
1366
|
+
get Layers2() {
|
|
1367
|
+
return he;
|
|
1368
|
+
},
|
|
1369
|
+
get MoreHorizontal() {
|
|
1370
|
+
return ye;
|
|
1371
|
+
},
|
|
1372
|
+
get RotateCcw() {
|
|
1373
|
+
return xe;
|
|
1374
|
+
},
|
|
1375
|
+
get Search() {
|
|
1376
|
+
return Se;
|
|
1377
|
+
},
|
|
1378
|
+
get SlidersHorizontal() {
|
|
1379
|
+
return Ce;
|
|
1380
|
+
},
|
|
1381
|
+
get X() {
|
|
1382
|
+
return we;
|
|
1383
|
+
},
|
|
1384
|
+
MapFilterSelect: ct,
|
|
1385
|
+
OverlayLayerRow: At,
|
|
1386
|
+
get WORK_TYPE_OPTIONS() {
|
|
1387
|
+
return jt;
|
|
1388
|
+
},
|
|
1389
|
+
get MAP_LEGEND() {
|
|
1390
|
+
return Nt;
|
|
1391
|
+
},
|
|
1392
|
+
get basemapPreview() {
|
|
1393
|
+
return l;
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
return Object.defineProperty(W, "__isScriptSetup", {
|
|
1397
|
+
enumerable: !1,
|
|
1398
|
+
value: !0
|
|
1399
|
+
}), W;
|
|
1400
|
+
}
|
|
1401
|
+
}), zt = { class: "rounded-full bg-brand-50 px-1.5 py-0.5 text-[11px] text-brand-700" }, Bt = {
|
|
1402
|
+
key: 1,
|
|
1403
|
+
class: "absolute inset-x-3 bottom-3 z-30 flex max-h-[calc(100%-6rem)] flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-[0_16px_50px_rgba(15,23,42,0.18)] xl:inset-x-auto xl:bottom-auto xl:left-4 xl:top-4 xl:max-h-[calc(100%-2rem)] xl:w-[400px]",
|
|
1404
|
+
"aria-label": "Панель шарів карти"
|
|
1405
|
+
}, Vt = { class: "border-b border-slate-100 p-3" }, Ht = { class: "flex items-center gap-2" }, Ut = { class: "relative min-w-0 flex-1" }, Wt = {
|
|
1406
|
+
key: 0,
|
|
1407
|
+
class: "mt-2 max-h-56 overflow-y-auto rounded-lg border border-slate-200 bg-white shadow-sm",
|
|
1408
|
+
role: "listbox",
|
|
1409
|
+
"aria-label": "Результати пошуку"
|
|
1410
|
+
}, Gt = {
|
|
1411
|
+
key: 0,
|
|
1412
|
+
class: "px-3 py-2.5 text-sm text-slate-500"
|
|
1413
|
+
}, Kt = {
|
|
1414
|
+
key: 1,
|
|
1415
|
+
class: "px-3 py-2.5 text-sm text-red-600"
|
|
1416
|
+
}, qt = {
|
|
1417
|
+
key: 2,
|
|
1418
|
+
class: "px-3 py-2.5 text-sm text-slate-500"
|
|
1419
|
+
}, Jt = {
|
|
1420
|
+
key: 3,
|
|
1421
|
+
class: "divide-y divide-slate-100"
|
|
1422
|
+
}, Yt = ["onClick"], Xt = { class: "text-sm font-medium text-slate-800" }, Zt = { class: "line-clamp-2 text-xs text-slate-500" }, Qt = { class: "min-h-0 flex-1 overflow-y-auto px-3 pb-3" }, $t = { class: "flex items-center justify-between pb-2 pt-3" }, en = { class: "text-[11px] text-slate-400" }, tn = {
|
|
1423
|
+
key: 0,
|
|
1424
|
+
class: "max-h-[min(480px,45vh)] space-y-2 overflow-y-auto pr-1"
|
|
1425
|
+
}, nn = { class: "flex items-start gap-2.5 p-3" }, rn = ["aria-checked"], an = ["title"], on = { class: "block truncate text-sm font-semibold text-slate-800" }, sn = { class: "mt-1 flex flex-wrap items-center gap-1.5 text-xs text-slate-500" }, cn = { class: "font-medium tabular-nums text-slate-700" }, ln = {
|
|
1426
|
+
key: 0,
|
|
1427
|
+
class: "rounded-full bg-amber-100 px-1.5 py-0.5 font-medium text-amber-700"
|
|
1428
|
+
}, un = {
|
|
1429
|
+
key: 1,
|
|
1430
|
+
class: "text-slate-400"
|
|
1431
|
+
}, dn = ["aria-expanded"], fn = {
|
|
1432
|
+
key: 0,
|
|
1433
|
+
class: "border-t border-brand-100 px-3 pb-3 pt-2"
|
|
1434
|
+
}, pn = { class: "mb-1 flex items-center justify-between" }, mn = { class: "text-[11px] tabular-nums text-slate-400" }, hn = { class: "space-y-0.5 py-0.5" }, gn = ["title", "onClick"], _n = { class: "min-w-0 flex-1 whitespace-normal break-words text-xs font-medium leading-4 text-slate-700" }, vn = { class: "w-10 shrink-0 pt-0.5 text-right text-xs tabular-nums text-slate-500" }, yn = { class: "w-8 shrink-0 pt-0.5 text-right text-[11px] tabular-nums text-slate-400" }, bn = {
|
|
1435
|
+
key: 0,
|
|
1436
|
+
class: "mt-2 rounded-lg border border-dashed border-slate-200 bg-white px-3 py-3 text-center text-xs text-slate-500"
|
|
1437
|
+
}, xn = { class: "mt-2 flex items-center gap-2 border-t border-brand-100 pt-2" }, Sn = ["aria-expanded"], Cn = {
|
|
1438
|
+
key: 0,
|
|
1439
|
+
class: "rounded-full bg-brand-600 px-1.5 text-[10px] text-white"
|
|
1440
|
+
}, wn = {
|
|
1441
|
+
key: 1,
|
|
1442
|
+
class: "mt-2 flex flex-wrap gap-1.5"
|
|
1443
|
+
}, Tn = ["title", "onClick"], En = { class: "max-w-[150px] truncate" }, Dn = { class: "mt-4 flex items-center justify-between border-t border-slate-100 pb-2 pt-3" }, On = {
|
|
1444
|
+
key: 2,
|
|
1445
|
+
class: "grid grid-cols-2 gap-2"
|
|
1446
|
+
}, kn = ["onClick"], An = ["src", "alt"], jn = ["src", "alt"], Mn = { class: "min-w-0 flex-1" }, Nn = { class: "block text-sm font-semibold text-slate-700" }, Pn = { class: "mb-3 flex items-start justify-between" }, Fn = { class: "grid grid-cols-2 gap-3" }, In = { class: "block" }, Ln = ["max"], Rn = { class: "block" }, zn = ["min"], Bn = {
|
|
1447
|
+
key: 0,
|
|
1448
|
+
class: "col-span-2 -mt-1 text-[11px] text-red-600"
|
|
1449
|
+
}, Vn = { class: "col-span-2 block" }, Hn = { class: "col-span-2 block" }, Un = { class: "col-span-2 block" }, Wn = { class: "col-span-2 block" }, Gn = { class: "mt-4 flex gap-2 border-t border-slate-100 pt-3" }, Kn = ["disabled"], qn = { class: "mb-2 flex items-center justify-between text-xs font-semibold text-slate-600" }, Jn = { class: "tabular-nums text-slate-400" }, Yn = ["value"];
|
|
1450
|
+
function Xn(e, t, n, r, i, a) {
|
|
1451
|
+
return R(), j(E, null, [r.collapsed ? (R(), j("button", {
|
|
1452
|
+
key: 0,
|
|
1453
|
+
type: "button",
|
|
1454
|
+
class: "absolute bottom-4 left-4 z-30 inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-700 shadow-card-hover transition-all hover:border-brand-300 hover:text-brand-700 xl:bottom-auto xl:top-4",
|
|
1455
|
+
onClick: t[0] ||= (e) => r.collapsed = !1
|
|
1456
|
+
}, [
|
|
1457
|
+
P(r.Layers2, { class: "h-4 w-4 text-brand-600" }),
|
|
1458
|
+
t[21] ||= N(" Шари ", -1),
|
|
1459
|
+
M("span", zt, V(r.activeLayersCount), 1)
|
|
1460
|
+
])) : (R(), j("section", Bt, [
|
|
1461
|
+
M("div", Vt, [M("div", Ht, [M("label", Ut, [
|
|
1462
|
+
P(r.Search, { class: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400" }),
|
|
1463
|
+
W(M("input", {
|
|
1464
|
+
"onUpdate:modelValue": t[1] ||= (e) => r.searchModel = e,
|
|
1465
|
+
type: "text",
|
|
1466
|
+
autocomplete: "off",
|
|
1467
|
+
placeholder: "Пошук на карті…",
|
|
1468
|
+
class: "h-10 w-full rounded-lg border border-slate-200 bg-slate-50 pl-9 pr-9 text-sm text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:border-brand-400 focus:bg-white focus:ring-2 focus:ring-brand-100"
|
|
1469
|
+
}, null, 512), [[H, r.searchModel]]),
|
|
1470
|
+
n.searchQuery ? (R(), j("button", {
|
|
1471
|
+
key: 0,
|
|
1472
|
+
type: "button",
|
|
1473
|
+
title: "Очистити пошук",
|
|
1474
|
+
"aria-label": "Очистити пошук",
|
|
1475
|
+
class: "absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-200/60 hover:text-slate-700",
|
|
1476
|
+
onClick: t[2] ||= (e) => r.searchModel = ""
|
|
1477
|
+
}, [P(r.X, { class: "h-3.5 w-3.5" })])) : A("", !0)
|
|
1478
|
+
]), M("button", {
|
|
1479
|
+
type: "button",
|
|
1480
|
+
title: "Згорнути панель шарів",
|
|
1481
|
+
"aria-label": "Згорнути панель шарів",
|
|
1482
|
+
class: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-slate-200 text-slate-500 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700",
|
|
1483
|
+
onClick: t[3] ||= (e) => r.collapsed = !0
|
|
1484
|
+
}, [P(r.X, { class: "h-4 w-4" })])]), r.searchDropdownOpen ? (R(), j("div", Wt, [n.searchLoading ? (R(), j("p", Gt, "Пошук…")) : n.searchError ? (R(), j("p", Kt, V(n.searchError), 1)) : n.searchEmpty ? (R(), j("p", qt, "Нічого не знайдено")) : (R(), j("ul", Jt, [(R(!0), j(E, null, B(n.searchResults, (e) => (R(), j("li", { key: e.id }, [M("button", {
|
|
1485
|
+
type: "button",
|
|
1486
|
+
role: "option",
|
|
1487
|
+
class: "flex w-full flex-col gap-0.5 px-3 py-2.5 text-left transition-colors hover:bg-brand-50",
|
|
1488
|
+
onClick: (t) => r.emit("selectSearchResult", e)
|
|
1489
|
+
}, [M("span", Xt, V(e.number || "Без номера"), 1), M("span", Zt, V(e.address), 1)], 8, Yt)]))), 128))]))])) : A("", !0)]),
|
|
1490
|
+
M("div", Qt, [
|
|
1491
|
+
M("div", $t, [M("button", {
|
|
1492
|
+
type: "button",
|
|
1493
|
+
class: "flex items-center gap-2 text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400",
|
|
1494
|
+
onClick: t[4] ||= (e) => r.layersOpen = !r.layersOpen
|
|
1495
|
+
}, [P(r.ChevronDown, { class: I(["h-3.5 w-3.5 transition-transform", r.layersOpen ? "" : "-rotate-90"]) }, null, 8, ["class"]), t[22] ||= N(" Додаткові шари ", -1)]), M("span", en, V(r.activeLayersCount) + " активні", 1)]),
|
|
1496
|
+
r.layersOpen ? (R(), j("div", tn, [M("div", { class: I(["rounded-xl border transition-colors", n.applicationsVisible ? "border-brand-300 bg-brand-50/40" : "border-slate-200 bg-white"]) }, [M("div", nn, [
|
|
1497
|
+
M("button", {
|
|
1498
|
+
type: "button",
|
|
1499
|
+
role: "switch",
|
|
1500
|
+
"aria-checked": n.applicationsVisible,
|
|
1501
|
+
"aria-label": "Показати звернення",
|
|
1502
|
+
class: I(["relative mt-0.5 h-5 w-9 shrink-0 rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-brand-200 focus:ring-offset-1", n.applicationsVisible ? "bg-brand-600" : "bg-slate-200"]),
|
|
1503
|
+
onClick: r.toggleApplications
|
|
1504
|
+
}, [M("span", { class: I(["absolute left-0.5 top-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform", n.applicationsVisible ? "translate-x-4" : ""]) }, null, 2)], 10, rn),
|
|
1505
|
+
M("button", {
|
|
1506
|
+
type: "button",
|
|
1507
|
+
title: r.applicationsLayerName,
|
|
1508
|
+
class: "min-w-0 flex-1 text-left focus:outline-none",
|
|
1509
|
+
onClick: t[5] ||= (e) => r.applicationsOpen = !r.applicationsOpen
|
|
1510
|
+
}, [M("span", on, V(r.applicationsLayerName), 1), M("span", sn, [
|
|
1511
|
+
M("span", cn, V(r.formatCount(r.visibleStatusCount)), 1),
|
|
1512
|
+
t[23] ||= N(" об'єктів ", -1),
|
|
1513
|
+
r.activeFilterCount > 0 ? (R(), j("span", ln, " фільтри: " + V(r.activeFilterCount), 1)) : A("", !0),
|
|
1514
|
+
n.applicationsOpacity < 100 ? (R(), j("span", un, "· " + V(n.applicationsOpacity) + "% непрозорості", 1)) : A("", !0)
|
|
1515
|
+
])], 8, an),
|
|
1516
|
+
M("button", {
|
|
1517
|
+
ref: "menuButtonRef",
|
|
1518
|
+
type: "button",
|
|
1519
|
+
"aria-expanded": r.menuOpen,
|
|
1520
|
+
"aria-label": "Меню шару звернень",
|
|
1521
|
+
class: "rounded-md p-1 text-slate-400 transition-colors hover:bg-white hover:text-slate-700 focus:outline-none focus:ring-2 focus:ring-brand-200",
|
|
1522
|
+
onClick: r.toggleApplicationsMenu
|
|
1523
|
+
}, [P(r.MoreHorizontal, { class: "h-4 w-4" })], 8, dn),
|
|
1524
|
+
M("button", {
|
|
1525
|
+
type: "button",
|
|
1526
|
+
"aria-label": "Розгорнути фільтри звернень",
|
|
1527
|
+
class: "rounded-md p-1 text-slate-400 transition-colors hover:bg-white hover:text-brand-600",
|
|
1528
|
+
onClick: t[6] ||= (e) => r.applicationsOpen = !r.applicationsOpen
|
|
1529
|
+
}, [P(r.ChevronDown, { class: I(["h-4 w-4 transition-transform", r.applicationsOpen ? "" : "-rotate-90"]) }, null, 8, ["class"])])
|
|
1530
|
+
]), r.applicationsOpen ? (R(), j("div", fn, [
|
|
1531
|
+
M("div", pn, [t[24] ||= M("span", { class: "text-[11px] font-semibold text-slate-400" }, "Швидкі фільтри за статусом", -1), M("span", mn, V(r.formatCount(r.visibleStatusCount)) + " з " + V(r.formatCount(n.totalCount)), 1)]),
|
|
1532
|
+
M("div", hn, [(R(!0), j(E, null, B(r.MAP_LEGEND, (e) => (R(), j("button", {
|
|
1533
|
+
key: e.key,
|
|
1534
|
+
type: "button",
|
|
1535
|
+
title: e.label,
|
|
1536
|
+
class: I(["flex w-full items-start gap-2 rounded-lg px-2 py-2 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-200", n.visibleStatuses.has(e.key) ? "hover:bg-white" : "opacity-45 hover:bg-white/70"]),
|
|
1537
|
+
onClick: (t) => r.emit("toggleStatus", e.key)
|
|
1538
|
+
}, [
|
|
1539
|
+
M("span", {
|
|
1540
|
+
class: "mt-1 h-2.5 w-2.5 shrink-0 rounded-full",
|
|
1541
|
+
style: L({ backgroundColor: e.color })
|
|
1542
|
+
}, null, 4),
|
|
1543
|
+
M("span", _n, V(e.label), 1),
|
|
1544
|
+
M("span", vn, V(r.formatCount(n.statusCounts[e.key] ?? 0)), 1),
|
|
1545
|
+
M("span", yn, V(r.statusPercent(e.key)) + "% ", 1)
|
|
1546
|
+
], 10, gn))), 128))]),
|
|
1547
|
+
n.visibleStatuses.size === 0 ? (R(), j("div", bn, " За вибраними статусами об'єктів не знайдено. ")) : A("", !0),
|
|
1548
|
+
M("div", xn, [
|
|
1549
|
+
M("button", {
|
|
1550
|
+
type: "button",
|
|
1551
|
+
class: "text-xs font-semibold text-brand-700 hover:text-brand-900",
|
|
1552
|
+
onClick: t[7] ||= (e) => r.emit("selectAllStatuses")
|
|
1553
|
+
}, " Усі "),
|
|
1554
|
+
t[26] ||= M("span", { class: "text-slate-300" }, "·", -1),
|
|
1555
|
+
M("button", {
|
|
1556
|
+
type: "button",
|
|
1557
|
+
class: "text-xs font-medium text-slate-500 hover:text-slate-700",
|
|
1558
|
+
onClick: t[8] ||= (e) => r.emit("clearStatuses")
|
|
1559
|
+
}, " Скинути "),
|
|
1560
|
+
M("button", {
|
|
1561
|
+
type: "button",
|
|
1562
|
+
"aria-expanded": r.filtersOpen,
|
|
1563
|
+
class: I(["ml-auto inline-flex items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-xs font-semibold transition-colors", r.filtersOpen || r.activeFilterCount ? "border-brand-200 text-brand-700" : "border-slate-200 text-slate-600 hover:border-brand-300 hover:text-brand-700"]),
|
|
1564
|
+
onClick: r.toggleFilters
|
|
1565
|
+
}, [
|
|
1566
|
+
P(r.SlidersHorizontal, { class: "h-3.5 w-3.5" }),
|
|
1567
|
+
t[25] ||= N(" Фільтри ", -1),
|
|
1568
|
+
r.activeFilterCount > 0 ? (R(), j("span", Cn, V(r.activeFilterCount), 1)) : A("", !0)
|
|
1569
|
+
], 10, Sn)
|
|
1570
|
+
]),
|
|
1571
|
+
r.activeFilterChips.length ? (R(), j("div", wn, [(R(!0), j(E, null, B(r.activeFilterChips, (e) => (R(), j("button", {
|
|
1572
|
+
key: e.key,
|
|
1573
|
+
type: "button",
|
|
1574
|
+
title: `Прибрати фільтр «${e.label}»`,
|
|
1575
|
+
class: "inline-flex max-w-full items-center gap-1 rounded-full border border-brand-100 bg-white px-2 py-1 text-[11px] text-brand-700 hover:border-brand-300",
|
|
1576
|
+
onClick: (t) => r.removeFilter(e.key)
|
|
1577
|
+
}, [M("span", En, V(e.label), 1), P(r.X, { class: "h-3 w-3 shrink-0" })], 8, Tn))), 128))])) : A("", !0)
|
|
1578
|
+
])) : A("", !0)], 2), (R(!0), j(E, null, B(n.overlays, (e) => (R(), k(r.OverlayLayerRow, {
|
|
1579
|
+
key: e.id,
|
|
1580
|
+
layer: e,
|
|
1581
|
+
visible: n.activeOverlayIds.includes(e.id),
|
|
1582
|
+
opacity: r.overlayOpacity(e),
|
|
1583
|
+
"map-zoom": n.mapZoom,
|
|
1584
|
+
"load-state": n.overlayLoad[e.id],
|
|
1585
|
+
"menu-open": r.overlayMenuId === e.id,
|
|
1586
|
+
"legend-open": r.legendLayerId === e.id,
|
|
1587
|
+
onToggle: (t) => r.emit("toggleOverlay", e.id),
|
|
1588
|
+
"onUpdate:opacity": (t) => r.emit("overlayOpacity", e.id, t),
|
|
1589
|
+
onZoom: (t) => r.zoomToLayer(e),
|
|
1590
|
+
onToggleMenu: (t) => r.toggleOverlayMenu(e.id),
|
|
1591
|
+
onCloseMenu: t[9] ||= (e) => r.overlayMenuId = null,
|
|
1592
|
+
onToggleLegend: (t) => r.toggleLegend(e.id),
|
|
1593
|
+
onRetry: (t) => r.emit("retryOverlay", e.id)
|
|
1594
|
+
}, null, 8, [
|
|
1595
|
+
"layer",
|
|
1596
|
+
"visible",
|
|
1597
|
+
"opacity",
|
|
1598
|
+
"map-zoom",
|
|
1599
|
+
"load-state",
|
|
1600
|
+
"menu-open",
|
|
1601
|
+
"legend-open",
|
|
1602
|
+
"onToggle",
|
|
1603
|
+
"onUpdate:opacity",
|
|
1604
|
+
"onZoom",
|
|
1605
|
+
"onToggleMenu",
|
|
1606
|
+
"onToggleLegend",
|
|
1607
|
+
"onRetry"
|
|
1608
|
+
]))), 128))])) : A("", !0),
|
|
1609
|
+
r.layerNotice ? (R(), j("button", {
|
|
1610
|
+
key: 1,
|
|
1611
|
+
type: "button",
|
|
1612
|
+
class: "mt-2 flex w-full items-center justify-between rounded-lg border border-brand-100 bg-brand-50 px-3 py-2 text-left text-xs text-brand-800",
|
|
1613
|
+
role: "status",
|
|
1614
|
+
onClick: t[10] ||= (e) => r.layerNotice = null
|
|
1615
|
+
}, [M("span", null, V(r.layerNotice), 1), P(r.X, { class: "h-3.5 w-3.5 shrink-0" })])) : A("", !0),
|
|
1616
|
+
M("div", Dn, [M("button", {
|
|
1617
|
+
type: "button",
|
|
1618
|
+
class: "flex items-center gap-2 text-[11px] font-bold uppercase tracking-[0.12em] text-slate-400",
|
|
1619
|
+
onClick: t[11] ||= (e) => r.baseOpen = !r.baseOpen
|
|
1620
|
+
}, [P(r.ChevronDown, { class: I(["h-3.5 w-3.5 transition-transform", r.baseOpen ? "" : "-rotate-90"]) }, null, 8, ["class"]), t[27] ||= N(" Базові шари ", -1)]), t[28] ||= M("span", { class: "text-[11px] text-slate-400" }, "1 активний", -1)]),
|
|
1621
|
+
r.baseOpen ? (R(), j("div", On, [(R(!0), j(E, null, B(n.baseLayers, (e) => (R(), j("button", {
|
|
1622
|
+
key: e.id,
|
|
1623
|
+
type: "button",
|
|
1624
|
+
class: I(["group rounded-xl border p-1.5 text-left transition-all focus:outline-none focus:ring-2 focus:ring-brand-200", n.basemapId === e.id ? "border-brand-500 bg-brand-50 shadow-sm" : "border-slate-200 bg-white hover:border-brand-300"]),
|
|
1625
|
+
onClick: (t) => r.emit("basemapChange", e.id)
|
|
1626
|
+
}, [M("img", {
|
|
1627
|
+
src: r.basemapPreview(e),
|
|
1628
|
+
alt: e.label,
|
|
1629
|
+
class: "block h-12 w-full rounded-md object-cover"
|
|
1630
|
+
}, null, 8, An), M("span", { class: I(["mt-1.5 flex items-center gap-1 px-0.5 text-xs font-semibold", n.basemapId === e.id ? "text-brand-700" : "text-slate-600"]) }, [n.basemapId === e.id ? (R(), k(r.Check, {
|
|
1631
|
+
key: 0,
|
|
1632
|
+
class: "h-3 w-3"
|
|
1633
|
+
})) : A("", !0), N(" " + V(e.label), 1)], 2)], 10, kn))), 128))])) : r.activeBasemap ? (R(), j("button", {
|
|
1634
|
+
key: 3,
|
|
1635
|
+
type: "button",
|
|
1636
|
+
class: "flex w-full items-center gap-3 rounded-xl border border-slate-200 bg-slate-50 p-2 text-left transition-colors hover:border-brand-300 hover:bg-brand-50/40",
|
|
1637
|
+
onClick: t[12] ||= (e) => r.baseOpen = !0
|
|
1638
|
+
}, [
|
|
1639
|
+
M("img", {
|
|
1640
|
+
src: r.basemapPreview(r.activeBasemap),
|
|
1641
|
+
alt: r.activeBasemap.label,
|
|
1642
|
+
class: "block h-12 w-16 shrink-0 rounded-md object-cover"
|
|
1643
|
+
}, null, 8, jn),
|
|
1644
|
+
M("span", Mn, [M("span", Nn, V(r.activeBasemap.label), 1), t[29] ||= M("span", { class: "block text-[11px] text-slate-400" }, "Підложка карти", -1)]),
|
|
1645
|
+
P(r.ChevronDown, { class: "h-4 w-4 text-slate-400" })
|
|
1646
|
+
])) : A("", !0)
|
|
1647
|
+
]),
|
|
1648
|
+
r.filtersOpen ? (R(), j("form", {
|
|
1649
|
+
key: 0,
|
|
1650
|
+
class: "shrink-0 border-t border-slate-100 bg-white p-4",
|
|
1651
|
+
onSubmit: G(r.applyFilters, ["prevent"])
|
|
1652
|
+
}, [
|
|
1653
|
+
M("div", Pn, [t[30] ||= M("div", null, [M("h3", { class: "text-sm font-bold text-slate-800" }, "Розширені фільтри"), M("p", { class: "mt-0.5 text-xs text-slate-400" }, "Звужуйте вибір об'єктів звернень")], -1), M("button", {
|
|
1654
|
+
type: "button",
|
|
1655
|
+
"aria-label": "Закрити фільтри",
|
|
1656
|
+
class: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700",
|
|
1657
|
+
onClick: t[13] ||= (e) => r.filtersOpen = !1
|
|
1658
|
+
}, [P(r.X, { class: "h-4 w-4" })])]),
|
|
1659
|
+
M("div", Fn, [
|
|
1660
|
+
M("label", In, [t[31] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Дата від", -1), W(M("input", {
|
|
1661
|
+
"onUpdate:modelValue": t[14] ||= (e) => r.draftFilters.dateFrom = e,
|
|
1662
|
+
type: "date",
|
|
1663
|
+
max: r.draftFilters.dateTo || void 0,
|
|
1664
|
+
class: "h-9 w-full rounded-lg border border-slate-200 px-2 text-xs text-slate-700 outline-none focus:border-brand-400 focus:ring-1 focus:ring-brand-100"
|
|
1665
|
+
}, null, 8, Ln), [[H, r.draftFilters.dateFrom]])]),
|
|
1666
|
+
M("label", Rn, [t[32] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Дата до", -1), W(M("input", {
|
|
1667
|
+
"onUpdate:modelValue": t[15] ||= (e) => r.draftFilters.dateTo = e,
|
|
1668
|
+
type: "date",
|
|
1669
|
+
min: r.draftFilters.dateFrom || void 0,
|
|
1670
|
+
class: "h-9 w-full rounded-lg border border-slate-200 px-2 text-xs text-slate-700 outline-none focus:border-brand-400 focus:ring-1 focus:ring-brand-100"
|
|
1671
|
+
}, null, 8, zn), [[H, r.draftFilters.dateTo]])]),
|
|
1672
|
+
r.dateRangeInvalid ? (R(), j("p", Bn, " Дата «від» не може бути пізнішою за дату «до». ")) : A("", !0),
|
|
1673
|
+
M("label", Vn, [t[33] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Вид робіт", -1), P(r.MapFilterSelect, {
|
|
1674
|
+
"model-value": r.draftFilters.workType ?? [],
|
|
1675
|
+
label: "Вид робіт",
|
|
1676
|
+
options: r.WORK_TYPE_OPTIONS.map((e) => ({
|
|
1677
|
+
value: e.code,
|
|
1678
|
+
label: e.label
|
|
1679
|
+
})),
|
|
1680
|
+
"onUpdate:modelValue": t[16] ||= (e) => r.draftFilters.workType = e
|
|
1681
|
+
}, null, 8, ["model-value", "options"])]),
|
|
1682
|
+
M("label", Hn, [t[34] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Перевірив", -1), W(M("input", {
|
|
1683
|
+
"onUpdate:modelValue": t[17] ||= (e) => r.draftFilters.verifiedBy = e,
|
|
1684
|
+
type: "text",
|
|
1685
|
+
class: "h-9 w-full rounded-lg border border-slate-200 px-2.5 text-xs text-slate-700 outline-none focus:border-brand-400 focus:ring-1 focus:ring-brand-100"
|
|
1686
|
+
}, null, 512), [[H, r.draftFilters.verifiedBy]])]),
|
|
1687
|
+
M("label", Un, [t[35] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Організація", -1), W(M("input", {
|
|
1688
|
+
"onUpdate:modelValue": t[18] ||= (e) => r.draftFilters.organization = e,
|
|
1689
|
+
type: "text",
|
|
1690
|
+
class: "h-9 w-full rounded-lg border border-slate-200 px-2.5 text-xs text-slate-700 outline-none focus:border-brand-400 focus:ring-1 focus:ring-brand-100"
|
|
1691
|
+
}, null, 512), [[H, r.draftFilters.organization]])]),
|
|
1692
|
+
M("label", Wn, [t[36] ||= M("span", { class: "mb-1 block text-[11px] font-semibold text-slate-500" }, "Адреса", -1), W(M("input", {
|
|
1693
|
+
"onUpdate:modelValue": t[19] ||= (e) => r.draftFilters.address = e,
|
|
1694
|
+
type: "text",
|
|
1695
|
+
class: "h-9 w-full rounded-lg border border-slate-200 px-2.5 text-xs text-slate-700 outline-none focus:border-brand-400 focus:ring-1 focus:ring-brand-100"
|
|
1696
|
+
}, null, 512), [[H, r.draftFilters.address]])])
|
|
1697
|
+
]),
|
|
1698
|
+
M("div", Gn, [M("button", {
|
|
1699
|
+
type: "button",
|
|
1700
|
+
class: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-slate-200 px-3 py-2 text-xs font-semibold text-slate-600 hover:bg-slate-50",
|
|
1701
|
+
onClick: r.resetFilters
|
|
1702
|
+
}, [P(r.RotateCcw, { class: "h-3.5 w-3.5" }), t[37] ||= N(" Скинути ", -1)]), M("button", {
|
|
1703
|
+
type: "submit",
|
|
1704
|
+
disabled: r.dateRangeInvalid,
|
|
1705
|
+
class: "flex-1 rounded-lg bg-brand-600 px-3 py-2 text-xs font-semibold text-white hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-50"
|
|
1706
|
+
}, " Застосувати ", 8, Kn)])
|
|
1707
|
+
], 32)) : A("", !0)
|
|
1708
|
+
])), (R(), k(D, { to: "body" }, [r.menuOpen && r.menuPosition ? (R(), j("div", {
|
|
1709
|
+
key: 0,
|
|
1710
|
+
ref: "menuRef",
|
|
1711
|
+
role: "menu",
|
|
1712
|
+
class: "fixed z-[70] w-52 rounded-xl border border-slate-200 bg-white p-3 shadow-xl",
|
|
1713
|
+
style: L({
|
|
1714
|
+
top: `${r.menuPosition.top}px`,
|
|
1715
|
+
left: `${r.menuPosition.left}px`
|
|
1716
|
+
})
|
|
1717
|
+
}, [M("div", qn, [t[38] ||= M("span", null, "Непрозорість", -1), M("span", Jn, V(n.applicationsOpacity) + "%", 1)]), M("input", {
|
|
1718
|
+
type: "range",
|
|
1719
|
+
min: "0",
|
|
1720
|
+
max: "100",
|
|
1721
|
+
value: n.applicationsOpacity,
|
|
1722
|
+
"aria-label": "Непрозорість шару звернень",
|
|
1723
|
+
class: "w-full accent-brand-600",
|
|
1724
|
+
onInput: t[20] ||= (e) => r.emit("update:applicationsOpacity", Number(e.target.value))
|
|
1725
|
+
}, null, 40, Yn)], 4)) : A("", !0)]))], 64);
|
|
1726
|
+
}
|
|
1727
|
+
var Zn = /*#__PURE__*/ e(Rt, [["render", Xn], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapLayersPanel.vue"]]), Qn = "flex h-9 w-9 items-center justify-center text-slate-600 transition-colors hover:bg-brand-50 hover:text-brand-600", $n = /*@__PURE__*/ F({
|
|
1728
|
+
__name: "MapControls",
|
|
1729
|
+
props: { visibleCount: {
|
|
1730
|
+
type: Number,
|
|
1731
|
+
required: !0
|
|
1732
|
+
} },
|
|
1733
|
+
emits: [
|
|
1734
|
+
"zoomIn",
|
|
1735
|
+
"zoomOut",
|
|
1736
|
+
"resetView"
|
|
1737
|
+
],
|
|
1738
|
+
setup(e, { expose: t, emit: n }) {
|
|
1739
|
+
t();
|
|
1740
|
+
let r = {
|
|
1741
|
+
emit: n,
|
|
1742
|
+
groupedButtonClass: Qn,
|
|
1743
|
+
get Compass() {
|
|
1744
|
+
return Q;
|
|
1745
|
+
},
|
|
1746
|
+
get Minus() {
|
|
1747
|
+
return ve;
|
|
1748
|
+
},
|
|
1749
|
+
get Plus() {
|
|
1750
|
+
return be;
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
return Object.defineProperty(r, "__isScriptSetup", {
|
|
1754
|
+
enumerable: !1,
|
|
1755
|
+
value: !0
|
|
1756
|
+
}), r;
|
|
1757
|
+
}
|
|
1758
|
+
}), er = { class: "absolute right-3 top-3 z-20 flex flex-col gap-1.5" }, tr = { class: "flex flex-col overflow-hidden rounded-lg border border-slate-200 bg-white shadow-card" }, nr = { class: "absolute bottom-3 right-3 z-10 flex items-center gap-2 rounded-md bg-white/80 px-2.5 py-1 text-[11px] text-slate-400 backdrop-blur-sm" };
|
|
1759
|
+
function rr(e, t, n, r, i, a) {
|
|
1760
|
+
return R(), j(E, null, [M("div", er, [M("div", tr, [
|
|
1761
|
+
M("button", {
|
|
1762
|
+
type: "button",
|
|
1763
|
+
title: "Збільшити",
|
|
1764
|
+
"aria-label": "Збільшити",
|
|
1765
|
+
class: I(r.groupedButtonClass),
|
|
1766
|
+
onClick: t[0] ||= (e) => r.emit("zoomIn")
|
|
1767
|
+
}, [P(r.Plus, { class: "h-4 w-4" })]),
|
|
1768
|
+
t[3] ||= M("div", { class: "h-px bg-slate-100" }, null, -1),
|
|
1769
|
+
M("button", {
|
|
1770
|
+
type: "button",
|
|
1771
|
+
title: "Зменшити",
|
|
1772
|
+
"aria-label": "Зменшити",
|
|
1773
|
+
class: I(r.groupedButtonClass),
|
|
1774
|
+
onClick: t[1] ||= (e) => r.emit("zoomOut")
|
|
1775
|
+
}, [P(r.Minus, { class: "h-4 w-4" })]),
|
|
1776
|
+
t[4] ||= M("div", { class: "h-px bg-slate-100" }, null, -1),
|
|
1777
|
+
M("button", {
|
|
1778
|
+
type: "button",
|
|
1779
|
+
title: "Північ/Південь/Захід/Схід",
|
|
1780
|
+
"aria-label": "Північ/Південь/Захід/Схід",
|
|
1781
|
+
class: I(r.groupedButtonClass),
|
|
1782
|
+
onClick: t[2] ||= (e) => r.emit("resetView")
|
|
1783
|
+
}, [P(r.Compass, { class: "h-4 w-4" })])
|
|
1784
|
+
])]), M("div", nr, [
|
|
1785
|
+
t[5] ||= M("span", null, "MapLibre", -1),
|
|
1786
|
+
t[6] ||= M("span", { class: "text-slate-300" }, "·", -1),
|
|
1787
|
+
M("span", null, "Точок: " + V(n.visibleCount), 1)
|
|
1788
|
+
])], 64);
|
|
1789
|
+
}
|
|
1790
|
+
var ir = /*#__PURE__*/ e($n, [["render", rr], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapControls.vue"]]), ar = /*@__PURE__*/ F({
|
|
1791
|
+
__name: "MapPointTooltip",
|
|
1792
|
+
props: {
|
|
1793
|
+
points: {
|
|
1794
|
+
type: Array,
|
|
1795
|
+
required: !0
|
|
1796
|
+
},
|
|
1797
|
+
total: {
|
|
1798
|
+
type: Number,
|
|
1799
|
+
required: !0
|
|
1800
|
+
},
|
|
1801
|
+
position: {
|
|
1802
|
+
type: Object,
|
|
1803
|
+
required: !0
|
|
1804
|
+
},
|
|
1805
|
+
containerWidth: {
|
|
1806
|
+
type: Number,
|
|
1807
|
+
required: !0
|
|
1808
|
+
},
|
|
1809
|
+
containerHeight: {
|
|
1810
|
+
type: Number,
|
|
1811
|
+
required: !0
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
setup(e, { expose: t }) {
|
|
1815
|
+
t();
|
|
1816
|
+
let n = e, r = O(() => n.points.slice(0, 6)), i = O(() => n.points.length === 1 && n.total <= 1), a = O(() => Math.max(n.total - r.value.length, 0)), o = O(() => i.value ? 156 : 40 + r.value.length * 52 + (a.value ? 28 : 8)), s = O(() => {
|
|
1817
|
+
let e = o.value, t = n.position.x > 280 ? n.position.x - 256 - 14 : n.position.x + 14, r = n.position.y > e + 24 ? n.position.y - e - 12 : n.position.y + 14;
|
|
1818
|
+
return {
|
|
1819
|
+
left: `${Math.min(Math.max(t, 8), Math.max(n.containerWidth - 256 - 8, 8))}px`,
|
|
1820
|
+
top: `${Math.min(Math.max(r, 8), Math.max(n.containerHeight - e - 8, 8))}px`
|
|
1821
|
+
};
|
|
1822
|
+
});
|
|
1823
|
+
function c(e) {
|
|
1824
|
+
return m[e] ?? "#64748b";
|
|
1825
|
+
}
|
|
1826
|
+
function l(e) {
|
|
1827
|
+
return g[e] ?? e;
|
|
1828
|
+
}
|
|
1829
|
+
let u = {
|
|
1830
|
+
props: n,
|
|
1831
|
+
visiblePoints: r,
|
|
1832
|
+
single: i,
|
|
1833
|
+
hiddenCount: a,
|
|
1834
|
+
cardHeight: o,
|
|
1835
|
+
style: s,
|
|
1836
|
+
color: c,
|
|
1837
|
+
statusLabel: l,
|
|
1838
|
+
point: O(() => n.points[0])
|
|
1839
|
+
};
|
|
1840
|
+
return Object.defineProperty(u, "__isScriptSetup", {
|
|
1841
|
+
enumerable: !1,
|
|
1842
|
+
value: !0
|
|
1843
|
+
}), u;
|
|
1844
|
+
}
|
|
1845
|
+
}), or = { class: "mb-2 flex items-center gap-2" }, sr = { class: "text-sm font-semibold text-slate-800" }, cr = { class: "space-y-1.5 text-xs" }, lr = { class: "flex justify-between gap-2" }, ur = { class: "font-medium text-slate-700" }, dr = { class: "flex justify-between gap-2" }, fr = { class: "font-medium text-slate-700" }, pr = { class: "flex justify-between gap-2" }, mr = { class: "text-right font-medium text-slate-700" }, hr = { class: "flex justify-between gap-2" }, gr = { class: "text-right font-medium text-slate-700" }, _r = { class: "mb-2 text-xs font-semibold text-slate-500" }, vr = { class: "space-y-2" }, yr = { class: "flex items-center gap-2" }, br = { class: "truncate text-sm font-semibold text-slate-800" }, xr = { class: "truncate pl-4 text-[11px] text-slate-500" }, Sr = {
|
|
1846
|
+
key: 0,
|
|
1847
|
+
class: "mt-2 text-[11px] font-medium text-slate-400"
|
|
1848
|
+
};
|
|
1849
|
+
function Cr(e, t, n, r, i, a) {
|
|
1850
|
+
return R(), j("div", {
|
|
1851
|
+
class: "pointer-events-none absolute z-30 w-64 rounded-lg border border-slate-200 bg-white p-3 shadow-card-hover",
|
|
1852
|
+
style: L(r.style)
|
|
1853
|
+
}, [r.single && r.point ? (R(), j(E, { key: 0 }, [M("div", or, [M("span", {
|
|
1854
|
+
class: "h-2.5 w-2.5 shrink-0 rounded-full",
|
|
1855
|
+
style: L({ backgroundColor: r.color(r.point.status) })
|
|
1856
|
+
}, null, 4), M("span", sr, V(r.point.number), 1)]), M("dl", cr, [
|
|
1857
|
+
M("div", lr, [t[0] ||= M("dt", { class: "text-slate-400" }, "Ідентифікатор", -1), M("dd", ur, V(r.point.id), 1)]),
|
|
1858
|
+
M("div", dr, [t[1] ||= M("dt", { class: "text-slate-400" }, "Статус", -1), M("dd", fr, V(r.statusLabel(r.point.status)), 1)]),
|
|
1859
|
+
M("div", pr, [t[2] ||= M("dt", { class: "text-slate-400" }, "Вид робіт", -1), M("dd", mr, V(r.point.workType), 1)]),
|
|
1860
|
+
M("div", hr, [t[3] ||= M("dt", { class: "text-slate-400" }, "Організація", -1), M("dd", gr, V(r.point.organization), 1)])
|
|
1861
|
+
])], 64)) : (R(), j(E, { key: 1 }, [
|
|
1862
|
+
M("p", _r, " Звернення в точці · " + V(n.total), 1),
|
|
1863
|
+
M("ul", vr, [(R(!0), j(E, null, B(r.visiblePoints, (e) => (R(), j("li", {
|
|
1864
|
+
key: e.id,
|
|
1865
|
+
class: "min-w-0"
|
|
1866
|
+
}, [M("div", yr, [M("span", {
|
|
1867
|
+
class: "h-2 w-2 shrink-0 rounded-full",
|
|
1868
|
+
style: L({ backgroundColor: r.color(e.status) })
|
|
1869
|
+
}, null, 4), M("span", br, V(e.number), 1)]), M("p", xr, V(r.statusLabel(e.status)) + " · " + V(e.organization), 1)]))), 128))]),
|
|
1870
|
+
r.hiddenCount ? (R(), j("p", Sr, " Ще " + V(r.hiddenCount), 1)) : A("", !0)
|
|
1871
|
+
], 64))], 4);
|
|
1872
|
+
}
|
|
1873
|
+
var wr = /*#__PURE__*/ e(ar, [["render", Cr], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapPointTooltip.vue"]]), Tr = /*@__PURE__*/ F({
|
|
1874
|
+
__name: "MapApplicationPanel",
|
|
1875
|
+
props: {
|
|
1876
|
+
rows: {
|
|
1877
|
+
type: Array,
|
|
1878
|
+
required: !0
|
|
1879
|
+
},
|
|
1880
|
+
total: {
|
|
1881
|
+
type: Number,
|
|
1882
|
+
required: !0
|
|
1883
|
+
},
|
|
1884
|
+
page: {
|
|
1885
|
+
type: Number,
|
|
1886
|
+
required: !0
|
|
1887
|
+
},
|
|
1888
|
+
pageCount: {
|
|
1889
|
+
type: Number,
|
|
1890
|
+
required: !0
|
|
1891
|
+
},
|
|
1892
|
+
application: {
|
|
1893
|
+
type: [Object, null],
|
|
1894
|
+
required: !0
|
|
1895
|
+
},
|
|
1896
|
+
loading: {
|
|
1897
|
+
type: Boolean,
|
|
1898
|
+
required: !0
|
|
1899
|
+
},
|
|
1900
|
+
error: {
|
|
1901
|
+
type: String,
|
|
1902
|
+
required: !0
|
|
1903
|
+
}
|
|
1904
|
+
},
|
|
1905
|
+
emits: [
|
|
1906
|
+
"close",
|
|
1907
|
+
"back",
|
|
1908
|
+
"select",
|
|
1909
|
+
"page"
|
|
1910
|
+
],
|
|
1911
|
+
setup(e, { expose: t, emit: n }) {
|
|
1912
|
+
t();
|
|
1913
|
+
let r = e, i = n;
|
|
1914
|
+
function a(e) {
|
|
1915
|
+
return Array.isArray(e) ? e[0] ?? null : e ?? null;
|
|
1916
|
+
}
|
|
1917
|
+
function o(e) {
|
|
1918
|
+
if (!e) return "—";
|
|
1919
|
+
let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
1920
|
+
return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
|
|
1921
|
+
}
|
|
1922
|
+
function s(e) {
|
|
1923
|
+
return e ? [
|
|
1924
|
+
e.last_name,
|
|
1925
|
+
e.first_name,
|
|
1926
|
+
e.middle_name
|
|
1927
|
+
].filter(Boolean).join(" ") : "";
|
|
1928
|
+
}
|
|
1929
|
+
let c = O(() => a(r.application?.organization)), l = O(() => a(r.application?.surveyor)), u = {
|
|
1930
|
+
props: r,
|
|
1931
|
+
emit: i,
|
|
1932
|
+
firstRelation: a,
|
|
1933
|
+
formatDate: o,
|
|
1934
|
+
personName: s,
|
|
1935
|
+
organization: c,
|
|
1936
|
+
surveyor: l,
|
|
1937
|
+
showList: O(() => !r.application),
|
|
1938
|
+
fields: O(() => {
|
|
1939
|
+
let e = r.application;
|
|
1940
|
+
if (!e) return [];
|
|
1941
|
+
let t = s(l.value) || e.surveyor_id_data?.text || "—", n = l.value?.phone || c.value?.phone;
|
|
1942
|
+
return [
|
|
1943
|
+
{
|
|
1944
|
+
label: "Вид робіт",
|
|
1945
|
+
value: e.work_type_data?.text || "—"
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
label: "Організація",
|
|
1949
|
+
value: c.value?.name || e.org_id_data?.text || "—"
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
label: "Заявник",
|
|
1953
|
+
value: t
|
|
1954
|
+
},
|
|
1955
|
+
...n ? [{
|
|
1956
|
+
label: "Телефон",
|
|
1957
|
+
value: n
|
|
1958
|
+
}] : [],
|
|
1959
|
+
{
|
|
1960
|
+
label: "Площа, га",
|
|
1961
|
+
value: e.area == null || e.area === "" ? "—" : String(e.area)
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
label: "Адреса",
|
|
1965
|
+
value: e.address_id_data?.text || "—"
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
label: "Місцезнаходження",
|
|
1969
|
+
value: e.location || "—"
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
label: "Опис запиту",
|
|
1973
|
+
value: e.description || "—"
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
label: "Підстава виконання",
|
|
1977
|
+
value: e.execution_basis || "—"
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
label: "Дата прийому",
|
|
1981
|
+
value: o(e.created_at)
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
label: "Дата видачі даних",
|
|
1985
|
+
value: o(e.source_data_issued_at)
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
label: "Дата прийому даних",
|
|
1989
|
+
value: o(e.survey_uploaded_at)
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
label: "Дата перевірки",
|
|
1993
|
+
value: o(e.verified_at)
|
|
1994
|
+
},
|
|
1995
|
+
{
|
|
1996
|
+
label: "Перевірив",
|
|
1997
|
+
value: e.verified_by_data?.text || "—"
|
|
1998
|
+
}
|
|
1999
|
+
];
|
|
2000
|
+
}),
|
|
2001
|
+
get RouterLink() {
|
|
2002
|
+
return K;
|
|
2003
|
+
},
|
|
2004
|
+
get ChevronLeft() {
|
|
2005
|
+
return pe;
|
|
2006
|
+
},
|
|
2007
|
+
get X() {
|
|
2008
|
+
return we;
|
|
2009
|
+
},
|
|
2010
|
+
AppealStatusBadge: v
|
|
2011
|
+
};
|
|
2012
|
+
return Object.defineProperty(u, "__isScriptSetup", {
|
|
2013
|
+
enumerable: !1,
|
|
2014
|
+
value: !0
|
|
2015
|
+
}), u;
|
|
2016
|
+
}
|
|
2017
|
+
}), Er = { class: "absolute bottom-12 right-16 top-3 z-20 flex w-[min(360px,calc(100vw-6rem))] flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-card-hover" }, Dr = { class: "flex items-start justify-between gap-3 border-b border-slate-100 px-4 py-3" }, Or = { class: "flex min-w-0 items-start gap-1" }, kr = { class: "min-w-0" }, Ar = { class: "text-[11px] font-semibold uppercase tracking-wide text-slate-400" }, jr = { class: "truncate text-base font-semibold text-slate-900" }, Mr = { class: "min-h-0 flex-1 overflow-y-auto px-4 py-3" }, Nr = {
|
|
2018
|
+
key: 0,
|
|
2019
|
+
class: "py-8 text-center text-sm text-slate-400"
|
|
2020
|
+
}, Pr = {
|
|
2021
|
+
key: 1,
|
|
2022
|
+
class: "py-8 text-center text-sm text-red-600"
|
|
2023
|
+
}, Fr = {
|
|
2024
|
+
key: 2,
|
|
2025
|
+
class: "py-8 text-center text-sm text-slate-400"
|
|
2026
|
+
}, Ir = {
|
|
2027
|
+
key: 3,
|
|
2028
|
+
class: "space-y-2"
|
|
2029
|
+
}, Lr = ["onClick"], Rr = { class: "flex items-center justify-between gap-2" }, zr = { class: "truncate text-sm font-semibold text-slate-800" }, Br = { class: "truncate text-xs text-slate-500" }, Vr = { class: "truncate text-xs text-slate-400" }, Hr = { class: "space-y-2.5" }, Ur = { class: "text-[11px] font-medium text-slate-400" }, Wr = { class: "text-[13px] font-medium leading-snug text-slate-800" }, Gr = {
|
|
2030
|
+
key: 0,
|
|
2031
|
+
class: "flex items-center justify-between gap-3 border-t border-slate-100 px-4 py-3"
|
|
2032
|
+
}, Kr = ["disabled"], qr = { class: "text-xs text-slate-400" }, Jr = ["disabled"], Yr = {
|
|
2033
|
+
key: 1,
|
|
2034
|
+
class: "border-t border-slate-100 px-4 py-3"
|
|
2035
|
+
};
|
|
2036
|
+
function Xr(e, t, n, r, i, a) {
|
|
2037
|
+
return R(), j("aside", Er, [
|
|
2038
|
+
M("header", Dr, [M("div", Or, [n.application && n.total > 1 ? (R(), j("button", {
|
|
2039
|
+
key: 0,
|
|
2040
|
+
type: "button",
|
|
2041
|
+
class: "mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
2042
|
+
"aria-label": "До списку",
|
|
2043
|
+
onClick: t[0] ||= (e) => r.emit("back")
|
|
2044
|
+
}, [P(r.ChevronLeft, { class: "h-4 w-4" })])) : A("", !0), M("div", kr, [M("p", Ar, V(r.showList ? "Звернення в точці" : "Звернення"), 1), M("h2", jr, [r.showList ? (R(), j(E, { key: 0 }, [N(V(n.total), 1)], 64)) : (R(), j(E, { key: 1 }, [N(V(n.application?.number || (n.loading ? "Завантаження…" : "—")), 1)], 64))])])]), M("button", {
|
|
2045
|
+
type: "button",
|
|
2046
|
+
class: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
2047
|
+
"aria-label": "Закрити",
|
|
2048
|
+
onClick: t[1] ||= (e) => r.emit("close")
|
|
2049
|
+
}, [P(r.X, { class: "h-4 w-4" })])]),
|
|
2050
|
+
M("div", Mr, [n.loading && !n.rows.length ? (R(), j("p", Nr, "Завантаження…")) : n.error ? (R(), j("p", Pr, V(n.error), 1)) : r.showList && !n.rows.length ? (R(), j("p", Fr, " У цій точці немає звернень ")) : r.showList ? (R(), j("ul", Ir, [(R(!0), j(E, null, B(n.rows, (e) => (R(), j("li", { key: e.app_id }, [M("button", {
|
|
2051
|
+
type: "button",
|
|
2052
|
+
class: "flex w-full flex-col gap-1 rounded-lg border border-slate-200 px-3 py-2.5 text-left transition-colors hover:border-brand-300 hover:bg-brand-50",
|
|
2053
|
+
onClick: (t) => r.emit("select", e)
|
|
2054
|
+
}, [
|
|
2055
|
+
M("span", Rr, [M("span", zr, V(e.number || "—"), 1), P(r.AppealStatusBadge, {
|
|
2056
|
+
status: e.status || "",
|
|
2057
|
+
label: e.status_data?.text || void 0,
|
|
2058
|
+
size: "sm"
|
|
2059
|
+
}, null, 8, ["status", "label"])]),
|
|
2060
|
+
M("span", Br, V(e.work_type_data?.text || "—"), 1),
|
|
2061
|
+
M("span", Vr, V(e.org_id_data?.text || "—"), 1)
|
|
2062
|
+
], 8, Lr)]))), 128))])) : n.application ? (R(), j(E, { key: 4 }, [P(r.AppealStatusBadge, {
|
|
2063
|
+
class: "mb-3",
|
|
2064
|
+
status: n.application.status || "",
|
|
2065
|
+
label: n.application.status_data?.text || void 0,
|
|
2066
|
+
size: "sm"
|
|
2067
|
+
}, null, 8, ["status", "label"]), M("dl", Hr, [(R(!0), j(E, null, B(r.fields, (e) => (R(), j("div", { key: e.label }, [M("dt", Ur, V(e.label), 1), M("dd", Wr, V(e.value), 1)]))), 128))])], 64)) : A("", !0)]),
|
|
2068
|
+
r.showList && n.pageCount > 1 ? (R(), j("footer", Gr, [
|
|
2069
|
+
M("button", {
|
|
2070
|
+
type: "button",
|
|
2071
|
+
class: "rounded-md px-2 py-1 text-[13px] font-medium text-slate-600 transition-colors hover:bg-slate-100 disabled:pointer-events-none disabled:text-slate-300",
|
|
2072
|
+
disabled: n.page <= 1 || n.loading,
|
|
2073
|
+
onClick: t[2] ||= (e) => r.emit("page", n.page - 1)
|
|
2074
|
+
}, " Назад ", 8, Kr),
|
|
2075
|
+
M("span", qr, V(n.page) + " / " + V(n.pageCount), 1),
|
|
2076
|
+
M("button", {
|
|
2077
|
+
type: "button",
|
|
2078
|
+
class: "rounded-md px-2 py-1 text-[13px] font-medium text-slate-600 transition-colors hover:bg-slate-100 disabled:pointer-events-none disabled:text-slate-300",
|
|
2079
|
+
disabled: n.page >= n.pageCount || n.loading,
|
|
2080
|
+
onClick: t[3] ||= (e) => r.emit("page", n.page + 1)
|
|
2081
|
+
}, " Далі ", 8, Jr)
|
|
2082
|
+
])) : n.application?.app_id ? (R(), j("footer", Yr, [P(r.RouterLink, {
|
|
2083
|
+
to: `/requests/${n.application.app_id}`,
|
|
2084
|
+
class: "inline-flex text-[13px] font-medium text-brand-600 transition-colors hover:text-brand-800 hover:underline"
|
|
2085
|
+
}, {
|
|
2086
|
+
default: fe(() => [...t[4] ||= [N(" Відкрити картку звернення ", -1)]]),
|
|
2087
|
+
_: 1
|
|
2088
|
+
}, 8, ["to"])])) : A("", !0)
|
|
2089
|
+
]);
|
|
2090
|
+
}
|
|
2091
|
+
var Zr = /*#__PURE__*/ e(Tr, [["render", Xr], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/components/MapApplicationPanel.vue"]]), Qr = ["status", "workType"], $r = "_", ei = [
|
|
2092
|
+
"dateFrom",
|
|
2093
|
+
"dateTo",
|
|
2094
|
+
"workType",
|
|
2095
|
+
"verifiedBy",
|
|
2096
|
+
"organization",
|
|
2097
|
+
"address"
|
|
2098
|
+
];
|
|
2099
|
+
function ti(e) {
|
|
2100
|
+
let t = Number(String(e ?? "").trim().replace(",", "."));
|
|
2101
|
+
return Number.isFinite(t) ? t : null;
|
|
2102
|
+
}
|
|
2103
|
+
function ni(e) {
|
|
2104
|
+
let t = ti(e.x), n = ti(e.y), r = ti(e.z), i = t != null && n != null && r != null ? {
|
|
2105
|
+
lng: t,
|
|
2106
|
+
lat: n,
|
|
2107
|
+
zoom: r
|
|
2108
|
+
} : null, o = String(e.filter ?? ""), s = a(o, Qr), c = null, l = s.status;
|
|
2109
|
+
if (l != null && l !== "") {
|
|
2110
|
+
let e = Array.isArray(l) ? l.join(",") : String(l);
|
|
2111
|
+
if (e === $r) c = /* @__PURE__ */ new Set();
|
|
2112
|
+
else {
|
|
2113
|
+
let t = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
2114
|
+
c = new Set(t.filter((e) => h.includes(e)));
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
let u = String(s.search ?? "").trim(), d = {};
|
|
2118
|
+
for (let e of ei) {
|
|
2119
|
+
let t = s[e];
|
|
2120
|
+
if (t == null || t === "") continue;
|
|
2121
|
+
if (e === "workType") {
|
|
2122
|
+
let e = Array.isArray(t) ? t.map((e) => String(e).trim()).filter(Boolean) : String(t).split(",").map((e) => e.trim()).filter(Boolean);
|
|
2123
|
+
e.length && (d.workType = e);
|
|
2124
|
+
continue;
|
|
2125
|
+
}
|
|
2126
|
+
let n = Array.isArray(t) ? t[0] : String(t).trim();
|
|
2127
|
+
n && (d[e] = n);
|
|
2128
|
+
}
|
|
2129
|
+
let f = e.layers, p = null;
|
|
2130
|
+
f != null && String(f) !== "" ? p = String(f).split(",").map((e) => e.trim()).filter(Boolean) : f != null && String(f) === "" && (p = []);
|
|
2131
|
+
let m = e.app, g = null;
|
|
2132
|
+
m != null && String(m) !== "" && (g = String(m) !== "0");
|
|
2133
|
+
let _ = ti(e.p), v = _ != null && _ > 0 ? Math.floor(_) : 1, y = String(e.basemap ?? e.base ?? "").trim() || null;
|
|
2134
|
+
return {
|
|
2135
|
+
view: i,
|
|
2136
|
+
sel: String(e.sel ?? "").trim() || null,
|
|
2137
|
+
identifyPage: v,
|
|
2138
|
+
basemapId: y,
|
|
2139
|
+
layerIds: p,
|
|
2140
|
+
applicationsVisible: g,
|
|
2141
|
+
visibleStatuses: c,
|
|
2142
|
+
search: u,
|
|
2143
|
+
advancedFilters: d
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
function ri(e) {
|
|
2147
|
+
let t = {};
|
|
2148
|
+
h.every((t) => e.visibleStatuses.has(t)) || (t.status = e.visibleStatuses.size ? [...e.visibleStatuses].sort().join(",") : $r);
|
|
2149
|
+
let n = e.search.trim();
|
|
2150
|
+
n && (t.search = n);
|
|
2151
|
+
for (let n of ei) {
|
|
2152
|
+
let r = e.advancedFilters[n];
|
|
2153
|
+
if (n === "workType") {
|
|
2154
|
+
let n = (e.advancedFilters.workType ?? []).map((e) => e.trim()).filter(Boolean);
|
|
2155
|
+
n.length && (t.workType = n);
|
|
2156
|
+
continue;
|
|
2157
|
+
}
|
|
2158
|
+
let i = typeof r == "string" ? r.trim() : "";
|
|
2159
|
+
i && (t[n] = i);
|
|
2160
|
+
}
|
|
2161
|
+
return t;
|
|
2162
|
+
}
|
|
2163
|
+
function ii(e) {
|
|
2164
|
+
let t = {};
|
|
2165
|
+
e.view && (t.z = String(Math.round(e.view.zoom * 100) / 100), t.x = e.view.lng.toFixed(5), t.y = e.view.lat.toFixed(5)), e.sel && (t.sel = e.sel), e.identifyPage > 1 && (t.p = String(e.identifyPage));
|
|
2166
|
+
let n = i(ri(e));
|
|
2167
|
+
return n && (t.filter = n), e.basemapId && e.defaultBasemapId && e.basemapId !== e.defaultBasemapId && (t.basemap = e.basemapId), e.activeOverlayIds.length > 0 && (t.layers = [...e.activeOverlayIds].sort().join(",")), e.applicationsVisible || (t.app = "0"), t;
|
|
2168
|
+
}
|
|
2169
|
+
function ai(e, t) {
|
|
2170
|
+
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
2171
|
+
for (let r of n) if (String(e[r] ?? "") !== String(t[r] ?? "")) return !1;
|
|
2172
|
+
return !0;
|
|
2173
|
+
}
|
|
2174
|
+
//#endregion
|
|
2175
|
+
//#region admin/src/pages/map/useMapRouteSync.ts
|
|
2176
|
+
var oi = 300, si = [
|
|
2177
|
+
"z",
|
|
2178
|
+
"x",
|
|
2179
|
+
"y",
|
|
2180
|
+
"sel",
|
|
2181
|
+
"p",
|
|
2182
|
+
"filter",
|
|
2183
|
+
"basemap",
|
|
2184
|
+
"base",
|
|
2185
|
+
"layers",
|
|
2186
|
+
"app"
|
|
2187
|
+
];
|
|
2188
|
+
function ci(e, t = {}) {
|
|
2189
|
+
let n = q(), r = J(), i = !1, a = !1, o, s = "";
|
|
2190
|
+
function c() {
|
|
2191
|
+
return JSON.stringify(ii({
|
|
2192
|
+
view: e.mapView.value,
|
|
2193
|
+
sel: e.sel.value,
|
|
2194
|
+
identifyPage: e.identifyPage.value,
|
|
2195
|
+
basemapId: e.basemapId.value,
|
|
2196
|
+
defaultBasemapId: e.defaultBasemapId.value,
|
|
2197
|
+
activeOverlayIds: e.activeOverlayIds.value,
|
|
2198
|
+
applicationsVisible: e.applicationsVisible.value,
|
|
2199
|
+
visibleStatuses: e.visibleStatuses.value,
|
|
2200
|
+
search: e.appliedSearch.value,
|
|
2201
|
+
advancedFilters: e.advancedFilters.value
|
|
2202
|
+
}));
|
|
2203
|
+
}
|
|
2204
|
+
function l() {
|
|
2205
|
+
let r = ni(n.query);
|
|
2206
|
+
i = !0, r.view && (e.mapView.value = r.view, t.onViewFromRoute?.(r.view)), e.sel.value = r.sel, e.identifyPage.value = r.identifyPage, r.basemapId && (e.basemapId.value = r.basemapId), r.layerIds != null && (e.activeOverlayIds.value = [...r.layerIds]), r.applicationsVisible != null && (e.applicationsVisible.value = r.applicationsVisible), r.visibleStatuses && (e.visibleStatuses.value = new Set(r.visibleStatuses)), e.searchQuery.value = r.search, e.appliedSearch.value = r.search, e.advancedFilters.value = { ...r.advancedFilters }, s = c(), i = !1;
|
|
2207
|
+
}
|
|
2208
|
+
function u() {
|
|
2209
|
+
return l(), ni(n.query);
|
|
2210
|
+
}
|
|
2211
|
+
function d() {
|
|
2212
|
+
if (i) return;
|
|
2213
|
+
let t = ii({
|
|
2214
|
+
view: e.mapView.value,
|
|
2215
|
+
sel: e.sel.value,
|
|
2216
|
+
identifyPage: e.identifyPage.value,
|
|
2217
|
+
basemapId: e.basemapId.value,
|
|
2218
|
+
defaultBasemapId: e.defaultBasemapId.value,
|
|
2219
|
+
activeOverlayIds: e.activeOverlayIds.value,
|
|
2220
|
+
applicationsVisible: e.applicationsVisible.value,
|
|
2221
|
+
visibleStatuses: e.visibleStatuses.value,
|
|
2222
|
+
search: e.appliedSearch.value,
|
|
2223
|
+
advancedFilters: e.advancedFilters.value
|
|
2224
|
+
}), o = JSON.stringify(t);
|
|
2225
|
+
if (o === s) return;
|
|
2226
|
+
if (ai(n.query, t)) {
|
|
2227
|
+
s = o;
|
|
2228
|
+
return;
|
|
2229
|
+
}
|
|
2230
|
+
s = o, a = !0;
|
|
2231
|
+
let c = {};
|
|
2232
|
+
for (let e of si) c[e] = t[e];
|
|
2233
|
+
r.replace({ query: c });
|
|
2234
|
+
}
|
|
2235
|
+
function f() {
|
|
2236
|
+
i || d();
|
|
2237
|
+
}
|
|
2238
|
+
function p() {
|
|
2239
|
+
i || (clearTimeout(o), o = setTimeout(d, oi));
|
|
2240
|
+
}
|
|
2241
|
+
function m() {
|
|
2242
|
+
U(() => n.query, () => {
|
|
2243
|
+
if (a) {
|
|
2244
|
+
a = !1;
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
l();
|
|
2248
|
+
}, { deep: !0 }), U([
|
|
2249
|
+
e.sel,
|
|
2250
|
+
e.identifyPage,
|
|
2251
|
+
e.basemapId,
|
|
2252
|
+
e.defaultBasemapId,
|
|
2253
|
+
e.activeOverlayIds,
|
|
2254
|
+
e.applicationsVisible,
|
|
2255
|
+
e.visibleStatuses,
|
|
2256
|
+
e.appliedSearch,
|
|
2257
|
+
e.advancedFilters
|
|
2258
|
+
], () => f(), { deep: !0 }), U(e.mapView, () => p(), { deep: !0 });
|
|
2259
|
+
}
|
|
2260
|
+
function h() {
|
|
2261
|
+
clearTimeout(o);
|
|
2262
|
+
}
|
|
2263
|
+
return {
|
|
2264
|
+
readInitialRouteState: u,
|
|
2265
|
+
bindMapRouteSync: m,
|
|
2266
|
+
syncRouteNow: d,
|
|
2267
|
+
clearViewDebounce: h
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
function li(e, t) {
|
|
2271
|
+
return e.find((e) => e.app_id === t) ?? null;
|
|
2272
|
+
}
|
|
2273
|
+
//#endregion
|
|
2274
|
+
//#region admin/src/pages/map/index.vue?vue&type=script&setup=true&lang.ts
|
|
2275
|
+
var ui = 350, di = /*@__PURE__*/ F({
|
|
2276
|
+
__name: "index",
|
|
2277
|
+
setup(e, { expose: t }) {
|
|
2278
|
+
t();
|
|
2279
|
+
let n = de("mapViewRef"), r = z(null), i = z(""), a = z(""), c = z([]), l = z(!1), p = z(!1), m = z(""), g = z({}), _ = O(() => ({ ...g.value })), v, y, b = 0, x = z(!0), ee = z(100), S = z(o), te = z(f), ne = z(null), re = z([]), C = z([]), ae = z({}), w = z({}), { zoom: oe } = Re(), T = z(oe.value), E = z(null), D = z(null), k = /* @__PURE__ */ new Map(), A = O(() => te.value[0]?.id ?? o), j = O(() => te.value.find((e) => e.id === S.value) ?? te.value[0] ?? f[0]);
|
|
2280
|
+
function M(e) {
|
|
2281
|
+
if (e.basemapId && te.value.some((t) => t.id === e.basemapId) && (S.value = e.basemapId), e.layerIds != null) {
|
|
2282
|
+
C.value = e.layerIds.filter((e) => {
|
|
2283
|
+
let t = re.value.find((t) => t.id === e);
|
|
2284
|
+
if (!t || !s(t)) return !1;
|
|
2285
|
+
let n = d(t);
|
|
2286
|
+
return n == null || T.value >= n;
|
|
2287
|
+
}), w.value = {};
|
|
2288
|
+
for (let e of C.value) F(e, "loading");
|
|
2289
|
+
}
|
|
2290
|
+
e.applicationsVisible != null && (x.value = e.applicationsVisible);
|
|
2291
|
+
}
|
|
2292
|
+
async function N() {
|
|
2293
|
+
let e = await ie("map");
|
|
2294
|
+
te.value = e.baseLayers, S.value = e.baseLayers[0]?.id ?? e.defaultBaseId, ne.value = e.overlays.find((e) => e.kind === "applications") ?? null, re.value = e.overlays.filter((e) => e.kind === "raster" || e.kind === "vector"), C.value = re.value.filter((e) => {
|
|
2295
|
+
if (!e.defaultVisible || !s(e)) return !1;
|
|
2296
|
+
let t = d(e);
|
|
2297
|
+
return t == null || T.value >= t;
|
|
2298
|
+
}).map((e) => e.id), ae.value = Object.fromEntries(re.value.map((e) => [e.id, Math.round(u(e) * 100)])), w.value = {};
|
|
2299
|
+
for (let e of C.value) F(e, "loading");
|
|
2300
|
+
ne.value && (x.value = ne.value.defaultVisible, ee.value = Math.round(ne.value.opacity * 100));
|
|
2301
|
+
}
|
|
2302
|
+
function P(e) {
|
|
2303
|
+
let t = k.get(e);
|
|
2304
|
+
t && (clearTimeout(t), k.delete(e));
|
|
2305
|
+
}
|
|
2306
|
+
function F(e, t) {
|
|
2307
|
+
P(e), w.value = {
|
|
2308
|
+
...w.value,
|
|
2309
|
+
[e]: t
|
|
2310
|
+
}, t === "loading" && k.set(e, setTimeout(() => {
|
|
2311
|
+
w.value[e] === "loading" && (w.value = {
|
|
2312
|
+
...w.value,
|
|
2313
|
+
[e]: "error"
|
|
2314
|
+
}), k.delete(e);
|
|
2315
|
+
}, 1e4));
|
|
2316
|
+
}
|
|
2317
|
+
function I(e) {
|
|
2318
|
+
let t = re.value.find((t) => t.id === e);
|
|
2319
|
+
if (!t || !s(t)) return !1;
|
|
2320
|
+
let n = d(t);
|
|
2321
|
+
return n == null || T.value >= n;
|
|
2322
|
+
}
|
|
2323
|
+
function L(e) {
|
|
2324
|
+
let t = C.value, r = !t.includes(e);
|
|
2325
|
+
if (!r || I(e)) {
|
|
2326
|
+
if (C.value = r ? [...t, e] : t.filter((t) => t !== e), !r) {
|
|
2327
|
+
P(e);
|
|
2328
|
+
let t = { ...w.value };
|
|
2329
|
+
delete t[e], w.value = t;
|
|
2330
|
+
return;
|
|
2331
|
+
}
|
|
2332
|
+
n.value?.overlaySourceReady(e) ? F(e, "ready") : F(e, "loading");
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
function R(e, t) {
|
|
2336
|
+
ae.value = {
|
|
2337
|
+
...ae.value,
|
|
2338
|
+
[e]: t
|
|
2339
|
+
};
|
|
2340
|
+
}
|
|
2341
|
+
function B(e) {
|
|
2342
|
+
if (!C.value.includes(e)) {
|
|
2343
|
+
if (!I(e)) return;
|
|
2344
|
+
C.value = [...C.value, e];
|
|
2345
|
+
}
|
|
2346
|
+
F(e, "loading"), n.value?.reloadOverlay(e);
|
|
2347
|
+
}
|
|
2348
|
+
function ue(e) {
|
|
2349
|
+
n.value?.zoomToOverlay(e);
|
|
2350
|
+
}
|
|
2351
|
+
let V = z(Object.fromEntries(h.map((e) => [e, 0]))), H = z(new Set(Nt.map((e) => e.key))), fe = z(null), W = z(null), G = z(null), K = z(null), q = z([]), J = z(0), Y = z(1), X = z(null), Z = z(!1), pe = z(""), Q = 0, me = z({
|
|
2352
|
+
width: 0,
|
|
2353
|
+
height: 0
|
|
2354
|
+
}), he = O(() => h.reduce((e, t) => e + (V.value[t] ?? 0), 0)), ge = O(() => x.value ? [...H.value].reduce((e, t) => e + (V.value[t] ?? 0), 0) : 0);
|
|
2355
|
+
function _e() {
|
|
2356
|
+
H.value = new Set(Nt.map((e) => e.key));
|
|
2357
|
+
}
|
|
2358
|
+
function ve() {
|
|
2359
|
+
H.value = /* @__PURE__ */ new Set();
|
|
2360
|
+
}
|
|
2361
|
+
function ye(e) {
|
|
2362
|
+
let t = new Set(H.value);
|
|
2363
|
+
t.has(e) ? t.delete(e) : t.add(e), H.value = t;
|
|
2364
|
+
}
|
|
2365
|
+
let be = O(() => Math.max(1, Math.ceil(J.value / 10)));
|
|
2366
|
+
function xe(e, t) {
|
|
2367
|
+
fe.value = e, W.value = t;
|
|
2368
|
+
}
|
|
2369
|
+
function Se() {
|
|
2370
|
+
Q += 1, K.value = null, q.value = [], J.value = 0, Y.value = 1, G.value = null, X.value = null, Z.value = !1, pe.value = "";
|
|
2371
|
+
}
|
|
2372
|
+
function Ce(e) {
|
|
2373
|
+
X.value = e, G.value = e.app_id;
|
|
2374
|
+
}
|
|
2375
|
+
async function we(e) {
|
|
2376
|
+
if (!e.sel) return;
|
|
2377
|
+
let t = e.view ? {
|
|
2378
|
+
lng: e.view.lng,
|
|
2379
|
+
lat: e.view.lat
|
|
2380
|
+
} : E.value ? {
|
|
2381
|
+
lng: E.value.lng,
|
|
2382
|
+
lat: E.value.lat
|
|
2383
|
+
} : null;
|
|
2384
|
+
if (t) {
|
|
2385
|
+
await $(t, e.identifyPage);
|
|
2386
|
+
let n = li(q.value, e.sel);
|
|
2387
|
+
if (n) {
|
|
2388
|
+
Ce(n);
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
pe.value = "", Z.value = !0;
|
|
2393
|
+
try {
|
|
2394
|
+
let n = await ke(e.sel), r = t ?? E.value ?? {
|
|
2395
|
+
lng: 24.0297,
|
|
2396
|
+
lat: 49.8397
|
|
2397
|
+
};
|
|
2398
|
+
K.value = r, q.value = [n], J.value = 1, Y.value = 1, Ce(n);
|
|
2399
|
+
} catch (e) {
|
|
2400
|
+
pe.value = e instanceof Error ? e.message : "Не вдалося завантажити звернення", t && (K.value = t);
|
|
2401
|
+
} finally {
|
|
2402
|
+
Z.value = !1;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
function Te(e) {
|
|
2406
|
+
E.value = e, T.value = e.zoom;
|
|
2407
|
+
}
|
|
2408
|
+
let { readInitialRouteState: Ee, bindMapRouteSync: De, syncRouteNow: Me, clearViewDebounce: Ne } = ci({
|
|
2409
|
+
mapView: E,
|
|
2410
|
+
sel: G,
|
|
2411
|
+
identifyPage: Y,
|
|
2412
|
+
basemapId: S,
|
|
2413
|
+
defaultBasemapId: A,
|
|
2414
|
+
activeOverlayIds: C,
|
|
2415
|
+
applicationsVisible: x,
|
|
2416
|
+
visibleStatuses: H,
|
|
2417
|
+
searchQuery: i,
|
|
2418
|
+
appliedSearch: a,
|
|
2419
|
+
advancedFilters: g
|
|
2420
|
+
}, { onViewFromRoute: (e) => {
|
|
2421
|
+
n.value?.setView(e, !1);
|
|
2422
|
+
} });
|
|
2423
|
+
async function $(e, t) {
|
|
2424
|
+
let n = ++Q, r = K.value?.lng === e.lng && K.value?.lat === e.lat;
|
|
2425
|
+
if (K.value = e, Y.value = t, X.value = null, G.value = null, pe.value = "", Z.value = !0, r || (q.value = [], J.value = 0), !H.value.size) {
|
|
2426
|
+
q.value = [], J.value = 0, Z.value = !1;
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
try {
|
|
2430
|
+
let r = await Ae(e.lng, e.lat, t, H.value);
|
|
2431
|
+
if (n !== Q) return;
|
|
2432
|
+
q.value = r.data, J.value = r.total, Y.value = r.page, r.total === 1 && r.data[0] && Ce(r.data[0]);
|
|
2433
|
+
} catch (e) {
|
|
2434
|
+
if (n !== Q) return;
|
|
2435
|
+
q.value = [], J.value = 0, pe.value = e instanceof Error ? e.message : "Не вдалося завантажити звернення";
|
|
2436
|
+
} finally {
|
|
2437
|
+
n === Q && (Z.value = !1);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
function Pe(e) {
|
|
2441
|
+
if (!e) {
|
|
2442
|
+
Se();
|
|
2443
|
+
return;
|
|
2444
|
+
}
|
|
2445
|
+
$(e, 1);
|
|
2446
|
+
}
|
|
2447
|
+
function Fe(e) {
|
|
2448
|
+
let t = K.value;
|
|
2449
|
+
!t || e < 1 || e > be.value || $(t, e);
|
|
2450
|
+
}
|
|
2451
|
+
function Ie() {
|
|
2452
|
+
X.value = null, G.value = null;
|
|
2453
|
+
}
|
|
2454
|
+
function Le() {
|
|
2455
|
+
r.value && (me.value = {
|
|
2456
|
+
width: r.value.clientWidth,
|
|
2457
|
+
height: r.value.clientHeight
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2460
|
+
U(() => Array.from(H.value).sort().join(","), () => {
|
|
2461
|
+
let e = K.value;
|
|
2462
|
+
e && (q.value = q.value.filter((e) => H.value.has(e.status ?? "")), $(e, 1));
|
|
2463
|
+
});
|
|
2464
|
+
function ze() {
|
|
2465
|
+
c.value = [], l.value = !1, p.value = !1, m.value = "";
|
|
2466
|
+
}
|
|
2467
|
+
function Be(e) {
|
|
2468
|
+
Se(), G.value = e.id, n.value?.fitApplicationGeometry(e.geometry);
|
|
2469
|
+
}
|
|
2470
|
+
async function Ve(e) {
|
|
2471
|
+
let t = e.trim();
|
|
2472
|
+
if (y?.abort(), !t) {
|
|
2473
|
+
ze();
|
|
2474
|
+
return;
|
|
2475
|
+
}
|
|
2476
|
+
let n = ++b, r = new AbortController();
|
|
2477
|
+
y = r, l.value = !0, p.value = !1, m.value = "", c.value = [];
|
|
2478
|
+
try {
|
|
2479
|
+
let e = await je(t, { signal: r.signal });
|
|
2480
|
+
if (n !== b) return;
|
|
2481
|
+
c.value = e.data, p.value = e.total === 0, e.total === 1 && e.data[0] && Be(e.data[0]);
|
|
2482
|
+
} catch (e) {
|
|
2483
|
+
if (r.signal.aborted || n !== b) return;
|
|
2484
|
+
c.value = [], p.value = !1, m.value = e instanceof Error ? e.message : "Не вдалося виконати пошук";
|
|
2485
|
+
} finally {
|
|
2486
|
+
n === b && (l.value = !1);
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
U(i, (e) => {
|
|
2490
|
+
clearTimeout(v);
|
|
2491
|
+
let t = e.trim();
|
|
2492
|
+
if (!t) {
|
|
2493
|
+
a.value = "", b += 1, y?.abort(), ze();
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
v = setTimeout(() => {
|
|
2497
|
+
a.value = t, Ve(e);
|
|
2498
|
+
}, ui);
|
|
2499
|
+
});
|
|
2500
|
+
let He;
|
|
2501
|
+
ce(async () => {
|
|
2502
|
+
Le(), r.value && (He = new ResizeObserver(Le), He.observe(r.value));
|
|
2503
|
+
let e = Ee();
|
|
2504
|
+
D.value = e.view, e.view && (E.value = e.view), e.search && Ve(e.search), await N(), M(e), await se(), e.view && n.value?.setView(e.view, !1), await we(e), De(), Me(), Oe().then((e) => {
|
|
2505
|
+
V.value = e;
|
|
2506
|
+
}).catch((e) => {
|
|
2507
|
+
console.error(e);
|
|
2508
|
+
});
|
|
2509
|
+
}), le(() => {
|
|
2510
|
+
He?.disconnect(), clearTimeout(v), Ne(), y?.abort();
|
|
2511
|
+
for (let e of k.values()) clearTimeout(e);
|
|
2512
|
+
k.clear();
|
|
2513
|
+
});
|
|
2514
|
+
let Ue = {
|
|
2515
|
+
mapViewRef: n,
|
|
2516
|
+
containerRef: r,
|
|
2517
|
+
SEARCH_DEBOUNCE_MS: ui,
|
|
2518
|
+
searchQuery: i,
|
|
2519
|
+
appliedSearch: a,
|
|
2520
|
+
searchResults: c,
|
|
2521
|
+
searchLoading: l,
|
|
2522
|
+
searchEmpty: p,
|
|
2523
|
+
searchError: m,
|
|
2524
|
+
advancedFilters: g,
|
|
2525
|
+
mapFilters: _,
|
|
2526
|
+
get searchTimer() {
|
|
2527
|
+
return v;
|
|
2528
|
+
},
|
|
2529
|
+
set searchTimer(e) {
|
|
2530
|
+
v = e;
|
|
2531
|
+
},
|
|
2532
|
+
get searchAbort() {
|
|
2533
|
+
return y;
|
|
2534
|
+
},
|
|
2535
|
+
set searchAbort(e) {
|
|
2536
|
+
y = e;
|
|
2537
|
+
},
|
|
2538
|
+
get searchRequestId() {
|
|
2539
|
+
return b;
|
|
2540
|
+
},
|
|
2541
|
+
set searchRequestId(e) {
|
|
2542
|
+
b = e;
|
|
2543
|
+
},
|
|
2544
|
+
applicationsVisible: x,
|
|
2545
|
+
applicationsOpacity: ee,
|
|
2546
|
+
basemapId: S,
|
|
2547
|
+
baseLayers: te,
|
|
2548
|
+
applicationsLayer: ne,
|
|
2549
|
+
overlayLayers: re,
|
|
2550
|
+
activeOverlayIds: C,
|
|
2551
|
+
overlayOpacities: ae,
|
|
2552
|
+
overlayLoad: w,
|
|
2553
|
+
settingsZoom: oe,
|
|
2554
|
+
mapZoom: T,
|
|
2555
|
+
mapView: E,
|
|
2556
|
+
mapInitialView: D,
|
|
2557
|
+
overlayLoadTimers: k,
|
|
2558
|
+
defaultBasemapId: A,
|
|
2559
|
+
activeBasemap: j,
|
|
2560
|
+
applyLayerStateFromRoute: M,
|
|
2561
|
+
loadLayerSettings: N,
|
|
2562
|
+
clearOverlayLoadTimer: P,
|
|
2563
|
+
setOverlayLoad: F,
|
|
2564
|
+
overlayCanTurnOn: I,
|
|
2565
|
+
toggleOverlay: L,
|
|
2566
|
+
setOverlayOpacity: R,
|
|
2567
|
+
retryOverlay: B,
|
|
2568
|
+
zoomToOverlay: ue,
|
|
2569
|
+
statusCounts: V,
|
|
2570
|
+
visibleStatuses: H,
|
|
2571
|
+
hovered: fe,
|
|
2572
|
+
hoverPosition: W,
|
|
2573
|
+
selectedId: G,
|
|
2574
|
+
identifyPoint: K,
|
|
2575
|
+
identifyRows: q,
|
|
2576
|
+
identifyTotal: J,
|
|
2577
|
+
identifyPage: Y,
|
|
2578
|
+
selectedApplication: X,
|
|
2579
|
+
selectedLoading: Z,
|
|
2580
|
+
selectedError: pe,
|
|
2581
|
+
get selectRequestId() {
|
|
2582
|
+
return Q;
|
|
2583
|
+
},
|
|
2584
|
+
set selectRequestId(e) {
|
|
2585
|
+
Q = e;
|
|
2586
|
+
},
|
|
2587
|
+
containerSize: me,
|
|
2588
|
+
totalCount: he,
|
|
2589
|
+
visibleCount: ge,
|
|
2590
|
+
selectAllStatuses: _e,
|
|
2591
|
+
clearStatuses: ve,
|
|
2592
|
+
toggleStatus: ye,
|
|
2593
|
+
identifyPageCount: be,
|
|
2594
|
+
handlePointHover: xe,
|
|
2595
|
+
closeSelection: Se,
|
|
2596
|
+
openIdentifiedApplication: Ce,
|
|
2597
|
+
restoreSelectionFromRoute: we,
|
|
2598
|
+
handleViewChange: Te,
|
|
2599
|
+
readInitialRouteState: Ee,
|
|
2600
|
+
bindMapRouteSync: De,
|
|
2601
|
+
syncRouteNow: Me,
|
|
2602
|
+
clearViewDebounce: Ne,
|
|
2603
|
+
loadIdentifiedApplications: $,
|
|
2604
|
+
handlePointSelect: Pe,
|
|
2605
|
+
showIdentifyPage: Fe,
|
|
2606
|
+
backToIdentifyList: Ie,
|
|
2607
|
+
updateContainerSize: Le,
|
|
2608
|
+
clearSearchState: ze,
|
|
2609
|
+
selectSearchResult: Be,
|
|
2610
|
+
runMapSearch: Ve,
|
|
2611
|
+
get resizeObserver() {
|
|
2612
|
+
return He;
|
|
2613
|
+
},
|
|
2614
|
+
set resizeObserver(e) {
|
|
2615
|
+
He = e;
|
|
2616
|
+
},
|
|
2617
|
+
MapView: Ze,
|
|
2618
|
+
MapLayersPanel: Zn,
|
|
2619
|
+
MapControls: ir,
|
|
2620
|
+
MapPointTooltip: wr,
|
|
2621
|
+
MapApplicationPanel: Zr
|
|
2622
|
+
};
|
|
2623
|
+
return Object.defineProperty(Ue, "__isScriptSetup", {
|
|
2624
|
+
enumerable: !1,
|
|
2625
|
+
value: !0
|
|
2626
|
+
}), Ue;
|
|
2627
|
+
}
|
|
2628
|
+
}), fi = { class: "flex h-full w-full min-h-0 flex-1 flex-col lg:h-full" }, pi = {
|
|
2629
|
+
ref: "containerRef",
|
|
2630
|
+
class: "relative min-h-0 flex-1 overflow-hidden bg-slate-100"
|
|
2631
|
+
};
|
|
2632
|
+
function mi(e, t, n, r, i, a) {
|
|
2633
|
+
return R(), j("div", fi, [M("div", pi, [
|
|
2634
|
+
P(r.MapView, {
|
|
2635
|
+
ref: "mapViewRef",
|
|
2636
|
+
basemap: r.activeBasemap,
|
|
2637
|
+
overlays: r.overlayLayers,
|
|
2638
|
+
"active-overlay-ids": r.activeOverlayIds,
|
|
2639
|
+
"overlay-opacities": r.overlayOpacities,
|
|
2640
|
+
"visible-statuses": r.visibleStatuses,
|
|
2641
|
+
"selected-id": r.selectedId,
|
|
2642
|
+
"applications-visible": r.applicationsVisible,
|
|
2643
|
+
"applications-opacity": r.applicationsOpacity,
|
|
2644
|
+
filters: r.mapFilters,
|
|
2645
|
+
"initial-view": r.mapInitialView,
|
|
2646
|
+
onPointHover: r.handlePointHover,
|
|
2647
|
+
onPointSelect: r.handlePointSelect,
|
|
2648
|
+
onZoom: t[0] ||= (e) => r.mapZoom = e,
|
|
2649
|
+
onViewChange: r.handleViewChange,
|
|
2650
|
+
onOverlayLoad: r.setOverlayLoad
|
|
2651
|
+
}, null, 8, [
|
|
2652
|
+
"basemap",
|
|
2653
|
+
"overlays",
|
|
2654
|
+
"active-overlay-ids",
|
|
2655
|
+
"overlay-opacities",
|
|
2656
|
+
"visible-statuses",
|
|
2657
|
+
"selected-id",
|
|
2658
|
+
"applications-visible",
|
|
2659
|
+
"applications-opacity",
|
|
2660
|
+
"filters",
|
|
2661
|
+
"initial-view"
|
|
2662
|
+
]),
|
|
2663
|
+
P(r.MapLayersPanel, {
|
|
2664
|
+
"search-query": r.searchQuery,
|
|
2665
|
+
"onUpdate:searchQuery": t[1] ||= (e) => r.searchQuery = e,
|
|
2666
|
+
"applications-visible": r.applicationsVisible,
|
|
2667
|
+
"onUpdate:applicationsVisible": t[2] ||= (e) => r.applicationsVisible = e,
|
|
2668
|
+
"applications-opacity": r.applicationsOpacity,
|
|
2669
|
+
"onUpdate:applicationsOpacity": t[3] ||= (e) => r.applicationsOpacity = e,
|
|
2670
|
+
filters: r.advancedFilters,
|
|
2671
|
+
"onUpdate:filters": t[4] ||= (e) => r.advancedFilters = e,
|
|
2672
|
+
"visible-statuses": r.visibleStatuses,
|
|
2673
|
+
"status-counts": r.statusCounts,
|
|
2674
|
+
"total-count": r.totalCount,
|
|
2675
|
+
"basemap-id": r.basemapId,
|
|
2676
|
+
"base-layers": r.baseLayers,
|
|
2677
|
+
overlays: r.overlayLayers,
|
|
2678
|
+
"active-overlay-ids": r.activeOverlayIds,
|
|
2679
|
+
"overlay-opacities": r.overlayOpacities,
|
|
2680
|
+
"overlay-load": r.overlayLoad,
|
|
2681
|
+
"map-zoom": r.mapZoom,
|
|
2682
|
+
"applications-name": r.applicationsLayer?.label,
|
|
2683
|
+
onToggleOverlay: r.toggleOverlay,
|
|
2684
|
+
onOverlayOpacity: r.setOverlayOpacity,
|
|
2685
|
+
onZoomToOverlay: r.zoomToOverlay,
|
|
2686
|
+
onRetryOverlay: r.retryOverlay,
|
|
2687
|
+
onToggleStatus: r.toggleStatus,
|
|
2688
|
+
onSelectAllStatuses: r.selectAllStatuses,
|
|
2689
|
+
onClearStatuses: r.clearStatuses,
|
|
2690
|
+
onBasemapChange: t[5] ||= (e) => r.basemapId = e,
|
|
2691
|
+
"search-loading": r.searchLoading,
|
|
2692
|
+
"search-results": r.searchResults,
|
|
2693
|
+
"search-empty": r.searchEmpty,
|
|
2694
|
+
"search-error": r.searchError,
|
|
2695
|
+
onSelectSearchResult: r.selectSearchResult
|
|
2696
|
+
}, null, 8, [
|
|
2697
|
+
"search-query",
|
|
2698
|
+
"applications-visible",
|
|
2699
|
+
"applications-opacity",
|
|
2700
|
+
"filters",
|
|
2701
|
+
"visible-statuses",
|
|
2702
|
+
"status-counts",
|
|
2703
|
+
"total-count",
|
|
2704
|
+
"basemap-id",
|
|
2705
|
+
"base-layers",
|
|
2706
|
+
"overlays",
|
|
2707
|
+
"active-overlay-ids",
|
|
2708
|
+
"overlay-opacities",
|
|
2709
|
+
"overlay-load",
|
|
2710
|
+
"map-zoom",
|
|
2711
|
+
"applications-name",
|
|
2712
|
+
"search-loading",
|
|
2713
|
+
"search-results",
|
|
2714
|
+
"search-empty",
|
|
2715
|
+
"search-error"
|
|
2716
|
+
]),
|
|
2717
|
+
P(r.MapControls, {
|
|
2718
|
+
"visible-count": r.visibleCount,
|
|
2719
|
+
onZoomIn: t[6] ||= (e) => r.mapViewRef?.zoomIn(),
|
|
2720
|
+
onZoomOut: t[7] ||= (e) => r.mapViewRef?.zoomOut(),
|
|
2721
|
+
onResetView: t[8] ||= (e) => r.mapViewRef?.resetView()
|
|
2722
|
+
}, null, 8, ["visible-count"]),
|
|
2723
|
+
r.identifyPoint ? (R(), k(r.MapApplicationPanel, {
|
|
2724
|
+
key: 0,
|
|
2725
|
+
rows: r.identifyRows,
|
|
2726
|
+
total: r.identifyTotal,
|
|
2727
|
+
page: r.identifyPage,
|
|
2728
|
+
"page-count": r.identifyPageCount,
|
|
2729
|
+
application: r.selectedApplication,
|
|
2730
|
+
loading: r.selectedLoading,
|
|
2731
|
+
error: r.selectedError,
|
|
2732
|
+
onClose: r.closeSelection,
|
|
2733
|
+
onBack: r.backToIdentifyList,
|
|
2734
|
+
onSelect: r.openIdentifiedApplication,
|
|
2735
|
+
onPage: r.showIdentifyPage
|
|
2736
|
+
}, null, 8, [
|
|
2737
|
+
"rows",
|
|
2738
|
+
"total",
|
|
2739
|
+
"page",
|
|
2740
|
+
"page-count",
|
|
2741
|
+
"application",
|
|
2742
|
+
"loading",
|
|
2743
|
+
"error"
|
|
2744
|
+
])) : A("", !0),
|
|
2745
|
+
r.hovered?.points.length && r.hoverPosition ? (R(), k(r.MapPointTooltip, {
|
|
2746
|
+
key: 1,
|
|
2747
|
+
points: r.hovered.points,
|
|
2748
|
+
total: r.hovered.total,
|
|
2749
|
+
position: r.hoverPosition,
|
|
2750
|
+
"container-width": r.containerSize.width,
|
|
2751
|
+
"container-height": r.containerSize.height
|
|
2752
|
+
}, null, 8, [
|
|
2753
|
+
"points",
|
|
2754
|
+
"total",
|
|
2755
|
+
"position",
|
|
2756
|
+
"container-width",
|
|
2757
|
+
"container-height"
|
|
2758
|
+
])) : A("", !0)
|
|
2759
|
+
], 512)]);
|
|
2760
|
+
}
|
|
2761
|
+
var hi = /*#__PURE__*/ e(di, [["render", mi], ["__file", "D:/Softpro/surveyor/admin/src/pages/map/index.vue"]]);
|
|
2762
|
+
//#endregion
|
|
2763
|
+
export { hi as default };
|