@opengis/admin 0.1.18 → 0.1.19
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/{add-page-CUlt8lxo.js → add-page-DU60zL6t.js} +9 -9
- package/dist/admin-interface-gm773DzD.js +919 -0
- package/dist/{admin-view-XOPkNJ7Q.js → admin-view-CfY_rVQ4.js} +113 -146
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +41 -41
- package/dist/card-page-ZWU3SEtH.js +194 -0
- package/dist/{card-view-CNzIVhiE.js → card-view-CwZPYXyJ.js} +1 -1
- package/dist/{edit-page-tYDkGn_6.js → edit-page-C6mgpZBS.js} +21 -21
- package/dist/{import-file-BdX0j7UB.js → import-file-C5Tvx4dB.js} +7936 -8006
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/dist/admin-interface-DyDvpW7d.js +0 -961
- package/dist/card-page-Bq1aDTDR.js +0 -202
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { u as H } from "./userMenu-CT1xO2Pt.js";
|
|
2
|
+
import { _ as V, a as z } from "./import-file-C5Tvx4dB.js";
|
|
3
|
+
import { resolveComponent as N, openBlock as n, createElementBlock as c, createElementVNode as l, toDisplayString as D, createVNode as q, withCtx as B, createTextVNode as E, normalizeClass as T, Fragment as f, renderList as M, createBlock as L, resolveDynamicComponent as $, createCommentVNode as g } from "vue";
|
|
4
|
+
const m = {
|
|
5
|
+
data() {
|
|
6
|
+
return {
|
|
7
|
+
objectData: null,
|
|
8
|
+
component: ""
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
computed: {
|
|
12
|
+
getRoute() {
|
|
13
|
+
const t = this.flattenMenu(H.value);
|
|
14
|
+
t != null && t.length || this.$router.replace("/404");
|
|
15
|
+
const r = t == null ? void 0 : t.find((a) => {
|
|
16
|
+
var u, s;
|
|
17
|
+
return (a == null ? void 0 : a.table) == ((s = (u = this.$route) == null ? void 0 : u.params) == null ? void 0 : s.table);
|
|
18
|
+
});
|
|
19
|
+
return r || this.$router.replace("/404"), r == null ? void 0 : r.path;
|
|
20
|
+
},
|
|
21
|
+
getTitle() {
|
|
22
|
+
var t, r, a, u, s, p, b, h, x, d, o, j, _, e;
|
|
23
|
+
if ((a = (r = (t = this.objectData) == null ? void 0 : t.rows) == null ? void 0 : r[0]) != null && a.name)
|
|
24
|
+
return ((b = (p = (s = (u = this.objectData) == null ? void 0 : u.rows) == null ? void 0 : s[0]) == null ? void 0 : p.name) == null ? void 0 : b.length) < 35 ? (d = (x = (h = this.objectData) == null ? void 0 : h.rows) == null ? void 0 : x[0]) == null ? void 0 : d.name : ((e = (_ = (j = (o = this.objectData) == null ? void 0 : o.rows) == null ? void 0 : j[0]) == null ? void 0 : _.name) == null ? void 0 : e.slice(0, 35)) + " ...";
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
async mounted() {
|
|
28
|
+
await this.getObjectData(), await this.checkActiveComponent();
|
|
29
|
+
},
|
|
30
|
+
watch: {
|
|
31
|
+
component(t) {
|
|
32
|
+
this.$router.replace({ ...this.$route, query: { tab: t } });
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
async getObjectData() {
|
|
37
|
+
var a;
|
|
38
|
+
const { table: t, id: r } = (a = this.$route) == null ? void 0 : a.params;
|
|
39
|
+
(!t || !r) && this.$router.replace("/404");
|
|
40
|
+
try {
|
|
41
|
+
const { data: u } = await z.get(`/api/table-data/${t}/${r}`);
|
|
42
|
+
this.objectData = u;
|
|
43
|
+
} catch (u) {
|
|
44
|
+
console.error(u);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
getColClass(t) {
|
|
48
|
+
return `col-span-${t || 12}`;
|
|
49
|
+
},
|
|
50
|
+
getGridClass() {
|
|
51
|
+
return "grid-cols-12";
|
|
52
|
+
},
|
|
53
|
+
checkActiveComponent() {
|
|
54
|
+
var t, r, a, u, s, p, b, h, x;
|
|
55
|
+
if ((r = (t = this.$route) == null ? void 0 : t.query) != null && r.tab)
|
|
56
|
+
this.component = (u = (a = this.$route) == null ? void 0 : a.query) == null ? void 0 : u.tab;
|
|
57
|
+
else {
|
|
58
|
+
const d = (p = (s = this.objectData) == null ? void 0 : s.panels) == null ? void 0 : p.find((o) => (o == null ? void 0 : o.type) === "tabs");
|
|
59
|
+
(b = d == null ? void 0 : d.items) != null && b.length && (this.component = ((h = d.items[0]) == null ? void 0 : h.component) || ((x = d.items[0]) == null ? void 0 : x.name));
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
flattenMenu(t) {
|
|
63
|
+
const r = [];
|
|
64
|
+
return t.forEach((a) => {
|
|
65
|
+
a.menu ? r.push(...this.flattenMenu(a.menu)) : r.push(a);
|
|
66
|
+
}), r;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, A = {
|
|
70
|
+
style: { width: "calc(100vw - 260px)", height: "calc(100vh - 60px)" },
|
|
71
|
+
class: "bg-gray-50 overflow-y-auto"
|
|
72
|
+
}, G = { class: "h-[58px] bg-gray-50 flex items-center justify-between px-[30px]" }, O = { class: "flex items-center gap-[4px]" }, R = { class: "text-xl font-medium text-gray-600" }, F = { class: "flex items-center gap-[6px]" }, I = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "border rounded-xl bg-white"
|
|
75
|
+
}, P = { class: "p-[10px] pl-[20px] text-xl" }, S = ["innerHTML"], J = { key: 1 }, K = { class: "p-[10px] pl-[20px] text-xl" }, Q = {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: "p-[20px] border-t"
|
|
78
|
+
}, U = {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "p-[20px] border-t"
|
|
81
|
+
}, W = ["innerHTML"], X = { class: "flex space-x-1 w-[1200px] bg-white border rounded-xl h-[60px] items-center pl-[20px]" }, Y = ["onClick"], Z = {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: "border rounded-xl bg-white mt-[20px]"
|
|
84
|
+
}, ee = { class: "p-[10px] pl-[20px] text-xl" }, te = {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: "p-[20px] border-t"
|
|
87
|
+
}, oe = {
|
|
88
|
+
key: 1,
|
|
89
|
+
class: "p-[20px] border-t"
|
|
90
|
+
}, re = ["innerHTML"];
|
|
91
|
+
function se(t, r, a, u, s, p) {
|
|
92
|
+
var h, x, d;
|
|
93
|
+
const b = N("router-link");
|
|
94
|
+
return n(), c("div", A, [
|
|
95
|
+
l("div", G, [
|
|
96
|
+
l("div", O, [
|
|
97
|
+
l("button", {
|
|
98
|
+
onClick: r[0] || (r[0] = (o) => t.$router.back()),
|
|
99
|
+
class: "text-xl font-medium text-gray-600 hover:text-black"
|
|
100
|
+
}, " До таблиці "),
|
|
101
|
+
r[1] || (r[1] = l("span", null, "/", -1)),
|
|
102
|
+
l("h2", R, D(p.getTitle), 1)
|
|
103
|
+
]),
|
|
104
|
+
l("div", F, [
|
|
105
|
+
q(b, {
|
|
106
|
+
to: `/edit?table=${p.getRoute}&id=${(x = (h = t.$route) == null ? void 0 : h.params) == null ? void 0 : x.id}`,
|
|
107
|
+
class: "py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"
|
|
108
|
+
}, {
|
|
109
|
+
default: B(() => r[2] || (r[2] = [
|
|
110
|
+
E(" Редагувати ")
|
|
111
|
+
])),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["to"])
|
|
114
|
+
])
|
|
115
|
+
]),
|
|
116
|
+
l("div", {
|
|
117
|
+
class: T(["grid gap-[20px]", p.getGridClass()])
|
|
118
|
+
}, [
|
|
119
|
+
(n(!0), c(f, null, M((d = s.objectData) == null ? void 0 : d.panels, (o, j) => {
|
|
120
|
+
var _;
|
|
121
|
+
return n(), c("div", {
|
|
122
|
+
key: j,
|
|
123
|
+
class: T([p.getColClass(o.col), "p-4"])
|
|
124
|
+
}, [
|
|
125
|
+
o != null && o.name ? (n(), c("div", I, [
|
|
126
|
+
l("h2", P, D((o == null ? void 0 : o.title) || "Панель"), 1),
|
|
127
|
+
l("div", {
|
|
128
|
+
class: "p-[20px] border-t",
|
|
129
|
+
innerHTML: (_ = s.objectData) == null ? void 0 : _.data[o == null ? void 0 : o.name]
|
|
130
|
+
}, null, 8, S)
|
|
131
|
+
])) : o.type === "container" ? (n(), c("div", J, [
|
|
132
|
+
(n(!0), c(f, null, M(o.items, (e, C) => {
|
|
133
|
+
var y, i, v, w, k;
|
|
134
|
+
return n(), c("div", {
|
|
135
|
+
key: C,
|
|
136
|
+
class: "border rounded-xl bg-white mb-[20px]"
|
|
137
|
+
}, [
|
|
138
|
+
l("h2", K, D((e == null ? void 0 : e.title) || "Панель"), 1),
|
|
139
|
+
e != null && e.component ? (n(), c("div", Q, [
|
|
140
|
+
(n(), L($(e.component), {
|
|
141
|
+
geometry: (i = (y = s.objectData) == null ? void 0 : y.rows[0]) == null ? void 0 : i.geom,
|
|
142
|
+
zoom: 16,
|
|
143
|
+
id: (w = (v = t.$route) == null ? void 0 : v.params) == null ? void 0 : w.id
|
|
144
|
+
}, null, 8, ["geometry", "id"]))
|
|
145
|
+
])) : g("", !0),
|
|
146
|
+
e != null && e.name ? (n(), c("div", U, [
|
|
147
|
+
l("div", {
|
|
148
|
+
innerHTML: (k = s.objectData) == null ? void 0 : k.data[e == null ? void 0 : e.name]
|
|
149
|
+
}, null, 8, W)
|
|
150
|
+
])) : g("", !0)
|
|
151
|
+
]);
|
|
152
|
+
}), 128))
|
|
153
|
+
])) : g("", !0),
|
|
154
|
+
(o == null ? void 0 : o.type) === "tabs" ? (n(), c(f, { key: 2 }, [
|
|
155
|
+
l("nav", X, [
|
|
156
|
+
(n(!0), c(f, null, M(o == null ? void 0 : o.items, (e) => (n(), c("button", {
|
|
157
|
+
key: (e == null ? void 0 : e.name) || (e == null ? void 0 : e.component),
|
|
158
|
+
onClick: (C) => s.component = (e == null ? void 0 : e.component) || (e == null ? void 0 : e.name),
|
|
159
|
+
class: T(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none", {
|
|
160
|
+
"bg-gray-100 text-gray-800 font-semibold after:absolute after:bottom-[-14px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800": s.component === (e == null ? void 0 : e.component) || s.component === (e == null ? void 0 : e.name),
|
|
161
|
+
"hover:bg-gray-100": s.component !== (e == null ? void 0 : e.component) && s.component !== (e == null ? void 0 : e.name)
|
|
162
|
+
}])
|
|
163
|
+
}, D(e == null ? void 0 : e.title), 11, Y))), 128))
|
|
164
|
+
]),
|
|
165
|
+
(n(!0), c(f, null, M(o.items, (e, C) => {
|
|
166
|
+
var y, i, v, w, k;
|
|
167
|
+
return n(), c(f, { key: C }, [
|
|
168
|
+
s.component === (e == null ? void 0 : e.component) || s.component === (e == null ? void 0 : e.name) ? (n(), c("div", Z, [
|
|
169
|
+
l("h2", ee, D((e == null ? void 0 : e.title) || "Панель"), 1),
|
|
170
|
+
e != null && e.component ? (n(), c("div", te, [
|
|
171
|
+
(n(), L($(e.component), {
|
|
172
|
+
geometry: (i = (y = s.objectData) == null ? void 0 : y.rows[0]) == null ? void 0 : i.geom,
|
|
173
|
+
zoom: 16,
|
|
174
|
+
id: (w = (v = t.$route) == null ? void 0 : v.params) == null ? void 0 : w.id
|
|
175
|
+
}, null, 8, ["geometry", "id"]))
|
|
176
|
+
])) : g("", !0),
|
|
177
|
+
e != null && e.name ? (n(), c("div", oe, [
|
|
178
|
+
l("div", {
|
|
179
|
+
innerHTML: (k = s.objectData) == null ? void 0 : k.data[e == null ? void 0 : e.name]
|
|
180
|
+
}, null, 8, re)
|
|
181
|
+
])) : g("", !0)
|
|
182
|
+
])) : g("", !0)
|
|
183
|
+
], 64);
|
|
184
|
+
}), 128))
|
|
185
|
+
], 64)) : g("", !0)
|
|
186
|
+
], 2);
|
|
187
|
+
}), 128))
|
|
188
|
+
], 2)
|
|
189
|
+
]);
|
|
190
|
+
}
|
|
191
|
+
const le = /* @__PURE__ */ V(m, [["render", se], ["__scopeId", "data-v-3adb7a11"]]);
|
|
192
|
+
export {
|
|
193
|
+
le as default
|
|
194
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as m } from "./userMenu-CT1xO2Pt.js";
|
|
2
|
-
import { _ as
|
|
3
|
-
import { resolveComponent as
|
|
2
|
+
import { _ as d, a as i } from "./import-file-C5Tvx4dB.js";
|
|
3
|
+
import { resolveComponent as h, openBlock as u, createElementBlock as b, createElementVNode as n, createBlock as f, createCommentVNode as p } from "vue";
|
|
4
4
|
const g = {
|
|
5
5
|
data() {
|
|
6
6
|
return {
|
|
@@ -33,13 +33,13 @@ const g = {
|
|
|
33
33
|
try {
|
|
34
34
|
const {
|
|
35
35
|
data: { form: s }
|
|
36
|
-
} = await
|
|
36
|
+
} = await i.get(`/api/template/table/${o}`), {
|
|
37
37
|
data: { rows: a }
|
|
38
|
-
} = await
|
|
38
|
+
} = await i.get(
|
|
39
39
|
`/api/table-data/${this.table}/${(l = (c = this.$route) == null ? void 0 : c.query) == null ? void 0 : l.id}`
|
|
40
40
|
);
|
|
41
41
|
this.formValues = a == null ? void 0 : a[0];
|
|
42
|
-
const { data: r } = await
|
|
42
|
+
const { data: r } = await i.get(`/api/template/form/${s}`);
|
|
43
43
|
this.scheme = (r == null ? void 0 : r.schema) || r;
|
|
44
44
|
} catch {
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ const g = {
|
|
|
47
47
|
async editObject() {
|
|
48
48
|
var t, e;
|
|
49
49
|
try {
|
|
50
|
-
await this.$refs.form.doValidation(), await
|
|
50
|
+
await this.$refs.form.doValidation(), await i.put(
|
|
51
51
|
`/api/table/${this.table}/${(e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.id}`,
|
|
52
52
|
this.formValues
|
|
53
53
|
), await this.$router.back(), await this.$notify({
|
|
@@ -64,41 +64,41 @@ const g = {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
}, x = { style: { width: "calc(100vw - 260px)" } }, w = { class: "h-[
|
|
68
|
-
style: { height: "calc(100vh -
|
|
67
|
+
}, x = { style: { width: "calc(100vw - 260px)" } }, w = { class: "h-[58px] bg-gray-50 flex items-center justify-between px-[30px]" }, y = { class: "flex items-center gap-[6px]" }, k = {
|
|
68
|
+
style: { height: "calc(100vh - 120px)", width: "calc(100vw - 260px)" },
|
|
69
69
|
class: "bg-gray-50 p-[20px] flex"
|
|
70
70
|
}, v = { class: "bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-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" };
|
|
71
71
|
function $(t, e, o, c, l, s) {
|
|
72
|
-
const a =
|
|
73
|
-
return u(),
|
|
74
|
-
|
|
75
|
-
e[3] || (e[3] =
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
const a = h("VsForm");
|
|
73
|
+
return u(), b("div", x, [
|
|
74
|
+
n("div", w, [
|
|
75
|
+
e[3] || (e[3] = n("h2", { class: "text-xl font-medium" }, "Редагувати", -1)),
|
|
76
|
+
n("div", y, [
|
|
77
|
+
n("button", {
|
|
78
78
|
onClick: e[0] || (e[0] = (r) => t.$router.back()),
|
|
79
79
|
class: "py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"
|
|
80
80
|
}, " Скасувати "),
|
|
81
|
-
|
|
81
|
+
n("button", {
|
|
82
82
|
onClick: e[1] || (e[1] = (...r) => s.editObject && s.editObject(...r)),
|
|
83
|
-
class: "py-2 px-3
|
|
83
|
+
class: "py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"
|
|
84
84
|
}, " Зберегти ")
|
|
85
85
|
])
|
|
86
86
|
]),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
l.scheme ? (u(),
|
|
87
|
+
n("div", k, [
|
|
88
|
+
n("div", v, [
|
|
89
|
+
l.scheme ? (u(), f(a, {
|
|
90
90
|
key: 0,
|
|
91
91
|
ref: "form",
|
|
92
92
|
scheme: l.scheme,
|
|
93
93
|
modelValue: l.formValues,
|
|
94
94
|
"onUpdate:modelValue": e[2] || (e[2] = (r) => l.formValues = r),
|
|
95
95
|
class: "p-0 mt-[20px]"
|
|
96
|
-
}, null, 8, ["scheme", "modelValue"])) :
|
|
96
|
+
}, null, 8, ["scheme", "modelValue"])) : p("", !0)
|
|
97
97
|
])
|
|
98
98
|
])
|
|
99
99
|
]);
|
|
100
100
|
}
|
|
101
|
-
const C = /* @__PURE__ */
|
|
101
|
+
const C = /* @__PURE__ */ d(g, [["render", $]]);
|
|
102
102
|
export {
|
|
103
103
|
C as default
|
|
104
104
|
};
|