@opengis/surveyor 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ApplicationHistorySection-PwToBfej.js → ApplicationHistorySection-Cwq0-Frd.js} +252 -247
- package/dist/chunks/{card-B_SfARf7.js → card-9r6Si3cz.js} +315 -315
- package/dist/chunks/{card-BDqeihxR.js → card-rXkTqZqA.js} +72 -72
- package/dist/chunks/create-BAsyL76t.js +1306 -0
- package/dist/chunks/{map-dvA3ayAK.js → map-UTBxwT7-.js} +1 -1
- package/dist/chunks/{mapLayersApi-CWoQ2be-.js → mapLayersApi-CBLcbADa.js} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/dist/chunks/create-BPWuoys6.js +0 -1047
|
@@ -0,0 +1,1306 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { a as t, t as n } from "./surveyor-CDkI2Dcp.js";
|
|
3
|
+
import { s as r, t as i } from "./organizations-DbVDoURw.js";
|
|
4
|
+
import { t as a } from "./AppIcon-CO70tpMX.js";
|
|
5
|
+
import { t as o } from "./SurveyorTeleport-CnSF0Ptl.js";
|
|
6
|
+
import { c as s, t as c, u as l } from "./appealMapLayers-CQMK3rrz.js";
|
|
7
|
+
import { a as u, d, i as f, l as p, r as m, s as h, t as g, u as _ } from "./mapLayersApi-CBLcbADa.js";
|
|
8
|
+
import { i as v, n as ee } from "./geometry-DyhIVRcw.js";
|
|
9
|
+
import { t as y } from "./work_types-Hwme-FEX.js";
|
|
10
|
+
import { t as b } from "./MapLayerMenu-AUeTqgEp.js";
|
|
11
|
+
import { t as x } from "./FormFilePicker-DxPQlxgy.js";
|
|
12
|
+
import { i as te, r as S, s as C } from "./applications-CLhv5l_j.js";
|
|
13
|
+
import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createTextVNode as A, createVNode as j, defineComponent as M, nextTick as N, normalizeClass as P, normalizeStyle as F, onBeforeUnmount as I, onMounted as ne, onUnmounted as re, openBlock as L, ref as R, renderList as ie, shallowRef as ae, toDisplayString as z, vModelText as B, watch as V, withCtx as H, withDirectives as U, withModifiers as W } from "vue";
|
|
14
|
+
import { RouterLink as G, useRouter as oe } from "vue-router";
|
|
15
|
+
//#region cabinet/src/pages/requests/components/FormSearchSelect.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
+
var K = /*@__PURE__*/ M({
|
|
17
|
+
__name: "FormSearchSelect",
|
|
18
|
+
props: {
|
|
19
|
+
label: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: !0
|
|
22
|
+
},
|
|
23
|
+
options: {
|
|
24
|
+
type: Array,
|
|
25
|
+
required: !0
|
|
26
|
+
},
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: !0
|
|
30
|
+
},
|
|
31
|
+
required: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: !1,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
placeholder: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: !1,
|
|
39
|
+
default: "Обрати"
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: !1,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
openAbove: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: !1,
|
|
49
|
+
default: !1
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
emits: ["update:modelValue"],
|
|
53
|
+
setup(e, { expose: t, emit: n }) {
|
|
54
|
+
t();
|
|
55
|
+
let r = e, i = n, s = R(!1), c = R(""), l = R(null), u = R(null), d = R(null), f = R(null), p = T(() => r.options.filter((e) => e.toLowerCase().includes(c.value.trim().toLowerCase()))), m = T(() => f.value ? r.openAbove ? {
|
|
56
|
+
left: `${f.value.left}px`,
|
|
57
|
+
width: `${f.value.width}px`,
|
|
58
|
+
bottom: `${window.innerHeight - f.value.top + 4}px`
|
|
59
|
+
} : {
|
|
60
|
+
left: `${f.value.left}px`,
|
|
61
|
+
width: `${f.value.width}px`,
|
|
62
|
+
top: `${f.value.bottom + 4}px`
|
|
63
|
+
} : { visibility: "hidden" });
|
|
64
|
+
function h() {
|
|
65
|
+
f.value = l.value?.getBoundingClientRect() ?? null;
|
|
66
|
+
}
|
|
67
|
+
function g() {
|
|
68
|
+
window.addEventListener("scroll", h, !0), window.addEventListener("resize", h);
|
|
69
|
+
}
|
|
70
|
+
function _() {
|
|
71
|
+
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
72
|
+
}
|
|
73
|
+
function v() {
|
|
74
|
+
r.disabled || (s.value = !s.value);
|
|
75
|
+
}
|
|
76
|
+
function ee(e) {
|
|
77
|
+
i("update:modelValue", e), s.value = !1;
|
|
78
|
+
}
|
|
79
|
+
function y(e) {
|
|
80
|
+
let t = e.target;
|
|
81
|
+
l.value?.contains(t) || u.value?.contains(t) || (s.value = !1);
|
|
82
|
+
}
|
|
83
|
+
V(s, async (e) => {
|
|
84
|
+
_(), e && (c.value = "", h(), g(), await N(), d.value?.focus());
|
|
85
|
+
}), ne(() => document.addEventListener("mousedown", y)), I(() => {
|
|
86
|
+
document.removeEventListener("mousedown", y), _();
|
|
87
|
+
});
|
|
88
|
+
let b = {
|
|
89
|
+
props: r,
|
|
90
|
+
emit: i,
|
|
91
|
+
open: s,
|
|
92
|
+
query: c,
|
|
93
|
+
rootRef: l,
|
|
94
|
+
panelRef: u,
|
|
95
|
+
inputRef: d,
|
|
96
|
+
triggerRect: f,
|
|
97
|
+
filtered: p,
|
|
98
|
+
dropdownStyle: m,
|
|
99
|
+
refreshRect: h,
|
|
100
|
+
bindPositionListeners: g,
|
|
101
|
+
unbindPositionListeners: _,
|
|
102
|
+
toggle: v,
|
|
103
|
+
select: ee,
|
|
104
|
+
onDocumentClick: y,
|
|
105
|
+
AppIcon: a,
|
|
106
|
+
SurveyorTeleport: o
|
|
107
|
+
};
|
|
108
|
+
return Object.defineProperty(b, "__isScriptSetup", {
|
|
109
|
+
enumerable: !1,
|
|
110
|
+
value: !0
|
|
111
|
+
}), b;
|
|
112
|
+
}
|
|
113
|
+
}), se = { class: "mb-1.5 block text-xs font-medium text-gray-700" }, ce = {
|
|
114
|
+
key: 0,
|
|
115
|
+
class: "text-red-400"
|
|
116
|
+
}, le = {
|
|
117
|
+
ref: "rootRef",
|
|
118
|
+
class: "relative"
|
|
119
|
+
}, ue = ["disabled"], de = { class: "border-b border-gray-100 p-2" }, q = { class: "relative" }, fe = { class: "max-h-48 overflow-y-auto" }, pe = {
|
|
120
|
+
key: 0,
|
|
121
|
+
class: "px-3 py-3 text-center text-xs text-gray-400"
|
|
122
|
+
}, me = ["onClick"];
|
|
123
|
+
function J(e, t, n, r, i, a) {
|
|
124
|
+
return L(), O("div", null, [k("label", se, [A(z(n.label) + " ", 1), n.required ? (L(), O("span", ce, "*")) : D("", !0)]), k("div", le, [k("button", {
|
|
125
|
+
type: "button",
|
|
126
|
+
disabled: n.disabled,
|
|
127
|
+
class: P(["flex w-full items-center justify-between rounded-xl border px-3.5 py-2.5 text-left text-sm transition-all", n.disabled ? "cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400" : r.open ? "border-[#2663EB] bg-white text-gray-900 ring-2 ring-[#2663EB]/15" : "border-gray-200 bg-white text-gray-900 hover:border-gray-300"]),
|
|
128
|
+
onClick: r.toggle
|
|
129
|
+
}, [k("span", { class: P(n.modelValue ? "text-gray-900" : "text-gray-400") }, z(n.modelValue || n.placeholder), 3), j(r.AppIcon, {
|
|
130
|
+
name: "chevron-down",
|
|
131
|
+
class: P(["h-[15px] w-[15px] shrink-0 text-gray-400 transition-transform", r.open ? "rotate-180" : ""])
|
|
132
|
+
}, null, 8, ["class"])], 10, ue), j(r.SurveyorTeleport, null, {
|
|
133
|
+
default: H(() => [r.open ? (L(), O("div", {
|
|
134
|
+
key: 0,
|
|
135
|
+
ref: "panelRef",
|
|
136
|
+
class: "fixed z-[100] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-lg",
|
|
137
|
+
style: F(r.dropdownStyle),
|
|
138
|
+
onMousedown: t[1] ||= W(() => {}, ["stop"])
|
|
139
|
+
}, [k("div", de, [k("div", q, [j(r.AppIcon, {
|
|
140
|
+
name: "search",
|
|
141
|
+
class: "absolute left-2.5 top-1/2 h-[13px] w-[13px] -translate-y-1/2 text-gray-400"
|
|
142
|
+
}), U(k("input", {
|
|
143
|
+
ref: "inputRef",
|
|
144
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.query = e,
|
|
145
|
+
type: "text",
|
|
146
|
+
placeholder: "Пошук...",
|
|
147
|
+
class: "w-full rounded-lg border border-gray-200 py-1.5 pl-8 pr-3 text-xs outline-none focus:border-[#2663EB]"
|
|
148
|
+
}, null, 512), [[B, r.query]])])]), k("div", fe, [r.filtered.length === 0 ? (L(), O("p", pe, "Нічого не знайдено")) : D("", !0), (L(!0), O(w, null, ie(r.filtered, (e) => (L(), O("button", {
|
|
149
|
+
key: e,
|
|
150
|
+
type: "button",
|
|
151
|
+
class: P(["w-full px-3.5 py-2.5 text-left text-sm transition-colors hover:bg-gray-50", n.modelValue === e ? "bg-[#EFF4FE] font-medium text-[#2663EB]" : "text-gray-700"]),
|
|
152
|
+
onClick: (t) => r.select(e)
|
|
153
|
+
}, z(e), 11, me))), 128))])], 36)) : D("", !0)]),
|
|
154
|
+
_: 1
|
|
155
|
+
})], 512)]);
|
|
156
|
+
}
|
|
157
|
+
var he = /*#__PURE__*/ e(K, [["render", J], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/FormSearchSelect.vue"]]), ge = /*@__PURE__*/ M({
|
|
158
|
+
__name: "FormSuggestSelect",
|
|
159
|
+
props: {
|
|
160
|
+
label: {
|
|
161
|
+
type: String,
|
|
162
|
+
required: !0
|
|
163
|
+
},
|
|
164
|
+
modelValue: {
|
|
165
|
+
type: String,
|
|
166
|
+
required: !0
|
|
167
|
+
},
|
|
168
|
+
displayValue: {
|
|
169
|
+
type: String,
|
|
170
|
+
required: !0
|
|
171
|
+
},
|
|
172
|
+
required: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
required: !1,
|
|
175
|
+
default: !1
|
|
176
|
+
},
|
|
177
|
+
placeholder: {
|
|
178
|
+
type: String,
|
|
179
|
+
required: !1,
|
|
180
|
+
default: "Обрати"
|
|
181
|
+
},
|
|
182
|
+
disabled: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
required: !1,
|
|
185
|
+
default: !1
|
|
186
|
+
},
|
|
187
|
+
loading: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
required: !1,
|
|
190
|
+
default: !1
|
|
191
|
+
},
|
|
192
|
+
options: {
|
|
193
|
+
type: Array,
|
|
194
|
+
required: !0
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
emits: [
|
|
198
|
+
"update:modelValue",
|
|
199
|
+
"update:displayValue",
|
|
200
|
+
"search",
|
|
201
|
+
"select"
|
|
202
|
+
],
|
|
203
|
+
setup(e, { expose: t, emit: n }) {
|
|
204
|
+
t();
|
|
205
|
+
let r = e, i = n, s = R(!1), c = R(""), l = R(null), u = R(null), d = R(null), f = R(null), p = T(() => {
|
|
206
|
+
let e = c.value.trim().toLowerCase();
|
|
207
|
+
return e ? r.options.filter((t) => t.text.toLowerCase().includes(e)) : r.options;
|
|
208
|
+
}), m = T(() => f.value ? {
|
|
209
|
+
left: `${f.value.left}px`,
|
|
210
|
+
width: `${f.value.width}px`,
|
|
211
|
+
top: `${f.value.bottom + 4}px`
|
|
212
|
+
} : { visibility: "hidden" });
|
|
213
|
+
function h() {
|
|
214
|
+
f.value = l.value?.getBoundingClientRect() ?? null;
|
|
215
|
+
}
|
|
216
|
+
function g() {
|
|
217
|
+
window.addEventListener("scroll", h, !0), window.addEventListener("resize", h);
|
|
218
|
+
}
|
|
219
|
+
function _() {
|
|
220
|
+
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
221
|
+
}
|
|
222
|
+
function v() {
|
|
223
|
+
r.disabled || (s.value = !s.value);
|
|
224
|
+
}
|
|
225
|
+
function ee(e) {
|
|
226
|
+
i("update:modelValue", e.id), i("update:displayValue", e.text), i("select", e), s.value = !1;
|
|
227
|
+
}
|
|
228
|
+
function y(e) {
|
|
229
|
+
let t = e.target;
|
|
230
|
+
l.value?.contains(t) || u.value?.contains(t) || (s.value = !1);
|
|
231
|
+
}
|
|
232
|
+
let b;
|
|
233
|
+
V(c, (e) => {
|
|
234
|
+
s.value && (clearTimeout(b), b = setTimeout(() => i("search", e.trim()), 280));
|
|
235
|
+
}), V(s, async (e) => {
|
|
236
|
+
_(), e && (c.value = "", h(), g(), i("search", ""), await N(), d.value?.focus());
|
|
237
|
+
}), ne(() => document.addEventListener("mousedown", y)), I(() => {
|
|
238
|
+
document.removeEventListener("mousedown", y), _(), clearTimeout(b);
|
|
239
|
+
});
|
|
240
|
+
let x = {
|
|
241
|
+
props: r,
|
|
242
|
+
emit: i,
|
|
243
|
+
open: s,
|
|
244
|
+
query: c,
|
|
245
|
+
rootRef: l,
|
|
246
|
+
panelRef: u,
|
|
247
|
+
inputRef: d,
|
|
248
|
+
triggerRect: f,
|
|
249
|
+
filtered: p,
|
|
250
|
+
dropdownStyle: m,
|
|
251
|
+
refreshRect: h,
|
|
252
|
+
bindPositionListeners: g,
|
|
253
|
+
unbindPositionListeners: _,
|
|
254
|
+
toggle: v,
|
|
255
|
+
select: ee,
|
|
256
|
+
onDocumentClick: y,
|
|
257
|
+
get searchTimer() {
|
|
258
|
+
return b;
|
|
259
|
+
},
|
|
260
|
+
set searchTimer(e) {
|
|
261
|
+
b = e;
|
|
262
|
+
},
|
|
263
|
+
AppIcon: a,
|
|
264
|
+
SurveyorTeleport: o
|
|
265
|
+
};
|
|
266
|
+
return Object.defineProperty(x, "__isScriptSetup", {
|
|
267
|
+
enumerable: !1,
|
|
268
|
+
value: !0
|
|
269
|
+
}), x;
|
|
270
|
+
}
|
|
271
|
+
}), _e = { class: "mb-1.5 block text-xs font-medium text-gray-700" }, ve = {
|
|
272
|
+
key: 0,
|
|
273
|
+
class: "text-red-400"
|
|
274
|
+
}, ye = {
|
|
275
|
+
ref: "rootRef",
|
|
276
|
+
class: "relative"
|
|
277
|
+
}, be = ["disabled"], Y = { class: "border-b border-gray-100 p-2" }, xe = { class: "relative" }, Se = { class: "max-h-48 overflow-y-auto" }, Ce = {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "px-3 py-3 text-center text-xs text-gray-400"
|
|
280
|
+
}, X = {
|
|
281
|
+
key: 1,
|
|
282
|
+
class: "px-3 py-3 text-center text-xs text-gray-400"
|
|
283
|
+
}, we = ["onClick"];
|
|
284
|
+
function Te(e, t, n, r, i, a) {
|
|
285
|
+
return L(), O("div", null, [k("label", _e, [A(z(n.label) + " ", 1), n.required ? (L(), O("span", ve, "*")) : D("", !0)]), k("div", ye, [k("button", {
|
|
286
|
+
type: "button",
|
|
287
|
+
disabled: n.disabled,
|
|
288
|
+
class: P(["flex w-full items-center justify-between rounded-xl border px-3.5 py-2.5 text-left text-sm transition-all", n.disabled ? "cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400" : r.open ? "border-[#2663EB] bg-white text-gray-900 ring-2 ring-[#2663EB]/15" : "border-gray-200 bg-white text-gray-900 hover:border-gray-300"]),
|
|
289
|
+
onClick: r.toggle
|
|
290
|
+
}, [k("span", { class: P(n.displayValue ? "text-gray-900" : "text-gray-400") }, z(n.displayValue || n.placeholder), 3), j(r.AppIcon, {
|
|
291
|
+
name: "chevron-down",
|
|
292
|
+
class: P(["h-[15px] w-[15px] shrink-0 text-gray-400 transition-transform", r.open ? "rotate-180" : ""])
|
|
293
|
+
}, null, 8, ["class"])], 10, be), j(r.SurveyorTeleport, null, {
|
|
294
|
+
default: H(() => [r.open ? (L(), O("div", {
|
|
295
|
+
key: 0,
|
|
296
|
+
ref: "panelRef",
|
|
297
|
+
class: "fixed z-[100] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-lg",
|
|
298
|
+
style: F(r.dropdownStyle),
|
|
299
|
+
onMousedown: t[1] ||= W(() => {}, ["stop"])
|
|
300
|
+
}, [k("div", Y, [k("div", xe, [j(r.AppIcon, {
|
|
301
|
+
name: "search",
|
|
302
|
+
class: "absolute left-2.5 top-1/2 h-[13px] w-[13px] -translate-y-1/2 text-gray-400"
|
|
303
|
+
}), U(k("input", {
|
|
304
|
+
ref: "inputRef",
|
|
305
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.query = e,
|
|
306
|
+
type: "text",
|
|
307
|
+
placeholder: "Пошук...",
|
|
308
|
+
class: "w-full rounded-lg border border-gray-200 py-1.5 pl-8 pr-3 text-xs outline-none focus:border-[#2663EB]"
|
|
309
|
+
}, null, 512), [[B, r.query]])])]), k("div", Se, [n.loading && r.filtered.length === 0 ? (L(), O("p", Ce, "Завантаження…")) : r.filtered.length === 0 ? (L(), O("p", X, "Нічого не знайдено")) : D("", !0), (L(!0), O(w, null, ie(r.filtered, (e) => (L(), O("button", {
|
|
310
|
+
key: e.id,
|
|
311
|
+
type: "button",
|
|
312
|
+
class: P(["w-full px-3.5 py-2.5 text-left text-sm transition-colors hover:bg-gray-50", n.modelValue === e.id ? "bg-[#EFF4FE] font-medium text-[#2663EB]" : "text-gray-700"]),
|
|
313
|
+
onClick: (t) => r.select(e)
|
|
314
|
+
}, z(e.text), 11, we))), 128))])], 36)) : D("", !0)]),
|
|
315
|
+
_: 1
|
|
316
|
+
})], 512)]);
|
|
317
|
+
}
|
|
318
|
+
var Ee = /*#__PURE__*/ e(ge, [["render", Te], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/FormSuggestSelect.vue"]]), Z = "draft-polygon", De = "draft-polygon-fill", Oe = "draft-polygon-line", Q = "draft-vertices", ke = "draft-vertices-layer", $ = "draft-vertices-hit", Ae = 12, je = 17, Me = 13, Ne = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 3v12\"/><path d=\"m17 8-5-5-5 5\"/><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/></svg>", Pe = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z\"/></svg>", Fe = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M3 6h18\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\"/><path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/><path d=\"M10 11v6\"/><path d=\"M14 11v6\"/></svg>", Ie = /*@__PURE__*/ M({
|
|
319
|
+
__name: "ApplicationCreateMap",
|
|
320
|
+
props: {
|
|
321
|
+
points: {
|
|
322
|
+
type: Array,
|
|
323
|
+
required: !0
|
|
324
|
+
},
|
|
325
|
+
addressPoint: {
|
|
326
|
+
type: [Array, null],
|
|
327
|
+
required: !1
|
|
328
|
+
},
|
|
329
|
+
geometry: {
|
|
330
|
+
type: [Object, null],
|
|
331
|
+
required: !1
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
emits: [
|
|
335
|
+
"update:points",
|
|
336
|
+
"update:geometry",
|
|
337
|
+
"import"
|
|
338
|
+
],
|
|
339
|
+
setup(e, { expose: t, emit: n }) {
|
|
340
|
+
t();
|
|
341
|
+
let r = e, i = n, a = [24.0297, 49.8397], o = R(null), y = ae(null), x = ae(null), te = R(""), S = R(!1), C = null, w = R(c), E = R([]), D = R(s), O = R([]), k = null, A = null, j = !1, M = !1, N = !1, P = !1, F = null, I = null, L = !1, ie = T(() => S.value ? "Перетягніть вершину. Клік по лінії додає точку, права кнопка на вершині видаляє її" : r.geometry ? "Геометрію імпортовано. Олівець — редагувати, кошик — видалити, клік — намалювати наново" : r.points.length > 0 ? "Клік додає точку. Олівець — редагувати контур, кошик — видалити" : "Клікніть на карті, щоб окреслити контур (мінімум 3 точки)");
|
|
342
|
+
function z() {
|
|
343
|
+
return !!r.geometry || r.points.length > 0;
|
|
344
|
+
}
|
|
345
|
+
function B(e) {
|
|
346
|
+
return w.value.find((t) => t.id === e) ?? w.value[0] ?? c[0];
|
|
347
|
+
}
|
|
348
|
+
async function H() {
|
|
349
|
+
let e = await g("application-form");
|
|
350
|
+
w.value = e.baseLayers, D.value = e.defaultBaseId, E.value = e.overlays.filter((e) => e.kind !== "applications"), O.value = E.value.filter((e) => e.defaultVisible).map((e) => e.id);
|
|
351
|
+
}
|
|
352
|
+
function U(e) {
|
|
353
|
+
let t = O.value;
|
|
354
|
+
O.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
355
|
+
}
|
|
356
|
+
function W(e) {
|
|
357
|
+
let t = [];
|
|
358
|
+
for (let n of e) {
|
|
359
|
+
if (!Array.isArray(n) || n.length < 2) continue;
|
|
360
|
+
let e = Number(n[0]), r = Number(n[1]);
|
|
361
|
+
Number.isFinite(e) && Number.isFinite(r) && t.push([e, r]);
|
|
362
|
+
}
|
|
363
|
+
if (t.length > 1) {
|
|
364
|
+
let [e, n] = t[0], [r, i] = t[t.length - 1];
|
|
365
|
+
Math.abs(e - r) < 1e-10 && Math.abs(n - i) < 1e-10 && t.pop();
|
|
366
|
+
}
|
|
367
|
+
return t;
|
|
368
|
+
}
|
|
369
|
+
function G() {
|
|
370
|
+
return A || (r.geometry ? W(r.geometry.coordinates[0] ?? []) : r.points);
|
|
371
|
+
}
|
|
372
|
+
function oe(e) {
|
|
373
|
+
let t = e.map(([e, t]) => [e, t]);
|
|
374
|
+
if (t.length === 0) return t;
|
|
375
|
+
let [n, r] = t[0], [i, a] = t[t.length - 1];
|
|
376
|
+
return (n !== i || r !== a) && t.push([n, r]), t;
|
|
377
|
+
}
|
|
378
|
+
function K(e) {
|
|
379
|
+
let t = r.geometry;
|
|
380
|
+
if (t && e.length >= 3) {
|
|
381
|
+
N = !0, i("update:geometry", {
|
|
382
|
+
type: "Polygon",
|
|
383
|
+
coordinates: [oe(e), ...t.coordinates.slice(1)]
|
|
384
|
+
});
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
t && i("update:geometry", null), i("update:points", e);
|
|
388
|
+
}
|
|
389
|
+
function se() {
|
|
390
|
+
S.value = !1, i("update:points", []), r.geometry && i("update:geometry", null);
|
|
391
|
+
}
|
|
392
|
+
function ce() {
|
|
393
|
+
z() && (S.value = !S.value);
|
|
394
|
+
}
|
|
395
|
+
function le(e, t) {
|
|
396
|
+
let n = [];
|
|
397
|
+
return e.length >= 2 && n.push({
|
|
398
|
+
type: "Feature",
|
|
399
|
+
geometry: {
|
|
400
|
+
type: "LineString",
|
|
401
|
+
coordinates: e
|
|
402
|
+
},
|
|
403
|
+
properties: {}
|
|
404
|
+
}), e.length >= 3 && n.push({
|
|
405
|
+
type: "Feature",
|
|
406
|
+
geometry: {
|
|
407
|
+
type: "Polygon",
|
|
408
|
+
coordinates: [oe(e), ...t]
|
|
409
|
+
},
|
|
410
|
+
properties: {}
|
|
411
|
+
}), n;
|
|
412
|
+
}
|
|
413
|
+
function ue() {
|
|
414
|
+
if (A) {
|
|
415
|
+
let e = r.geometry?.coordinates.slice(1) ?? [];
|
|
416
|
+
return {
|
|
417
|
+
type: "FeatureCollection",
|
|
418
|
+
features: le(A, e)
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
return r.geometry ? {
|
|
422
|
+
type: "FeatureCollection",
|
|
423
|
+
features: [{
|
|
424
|
+
type: "Feature",
|
|
425
|
+
geometry: r.geometry,
|
|
426
|
+
properties: {}
|
|
427
|
+
}]
|
|
428
|
+
} : {
|
|
429
|
+
type: "FeatureCollection",
|
|
430
|
+
features: le(r.points, [])
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function de() {
|
|
434
|
+
return {
|
|
435
|
+
type: "FeatureCollection",
|
|
436
|
+
features: (!S.value && r.geometry ? [] : G()).map(([e, t], n) => ({
|
|
437
|
+
type: "Feature",
|
|
438
|
+
geometry: {
|
|
439
|
+
type: "Point",
|
|
440
|
+
coordinates: [e, t]
|
|
441
|
+
},
|
|
442
|
+
properties: { index: n }
|
|
443
|
+
}))
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
function q(e) {
|
|
447
|
+
e.getSource(Z)?.setData(ue()), e.getSource(Q)?.setData(de());
|
|
448
|
+
}
|
|
449
|
+
function fe(e) {
|
|
450
|
+
let t = e.features?.[0]?.properties?.index, n = typeof t == "number" ? t : Number(t);
|
|
451
|
+
return Number.isInteger(n) && n >= 0 ? n : null;
|
|
452
|
+
}
|
|
453
|
+
function pe(e) {
|
|
454
|
+
if (!S.value) return;
|
|
455
|
+
let t = e.originalEvent;
|
|
456
|
+
if (t && "button" in t && t.button !== 0) return;
|
|
457
|
+
let n = fe(e), r = y.value, i = G();
|
|
458
|
+
n == null || !r || n >= i.length || (e.preventDefault(), k = n, j = !1, A = i.map(([e, t]) => [e, t]), M = !0, r.dragPan.disable(), r.getCanvas().style.cursor = "grabbing", window.addEventListener("mouseup", J));
|
|
459
|
+
}
|
|
460
|
+
function me(e) {
|
|
461
|
+
if (k == null || !A) return;
|
|
462
|
+
let { lng: t, lat: n } = e.lngLat, r = A[k];
|
|
463
|
+
if (r[0] === t && r[1] === n) return;
|
|
464
|
+
j = !0, A[k] = [t, n];
|
|
465
|
+
let i = y.value;
|
|
466
|
+
i && q(i);
|
|
467
|
+
}
|
|
468
|
+
function J() {
|
|
469
|
+
if (window.removeEventListener("mouseup", J), k == null || L) {
|
|
470
|
+
k = null, A = null, j = !1;
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
let e = y.value;
|
|
474
|
+
e?.dragPan.enable();
|
|
475
|
+
let t = A, n = j;
|
|
476
|
+
k = null, A = null, j = !1, e && (e.getCanvas().style.cursor = "", n || q(e)), t && n && K(t), window.setTimeout(() => {
|
|
477
|
+
M = !1;
|
|
478
|
+
}, 0);
|
|
479
|
+
}
|
|
480
|
+
function he(e) {
|
|
481
|
+
if (!S.value) return;
|
|
482
|
+
e.preventDefault();
|
|
483
|
+
let t = fe(e);
|
|
484
|
+
t != null && K(G().filter((e, n) => n !== t));
|
|
485
|
+
}
|
|
486
|
+
function ge(e, t, n) {
|
|
487
|
+
let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
|
|
488
|
+
if (a === 0) return Math.hypot(e.x - t.x, e.y - t.y);
|
|
489
|
+
let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
|
|
490
|
+
return Math.hypot(e.x - (t.x + o * r), e.y - (t.y + o * i));
|
|
491
|
+
}
|
|
492
|
+
function _e(e, t, n, r) {
|
|
493
|
+
let i = e.project([n, r]);
|
|
494
|
+
for (let n of t) {
|
|
495
|
+
let t = e.project(n);
|
|
496
|
+
if (Math.hypot(i.x - t.x, i.y - t.y) <= 8) return null;
|
|
497
|
+
}
|
|
498
|
+
let a = Ae, o = -1, s = t.length >= 3 ? t.length : t.length - 1;
|
|
499
|
+
for (let n = 0; n < s; n += 1) {
|
|
500
|
+
let r = ge(i, e.project(t[n]), e.project(t[(n + 1) % t.length]));
|
|
501
|
+
r <= a && (a = r, o = n);
|
|
502
|
+
}
|
|
503
|
+
if (o < 0) return null;
|
|
504
|
+
let c = t.map(([e, t]) => [e, t]);
|
|
505
|
+
return c.splice(o + 1, 0, [n, r]), c;
|
|
506
|
+
}
|
|
507
|
+
function ve(e) {
|
|
508
|
+
P || (P = !0, e.on("mousedown", $, (e) => pe(e)), e.on("contextmenu", $, (e) => he(e)), e.on("mousemove", (e) => me(e)), e.on("mouseenter", $, () => {
|
|
509
|
+
let e = y.value;
|
|
510
|
+
e && S.value && k == null && (e.getCanvas().style.cursor = "grab");
|
|
511
|
+
}), e.on("mouseleave", $, () => {
|
|
512
|
+
if (k != null) return;
|
|
513
|
+
let e = y.value;
|
|
514
|
+
e && (e.getCanvas().style.cursor = "");
|
|
515
|
+
}));
|
|
516
|
+
}
|
|
517
|
+
function ye(e) {
|
|
518
|
+
e.getSource(Z) || (e.addSource(Z, {
|
|
519
|
+
type: "geojson",
|
|
520
|
+
data: ue()
|
|
521
|
+
}), e.addLayer({
|
|
522
|
+
id: De,
|
|
523
|
+
type: "fill",
|
|
524
|
+
source: Z,
|
|
525
|
+
filter: [
|
|
526
|
+
"==",
|
|
527
|
+
["geometry-type"],
|
|
528
|
+
"Polygon"
|
|
529
|
+
],
|
|
530
|
+
paint: {
|
|
531
|
+
"fill-color": "#2663EB",
|
|
532
|
+
"fill-opacity": .2
|
|
533
|
+
}
|
|
534
|
+
}), e.addLayer({
|
|
535
|
+
id: Oe,
|
|
536
|
+
type: "line",
|
|
537
|
+
source: Z,
|
|
538
|
+
paint: {
|
|
539
|
+
"line-color": "#2663EB",
|
|
540
|
+
"line-width": 2
|
|
541
|
+
}
|
|
542
|
+
})), e.getSource(Q) || (e.addSource(Q, {
|
|
543
|
+
type: "geojson",
|
|
544
|
+
data: de()
|
|
545
|
+
}), e.addLayer({
|
|
546
|
+
id: ke,
|
|
547
|
+
type: "circle",
|
|
548
|
+
source: Q,
|
|
549
|
+
paint: {
|
|
550
|
+
"circle-radius": S.value ? 7 : 5,
|
|
551
|
+
"circle-color": "#ffffff",
|
|
552
|
+
"circle-stroke-color": "#2663EB",
|
|
553
|
+
"circle-stroke-width": S.value ? 3 : 2
|
|
554
|
+
}
|
|
555
|
+
}), e.addLayer({
|
|
556
|
+
id: $,
|
|
557
|
+
type: "circle",
|
|
558
|
+
source: Q,
|
|
559
|
+
paint: {
|
|
560
|
+
"circle-radius": 14,
|
|
561
|
+
"circle-color": "#000000",
|
|
562
|
+
"circle-opacity": 0
|
|
563
|
+
}
|
|
564
|
+
})), ve(e), q(e);
|
|
565
|
+
}
|
|
566
|
+
function be(e) {
|
|
567
|
+
if (M) {
|
|
568
|
+
M = !1;
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
if (S.value) {
|
|
572
|
+
let t = y.value, n = G();
|
|
573
|
+
if (!t || n.length < 2) return;
|
|
574
|
+
let r = _e(t, n, e.lngLat.lng, e.lngLat.lat);
|
|
575
|
+
r && K(r);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
let t = [e.lngLat.lng, e.lngLat.lat];
|
|
579
|
+
i("update:points", r.geometry ? [t] : [...r.points, t]);
|
|
580
|
+
}
|
|
581
|
+
function Y(e, t, n) {
|
|
582
|
+
let r = document.createElement("button");
|
|
583
|
+
return r.type = "button", r.title = e, r.setAttribute("aria-label", e), r.style.display = "flex", r.style.alignItems = "center", r.style.justifyContent = "center", r.style.color = "#334155", r.innerHTML = t, r.addEventListener("click", (e) => {
|
|
584
|
+
e.preventDefault(), e.stopPropagation(), !r.disabled && n();
|
|
585
|
+
}), r;
|
|
586
|
+
}
|
|
587
|
+
function xe(e) {
|
|
588
|
+
let t = document.createElement("div");
|
|
589
|
+
t.className = "maplibregl-ctrl maplibregl-ctrl-group";
|
|
590
|
+
for (let n of e) t.appendChild(n);
|
|
591
|
+
return {
|
|
592
|
+
onAdd() {
|
|
593
|
+
return t;
|
|
594
|
+
},
|
|
595
|
+
onRemove() {
|
|
596
|
+
t.remove();
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function Se(e) {
|
|
601
|
+
e.flyTo({
|
|
602
|
+
center: a,
|
|
603
|
+
zoom: Me,
|
|
604
|
+
bearing: 0,
|
|
605
|
+
pitch: 0,
|
|
606
|
+
duration: 600,
|
|
607
|
+
essential: !0
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function Ce(e) {
|
|
611
|
+
let t = o.value?.querySelector(".maplibregl-ctrl-compass");
|
|
612
|
+
if (!t) return;
|
|
613
|
+
let n = "Повернути початковий вигляд";
|
|
614
|
+
t.title = n, t.setAttribute("aria-label", n), t.addEventListener("click", (t) => {
|
|
615
|
+
t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation(), Se(e);
|
|
616
|
+
}, !0);
|
|
617
|
+
}
|
|
618
|
+
function X() {
|
|
619
|
+
let e = z();
|
|
620
|
+
if (F) {
|
|
621
|
+
let t = e && S.value;
|
|
622
|
+
F.disabled = !e, F.style.opacity = e ? "1" : "0.4", F.style.backgroundColor = t ? "#2663EB" : "", F.style.color = t ? "#ffffff" : "#334155";
|
|
623
|
+
let n = t ? "Завершити редагування" : "Редагувати контур";
|
|
624
|
+
F.title = n, F.setAttribute("aria-label", n), F.setAttribute("aria-pressed", t ? "true" : "false");
|
|
625
|
+
}
|
|
626
|
+
I && (I.disabled = !e, I.style.opacity = e ? "1" : "0.4");
|
|
627
|
+
}
|
|
628
|
+
function we(e) {
|
|
629
|
+
let t = v(r.geometry);
|
|
630
|
+
if (!t) return !1;
|
|
631
|
+
let [[n, i], [a, o]] = ee(t);
|
|
632
|
+
if (![
|
|
633
|
+
n,
|
|
634
|
+
i,
|
|
635
|
+
a,
|
|
636
|
+
o
|
|
637
|
+
].every(Number.isFinite)) return !1;
|
|
638
|
+
e.resize();
|
|
639
|
+
let s = e.getCanvas();
|
|
640
|
+
if (s.clientWidth < 2 || s.clientHeight < 2) return !1;
|
|
641
|
+
let c = [Math.min(n, a), Math.min(i, o)], l = [Math.max(n, a), Math.max(i, o)];
|
|
642
|
+
return l[0] - c[0] < 1e-8 && l[1] - c[1] < 1e-8 ? (e.flyTo({
|
|
643
|
+
center: c,
|
|
644
|
+
zoom: je,
|
|
645
|
+
essential: !0,
|
|
646
|
+
duration: 600
|
|
647
|
+
}), !0) : (e.fitBounds([c, l], {
|
|
648
|
+
padding: 48,
|
|
649
|
+
duration: 600,
|
|
650
|
+
maxZoom: je,
|
|
651
|
+
essential: !0
|
|
652
|
+
}), !0);
|
|
653
|
+
}
|
|
654
|
+
function Te(e) {
|
|
655
|
+
if (!L && y.value === e && r.geometry) {
|
|
656
|
+
if (!e.getSource(Z)) {
|
|
657
|
+
e.once("load", () => Te(e));
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
q(e), we(e) || requestAnimationFrame(() => we(e));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function Ee() {
|
|
664
|
+
let e = document.createElement("div");
|
|
665
|
+
return e.setAttribute("aria-hidden", "true"), e.style.width = "28px", e.style.height = "36px", e.style.pointerEvents = "none", e.innerHTML = "<svg width=\"28\" height=\"36\" viewBox=\"0 0 28 36\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M14 0C6.27 0 0 6.27 0 14c0 10.5 14 22 14 22s14-11.5 14-22C28 6.27 21.73 0 14 0z\" fill=\"#EF4444\"/><circle cx=\"14\" cy=\"14\" r=\"5\" fill=\"#fff\"/></svg>", e;
|
|
666
|
+
}
|
|
667
|
+
function Ie(e) {
|
|
668
|
+
let t = r.addressPoint;
|
|
669
|
+
if (!t || !C) {
|
|
670
|
+
x.value?.remove(), x.value = null;
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
x.value ? x.value.setLngLat(t) : x.value = new C.Marker({
|
|
674
|
+
element: Ee(),
|
|
675
|
+
anchor: "bottom"
|
|
676
|
+
}).setLngLat(t).addTo(e), e.flyTo({
|
|
677
|
+
center: t,
|
|
678
|
+
zoom: Math.max(e.getZoom(), je),
|
|
679
|
+
essential: !0
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
ne(async () => {
|
|
683
|
+
let e;
|
|
684
|
+
try {
|
|
685
|
+
let [t] = await Promise.all([d(), H()]);
|
|
686
|
+
e = t;
|
|
687
|
+
} catch (e) {
|
|
688
|
+
console.error(e), te.value = p;
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
if (L || !o.value) return;
|
|
692
|
+
C = e;
|
|
693
|
+
let t = new e.Map({
|
|
694
|
+
container: o.value,
|
|
695
|
+
style: l(B(D.value)),
|
|
696
|
+
center: a,
|
|
697
|
+
zoom: Me,
|
|
698
|
+
attributionControl: !1,
|
|
699
|
+
locale: _
|
|
700
|
+
});
|
|
701
|
+
t.addControl(new e.NavigationControl({ showCompass: !0 }), "top-left"), Ce(t), t.addControl(xe([Y("Імпортувати геометрію", Ne, () => i("import"))]), "top-left"), F = Y("Редагувати контур", Pe, ce), I = Y("Видалити контур", Fe, se), t.addControl(xe([F, I]), "top-left"), X(), t.on("load", () => {
|
|
702
|
+
ye(t), h(t, E.value, O.value, De), Ie(t);
|
|
703
|
+
}), t.on("click", (e) => be(e)), y.value = t;
|
|
704
|
+
}), re(() => {
|
|
705
|
+
L = !0, window.removeEventListener("mouseup", J), x.value?.remove(), x.value = null, y.value?.remove(), y.value = null, F = null, I = null;
|
|
706
|
+
}), V(() => [r.points, r.geometry], () => {
|
|
707
|
+
S.value && !z() && (S.value = !1);
|
|
708
|
+
let e = y.value;
|
|
709
|
+
e?.getSource(Z) && q(e), X();
|
|
710
|
+
}, { deep: !0 }), V(S, () => {
|
|
711
|
+
let e = y.value;
|
|
712
|
+
e?.getLayer(ke) && (e.setPaintProperty(ke, "circle-radius", S.value ? 7 : 5), e.setPaintProperty(ke, "circle-stroke-width", S.value ? 3 : 2), q(e)), e && (S.value ? e.doubleClickZoom.disable() : e.doubleClickZoom.enable(), S.value || (e.getCanvas().style.cursor = "")), X();
|
|
713
|
+
}), V(() => r.geometry, () => {
|
|
714
|
+
if (N) {
|
|
715
|
+
N = !1;
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
let e = y.value;
|
|
719
|
+
e && r.geometry && Te(e);
|
|
720
|
+
}, { flush: "post" }), V(D, () => {
|
|
721
|
+
let e = y.value;
|
|
722
|
+
if (!e) return;
|
|
723
|
+
let t = () => u(e, B(D.value), f(e, E.value, [De]));
|
|
724
|
+
e.isStyleLoaded() ? t() : e.once("load", t);
|
|
725
|
+
}), V(O, () => {
|
|
726
|
+
let e = y.value;
|
|
727
|
+
e?.isStyleLoaded() && m(e, E.value, O.value);
|
|
728
|
+
}), V(() => r.addressPoint, () => {
|
|
729
|
+
let e = y.value;
|
|
730
|
+
e?.isStyleLoaded() && Ie(e);
|
|
731
|
+
});
|
|
732
|
+
let Le = {
|
|
733
|
+
props: r,
|
|
734
|
+
emit: i,
|
|
735
|
+
DRAFT_SOURCE: Z,
|
|
736
|
+
DRAFT_FILL: De,
|
|
737
|
+
DRAFT_LINE: Oe,
|
|
738
|
+
VERTEX_SOURCE: Q,
|
|
739
|
+
VERTEX_LAYER: ke,
|
|
740
|
+
VERTEX_HIT: $,
|
|
741
|
+
INSERT_TOLERANCE_PX: Ae,
|
|
742
|
+
ADDRESS_ZOOM: je,
|
|
743
|
+
INITIAL_CENTER: a,
|
|
744
|
+
INITIAL_ZOOM: Me,
|
|
745
|
+
IMPORT_ICON: Ne,
|
|
746
|
+
EDIT_ICON: Pe,
|
|
747
|
+
DELETE_ICON: Fe,
|
|
748
|
+
mapHost: o,
|
|
749
|
+
mapRef: y,
|
|
750
|
+
addressMarker: x,
|
|
751
|
+
mapLoadError: te,
|
|
752
|
+
editing: S,
|
|
753
|
+
get maplibre() {
|
|
754
|
+
return C;
|
|
755
|
+
},
|
|
756
|
+
set maplibre(e) {
|
|
757
|
+
C = e;
|
|
758
|
+
},
|
|
759
|
+
baseLayers: w,
|
|
760
|
+
overlayLayers: E,
|
|
761
|
+
activeBaseId: D,
|
|
762
|
+
activeOverlayIds: O,
|
|
763
|
+
get dragIndex() {
|
|
764
|
+
return k;
|
|
765
|
+
},
|
|
766
|
+
set dragIndex(e) {
|
|
767
|
+
k = e;
|
|
768
|
+
},
|
|
769
|
+
get dragPoints() {
|
|
770
|
+
return A;
|
|
771
|
+
},
|
|
772
|
+
set dragPoints(e) {
|
|
773
|
+
A = e;
|
|
774
|
+
},
|
|
775
|
+
get dragMoved() {
|
|
776
|
+
return j;
|
|
777
|
+
},
|
|
778
|
+
set dragMoved(e) {
|
|
779
|
+
j = e;
|
|
780
|
+
},
|
|
781
|
+
get suppressClick() {
|
|
782
|
+
return M;
|
|
783
|
+
},
|
|
784
|
+
set suppressClick(e) {
|
|
785
|
+
M = e;
|
|
786
|
+
},
|
|
787
|
+
get skipGeometryFocus() {
|
|
788
|
+
return N;
|
|
789
|
+
},
|
|
790
|
+
set skipGeometryFocus(e) {
|
|
791
|
+
N = e;
|
|
792
|
+
},
|
|
793
|
+
get vertexHandlersBound() {
|
|
794
|
+
return P;
|
|
795
|
+
},
|
|
796
|
+
set vertexHandlersBound(e) {
|
|
797
|
+
P = e;
|
|
798
|
+
},
|
|
799
|
+
get editButton() {
|
|
800
|
+
return F;
|
|
801
|
+
},
|
|
802
|
+
set editButton(e) {
|
|
803
|
+
F = e;
|
|
804
|
+
},
|
|
805
|
+
get deleteButton() {
|
|
806
|
+
return I;
|
|
807
|
+
},
|
|
808
|
+
set deleteButton(e) {
|
|
809
|
+
I = e;
|
|
810
|
+
},
|
|
811
|
+
get disposed() {
|
|
812
|
+
return L;
|
|
813
|
+
},
|
|
814
|
+
set disposed(e) {
|
|
815
|
+
L = e;
|
|
816
|
+
},
|
|
817
|
+
hint: ie,
|
|
818
|
+
hasContour: z,
|
|
819
|
+
baseLayer: B,
|
|
820
|
+
loadLayerSettings: H,
|
|
821
|
+
toggleOverlay: U,
|
|
822
|
+
ringVertices: W,
|
|
823
|
+
contourPoints: G,
|
|
824
|
+
closeRing: oe,
|
|
825
|
+
commitContour: K,
|
|
826
|
+
clearContour: se,
|
|
827
|
+
toggleEditing: ce,
|
|
828
|
+
draftFeatures: le,
|
|
829
|
+
draftGeoJson: ue,
|
|
830
|
+
verticesGeoJson: de,
|
|
831
|
+
refreshSources: q,
|
|
832
|
+
vertexIndex: fe,
|
|
833
|
+
beginVertexDrag: pe,
|
|
834
|
+
moveVertex: me,
|
|
835
|
+
endVertexDrag: J,
|
|
836
|
+
onVertexContextMenu: he,
|
|
837
|
+
pointSegmentDistance: ge,
|
|
838
|
+
insertOnNearestSegment: _e,
|
|
839
|
+
bindVertexHandlers: ve,
|
|
840
|
+
ensureLayers: ye,
|
|
841
|
+
onMapClick: be,
|
|
842
|
+
iconButton: Y,
|
|
843
|
+
controlGroup: xe,
|
|
844
|
+
resetInitialView: Se,
|
|
845
|
+
bindInitialViewButton: Ce,
|
|
846
|
+
syncContourButtons: X,
|
|
847
|
+
focusImportedGeometry: we,
|
|
848
|
+
showImportedGeometry: Te,
|
|
849
|
+
addressMarkerElement: Ee,
|
|
850
|
+
syncAddressPoint: Ie,
|
|
851
|
+
MapLayerMenu: b
|
|
852
|
+
};
|
|
853
|
+
return Object.defineProperty(Le, "__isScriptSetup", {
|
|
854
|
+
enumerable: !1,
|
|
855
|
+
value: !0
|
|
856
|
+
}), Le;
|
|
857
|
+
}
|
|
858
|
+
}), Le = { class: "relative h-full w-full overflow-hidden rounded-xl" }, Re = {
|
|
859
|
+
ref: "mapHost",
|
|
860
|
+
class: "h-full w-full"
|
|
861
|
+
}, ze = {
|
|
862
|
+
key: 1,
|
|
863
|
+
class: "absolute inset-0 z-[20] flex items-center justify-center bg-white/90 px-4 text-center text-sm text-red-600"
|
|
864
|
+
}, Be = { class: "absolute bottom-3 left-3 z-[10] max-w-[calc(100%-1.5rem)] rounded-lg border border-gray-100 bg-white/90 px-2.5 py-1.5 text-xs text-gray-500 shadow backdrop-blur-sm" };
|
|
865
|
+
function Ve(e, t, n, r, i, a) {
|
|
866
|
+
return L(), O("div", Le, [
|
|
867
|
+
k("div", Re, null, 512),
|
|
868
|
+
r.mapLoadError ? D("", !0) : (L(), E(r.MapLayerMenu, {
|
|
869
|
+
key: 0,
|
|
870
|
+
placement: "end",
|
|
871
|
+
"base-id": r.activeBaseId,
|
|
872
|
+
"active-overlay-ids": r.activeOverlayIds,
|
|
873
|
+
"base-layers": r.baseLayers,
|
|
874
|
+
overlays: r.overlayLayers,
|
|
875
|
+
onSelectBase: t[0] ||= (e) => r.activeBaseId = e,
|
|
876
|
+
onToggleOverlay: r.toggleOverlay
|
|
877
|
+
}, null, 8, [
|
|
878
|
+
"base-id",
|
|
879
|
+
"active-overlay-ids",
|
|
880
|
+
"base-layers",
|
|
881
|
+
"overlays"
|
|
882
|
+
])),
|
|
883
|
+
r.mapLoadError ? (L(), O("p", ze, z(r.mapLoadError), 1)) : D("", !0),
|
|
884
|
+
k("div", Be, z(r.hint), 1)
|
|
885
|
+
]);
|
|
886
|
+
}
|
|
887
|
+
var He = /*#__PURE__*/ e(Ie, [["render", Ve], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/ApplicationCreateMap.vue"]]), Ue = /*@__PURE__*/ M({
|
|
888
|
+
__name: "GeometryImportDialog",
|
|
889
|
+
emits: ["close", "imported"],
|
|
890
|
+
setup(e, { expose: t, emit: n }) {
|
|
891
|
+
t();
|
|
892
|
+
let r = n, i = R(null), s = R(!1), c = R("");
|
|
893
|
+
function l(e) {
|
|
894
|
+
i.value = e, c.value = "";
|
|
895
|
+
}
|
|
896
|
+
async function u() {
|
|
897
|
+
if (i.value && !s.value) {
|
|
898
|
+
c.value = "", s.value = !0;
|
|
899
|
+
try {
|
|
900
|
+
let e = await C(i.value);
|
|
901
|
+
r("imported", e);
|
|
902
|
+
} catch (e) {
|
|
903
|
+
c.value = e instanceof Error ? e.message : "Не вдалося імпортувати геометрію";
|
|
904
|
+
} finally {
|
|
905
|
+
s.value = !1;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
let d = {
|
|
910
|
+
emit: r,
|
|
911
|
+
file: i,
|
|
912
|
+
importing: s,
|
|
913
|
+
error: c,
|
|
914
|
+
onFileChange: l,
|
|
915
|
+
submit: u,
|
|
916
|
+
AppIcon: a,
|
|
917
|
+
SurveyorTeleport: o,
|
|
918
|
+
FormFilePicker: x
|
|
919
|
+
};
|
|
920
|
+
return Object.defineProperty(d, "__isScriptSetup", {
|
|
921
|
+
enumerable: !1,
|
|
922
|
+
value: !0
|
|
923
|
+
}), d;
|
|
924
|
+
}
|
|
925
|
+
}), We = {
|
|
926
|
+
class: "w-full max-w-md overflow-hidden rounded-2xl bg-white shadow-2xl",
|
|
927
|
+
role: "dialog",
|
|
928
|
+
"aria-labelledby": "geometry-import-title"
|
|
929
|
+
}, Ge = { class: "flex items-center justify-between border-b border-gray-100 px-6 py-5" }, Ke = { class: "flex items-center gap-3" }, qe = { class: "flex h-9 w-9 items-center justify-center rounded-xl bg-[#EFF4FE]" }, Je = {
|
|
930
|
+
key: 0,
|
|
931
|
+
class: "rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700"
|
|
932
|
+
}, Ye = { class: "flex items-center justify-end gap-2" }, Xe = ["disabled"];
|
|
933
|
+
function Ze(e, t, n, r, i, a) {
|
|
934
|
+
return L(), E(r.SurveyorTeleport, null, {
|
|
935
|
+
default: H(() => [k("div", {
|
|
936
|
+
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 backdrop-blur-sm",
|
|
937
|
+
onMousedown: t[2] ||= W((e) => r.emit("close"), ["self"])
|
|
938
|
+
}, [k("div", We, [k("div", Ge, [k("div", Ke, [k("div", qe, [j(r.AppIcon, {
|
|
939
|
+
name: "upload",
|
|
940
|
+
class: "h-[17px] w-[17px] text-[#2663EB]"
|
|
941
|
+
})]), t[3] ||= k("div", null, [k("h2", {
|
|
942
|
+
id: "geometry-import-title",
|
|
943
|
+
class: "text-base font-semibold text-gray-900"
|
|
944
|
+
}, "Імпорт геометрії"), k("p", { class: "mt-0.5 text-xs text-gray-500" }, "ZIP (Shapefile) або GeoJSON")], -1)]), k("button", {
|
|
945
|
+
type: "button",
|
|
946
|
+
class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600",
|
|
947
|
+
"aria-label": "Закрити",
|
|
948
|
+
onClick: t[0] ||= (e) => r.emit("close")
|
|
949
|
+
}, [j(r.AppIcon, {
|
|
950
|
+
name: "x",
|
|
951
|
+
class: "h-[17px] w-[17px]"
|
|
952
|
+
})])]), k("form", {
|
|
953
|
+
class: "space-y-4 px-6 py-5",
|
|
954
|
+
onSubmit: W(r.submit, ["prevent"])
|
|
955
|
+
}, [
|
|
956
|
+
j(r.FormFilePicker, {
|
|
957
|
+
"file-name": r.file?.name,
|
|
958
|
+
accept: ".zip,.geojson,.json,application/geo+json,application/zip",
|
|
959
|
+
"button-label": "Завантажити файл",
|
|
960
|
+
onChange: r.onFileChange
|
|
961
|
+
}, null, 8, ["file-name"]),
|
|
962
|
+
r.error ? (L(), O("p", Je, z(r.error), 1)) : D("", !0),
|
|
963
|
+
k("div", Ye, [k("button", {
|
|
964
|
+
type: "button",
|
|
965
|
+
class: "rounded-xl bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200",
|
|
966
|
+
onClick: t[1] ||= (e) => r.emit("close")
|
|
967
|
+
}, " Скасувати "), k("button", {
|
|
968
|
+
type: "submit",
|
|
969
|
+
class: "rounded-xl bg-[#2663EB] px-4 py-2.5 text-sm font-medium text-white transition-all hover:bg-[#1d52cc] disabled:cursor-not-allowed disabled:opacity-40",
|
|
970
|
+
disabled: !r.file || r.importing
|
|
971
|
+
}, z(r.importing ? "Імпортування…" : "Імпортувати"), 9, Xe)])
|
|
972
|
+
], 32)])], 32)]),
|
|
973
|
+
_: 1
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
var Qe = /*#__PURE__*/ e(Ue, [["render", Ze], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/GeometryImportDialog.vue"]]), $e = "public_applications", et = $e;
|
|
977
|
+
async function tt(e, r, i) {
|
|
978
|
+
let a = new URLSearchParams();
|
|
979
|
+
if (a.set("limit", String(i?.limit ?? 20)), i?.search && a.set("search", i.search), i?.filter) for (let [e, t] of Object.entries(i.filter)) a.set(`filter[${e}]`, String(t));
|
|
980
|
+
let o = await fetch(n(`/api/suggest/${encodeURIComponent(e)}/${encodeURIComponent(r)}?${a}`), { credentials: "include" });
|
|
981
|
+
if (!o.ok) throw Error(t(await o.text(), o.status));
|
|
982
|
+
return (await o.json()).data ?? [];
|
|
983
|
+
}
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region cabinet/src/pages/requests/create.vue?vue&type=script&setup=true&lang.ts
|
|
986
|
+
var nt = /*@__PURE__*/ M({
|
|
987
|
+
__name: "create",
|
|
988
|
+
setup(e, { expose: t }) {
|
|
989
|
+
t();
|
|
990
|
+
let n = oe(), o = R(""), s = R(""), c = R(""), l = R(""), u = R([]), d = R([]), f = R(!1), p = R(!1), m = R(!1), h = R(""), g = R(""), _ = R(""), v = R(""), ee = R(""), b = R(""), x = R([]), C = R(null), w = R(!1), E = R(null), D = R(!1), O = R(""), k = T(() => r.value.find((e) => e.id === i.value)?.name ?? ""), A = y.items.map((e) => e.name);
|
|
991
|
+
V(o, () => {
|
|
992
|
+
c.value = "", l.value = "", d.value = [], E.value = null;
|
|
993
|
+
}), V(_, (e) => {
|
|
994
|
+
g.value = y.items.find((t) => t.name === e)?.code ?? "";
|
|
995
|
+
}), V(x, (e) => {
|
|
996
|
+
e.length > 0 && (C.value = null);
|
|
997
|
+
});
|
|
998
|
+
let j = T(() => {
|
|
999
|
+
let e = !!o.value, t = m.value ? h.value.trim().length > 0 : !!c.value, n = !!C.value || x.value.length >= 3;
|
|
1000
|
+
return !!(g.value && e && t && n);
|
|
1001
|
+
});
|
|
1002
|
+
function M(e) {
|
|
1003
|
+
C.value = e, x.value = [], w.value = !1;
|
|
1004
|
+
}
|
|
1005
|
+
async function N(e) {
|
|
1006
|
+
f.value = !0;
|
|
1007
|
+
try {
|
|
1008
|
+
u.value = await tt($e, "settlement_id", {
|
|
1009
|
+
search: e,
|
|
1010
|
+
filter: { level: 5 }
|
|
1011
|
+
});
|
|
1012
|
+
} catch {
|
|
1013
|
+
u.value = [];
|
|
1014
|
+
} finally {
|
|
1015
|
+
f.value = !1;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
async function P(e) {
|
|
1019
|
+
if (!o.value) {
|
|
1020
|
+
d.value = [];
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
p.value = !0;
|
|
1024
|
+
try {
|
|
1025
|
+
d.value = await tt(et, "address_id", {
|
|
1026
|
+
search: e,
|
|
1027
|
+
filter: { settlement_id: o.value }
|
|
1028
|
+
});
|
|
1029
|
+
} catch {
|
|
1030
|
+
d.value = [];
|
|
1031
|
+
} finally {
|
|
1032
|
+
p.value = !1;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
function F(e) {
|
|
1036
|
+
if (!e) return null;
|
|
1037
|
+
let t = e.coordinates, n = e.type === "Point" ? t : e.type === "MultiPoint" && Array.isArray(t) ? t[0] : null;
|
|
1038
|
+
if (!Array.isArray(n) || n.length < 2) return null;
|
|
1039
|
+
let r = Number(n[0]), i = Number(n[1]);
|
|
1040
|
+
return !Number.isFinite(r) || !Number.isFinite(i) ? null : [r, i];
|
|
1041
|
+
}
|
|
1042
|
+
function I(e) {
|
|
1043
|
+
E.value = F(e.geom);
|
|
1044
|
+
}
|
|
1045
|
+
function ne() {
|
|
1046
|
+
m.value = !m.value, c.value = "", l.value = "", d.value = [], h.value = "", E.value = null;
|
|
1047
|
+
}
|
|
1048
|
+
async function re() {
|
|
1049
|
+
if (O.value = "", !i.value) {
|
|
1050
|
+
O.value = "Оберіть організацію в шапці кабінету";
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
if (!j.value) {
|
|
1054
|
+
O.value = "Заповніть обовʼязкові поля та окресліть територію на карті або імпортуйте геометрію";
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
let e = C.value ?? S(x.value);
|
|
1058
|
+
if (!e) {
|
|
1059
|
+
O.value = "Некоректний контур території";
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
D.value = !0;
|
|
1063
|
+
try {
|
|
1064
|
+
let t = await te({
|
|
1065
|
+
organization_id: i.value,
|
|
1066
|
+
work_type: g.value,
|
|
1067
|
+
settlement_id: o.value,
|
|
1068
|
+
is_found_address_id: !m.value,
|
|
1069
|
+
...m.value ? { location: h.value.trim() } : { address_id: c.value },
|
|
1070
|
+
description: v.value.trim() || void 0,
|
|
1071
|
+
execution_basis: ee.value.trim() || void 0,
|
|
1072
|
+
notes: b.value.trim() || void 0,
|
|
1073
|
+
geom: e
|
|
1074
|
+
});
|
|
1075
|
+
await n.push({
|
|
1076
|
+
name: "requests",
|
|
1077
|
+
query: {
|
|
1078
|
+
submitted: t.number,
|
|
1079
|
+
status: t.status
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
} catch (e) {
|
|
1083
|
+
O.value = e instanceof Error ? e.message : "Не вдалося відправити звернення";
|
|
1084
|
+
} finally {
|
|
1085
|
+
D.value = !1;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
let L = {
|
|
1089
|
+
router: n,
|
|
1090
|
+
settlementId: o,
|
|
1091
|
+
settlementLabel: s,
|
|
1092
|
+
addressId: c,
|
|
1093
|
+
addressLabel: l,
|
|
1094
|
+
settlementOptions: u,
|
|
1095
|
+
addressOptions: d,
|
|
1096
|
+
settlementLoading: f,
|
|
1097
|
+
addressLoading: p,
|
|
1098
|
+
manualAddress: m,
|
|
1099
|
+
manualValue: h,
|
|
1100
|
+
workTypeCode: g,
|
|
1101
|
+
workTypeLabel: _,
|
|
1102
|
+
description: v,
|
|
1103
|
+
basis: ee,
|
|
1104
|
+
notes: b,
|
|
1105
|
+
mapPoints: x,
|
|
1106
|
+
importedGeom: C,
|
|
1107
|
+
importOpen: w,
|
|
1108
|
+
addressPoint: E,
|
|
1109
|
+
submitting: D,
|
|
1110
|
+
error: O,
|
|
1111
|
+
orgName: k,
|
|
1112
|
+
workTypeOptions: A,
|
|
1113
|
+
canSubmit: j,
|
|
1114
|
+
onGeometryImported: M,
|
|
1115
|
+
loadSettlements: N,
|
|
1116
|
+
loadAddresses: P,
|
|
1117
|
+
pointFromGeom: F,
|
|
1118
|
+
onAddressSelect: I,
|
|
1119
|
+
toggleManualAddress: ne,
|
|
1120
|
+
submit: re,
|
|
1121
|
+
get RouterLink() {
|
|
1122
|
+
return G;
|
|
1123
|
+
},
|
|
1124
|
+
AppIcon: a,
|
|
1125
|
+
FormSearchSelect: he,
|
|
1126
|
+
FormSuggestSelect: Ee,
|
|
1127
|
+
ApplicationCreateMap: He,
|
|
1128
|
+
GeometryImportDialog: Qe
|
|
1129
|
+
};
|
|
1130
|
+
return Object.defineProperty(L, "__isScriptSetup", {
|
|
1131
|
+
enumerable: !1,
|
|
1132
|
+
value: !0
|
|
1133
|
+
}), L;
|
|
1134
|
+
}
|
|
1135
|
+
}), rt = { class: "min-h-[calc(100vh-3.5rem)] bg-gray-50" }, it = { class: "border-b border-gray-200 bg-white py-4" }, at = { class: "mx-auto max-w-[1400px] px-6" }, ot = { class: "mb-3 flex items-center gap-1.5 text-xs text-gray-400" }, st = { class: "flex items-start justify-between gap-4" }, ct = {
|
|
1136
|
+
key: 0,
|
|
1137
|
+
class: "flex shrink-0 items-center gap-2 rounded-lg border border-[#2663EB]/20 bg-[#EFF4FE] px-3 py-1.5"
|
|
1138
|
+
}, lt = { class: "max-w-[200px] truncate text-xs font-medium text-[#2663EB]" }, ut = { class: "grid grid-cols-1 gap-5 xl:grid-cols-[1fr_480px]" }, dt = { class: "space-y-4" }, ft = { class: "relative z-20 rounded-2xl border border-gray-200 bg-white" }, pt = { class: "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, mt = { class: "space-y-4 p-5" }, ht = { class: "block text-xs font-medium text-gray-700" }, gt = ["value"], _t = { class: "flex min-w-0 items-center gap-3" }, vt = { class: "min-w-0" }, yt = { key: 0 }, bt = { class: "overflow-hidden rounded-2xl border border-gray-200 bg-white" }, xt = { class: "space-y-4 p-5" }, St = { class: "space-y-4" }, Ct = { class: "overflow-hidden rounded-2xl border border-gray-200 bg-white" }, wt = { class: "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, Tt = { class: "h-[420px]" }, Et = { class: "rounded-2xl border border-gray-200 bg-white p-5" }, Dt = { class: "mb-4 flex items-center gap-2 text-xs text-gray-400" }, Ot = {
|
|
1139
|
+
key: 0,
|
|
1140
|
+
class: "mb-3 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700"
|
|
1141
|
+
}, kt = { class: "flex items-center gap-3" }, At = ["disabled"];
|
|
1142
|
+
function jt(e, t, n, r, i, a) {
|
|
1143
|
+
return L(), O("div", rt, [
|
|
1144
|
+
k("div", it, [k("div", at, [k("nav", ot, [
|
|
1145
|
+
j(r.RouterLink, {
|
|
1146
|
+
to: "/requests",
|
|
1147
|
+
class: "flex items-center gap-1 transition-colors hover:text-gray-700"
|
|
1148
|
+
}, {
|
|
1149
|
+
default: H(() => [j(r.AppIcon, {
|
|
1150
|
+
name: "home",
|
|
1151
|
+
class: "h-3 w-3"
|
|
1152
|
+
}), t[13] ||= k("span", null, "Звернення", -1)]),
|
|
1153
|
+
_: 1
|
|
1154
|
+
}),
|
|
1155
|
+
j(r.AppIcon, {
|
|
1156
|
+
name: "chevron-right",
|
|
1157
|
+
class: "h-3 w-3"
|
|
1158
|
+
}),
|
|
1159
|
+
t[14] ||= k("span", { class: "font-medium text-gray-700" }, "Нове звернення", -1)
|
|
1160
|
+
]), k("div", st, [t[15] ||= k("div", null, [k("h1", { class: "text-lg font-semibold text-gray-900" }, "Нове звернення"), k("p", { class: "mt-0.5 text-sm text-gray-500" }, "Заповніть дані для створення заявки")], -1), r.orgName ? (L(), O("div", ct, [j(r.AppIcon, {
|
|
1161
|
+
name: "building-2",
|
|
1162
|
+
class: "h-3.5 w-3.5 text-[#2663EB]"
|
|
1163
|
+
}), k("span", lt, z(r.orgName), 1)])) : D("", !0)])])]),
|
|
1164
|
+
k("form", {
|
|
1165
|
+
class: "mx-auto max-w-[1400px] px-6 py-5",
|
|
1166
|
+
onSubmit: W(r.submit, ["prevent"])
|
|
1167
|
+
}, [k("div", ut, [k("div", dt, [k("div", ft, [k("div", pt, [j(r.AppIcon, {
|
|
1168
|
+
name: "map-pin",
|
|
1169
|
+
class: "h-3.5 w-3.5 text-gray-400"
|
|
1170
|
+
}), t[16] ||= k("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, "Адреса об'єкта", -1)]), k("div", mt, [
|
|
1171
|
+
j(r.FormSuggestSelect, {
|
|
1172
|
+
modelValue: r.settlementId,
|
|
1173
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.settlementId = e,
|
|
1174
|
+
"display-value": r.settlementLabel,
|
|
1175
|
+
"onUpdate:displayValue": t[1] ||= (e) => r.settlementLabel = e,
|
|
1176
|
+
label: "Населений пункт",
|
|
1177
|
+
required: "",
|
|
1178
|
+
options: r.settlementOptions,
|
|
1179
|
+
loading: r.settlementLoading,
|
|
1180
|
+
placeholder: "Обрати",
|
|
1181
|
+
onSearch: r.loadSettlements
|
|
1182
|
+
}, null, 8, [
|
|
1183
|
+
"modelValue",
|
|
1184
|
+
"display-value",
|
|
1185
|
+
"options",
|
|
1186
|
+
"loading"
|
|
1187
|
+
]),
|
|
1188
|
+
k("label", ht, [
|
|
1189
|
+
t[17] ||= A(" Код населеного пункту (КАТОТТГ) ", -1),
|
|
1190
|
+
t[18] ||= k("span", { class: "text-red-400" }, "*", -1),
|
|
1191
|
+
k("input", {
|
|
1192
|
+
value: r.settlementId,
|
|
1193
|
+
type: "text",
|
|
1194
|
+
readonly: "",
|
|
1195
|
+
tabindex: "-1",
|
|
1196
|
+
class: "mt-1.5 w-full cursor-default rounded-xl border border-gray-200 bg-gray-50 px-3.5 py-2.5 text-sm text-gray-700 outline-none placeholder:text-gray-400",
|
|
1197
|
+
placeholder: "Заповнюється після вибору населеного пункту"
|
|
1198
|
+
}, null, 8, gt)
|
|
1199
|
+
]),
|
|
1200
|
+
k("button", {
|
|
1201
|
+
type: "button",
|
|
1202
|
+
class: P(["flex w-full cursor-pointer select-none items-center justify-between gap-3 rounded-xl border px-4 py-3 text-left transition-all", r.manualAddress ? "border-[#2663EB]/30 bg-[#EFF4FE]" : "border-gray-200 bg-white hover:border-gray-300"]),
|
|
1203
|
+
onClick: r.toggleManualAddress
|
|
1204
|
+
}, [k("div", _t, [k("div", { class: P(["flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-colors", r.manualAddress ? "bg-[#2663EB]" : "bg-gray-200"]) }, [j(r.AppIcon, {
|
|
1205
|
+
name: "map-pin",
|
|
1206
|
+
class: P(["h-3.5 w-3.5", r.manualAddress ? "text-white" : "text-gray-500"])
|
|
1207
|
+
}, null, 8, ["class"])], 2), k("div", vt, [k("p", { class: P(["text-xs font-semibold", r.manualAddress ? "text-[#2663EB]" : "text-gray-700"]) }, "Адресу не знайдено", 2), t[19] ||= k("p", { class: "truncate text-xs leading-snug text-gray-400" }, "Вказати адресу вручну у полі «Місцезнаходження»", -1)])]), k("div", { class: P(["relative h-5 w-9 shrink-0 rounded-full transition-colors", r.manualAddress ? "bg-[#2663EB]" : "bg-gray-300"]) }, [k("span", { class: P(["absolute top-0.5 h-4 w-4 rounded-full bg-white shadow transition-all", r.manualAddress ? "left-[18px]" : "left-0.5"]) }, null, 2)], 2)], 2),
|
|
1208
|
+
r.manualAddress ? (L(), O("div", yt, [t[20] ||= k("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, [A(" Місцезнаходження "), k("span", { class: "text-red-400" }, "*")], -1), U(k("input", {
|
|
1209
|
+
"onUpdate:modelValue": t[2] ||= (e) => r.manualValue = e,
|
|
1210
|
+
type: "text",
|
|
1211
|
+
placeholder: "Введіть адресу вручну...",
|
|
1212
|
+
class: "w-full rounded-xl border border-gray-200 px-3.5 py-2.5 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-400 focus:border-[#2663EB] focus:ring-2 focus:ring-[#2663EB]/15"
|
|
1213
|
+
}, null, 512), [[B, r.manualValue]])])) : (L(), E(r.FormSuggestSelect, {
|
|
1214
|
+
key: 1,
|
|
1215
|
+
modelValue: r.addressId,
|
|
1216
|
+
"onUpdate:modelValue": t[3] ||= (e) => r.addressId = e,
|
|
1217
|
+
"display-value": r.addressLabel,
|
|
1218
|
+
"onUpdate:displayValue": t[4] ||= (e) => r.addressLabel = e,
|
|
1219
|
+
label: "Адреса",
|
|
1220
|
+
required: "",
|
|
1221
|
+
options: r.addressOptions,
|
|
1222
|
+
loading: r.addressLoading,
|
|
1223
|
+
disabled: !r.settlementId,
|
|
1224
|
+
placeholder: r.settlementId ? "Обрати" : "Спочатку оберіть населений пункт",
|
|
1225
|
+
onSearch: r.loadAddresses,
|
|
1226
|
+
onSelect: r.onAddressSelect
|
|
1227
|
+
}, null, 8, [
|
|
1228
|
+
"modelValue",
|
|
1229
|
+
"display-value",
|
|
1230
|
+
"options",
|
|
1231
|
+
"loading",
|
|
1232
|
+
"disabled",
|
|
1233
|
+
"placeholder"
|
|
1234
|
+
]))
|
|
1235
|
+
])]), k("div", bt, [t[24] ||= k("div", { class: "border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, [k("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, "Деталі заявки")], -1), k("div", xt, [
|
|
1236
|
+
j(r.FormSearchSelect, {
|
|
1237
|
+
modelValue: r.workTypeLabel,
|
|
1238
|
+
"onUpdate:modelValue": t[5] ||= (e) => r.workTypeLabel = e,
|
|
1239
|
+
label: "Вид робіт",
|
|
1240
|
+
required: "",
|
|
1241
|
+
options: r.workTypeOptions
|
|
1242
|
+
}, null, 8, ["modelValue", "options"]),
|
|
1243
|
+
k("div", null, [t[21] ||= k("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, "Опис запиту", -1), U(k("textarea", {
|
|
1244
|
+
"onUpdate:modelValue": t[6] ||= (e) => r.description = e,
|
|
1245
|
+
rows: "3",
|
|
1246
|
+
placeholder: "Опишіть запит...",
|
|
1247
|
+
class: "w-full resize-none rounded-xl border border-gray-200 px-3.5 py-2.5 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-400 focus:border-[#2663EB] focus:ring-2 focus:ring-[#2663EB]/15"
|
|
1248
|
+
}, null, 512), [[B, r.description]])]),
|
|
1249
|
+
k("div", null, [t[22] ||= k("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, [A(" Підстава виконання робіт "), k("span", { class: "ml-1 font-normal text-gray-400" }, "(у складі якої документації розробляється, які вихідні дані)")], -1), U(k("textarea", {
|
|
1250
|
+
"onUpdate:modelValue": t[7] ||= (e) => r.basis = e,
|
|
1251
|
+
rows: "3",
|
|
1252
|
+
placeholder: "Вкажіть підставу...",
|
|
1253
|
+
class: "w-full resize-none rounded-xl border border-gray-200 px-3.5 py-2.5 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-400 focus:border-[#2663EB] focus:ring-2 focus:ring-[#2663EB]/15"
|
|
1254
|
+
}, null, 512), [[B, r.basis]])]),
|
|
1255
|
+
k("div", null, [t[23] ||= k("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, "Примітки", -1), U(k("textarea", {
|
|
1256
|
+
"onUpdate:modelValue": t[8] ||= (e) => r.notes = e,
|
|
1257
|
+
rows: "2",
|
|
1258
|
+
placeholder: "Додаткові примітки...",
|
|
1259
|
+
class: "w-full resize-none rounded-xl border border-gray-200 px-3.5 py-2.5 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-400 focus:border-[#2663EB] focus:ring-2 focus:ring-[#2663EB]/15"
|
|
1260
|
+
}, null, 512), [[B, r.notes]])])
|
|
1261
|
+
])])]), k("div", St, [k("div", Ct, [k("div", wt, [j(r.AppIcon, {
|
|
1262
|
+
name: "map-pin",
|
|
1263
|
+
class: "h-3.5 w-3.5 text-gray-400"
|
|
1264
|
+
}), t[25] ||= k("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, [A(" Карта "), k("span", { class: "text-red-400" }, "*")], -1)]), k("div", Tt, [j(r.ApplicationCreateMap, {
|
|
1265
|
+
points: r.mapPoints,
|
|
1266
|
+
"onUpdate:points": t[9] ||= (e) => r.mapPoints = e,
|
|
1267
|
+
geometry: r.importedGeom,
|
|
1268
|
+
"onUpdate:geometry": t[10] ||= (e) => r.importedGeom = e,
|
|
1269
|
+
"address-point": r.addressPoint,
|
|
1270
|
+
onImport: t[11] ||= (e) => r.importOpen = !0
|
|
1271
|
+
}, null, 8, [
|
|
1272
|
+
"points",
|
|
1273
|
+
"geometry",
|
|
1274
|
+
"address-point"
|
|
1275
|
+
])])]), k("div", Et, [
|
|
1276
|
+
k("div", Dt, [j(r.AppIcon, {
|
|
1277
|
+
name: "alert-circle",
|
|
1278
|
+
class: "h-[13px] w-[13px]"
|
|
1279
|
+
}), t[26] ||= k("span", null, [
|
|
1280
|
+
A("Поля із "),
|
|
1281
|
+
k("span", { class: "font-medium text-red-400" }, "*"),
|
|
1282
|
+
A(" обов'язкові")
|
|
1283
|
+
], -1)]),
|
|
1284
|
+
r.error ? (L(), O("p", Ot, z(r.error), 1)) : D("", !0),
|
|
1285
|
+
k("div", kt, [j(r.RouterLink, {
|
|
1286
|
+
to: "/requests",
|
|
1287
|
+
class: "flex-1 rounded-xl bg-gray-100 px-4 py-2.5 text-center text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200"
|
|
1288
|
+
}, {
|
|
1289
|
+
default: H(() => [...t[27] ||= [A(" Скасувати ", -1)]]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
}), k("button", {
|
|
1292
|
+
type: "submit",
|
|
1293
|
+
class: "flex-1 rounded-xl bg-[#2663EB] px-4 py-2.5 text-sm font-medium text-white transition-all hover:bg-[#1d52cc] active:scale-95 disabled:cursor-not-allowed disabled:opacity-40",
|
|
1294
|
+
disabled: !r.canSubmit || r.submitting
|
|
1295
|
+
}, z(r.submitting ? "Відправлення…" : "Відправити"), 9, At)])
|
|
1296
|
+
])])])], 32),
|
|
1297
|
+
r.importOpen ? (L(), E(r.GeometryImportDialog, {
|
|
1298
|
+
key: 0,
|
|
1299
|
+
onClose: t[12] ||= (e) => r.importOpen = !1,
|
|
1300
|
+
onImported: r.onGeometryImported
|
|
1301
|
+
})) : D("", !0)
|
|
1302
|
+
]);
|
|
1303
|
+
}
|
|
1304
|
+
var Mt = /*#__PURE__*/ e(nt, [["render", jt], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/create.vue"]]);
|
|
1305
|
+
//#endregion
|
|
1306
|
+
export { Mt as default };
|