@opengis/admin 0.1.59 → 0.1.61

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,230 +0,0 @@
1
- import { f as L, g as R, _ as V, u as H, a as A } from "./import-file-BBA7riUK.js";
2
- import { computed as q, resolveComponent as $, openBlock as s, createElementBlock as a, createElementVNode as p, toDisplayString as j, createVNode as z, withCtx as B, createTextVNode as N, createBlock as m, createCommentVNode as v, normalizeClass as M, Fragment as w, renderList as D, resolveDynamicComponent as T } from "vue";
3
- const E = { class: "h-[76px] bg-white border rounded-xl flex items-center justify-between px-[15px] mb-[16px]" }, S = { class: "text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200" }, G = { class: "flex items-center gap-[6px]" }, O = {
4
- __name: "admin-card-header",
5
- props: {
6
- title: {
7
- type: String
8
- },
9
- getRoute: {
10
- type: String,
11
- required: !0
12
- }
13
- },
14
- setup(t) {
15
- const n = t, c = L(), l = R(), r = () => {
16
- c.back();
17
- }, u = q(
18
- () => {
19
- var d;
20
- return `/edit?table=${n.getRoute}&id=${(d = l == null ? void 0 : l.params) == null ? void 0 : d.id}`;
21
- }
22
- );
23
- return (d, h) => {
24
- const b = $("router-link");
25
- return s(), a("div", E, [
26
- p("div", null, [
27
- p("button", {
28
- onClick: r,
29
- class: "text-sm h-[20px] text-blue-600 font-medium hover:border-b hover:border-b-2 hover:border-b-blue-500"
30
- }, " До таблиці "),
31
- p("h2", S, j(t.title), 1)
32
- ]),
33
- p("div", G, [
34
- z(b, {
35
- to: u.value,
36
- class: "inline-flex items-center px-3 py-2 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white"
37
- }, {
38
- default: B(() => h[0] || (h[0] = [
39
- N(" Редагувати ")
40
- ])),
41
- _: 1
42
- }, 8, ["to"])
43
- ])
44
- ]);
45
- };
46
- }
47
- }, F = {
48
- components: { AdminCardHeader: O },
49
- data() {
50
- return {
51
- objectData: null,
52
- component: ""
53
- };
54
- },
55
- computed: {
56
- getRoute() {
57
- const t = this.flattenMenu(H.value);
58
- t != null && t.length || this.$router.replace("/404");
59
- const n = t == null ? void 0 : t.find((c) => {
60
- var l, r;
61
- return (c == null ? void 0 : c.table) == ((r = (l = this.$route) == null ? void 0 : l.params) == null ? void 0 : r.table);
62
- });
63
- return n || this.$router.replace("/404"), n == null ? void 0 : n.path;
64
- },
65
- getTitle() {
66
- var t, n, c, l, r, u, d, h, b, o, i, C, e, k, _;
67
- if ((c = (n = (t = this.objectData) == null ? void 0 : t.rows) == null ? void 0 : n[0]) != null && c.name)
68
- return ((d = (u = (r = (l = this.objectData) == null ? void 0 : l.rows) == null ? void 0 : r[0]) == null ? void 0 : u.name) == null ? void 0 : d.length) < 35 ? (o = (b = (h = this.objectData) == null ? void 0 : h.rows) == null ? void 0 : b[0]) == null ? void 0 : o.name : ((k = (e = (C = (i = this.objectData) == null ? void 0 : i.rows) == null ? void 0 : C[0]) == null ? void 0 : e.name) == null ? void 0 : k.slice(0, 35)) + " ...";
69
- {
70
- const x = (_ = this.flattenMenu(H.value)) == null ? void 0 : _.find(
71
- (g) => {
72
- var f, y;
73
- return (g == null ? void 0 : g.table) === ((y = (f = this.$route) == null ? void 0 : f.params) == null ? void 0 : y.table);
74
- }
75
- );
76
- return x == null ? void 0 : x.ua;
77
- }
78
- }
79
- },
80
- async mounted() {
81
- await this.getObjectData(), await this.checkActiveComponent();
82
- },
83
- watch: {
84
- component(t) {
85
- this.$router.replace({ ...this.$route, query: { tab: t } });
86
- }
87
- },
88
- methods: {
89
- async getObjectData() {
90
- var c;
91
- const { table: t, id: n } = (c = this.$route) == null ? void 0 : c.params;
92
- (!t || !n) && this.$router.replace("/404");
93
- try {
94
- const { data: l } = await A.get(`/api/table-data/${t}/${n}`);
95
- this.objectData = l;
96
- } catch (l) {
97
- console.error(l);
98
- }
99
- },
100
- getColClass(t) {
101
- return `col-span-${t || 12}`;
102
- },
103
- getGridClass() {
104
- return "grid-cols-12";
105
- },
106
- checkActiveComponent() {
107
- var t, n, c, l, r, u, d, h, b;
108
- if ((n = (t = this.$route) == null ? void 0 : t.query) != null && n.tab)
109
- this.component = (l = (c = this.$route) == null ? void 0 : c.query) == null ? void 0 : l.tab;
110
- else {
111
- const o = (u = (r = this.objectData) == null ? void 0 : r.panels) == null ? void 0 : u.find((i) => (i == null ? void 0 : i.type) === "tabs");
112
- (d = o == null ? void 0 : o.items) != null && d.length && (this.component = ((h = o.items[0]) == null ? void 0 : h.component) || ((b = o.items[0]) == null ? void 0 : b.name));
113
- }
114
- },
115
- flattenMenu(t) {
116
- const n = [];
117
- return t.forEach((c) => {
118
- c.menu ? n.push(...this.flattenMenu(c.menu)) : n.push(c);
119
- }), n;
120
- }
121
- }
122
- }, I = {
123
- style: { width: "calc(100vw - 260px)", height: "calc(100vh - 60px)" },
124
- class: "p-4 overflow-y-auto bg-gray-50"
125
- }, P = {
126
- key: 0,
127
- class: "bg-white border rounded-xl"
128
- }, J = { class: "p-[10px] pl-[20px] text-xl" }, K = ["innerHTML"], Q = { key: 1 }, U = { class: "p-[10px] pl-[20px] text-xl" }, W = {
129
- key: 0,
130
- class: "p-[20px] border-t"
131
- }, X = {
132
- key: 1,
133
- class: "p-[20px] border-t"
134
- }, Y = ["innerHTML"], Z = { class: "flex space-x-1 w-full bg-white border border-b-0 rounded-tr-xl rounded-tl-xl h-[60px] items-center pl-[20px]" }, ee = ["onClick"], te = {
135
- key: 0,
136
- class: "bg-white border border-t-0 rounded-bl-xl rounded-br-xl"
137
- }, oe = {
138
- key: 0,
139
- class: "p-[20px] border-t"
140
- }, re = {
141
- key: 1,
142
- class: "p-[20px] border-t"
143
- }, ne = ["innerHTML"];
144
- function se(t, n, c, l, r, u) {
145
- var h, b;
146
- const d = $("AdminCardHeader");
147
- return s(), a("div", I, [
148
- ((h = r.objectData) == null ? void 0 : h.isHeader) !== !1 ? (s(), m(d, {
149
- key: 0,
150
- title: u.getTitle,
151
- "get-route": u.getRoute
152
- }, null, 8, ["title", "get-route"])) : v("", !0),
153
- p("div", {
154
- class: M(["grid gap-[20px]", u.getGridClass()])
155
- }, [
156
- (s(!0), a(w, null, D((b = r.objectData) == null ? void 0 : b.panels, (o, i) => {
157
- var C;
158
- return s(), a("div", {
159
- key: i,
160
- class: M(u.getColClass(o.col))
161
- }, [
162
- o != null && o.name ? (s(), a("div", P, [
163
- p("h2", J, j((o == null ? void 0 : o.title) || "Панель"), 1),
164
- p("div", {
165
- class: "p-[20px] border-t",
166
- innerHTML: (C = r.objectData) == null ? void 0 : C.data[o == null ? void 0 : o.name]
167
- }, null, 8, K)
168
- ])) : o.type === "container" ? (s(), a("div", Q, [
169
- (s(!0), a(w, null, D(o.items, (e, k) => {
170
- var _, x, g, f, y;
171
- return s(), a("div", {
172
- key: k,
173
- class: "border rounded-xl bg-white mb-[20px]"
174
- }, [
175
- p("h2", U, j((e == null ? void 0 : e.title) || "Панель"), 1),
176
- e != null && e.component ? (s(), a("div", W, [
177
- (s(), m(T(e.component), {
178
- geometry: (x = (_ = r.objectData) == null ? void 0 : _.rows[0]) == null ? void 0 : x.geom,
179
- zoom: 16,
180
- id: (f = (g = t.$route) == null ? void 0 : g.params) == null ? void 0 : f.id
181
- }, null, 8, ["geometry", "id"]))
182
- ])) : v("", !0),
183
- e != null && e.name ? (s(), a("div", X, [
184
- p("div", {
185
- innerHTML: (y = r.objectData) == null ? void 0 : y.data[e == null ? void 0 : e.name]
186
- }, null, 8, Y)
187
- ])) : v("", !0)
188
- ]);
189
- }), 128))
190
- ])) : v("", !0),
191
- (o == null ? void 0 : o.type) === "tabs" ? (s(), a(w, { key: 2 }, [
192
- p("nav", Z, [
193
- (s(!0), a(w, null, D(o == null ? void 0 : o.items, (e) => (s(), a("button", {
194
- key: (e == null ? void 0 : e.name) || (e == null ? void 0 : e.component),
195
- onClick: (k) => r.component = (e == null ? void 0 : e.component) || (e == null ? void 0 : e.name),
196
- class: M(["px-2.5 h-[30px] py-1.5 relative inline-flex items-center gap-x-2 text-gray-500 hover:bg-gray-100 focus:bg-gray-100 hover:text-gray-800 text-sm whitespace-nowrap rounded-lg focus:outline-none", {
197
- " 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": r.component === (e == null ? void 0 : e.component) || r.component === (e == null ? void 0 : e.name),
198
- "": r.component !== (e == null ? void 0 : e.component) && r.component !== (e == null ? void 0 : e.name)
199
- }])
200
- }, j(e == null ? void 0 : e.title), 11, ee))), 128))
201
- ]),
202
- (s(!0), a(w, null, D(o.items, (e, k) => {
203
- var _, x, g, f, y;
204
- return s(), a(w, { key: k }, [
205
- r.component === (e == null ? void 0 : e.component) || r.component === (e == null ? void 0 : e.name) ? (s(), a("div", te, [
206
- e != null && e.component ? (s(), a("div", oe, [
207
- (s(), m(T(e.component), {
208
- geometry: (x = (_ = r.objectData) == null ? void 0 : _.rows[0]) == null ? void 0 : x.geom,
209
- zoom: 16,
210
- id: (f = (g = t.$route) == null ? void 0 : g.params) == null ? void 0 : f.id
211
- }, null, 8, ["geometry", "id"]))
212
- ])) : v("", !0),
213
- e != null && e.name ? (s(), a("div", re, [
214
- p("div", {
215
- innerHTML: (y = r.objectData) == null ? void 0 : y.data[e == null ? void 0 : e.name]
216
- }, null, 8, ne)
217
- ])) : v("", !0)
218
- ])) : v("", !0)
219
- ], 64);
220
- }), 128))
221
- ], 64)) : v("", !0)
222
- ], 2);
223
- }), 128))
224
- ], 2)
225
- ]);
226
- }
227
- const le = /* @__PURE__ */ V(F, [["render", se], ["__scopeId", "data-v-274c6efe"]]);
228
- export {
229
- le as default
230
- };