@opengis/gis 0.2.115 → 0.2.117
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/module/test/cls/doc_status.json +31 -31
- package/module/test/select/core.user_uid.sql +1 -1
- package/package.json +3 -4
- package/server/plugins/mapnik/funcs/mapnik.js +5 -5
- 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 +21 -6
- package/server/routes/mapnik/index.js +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { openBlock as t, createElementBlock as n, createElementVNode as l } from "vue";
|
|
2
|
+
import { _ as o } from "./index-4aSsUBB8.js";
|
|
3
|
+
const s = {}, a = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "24",
|
|
6
|
+
height: "24",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
fill: "none",
|
|
9
|
+
stroke: "currentColor",
|
|
10
|
+
"stroke-width": "2",
|
|
11
|
+
"stroke-linecap": "round",
|
|
12
|
+
"stroke-linejoin": "round",
|
|
13
|
+
class: "lucide lucide-settings"
|
|
14
|
+
};
|
|
15
|
+
function c(r, e) {
|
|
16
|
+
return t(), n("svg", a, [...e[0] || (e[0] = [
|
|
17
|
+
l("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }, null, -1),
|
|
18
|
+
l("circle", {
|
|
19
|
+
cx: "12",
|
|
20
|
+
cy: "12",
|
|
21
|
+
r: "3"
|
|
22
|
+
}, null, -1)
|
|
23
|
+
])]);
|
|
24
|
+
}
|
|
25
|
+
const w = /* @__PURE__ */ o(s, [["render", c]]), i = {}, d = {
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
width: "24",
|
|
28
|
+
height: "24",
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
fill: "none",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
"stroke-width": "2",
|
|
33
|
+
"stroke-linecap": "round",
|
|
34
|
+
"stroke-linejoin": "round",
|
|
35
|
+
class: "lucide lucide-eye"
|
|
36
|
+
};
|
|
37
|
+
function u(r, e) {
|
|
38
|
+
return t(), n("svg", d, [...e[0] || (e[0] = [
|
|
39
|
+
l("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }, null, -1),
|
|
40
|
+
l("circle", {
|
|
41
|
+
cx: "12",
|
|
42
|
+
cy: "12",
|
|
43
|
+
r: "3"
|
|
44
|
+
}, null, -1)
|
|
45
|
+
])]);
|
|
46
|
+
}
|
|
47
|
+
const f = /* @__PURE__ */ o(i, [["render", u]]);
|
|
48
|
+
export {
|
|
49
|
+
f as C,
|
|
50
|
+
w as S
|
|
51
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { defineComponent as O, defineAsyncComponent as z, ref as s, computed as u, onMounted as D, resolveComponent as I, openBlock as h, createElementBlock as C, Fragment as $, createVNode as c, createSlots as K, withCtx as n, createTextVNode as j, toDisplayString as y, createElementVNode as o, unref as k, createCommentVNode as E, createBlock as L } from "vue";
|
|
2
|
+
import { notify as d } from "@opengis/core";
|
|
3
|
+
import { useRouter as P, useRoute as R } from "vue-router";
|
|
4
|
+
import { LucideChevronRight as A, ArrowLeft as F } from "lucide-vue-next";
|
|
5
|
+
import { _ as U } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
|
|
6
|
+
const J = { class: "mx-1" }, M = { class: "flex items-center gap-2 mt-[0.4rem]" }, q = { class: "flex-1 px-4 sm:px-6 pb-4 overflow-y-auto" }, G = { class: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden" }, H = { class: "w-full relative overflow-auto p-5 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" }, Q = { class: "vs-form w-full" }, te = /* @__PURE__ */ O({
|
|
7
|
+
__name: "EntityCreatePage",
|
|
8
|
+
props: {
|
|
9
|
+
entityKey: { default: "" }
|
|
10
|
+
},
|
|
11
|
+
setup(S) {
|
|
12
|
+
const V = z(() => import("@opengis/form")), m = s({}), p = s(null), b = s(null), f = P(), v = R(), N = S, g = s({}), w = s(""), l = u(() => v.path.replace(/\/(add|new)$/, "")), i = u(() => {
|
|
13
|
+
var t;
|
|
14
|
+
return ((t = f.resolve(l.value).meta) == null ? void 0 : t.title) ?? "";
|
|
15
|
+
}), T = u(() => i.value ? `Додати в ${i.value.toLowerCase()}` : "Додати"), x = u(() => {
|
|
16
|
+
var t;
|
|
17
|
+
return ((t = v.meta) == null ? void 0 : t.description) ?? "";
|
|
18
|
+
});
|
|
19
|
+
function _() {
|
|
20
|
+
f.push(l.value || "/");
|
|
21
|
+
}
|
|
22
|
+
async function B() {
|
|
23
|
+
if (!b.value) {
|
|
24
|
+
d({
|
|
25
|
+
type: "error",
|
|
26
|
+
title: "Error",
|
|
27
|
+
message: "Create token is missing."
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const t = g.value.validate();
|
|
32
|
+
if (t) {
|
|
33
|
+
d({ type: "warning", title: "Validation", message: Object.entries(t).map(([r, a]) => `${r}: ${a}`).join(`
|
|
34
|
+
`) });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const e = await fetch("/api/table/" + b.value, {
|
|
38
|
+
method: "POST",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json"
|
|
41
|
+
},
|
|
42
|
+
body: JSON.stringify(m.value)
|
|
43
|
+
});
|
|
44
|
+
if (!e.ok) {
|
|
45
|
+
d({
|
|
46
|
+
type: "error",
|
|
47
|
+
title: "Error",
|
|
48
|
+
message: `Error code: ${e.status}`
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await e.json(), d({ title: "Success!", message: "Object created." }), f.back();
|
|
53
|
+
}
|
|
54
|
+
return D(async () => {
|
|
55
|
+
const t = N.entityKey || String(v.name ?? "").split("-")[0], e = await fetch(`/api/form/gis.${t}.table`).then((r) => r.json());
|
|
56
|
+
b.value = e.token, w.value = e.id, p.value = e.schema, document.title = T.value;
|
|
57
|
+
}), (t, e) => {
|
|
58
|
+
const r = I("router-link");
|
|
59
|
+
return h(), C($, null, [
|
|
60
|
+
c(U, { variant: "form" }, K({
|
|
61
|
+
breadcrumbs: n(() => [
|
|
62
|
+
l.value ? (h(), C($, { key: 0 }, [
|
|
63
|
+
c(r, {
|
|
64
|
+
to: l.value,
|
|
65
|
+
class: "text-gray-500 hover:text-gray-700"
|
|
66
|
+
}, {
|
|
67
|
+
default: n(() => [
|
|
68
|
+
j(y(i.value), 1)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["to"]),
|
|
72
|
+
o("span", J, [
|
|
73
|
+
c(k(A), {
|
|
74
|
+
size: 16,
|
|
75
|
+
class: "shrink-0"
|
|
76
|
+
})
|
|
77
|
+
])
|
|
78
|
+
], 64)) : E("", !0),
|
|
79
|
+
e[2] || (e[2] = o("span", { class: "text-gray-900 font-semibold" }, "Створення", -1))
|
|
80
|
+
]),
|
|
81
|
+
title: n(() => [
|
|
82
|
+
o("div", M, [
|
|
83
|
+
o("button", {
|
|
84
|
+
type: "button",
|
|
85
|
+
class: "p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit hover:opacity-80",
|
|
86
|
+
onClick: _,
|
|
87
|
+
"aria-label": "Назад"
|
|
88
|
+
}, [
|
|
89
|
+
c(k(F), {
|
|
90
|
+
size: 20,
|
|
91
|
+
class: "shrink-0"
|
|
92
|
+
})
|
|
93
|
+
]),
|
|
94
|
+
o("span", null, y(i.value || "Створення"), 1)
|
|
95
|
+
])
|
|
96
|
+
]),
|
|
97
|
+
actions: n(() => [
|
|
98
|
+
o("button", {
|
|
99
|
+
class: "cursor-pointer flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100",
|
|
100
|
+
onClick: _
|
|
101
|
+
}, " Назад "),
|
|
102
|
+
o("button", {
|
|
103
|
+
onClick: B,
|
|
104
|
+
class: "cursor-pointer inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 hover:bg-blue-700 border border-transparent rounded-lg gap-x-2 hover:text-white"
|
|
105
|
+
}, " Зберегти ")
|
|
106
|
+
]),
|
|
107
|
+
_: 2
|
|
108
|
+
}, [
|
|
109
|
+
x.value ? {
|
|
110
|
+
name: "description",
|
|
111
|
+
fn: n(() => [
|
|
112
|
+
j(y(x.value), 1)
|
|
113
|
+
]),
|
|
114
|
+
key: "0"
|
|
115
|
+
} : void 0
|
|
116
|
+
]), 1024),
|
|
117
|
+
o("div", q, [
|
|
118
|
+
o("div", G, [
|
|
119
|
+
o("div", H, [
|
|
120
|
+
o("div", Q, [
|
|
121
|
+
p.value ? (h(), L(k(V), {
|
|
122
|
+
key: 0,
|
|
123
|
+
values: m.value,
|
|
124
|
+
"onUpdate:values": e[0] || (e[0] = (a) => m.value = a),
|
|
125
|
+
form: g.value,
|
|
126
|
+
"onUpdate:form": e[1] || (e[1] = (a) => g.value = a),
|
|
127
|
+
schema: p.value,
|
|
128
|
+
style: { primaryColor: "blue" },
|
|
129
|
+
formId: w.value
|
|
130
|
+
}, null, 8, ["values", "form", "schema", "formId"])) : E("", !0)
|
|
131
|
+
])
|
|
132
|
+
])
|
|
133
|
+
])
|
|
134
|
+
])
|
|
135
|
+
], 64);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
export {
|
|
140
|
+
te as default
|
|
141
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { defineComponent as D, defineAsyncComponent as R, ref as i, computed as p, onMounted as U, resolveComponent as A, openBlock as d, createElementBlock as w, Fragment as _, createVNode as s, createSlots as F, withCtx as n, createTextVNode as C, toDisplayString as v, createElementVNode as r, unref as b, createCommentVNode as $, createBlock as K } from "vue";
|
|
2
|
+
import { notify as f } from "@opengis/core";
|
|
3
|
+
import { useRoute as L, useRouter as O } from "vue-router";
|
|
4
|
+
import { LucideChevronRight as j, ArrowLeft as J } from "lucide-vue-next";
|
|
5
|
+
import { _ as M } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
|
|
6
|
+
const Y = { class: "mx-1" }, q = { class: "mx-1" }, G = { class: "flex items-center gap-2 mt-[0.4rem]" }, H = { class: "flex-1 px-4 sm:px-6 pb-4 overflow-y-auto" }, I = { class: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden" }, Q = { class: "w-full relative overflow-auto p-5 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" }, W = { class: "vs-form w-full" }, ae = /* @__PURE__ */ D({
|
|
7
|
+
__name: "EntityEditPage",
|
|
8
|
+
props: {
|
|
9
|
+
entityKey: { default: "" }
|
|
10
|
+
},
|
|
11
|
+
setup(N) {
|
|
12
|
+
const T = R(() => import("@opengis/form")), u = i({}), g = i(null), h = i(null), y = i({}), c = i(""), m = L(), k = O(), z = N.entityKey || String(m.name ?? "").split("-")[0], { id: x } = m.params, o = p(
|
|
13
|
+
() => m.path.replace(/\/edit\/[^/]+$/, "").replace(/\/[^/]+\/edit$/, "")
|
|
14
|
+
), B = p(() => x ? `${o.value}/${x}` : o.value || "/"), E = p(() => {
|
|
15
|
+
var t;
|
|
16
|
+
return ((t = k.resolve(o.value).meta) == null ? void 0 : t.title) ?? "";
|
|
17
|
+
}), S = p(() => {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = m.meta) == null ? void 0 : t.description) ?? "";
|
|
20
|
+
});
|
|
21
|
+
function V() {
|
|
22
|
+
k.push(o.value || "/");
|
|
23
|
+
}
|
|
24
|
+
async function P() {
|
|
25
|
+
const t = y.value.validate();
|
|
26
|
+
if (t) {
|
|
27
|
+
f({
|
|
28
|
+
type: "warning",
|
|
29
|
+
title: "Validation",
|
|
30
|
+
message: Object.entries(t).map(([a, l]) => `${a}: ${l}`).join(`
|
|
31
|
+
`)
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!h.value) {
|
|
36
|
+
f({
|
|
37
|
+
type: "error",
|
|
38
|
+
title: "Error",
|
|
39
|
+
message: "Edit token is missing."
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const e = await fetch(`/api/table/${h.value}`, {
|
|
44
|
+
method: "PUT",
|
|
45
|
+
headers: {
|
|
46
|
+
"Content-Type": "application/json"
|
|
47
|
+
},
|
|
48
|
+
body: JSON.stringify(u.value)
|
|
49
|
+
});
|
|
50
|
+
if (!e.ok) {
|
|
51
|
+
f({
|
|
52
|
+
type: "error",
|
|
53
|
+
title: "Error",
|
|
54
|
+
message: `Error code: ${e.status}`
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await e.json(), f({ title: "Success!", message: "Your changes have been saved." }), k.back();
|
|
59
|
+
}
|
|
60
|
+
return U(async () => {
|
|
61
|
+
const t = await fetch(
|
|
62
|
+
`/api/form/gis.${z}.table/${x}`
|
|
63
|
+
).then((a) => a.json());
|
|
64
|
+
u.value = t.data, h.value = t.token, g.value = t.schema;
|
|
65
|
+
const e = t.data;
|
|
66
|
+
c.value = (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.register_key) || (e == null ? void 0 : e.map_key) || "";
|
|
67
|
+
}), (t, e) => {
|
|
68
|
+
const a = A("router-link");
|
|
69
|
+
return d(), w(_, null, [
|
|
70
|
+
s(M, { variant: "form" }, F({
|
|
71
|
+
breadcrumbs: n(() => [
|
|
72
|
+
o.value ? (d(), w(_, { key: 0 }, [
|
|
73
|
+
s(a, {
|
|
74
|
+
to: o.value,
|
|
75
|
+
class: "text-gray-500 hover:text-gray-700"
|
|
76
|
+
}, {
|
|
77
|
+
default: n(() => [
|
|
78
|
+
C(v(E.value), 1)
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["to"]),
|
|
82
|
+
r("span", Y, [
|
|
83
|
+
s(b(j), {
|
|
84
|
+
size: 16,
|
|
85
|
+
class: "shrink-0"
|
|
86
|
+
})
|
|
87
|
+
])
|
|
88
|
+
], 64)) : $("", !0),
|
|
89
|
+
c.value ? (d(), w(_, { key: 1 }, [
|
|
90
|
+
s(a, {
|
|
91
|
+
to: B.value,
|
|
92
|
+
class: "text-gray-500 hover:text-gray-700"
|
|
93
|
+
}, {
|
|
94
|
+
default: n(() => [
|
|
95
|
+
C(v(c.value), 1)
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
}, 8, ["to"]),
|
|
99
|
+
r("span", q, [
|
|
100
|
+
s(b(j), {
|
|
101
|
+
size: 16,
|
|
102
|
+
class: "shrink-0"
|
|
103
|
+
})
|
|
104
|
+
])
|
|
105
|
+
], 64)) : $("", !0),
|
|
106
|
+
e[2] || (e[2] = r("span", { class: "text-gray-900 font-semibold" }, "Редагування", -1))
|
|
107
|
+
]),
|
|
108
|
+
title: n(() => [
|
|
109
|
+
r("div", G, [
|
|
110
|
+
r("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
class: "p-0 m-0 border-0 bg-transparent cursor-pointer text-inherit hover:opacity-80",
|
|
113
|
+
onClick: V,
|
|
114
|
+
"aria-label": "Назад"
|
|
115
|
+
}, [
|
|
116
|
+
s(b(J), {
|
|
117
|
+
size: 20,
|
|
118
|
+
class: "shrink-0"
|
|
119
|
+
})
|
|
120
|
+
]),
|
|
121
|
+
r("span", null, v(c.value || E.value || "Редагування"), 1)
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
actions: n(() => [
|
|
125
|
+
r("button", {
|
|
126
|
+
class: "cursor-pointer flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100",
|
|
127
|
+
onClick: V
|
|
128
|
+
}, " Назад "),
|
|
129
|
+
r("button", {
|
|
130
|
+
onClick: P,
|
|
131
|
+
class: "cursor-pointer inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 hover:bg-blue-700 border border-transparent rounded-lg gap-x-2 hover:text-white"
|
|
132
|
+
}, " Зберегти ")
|
|
133
|
+
]),
|
|
134
|
+
_: 2
|
|
135
|
+
}, [
|
|
136
|
+
S.value ? {
|
|
137
|
+
name: "description",
|
|
138
|
+
fn: n(() => [
|
|
139
|
+
C(v(S.value), 1)
|
|
140
|
+
]),
|
|
141
|
+
key: "0"
|
|
142
|
+
} : void 0
|
|
143
|
+
]), 1024),
|
|
144
|
+
r("div", H, [
|
|
145
|
+
r("div", I, [
|
|
146
|
+
r("div", Q, [
|
|
147
|
+
r("div", W, [
|
|
148
|
+
g.value ? (d(), K(b(T), {
|
|
149
|
+
key: 0,
|
|
150
|
+
schema: g.value,
|
|
151
|
+
values: u.value,
|
|
152
|
+
"onUpdate:values": e[0] || (e[0] = (l) => u.value = l),
|
|
153
|
+
form: y.value,
|
|
154
|
+
"onUpdate:form": e[1] || (e[1] = (l) => y.value = l),
|
|
155
|
+
style: { primaryColor: "blue" }
|
|
156
|
+
}, null, 8, ["schema", "values", "form"])) : $("", !0)
|
|
157
|
+
])
|
|
158
|
+
])
|
|
159
|
+
])
|
|
160
|
+
])
|
|
161
|
+
], 64);
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
export {
|
|
166
|
+
ae as default
|
|
167
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as se, defineAsyncComponent as oe, computed as l, ref as i, onMounted as re, onBeforeUnmount as le, watch as A, openBlock as C, createElementBlock as k, createVNode as f, createSlots as ie, withCtx as _, createTextVNode as g, toDisplayString as y, unref as u, createCommentVNode as F, createElementVNode as o, withDirectives as ue, vModelText as ce, renderSlot as D } from "vue";
|
|
2
|
+
import { RefreshCw as de, Plus as fe, Search as pe } from "lucide-vue-next";
|
|
3
|
+
import { useRoute as me, useRouter as ge } from "vue-router";
|
|
4
|
+
import { VsPagination as ve, notify as I } from "@opengis/core";
|
|
5
|
+
import { Filter as he } from "@opengis/filter";
|
|
6
|
+
import { F as ye } from "./FileEdit-C7tteUeG.js";
|
|
7
|
+
import { _ as xe } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
|
|
8
|
+
import { _ as be } from "./index-4aSsUBB8.js";
|
|
9
|
+
const we = { class: "flex-1 flex flex-col bg-gray-50 h-screen overflow-hidden p-0 m-0" }, _e = {
|
|
10
|
+
key: 0,
|
|
11
|
+
href: "/api/gis-create-xml",
|
|
12
|
+
target: "_blank",
|
|
13
|
+
rel: "noreferrer",
|
|
14
|
+
class: "flex h-[2rem] items-center gap-1.5 px-3 py-1.5 bg-slate-50 text-slate-700 rounded-md border border-slate-200 hover:bg-slate-100 transition-colors text-sm"
|
|
15
|
+
}, $e = { class: "flex-1 px-4 sm:px-6 pb-4 overflow-y-auto overflow-x-visible" }, Se = { class: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-visible" }, Pe = { class: "p-3 border-b border-gray-200" }, Te = { class: "flex flex-col sm:flex-row gap-2" }, Ce = { class: "flex-1 relative" }, ke = ["placeholder"], Ee = { class: "entity-table-root" }, Re = { class: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800" }, ze = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "gap-2 inline-flex"
|
|
18
|
+
}, Fe = ["onClick"], Ne = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "flex flex-col gap-3 border-t border-gray-200 px-4 py-3 sm:flex-row sm:items-center sm:justify-between bg-gray-50"
|
|
21
|
+
}, je = { class: "text-sm text-gray-500" }, Be = { class: "font-medium text-gray-700" }, Ue = { class: "font-medium text-gray-700" }, Ve = { class: "font-medium text-gray-700" }, qe = { class: "flex items-center justify-end gap-3" }, Ae = /* @__PURE__ */ se({
|
|
22
|
+
__name: "EntityTablePage",
|
|
23
|
+
props: {
|
|
24
|
+
entityKey: { default: "" },
|
|
25
|
+
entityBasePath: { default: "" },
|
|
26
|
+
columnsConfig: { default: () => [] }
|
|
27
|
+
},
|
|
28
|
+
setup(M) {
|
|
29
|
+
const Q = oe(() => import("@opengis/table")), s = me(), $ = ge(), S = M, N = l(
|
|
30
|
+
() => S.entityKey || String(s.name ?? "").split("-")[0]
|
|
31
|
+
), J = l(() => {
|
|
32
|
+
var n;
|
|
33
|
+
let e = (((n = s.matched[s.matched.length - 1]) == null ? void 0 : n.path) || s.path).replace(/\/:id\??\/:action\??$/, "").replace(/\/:id\??$/, "").replace(/\/:action\??$/, "");
|
|
34
|
+
return e.startsWith("/") || (e = `/${e}`), e;
|
|
35
|
+
}), E = l(() => S.entityBasePath || J.value), R = l(() => {
|
|
36
|
+
var e;
|
|
37
|
+
const t = ((e = s.matched[s.matched.length - 1]) == null ? void 0 : e.path) || "";
|
|
38
|
+
return /:id\??/.test(t) && /:action\??/.test(t);
|
|
39
|
+
}), P = l(() => {
|
|
40
|
+
var e, n;
|
|
41
|
+
return (e = s.meta) != null && e.title ? s.meta.title : s.name ? s.name : ((n = s.path) == null ? void 0 : n.replace(/^\//, "")) || "" || "GIS";
|
|
42
|
+
}), j = l(() => {
|
|
43
|
+
var t;
|
|
44
|
+
return ((t = s.meta) == null ? void 0 : t.description) || "";
|
|
45
|
+
}), K = l(() => {
|
|
46
|
+
const t = String(P.value || "").trim();
|
|
47
|
+
return t ? `Пошук ${t}...` : "Пошук...";
|
|
48
|
+
}), x = i([]), b = i(!0), v = i([]), B = i([]), p = i({}), U = i([]), c = i(String(s.query.search ?? "")), r = i(Math.max(1, Number(s.query.page) || 1)), T = i(15), m = i(0);
|
|
49
|
+
let w = null;
|
|
50
|
+
const L = l(() => m.value > 0), O = l(() => m.value ? (r.value - 1) * T.value + 1 : 0), W = l(() => m.value ? Math.min(r.value * T.value, m.value) : 0);
|
|
51
|
+
function G(t) {
|
|
52
|
+
const e = new URLSearchParams();
|
|
53
|
+
return Object.entries(t).forEach(([n, a]) => {
|
|
54
|
+
if (!(a == null || a === "")) {
|
|
55
|
+
if (Array.isArray(a)) {
|
|
56
|
+
a.forEach((d) => {
|
|
57
|
+
d != null && d !== "" && e.append(n, String(d));
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
e.append(n, String(a));
|
|
62
|
+
}
|
|
63
|
+
}), e.toString();
|
|
64
|
+
}
|
|
65
|
+
function H() {
|
|
66
|
+
return R.value ? `${E.value}/new` : s.name === "services" ? "/gis.datasets/new" : s.name === "group_list" ? "/gis.group/add" : `${s.path}/add`;
|
|
67
|
+
}
|
|
68
|
+
function X(t) {
|
|
69
|
+
if (R.value)
|
|
70
|
+
return `${E.value}/${t}/edit`;
|
|
71
|
+
const e = String(s.name ?? "").split("_")[0];
|
|
72
|
+
return e === "services" ? `/gis.datasets/${t}/edit` : `/gis.${e}/edit/${t}`;
|
|
73
|
+
}
|
|
74
|
+
const h = async () => {
|
|
75
|
+
const t = `/api/data/gis.${N.value}.table`;
|
|
76
|
+
if (!t) {
|
|
77
|
+
x.value = [], b.value = !1;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
b.value = !0;
|
|
82
|
+
const e = G({
|
|
83
|
+
...p.value,
|
|
84
|
+
page: r.value,
|
|
85
|
+
limit: T.value
|
|
86
|
+
}), n = await fetch(e ? `${t}?${e}` : t);
|
|
87
|
+
if (!n.ok)
|
|
88
|
+
throw new Error(`Rows fetch failed: ${n.status}`);
|
|
89
|
+
const a = await n.json();
|
|
90
|
+
x.value = a.rows || [], m.value = Number(a.filtered ?? a.total ?? a.count ?? x.value.length) || 0, v.value = S.columnsConfig.length ? S.columnsConfig : a.columns || [], B.value = a.filters || [], b.value = !1, U.value = a.actions, a.card !== !1 && v.value.length && (R.value ? v.value[0].link = `${E.value}/{id}` : v.value[0].link || (v.value[0].link = `/${s.name}/{id}`));
|
|
91
|
+
} catch {
|
|
92
|
+
x.value = [], b.value = !1;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
function Y(t) {
|
|
96
|
+
p.value = t, r.value = 1, z(), h();
|
|
97
|
+
}
|
|
98
|
+
re(() => {
|
|
99
|
+
h(), document.title = P.value;
|
|
100
|
+
}), le(() => {
|
|
101
|
+
w && clearTimeout(w);
|
|
102
|
+
}), A(
|
|
103
|
+
() => s.name,
|
|
104
|
+
() => {
|
|
105
|
+
r.value = 1, c.value = "", h(), document.title = P.value;
|
|
106
|
+
}
|
|
107
|
+
), A(
|
|
108
|
+
() => s.query,
|
|
109
|
+
(t) => {
|
|
110
|
+
const e = Math.max(1, Number(t.page) || 1), n = String(t.search ?? ""), a = e !== r.value, d = n !== c.value;
|
|
111
|
+
!a && !d || (r.value = e, c.value = n, p.value = {
|
|
112
|
+
...p.value,
|
|
113
|
+
search: n || void 0
|
|
114
|
+
}, h());
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
async function Z(t, e, n) {
|
|
118
|
+
const a = await fetch(`/api/form/gis.${N.value}.table/${t.id}`);
|
|
119
|
+
if (!a.ok) throw new Error(`Form fetch failed: ${a.status}`);
|
|
120
|
+
const ae = (await a.json()).token, ne = { [e]: n }, q = await fetch(`/api/table/${ae}`, {
|
|
121
|
+
method: "PUT",
|
|
122
|
+
headers: { "Content-Type": "application/json" },
|
|
123
|
+
body: JSON.stringify(ne)
|
|
124
|
+
});
|
|
125
|
+
if (!q.ok)
|
|
126
|
+
throw I({
|
|
127
|
+
type: "error",
|
|
128
|
+
title: "Помилка збереження",
|
|
129
|
+
message: `Поле "${e}" не оновлено`
|
|
130
|
+
}), new Error(`Save failed: ${q.status}`);
|
|
131
|
+
I({ title: "Збережено", message: `Поле "${e}" оновлено` });
|
|
132
|
+
}
|
|
133
|
+
function ee(t, e) {
|
|
134
|
+
p.value = {
|
|
135
|
+
...p.value,
|
|
136
|
+
[t]: e
|
|
137
|
+
}, z(), h();
|
|
138
|
+
}
|
|
139
|
+
function te() {
|
|
140
|
+
w && clearTimeout(w), w = setTimeout(() => {
|
|
141
|
+
r.value = 1, ee("search", c.value);
|
|
142
|
+
}, 250);
|
|
143
|
+
}
|
|
144
|
+
function V(t) {
|
|
145
|
+
!t || t === r.value || (r.value = t, z(), h());
|
|
146
|
+
}
|
|
147
|
+
function z() {
|
|
148
|
+
const t = {
|
|
149
|
+
...s.query,
|
|
150
|
+
page: String(r.value),
|
|
151
|
+
...c.value ? { search: c.value } : {}
|
|
152
|
+
};
|
|
153
|
+
c.value || delete t.search, $.replace({ query: t });
|
|
154
|
+
}
|
|
155
|
+
return (t, e) => (C(), k("div", we, [
|
|
156
|
+
f(xe, { variant: "table" }, ie({
|
|
157
|
+
title: _(() => [
|
|
158
|
+
g(y(P.value), 1)
|
|
159
|
+
]),
|
|
160
|
+
actions: _(() => [
|
|
161
|
+
u(s).name === "rasters" ? (C(), k("a", _e, [
|
|
162
|
+
f(u(de), { size: 16 }),
|
|
163
|
+
e[2] || (e[2] = g(" Оновити растри ", -1))
|
|
164
|
+
])) : F("", !0),
|
|
165
|
+
o("a", {
|
|
166
|
+
onClick: e[0] || (e[0] = (n) => u($).push(H())),
|
|
167
|
+
class: "hover:cursor-pointer flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm"
|
|
168
|
+
}, [
|
|
169
|
+
f(u(fe), { size: 16 }),
|
|
170
|
+
e[3] || (e[3] = g(" Додати ", -1))
|
|
171
|
+
])
|
|
172
|
+
]),
|
|
173
|
+
_: 2
|
|
174
|
+
}, [
|
|
175
|
+
j.value ? {
|
|
176
|
+
name: "description",
|
|
177
|
+
fn: _(() => [
|
|
178
|
+
g(y(j.value), 1)
|
|
179
|
+
]),
|
|
180
|
+
key: "0"
|
|
181
|
+
} : void 0
|
|
182
|
+
]), 1024),
|
|
183
|
+
o("div", $e, [
|
|
184
|
+
o("div", Se, [
|
|
185
|
+
o("div", Pe, [
|
|
186
|
+
o("div", Te, [
|
|
187
|
+
o("div", Ce, [
|
|
188
|
+
f(u(pe), {
|
|
189
|
+
size: 16,
|
|
190
|
+
class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
|
|
191
|
+
}),
|
|
192
|
+
ue(o("input", {
|
|
193
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => c.value = n),
|
|
194
|
+
onInput: te,
|
|
195
|
+
type: "text",
|
|
196
|
+
placeholder: K.value,
|
|
197
|
+
class: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
198
|
+
}, null, 40, ke), [
|
|
199
|
+
[ce, c.value]
|
|
200
|
+
])
|
|
201
|
+
]),
|
|
202
|
+
f(u(he), {
|
|
203
|
+
schema: B.value,
|
|
204
|
+
value: p.value,
|
|
205
|
+
onChange: Y,
|
|
206
|
+
layout: "inline",
|
|
207
|
+
mode: "soft",
|
|
208
|
+
view: "popover",
|
|
209
|
+
limit: 8,
|
|
210
|
+
class: "flex-shrink-0"
|
|
211
|
+
}, null, 8, ["schema", "value"])
|
|
212
|
+
])
|
|
213
|
+
]),
|
|
214
|
+
o("div", Ee, [
|
|
215
|
+
f(u(Q), {
|
|
216
|
+
rows: x.value,
|
|
217
|
+
columns: v.value,
|
|
218
|
+
loading: b.value,
|
|
219
|
+
router: u($),
|
|
220
|
+
selectable: !1,
|
|
221
|
+
onCellUpdate: Z,
|
|
222
|
+
classWrapper: "overflow-x-auto overflow-y-visible",
|
|
223
|
+
TableStyle: "w-full",
|
|
224
|
+
classTable: "w-full min-w-[640px]",
|
|
225
|
+
classThead: "bg-gray-50 border-b border-gray-200",
|
|
226
|
+
classTh: "px-3 sm:px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
|
|
227
|
+
classTbody: "bg-white divide-y divide-gray-200",
|
|
228
|
+
classTr: "hover:bg-gray-50 transition-colors",
|
|
229
|
+
classTd: "px-3 sm:px-4 py-2.5 whitespace-nowrap",
|
|
230
|
+
classLink: "text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline text-left"
|
|
231
|
+
}, {
|
|
232
|
+
badge: _(({ row: n, value: a, column: d }) => [
|
|
233
|
+
D(t.$slots, "badge", {
|
|
234
|
+
row: n,
|
|
235
|
+
value: a,
|
|
236
|
+
column: d
|
|
237
|
+
}, () => [
|
|
238
|
+
o("span", Re, y((a == null ? void 0 : a.text) || a || "-"), 1)
|
|
239
|
+
], !0)
|
|
240
|
+
]),
|
|
241
|
+
action: _(({ row: n }) => [
|
|
242
|
+
D(t.$slots, "action", { row: n }, () => [
|
|
243
|
+
U.value.includes("add") ? (C(), k("div", ze, [
|
|
244
|
+
o("button", {
|
|
245
|
+
onClick: (a) => u($).push(X(n.id)),
|
|
246
|
+
class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
|
|
247
|
+
}, [
|
|
248
|
+
f(ye)
|
|
249
|
+
], 8, Fe)
|
|
250
|
+
])) : F("", !0)
|
|
251
|
+
], !0)
|
|
252
|
+
]),
|
|
253
|
+
_: 3
|
|
254
|
+
}, 8, ["rows", "columns", "loading", "router"])
|
|
255
|
+
]),
|
|
256
|
+
L.value ? (C(), k("div", Ne, [
|
|
257
|
+
o("div", je, [
|
|
258
|
+
e[4] || (e[4] = g(" Показано ", -1)),
|
|
259
|
+
o("span", Be, y(O.value), 1),
|
|
260
|
+
e[5] || (e[5] = g(" - ", -1)),
|
|
261
|
+
o("span", Ue, y(W.value), 1),
|
|
262
|
+
e[6] || (e[6] = g(" з ", -1)),
|
|
263
|
+
o("span", Ve, y(m.value), 1)
|
|
264
|
+
]),
|
|
265
|
+
o("div", qe, [
|
|
266
|
+
f(u(ve), {
|
|
267
|
+
total: m.value,
|
|
268
|
+
page: r.value,
|
|
269
|
+
"page-size": T.value,
|
|
270
|
+
showPageSizes: !1,
|
|
271
|
+
pageRange: 5,
|
|
272
|
+
view: "button",
|
|
273
|
+
color: "gray",
|
|
274
|
+
"onUpdate:page": V,
|
|
275
|
+
onPageChange: V
|
|
276
|
+
}, null, 8, ["total", "page", "page-size"])
|
|
277
|
+
])
|
|
278
|
+
])) : F("", !0)
|
|
279
|
+
])
|
|
280
|
+
])
|
|
281
|
+
]));
|
|
282
|
+
}
|
|
283
|
+
}), We = /* @__PURE__ */ be(Ae, [["__scopeId", "data-v-fe4caa80"]]);
|
|
284
|
+
export {
|
|
285
|
+
We as default
|
|
286
|
+
};
|