@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
|
@@ -1,1047 +0,0 @@
|
|
|
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-CWoQ2be-.js";
|
|
8
|
-
import { i as v, n as y } from "./geometry-DyhIVRcw.js";
|
|
9
|
-
import { t as b } from "./work_types-Hwme-FEX.js";
|
|
10
|
-
import { t as x } from "./MapLayerMenu-AUeTqgEp.js";
|
|
11
|
-
import { t as S } from "./FormFilePicker-DxPQlxgy.js";
|
|
12
|
-
import { i as C, r as w, s as T } from "./applications-CLhv5l_j.js";
|
|
13
|
-
import { Fragment as E, computed as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createTextVNode as M, createVNode as N, defineComponent as P, nextTick as F, normalizeClass as I, normalizeStyle as L, onBeforeUnmount as R, onMounted as z, onUnmounted as B, openBlock as V, ref as H, renderList as U, shallowRef as ee, toDisplayString as W, vModelText as G, watch as K, withCtx as q, withDirectives as J, withModifiers as Y } from "vue";
|
|
14
|
-
import { RouterLink as te, useRouter as ne } from "vue-router";
|
|
15
|
-
//#region cabinet/src/pages/requests/components/FormSearchSelect.vue?vue&type=script&setup=true&lang.ts
|
|
16
|
-
var re = /*@__PURE__*/ P({
|
|
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 = H(!1), c = H(""), l = H(null), u = H(null), d = H(null), f = H(null), p = D(() => r.options.filter((e) => e.toLowerCase().includes(c.value.trim().toLowerCase()))), m = D(() => 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 y(e) {
|
|
77
|
-
i("update:modelValue", e), s.value = !1;
|
|
78
|
-
}
|
|
79
|
-
function b(e) {
|
|
80
|
-
let t = e.target;
|
|
81
|
-
l.value?.contains(t) || u.value?.contains(t) || (s.value = !1);
|
|
82
|
-
}
|
|
83
|
-
K(s, async (e) => {
|
|
84
|
-
_(), e && (c.value = "", h(), g(), await F(), d.value?.focus());
|
|
85
|
-
}), z(() => document.addEventListener("mousedown", b)), R(() => {
|
|
86
|
-
document.removeEventListener("mousedown", b), _();
|
|
87
|
-
});
|
|
88
|
-
let x = {
|
|
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: y,
|
|
104
|
-
onDocumentClick: b,
|
|
105
|
-
AppIcon: a,
|
|
106
|
-
SurveyorTeleport: o
|
|
107
|
-
};
|
|
108
|
-
return Object.defineProperty(x, "__isScriptSetup", {
|
|
109
|
-
enumerable: !1,
|
|
110
|
-
value: !0
|
|
111
|
-
}), x;
|
|
112
|
-
}
|
|
113
|
-
}), ie = { class: "mb-1.5 block text-xs font-medium text-gray-700" }, ae = {
|
|
114
|
-
key: 0,
|
|
115
|
-
class: "text-red-400"
|
|
116
|
-
}, oe = {
|
|
117
|
-
ref: "rootRef",
|
|
118
|
-
class: "relative"
|
|
119
|
-
}, se = ["disabled"], ce = { class: "border-b border-gray-100 p-2" }, le = { class: "relative" }, ue = { class: "max-h-48 overflow-y-auto" }, de = {
|
|
120
|
-
key: 0,
|
|
121
|
-
class: "px-3 py-3 text-center text-xs text-gray-400"
|
|
122
|
-
}, fe = ["onClick"];
|
|
123
|
-
function pe(e, t, n, r, i, a) {
|
|
124
|
-
return V(), A("div", null, [j("label", ie, [M(W(n.label) + " ", 1), n.required ? (V(), A("span", ae, "*")) : k("", !0)]), j("div", oe, [j("button", {
|
|
125
|
-
type: "button",
|
|
126
|
-
disabled: n.disabled,
|
|
127
|
-
class: I(["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
|
-
}, [j("span", { class: I(n.modelValue ? "text-gray-900" : "text-gray-400") }, W(n.modelValue || n.placeholder), 3), N(r.AppIcon, {
|
|
130
|
-
name: "chevron-down",
|
|
131
|
-
class: I(["h-[15px] w-[15px] shrink-0 text-gray-400 transition-transform", r.open ? "rotate-180" : ""])
|
|
132
|
-
}, null, 8, ["class"])], 10, se), N(r.SurveyorTeleport, null, {
|
|
133
|
-
default: q(() => [r.open ? (V(), A("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: L(r.dropdownStyle),
|
|
138
|
-
onMousedown: t[1] ||= Y(() => {}, ["stop"])
|
|
139
|
-
}, [j("div", ce, [j("div", le, [N(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
|
-
}), J(j("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), [[G, r.query]])])]), j("div", ue, [r.filtered.length === 0 ? (V(), A("p", de, "Нічого не знайдено")) : k("", !0), (V(!0), A(E, null, U(r.filtered, (e) => (V(), A("button", {
|
|
149
|
-
key: e,
|
|
150
|
-
type: "button",
|
|
151
|
-
class: I(["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
|
-
}, W(e), 11, fe))), 128))])], 36)) : k("", !0)]),
|
|
154
|
-
_: 1
|
|
155
|
-
})], 512)]);
|
|
156
|
-
}
|
|
157
|
-
var me = /*#__PURE__*/ e(re, [["render", pe], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/FormSearchSelect.vue"]]), he = /*@__PURE__*/ P({
|
|
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 = H(!1), c = H(""), l = H(null), u = H(null), d = H(null), f = H(null), p = D(() => {
|
|
206
|
-
let e = c.value.trim().toLowerCase();
|
|
207
|
-
return e ? r.options.filter((t) => t.text.toLowerCase().includes(e)) : r.options;
|
|
208
|
-
}), m = D(() => 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 y(e) {
|
|
226
|
-
i("update:modelValue", e.id), i("update:displayValue", e.text), i("select", e), s.value = !1;
|
|
227
|
-
}
|
|
228
|
-
function b(e) {
|
|
229
|
-
let t = e.target;
|
|
230
|
-
l.value?.contains(t) || u.value?.contains(t) || (s.value = !1);
|
|
231
|
-
}
|
|
232
|
-
let x;
|
|
233
|
-
K(c, (e) => {
|
|
234
|
-
s.value && (clearTimeout(x), x = setTimeout(() => i("search", e.trim()), 280));
|
|
235
|
-
}), K(s, async (e) => {
|
|
236
|
-
_(), e && (c.value = "", h(), g(), i("search", ""), await F(), d.value?.focus());
|
|
237
|
-
}), z(() => document.addEventListener("mousedown", b)), R(() => {
|
|
238
|
-
document.removeEventListener("mousedown", b), _(), clearTimeout(x);
|
|
239
|
-
});
|
|
240
|
-
let S = {
|
|
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: y,
|
|
256
|
-
onDocumentClick: b,
|
|
257
|
-
get searchTimer() {
|
|
258
|
-
return x;
|
|
259
|
-
},
|
|
260
|
-
set searchTimer(e) {
|
|
261
|
-
x = e;
|
|
262
|
-
},
|
|
263
|
-
AppIcon: a,
|
|
264
|
-
SurveyorTeleport: o
|
|
265
|
-
};
|
|
266
|
-
return Object.defineProperty(S, "__isScriptSetup", {
|
|
267
|
-
enumerable: !1,
|
|
268
|
-
value: !0
|
|
269
|
-
}), S;
|
|
270
|
-
}
|
|
271
|
-
}), ge = { class: "mb-1.5 block text-xs font-medium text-gray-700" }, _e = {
|
|
272
|
-
key: 0,
|
|
273
|
-
class: "text-red-400"
|
|
274
|
-
}, ve = {
|
|
275
|
-
ref: "rootRef",
|
|
276
|
-
class: "relative"
|
|
277
|
-
}, ye = ["disabled"], be = { 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
|
-
}, we = {
|
|
281
|
-
key: 1,
|
|
282
|
-
class: "px-3 py-3 text-center text-xs text-gray-400"
|
|
283
|
-
}, Te = ["onClick"];
|
|
284
|
-
function Ee(e, t, n, r, i, a) {
|
|
285
|
-
return V(), A("div", null, [j("label", ge, [M(W(n.label) + " ", 1), n.required ? (V(), A("span", _e, "*")) : k("", !0)]), j("div", ve, [j("button", {
|
|
286
|
-
type: "button",
|
|
287
|
-
disabled: n.disabled,
|
|
288
|
-
class: I(["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
|
-
}, [j("span", { class: I(n.displayValue ? "text-gray-900" : "text-gray-400") }, W(n.displayValue || n.placeholder), 3), N(r.AppIcon, {
|
|
291
|
-
name: "chevron-down",
|
|
292
|
-
class: I(["h-[15px] w-[15px] shrink-0 text-gray-400 transition-transform", r.open ? "rotate-180" : ""])
|
|
293
|
-
}, null, 8, ["class"])], 10, ye), N(r.SurveyorTeleport, null, {
|
|
294
|
-
default: q(() => [r.open ? (V(), A("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: L(r.dropdownStyle),
|
|
299
|
-
onMousedown: t[1] ||= Y(() => {}, ["stop"])
|
|
300
|
-
}, [j("div", be, [j("div", xe, [N(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
|
-
}), J(j("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), [[G, r.query]])])]), j("div", Se, [n.loading && r.filtered.length === 0 ? (V(), A("p", Ce, "Завантаження…")) : r.filtered.length === 0 ? (V(), A("p", we, "Нічого не знайдено")) : k("", !0), (V(!0), A(E, null, U(r.filtered, (e) => (V(), A("button", {
|
|
310
|
-
key: e.id,
|
|
311
|
-
type: "button",
|
|
312
|
-
class: I(["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
|
-
}, W(e.text), 11, Te))), 128))])], 36)) : k("", !0)]),
|
|
315
|
-
_: 1
|
|
316
|
-
})], 512)]);
|
|
317
|
-
}
|
|
318
|
-
var De = /*#__PURE__*/ e(he, [["render", Ee], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/FormSuggestSelect.vue"]]), X = "draft-polygon", Z = "draft-polygon-fill", Oe = "draft-polygon-line", Q = "draft-vertices", ke = "draft-vertices-layer", $ = 17, Ae = /*@__PURE__*/ P({
|
|
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: ["update:points", "import"],
|
|
335
|
-
setup(e, { expose: t, emit: n }) {
|
|
336
|
-
t();
|
|
337
|
-
let r = e, i = n, a = H(null), o = ee(null), b = ee(null), S = H(""), C = null, w = H(c), T = H([]), E = H(s), D = H([]);
|
|
338
|
-
function O(e) {
|
|
339
|
-
return w.value.find((t) => t.id === e) ?? w.value[0] ?? c[0];
|
|
340
|
-
}
|
|
341
|
-
async function k() {
|
|
342
|
-
let e = await g("application-form");
|
|
343
|
-
w.value = e.baseLayers, E.value = e.defaultBaseId, T.value = e.overlays.filter((e) => e.kind !== "applications"), D.value = T.value.filter((e) => e.defaultVisible).map((e) => e.id);
|
|
344
|
-
}
|
|
345
|
-
function A(e) {
|
|
346
|
-
let t = D.value;
|
|
347
|
-
D.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
348
|
-
}
|
|
349
|
-
function j() {
|
|
350
|
-
let e = r.geometry;
|
|
351
|
-
if (e) return {
|
|
352
|
-
type: "FeatureCollection",
|
|
353
|
-
features: [{
|
|
354
|
-
type: "Feature",
|
|
355
|
-
geometry: e,
|
|
356
|
-
properties: {}
|
|
357
|
-
}]
|
|
358
|
-
};
|
|
359
|
-
let t = r.points.map(([e, t]) => [e, t]), n = [];
|
|
360
|
-
return t.length >= 2 && n.push({
|
|
361
|
-
type: "Feature",
|
|
362
|
-
geometry: {
|
|
363
|
-
type: "LineString",
|
|
364
|
-
coordinates: t
|
|
365
|
-
},
|
|
366
|
-
properties: {}
|
|
367
|
-
}), t.length >= 3 && n.push({
|
|
368
|
-
type: "Feature",
|
|
369
|
-
geometry: {
|
|
370
|
-
type: "Polygon",
|
|
371
|
-
coordinates: [[...t, t[0]]]
|
|
372
|
-
},
|
|
373
|
-
properties: {}
|
|
374
|
-
}), {
|
|
375
|
-
type: "FeatureCollection",
|
|
376
|
-
features: n
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
function M() {
|
|
380
|
-
return {
|
|
381
|
-
type: "FeatureCollection",
|
|
382
|
-
features: (r.geometry ? [] : r.points).map(([e, t]) => ({
|
|
383
|
-
type: "Feature",
|
|
384
|
-
geometry: {
|
|
385
|
-
type: "Point",
|
|
386
|
-
coordinates: [e, t]
|
|
387
|
-
},
|
|
388
|
-
properties: {}
|
|
389
|
-
}))
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
function N(e) {
|
|
393
|
-
e.getSource(X)?.setData(j()), e.getSource(Q)?.setData(M());
|
|
394
|
-
}
|
|
395
|
-
function P(e) {
|
|
396
|
-
e.getSource(X) || (e.addSource(X, {
|
|
397
|
-
type: "geojson",
|
|
398
|
-
data: j()
|
|
399
|
-
}), e.addLayer({
|
|
400
|
-
id: Z,
|
|
401
|
-
type: "fill",
|
|
402
|
-
source: X,
|
|
403
|
-
filter: [
|
|
404
|
-
"==",
|
|
405
|
-
["geometry-type"],
|
|
406
|
-
"Polygon"
|
|
407
|
-
],
|
|
408
|
-
paint: {
|
|
409
|
-
"fill-color": "#2663EB",
|
|
410
|
-
"fill-opacity": .2
|
|
411
|
-
}
|
|
412
|
-
}), e.addLayer({
|
|
413
|
-
id: Oe,
|
|
414
|
-
type: "line",
|
|
415
|
-
source: X,
|
|
416
|
-
paint: {
|
|
417
|
-
"line-color": "#2663EB",
|
|
418
|
-
"line-width": 2
|
|
419
|
-
}
|
|
420
|
-
})), e.getSource(Q) || (e.addSource(Q, {
|
|
421
|
-
type: "geojson",
|
|
422
|
-
data: M()
|
|
423
|
-
}), e.addLayer({
|
|
424
|
-
id: ke,
|
|
425
|
-
type: "circle",
|
|
426
|
-
source: Q,
|
|
427
|
-
paint: {
|
|
428
|
-
"circle-radius": 5,
|
|
429
|
-
"circle-color": "#ffffff",
|
|
430
|
-
"circle-stroke-color": "#2663EB",
|
|
431
|
-
"circle-stroke-width": 2
|
|
432
|
-
}
|
|
433
|
-
})), N(e);
|
|
434
|
-
}
|
|
435
|
-
function F(e) {
|
|
436
|
-
let t = [e.lngLat.lng, e.lngLat.lat];
|
|
437
|
-
i("update:points", r.geometry ? [t] : [...r.points, t]);
|
|
438
|
-
}
|
|
439
|
-
function I(e) {
|
|
440
|
-
let t = document.createElement("div");
|
|
441
|
-
t.className = "maplibregl-ctrl maplibregl-ctrl-group";
|
|
442
|
-
let n = document.createElement("button");
|
|
443
|
-
return n.type = "button", n.title = "Імпортувати геометрію", n.setAttribute("aria-label", "Імпортувати геометрію"), n.style.display = "flex", n.style.alignItems = "center", n.style.justifyContent = "center", n.style.color = "#334155", n.innerHTML = "<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>", n.addEventListener("click", (t) => {
|
|
444
|
-
t.preventDefault(), t.stopPropagation(), e();
|
|
445
|
-
}), t.appendChild(n), {
|
|
446
|
-
onAdd() {
|
|
447
|
-
return t;
|
|
448
|
-
},
|
|
449
|
-
onRemove() {
|
|
450
|
-
t.remove();
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
function L(e) {
|
|
455
|
-
let t = v(r.geometry);
|
|
456
|
-
if (!t) return !1;
|
|
457
|
-
let [[n, i], [a, o]] = y(t);
|
|
458
|
-
if (![
|
|
459
|
-
n,
|
|
460
|
-
i,
|
|
461
|
-
a,
|
|
462
|
-
o
|
|
463
|
-
].every(Number.isFinite)) return !1;
|
|
464
|
-
e.resize();
|
|
465
|
-
let s = e.getCanvas();
|
|
466
|
-
if (s.clientWidth < 2 || s.clientHeight < 2) return !1;
|
|
467
|
-
let c = [Math.min(n, a), Math.min(i, o)], l = [Math.max(n, a), Math.max(i, o)];
|
|
468
|
-
return l[0] - c[0] < 1e-8 && l[1] - c[1] < 1e-8 ? (e.flyTo({
|
|
469
|
-
center: c,
|
|
470
|
-
zoom: $,
|
|
471
|
-
essential: !0,
|
|
472
|
-
duration: 600
|
|
473
|
-
}), !0) : (e.fitBounds([c, l], {
|
|
474
|
-
padding: 48,
|
|
475
|
-
duration: 600,
|
|
476
|
-
maxZoom: $,
|
|
477
|
-
essential: !0
|
|
478
|
-
}), !0);
|
|
479
|
-
}
|
|
480
|
-
function R(e) {
|
|
481
|
-
if (!W && o.value === e && r.geometry) {
|
|
482
|
-
if (!e.getSource(X)) {
|
|
483
|
-
e.once("load", () => R(e));
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
N(e), L(e) || requestAnimationFrame(() => L(e));
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
function V() {
|
|
490
|
-
let e = document.createElement("div");
|
|
491
|
-
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;
|
|
492
|
-
}
|
|
493
|
-
function U(e) {
|
|
494
|
-
let t = r.addressPoint;
|
|
495
|
-
if (!t || !C) {
|
|
496
|
-
b.value?.remove(), b.value = null;
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
b.value ? b.value.setLngLat(t) : b.value = new C.Marker({
|
|
500
|
-
element: V(),
|
|
501
|
-
anchor: "bottom"
|
|
502
|
-
}).setLngLat(t).addTo(e), e.flyTo({
|
|
503
|
-
center: t,
|
|
504
|
-
zoom: Math.max(e.getZoom(), $),
|
|
505
|
-
essential: !0
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
let W = !1;
|
|
509
|
-
z(async () => {
|
|
510
|
-
let e;
|
|
511
|
-
try {
|
|
512
|
-
let [t] = await Promise.all([d(), k()]);
|
|
513
|
-
e = t;
|
|
514
|
-
} catch (e) {
|
|
515
|
-
console.error(e), S.value = p;
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
if (W || !a.value) return;
|
|
519
|
-
C = e;
|
|
520
|
-
let t = new e.Map({
|
|
521
|
-
container: a.value,
|
|
522
|
-
style: l(O(E.value)),
|
|
523
|
-
center: [24.0297, 49.8397],
|
|
524
|
-
zoom: 13,
|
|
525
|
-
attributionControl: !1,
|
|
526
|
-
locale: _
|
|
527
|
-
});
|
|
528
|
-
t.addControl(new e.NavigationControl({ showCompass: !1 }), "top-left"), t.addControl(I(() => i("import")), "top-left"), t.on("load", () => {
|
|
529
|
-
P(t), h(t, T.value, D.value, Z), U(t);
|
|
530
|
-
}), t.on("click", (e) => F(e)), o.value = t;
|
|
531
|
-
}), B(() => {
|
|
532
|
-
W = !0, b.value?.remove(), b.value = null, o.value?.remove(), o.value = null;
|
|
533
|
-
}), K(() => [r.points, r.geometry], () => {
|
|
534
|
-
let e = o.value;
|
|
535
|
-
e?.getSource(X) && N(e);
|
|
536
|
-
}, { deep: !0 }), K(() => r.geometry, () => {
|
|
537
|
-
let e = o.value;
|
|
538
|
-
e && r.geometry && R(e);
|
|
539
|
-
}, { flush: "post" }), K(E, () => {
|
|
540
|
-
let e = o.value;
|
|
541
|
-
if (!e) return;
|
|
542
|
-
let t = () => u(e, O(E.value), f(e, T.value, [Z]));
|
|
543
|
-
e.isStyleLoaded() ? t() : e.once("load", t);
|
|
544
|
-
}), K(D, () => {
|
|
545
|
-
let e = o.value;
|
|
546
|
-
e?.isStyleLoaded() && m(e, T.value, D.value);
|
|
547
|
-
}), K(() => r.addressPoint, () => {
|
|
548
|
-
let e = o.value;
|
|
549
|
-
e?.isStyleLoaded() && U(e);
|
|
550
|
-
});
|
|
551
|
-
let G = {
|
|
552
|
-
props: r,
|
|
553
|
-
emit: i,
|
|
554
|
-
DRAFT_SOURCE: X,
|
|
555
|
-
DRAFT_FILL: Z,
|
|
556
|
-
DRAFT_LINE: Oe,
|
|
557
|
-
VERTEX_SOURCE: Q,
|
|
558
|
-
VERTEX_LAYER: ke,
|
|
559
|
-
ADDRESS_ZOOM: $,
|
|
560
|
-
mapHost: a,
|
|
561
|
-
mapRef: o,
|
|
562
|
-
addressMarker: b,
|
|
563
|
-
mapLoadError: S,
|
|
564
|
-
get maplibre() {
|
|
565
|
-
return C;
|
|
566
|
-
},
|
|
567
|
-
set maplibre(e) {
|
|
568
|
-
C = e;
|
|
569
|
-
},
|
|
570
|
-
baseLayers: w,
|
|
571
|
-
overlayLayers: T,
|
|
572
|
-
activeBaseId: E,
|
|
573
|
-
activeOverlayIds: D,
|
|
574
|
-
baseLayer: O,
|
|
575
|
-
loadLayerSettings: k,
|
|
576
|
-
toggleOverlay: A,
|
|
577
|
-
draftGeoJson: j,
|
|
578
|
-
verticesGeoJson: M,
|
|
579
|
-
refreshSources: N,
|
|
580
|
-
ensureLayers: P,
|
|
581
|
-
onMapClick: F,
|
|
582
|
-
importGeometryControl: I,
|
|
583
|
-
focusImportedGeometry: L,
|
|
584
|
-
showImportedGeometry: R,
|
|
585
|
-
addressMarkerElement: V,
|
|
586
|
-
syncAddressPoint: U,
|
|
587
|
-
get disposed() {
|
|
588
|
-
return W;
|
|
589
|
-
},
|
|
590
|
-
set disposed(e) {
|
|
591
|
-
W = e;
|
|
592
|
-
},
|
|
593
|
-
MapLayerMenu: x
|
|
594
|
-
};
|
|
595
|
-
return Object.defineProperty(G, "__isScriptSetup", {
|
|
596
|
-
enumerable: !1,
|
|
597
|
-
value: !0
|
|
598
|
-
}), G;
|
|
599
|
-
}
|
|
600
|
-
}), je = { class: "relative h-full w-full overflow-hidden rounded-xl" }, Me = {
|
|
601
|
-
ref: "mapHost",
|
|
602
|
-
class: "h-full w-full"
|
|
603
|
-
}, Ne = {
|
|
604
|
-
key: 1,
|
|
605
|
-
class: "absolute inset-0 z-[20] flex items-center justify-center bg-white/90 px-4 text-center text-sm text-red-600"
|
|
606
|
-
}, Pe = { 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" };
|
|
607
|
-
function Fe(e, t, n, r, i, a) {
|
|
608
|
-
return V(), A("div", je, [
|
|
609
|
-
j("div", Me, null, 512),
|
|
610
|
-
r.mapLoadError ? k("", !0) : (V(), O(r.MapLayerMenu, {
|
|
611
|
-
key: 0,
|
|
612
|
-
placement: "end",
|
|
613
|
-
"base-id": r.activeBaseId,
|
|
614
|
-
"active-overlay-ids": r.activeOverlayIds,
|
|
615
|
-
"base-layers": r.baseLayers,
|
|
616
|
-
overlays: r.overlayLayers,
|
|
617
|
-
onSelectBase: t[0] ||= (e) => r.activeBaseId = e,
|
|
618
|
-
onToggleOverlay: r.toggleOverlay
|
|
619
|
-
}, null, 8, [
|
|
620
|
-
"base-id",
|
|
621
|
-
"active-overlay-ids",
|
|
622
|
-
"base-layers",
|
|
623
|
-
"overlays"
|
|
624
|
-
])),
|
|
625
|
-
r.mapLoadError ? (V(), A("p", Ne, W(r.mapLoadError), 1)) : k("", !0),
|
|
626
|
-
j("div", Pe, W(n.geometry ? "Геометрію імпортовано. Клікніть на карті, щоб намалювати контур наново" : "Клікніть на карті, щоб окреслити контур (мінімум 3 точки)"), 1)
|
|
627
|
-
]);
|
|
628
|
-
}
|
|
629
|
-
var Ie = /*#__PURE__*/ e(Ae, [["render", Fe], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/ApplicationCreateMap.vue"]]), Le = /*@__PURE__*/ P({
|
|
630
|
-
__name: "GeometryImportDialog",
|
|
631
|
-
emits: ["close", "imported"],
|
|
632
|
-
setup(e, { expose: t, emit: n }) {
|
|
633
|
-
t();
|
|
634
|
-
let r = n, i = H(null), s = H(!1), c = H("");
|
|
635
|
-
function l(e) {
|
|
636
|
-
i.value = e, c.value = "";
|
|
637
|
-
}
|
|
638
|
-
async function u() {
|
|
639
|
-
if (i.value && !s.value) {
|
|
640
|
-
c.value = "", s.value = !0;
|
|
641
|
-
try {
|
|
642
|
-
let e = await T(i.value);
|
|
643
|
-
r("imported", e);
|
|
644
|
-
} catch (e) {
|
|
645
|
-
c.value = e instanceof Error ? e.message : "Не вдалося імпортувати геометрію";
|
|
646
|
-
} finally {
|
|
647
|
-
s.value = !1;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
let d = {
|
|
652
|
-
emit: r,
|
|
653
|
-
file: i,
|
|
654
|
-
importing: s,
|
|
655
|
-
error: c,
|
|
656
|
-
onFileChange: l,
|
|
657
|
-
submit: u,
|
|
658
|
-
AppIcon: a,
|
|
659
|
-
SurveyorTeleport: o,
|
|
660
|
-
FormFilePicker: S
|
|
661
|
-
};
|
|
662
|
-
return Object.defineProperty(d, "__isScriptSetup", {
|
|
663
|
-
enumerable: !1,
|
|
664
|
-
value: !0
|
|
665
|
-
}), d;
|
|
666
|
-
}
|
|
667
|
-
}), Re = {
|
|
668
|
-
class: "w-full max-w-md overflow-hidden rounded-2xl bg-white shadow-2xl",
|
|
669
|
-
role: "dialog",
|
|
670
|
-
"aria-labelledby": "geometry-import-title"
|
|
671
|
-
}, ze = { class: "flex items-center justify-between border-b border-gray-100 px-6 py-5" }, Be = { class: "flex items-center gap-3" }, Ve = { class: "flex h-9 w-9 items-center justify-center rounded-xl bg-[#EFF4FE]" }, He = {
|
|
672
|
-
key: 0,
|
|
673
|
-
class: "rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700"
|
|
674
|
-
}, Ue = { class: "flex items-center justify-end gap-2" }, We = ["disabled"];
|
|
675
|
-
function Ge(e, t, n, r, i, a) {
|
|
676
|
-
return V(), O(r.SurveyorTeleport, null, {
|
|
677
|
-
default: q(() => [j("div", {
|
|
678
|
-
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 backdrop-blur-sm",
|
|
679
|
-
onMousedown: t[2] ||= Y((e) => r.emit("close"), ["self"])
|
|
680
|
-
}, [j("div", Re, [j("div", ze, [j("div", Be, [j("div", Ve, [N(r.AppIcon, {
|
|
681
|
-
name: "upload",
|
|
682
|
-
class: "h-[17px] w-[17px] text-[#2663EB]"
|
|
683
|
-
})]), t[3] ||= j("div", null, [j("h2", {
|
|
684
|
-
id: "geometry-import-title",
|
|
685
|
-
class: "text-base font-semibold text-gray-900"
|
|
686
|
-
}, "Імпорт геометрії"), j("p", { class: "mt-0.5 text-xs text-gray-500" }, "ZIP (Shapefile) або GeoJSON")], -1)]), j("button", {
|
|
687
|
-
type: "button",
|
|
688
|
-
class: "rounded-lg p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600",
|
|
689
|
-
"aria-label": "Закрити",
|
|
690
|
-
onClick: t[0] ||= (e) => r.emit("close")
|
|
691
|
-
}, [N(r.AppIcon, {
|
|
692
|
-
name: "x",
|
|
693
|
-
class: "h-[17px] w-[17px]"
|
|
694
|
-
})])]), j("form", {
|
|
695
|
-
class: "space-y-4 px-6 py-5",
|
|
696
|
-
onSubmit: Y(r.submit, ["prevent"])
|
|
697
|
-
}, [
|
|
698
|
-
N(r.FormFilePicker, {
|
|
699
|
-
"file-name": r.file?.name,
|
|
700
|
-
accept: ".zip,.geojson,.json,application/geo+json,application/zip",
|
|
701
|
-
"button-label": "Завантажити файл",
|
|
702
|
-
onChange: r.onFileChange
|
|
703
|
-
}, null, 8, ["file-name"]),
|
|
704
|
-
r.error ? (V(), A("p", He, W(r.error), 1)) : k("", !0),
|
|
705
|
-
j("div", Ue, [j("button", {
|
|
706
|
-
type: "button",
|
|
707
|
-
class: "rounded-xl bg-gray-100 px-4 py-2.5 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200",
|
|
708
|
-
onClick: t[1] ||= (e) => r.emit("close")
|
|
709
|
-
}, " Скасувати "), j("button", {
|
|
710
|
-
type: "submit",
|
|
711
|
-
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",
|
|
712
|
-
disabled: !r.file || r.importing
|
|
713
|
-
}, W(r.importing ? "Імпортування…" : "Імпортувати"), 9, We)])
|
|
714
|
-
], 32)])], 32)]),
|
|
715
|
-
_: 1
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
var Ke = /*#__PURE__*/ e(Le, [["render", Ge], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/components/GeometryImportDialog.vue"]]), qe = "public_applications", Je = qe;
|
|
719
|
-
async function Ye(e, r, i) {
|
|
720
|
-
let a = new URLSearchParams();
|
|
721
|
-
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));
|
|
722
|
-
let o = await fetch(n(`/api/suggest/${encodeURIComponent(e)}/${encodeURIComponent(r)}?${a}`), { credentials: "include" });
|
|
723
|
-
if (!o.ok) throw Error(t(await o.text(), o.status));
|
|
724
|
-
return (await o.json()).data ?? [];
|
|
725
|
-
}
|
|
726
|
-
//#endregion
|
|
727
|
-
//#region cabinet/src/pages/requests/create.vue?vue&type=script&setup=true&lang.ts
|
|
728
|
-
var Xe = /*@__PURE__*/ P({
|
|
729
|
-
__name: "create",
|
|
730
|
-
setup(e, { expose: t }) {
|
|
731
|
-
t();
|
|
732
|
-
let n = ne(), o = H(""), s = H(""), c = H(""), l = H(""), u = H([]), d = H([]), f = H(!1), p = H(!1), m = H(!1), h = H(""), g = H(""), _ = H(""), v = H(""), y = H(""), x = H(""), S = H([]), T = H(null), E = H(!1), O = H(null), k = H(!1), A = H(""), j = D(() => r.value.find((e) => e.id === i.value)?.name ?? ""), M = b.items.map((e) => e.name);
|
|
733
|
-
K(o, () => {
|
|
734
|
-
c.value = "", l.value = "", d.value = [], O.value = null;
|
|
735
|
-
}), K(_, (e) => {
|
|
736
|
-
g.value = b.items.find((t) => t.name === e)?.code ?? "";
|
|
737
|
-
}), K(S, (e) => {
|
|
738
|
-
e.length > 0 && (T.value = null);
|
|
739
|
-
});
|
|
740
|
-
let N = D(() => {
|
|
741
|
-
let e = !!o.value, t = m.value ? h.value.trim().length > 0 : !!c.value, n = !!T.value || S.value.length >= 3;
|
|
742
|
-
return !!(g.value && e && t && n);
|
|
743
|
-
});
|
|
744
|
-
function P(e) {
|
|
745
|
-
T.value = e, S.value = [], E.value = !1;
|
|
746
|
-
}
|
|
747
|
-
async function F(e) {
|
|
748
|
-
f.value = !0;
|
|
749
|
-
try {
|
|
750
|
-
u.value = await Ye(qe, "settlement_id", {
|
|
751
|
-
search: e,
|
|
752
|
-
filter: { level: 5 }
|
|
753
|
-
});
|
|
754
|
-
} catch {
|
|
755
|
-
u.value = [];
|
|
756
|
-
} finally {
|
|
757
|
-
f.value = !1;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
async function I(e) {
|
|
761
|
-
if (!o.value) {
|
|
762
|
-
d.value = [];
|
|
763
|
-
return;
|
|
764
|
-
}
|
|
765
|
-
p.value = !0;
|
|
766
|
-
try {
|
|
767
|
-
d.value = await Ye(Je, "address_id", {
|
|
768
|
-
search: e,
|
|
769
|
-
filter: { settlement_id: o.value }
|
|
770
|
-
});
|
|
771
|
-
} catch {
|
|
772
|
-
d.value = [];
|
|
773
|
-
} finally {
|
|
774
|
-
p.value = !1;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
function L(e) {
|
|
778
|
-
if (!e) return null;
|
|
779
|
-
let t = e.coordinates, n = e.type === "Point" ? t : e.type === "MultiPoint" && Array.isArray(t) ? t[0] : null;
|
|
780
|
-
if (!Array.isArray(n) || n.length < 2) return null;
|
|
781
|
-
let r = Number(n[0]), i = Number(n[1]);
|
|
782
|
-
return !Number.isFinite(r) || !Number.isFinite(i) ? null : [r, i];
|
|
783
|
-
}
|
|
784
|
-
function R(e) {
|
|
785
|
-
O.value = L(e.geom);
|
|
786
|
-
}
|
|
787
|
-
function z() {
|
|
788
|
-
m.value = !m.value, c.value = "", l.value = "", d.value = [], h.value = "", O.value = null;
|
|
789
|
-
}
|
|
790
|
-
async function B() {
|
|
791
|
-
if (A.value = "", !i.value) {
|
|
792
|
-
A.value = "Оберіть організацію в шапці кабінету";
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
if (!N.value) {
|
|
796
|
-
A.value = "Заповніть обовʼязкові поля та окресліть територію на карті або імпортуйте геометрію";
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
let e = T.value ?? w(S.value);
|
|
800
|
-
if (!e) {
|
|
801
|
-
A.value = "Некоректний контур території";
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
let t = [v.value.trim(), x.value.trim() ? `Примітки: ${x.value.trim()}` : ""].filter(Boolean).join("\n\n");
|
|
805
|
-
k.value = !0;
|
|
806
|
-
try {
|
|
807
|
-
let r = await C({
|
|
808
|
-
organization_id: i.value,
|
|
809
|
-
work_type: g.value,
|
|
810
|
-
settlement_id: o.value,
|
|
811
|
-
is_found_address_id: !m.value,
|
|
812
|
-
...m.value ? { location: h.value.trim() } : { address_id: c.value },
|
|
813
|
-
description: t || void 0,
|
|
814
|
-
execution_basis: y.value.trim() || void 0,
|
|
815
|
-
geom: e
|
|
816
|
-
});
|
|
817
|
-
await n.push({
|
|
818
|
-
name: "requests",
|
|
819
|
-
query: {
|
|
820
|
-
submitted: r.number,
|
|
821
|
-
status: r.status
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
} catch (e) {
|
|
825
|
-
A.value = e instanceof Error ? e.message : "Не вдалося відправити звернення";
|
|
826
|
-
} finally {
|
|
827
|
-
k.value = !1;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
let V = {
|
|
831
|
-
router: n,
|
|
832
|
-
settlementId: o,
|
|
833
|
-
settlementLabel: s,
|
|
834
|
-
addressId: c,
|
|
835
|
-
addressLabel: l,
|
|
836
|
-
settlementOptions: u,
|
|
837
|
-
addressOptions: d,
|
|
838
|
-
settlementLoading: f,
|
|
839
|
-
addressLoading: p,
|
|
840
|
-
manualAddress: m,
|
|
841
|
-
manualValue: h,
|
|
842
|
-
workTypeCode: g,
|
|
843
|
-
workTypeLabel: _,
|
|
844
|
-
description: v,
|
|
845
|
-
basis: y,
|
|
846
|
-
notes: x,
|
|
847
|
-
mapPoints: S,
|
|
848
|
-
importedGeom: T,
|
|
849
|
-
importOpen: E,
|
|
850
|
-
addressPoint: O,
|
|
851
|
-
submitting: k,
|
|
852
|
-
error: A,
|
|
853
|
-
orgName: j,
|
|
854
|
-
workTypeOptions: M,
|
|
855
|
-
canSubmit: N,
|
|
856
|
-
onGeometryImported: P,
|
|
857
|
-
loadSettlements: F,
|
|
858
|
-
loadAddresses: I,
|
|
859
|
-
pointFromGeom: L,
|
|
860
|
-
onAddressSelect: R,
|
|
861
|
-
toggleManualAddress: z,
|
|
862
|
-
submit: B,
|
|
863
|
-
get RouterLink() {
|
|
864
|
-
return te;
|
|
865
|
-
},
|
|
866
|
-
AppIcon: a,
|
|
867
|
-
FormSearchSelect: me,
|
|
868
|
-
FormSuggestSelect: De,
|
|
869
|
-
ApplicationCreateMap: Ie,
|
|
870
|
-
GeometryImportDialog: Ke
|
|
871
|
-
};
|
|
872
|
-
return Object.defineProperty(V, "__isScriptSetup", {
|
|
873
|
-
enumerable: !1,
|
|
874
|
-
value: !0
|
|
875
|
-
}), V;
|
|
876
|
-
}
|
|
877
|
-
}), Ze = { class: "min-h-[calc(100vh-3.5rem)] bg-gray-50" }, Qe = { class: "border-b border-gray-200 bg-white py-4" }, $e = { class: "mx-auto max-w-[1400px] px-6" }, et = { class: "mb-3 flex items-center gap-1.5 text-xs text-gray-400" }, tt = { class: "flex items-start justify-between gap-4" }, nt = {
|
|
878
|
-
key: 0,
|
|
879
|
-
class: "flex shrink-0 items-center gap-2 rounded-lg border border-[#2663EB]/20 bg-[#EFF4FE] px-3 py-1.5"
|
|
880
|
-
}, rt = { class: "max-w-[200px] truncate text-xs font-medium text-[#2663EB]" }, it = { class: "grid grid-cols-1 gap-5 xl:grid-cols-[1fr_480px]" }, at = { class: "space-y-4" }, ot = { class: "relative z-20 rounded-2xl border border-gray-200 bg-white" }, st = { class: "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, ct = { class: "space-y-4 p-5" }, lt = { class: "block text-xs font-medium text-gray-700" }, ut = ["value"], dt = { class: "flex min-w-0 items-center gap-3" }, ft = { class: "min-w-0" }, pt = { key: 0 }, mt = { class: "overflow-hidden rounded-2xl border border-gray-200 bg-white" }, ht = { class: "space-y-4 p-5" }, gt = { class: "space-y-4" }, _t = { class: "overflow-hidden rounded-2xl border border-gray-200 bg-white" }, vt = { class: "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, yt = { class: "h-[420px]" }, bt = { class: "rounded-2xl border border-gray-200 bg-white p-5" }, xt = { class: "mb-4 flex items-center gap-2 text-xs text-gray-400" }, St = {
|
|
881
|
-
key: 0,
|
|
882
|
-
class: "mb-3 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700"
|
|
883
|
-
}, Ct = { class: "flex items-center gap-3" }, wt = ["disabled"];
|
|
884
|
-
function Tt(e, t, n, r, i, a) {
|
|
885
|
-
return V(), A("div", Ze, [
|
|
886
|
-
j("div", Qe, [j("div", $e, [j("nav", et, [
|
|
887
|
-
N(r.RouterLink, {
|
|
888
|
-
to: "/requests",
|
|
889
|
-
class: "flex items-center gap-1 transition-colors hover:text-gray-700"
|
|
890
|
-
}, {
|
|
891
|
-
default: q(() => [N(r.AppIcon, {
|
|
892
|
-
name: "home",
|
|
893
|
-
class: "h-3 w-3"
|
|
894
|
-
}), t[12] ||= j("span", null, "Звернення", -1)]),
|
|
895
|
-
_: 1
|
|
896
|
-
}),
|
|
897
|
-
N(r.AppIcon, {
|
|
898
|
-
name: "chevron-right",
|
|
899
|
-
class: "h-3 w-3"
|
|
900
|
-
}),
|
|
901
|
-
t[13] ||= j("span", { class: "font-medium text-gray-700" }, "Нове звернення", -1)
|
|
902
|
-
]), j("div", tt, [t[14] ||= j("div", null, [j("h1", { class: "text-lg font-semibold text-gray-900" }, "Нове звернення"), j("p", { class: "mt-0.5 text-sm text-gray-500" }, "Заповніть дані для створення заявки")], -1), r.orgName ? (V(), A("div", nt, [N(r.AppIcon, {
|
|
903
|
-
name: "building-2",
|
|
904
|
-
class: "h-3.5 w-3.5 text-[#2663EB]"
|
|
905
|
-
}), j("span", rt, W(r.orgName), 1)])) : k("", !0)])])]),
|
|
906
|
-
j("form", {
|
|
907
|
-
class: "mx-auto max-w-[1400px] px-6 py-5",
|
|
908
|
-
onSubmit: Y(r.submit, ["prevent"])
|
|
909
|
-
}, [j("div", it, [j("div", at, [j("div", ot, [j("div", st, [N(r.AppIcon, {
|
|
910
|
-
name: "map-pin",
|
|
911
|
-
class: "h-3.5 w-3.5 text-gray-400"
|
|
912
|
-
}), t[15] ||= j("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, "Адреса об'єкта", -1)]), j("div", ct, [
|
|
913
|
-
N(r.FormSuggestSelect, {
|
|
914
|
-
modelValue: r.settlementId,
|
|
915
|
-
"onUpdate:modelValue": t[0] ||= (e) => r.settlementId = e,
|
|
916
|
-
"display-value": r.settlementLabel,
|
|
917
|
-
"onUpdate:displayValue": t[1] ||= (e) => r.settlementLabel = e,
|
|
918
|
-
label: "Населений пункт",
|
|
919
|
-
required: "",
|
|
920
|
-
options: r.settlementOptions,
|
|
921
|
-
loading: r.settlementLoading,
|
|
922
|
-
placeholder: "Обрати",
|
|
923
|
-
onSearch: r.loadSettlements
|
|
924
|
-
}, null, 8, [
|
|
925
|
-
"modelValue",
|
|
926
|
-
"display-value",
|
|
927
|
-
"options",
|
|
928
|
-
"loading"
|
|
929
|
-
]),
|
|
930
|
-
j("label", lt, [
|
|
931
|
-
t[16] ||= M(" Код населеного пункту (КАТОТТГ) ", -1),
|
|
932
|
-
t[17] ||= j("span", { class: "text-red-400" }, "*", -1),
|
|
933
|
-
j("input", {
|
|
934
|
-
value: r.settlementId,
|
|
935
|
-
type: "text",
|
|
936
|
-
readonly: "",
|
|
937
|
-
tabindex: "-1",
|
|
938
|
-
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",
|
|
939
|
-
placeholder: "Заповнюється після вибору населеного пункту"
|
|
940
|
-
}, null, 8, ut)
|
|
941
|
-
]),
|
|
942
|
-
j("button", {
|
|
943
|
-
type: "button",
|
|
944
|
-
class: I(["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"]),
|
|
945
|
-
onClick: r.toggleManualAddress
|
|
946
|
-
}, [j("div", dt, [j("div", { class: I(["flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-colors", r.manualAddress ? "bg-[#2663EB]" : "bg-gray-200"]) }, [N(r.AppIcon, {
|
|
947
|
-
name: "map-pin",
|
|
948
|
-
class: I(["h-3.5 w-3.5", r.manualAddress ? "text-white" : "text-gray-500"])
|
|
949
|
-
}, null, 8, ["class"])], 2), j("div", ft, [j("p", { class: I(["text-xs font-semibold", r.manualAddress ? "text-[#2663EB]" : "text-gray-700"]) }, "Адресу не знайдено", 2), t[18] ||= j("p", { class: "truncate text-xs leading-snug text-gray-400" }, "Вказати адресу вручну у полі «Місцезнаходження»", -1)])]), j("div", { class: I(["relative h-5 w-9 shrink-0 rounded-full transition-colors", r.manualAddress ? "bg-[#2663EB]" : "bg-gray-300"]) }, [j("span", { class: I(["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),
|
|
950
|
-
r.manualAddress ? (V(), A("div", pt, [t[19] ||= j("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, [M(" Місцезнаходження "), j("span", { class: "text-red-400" }, "*")], -1), J(j("input", {
|
|
951
|
-
"onUpdate:modelValue": t[2] ||= (e) => r.manualValue = e,
|
|
952
|
-
type: "text",
|
|
953
|
-
placeholder: "Введіть адресу вручну...",
|
|
954
|
-
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"
|
|
955
|
-
}, null, 512), [[G, r.manualValue]])])) : (V(), O(r.FormSuggestSelect, {
|
|
956
|
-
key: 1,
|
|
957
|
-
modelValue: r.addressId,
|
|
958
|
-
"onUpdate:modelValue": t[3] ||= (e) => r.addressId = e,
|
|
959
|
-
"display-value": r.addressLabel,
|
|
960
|
-
"onUpdate:displayValue": t[4] ||= (e) => r.addressLabel = e,
|
|
961
|
-
label: "Адреса",
|
|
962
|
-
required: "",
|
|
963
|
-
options: r.addressOptions,
|
|
964
|
-
loading: r.addressLoading,
|
|
965
|
-
disabled: !r.settlementId,
|
|
966
|
-
placeholder: r.settlementId ? "Обрати" : "Спочатку оберіть населений пункт",
|
|
967
|
-
onSearch: r.loadAddresses,
|
|
968
|
-
onSelect: r.onAddressSelect
|
|
969
|
-
}, null, 8, [
|
|
970
|
-
"modelValue",
|
|
971
|
-
"display-value",
|
|
972
|
-
"options",
|
|
973
|
-
"loading",
|
|
974
|
-
"disabled",
|
|
975
|
-
"placeholder"
|
|
976
|
-
]))
|
|
977
|
-
])]), j("div", mt, [t[23] ||= j("div", { class: "border-b border-gray-100 bg-gray-50/60 px-5 py-3" }, [j("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, "Деталі заявки")], -1), j("div", ht, [
|
|
978
|
-
N(r.FormSearchSelect, {
|
|
979
|
-
modelValue: r.workTypeLabel,
|
|
980
|
-
"onUpdate:modelValue": t[5] ||= (e) => r.workTypeLabel = e,
|
|
981
|
-
label: "Вид робіт",
|
|
982
|
-
required: "",
|
|
983
|
-
options: r.workTypeOptions
|
|
984
|
-
}, null, 8, ["modelValue", "options"]),
|
|
985
|
-
j("div", null, [t[20] ||= j("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, "Опис запиту", -1), J(j("textarea", {
|
|
986
|
-
"onUpdate:modelValue": t[6] ||= (e) => r.description = e,
|
|
987
|
-
rows: "3",
|
|
988
|
-
placeholder: "Опишіть запит...",
|
|
989
|
-
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"
|
|
990
|
-
}, null, 512), [[G, r.description]])]),
|
|
991
|
-
j("div", null, [t[21] ||= j("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, [M(" Підстава виконання робіт "), j("span", { class: "ml-1 font-normal text-gray-400" }, "(у складі якої документації розробляється, які вихідні дані)")], -1), J(j("textarea", {
|
|
992
|
-
"onUpdate:modelValue": t[7] ||= (e) => r.basis = e,
|
|
993
|
-
rows: "3",
|
|
994
|
-
placeholder: "Вкажіть підставу...",
|
|
995
|
-
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"
|
|
996
|
-
}, null, 512), [[G, r.basis]])]),
|
|
997
|
-
j("div", null, [t[22] ||= j("label", { class: "mb-1.5 block text-xs font-medium text-gray-700" }, "Примітки", -1), J(j("textarea", {
|
|
998
|
-
"onUpdate:modelValue": t[8] ||= (e) => r.notes = e,
|
|
999
|
-
rows: "2",
|
|
1000
|
-
placeholder: "Додаткові примітки...",
|
|
1001
|
-
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"
|
|
1002
|
-
}, null, 512), [[G, r.notes]])])
|
|
1003
|
-
])])]), j("div", gt, [j("div", _t, [j("div", vt, [N(r.AppIcon, {
|
|
1004
|
-
name: "map-pin",
|
|
1005
|
-
class: "h-3.5 w-3.5 text-gray-400"
|
|
1006
|
-
}), t[24] ||= j("h3", { class: "text-xs font-semibold uppercase tracking-wider text-gray-500" }, [M(" Карта "), j("span", { class: "text-red-400" }, "*")], -1)]), j("div", yt, [N(r.ApplicationCreateMap, {
|
|
1007
|
-
points: r.mapPoints,
|
|
1008
|
-
"onUpdate:points": t[9] ||= (e) => r.mapPoints = e,
|
|
1009
|
-
geometry: r.importedGeom,
|
|
1010
|
-
"address-point": r.addressPoint,
|
|
1011
|
-
onImport: t[10] ||= (e) => r.importOpen = !0
|
|
1012
|
-
}, null, 8, [
|
|
1013
|
-
"points",
|
|
1014
|
-
"geometry",
|
|
1015
|
-
"address-point"
|
|
1016
|
-
])])]), j("div", bt, [
|
|
1017
|
-
j("div", xt, [N(r.AppIcon, {
|
|
1018
|
-
name: "alert-circle",
|
|
1019
|
-
class: "h-[13px] w-[13px]"
|
|
1020
|
-
}), t[25] ||= j("span", null, [
|
|
1021
|
-
M("Поля із "),
|
|
1022
|
-
j("span", { class: "font-medium text-red-400" }, "*"),
|
|
1023
|
-
M(" обов'язкові")
|
|
1024
|
-
], -1)]),
|
|
1025
|
-
r.error ? (V(), A("p", St, W(r.error), 1)) : k("", !0),
|
|
1026
|
-
j("div", Ct, [N(r.RouterLink, {
|
|
1027
|
-
to: "/requests",
|
|
1028
|
-
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"
|
|
1029
|
-
}, {
|
|
1030
|
-
default: q(() => [...t[26] ||= [M(" Скасувати ", -1)]]),
|
|
1031
|
-
_: 1
|
|
1032
|
-
}), j("button", {
|
|
1033
|
-
type: "submit",
|
|
1034
|
-
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",
|
|
1035
|
-
disabled: !r.canSubmit || r.submitting
|
|
1036
|
-
}, W(r.submitting ? "Відправлення…" : "Відправити"), 9, wt)])
|
|
1037
|
-
])])])], 32),
|
|
1038
|
-
r.importOpen ? (V(), O(r.GeometryImportDialog, {
|
|
1039
|
-
key: 0,
|
|
1040
|
-
onClose: t[11] ||= (e) => r.importOpen = !1,
|
|
1041
|
-
onImported: r.onGeometryImported
|
|
1042
|
-
})) : k("", !0)
|
|
1043
|
-
]);
|
|
1044
|
-
}
|
|
1045
|
-
var Et = /*#__PURE__*/ e(Xe, [["render", Tt], ["__file", "C:/softpro/surveyor/cabinet/src/pages/requests/create.vue"]]);
|
|
1046
|
-
//#endregion
|
|
1047
|
-
export { Et as default };
|