@opengis/admin 0.1.59 → 0.1.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{add-page-BOXd-uV_.js → add-page-C3Wh2-Ml.js} +13 -11
- package/dist/admin-interface-C4m7uvG2.js +896 -0
- package/dist/admin-view-YtM2-LrW.js +225 -0
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +95 -207
- package/dist/card-page-WrYs8chM.js +133 -0
- package/dist/{card-view-NLu0N8TA.js → card-view-BwtqUSFP.js} +1 -1
- package/dist/{edit-page-z7ozrw2C.js → edit-page-CMTqsvJf.js} +34 -33
- package/dist/import-file-bdYAo8iW.js +29759 -0
- package/dist/style.css +1 -1
- package/dist/userMenu-CT1xO2Pt.js +5 -0
- package/module/settings/select/core.roles.json +2 -2
- package/package.json +4 -4
- package/plugin.js +5 -69
- package/server/plugins/adminHook.js +165 -0
- package/server/plugins/cron.js +11 -0
- package/server/plugins/hook.js +145 -221
- package/server/routes/data/controllers/cardData.js +5 -4
- package/server/routes/data/controllers/funcs/getFilterSQL/util/formatValue.js +5 -5
- package/server/routes/data/controllers/tableData.js +9 -42
- package/server/routes/data/controllers/tableFilter.js +3 -3
- package/server/routes/data/controllers/utils/getColumns.js +2 -15
- package/server/routes/templates/controllers/getTemplate.js +5 -1
- package/dist/admin-interface-DbfKIAnw.js +0 -1347
- package/dist/admin-view-DDDd_P1v.js +0 -461
- package/dist/card-page-Bq7fUm5C.js +0 -230
- package/dist/import-file-BBA7riUK.js +0 -47257
@@ -0,0 +1,133 @@
|
|
1
|
+
import { u as T } from "./userMenu-CT1xO2Pt.js";
|
2
|
+
import { _ as H, a as N } from "./import-file-bdYAo8iW.js";
|
3
|
+
import { resolveComponent as B, openBlock as a, createElementBlock as c, createElementVNode as n, toDisplayString as i, createVNode as E, withCtx as z, createTextVNode as G, normalizeClass as D, Fragment as j, renderList as $, createBlock as O, resolveDynamicComponent as R, createCommentVNode as p } from "vue";
|
4
|
+
const F = {
|
5
|
+
data() {
|
6
|
+
return {
|
7
|
+
objectData: null
|
8
|
+
};
|
9
|
+
},
|
10
|
+
computed: {
|
11
|
+
getRoute() {
|
12
|
+
const t = this.flattenMenu(T.value);
|
13
|
+
t != null && t.length || this.$router.replace("/404");
|
14
|
+
const e = t == null ? void 0 : t.find((r) => {
|
15
|
+
var d, l;
|
16
|
+
return (r == null ? void 0 : r.table) == ((l = (d = this.$route) == null ? void 0 : d.params) == null ? void 0 : l.table);
|
17
|
+
});
|
18
|
+
return e || this.$router.replace("/404"), e == null ? void 0 : e.path;
|
19
|
+
}
|
20
|
+
},
|
21
|
+
mounted() {
|
22
|
+
this.getObjectData();
|
23
|
+
},
|
24
|
+
methods: {
|
25
|
+
async getObjectData() {
|
26
|
+
var r;
|
27
|
+
const { table: t, id: e } = (r = this.$route) == null ? void 0 : r.params;
|
28
|
+
(!t || !e) && this.$router.replace("/404");
|
29
|
+
try {
|
30
|
+
const { data: d } = await N.get(`/api/table-data/${t}/${e}`);
|
31
|
+
this.objectData = d;
|
32
|
+
} catch (d) {
|
33
|
+
console.error(d);
|
34
|
+
}
|
35
|
+
},
|
36
|
+
getColClass(t) {
|
37
|
+
return `col-span-${t || 12}`;
|
38
|
+
},
|
39
|
+
getGridClass() {
|
40
|
+
return "grid-cols-12";
|
41
|
+
},
|
42
|
+
flattenMenu(t) {
|
43
|
+
const e = [];
|
44
|
+
return t.forEach((r) => {
|
45
|
+
r.menu ? e.push(...this.flattenMenu(r.menu)) : e.push(r);
|
46
|
+
}), e;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}, I = {
|
50
|
+
style: { width: "calc(100vw - 260px)", height: "100vh" },
|
51
|
+
class: "bg-gray-50 overflow-y-auto"
|
52
|
+
}, P = { class: "h-[58px] bg-gray-50 flex items-center justify-between px-[30px]" }, S = { class: "flex items-center gap-[4px]" }, q = { class: "text-xl font-medium text-gray-600" }, A = { class: "flex items-center gap-[6px]" }, J = {
|
53
|
+
key: 0,
|
54
|
+
class: "border rounded-xl bg-white"
|
55
|
+
}, K = { class: "p-[10px] pl-[20px] text-xl" }, Q = ["innerHTML"], U = { key: 1 }, W = { class: "p-[10px] pl-[20px] text-xl" }, X = {
|
56
|
+
key: 0,
|
57
|
+
class: "p-[20px] border-t"
|
58
|
+
}, Y = {
|
59
|
+
key: 1,
|
60
|
+
class: "p-[20px] border-t"
|
61
|
+
}, Z = ["innerHTML"];
|
62
|
+
function ee(t, e, r, d, l, u) {
|
63
|
+
var h, x, g, b, _, f;
|
64
|
+
const M = B("router-link");
|
65
|
+
return a(), c("div", I, [
|
66
|
+
n("div", P, [
|
67
|
+
n("div", S, [
|
68
|
+
n("button", {
|
69
|
+
onClick: e[0] || (e[0] = (o) => t.$router.back()),
|
70
|
+
class: "text-xl font-medium text-gray-600 hover:text-black"
|
71
|
+
}, " До таблиці "),
|
72
|
+
e[1] || (e[1] = n("span", null, "/", -1)),
|
73
|
+
n("h2", q, i(((g = (x = (h = l.objectData) == null ? void 0 : h.rows) == null ? void 0 : x[0]) == null ? void 0 : g.name) || "Сторінка об'єкта"), 1)
|
74
|
+
]),
|
75
|
+
n("div", A, [
|
76
|
+
E(M, {
|
77
|
+
to: `/edit?table=${u.getRoute}&id=${(_ = (b = t.$route) == null ? void 0 : b.params) == null ? void 0 : _.id}`,
|
78
|
+
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"
|
79
|
+
}, {
|
80
|
+
default: z(() => e[2] || (e[2] = [
|
81
|
+
G(" Редагувати ")
|
82
|
+
])),
|
83
|
+
_: 1
|
84
|
+
}, 8, ["to"])
|
85
|
+
])
|
86
|
+
]),
|
87
|
+
n("div", {
|
88
|
+
class: D(["grid gap-[20px]", u.getGridClass()])
|
89
|
+
}, [
|
90
|
+
(a(!0), c(j, null, $((f = l.objectData) == null ? void 0 : f.panels, (o, V) => {
|
91
|
+
var m;
|
92
|
+
return a(), c("div", {
|
93
|
+
key: V,
|
94
|
+
class: D([u.getColClass(o.col), "p-4"])
|
95
|
+
}, [
|
96
|
+
o != null && o.name ? (a(), c("div", J, [
|
97
|
+
n("h2", K, i((o == null ? void 0 : o.title) || "Панель"), 1),
|
98
|
+
n("div", {
|
99
|
+
class: "p-[20px] border-t",
|
100
|
+
innerHTML: (m = l.objectData) == null ? void 0 : m.data[o == null ? void 0 : o.name]
|
101
|
+
}, null, 8, Q)
|
102
|
+
])) : o.type === "container" ? (a(), c("div", U, [
|
103
|
+
(a(!0), c(j, null, $(o.items, (s, L) => {
|
104
|
+
var v, y, k, w, C;
|
105
|
+
return a(), c("div", {
|
106
|
+
key: L,
|
107
|
+
class: "border rounded-xl bg-white mb-[20px]"
|
108
|
+
}, [
|
109
|
+
n("h2", W, i((s == null ? void 0 : s.title) || "Панель"), 1),
|
110
|
+
s != null && s.component ? (a(), c("div", X, [
|
111
|
+
(a(), O(R(s.component), {
|
112
|
+
geometry: (y = (v = l.objectData) == null ? void 0 : v.rows[0]) == null ? void 0 : y.geom,
|
113
|
+
zoom: 16,
|
114
|
+
id: (w = (k = t.$route) == null ? void 0 : k.params) == null ? void 0 : w.id
|
115
|
+
}, null, 8, ["geometry", "id"]))
|
116
|
+
])) : p("", !0),
|
117
|
+
s != null && s.name ? (a(), c("div", Y, [
|
118
|
+
n("div", {
|
119
|
+
innerHTML: (C = l.objectData) == null ? void 0 : C.data[s == null ? void 0 : s.name]
|
120
|
+
}, null, 8, Z)
|
121
|
+
])) : p("", !0)
|
122
|
+
]);
|
123
|
+
}), 128))
|
124
|
+
])) : p("", !0)
|
125
|
+
], 2);
|
126
|
+
}), 128))
|
127
|
+
], 2)
|
128
|
+
]);
|
129
|
+
}
|
130
|
+
const re = /* @__PURE__ */ H(F, [["render", ee], ["__scopeId", "data-v-86de1424"]]);
|
131
|
+
export {
|
132
|
+
re as default
|
133
|
+
};
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { u as m } from "./userMenu-CT1xO2Pt.js";
|
2
|
+
import { _ as h, a as c } from "./import-file-bdYAo8iW.js";
|
3
|
+
import { resolveComponent as d, openBlock as u, createElementBlock as b, createElementVNode as n, createBlock as f, createCommentVNode as p } from "vue";
|
3
4
|
const g = {
|
4
5
|
data() {
|
5
6
|
return {
|
@@ -19,37 +20,37 @@ const g = {
|
|
19
20
|
}), e;
|
20
21
|
},
|
21
22
|
async getFormScheme() {
|
22
|
-
var
|
23
|
-
const t = this.flattenMenu(
|
23
|
+
var i, s;
|
24
|
+
const t = this.flattenMenu(m.value);
|
24
25
|
t != null && t.length || this.$router.replace("/404");
|
25
|
-
const e = t == null ? void 0 : t.find((
|
26
|
-
var
|
27
|
-
return (
|
26
|
+
const e = t == null ? void 0 : t.find((a) => {
|
27
|
+
var l, r;
|
28
|
+
return (a == null ? void 0 : a.path) == ((r = (l = this.$route) == null ? void 0 : l.query) == null ? void 0 : r.table);
|
28
29
|
});
|
29
30
|
e || this.$router.replace("/404");
|
30
31
|
const o = e == null ? void 0 : e.table;
|
31
32
|
this.table = o;
|
32
33
|
try {
|
33
34
|
const {
|
34
|
-
data: { form:
|
35
|
-
} = await
|
36
|
-
data: { rows:
|
37
|
-
} = await
|
38
|
-
`/api/table-data/${this.table}/${(
|
35
|
+
data: { form: a }
|
36
|
+
} = await c.get(`/api/template/table/${o}`), {
|
37
|
+
data: { rows: l }
|
38
|
+
} = await c.get(
|
39
|
+
`/api/table-data/${this.table}/${(s = (i = this.$route) == null ? void 0 : i.query) == null ? void 0 : s.id}`
|
39
40
|
);
|
40
|
-
this.formValues =
|
41
|
-
const { data: r } = await
|
41
|
+
this.formValues = l == null ? void 0 : l[0];
|
42
|
+
const { data: r } = await c.get(`/api/template/form/${a}`);
|
42
43
|
this.scheme = (r == null ? void 0 : r.schema) || r;
|
43
44
|
} catch {
|
44
45
|
}
|
45
46
|
},
|
46
47
|
async editObject() {
|
47
|
-
var t, e;
|
48
|
+
var t, e, o, i;
|
48
49
|
try {
|
49
|
-
await this.$refs.form.doValidation(), await
|
50
|
+
await this.$refs.form.doValidation(), await c.put(
|
50
51
|
`/api/table/${this.table}/${(e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.id}`,
|
51
52
|
this.formValues
|
52
|
-
), await this.$router.
|
53
|
+
), await this.$router.replace(`/${(i = (o = this.$route) == null ? void 0 : o.query) == null ? void 0 : i.table}`), await this.$notify({
|
53
54
|
title: "Успішно!",
|
54
55
|
message: "Об'єкт успішно створено",
|
55
56
|
type: "success"
|
@@ -63,13 +64,13 @@ const g = {
|
|
63
64
|
}
|
64
65
|
}
|
65
66
|
}
|
66
|
-
}, x = { style: { width: "calc(100vw - 260px)" } }, w = { class: "h-[
|
67
|
-
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 - 60px)", width: "calc(100vw - 260px)" },
|
68
69
|
class: "bg-gray-50 p-[20px] flex"
|
69
|
-
},
|
70
|
-
function
|
71
|
-
const
|
72
|
-
return u(),
|
70
|
+
}, $ = { 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
|
+
function v(t, e, o, i, s, a) {
|
72
|
+
const l = d("VsForm");
|
73
|
+
return u(), b("div", x, [
|
73
74
|
n("div", w, [
|
74
75
|
e[3] || (e[3] = n("h2", { class: "text-xl font-medium" }, "Редагувати", -1)),
|
75
76
|
n("div", y, [
|
@@ -78,26 +79,26 @@ function $(t, e, o, c, l, s) {
|
|
78
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"
|
79
80
|
}, " Скасувати "),
|
80
81
|
n("button", {
|
81
|
-
onClick: e[1] || (e[1] = (...r) =>
|
82
|
-
class: "py-2 px-3
|
82
|
+
onClick: e[1] || (e[1] = (...r) => a.editObject && a.editObject(...r)),
|
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"
|
83
84
|
}, " Зберегти ")
|
84
85
|
])
|
85
86
|
]),
|
86
87
|
n("div", k, [
|
87
|
-
n("div",
|
88
|
-
|
88
|
+
n("div", $, [
|
89
|
+
s.scheme ? (u(), f(l, {
|
89
90
|
key: 0,
|
90
91
|
ref: "form",
|
91
|
-
scheme:
|
92
|
-
modelValue:
|
93
|
-
"onUpdate:modelValue": e[2] || (e[2] = (r) =>
|
92
|
+
scheme: s.scheme,
|
93
|
+
modelValue: s.formValues,
|
94
|
+
"onUpdate:modelValue": e[2] || (e[2] = (r) => s.formValues = r),
|
94
95
|
class: "p-0 mt-[20px]"
|
95
|
-
}, null, 8, ["scheme", "modelValue"])) :
|
96
|
+
}, null, 8, ["scheme", "modelValue"])) : p("", !0)
|
96
97
|
])
|
97
98
|
])
|
98
99
|
]);
|
99
100
|
}
|
100
|
-
const
|
101
|
+
const q = /* @__PURE__ */ h(g, [["render", v]]);
|
101
102
|
export {
|
102
|
-
|
103
|
+
q as default
|
103
104
|
};
|