@opengis/gis 0.2.116 → 0.2.118
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/CardIcon-FxpK90rl.js +51 -0
- package/dist/EntityCreatePage-Da8XgBKU.js +141 -0
- package/dist/EntityEditPage-QktKEAxz.js +167 -0
- package/dist/EntityTablePage-ii-Wz0YZ.js +286 -0
- package/dist/ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-Bl5ZwNQX.js +70 -0
- package/dist/FileEdit-C7tteUeG.js +37 -0
- package/dist/HeaderActions.vue_vue_type_script_setup_true_lang-CKEep8BL.js +796 -0
- package/dist/MapSettings-CjJ7WWkn.js +672 -0
- package/dist/MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js +29 -0
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-Bs7gz6Lt.js +408 -0
- package/dist/RastersTablePage-DpKkFOyo.js +359 -0
- package/dist/TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js +47 -0
- package/dist/cartocss-C_O8qG3h.js +892 -0
- package/dist/import-utils-BbZ1gVp-.js +123 -0
- package/dist/index-4aSsUBB8.js +10020 -0
- package/dist/index.css +1 -1
- package/dist/index.js +16 -17634
- package/dist/index.umd.cjs +41 -244
- package/dist/raster-Du8ZMtjf.js +664 -0
- package/dist/register-B2gF-GzA.js +780 -0
- package/dist/service-BnPCDVwm.js +2573 -0
- package/dist/vs-datatable-QKks38xL.js +800 -0
- package/module/gis/form/feedback.answer.form.json +11 -0
- package/module/gis/form/gis.cartocss.form.json +8 -0
- package/module/gis/form/gis.metadata_new.form.json +196 -0
- package/module/gis/form/gis.ogc_service.form.json +8 -2
- package/module/gis/select/layer_list_text.sql +7 -0
- package/module/gis/select/pg.column_name.geometry.sql +13 -0
- package/module/gis/table/gis.metadata_new.table.json +138 -0
- package/module/gis/table/site.gis.registers.table.json +1 -1
- package/package.json +3 -4
- package/server/routes/gis/cartocss/get.cartocss.js +1 -1
- package/server/routes/mapnik/controllers/clearTiles.js +8 -4
- package/server/routes/mapnik/controllers/createXmlMulti.js +1 -1
- package/server/routes/mapnik/controllers/fileSearch.js +6 -2
- package/server/routes/mapnik/controllers/fileStat.js +4 -3
- package/server/routes/mapnik/controllers/mapnikLogger.js +1 -1
- package/server/routes/mapnik/controllers/mapnikStat.js +1 -1
- package/server/routes/mapnik/controllers/rasterInfo.js +5 -2
- package/server/routes/mapnik/controllers/readDir.js +5 -2
- package/server/routes/mapnik/controllers/rtile.js +16 -3
- package/server/routes/mapnik/index.js +0 -1
|
@@ -0,0 +1,780 @@
|
|
|
1
|
+
import { defineComponent as B, mergeModels as j, useModel as S, computed as h, defineAsyncComponent as O, ref as $, watch as D, onBeforeUnmount as K, openBlock as k, createElementBlock as C, createElementVNode as l, createBlock as T, unref as U, createTextVNode as q, createVNode as V, toDisplayString as M, resolveDynamicComponent as J, onMounted as G, resolveComponent as W, withCtx as I, Fragment as X, createCommentVNode as Y } from "vue";
|
|
2
|
+
import { useRoute as Z, useRouter as ee } from "vue-router";
|
|
3
|
+
import { notify as F } from "@opengis/core";
|
|
4
|
+
import { _ as te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
|
|
5
|
+
import { V as N } from "./vs-datatable-QKks38xL.js";
|
|
6
|
+
import { _ as z, n as R, m as E, r as H } from "./import-utils-BbZ1gVp-.js";
|
|
7
|
+
import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-4aSsUBB8.js";
|
|
8
|
+
import { LucideChevronRight as re } from "lucide-vue-next";
|
|
9
|
+
import { _ as ne } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
|
|
10
|
+
const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max container" }, ce = { class: "flex flex-wrap" }, me = { class: "h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6" }, ve = { class: "h-fit w-full flex flex-wrap" }, pe = { class: "w-full" }, fe = /* @__PURE__ */ B({
|
|
11
|
+
__name: "list-tab",
|
|
12
|
+
props: /* @__PURE__ */ j({
|
|
13
|
+
fields: {}
|
|
14
|
+
}, {
|
|
15
|
+
data: { default: {} },
|
|
16
|
+
dataModifiers: {},
|
|
17
|
+
form: {},
|
|
18
|
+
formModifiers: {}
|
|
19
|
+
}),
|
|
20
|
+
emits: ["update:data", "update:form"],
|
|
21
|
+
setup(g) {
|
|
22
|
+
const t = S(g, "data"), p = S(g, "form"), w = g, A = h(() => Array.isArray(w.fields) ? w.fields : []), y = (e) => H(e || {}), m = O(() => import("@opengis/form")), d = $(), _ = $(!1), u = $([]), b = () => {
|
|
23
|
+
const e = c.value.map((s) => y(s)).filter((s) => s.length > 0);
|
|
24
|
+
u.value = [...e], _.value = !0;
|
|
25
|
+
}, x = h(
|
|
26
|
+
() => {
|
|
27
|
+
var e, s;
|
|
28
|
+
return ((e = t.value) == null ? void 0 : e.token) || ((s = t.value) == null ? void 0 : s.id) || "register-form";
|
|
29
|
+
}
|
|
30
|
+
), c = h({
|
|
31
|
+
get: () => (t.value || (t.value = {}), Array.isArray(t.value.columns) || (t.value.columns = []), t.value.columns),
|
|
32
|
+
set: (e) => {
|
|
33
|
+
t.value || (t.value = {}), t.value.columns = Array.isArray(e) ? e : [];
|
|
34
|
+
}
|
|
35
|
+
}), o = h({
|
|
36
|
+
get: () => t.value || {},
|
|
37
|
+
set: (e) => {
|
|
38
|
+
var n;
|
|
39
|
+
const s = Array.isArray((n = t.value) == null ? void 0 : n.columns) ? t.value.columns : [];
|
|
40
|
+
t.value = {
|
|
41
|
+
...t.value,
|
|
42
|
+
...e,
|
|
43
|
+
columns: s
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
D(
|
|
48
|
+
() => d.value,
|
|
49
|
+
(e) => {
|
|
50
|
+
p.value = e || null;
|
|
51
|
+
},
|
|
52
|
+
{ immediate: !0 }
|
|
53
|
+
), D(_, (e) => {
|
|
54
|
+
e || (u.value = []);
|
|
55
|
+
});
|
|
56
|
+
const a = () => {
|
|
57
|
+
const e = new Set(
|
|
58
|
+
u.value.map((v) => R(v)).filter((v) => v.length > 0)
|
|
59
|
+
), s = Array.isArray(c.value) ? [...c.value] : [], n = A.value.filter((v) => e.has(y(v))).map((v) => {
|
|
60
|
+
const L = y(v), Q = v.title ?? v.label ?? L;
|
|
61
|
+
return {
|
|
62
|
+
...v,
|
|
63
|
+
name: L,
|
|
64
|
+
label: Q,
|
|
65
|
+
type: v.type || "text",
|
|
66
|
+
meta: v.meta ?? "features"
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
c.value = E(s, n, {
|
|
70
|
+
selectedKeys: u.value,
|
|
71
|
+
resolveKey: y
|
|
72
|
+
}), _.value = !1, u.value = [];
|
|
73
|
+
}, f = {
|
|
74
|
+
table_name: {
|
|
75
|
+
type: "select",
|
|
76
|
+
label: "Таблиця",
|
|
77
|
+
required: !0,
|
|
78
|
+
data: "pg.table_name",
|
|
79
|
+
placeholder: "Таблиця в БД",
|
|
80
|
+
validators: ["required"],
|
|
81
|
+
col: 6
|
|
82
|
+
},
|
|
83
|
+
name: {
|
|
84
|
+
type: "text",
|
|
85
|
+
label: "Назва",
|
|
86
|
+
required: !0,
|
|
87
|
+
placeholder: "Назва",
|
|
88
|
+
validators: ["required"],
|
|
89
|
+
col: 6
|
|
90
|
+
},
|
|
91
|
+
query: {
|
|
92
|
+
type: "text",
|
|
93
|
+
label: "Умова",
|
|
94
|
+
placeholder: "Умова",
|
|
95
|
+
col: 6
|
|
96
|
+
},
|
|
97
|
+
order: {
|
|
98
|
+
type: "text",
|
|
99
|
+
label: "Сортування",
|
|
100
|
+
placeholder: "Сортування",
|
|
101
|
+
col: 6
|
|
102
|
+
},
|
|
103
|
+
description: {
|
|
104
|
+
type: "textarea",
|
|
105
|
+
label: "Опис",
|
|
106
|
+
placeholder: "Опис",
|
|
107
|
+
col: 12
|
|
108
|
+
}
|
|
109
|
+
}, r = [
|
|
110
|
+
{ key: "name", label: "Name", type: "text" },
|
|
111
|
+
{ key: "label", label: "Назва", type: "text" },
|
|
112
|
+
// { key: "format", label: "Format", type: "text" },
|
|
113
|
+
{ key: "meta", label: "Мета", type: "text" }
|
|
114
|
+
// { key: "data", label: "Класифікатор", type: "text" },
|
|
115
|
+
], i = {
|
|
116
|
+
name: {
|
|
117
|
+
type: "text",
|
|
118
|
+
label: "Назва колонки",
|
|
119
|
+
validators: ["required"],
|
|
120
|
+
disabled: !0
|
|
121
|
+
},
|
|
122
|
+
ua: {
|
|
123
|
+
type: "text",
|
|
124
|
+
label: "Назва",
|
|
125
|
+
validators: ["required"]
|
|
126
|
+
},
|
|
127
|
+
format: {
|
|
128
|
+
type: "radio",
|
|
129
|
+
label: "Формат",
|
|
130
|
+
position: "horizontal",
|
|
131
|
+
options: [
|
|
132
|
+
{ text: "Text", id: "text" },
|
|
133
|
+
{ text: "Number", id: "number" },
|
|
134
|
+
{ text: "Date", id: "date" },
|
|
135
|
+
{ text: "File", id: "file" },
|
|
136
|
+
{ text: "Select", id: "select" },
|
|
137
|
+
{ text: "Badge", id: "badge" },
|
|
138
|
+
{ text: "Tags", id: "tags" }
|
|
139
|
+
],
|
|
140
|
+
validators: ["required"]
|
|
141
|
+
},
|
|
142
|
+
is_export: {
|
|
143
|
+
type: "switcher",
|
|
144
|
+
label: "Експорт",
|
|
145
|
+
info: "Чи експортувати дані колонки?",
|
|
146
|
+
view: "switcher"
|
|
147
|
+
},
|
|
148
|
+
meta: {
|
|
149
|
+
type: "combobox",
|
|
150
|
+
label: "Мета",
|
|
151
|
+
mode: "combo",
|
|
152
|
+
options: [
|
|
153
|
+
{ text: "Title", id: "title" },
|
|
154
|
+
{ text: "Features", id: "features" },
|
|
155
|
+
{ text: "Status", id: "status" },
|
|
156
|
+
{ text: "Tags", id: "tags" },
|
|
157
|
+
{ text: "Category", id: "category" },
|
|
158
|
+
{ text: "Image", id: "image" }
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
data: {
|
|
162
|
+
type: "select",
|
|
163
|
+
label: "Класифікатор",
|
|
164
|
+
data: "admin.cls.name",
|
|
165
|
+
conditions: ["format", "in", ["select", "badge", "tags"]]
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return K(() => {
|
|
169
|
+
p.value = null;
|
|
170
|
+
}), (e, s) => (k(), C("div", ue, [
|
|
171
|
+
l("div", de, [
|
|
172
|
+
l("div", ce, [
|
|
173
|
+
l("div", me, [
|
|
174
|
+
(k(), T(U(m), {
|
|
175
|
+
ref_key: "formEl",
|
|
176
|
+
ref: d,
|
|
177
|
+
key: x.value,
|
|
178
|
+
schema: f,
|
|
179
|
+
modelValue: o.value,
|
|
180
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => o.value = n)
|
|
181
|
+
}, null, 8, ["modelValue"]))
|
|
182
|
+
]),
|
|
183
|
+
l("div", ve, [
|
|
184
|
+
l("div", { class: "flex justify-end mb-3 gap-2 w-full" }, [
|
|
185
|
+
l("button", {
|
|
186
|
+
onClick: b,
|
|
187
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"
|
|
188
|
+
}, [...s[4] || (s[4] = [
|
|
189
|
+
l("svg", {
|
|
190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
191
|
+
width: "16",
|
|
192
|
+
height: "16",
|
|
193
|
+
fill: "none",
|
|
194
|
+
viewBox: "0 0 24 24",
|
|
195
|
+
stroke: "currentColor",
|
|
196
|
+
"stroke-width": "2",
|
|
197
|
+
class: "mr-1"
|
|
198
|
+
}, [
|
|
199
|
+
l("path", {
|
|
200
|
+
"stroke-linecap": "round",
|
|
201
|
+
"stroke-linejoin": "round",
|
|
202
|
+
d: "M12 4v16m8-8H4"
|
|
203
|
+
})
|
|
204
|
+
], -1),
|
|
205
|
+
q(" Імпорт ", -1)
|
|
206
|
+
])])
|
|
207
|
+
]),
|
|
208
|
+
l("div", pe, [
|
|
209
|
+
V(N, {
|
|
210
|
+
modelValue: c.value,
|
|
211
|
+
"onUpdate:modelValue": s[1] || (s[1] = (n) => c.value = n),
|
|
212
|
+
"columns-scheme": r,
|
|
213
|
+
"form-scheme": i,
|
|
214
|
+
"main-col-width": "250px",
|
|
215
|
+
"add-button": !1
|
|
216
|
+
}, null, 8, ["modelValue"])
|
|
217
|
+
])
|
|
218
|
+
])
|
|
219
|
+
])
|
|
220
|
+
]),
|
|
221
|
+
V(z, {
|
|
222
|
+
visible: _.value,
|
|
223
|
+
"onUpdate:visible": s[2] || (s[2] = (n) => _.value = n),
|
|
224
|
+
selection: u.value,
|
|
225
|
+
"onUpdate:selection": s[3] || (s[3] = (n) => u.value = n),
|
|
226
|
+
fields: A.value,
|
|
227
|
+
title: "Імпорт колонок",
|
|
228
|
+
"id-prefix": "import-column",
|
|
229
|
+
onConfirm: a
|
|
230
|
+
}, null, 8, ["visible", "selection", "fields"])
|
|
231
|
+
]));
|
|
232
|
+
}
|
|
233
|
+
}), ye = { class: "vs-form" }, be = { class: "vs-form__body auto-rows-max container" }, xe = { class: "flex flex-wrap" }, ge = { class: "h-fit w-full flex flex-wrap" }, he = { class: "w-full" }, we = /* @__PURE__ */ B({
|
|
234
|
+
__name: "filter-tab",
|
|
235
|
+
props: /* @__PURE__ */ j({
|
|
236
|
+
fields: {}
|
|
237
|
+
}, {
|
|
238
|
+
data: { default: {} },
|
|
239
|
+
dataModifiers: {},
|
|
240
|
+
form: {},
|
|
241
|
+
formModifiers: {}
|
|
242
|
+
}),
|
|
243
|
+
emits: ["update:data", "update:form"],
|
|
244
|
+
setup(g) {
|
|
245
|
+
const t = S(g, "data"), p = S(g, "form"), w = g, A = h(() => Array.isArray(w.fields) ? w.fields : []), y = (o) => H(o || {}), m = $(!1), d = $([]), _ = () => {
|
|
246
|
+
const o = u.value.map((a) => y(a)).filter((a) => a.length > 0);
|
|
247
|
+
d.value = [...o], m.value = !0;
|
|
248
|
+
}, u = h({
|
|
249
|
+
get: () => (t.value || (t.value = {}), Array.isArray(t.value.filters) || (t.value.filters = []), t.value.filters),
|
|
250
|
+
set: (o) => {
|
|
251
|
+
t.value || (t.value = {}), t.value.filters = Array.isArray(o) ? o : [];
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
D(m, (o) => {
|
|
255
|
+
o || (d.value = []);
|
|
256
|
+
});
|
|
257
|
+
const b = () => {
|
|
258
|
+
const o = new Set(
|
|
259
|
+
d.value.map((r) => R(r)).filter((r) => r.length > 0)
|
|
260
|
+
), a = Array.isArray(u.value) ? [...u.value] : [], f = A.value.filter((r) => o.has(y(r))).map((r) => ({
|
|
261
|
+
name: y(r),
|
|
262
|
+
label: r.title ?? r.label ?? y(r),
|
|
263
|
+
type: r.type || "text"
|
|
264
|
+
}));
|
|
265
|
+
u.value = E(a, f, {
|
|
266
|
+
selectedKeys: d.value,
|
|
267
|
+
resolveKey: y
|
|
268
|
+
}), m.value = !1, d.value = [];
|
|
269
|
+
}, x = [
|
|
270
|
+
{ key: "id", label: "Name" },
|
|
271
|
+
{ key: "label", label: "Назва" },
|
|
272
|
+
{ key: "type", label: "Тип" }
|
|
273
|
+
], c = {
|
|
274
|
+
name: {
|
|
275
|
+
type: "text",
|
|
276
|
+
label: "Назва колонки",
|
|
277
|
+
validators: ["required"],
|
|
278
|
+
disabled: !0
|
|
279
|
+
},
|
|
280
|
+
ua: {
|
|
281
|
+
type: "text",
|
|
282
|
+
label: "Назва",
|
|
283
|
+
validators: ["required"]
|
|
284
|
+
},
|
|
285
|
+
type: {
|
|
286
|
+
type: "radio",
|
|
287
|
+
label: "Тип",
|
|
288
|
+
validators: ["required"],
|
|
289
|
+
position: "horizontal",
|
|
290
|
+
options: [
|
|
291
|
+
{ text: "Check", id: "Check" },
|
|
292
|
+
{ text: "Range", id: "Range" },
|
|
293
|
+
{ text: "Date", id: "Date" },
|
|
294
|
+
{ text: "Text", id: "Text" },
|
|
295
|
+
{ text: "Select", id: "Select" }
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
hidden: {
|
|
299
|
+
label: "Приховати",
|
|
300
|
+
type: "Switcher"
|
|
301
|
+
},
|
|
302
|
+
data: {
|
|
303
|
+
type: "select",
|
|
304
|
+
label: "Класифікатор",
|
|
305
|
+
data: "admin.cls.name",
|
|
306
|
+
conditions: ["type", "in", ["select", "autocomplete", "check"]]
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
return K(() => {
|
|
310
|
+
p.value = null;
|
|
311
|
+
}), (o, a) => (k(), C("div", ye, [
|
|
312
|
+
l("div", be, [
|
|
313
|
+
l("div", xe, [
|
|
314
|
+
a[4] || (a[4] = l("div", { class: "h-fit w-full flex flex-wrap mb-6 px-2" }, [
|
|
315
|
+
l("p", { class: "text-sm text-gray-600" }, " Налаштуйте фільтри реєстру. Оберіть поля для імпорту або відредагуйте властивості вручну. ")
|
|
316
|
+
], -1)),
|
|
317
|
+
l("div", ge, [
|
|
318
|
+
l("div", { class: "flex justify-end mb-3 gap-2 w-full" }, [
|
|
319
|
+
l("button", {
|
|
320
|
+
onClick: _,
|
|
321
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"
|
|
322
|
+
}, [...a[3] || (a[3] = [
|
|
323
|
+
l("svg", {
|
|
324
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
325
|
+
width: "16",
|
|
326
|
+
height: "16",
|
|
327
|
+
fill: "none",
|
|
328
|
+
viewBox: "0 0 24 24",
|
|
329
|
+
stroke: "currentColor",
|
|
330
|
+
"stroke-width": "2",
|
|
331
|
+
class: "mr-1"
|
|
332
|
+
}, [
|
|
333
|
+
l("path", {
|
|
334
|
+
"stroke-linecap": "round",
|
|
335
|
+
"stroke-linejoin": "round",
|
|
336
|
+
d: "M12 4v16m8-8H4"
|
|
337
|
+
})
|
|
338
|
+
], -1),
|
|
339
|
+
q(" Імпорт ", -1)
|
|
340
|
+
])])
|
|
341
|
+
]),
|
|
342
|
+
l("div", he, [
|
|
343
|
+
V(N, {
|
|
344
|
+
modelValue: u.value,
|
|
345
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => u.value = f),
|
|
346
|
+
"columns-scheme": x,
|
|
347
|
+
"form-scheme": c,
|
|
348
|
+
"main-col-width": "250px",
|
|
349
|
+
"add-button": !1
|
|
350
|
+
}, null, 8, ["modelValue"])
|
|
351
|
+
])
|
|
352
|
+
])
|
|
353
|
+
])
|
|
354
|
+
]),
|
|
355
|
+
V(z, {
|
|
356
|
+
visible: m.value,
|
|
357
|
+
"onUpdate:visible": a[1] || (a[1] = (f) => m.value = f),
|
|
358
|
+
selection: d.value,
|
|
359
|
+
"onUpdate:selection": a[2] || (a[2] = (f) => d.value = f),
|
|
360
|
+
fields: A.value,
|
|
361
|
+
title: "Імпорт фільтрів",
|
|
362
|
+
"id-prefix": "import-filter",
|
|
363
|
+
onConfirm: b
|
|
364
|
+
}, null, 8, ["visible", "selection", "fields"])
|
|
365
|
+
]));
|
|
366
|
+
}
|
|
367
|
+
}), _e = { class: "vs-form" }, ke = { class: "vs-form__body auto-rows-max container" }, Ae = { class: "flex flex-wrap" }, $e = { class: "h-fit w-full flex flex-wrap" }, Ce = { class: "w-full" }, Ve = /* @__PURE__ */ B({
|
|
368
|
+
__name: "card-tab",
|
|
369
|
+
props: /* @__PURE__ */ j({
|
|
370
|
+
fields: {}
|
|
371
|
+
}, {
|
|
372
|
+
data: { default: {} },
|
|
373
|
+
dataModifiers: {},
|
|
374
|
+
form: {},
|
|
375
|
+
formModifiers: {}
|
|
376
|
+
}),
|
|
377
|
+
emits: ["update:data", "update:form"],
|
|
378
|
+
setup(g) {
|
|
379
|
+
const t = S(g, "data"), p = S(g, "form"), w = g, A = h(() => Array.isArray(w.fields) ? w.fields : []), y = (o) => H(o || {}), m = $(!1), d = $([]), _ = () => {
|
|
380
|
+
const o = u.value.map((a) => y(a)).filter((a) => a.length > 0);
|
|
381
|
+
d.value = [...o], m.value = !0;
|
|
382
|
+
}, u = h({
|
|
383
|
+
get: () => t.value.card,
|
|
384
|
+
set: (o) => {
|
|
385
|
+
t.value || (t.value = {}), t.value.card = Array.isArray(o) ? o : [];
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
D(m, (o) => {
|
|
389
|
+
var a;
|
|
390
|
+
if (o) {
|
|
391
|
+
const f = ((a = u.value) == null ? void 0 : a.map((r) => r.name)) || [];
|
|
392
|
+
d.value = [...f];
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
const b = () => {
|
|
396
|
+
const o = new Set(
|
|
397
|
+
d.value.map((r) => R(r)).filter((r) => r.length > 0)
|
|
398
|
+
), a = Array.isArray(u.value) ? [...u.value] : [], f = A.value.filter((r) => o.has(y(r))).map((r) => {
|
|
399
|
+
const i = y(r), e = r.title ?? r.label ?? i;
|
|
400
|
+
return {
|
|
401
|
+
...r,
|
|
402
|
+
name: i,
|
|
403
|
+
label: e,
|
|
404
|
+
format: r.format || r.type || "text",
|
|
405
|
+
meta: r.meta || "title"
|
|
406
|
+
};
|
|
407
|
+
});
|
|
408
|
+
u.value = E(a, f, {
|
|
409
|
+
selectedKeys: d.value,
|
|
410
|
+
resolveKey: y
|
|
411
|
+
}), m.value = !1, d.value = [];
|
|
412
|
+
}, x = [
|
|
413
|
+
{ key: "name", label: "Name", type: "text" },
|
|
414
|
+
{ key: "label", label: "Назва", type: "text" },
|
|
415
|
+
{ key: "format", label: "Формат", type: "text" }
|
|
416
|
+
// { key: "meta", label: "Мета", type: "text" },
|
|
417
|
+
], c = {
|
|
418
|
+
name: {
|
|
419
|
+
type: "text",
|
|
420
|
+
label: "Назва колонки",
|
|
421
|
+
validators: ["required"],
|
|
422
|
+
disabled: !0
|
|
423
|
+
},
|
|
424
|
+
ua: {
|
|
425
|
+
type: "text",
|
|
426
|
+
label: "Назва",
|
|
427
|
+
validators: ["required"]
|
|
428
|
+
},
|
|
429
|
+
format: {
|
|
430
|
+
type: "radio",
|
|
431
|
+
label: "Формат",
|
|
432
|
+
position: "horizontal",
|
|
433
|
+
options: [
|
|
434
|
+
{ text: "Text", id: "text" },
|
|
435
|
+
{ text: "Number", id: "number" },
|
|
436
|
+
{ text: "Date", id: "date" },
|
|
437
|
+
{ text: "File", id: "file" },
|
|
438
|
+
{ text: "Select", id: "select" },
|
|
439
|
+
{ text: "Badge", id: "badge" },
|
|
440
|
+
{ text: "Tags", id: "tags" }
|
|
441
|
+
],
|
|
442
|
+
validators: ["required"]
|
|
443
|
+
},
|
|
444
|
+
data: {
|
|
445
|
+
type: "text",
|
|
446
|
+
label: "Класифікатор",
|
|
447
|
+
conditions: ["format", "in", ["select", "badge", "tags"]]
|
|
448
|
+
}
|
|
449
|
+
/* meta: {
|
|
450
|
+
type: "combobox",
|
|
451
|
+
label: "Мета",
|
|
452
|
+
mode: "combo",
|
|
453
|
+
required: true,
|
|
454
|
+
options: [
|
|
455
|
+
{ text: "Title", id: "title" },
|
|
456
|
+
{ text: "Features", id: "features" },
|
|
457
|
+
{ text: "Status", id: "status" },
|
|
458
|
+
{ text: "Tags", id: "tags" },
|
|
459
|
+
{ text: "Category", id: "category" },
|
|
460
|
+
{ text: "Image", id: "image" },
|
|
461
|
+
],
|
|
462
|
+
}, */
|
|
463
|
+
};
|
|
464
|
+
return K(() => {
|
|
465
|
+
p.value = null;
|
|
466
|
+
}), (o, a) => (k(), C("div", _e, [
|
|
467
|
+
l("div", ke, [
|
|
468
|
+
l("div", Ae, [
|
|
469
|
+
a[4] || (a[4] = l("div", { class: "h-fit w-full flex flex-wrap mb-6 px-2" }, [
|
|
470
|
+
l("p", { class: "text-sm text-gray-600" }, " Налаштуйте відображення картки. Оберіть потрібні поля та відредагуйте їхні властивості. ")
|
|
471
|
+
], -1)),
|
|
472
|
+
l("div", $e, [
|
|
473
|
+
l("div", { class: "flex justify-end mb-3 gap-2 w-full" }, [
|
|
474
|
+
l("button", {
|
|
475
|
+
onClick: _,
|
|
476
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary hover:bg-primary/90 h-10 px-4 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-700 hover:to-blue-600 text-white"
|
|
477
|
+
}, [...a[3] || (a[3] = [
|
|
478
|
+
l("svg", {
|
|
479
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
480
|
+
width: "16",
|
|
481
|
+
height: "16",
|
|
482
|
+
fill: "none",
|
|
483
|
+
viewBox: "0 0 24 24",
|
|
484
|
+
stroke: "currentColor",
|
|
485
|
+
"stroke-width": "2",
|
|
486
|
+
class: "mr-1"
|
|
487
|
+
}, [
|
|
488
|
+
l("path", {
|
|
489
|
+
"stroke-linecap": "round",
|
|
490
|
+
"stroke-linejoin": "round",
|
|
491
|
+
d: "M12 4v16m8-8H4"
|
|
492
|
+
})
|
|
493
|
+
], -1),
|
|
494
|
+
q(" Імпорт ", -1)
|
|
495
|
+
])])
|
|
496
|
+
]),
|
|
497
|
+
l("div", Ce, [
|
|
498
|
+
V(N, {
|
|
499
|
+
modelValue: u.value,
|
|
500
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => u.value = f),
|
|
501
|
+
"columns-scheme": x,
|
|
502
|
+
"form-scheme": c,
|
|
503
|
+
"main-col-width": "250px",
|
|
504
|
+
"add-button": !1
|
|
505
|
+
}, null, 8, ["modelValue"])
|
|
506
|
+
])
|
|
507
|
+
])
|
|
508
|
+
])
|
|
509
|
+
]),
|
|
510
|
+
V(z, {
|
|
511
|
+
visible: m.value,
|
|
512
|
+
"onUpdate:visible": a[1] || (a[1] = (f) => m.value = f),
|
|
513
|
+
selection: d.value,
|
|
514
|
+
"onUpdate:selection": a[2] || (a[2] = (f) => d.value = f),
|
|
515
|
+
fields: A.value,
|
|
516
|
+
title: "Імпорт полів картки",
|
|
517
|
+
"id-prefix": "import-card",
|
|
518
|
+
onConfirm: b
|
|
519
|
+
}, null, 8, ["visible", "selection", "fields"])
|
|
520
|
+
]));
|
|
521
|
+
}
|
|
522
|
+
}), P = {
|
|
523
|
+
template1: ae,
|
|
524
|
+
template2: le,
|
|
525
|
+
template3: se,
|
|
526
|
+
template4: oe,
|
|
527
|
+
template5: ie
|
|
528
|
+
}, De = { class: "space-y-4" }, Se = { class: "flex items-center gap-4 bg-white border border-gray-200 rounded-lg px-6 py-4" }, qe = { class: "text-lg font-semibold mb-4" }, Be = { class: "bg-white" }, Ie = {
|
|
529
|
+
key: 1,
|
|
530
|
+
class: "text-gray-400 text-center py-12"
|
|
531
|
+
}, Te = {
|
|
532
|
+
key: 2,
|
|
533
|
+
class: "text-gray-400 text-center py-12"
|
|
534
|
+
}, Ue = /* @__PURE__ */ B({
|
|
535
|
+
__name: "preview-tab",
|
|
536
|
+
props: /* @__PURE__ */ j({
|
|
537
|
+
hideDetailsButton: { type: Boolean, default: !1 }
|
|
538
|
+
}, {
|
|
539
|
+
data: { default: {} },
|
|
540
|
+
dataModifiers: {}
|
|
541
|
+
}),
|
|
542
|
+
emits: ["update:data"],
|
|
543
|
+
setup(g) {
|
|
544
|
+
const t = O(() => import("@opengis/form")), p = S(g, "data"), w = [
|
|
545
|
+
{ text: "template1", id: "template1" },
|
|
546
|
+
{ text: "template2", id: "template2" },
|
|
547
|
+
{ text: "template3", id: "template3" },
|
|
548
|
+
{ text: "template4", id: "template4" },
|
|
549
|
+
{ text: "template5", id: "template5" }
|
|
550
|
+
], A = {
|
|
551
|
+
view: {
|
|
552
|
+
type: "radio",
|
|
553
|
+
label: "Вигляд",
|
|
554
|
+
position: "horizontal",
|
|
555
|
+
required: !0,
|
|
556
|
+
options: w,
|
|
557
|
+
col: 12
|
|
558
|
+
}
|
|
559
|
+
}, y = h(
|
|
560
|
+
() => {
|
|
561
|
+
var b;
|
|
562
|
+
return Array.isArray((b = p.value) == null ? void 0 : b.columns) ? p.value.columns : [];
|
|
563
|
+
}
|
|
564
|
+
), m = h(() => {
|
|
565
|
+
var b;
|
|
566
|
+
return ((b = p.value) == null ? void 0 : b.view) || "template1";
|
|
567
|
+
}), d = h(
|
|
568
|
+
() => P[m.value] || P.template1
|
|
569
|
+
), _ = h(() => {
|
|
570
|
+
var c;
|
|
571
|
+
const b = (c = p.value) == null ? void 0 : c.view;
|
|
572
|
+
if (!b) return "template1";
|
|
573
|
+
const x = w.find((o) => o.id === b);
|
|
574
|
+
return (x == null ? void 0 : x.text) || b;
|
|
575
|
+
}), u = h(() => (Array.isArray(p.value.tableData) ? p.value.tableData : []).slice(0, 5).map((x) => {
|
|
576
|
+
var c, o;
|
|
577
|
+
return {
|
|
578
|
+
...x,
|
|
579
|
+
service_id: (c = p.value) == null ? void 0 : c.service_id,
|
|
580
|
+
is_map: (o = p.value) == null ? void 0 : o.is_map
|
|
581
|
+
};
|
|
582
|
+
}));
|
|
583
|
+
return (b, x) => (k(), C("div", De, [
|
|
584
|
+
l("div", Se, [
|
|
585
|
+
(k(), T(U(t), {
|
|
586
|
+
key: p.value.id,
|
|
587
|
+
schema: A,
|
|
588
|
+
modelValue: p.value,
|
|
589
|
+
"onUpdate:modelValue": x[0] || (x[0] = (c) => p.value = c)
|
|
590
|
+
}, null, 8, ["modelValue"]))
|
|
591
|
+
]),
|
|
592
|
+
l("h2", qe, " Превʼю таблиці (" + M(_.value) + ") ", 1),
|
|
593
|
+
l("div", Be, [
|
|
594
|
+
d.value && u.value.length && y.value.length ? (k(), T(J(d.value), {
|
|
595
|
+
items: u.value,
|
|
596
|
+
columns: y.value,
|
|
597
|
+
path: "#",
|
|
598
|
+
id_key: "id",
|
|
599
|
+
"hide-details-button": g.hideDetailsButton,
|
|
600
|
+
key: m.value
|
|
601
|
+
}, null, 8, ["items", "columns", "hide-details-button"])) : u.value.length ? (k(), C("div", Te, " Додайте колонки та виберіть вигляд для перегляду ")) : (k(), C("div", Ie, " Немає даних для превʼю "))
|
|
602
|
+
])
|
|
603
|
+
]));
|
|
604
|
+
}
|
|
605
|
+
}), je = { class: "relative h-full flex flex-col flex-1 min-h-0 overflow-hidden mx-auto w-full" }, Fe = { class: "mx-1" }, Me = { class: "text-gray-900 font-semibold" }, Ke = {
|
|
606
|
+
key: 0,
|
|
607
|
+
class: "text-center py-12 mt-6 px-[24px]"
|
|
608
|
+
}, Ne = {
|
|
609
|
+
key: 1,
|
|
610
|
+
class: "px-[24px] overflow-y-auto"
|
|
611
|
+
}, ze = { class: "space-y-6" }, We = /* @__PURE__ */ B({
|
|
612
|
+
__name: "register",
|
|
613
|
+
props: {
|
|
614
|
+
hideDetailsButton: { type: Boolean, default: !1 }
|
|
615
|
+
},
|
|
616
|
+
setup(g) {
|
|
617
|
+
const t = Z(), p = ee(), w = h(() => t.path.replace(/\/[^/]+$/, "")), A = h(
|
|
618
|
+
() => {
|
|
619
|
+
var i;
|
|
620
|
+
return ((i = p.resolve(w.value).meta) == null ? void 0 : i.title) ?? "";
|
|
621
|
+
}
|
|
622
|
+
), y = h(() => {
|
|
623
|
+
var i;
|
|
624
|
+
return ((i = c.value) == null ? void 0 : i.name) || "Налаштування реєстру";
|
|
625
|
+
}), m = $("list"), d = $(""), _ = $(!0), u = [
|
|
626
|
+
{ name: "Список", id: "list" },
|
|
627
|
+
{ name: "Фільтри", id: "filters" },
|
|
628
|
+
{ name: "Картка", id: "card" },
|
|
629
|
+
{ name: "Перегляд", id: "preview" }
|
|
630
|
+
], b = {
|
|
631
|
+
list: fe,
|
|
632
|
+
filters: we,
|
|
633
|
+
card: Ve,
|
|
634
|
+
preview: Ue
|
|
635
|
+
}, x = u.map((i) => i.id), c = $({
|
|
636
|
+
columns: [],
|
|
637
|
+
filters: [],
|
|
638
|
+
card: [],
|
|
639
|
+
tableData: []
|
|
640
|
+
}), o = $([]), a = async () => {
|
|
641
|
+
var e;
|
|
642
|
+
if (!((e = c.value) == null ? void 0 : e.token)) {
|
|
643
|
+
F({
|
|
644
|
+
type: "error",
|
|
645
|
+
title: "Помилка",
|
|
646
|
+
message: "Відсутній токен для збереження"
|
|
647
|
+
});
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
try {
|
|
651
|
+
const s = await fetch(`/api/gis-registry/${t.params.id}`, {
|
|
652
|
+
method: "PUT",
|
|
653
|
+
headers: {
|
|
654
|
+
"Content-Type": "application/json"
|
|
655
|
+
},
|
|
656
|
+
body: JSON.stringify(c.value)
|
|
657
|
+
});
|
|
658
|
+
if (!s.ok)
|
|
659
|
+
throw new Error(`Failed to save content: ${s.status}`);
|
|
660
|
+
F({
|
|
661
|
+
type: "success",
|
|
662
|
+
title: "Успіх",
|
|
663
|
+
message: "Контент збережено"
|
|
664
|
+
});
|
|
665
|
+
} catch (s) {
|
|
666
|
+
F({
|
|
667
|
+
type: "error",
|
|
668
|
+
title: "Помилка",
|
|
669
|
+
message: "Не вдалося зберегти контент"
|
|
670
|
+
}), console.error(s);
|
|
671
|
+
}
|
|
672
|
+
}, f = async (i) => {
|
|
673
|
+
try {
|
|
674
|
+
const s = await (await fetch(`/api/gis-registry/${i}`)).json(), n = Array.isArray(s == null ? void 0 : s.rows) ? s.rows : [];
|
|
675
|
+
c.value.tableData = n.slice(0, 3);
|
|
676
|
+
} catch (e) {
|
|
677
|
+
console.error("Помилка завантаження превʼю:", e);
|
|
678
|
+
}
|
|
679
|
+
}, r = async () => {
|
|
680
|
+
var i, e;
|
|
681
|
+
try {
|
|
682
|
+
_.value = !0;
|
|
683
|
+
const n = await (await fetch(`/api/data/gis.registers.table/${t.params.id}`)).json(), v = ((i = n == null ? void 0 : n.rows) == null ? void 0 : i[0]) || {};
|
|
684
|
+
d.value = v.register_key || "", c.value = {
|
|
685
|
+
...v,
|
|
686
|
+
columns: Array.isArray(v.columns) ? v.columns : [],
|
|
687
|
+
filters: Array.isArray(v.filters) ? v.filters : [],
|
|
688
|
+
card: Array.isArray(v.card) ? v.card : [],
|
|
689
|
+
tableData: Array.isArray(v.tableData) ? v.tableData : []
|
|
690
|
+
}, (e = n == null ? void 0 : n.tokens) != null && e.edit && (c.value.token = n.tokens.edit), o.value = Array.isArray(n == null ? void 0 : n.fields) ? n.fields : [];
|
|
691
|
+
} catch (s) {
|
|
692
|
+
console.error("Помилка завантаження даних:", s);
|
|
693
|
+
} finally {
|
|
694
|
+
_.value = !1;
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
return G(async () => {
|
|
698
|
+
const i = t.query.tab;
|
|
699
|
+
typeof i == "string" && x.includes(i) && (m.value = i), await r(), d.value && await f(d.value);
|
|
700
|
+
}), D(m, (i) => {
|
|
701
|
+
t.query.tab !== i && p.replace({
|
|
702
|
+
query: { ...t.query, tab: i }
|
|
703
|
+
});
|
|
704
|
+
}), D(
|
|
705
|
+
() => t.query.tab,
|
|
706
|
+
(i) => {
|
|
707
|
+
typeof i == "string" && x.includes(i) && m.value !== i && (m.value = i);
|
|
708
|
+
}
|
|
709
|
+
), D(
|
|
710
|
+
() => t.params.id,
|
|
711
|
+
async (i, e) => {
|
|
712
|
+
!i || i === e || (await r(), d.value && await f(d.value));
|
|
713
|
+
}
|
|
714
|
+
), (i, e) => {
|
|
715
|
+
const s = W("router-link");
|
|
716
|
+
return k(), C("div", je, [
|
|
717
|
+
V(te, {
|
|
718
|
+
variant: "form",
|
|
719
|
+
title: y.value
|
|
720
|
+
}, {
|
|
721
|
+
breadcrumbs: I(() => [
|
|
722
|
+
w.value ? (k(), C(X, { key: 0 }, [
|
|
723
|
+
V(s, {
|
|
724
|
+
to: w.value,
|
|
725
|
+
class: "text-gray-500 hover:text-gray-700"
|
|
726
|
+
}, {
|
|
727
|
+
default: I(() => [
|
|
728
|
+
q(M(A.value), 1)
|
|
729
|
+
]),
|
|
730
|
+
_: 1
|
|
731
|
+
}, 8, ["to"]),
|
|
732
|
+
l("span", Fe, [
|
|
733
|
+
V(U(re), {
|
|
734
|
+
size: 16,
|
|
735
|
+
class: "shrink-0"
|
|
736
|
+
})
|
|
737
|
+
])
|
|
738
|
+
], 64)) : Y("", !0),
|
|
739
|
+
l("span", Me, M(y.value), 1)
|
|
740
|
+
]),
|
|
741
|
+
description: I(() => [...e[3] || (e[3] = [
|
|
742
|
+
q("Налаштування реєстру", -1)
|
|
743
|
+
])]),
|
|
744
|
+
actions: I(() => [
|
|
745
|
+
l("button", {
|
|
746
|
+
onClick: e[0] || (e[0] = (n) => U(p).back()),
|
|
747
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium border h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"
|
|
748
|
+
}, " Повернутися "),
|
|
749
|
+
l("button", {
|
|
750
|
+
onClick: a,
|
|
751
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"
|
|
752
|
+
}, " Зберегти ")
|
|
753
|
+
]),
|
|
754
|
+
_: 1
|
|
755
|
+
}, 8, ["title"]),
|
|
756
|
+
_.value ? (k(), C("div", Ke, [...e[4] || (e[4] = [
|
|
757
|
+
l("p", { class: "text-gray-500" }, "Завантаження...", -1)
|
|
758
|
+
])])) : (k(), C("div", Ne, [
|
|
759
|
+
V(ne, {
|
|
760
|
+
tabs: u,
|
|
761
|
+
activeTab: m.value,
|
|
762
|
+
"onUpdate:activeTab": e[1] || (e[1] = (n) => m.value = n)
|
|
763
|
+
}, null, 8, ["activeTab"]),
|
|
764
|
+
l("div", ze, [
|
|
765
|
+
(k(), T(J(b[m.value]), {
|
|
766
|
+
data: c.value,
|
|
767
|
+
"onUpdate:data": e[2] || (e[2] = (n) => c.value = n),
|
|
768
|
+
fields: o.value,
|
|
769
|
+
"hide-details-button": g.hideDetailsButton,
|
|
770
|
+
key: m.value
|
|
771
|
+
}, null, 40, ["data", "fields", "hide-details-button"]))
|
|
772
|
+
])
|
|
773
|
+
]))
|
|
774
|
+
]);
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
export {
|
|
779
|
+
We as default
|
|
780
|
+
};
|