@opengis/admin 0.2.58 → 0.2.60
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-DdvFmTgc.js → add-page-s3kAXu-D.js} +1 -1
- package/dist/admin-interface-BcBS-eDR.js +1855 -0
- package/dist/{admin-view-HtofXFzi.js → admin-view-CMCHSXHc.js} +116 -120
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +52 -52
- package/dist/{card-view-Dh_K-AYO.js → card-view-BAr1nB6G.js} +1 -1
- package/dist/{edit-page-6ni8DMRH.js → edit-page-BEUUypdS.js} +1 -1
- package/dist/{import-file-BCQRB2FQ.js → import-file-4FTWUxAt.js} +7059 -6969
- package/dist/style.css +1 -1
- package/module/settings/menu.json +0 -15
- package/package.json +1 -1
- package/dist/admin-interface-D3qL--vJ.js +0 -1587
@@ -1,1587 +0,0 @@
|
|
1
|
-
import { _ as T, e as Pe, f as Be, g as Le, d as F, I as ze, h as z, A as O, V as Oe, i as Ue, j as Ne, k as Ee, l as He, m as Re, n as We, a as Je, u as Ae, s as Ge } from "./import-file-BCQRB2FQ.js";
|
2
|
-
import { openBlock as l, createElementBlock as i, createTextVNode as j, toDisplayString as I, createCommentVNode as v, resolveComponent as p, Fragment as $, createElementVNode as o, createVNode as y, withCtx as A, createBlock as _, renderList as V, withModifiers as Ke, normalizeClass as D, createStaticVNode as Qe, withDirectives as U, vModelCheckbox as Xe, Transition as N, renderSlot as Ye, vShow as Ie, getCurrentInstance as Se, ref as B, resolveDynamicComponent as L, normalizeStyle as Te } from "vue";
|
3
|
-
const Ze = {
|
4
|
-
data() {
|
5
|
-
return {
|
6
|
-
currentSort: ""
|
7
|
-
};
|
8
|
-
},
|
9
|
-
props: {
|
10
|
-
data: {
|
11
|
-
type: Object,
|
12
|
-
default: () => null
|
13
|
-
},
|
14
|
-
activeColumn: { type: String }
|
15
|
-
},
|
16
|
-
computed: {
|
17
|
-
label() {
|
18
|
-
var t, e;
|
19
|
-
return ((t = this.data) == null ? void 0 : t.ua) || ((e = this.data) == null ? void 0 : e.label) || this.data.title || "null";
|
20
|
-
},
|
21
|
-
selectedSortParam() {
|
22
|
-
var t, e;
|
23
|
-
return (e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.sort;
|
24
|
-
},
|
25
|
-
getVisibleIcon() {
|
26
|
-
return this.data.format !== "image" && this.data.format !== "verify";
|
27
|
-
}
|
28
|
-
},
|
29
|
-
watch: {
|
30
|
-
activeColumn(t) {
|
31
|
-
t !== this.data.name && (this.currentSort = "");
|
32
|
-
}
|
33
|
-
},
|
34
|
-
methods: {
|
35
|
-
changeCurrentSort(t) {
|
36
|
-
switch (t) {
|
37
|
-
case "":
|
38
|
-
return "asc";
|
39
|
-
case "asc":
|
40
|
-
return "desc";
|
41
|
-
case "desc":
|
42
|
-
return "";
|
43
|
-
default:
|
44
|
-
return "";
|
45
|
-
}
|
46
|
-
},
|
47
|
-
handleClickSortBtn(t) {
|
48
|
-
this.$emit("change-active", this.data.name), this.currentSort = this.changeCurrentSort(t);
|
49
|
-
const e = this.$route.query, { sort: n, ...a } = e, s = this.currentSort ? `${this.data.name}-${this.currentSort}` : "";
|
50
|
-
this.$router.replace({
|
51
|
-
query: {
|
52
|
-
...a,
|
53
|
-
...s && { sort: s }
|
54
|
-
}
|
55
|
-
});
|
56
|
-
},
|
57
|
-
isValueEqualToSelected(t) {
|
58
|
-
return `${this.data.name}-${t}` === this.selectedSortParam;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}, et = {
|
62
|
-
scope: "col",
|
63
|
-
class: "px-2 py-1 text-start"
|
64
|
-
}, tt = {
|
65
|
-
class: "flex-shrink-0 size-3.5",
|
66
|
-
xmlns: "http://www.w3.org/2000/svg",
|
67
|
-
width: "24",
|
68
|
-
height: "24",
|
69
|
-
viewBox: "0 0 24 24",
|
70
|
-
fill: "none",
|
71
|
-
stroke: "currentColor",
|
72
|
-
"stroke-width": "2",
|
73
|
-
"stroke-linecap": "round",
|
74
|
-
"stroke-linejoin": "round"
|
75
|
-
}, st = {
|
76
|
-
key: 0,
|
77
|
-
d: "m7 15 5 5 5-5"
|
78
|
-
}, nt = {
|
79
|
-
key: 1,
|
80
|
-
d: "m7 9 5-5 5 5"
|
81
|
-
}, lt = {
|
82
|
-
key: 1,
|
83
|
-
class: "flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200"
|
84
|
-
};
|
85
|
-
function ot(t, e, n, a, s, r) {
|
86
|
-
return l(), i("th", et, [
|
87
|
-
r.getVisibleIcon ? (l(), i("button", {
|
88
|
-
key: 0,
|
89
|
-
type: "button",
|
90
|
-
class: "flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1 dark:text-neutral-200",
|
91
|
-
onClick: e[0] || (e[0] = (u) => r.handleClickSortBtn(s.currentSort))
|
92
|
-
}, [
|
93
|
-
j(I(r.label) + " ", 1),
|
94
|
-
(l(), i("svg", tt, [
|
95
|
-
s.currentSort === "asc" ? (l(), i("path", st)) : v("", !0),
|
96
|
-
s.currentSort === "desc" ? (l(), i("path", nt)) : v("", !0)
|
97
|
-
]))
|
98
|
-
])) : (l(), i("p", lt, I(r.label), 1))
|
99
|
-
]);
|
100
|
-
}
|
101
|
-
const rt = /* @__PURE__ */ T(Ze, [["render", ot]]), at = {
|
102
|
-
components: {
|
103
|
-
IconMore: Pe,
|
104
|
-
IconDelete: Be,
|
105
|
-
IconEdit: Le
|
106
|
-
},
|
107
|
-
emits: ["updateTable"],
|
108
|
-
props: {
|
109
|
-
item: Object,
|
110
|
-
table: String,
|
111
|
-
isForm: null,
|
112
|
-
actions: Array,
|
113
|
-
default: () => []
|
114
|
-
},
|
115
|
-
data() {
|
116
|
-
return {
|
117
|
-
formVisible: !1,
|
118
|
-
isDeleteConfirm: !1,
|
119
|
-
formValue: {},
|
120
|
-
top: 0,
|
121
|
-
left: 0
|
122
|
-
};
|
123
|
-
},
|
124
|
-
computed: {
|
125
|
-
getCustomActions() {
|
126
|
-
return this.actions.filter((t) => typeof t == "object");
|
127
|
-
}
|
128
|
-
},
|
129
|
-
methods: {
|
130
|
-
openConfirm() {
|
131
|
-
this.isDeleteConfirm = !0, document.querySelector("body").click();
|
132
|
-
},
|
133
|
-
async getData() {
|
134
|
-
var t;
|
135
|
-
try {
|
136
|
-
const { data: e } = await F.get(
|
137
|
-
`/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`
|
138
|
-
);
|
139
|
-
this.formValue = e;
|
140
|
-
} catch (e) {
|
141
|
-
console.error(e);
|
142
|
-
}
|
143
|
-
},
|
144
|
-
doSomethingOnCancel() {
|
145
|
-
this.formVisible = !1;
|
146
|
-
},
|
147
|
-
async deleteElement() {
|
148
|
-
var t, e;
|
149
|
-
try {
|
150
|
-
const { data: n } = await F.get(
|
151
|
-
`/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`
|
152
|
-
);
|
153
|
-
await F.delete(`/api/table/${n == null ? void 0 : n.token}`), await this.$notify({
|
154
|
-
title: "Успішно!",
|
155
|
-
message: "Об`єкт успішно видалeно",
|
156
|
-
type: "success"
|
157
|
-
}), await this.$emit("update-table");
|
158
|
-
} catch (n) {
|
159
|
-
this.$notify({
|
160
|
-
title: "Помилка!",
|
161
|
-
message: (e = n == null ? void 0 : n.response) == null ? void 0 : e.data,
|
162
|
-
type: "error"
|
163
|
-
});
|
164
|
-
} finally {
|
165
|
-
this.isDeleteConfirm = !1;
|
166
|
-
}
|
167
|
-
},
|
168
|
-
async customButtonAction(t) {
|
169
|
-
var e, n;
|
170
|
-
document.querySelector("body").click(), t != null && t.form ? (await this.$v3plugin.$form({
|
171
|
-
form: t == null ? void 0 : t.form,
|
172
|
-
id: (e = this.item) == null ? void 0 : e.id,
|
173
|
-
api: t == null ? void 0 : t.api,
|
174
|
-
title: t == null ? void 0 : t.title
|
175
|
-
}), await this.$emit("update-table")) : await this.$v3plugin.$api({
|
176
|
-
confirm: t == null ? void 0 : t.confirm,
|
177
|
-
api: t == null ? void 0 : t.api,
|
178
|
-
method: t == null ? void 0 : t.method,
|
179
|
-
id: (n = this.item) == null ? void 0 : n.id,
|
180
|
-
isId: (t == null ? void 0 : t.isId) || !1
|
181
|
-
});
|
182
|
-
}
|
183
|
-
}
|
184
|
-
}, it = { class: "inline-flex" }, ct = { class: "inline-flex items-center justify-center bg-white border rounded-lg shadow-sm size-7 gap-x-2 border-stone-200 text-stone-800 hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50" }, ut = { class: "flex flex-col items-start" }, dt = ["onClick"], pt = { class: "text-gray-800" }, bt = {
|
185
|
-
key: 1,
|
186
|
-
class: "h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"
|
187
|
-
}, ht = { class: "flex justify-end p-[16px] pr-0 gap-x-3" };
|
188
|
-
function ft(t, e, n, a, s, r) {
|
189
|
-
const u = p("IconMore"), f = p("IconEdit"), x = p("router-link"), b = p("IconDelete"), c = p("VsPopover"), k = p("VsConfirm");
|
190
|
-
return l(), i($, null, [
|
191
|
-
o("div", it, [
|
192
|
-
y(c, {
|
193
|
-
trigger: "click",
|
194
|
-
placement: "bottom-left"
|
195
|
-
}, {
|
196
|
-
reference: A(() => [
|
197
|
-
o("button", ct, [
|
198
|
-
y(u, {
|
199
|
-
height: "16",
|
200
|
-
width: "16"
|
201
|
-
})
|
202
|
-
])
|
203
|
-
]),
|
204
|
-
default: A(() => {
|
205
|
-
var m, h, w, g, C;
|
206
|
-
return [
|
207
|
-
o("div", ut, [
|
208
|
-
(m = n.actions) != null && m.includes("edit") && n.isForm ? (l(), _(x, {
|
209
|
-
key: 0,
|
210
|
-
to: `/edit?table=${(w = (h = t.$route) == null ? void 0 : h.params) == null ? void 0 : w.catchAll}&id=${(g = n.item) == null ? void 0 : g.id}`,
|
211
|
-
class: "w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"
|
212
|
-
}, {
|
213
|
-
default: A(() => [
|
214
|
-
y(f, { color: "#000" }),
|
215
|
-
e[4] || (e[4] = j(" Редагувати "))
|
216
|
-
]),
|
217
|
-
_: 1
|
218
|
-
}, 8, ["to"])) : v("", !0),
|
219
|
-
(l(!0), i($, null, V(r.getCustomActions, (S, q) => (l(), i("button", {
|
220
|
-
key: q,
|
221
|
-
onClick: (P) => r.customButtonAction(S),
|
222
|
-
class: "w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"
|
223
|
-
}, [
|
224
|
-
y(b, { class: "opacity-0" }),
|
225
|
-
o("span", pt, I(S == null ? void 0 : S.label), 1)
|
226
|
-
], 8, dt))), 128)),
|
227
|
-
n.isForm ? (l(), i("div", bt)) : v("", !0),
|
228
|
-
(C = n.actions) != null && C.includes("del") ? (l(), i("button", {
|
229
|
-
key: 2,
|
230
|
-
onClick: e[0] || (e[0] = Ke((...S) => r.openConfirm && r.openConfirm(...S), ["stop"])),
|
231
|
-
class: "w-full flex items-center gap-x-3 py-1.5 px-2 rounded-lg text-[13px] text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"
|
232
|
-
}, [
|
233
|
-
y(b),
|
234
|
-
e[5] || (e[5] = o("span", { class: "text-gray-800" }, "Видалити", -1))
|
235
|
-
])) : v("", !0)
|
236
|
-
])
|
237
|
-
];
|
238
|
-
}),
|
239
|
-
_: 1
|
240
|
-
})
|
241
|
-
]),
|
242
|
-
y(k, {
|
243
|
-
visible: s.isDeleteConfirm,
|
244
|
-
"onUpdate:visible": e[3] || (e[3] = (m) => s.isDeleteConfirm = m),
|
245
|
-
size: "small",
|
246
|
-
title: "Ви впевнені?"
|
247
|
-
}, {
|
248
|
-
default: A(() => [
|
249
|
-
e[6] || (e[6] = o("p", { class: "mt-1 text-sm text-gray-600 dark:text-neutral-400" }, " Ви впевнені, що хочете видалити цей об'єкт? ", -1)),
|
250
|
-
o("div", ht, [
|
251
|
-
o("button", {
|
252
|
-
type: "button",
|
253
|
-
class: "inline-flex items-center px-3 py-2 text-xs font-medium duration-300 border rounded-lg shadow-sm hover:bg-gray-100 gap-x-2 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",
|
254
|
-
onClick: e[1] || (e[1] = (m) => s.isDeleteConfirm = !1)
|
255
|
-
}, " Скасувати "),
|
256
|
-
o("button", {
|
257
|
-
type: "button",
|
258
|
-
class: "inline-flex items-center px-3 py-2 text-xs font-medium text-white duration-300 bg-red-500 rounded-lg gap-x-2 hover:bg-red-700 disabled:opacity-50 disabled:pointer-events-none",
|
259
|
-
onClick: e[2] || (e[2] = (...m) => r.deleteElement && r.deleteElement(...m))
|
260
|
-
}, " Так, я впевнена(ий) ")
|
261
|
-
])
|
262
|
-
]),
|
263
|
-
_: 1
|
264
|
-
}, 8, ["visible"])
|
265
|
-
], 64);
|
266
|
-
}
|
267
|
-
const mt = /* @__PURE__ */ T(at, [["render", ft]]), gt = {}, xt = {
|
268
|
-
class: "flex-shrink-0 mt-0.5 size-3.5",
|
269
|
-
xmlns: "http://www.w3.org/2000/svg",
|
270
|
-
viewBox: "0 0 24 24",
|
271
|
-
fill: "none",
|
272
|
-
stroke: "currentColor",
|
273
|
-
"stroke-width": "2",
|
274
|
-
"stroke-linecap": "round",
|
275
|
-
"stroke-linejoin": "round"
|
276
|
-
};
|
277
|
-
function yt(t, e, n, a, s, r) {
|
278
|
-
return l(), i("svg", xt, e[0] || (e[0] = [
|
279
|
-
o("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
280
|
-
o("path", { d: "M7 20V4" }, null, -1),
|
281
|
-
o("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
282
|
-
o("path", { d: "M17 4v16" }, null, -1)
|
283
|
-
]));
|
284
|
-
}
|
285
|
-
const _t = /* @__PURE__ */ T(gt, [["render", yt]]), vt = {}, kt = {
|
286
|
-
xmlns: "http://www.w3.org/2000/svg",
|
287
|
-
width: "24",
|
288
|
-
height: "24",
|
289
|
-
viewBox: "0 0 24 24",
|
290
|
-
fill: "none",
|
291
|
-
stroke: "currentColor",
|
292
|
-
"stroke-width": "2",
|
293
|
-
"stroke-linecap": "round",
|
294
|
-
"stroke-linejoin": "round",
|
295
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-rosette-discount-check"
|
296
|
-
};
|
297
|
-
function wt(t, e, n, a, s, r) {
|
298
|
-
return l(), i("svg", kt, e[0] || (e[0] = [
|
299
|
-
o("path", {
|
300
|
-
stroke: "none",
|
301
|
-
d: "M0 0h24v24H0z",
|
302
|
-
fill: "none"
|
303
|
-
}, null, -1),
|
304
|
-
o("path", { d: "M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1" }, null, -1),
|
305
|
-
o("path", { d: "M9 12l2 2l4 -4" }, null, -1)
|
306
|
-
]));
|
307
|
-
}
|
308
|
-
const Ct = /* @__PURE__ */ T(vt, [["render", wt]]), $t = {
|
309
|
-
components: { IconExport: _t, IconChevronDown: ze, IconSuccess: Ct },
|
310
|
-
props: {
|
311
|
-
table: String,
|
312
|
-
columns: Array,
|
313
|
-
page: [String, Number],
|
314
|
-
filterCustom: String,
|
315
|
-
filterState: String,
|
316
|
-
filters: String
|
317
|
-
},
|
318
|
-
data() {
|
319
|
-
return {
|
320
|
-
isOpen: !1,
|
321
|
-
tableFormats: ["json", "csv", "xlsx"],
|
322
|
-
format: "",
|
323
|
-
cols: [],
|
324
|
-
activeAction: "",
|
325
|
-
isSuccessTemplate: !1,
|
326
|
-
actions: [
|
327
|
-
{ name: "choceAll", function: this.choceAll, label: "Вибрати усі" },
|
328
|
-
{
|
329
|
-
name: "choceVisible",
|
330
|
-
function: this.choceVisible,
|
331
|
-
label: "Вибрати поточні"
|
332
|
-
},
|
333
|
-
{ name: "clearAll", function: this.clearAll, label: "Жодного" }
|
334
|
-
]
|
335
|
-
};
|
336
|
-
},
|
337
|
-
watch: {
|
338
|
-
isOpen(t) {
|
339
|
-
t || (this.format = "", this.cols = [], this.activeAction = "", this.isSuccessTemplate = !1);
|
340
|
-
}
|
341
|
-
},
|
342
|
-
methods: {
|
343
|
-
async exportTable() {
|
344
|
-
var t;
|
345
|
-
if (!((t = this.cols) != null && t.length)) {
|
346
|
-
this.$notify({
|
347
|
-
type: "error",
|
348
|
-
title: "Помилка",
|
349
|
-
message: "Оберіть колонки для експорту!"
|
350
|
-
});
|
351
|
-
return;
|
352
|
-
}
|
353
|
-
if (!this.format) {
|
354
|
-
this.$notify({
|
355
|
-
type: "error",
|
356
|
-
title: "Помилка",
|
357
|
-
message: "Оберіть формат!"
|
358
|
-
});
|
359
|
-
return;
|
360
|
-
}
|
361
|
-
try {
|
362
|
-
const e = await F.get("/api/export", {
|
363
|
-
params: {
|
364
|
-
table: this.table,
|
365
|
-
format: this.format,
|
366
|
-
cols: this.cols.join(","),
|
367
|
-
page: this.page,
|
368
|
-
filter: this.filters || null,
|
369
|
-
state: this.filterState || null,
|
370
|
-
custom: this.filterCustom || null
|
371
|
-
},
|
372
|
-
responseType: "blob"
|
373
|
-
}), n = await e.data.text(), a = n != null && n.includes(";") ? null : JSON == null ? void 0 : JSON.parse(n), s = new Blob([e.data], {
|
374
|
-
type: "application/octet-stream"
|
375
|
-
}), r = window.URL.createObjectURL(s), u = document.createElement("a");
|
376
|
-
if (u.href = r, u.setAttribute(
|
377
|
-
"download",
|
378
|
-
`${this.table.split(".")[0]}.${this.format}`
|
379
|
-
), document.body.appendChild(u), typeof a == "string") {
|
380
|
-
this.exportTable();
|
381
|
-
return;
|
382
|
-
}
|
383
|
-
u.click(), document.body.removeChild(u), window.URL.revokeObjectURL(r), this.$notify({
|
384
|
-
type: "success",
|
385
|
-
title: "Експорт",
|
386
|
-
message: "Файл успішно експортовано!"
|
387
|
-
}), this.isSuccessTemplate = !0;
|
388
|
-
} catch (e) {
|
389
|
-
console.log(e), this.$notify({
|
390
|
-
type: "error",
|
391
|
-
title: "Помилка",
|
392
|
-
message: "Не вдалося експортувати файл."
|
393
|
-
});
|
394
|
-
}
|
395
|
-
},
|
396
|
-
selectFormat(t) {
|
397
|
-
this.format = t;
|
398
|
-
},
|
399
|
-
choceAll() {
|
400
|
-
var t;
|
401
|
-
this.cols = (t = this.columns) == null ? void 0 : t.map((e) => e == null ? void 0 : e.name), this.activeAction = "choceAll";
|
402
|
-
},
|
403
|
-
clearAll() {
|
404
|
-
this.cols = [], this.activeAction = "clearAll";
|
405
|
-
},
|
406
|
-
choceVisible() {
|
407
|
-
var t, e;
|
408
|
-
this.cols = (e = (t = this.columns) == null ? void 0 : t.filter((n) => (n == null ? void 0 : n.hidden) !== !0)) == null ? void 0 : e.map((n) => n == null ? void 0 : n.name), this.activeAction = "choceVisible";
|
409
|
-
}
|
410
|
-
}
|
411
|
-
}, At = {
|
412
|
-
key: 0,
|
413
|
-
class: "flex flex-col items-center"
|
414
|
-
}, Tt = {
|
415
|
-
key: 1,
|
416
|
-
class: "p-4"
|
417
|
-
}, It = { class: "pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700" }, St = { class: "flex items-center gap-[10px] -ml-[10px] my-[10px]" }, Vt = ["onClick"], Dt = {
|
418
|
-
key: 0,
|
419
|
-
class: "block h-[8px] w-[8px] rounded-full bg-blue-500"
|
420
|
-
}, Ft = { class: "mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]" }, jt = { class: "pb-5 mb-5 border-b border-gray-200 last:pb-0 last:mb-0 last:border-b-0 dark:border-neutral-700" }, Mt = { class: "mt-2 space-y-2" }, qt = ["id", "onChange"], Pt = ["for"], Bt = {
|
421
|
-
key: 0,
|
422
|
-
class: "flex w-full justify-end p-[20px] gap-[6px] border-t"
|
423
|
-
}, Lt = {
|
424
|
-
key: 1,
|
425
|
-
class: "flex w-full justify-end p-[20px] gap-[6px] border-t"
|
426
|
-
};
|
427
|
-
function zt(t, e, n, a, s, r) {
|
428
|
-
const u = p("IconExport"), f = p("IconSuccess"), x = p("VsCheckbox"), b = p("VsDialog");
|
429
|
-
return l(), i($, null, [
|
430
|
-
o("button", {
|
431
|
-
onClick: e[0] || (e[0] = (c) => s.isOpen = !0),
|
432
|
-
class: "py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"
|
433
|
-
}, [
|
434
|
-
y(u, {
|
435
|
-
height: "16",
|
436
|
-
width: "16"
|
437
|
-
}),
|
438
|
-
e[7] || (e[7] = j(" Експорт "))
|
439
|
-
]),
|
440
|
-
y(b, {
|
441
|
-
visible: s.isOpen,
|
442
|
-
"onUpdate:visible": e[6] || (e[6] = (c) => s.isOpen = c),
|
443
|
-
title: "Експорт таблиці",
|
444
|
-
size: "small",
|
445
|
-
closeClickBack: !0
|
446
|
-
}, {
|
447
|
-
footer: A(() => [
|
448
|
-
s.isSuccessTemplate ? (l(), i("div", Bt, [
|
449
|
-
o("button", {
|
450
|
-
type: "button",
|
451
|
-
class: "inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
|
452
|
-
onClick: e[2] || (e[2] = (c) => s.isOpen = !1)
|
453
|
-
}, " Закрити "),
|
454
|
-
o("button", {
|
455
|
-
type: "button",
|
456
|
-
class: "inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",
|
457
|
-
onClick: e[3] || (e[3] = (c) => s.isSuccessTemplate = !1)
|
458
|
-
}, " Вигрузити ще ")
|
459
|
-
])) : (l(), i("div", Lt, [
|
460
|
-
o("button", {
|
461
|
-
type: "button",
|
462
|
-
class: "inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border border-gray-200 rounded-lg shadow-sm text-nowrap text-start hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
|
463
|
-
onClick: e[4] || (e[4] = (c) => s.isOpen = !1)
|
464
|
-
}, " Скасувати "),
|
465
|
-
o("button", {
|
466
|
-
type: "button",
|
467
|
-
class: "inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-white align-middle bg-blue-600 border border-blue-600 rounded-lg shadow-sm text-nowrap gap-x-2 text-start hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-500",
|
468
|
-
onClick: e[5] || (e[5] = (...c) => r.exportTable && r.exportTable(...c))
|
469
|
-
}, " Завантажити таблицю ")
|
470
|
-
]))
|
471
|
-
]),
|
472
|
-
default: A(() => [
|
473
|
-
s.isSuccessTemplate ? (l(), i("div", At, [
|
474
|
-
y(f, {
|
475
|
-
height: "100",
|
476
|
-
width: "100",
|
477
|
-
class: "text-green-200 mb-[20px]"
|
478
|
-
}),
|
479
|
-
e[8] || (e[8] = o("h2", null, "Звіт сформовано і збережено", -1))
|
480
|
-
])) : (l(), i("div", Tt, [
|
481
|
-
o("div", It, [
|
482
|
-
e[9] || (e[9] = o("h2", { class: "text-sm font-[600] text-gray-500" }, " Виберіть стовпці таблиці для експорту: ", -1)),
|
483
|
-
o("div", St, [
|
484
|
-
(l(!0), i($, null, V(s.actions, (c) => (l(), i("button", {
|
485
|
-
key: c == null ? void 0 : c.name,
|
486
|
-
onClick: c == null ? void 0 : c.function,
|
487
|
-
class: "inline-flex items-center gap-[8px] justify-center px-3 py-2 text-sm font-medium text-gray-800 align-middle bg-white border-gray-200 text-nowrap text-start"
|
488
|
-
}, [
|
489
|
-
o("span", {
|
490
|
-
class: D(["h-[14px] w-[14px] border rounded-full flex items-center justify-center", { "border-blue-500": (c == null ? void 0 : c.name) === s.activeAction }])
|
491
|
-
}, [
|
492
|
-
(c == null ? void 0 : c.name) === s.activeAction ? (l(), i("span", Dt)) : v("", !0)
|
493
|
-
], 2),
|
494
|
-
j(" " + I(c == null ? void 0 : c.label), 1)
|
495
|
-
], 8, Vt))), 128))
|
496
|
-
]),
|
497
|
-
o("div", Ft, [
|
498
|
-
(l(!0), i($, null, V(n.columns, (c, k) => (l(), i("div", {
|
499
|
-
class: "flex items-center",
|
500
|
-
key: k,
|
501
|
-
style: { width: "calc((100% - 10px) / 2)" }
|
502
|
-
}, [
|
503
|
-
y(x, {
|
504
|
-
class: "[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",
|
505
|
-
modelValue: s.cols,
|
506
|
-
"onUpdate:modelValue": e[1] || (e[1] = (m) => s.cols = m),
|
507
|
-
value: c == null ? void 0 : c.name,
|
508
|
-
label: c == null ? void 0 : c.ua
|
509
|
-
}, null, 8, ["modelValue", "value", "label"])
|
510
|
-
]))), 128))
|
511
|
-
])
|
512
|
-
]),
|
513
|
-
o("div", jt, [
|
514
|
-
e[10] || (e[10] = o("h2", { class: "text-sm font-[600] text-gray-500" }, "Виберіть формат таблиці:", -1)),
|
515
|
-
o("div", Mt, [
|
516
|
-
(l(!0), i($, null, V(s.tableFormats, (c, k) => (l(), i("div", {
|
517
|
-
class: "flex items-center",
|
518
|
-
key: k
|
519
|
-
}, [
|
520
|
-
o("input", {
|
521
|
-
type: "radio",
|
522
|
-
name: "hs-pro-duecmfm",
|
523
|
-
class: "text-blue-600 border-gray-300 rounded-full shrink-0 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",
|
524
|
-
id: c,
|
525
|
-
onChange: (m) => r.selectFormat(c)
|
526
|
-
}, null, 40, qt),
|
527
|
-
o("label", {
|
528
|
-
for: c,
|
529
|
-
class: "text-sm text-gray-800 ms-3 dark:text-neutral-400"
|
530
|
-
}, " Формат " + I(c), 9, Pt)
|
531
|
-
]))), 128))
|
532
|
-
])
|
533
|
-
])
|
534
|
-
]))
|
535
|
-
]),
|
536
|
-
_: 1
|
537
|
-
}, 8, ["visible"])
|
538
|
-
], 64);
|
539
|
-
}
|
540
|
-
const Ot = /* @__PURE__ */ T($t, [["render", zt]]), Ut = {}, Nt = {
|
541
|
-
xmlns: "http://www.w3.org/2000/svg",
|
542
|
-
viewBox: "0 0 24 24",
|
543
|
-
fill: "none",
|
544
|
-
stroke: "currentColor",
|
545
|
-
"stroke-width": "2",
|
546
|
-
"stroke-linecap": "round",
|
547
|
-
"stroke-linejoin": "round",
|
548
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-columns"
|
549
|
-
};
|
550
|
-
function Et(t, e, n, a, s, r) {
|
551
|
-
return l(), i("svg", Nt, e[0] || (e[0] = [
|
552
|
-
Qe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>', 9)
|
553
|
-
]));
|
554
|
-
}
|
555
|
-
const Ht = /* @__PURE__ */ T(Ut, [["render", Et]]), Rt = {
|
556
|
-
props: { column: Object },
|
557
|
-
emits: ["update-column"],
|
558
|
-
data() {
|
559
|
-
return {
|
560
|
-
value: !1
|
561
|
-
};
|
562
|
-
},
|
563
|
-
watch: {
|
564
|
-
value(t) {
|
565
|
-
this.$emit("update-column", { ...this.column, hidden: !t });
|
566
|
-
}
|
567
|
-
},
|
568
|
-
mounted() {
|
569
|
-
var t;
|
570
|
-
((t = this.column) == null ? void 0 : t.hidden) !== !0 && (this.value = !0);
|
571
|
-
}
|
572
|
-
}, Wt = { class: "flex w-full gap-[8px] items-centr" };
|
573
|
-
function Jt(t, e, n, a, s, r) {
|
574
|
-
var u, f;
|
575
|
-
return l(), i("label", Wt, [
|
576
|
-
U(o("input", {
|
577
|
-
"onUpdate:modelValue": e[0] || (e[0] = (x) => s.value = x),
|
578
|
-
type: "checkbox"
|
579
|
-
}, null, 512), [
|
580
|
-
[Xe, s.value]
|
581
|
-
]),
|
582
|
-
j(" " + I(((u = n.column) == null ? void 0 : u.ua) || ((f = n.column) == null ? void 0 : f.title)), 1)
|
583
|
-
]);
|
584
|
-
}
|
585
|
-
const Gt = /* @__PURE__ */ T(Rt, [["render", Jt]]), Kt = {
|
586
|
-
components: { IconColumns: Ht, AdminTableColumnsHiddenItem: Gt },
|
587
|
-
emits: ["update-columns"],
|
588
|
-
props: { columns: Array },
|
589
|
-
methods: {
|
590
|
-
updateColumn(t) {
|
591
|
-
const e = this.columns.findIndex((a) => (a == null ? void 0 : a.name) === (t == null ? void 0 : t.name)), n = this.columns;
|
592
|
-
n[e] = t, this.$emit("update-columns", [...n]);
|
593
|
-
}
|
594
|
-
}
|
595
|
-
}, Qt = { class: "py-2 max-h-[34px] px-2.5 md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Xt = { class: "py-[10px] px-[10px] w-[260px]" }, Yt = { class: "flex flex-col gap-[3px] max-h-[400px] w-full 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" };
|
596
|
-
function Zt(t, e, n, a, s, r) {
|
597
|
-
const u = p("IconColumns"), f = p("AdminTableColumnsHiddenItem"), x = p("VsPopover");
|
598
|
-
return l(), _(x, {
|
599
|
-
trigger: "click",
|
600
|
-
placement: "bottom"
|
601
|
-
}, {
|
602
|
-
reference: A(() => [
|
603
|
-
o("button", Qt, [
|
604
|
-
y(u, {
|
605
|
-
height: "20",
|
606
|
-
width: "16"
|
607
|
-
})
|
608
|
-
])
|
609
|
-
]),
|
610
|
-
default: A(() => [
|
611
|
-
o("div", Xt, [
|
612
|
-
e[0] || (e[0] = o("h2", { class: "text-sm mb-[8px]" }, "Оберіть колонки, щоб приховати", -1)),
|
613
|
-
o("ul", Yt, [
|
614
|
-
(l(!0), i($, null, V(n.columns, (b, c) => (l(), i("li", { key: c }, [
|
615
|
-
y(f, {
|
616
|
-
column: b,
|
617
|
-
onUpdateColumn: r.updateColumn
|
618
|
-
}, null, 8, ["column", "onUpdateColumn"])
|
619
|
-
]))), 128))
|
620
|
-
])
|
621
|
-
])
|
622
|
-
]),
|
623
|
-
_: 1
|
624
|
-
});
|
625
|
-
}
|
626
|
-
const es = /* @__PURE__ */ T(Kt, [["render", Zt]]), ts = {}, ss = {
|
627
|
-
xmlns: "http://www.w3.org/2000/svg",
|
628
|
-
viewBox: "0 0 24 24",
|
629
|
-
fill: "none",
|
630
|
-
stroke: "currentColor",
|
631
|
-
"stroke-width": "2",
|
632
|
-
"stroke-linecap": "round",
|
633
|
-
"stroke-linejoin": "round",
|
634
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-minus"
|
635
|
-
};
|
636
|
-
function ns(t, e, n, a, s, r) {
|
637
|
-
return l(), i("svg", ss, e[0] || (e[0] = [
|
638
|
-
o("path", {
|
639
|
-
stroke: "none",
|
640
|
-
d: "M0 0h24v24H0z",
|
641
|
-
fill: "none"
|
642
|
-
}, null, -1),
|
643
|
-
o("path", { d: "M5 12l14 0" }, null, -1)
|
644
|
-
]));
|
645
|
-
}
|
646
|
-
const ls = /* @__PURE__ */ T(ts, [["render", ns]]), os = {
|
647
|
-
components: { IconPlus: z, IconMinus: ls },
|
648
|
-
props: {
|
649
|
-
title: String,
|
650
|
-
defaultValue: { type: Boolean, default: () => !1 }
|
651
|
-
},
|
652
|
-
data() {
|
653
|
-
return { expanded: this.defaultValue };
|
654
|
-
}
|
655
|
-
}, rs = { class: "hs-accordion" }, as = { class: "py-0.5 flex items-center gap-x-0.5 w-full" }, is = { class: "text-sm font-medium" }, cs = { class: "relative inline-block w-full duration-150 cursor-pointer before:block before:absolute b" };
|
656
|
-
function us(t, e, n, a, s, r) {
|
657
|
-
const u = p("IconPlus"), f = p("IconMinus");
|
658
|
-
return l(), i("div", null, [
|
659
|
-
o("div", null, [
|
660
|
-
o("div", rs, [
|
661
|
-
o("div", as, [
|
662
|
-
o("div", {
|
663
|
-
onClick: e[0] || (e[0] = (x) => s.expanded = !s.expanded),
|
664
|
-
class: "rounded-md cursor-pointer grow"
|
665
|
-
}, [
|
666
|
-
o("span", is, I(n.title), 1)
|
667
|
-
]),
|
668
|
-
o("button", {
|
669
|
-
class: "flex items-center justify-center rounded-md size-6 hover:bg-gray-100",
|
670
|
-
onClick: e[1] || (e[1] = (x) => s.expanded = !s.expanded)
|
671
|
-
}, [
|
672
|
-
s.expanded ? (l(), _(f, {
|
673
|
-
key: 1,
|
674
|
-
width: "14"
|
675
|
-
})) : (l(), _(u, { key: 0 }))
|
676
|
-
])
|
677
|
-
]),
|
678
|
-
y(N, { name: "fade" }, {
|
679
|
-
default: A(() => [
|
680
|
-
U(o("div", cs, [
|
681
|
-
Ye(t.$slots, "default", {}, void 0, !0)
|
682
|
-
], 512), [
|
683
|
-
[Ie, s.expanded]
|
684
|
-
])
|
685
|
-
]),
|
686
|
-
_: 3
|
687
|
-
})
|
688
|
-
])
|
689
|
-
])
|
690
|
-
]);
|
691
|
-
}
|
692
|
-
const ds = /* @__PURE__ */ T(os, [["render", us], ["__scopeId", "data-v-c6318482"]]), ps = {
|
693
|
-
components: {
|
694
|
-
AdminComponentIs: O,
|
695
|
-
AdminTree: ds,
|
696
|
-
VsNoData: Oe,
|
697
|
-
VsWidgetComments: Ue,
|
698
|
-
VsWidgetMap: Ne,
|
699
|
-
VsWidgetFileList: Ee
|
700
|
-
},
|
701
|
-
props: { table: String, columns: Array, row: Object }
|
702
|
-
}, bs = {
|
703
|
-
class: "hs-accordion border-gray-100 w-[360px] shrink-0 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",
|
704
|
-
style: { height: "calc(100vh - 310px)" }
|
705
|
-
}, hs = {
|
706
|
-
class: "border-l",
|
707
|
-
style: { height: "calc(100vh - 360px)" }
|
708
|
-
}, fs = { class: "flow-root mt-[10px]" }, ms = { class: "-my-3 text-sm divide-y divide-gray-100" }, gs = { class: "flex py-3 sm:grid-cols-3 sm:gap-4" }, xs = { class: "font-medium text-black w-[50%]" }, ys = { class: "text-gray-700 sm:col-span-2 w-[50%]" }, _s = { class: "table-info-card" }, vs = { class: "table-info-card" };
|
709
|
-
function ks(t, e, n, a, s, r) {
|
710
|
-
var m, h, w;
|
711
|
-
const u = p("AdminComponentIs"), f = p("AdminTree"), x = p("VsWidgetMap"), b = p("VsNoData"), c = p("VsWidgetComments"), k = p("VsWidgetFileList");
|
712
|
-
return l(), i("div", bs, [
|
713
|
-
e[0] || (e[0] = o("div", { class: "p-[10px] pl-[18px] pb-[18px] border-b" }, [
|
714
|
-
o("h2", { class: "text-sm font-medium" }, "Інформація про об'єкт")
|
715
|
-
], -1)),
|
716
|
-
o("div", hs, [
|
717
|
-
(h = (m = t.$route) == null ? void 0 : m.query) != null && h.card ? (l(), i($, { key: 0 }, [
|
718
|
-
n.row ? (l(), _(f, {
|
719
|
-
key: 0,
|
720
|
-
defaultValue: !0,
|
721
|
-
title: "Основна інформація",
|
722
|
-
class: "border-b p-[10px] py-[16px]"
|
723
|
-
}, {
|
724
|
-
default: A(() => [
|
725
|
-
o("div", fs, [
|
726
|
-
o("dl", ms, [
|
727
|
-
(l(!0), i($, null, V(n.columns, (g) => (l(), i("div", gs, [
|
728
|
-
o("dt", xs, I((g == null ? void 0 : g.ua) || (g == null ? void 0 : g.title)), 1),
|
729
|
-
o("dd", ys, [
|
730
|
-
y(u, {
|
731
|
-
row: n.row,
|
732
|
-
column: g,
|
733
|
-
table: n.table
|
734
|
-
}, null, 8, ["row", "column", "table"])
|
735
|
-
])
|
736
|
-
]))), 256))
|
737
|
-
])
|
738
|
-
])
|
739
|
-
]),
|
740
|
-
_: 1
|
741
|
-
})) : v("", !0),
|
742
|
-
(w = n.row) != null && w.geom ? (l(), _(f, {
|
743
|
-
key: 1,
|
744
|
-
title: "Карта",
|
745
|
-
class: "border-b p-[10px] py-[16px]"
|
746
|
-
}, {
|
747
|
-
default: A(() => {
|
748
|
-
var g, C;
|
749
|
-
return [
|
750
|
-
(g = n.row) != null && g.geom ? (l(), _(x, {
|
751
|
-
key: 0,
|
752
|
-
geometry: (C = n.row) == null ? void 0 : C.geom,
|
753
|
-
zoom: 14
|
754
|
-
}, null, 8, ["geometry"])) : (l(), _(b, {
|
755
|
-
key: 1,
|
756
|
-
title: "У об'єкта відсутня геометрія",
|
757
|
-
text: "",
|
758
|
-
class: "[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"
|
759
|
-
}))
|
760
|
-
];
|
761
|
-
}),
|
762
|
-
_: 1
|
763
|
-
})) : v("", !0),
|
764
|
-
y(f, {
|
765
|
-
title: "Коментарі",
|
766
|
-
class: "border-b p-[10px] py-[16px]"
|
767
|
-
}, {
|
768
|
-
default: A(() => {
|
769
|
-
var g;
|
770
|
-
return [
|
771
|
-
o("div", _s, [
|
772
|
-
y(c, {
|
773
|
-
id: (g = n.row) == null ? void 0 : g.id
|
774
|
-
}, null, 8, ["id"])
|
775
|
-
])
|
776
|
-
];
|
777
|
-
}),
|
778
|
-
_: 1
|
779
|
-
}),
|
780
|
-
y(f, {
|
781
|
-
title: "Файли",
|
782
|
-
class: "border-b p-[10px] py-[16px]"
|
783
|
-
}, {
|
784
|
-
default: A(() => {
|
785
|
-
var g, C;
|
786
|
-
return [
|
787
|
-
o("div", vs, [
|
788
|
-
(l(), _(k, {
|
789
|
-
key: (g = n.row) == null ? void 0 : g.id,
|
790
|
-
id: (C = n.row) == null ? void 0 : C.id
|
791
|
-
}, null, 8, ["id"]))
|
792
|
-
])
|
793
|
-
];
|
794
|
-
}),
|
795
|
-
_: 1
|
796
|
-
})
|
797
|
-
], 64)) : (l(), _(b, {
|
798
|
-
key: 1,
|
799
|
-
text: "Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"
|
800
|
-
}))
|
801
|
-
])
|
802
|
-
]);
|
803
|
-
}
|
804
|
-
const ws = /* @__PURE__ */ T(ps, [["render", ks]]), Cs = {}, $s = {
|
805
|
-
class: "size-4",
|
806
|
-
xmlns: "http://www.w3.org/2000/svg",
|
807
|
-
viewBox: "0 0 24 24",
|
808
|
-
fill: "none",
|
809
|
-
stroke: "currentColor",
|
810
|
-
"stroke-width": "2",
|
811
|
-
"stroke-linecap": "round",
|
812
|
-
"stroke-linejoin": "round"
|
813
|
-
};
|
814
|
-
function As(t, e, n, a, s, r) {
|
815
|
-
return l(), i("svg", $s, e[0] || (e[0] = [
|
816
|
-
o("rect", {
|
817
|
-
width: "18",
|
818
|
-
height: "18",
|
819
|
-
x: "3",
|
820
|
-
y: "3",
|
821
|
-
rx: "2"
|
822
|
-
}, null, -1),
|
823
|
-
o("path", { d: "M15 3v18" }, null, -1),
|
824
|
-
o("path", { d: "m8 9 3 3-3 3" }, null, -1)
|
825
|
-
]));
|
826
|
-
}
|
827
|
-
const Ts = /* @__PURE__ */ T(Cs, [["render", As]]), Is = {
|
828
|
-
emits: ["filterChange"],
|
829
|
-
props: {
|
830
|
-
scheme: { type: Object },
|
831
|
-
onFilters: { type: Number },
|
832
|
-
table: { type: String }
|
833
|
-
},
|
834
|
-
components: { IconFilter: He },
|
835
|
-
data() {
|
836
|
-
return {
|
837
|
-
isFilters: !1
|
838
|
-
};
|
839
|
-
},
|
840
|
-
methods: {
|
841
|
-
closeFilter({ target: t }) {
|
842
|
-
this.isFilters && t.classList.contains("filter-container") && (this.isFilters = !1);
|
843
|
-
}
|
844
|
-
}
|
845
|
-
}, Ss = { key: 0 }, Vs = { class: "filter-content h-screen bg-white w-[400px] overflow-x-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" };
|
846
|
-
function Ds(t, e, n, a, s, r) {
|
847
|
-
const u = p("IconFilter"), f = p("VsFilter");
|
848
|
-
return l(), i($, null, [
|
849
|
-
o("button", {
|
850
|
-
onClick: e[0] || (e[0] = (x) => s.isFilters = !s.isFilters),
|
851
|
-
class: "py-2 px-2.5 max-h-[34px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none"
|
852
|
-
}, [
|
853
|
-
y(u, {
|
854
|
-
height: "16",
|
855
|
-
width: "16"
|
856
|
-
}),
|
857
|
-
e[4] || (e[4] = j(" Фільтри ")),
|
858
|
-
n.onFilters ? (l(), i("span", Ss, I(n.onFilters), 1)) : v("", !0)
|
859
|
-
]),
|
860
|
-
y(N, { name: "fade" }, {
|
861
|
-
default: A(() => {
|
862
|
-
var x;
|
863
|
-
return [
|
864
|
-
U(o("div", {
|
865
|
-
onClick: e[3] || (e[3] = (...b) => r.closeFilter && r.closeFilter(...b)),
|
866
|
-
style: { height: "100vh" },
|
867
|
-
class: "fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"
|
868
|
-
}, [
|
869
|
-
o("div", Vs, [
|
870
|
-
(x = n.scheme) != null && x.length ? (l(), _(f, {
|
871
|
-
key: 0,
|
872
|
-
ref: "filter",
|
873
|
-
scheme: n.scheme,
|
874
|
-
layout: "default",
|
875
|
-
"apply-vue-router": "",
|
876
|
-
history: "",
|
877
|
-
token: n.table,
|
878
|
-
name: "filter",
|
879
|
-
footer: !0,
|
880
|
-
background: !0,
|
881
|
-
onFilterChange: e[1] || (e[1] = (b) => t.$emit("filterChange", b)),
|
882
|
-
closeFilterBtn: !0,
|
883
|
-
onFilterClose: e[2] || (e[2] = (b) => s.isFilters = !1)
|
884
|
-
}, null, 8, ["scheme", "token"])) : v("", !0)
|
885
|
-
])
|
886
|
-
], 512), [
|
887
|
-
[Ie, s.isFilters]
|
888
|
-
])
|
889
|
-
];
|
890
|
-
}),
|
891
|
-
_: 1
|
892
|
-
})
|
893
|
-
], 64);
|
894
|
-
}
|
895
|
-
const Fs = /* @__PURE__ */ T(Is, [["render", Ds]]), js = {
|
896
|
-
props: { tabsList: { type: Array, default: () => [] }, filterState: String }
|
897
|
-
}, Ms = {
|
898
|
-
class: "relative flex space-x-1 mb-[20px] after:absolute after:w-[99%] after:bottom-0 after:inset-x-0 after:border-b-2 after:border-gray-200 dark:after:border-neutral-700",
|
899
|
-
"aria-label": "Tabs",
|
900
|
-
role: "tablist",
|
901
|
-
"aria-orientation": "horizontal"
|
902
|
-
}, qs = ["onClick"];
|
903
|
-
function Ps(t, e, n, a, s, r) {
|
904
|
-
return l(), i("nav", Ms, [
|
905
|
-
(l(!0), i($, null, V(n.tabsList, (u) => (l(), i("button", {
|
906
|
-
onClick: (f) => t.$emit("update:filterState", u == null ? void 0 : u.name),
|
907
|
-
class: D(["hs-tab-active:after:bg-gray-800 hs-tab-active:text-gray-800 px-2.5 py-1.5 mb-2 relative inline-flex justify-center items-center gap-x-2 hover:bg-gray-100 text-gray-500 hover:text-gray-800 text-sm rounded-lg disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 after:absolute after:-bottom-2 after:inset-x-0 after:z-10 after:h-0.5 after:pointer-events-none dark:hs-tab-active:text-neutral-200 dark:hs-tab-active:after:bg-neutral-400 dark:text-neutral-500 dark:hover:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 active", {
|
908
|
-
" font-semibold after:absolute after:bottom-[-8px] after:left-2.5 after:right-2.5 after:z-10 after:h-0.5 after:bg-gray-800": (u == null ? void 0 : u.name) === n.filterState
|
909
|
-
}])
|
910
|
-
}, I(u == null ? void 0 : u.label), 11, qs))), 256))
|
911
|
-
]);
|
912
|
-
}
|
913
|
-
const Bs = /* @__PURE__ */ T(js, [["render", Ps]]), Ls = {}, zs = {
|
914
|
-
xmlns: "http://www.w3.org/2000/svg",
|
915
|
-
viewBox: "0 0 24 24",
|
916
|
-
fill: "none",
|
917
|
-
stroke: "currentColor",
|
918
|
-
"stroke-width": "2",
|
919
|
-
"stroke-linecap": "round",
|
920
|
-
"stroke-linejoin": "round",
|
921
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-filter"
|
922
|
-
};
|
923
|
-
function Os(t, e, n, a, s, r) {
|
924
|
-
return l(), i("svg", zs, e[0] || (e[0] = [
|
925
|
-
o("path", {
|
926
|
-
stroke: "none",
|
927
|
-
d: "M0 0h24v24H0z",
|
928
|
-
fill: "none"
|
929
|
-
}, null, -1),
|
930
|
-
o("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" }, null, -1)
|
931
|
-
]));
|
932
|
-
}
|
933
|
-
const Us = /* @__PURE__ */ T(Ls, [["render", Os]]), Ns = {
|
934
|
-
components: { IconFilter2: Us, IconCheck2: Re },
|
935
|
-
props: { filterCustom: String, customList: Array }
|
936
|
-
}, Es = { class: "py-2 max-h-[34px] px-2.5 inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Hs = { class: "flex flex-col p-[2px] gap-[2px] w-[170px]" }, Rs = ["onClick"], Ws = { class: "text-sm text-gray-800" };
|
937
|
-
function Js(t, e, n, a, s, r) {
|
938
|
-
const u = p("IconFilter2"), f = p("IconCheck2"), x = p("VsPopover");
|
939
|
-
return l(), _(x, {
|
940
|
-
ref: "popover",
|
941
|
-
placement: "bottom"
|
942
|
-
}, {
|
943
|
-
reference: A(() => [
|
944
|
-
o("button", Es, [
|
945
|
-
y(u, {
|
946
|
-
height: "20",
|
947
|
-
width: "20"
|
948
|
-
})
|
949
|
-
])
|
950
|
-
]),
|
951
|
-
default: A(() => [
|
952
|
-
o("div", Hs, [
|
953
|
-
(l(!0), i($, null, V(n.customList, (b, c) => (l(), i("button", {
|
954
|
-
onClick: (k) => {
|
955
|
-
var m;
|
956
|
-
t.$emit("update:filterCustom", b == null ? void 0 : b.name), (m = t.$refs) == null || m.popover.togglePopover();
|
957
|
-
},
|
958
|
-
key: c,
|
959
|
-
class: D(["flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100", { "bg-gray-100": n.filterCustom === (b == null ? void 0 : b.name) }])
|
960
|
-
}, [
|
961
|
-
o("span", Ws, I(b == null ? void 0 : b.label), 1),
|
962
|
-
n.filterCustom === (b == null ? void 0 : b.name) ? (l(), _(f, {
|
963
|
-
key: 0,
|
964
|
-
class: "ml-auto size-3 shrink-0"
|
965
|
-
})) : v("", !0)
|
966
|
-
], 10, Rs))), 128)),
|
967
|
-
o("button", {
|
968
|
-
class: "flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100",
|
969
|
-
onClick: e[0] || (e[0] = (b) => {
|
970
|
-
var c;
|
971
|
-
t.$emit("update:filterCustom", void 0), (c = t.$refs) == null || c.popover.togglePopover();
|
972
|
-
})
|
973
|
-
}, " Скинути фільтри ")
|
974
|
-
])
|
975
|
-
]),
|
976
|
-
_: 1
|
977
|
-
}, 512);
|
978
|
-
}
|
979
|
-
const Gs = /* @__PURE__ */ T(Ns, [["render", Js]]), Ks = { class: "flex items-center gap-x-2" }, Qs = {
|
980
|
-
__name: "admin-table-custom-buttons",
|
981
|
-
props: {
|
982
|
-
slots: Object
|
983
|
-
},
|
984
|
-
setup(t) {
|
985
|
-
var f, x, b, c, k;
|
986
|
-
const { asyncTemplateSlot: e } = (k = (c = (b = (x = (f = Se()) == null ? void 0 : f.appContext) == null ? void 0 : x.app) == null ? void 0 : b.config) == null ? void 0 : c.globalProperties) == null ? void 0 : k.utils, n = B(""), a = B(""), s = t, r = () => {
|
987
|
-
var m, h, w, g, C;
|
988
|
-
if ((m = s.slots) != null && m.panelLeft || (a.value = "div"), (w = (h = s.slots) == null ? void 0 : h.panelLeft) != null && w.includes("<")) {
|
989
|
-
const S = e("PanelLeft", (g = s.slots) == null ? void 0 : g.panelLeft, [
|
990
|
-
"name"
|
991
|
-
]);
|
992
|
-
a.value = S;
|
993
|
-
} else
|
994
|
-
a.value = (C = s.slots) == null ? void 0 : C.panelLeft;
|
995
|
-
}, u = () => {
|
996
|
-
var m, h, w, g, C;
|
997
|
-
if ((m = s.slots) != null && m.panelRight || (n.value = "div"), (w = (h = s.slots) == null ? void 0 : h.panelRight) != null && w.includes("<")) {
|
998
|
-
const S = e("PanelRight", (g = s.slots) == null ? void 0 : g.panelRight, [
|
999
|
-
"name"
|
1000
|
-
]);
|
1001
|
-
n.value = S;
|
1002
|
-
} else
|
1003
|
-
n.value = (C = s.slots) == null ? void 0 : C.panelRight;
|
1004
|
-
};
|
1005
|
-
return r(), u(), (m, h) => (l(), i("div", Ks, [
|
1006
|
-
(l(), _(L(a.value))),
|
1007
|
-
(l(), _(L(n.value)))
|
1008
|
-
]));
|
1009
|
-
}
|
1010
|
-
}, Xs = (t, e = 300) => {
|
1011
|
-
let n;
|
1012
|
-
return function(...a) {
|
1013
|
-
clearTimeout(n), n = setTimeout(() => {
|
1014
|
-
t.apply(this, a);
|
1015
|
-
}, e);
|
1016
|
-
};
|
1017
|
-
}, Ys = {
|
1018
|
-
__name: "admin-custom-button-add",
|
1019
|
-
props: {
|
1020
|
-
slots: Object
|
1021
|
-
},
|
1022
|
-
setup(t) {
|
1023
|
-
var r, u, f, x, b;
|
1024
|
-
const { asyncTemplateSlot: e } = (b = (x = (f = (u = (r = Se()) == null ? void 0 : r.appContext) == null ? void 0 : u.app) == null ? void 0 : f.config) == null ? void 0 : x.globalProperties) == null ? void 0 : b.utils, n = B(""), a = t;
|
1025
|
-
return (() => {
|
1026
|
-
var c, k, m, h, w;
|
1027
|
-
if ((c = a.slots) != null && c.addButton || (n.value = "div"), (m = (k = a.slots) == null ? void 0 : k.addButton) != null && m.includes("<")) {
|
1028
|
-
const g = e("addButton", (h = a.slots) == null ? void 0 : h.addButton, [
|
1029
|
-
"IconPlus"
|
1030
|
-
]);
|
1031
|
-
n.value = g;
|
1032
|
-
} else
|
1033
|
-
n.value = (w = a.slots) == null ? void 0 : w.addButton;
|
1034
|
-
})(), (c, k) => n.value ? (l(), _(L(n.value), {
|
1035
|
-
key: 0,
|
1036
|
-
IconPlus: z
|
1037
|
-
})) : v("", !0);
|
1038
|
-
}
|
1039
|
-
}, Zs = {
|
1040
|
-
key: 0,
|
1041
|
-
class: "px-4 py-3 text-sm text-gray-800 font-[500]"
|
1042
|
-
}, en = {
|
1043
|
-
key: 1,
|
1044
|
-
class: "px-4 py-3 text-sm text-gray-800 font-[700]"
|
1045
|
-
}, tn = {
|
1046
|
-
__name: "admin-table-totals-list",
|
1047
|
-
props: {
|
1048
|
-
columns: { type: Array, default: () => [] },
|
1049
|
-
agg: { type: Object, default: () => {
|
1050
|
-
} }
|
1051
|
-
},
|
1052
|
-
setup(t) {
|
1053
|
-
return (e, n) => (l(), i("tr", null, [
|
1054
|
-
(l(!0), i($, null, V(t.columns, (a) => {
|
1055
|
-
var s;
|
1056
|
-
return l(), i($, {
|
1057
|
-
key: a == null ? void 0 : a.name
|
1058
|
-
}, [
|
1059
|
-
(s = t.agg) != null && s[a == null ? void 0 : a.name] ? (l(), i("td", Zs, [
|
1060
|
-
y(O, {
|
1061
|
-
column: a,
|
1062
|
-
row: t.agg
|
1063
|
-
}, null, 8, ["column", "row"])
|
1064
|
-
])) : (l(), i("td", en))
|
1065
|
-
], 64);
|
1066
|
-
}), 128))
|
1067
|
-
]));
|
1068
|
-
}
|
1069
|
-
}, sn = {
|
1070
|
-
props: { table: String, title: String },
|
1071
|
-
components: {
|
1072
|
-
AdminTableControl: mt,
|
1073
|
-
AdminTableExport: Ot,
|
1074
|
-
AdminTableColumnsHidden: es,
|
1075
|
-
AdminTableColumn: rt,
|
1076
|
-
AdminNodata: We,
|
1077
|
-
IconPlus: z,
|
1078
|
-
IconSearch: Je,
|
1079
|
-
AdminTableCardInfo: ws,
|
1080
|
-
IconOpenCard: Ts,
|
1081
|
-
AdminComponentIs: O,
|
1082
|
-
AdminTableFilters: Fs,
|
1083
|
-
AdminTableTabs: Bs,
|
1084
|
-
AdminTableCustomFilters: Gs,
|
1085
|
-
AdminTableCustomButtons: Qs,
|
1086
|
-
AdminCustomButtonAdd: Ys,
|
1087
|
-
AdminTableTotalsList: tn
|
1088
|
-
},
|
1089
|
-
data() {
|
1090
|
-
return {
|
1091
|
-
tableData: {},
|
1092
|
-
filterScheme: [],
|
1093
|
-
page: 1,
|
1094
|
-
searchValue: "",
|
1095
|
-
limit: 0,
|
1096
|
-
filters: null,
|
1097
|
-
activeColumn: "",
|
1098
|
-
isVisibleCardInfo: !1,
|
1099
|
-
onFilters: 0,
|
1100
|
-
filterState: null,
|
1101
|
-
filterCustom: null,
|
1102
|
-
visibleColumns: [],
|
1103
|
-
initialHiddenColumns: ""
|
1104
|
-
};
|
1105
|
-
},
|
1106
|
-
async mounted() {
|
1107
|
-
await this.checkUrlMounted(), await this.getTableData(), await this.getFilters();
|
1108
|
-
},
|
1109
|
-
computed: {
|
1110
|
-
defaultPage() {
|
1111
|
-
var t, e;
|
1112
|
-
return ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.page) || 1;
|
1113
|
-
},
|
1114
|
-
columns() {
|
1115
|
-
var t, e;
|
1116
|
-
return (e = (t = this.tableData) == null ? void 0 : t.columns) == null ? void 0 : e.filter((n) => (n == null ? void 0 : n.hidden) !== !0);
|
1117
|
-
},
|
1118
|
-
isForm() {
|
1119
|
-
var t, e, n;
|
1120
|
-
return ((t = this.tableData) == null ? void 0 : t.form) && ((n = (e = this.tableData) == null ? void 0 : e.actions) == null ? void 0 : n.includes("add"));
|
1121
|
-
},
|
1122
|
-
isNoData() {
|
1123
|
-
var t, e;
|
1124
|
-
return !((t = this.tableData) != null && t.rows) || !((e = this.columns) != null && e.length);
|
1125
|
-
},
|
1126
|
-
activeCardRow() {
|
1127
|
-
var t, e;
|
1128
|
-
return ((e = (t = this.tableData) == null ? void 0 : t.rows) == null ? void 0 : e.find((n) => {
|
1129
|
-
var a, s;
|
1130
|
-
return (n == null ? void 0 : n.id) === ((s = (a = this.$route) == null ? void 0 : a.query) == null ? void 0 : s.card);
|
1131
|
-
})) || {};
|
1132
|
-
},
|
1133
|
-
getActions() {
|
1134
|
-
var t;
|
1135
|
-
return (t = this.tableData) == null ? void 0 : t.actions;
|
1136
|
-
}
|
1137
|
-
},
|
1138
|
-
watch: {
|
1139
|
-
async table() {
|
1140
|
-
this.tableData = null, await this.getTableData();
|
1141
|
-
},
|
1142
|
-
searchValue: {
|
1143
|
-
handler: Xs(async function(t) {
|
1144
|
-
var e;
|
1145
|
-
await this.getTableData(), this.$router.push({
|
1146
|
-
...this.$route,
|
1147
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, search: t || void 0 }
|
1148
|
-
});
|
1149
|
-
}, 500)
|
1150
|
-
},
|
1151
|
-
$route: {
|
1152
|
-
handler(t, e) {
|
1153
|
-
var n, a;
|
1154
|
-
((n = t == null ? void 0 : t.params) == null ? void 0 : n.catchAll) !== ((a = e == null ? void 0 : e.params) == null ? void 0 : a.catchAll) && (this.visibleColumns = [], this.unmountedData(), this.getFilters());
|
1155
|
-
},
|
1156
|
-
deep: !0
|
1157
|
-
},
|
1158
|
-
limit(t) {
|
1159
|
-
var e;
|
1160
|
-
this.$router.replace({ query: { ...(e = this.$route) == null ? void 0 : e.query, limit: t } });
|
1161
|
-
},
|
1162
|
-
filterState(t) {
|
1163
|
-
var e;
|
1164
|
-
t && (this.$router.replace({
|
1165
|
-
...this.$route,
|
1166
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, filterState: t }
|
1167
|
-
}), this.getTableData());
|
1168
|
-
},
|
1169
|
-
filterCustom(t) {
|
1170
|
-
var e;
|
1171
|
-
this.$router.replace({
|
1172
|
-
...this.$route,
|
1173
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, custom: t }
|
1174
|
-
}), this.getTableData();
|
1175
|
-
},
|
1176
|
-
columns(t) {
|
1177
|
-
var e, n, a, s;
|
1178
|
-
this.visibleColumns = t == null ? void 0 : t.map((r) => r == null ? void 0 : r.name), this.initialHiddenColumns === ((e = this.visibleColumns) == null ? void 0 : e.join(",")) && (this.visibleColumns = []), this.$router.replace({
|
1179
|
-
...this.$route,
|
1180
|
-
query: {
|
1181
|
-
...(n = this.$route) == null ? void 0 : n.query,
|
1182
|
-
columns: (a = this.visibleColumns) != null && a.length ? (s = this.visibleColumns) == null ? void 0 : s.join(",") : void 0
|
1183
|
-
}
|
1184
|
-
});
|
1185
|
-
}
|
1186
|
-
},
|
1187
|
-
methods: {
|
1188
|
-
async checkUrlMounted() {
|
1189
|
-
var t, e, n, a, s, r, u, f, x, b, c, k, m, h, w, g, C;
|
1190
|
-
this.page = ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.page) || 1, this.limit = ((a = (n = this.$route) == null ? void 0 : n.query) == null ? void 0 : a.limit) || 20, this.filters = ((u = decodeURI((r = (s = this.$route) == null ? void 0 : s.query) == null ? void 0 : r.filter)) == null ? void 0 : u.replaceAll("+", " ")) || null, this.filterState = ((x = (f = this.$route) == null ? void 0 : f.query) == null ? void 0 : x.filterState) || null, this.filterCustom = ((c = (b = this.$route) == null ? void 0 : b.query) == null ? void 0 : c.custom) || null, this.searchValue = ((m = (k = this.$route) == null ? void 0 : k.query) == null ? void 0 : m.search) || "", this.visibleColumns = ((g = (w = (h = this.$route) == null ? void 0 : h.query) == null ? void 0 : w.columns) == null ? void 0 : g.split(",")) || [], (C = this.$route) != null && C.query.card && (this.isVisibleCardInfo = !0);
|
1191
|
-
},
|
1192
|
-
rowWidth(t) {
|
1193
|
-
var n, a;
|
1194
|
-
const e = (a = (n = this.tableData) == null ? void 0 : n.columns) == null ? void 0 : a.find((s) => s.name === t);
|
1195
|
-
if (e) {
|
1196
|
-
const s = e == null ? void 0 : e.width;
|
1197
|
-
return typeof s == "number" ? `${s}px` : s != null && s.includes("px") ? s : `${s}px`;
|
1198
|
-
}
|
1199
|
-
},
|
1200
|
-
unmountedData() {
|
1201
|
-
this.page = 1, this.visibleColumns = [], this.filterCustom = null, this.filterState = null, this.isVisibleCardInfo = !1, this.filterScheme = null, this.filters = null, this.onFilters = 0, this.searchValue = "";
|
1202
|
-
},
|
1203
|
-
async getTableData() {
|
1204
|
-
var t, e, n, a, s, r, u, f, x, b, c;
|
1205
|
-
try {
|
1206
|
-
const { data: k } = await F.get(`/api/template/table/${this.table}`), m = await F.get(`/api/table-data/${this.table}`, {
|
1207
|
-
params: {
|
1208
|
-
page: this.page,
|
1209
|
-
search: this.searchValue || null,
|
1210
|
-
limit: this.limit,
|
1211
|
-
filter: this.filters || null,
|
1212
|
-
order: ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.sort) || null,
|
1213
|
-
state: this.filterState || null,
|
1214
|
-
custom: this.filterCustom || null
|
1215
|
-
}
|
1216
|
-
});
|
1217
|
-
this.tableData = {
|
1218
|
-
...k,
|
1219
|
-
...(m == null ? void 0 : m.data) || {}
|
1220
|
-
}, this.initialHiddenColumns = (r = (s = (a = (n = this.tableData) == null ? void 0 : n.columns) == null ? void 0 : a.filter((h) => (h == null ? void 0 : h.hidden) !== !0)) == null ? void 0 : s.map((h) => h == null ? void 0 : h.name)) == null ? void 0 : r.join(","), (u = this.visibleColumns) != null && u.length ? (f = this.tableData) == null || f.columns.forEach((h) => {
|
1221
|
-
var w;
|
1222
|
-
(w = this.visibleColumns) != null && w.includes(h == null ? void 0 : h.name) ? h.hidden = !1 : h.hidden = !0;
|
1223
|
-
}) : this.visibleColumns = (c = (b = (x = this.tableData) == null ? void 0 : x.columns) == null ? void 0 : b.filter((h) => (h == null ? void 0 : h.hidden) !== !0)) == null ? void 0 : c.map((h) => h == null ? void 0 : h.name);
|
1224
|
-
} catch {
|
1225
|
-
}
|
1226
|
-
},
|
1227
|
-
async getFilters() {
|
1228
|
-
var t;
|
1229
|
-
try {
|
1230
|
-
const { data: e } = await F.get(`/api/table-filter/${this.table}`);
|
1231
|
-
this.filterScheme = (t = e == null ? void 0 : e.list) == null ? void 0 : t.map((n) => ({
|
1232
|
-
...n,
|
1233
|
-
label: (n == null ? void 0 : n.label) || (n == null ? void 0 : n.ua)
|
1234
|
-
}));
|
1235
|
-
} catch {
|
1236
|
-
}
|
1237
|
-
},
|
1238
|
-
async handlePageChange(t) {
|
1239
|
-
const e = this.$route.query;
|
1240
|
-
this.page = t, !(!(e != null && e.page) && t === 1 || e.page === t) && (await this.$router.replace({ query: { ...e, page: t } }), await this.getTableData());
|
1241
|
-
},
|
1242
|
-
async changeLimit(t) {
|
1243
|
-
this.limit = await t, this.defaultPage = 1, await this.getTableData();
|
1244
|
-
},
|
1245
|
-
async filterChange({ url: t, state: e }) {
|
1246
|
-
var n;
|
1247
|
-
this.filters = t !== "no-url" ? t : null, this.onFilters = (n = Object.entries(e)) == null ? void 0 : n.length, this.page = 1, await this.getTableData();
|
1248
|
-
},
|
1249
|
-
changeActiveColumn(t) {
|
1250
|
-
this.activeColumn = t, this.getTableData();
|
1251
|
-
},
|
1252
|
-
pushToCard(t) {
|
1253
|
-
var e;
|
1254
|
-
((e = this.tableData) == null ? void 0 : e.card) === !1 || this.$router.push(`/card/${this.table}/${t}`);
|
1255
|
-
},
|
1256
|
-
changeActiveCardInfo(t) {
|
1257
|
-
var e;
|
1258
|
-
this.isVisibleCardInfo && this.$router.push({
|
1259
|
-
...this.$route,
|
1260
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, card: t }
|
1261
|
-
});
|
1262
|
-
},
|
1263
|
-
toggleCardInfo() {
|
1264
|
-
var t;
|
1265
|
-
this.isVisibleCardInfo = !this.isVisibleCardInfo, this.isVisibleCardInfo || this.$router.push({
|
1266
|
-
...this.$route,
|
1267
|
-
query: { ...(t = this.$route) == null ? void 0 : t.query, card: void 0 }
|
1268
|
-
});
|
1269
|
-
}
|
1270
|
-
}
|
1271
|
-
}, nn = { class: "w-[calc(100vw - 320px)] bg-gray-50" }, ln = { class: "h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl" }, on = { class: "text-xl font-medium" }, rn = {
|
1272
|
-
style: { height: "calc(100vh - 155px)" },
|
1273
|
-
class: "bg-gray-50 p-[20px] flex pt-[10px] lg:w-[calc(100vw-260px)] w-[100vw]"
|
1274
|
-
}, an = { class: "bg-white w-full rounded-xl border p-[20px] pr-0" }, cn = { class: "flex" }, un = { class: "flex gap-[6px] ml-auto" }, dn = { class: "inline-block w-full align-middle" }, pn = {
|
1275
|
-
key: 0,
|
1276
|
-
class: "relative min-w-full text-[13px] divide-y divide-gray-200 table-fixed w-max dark:divide-neutral-700"
|
1277
|
-
}, bn = { class: "sticky top-[-1px] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200" }, hn = { class: "right-0" }, fn = {
|
1278
|
-
key: 0,
|
1279
|
-
class: "w-[70px] sticky right-0 top-0"
|
1280
|
-
}, mn = { class: "divide-y divide-gray-200" }, gn = { class: "px-4 py-3 text-gray-600" }, xn = ["onClick"], yn = ["onClick"], _n = { class: "p-[20px] flex justify-start items-center w-full" }, vn = { class: "w-[200px] md:inline-flex hidden" }, kn = { class: "text-sm text-gray-600 dark:text-neutral-400" }, wn = { class: "font-semibold text-gray-800 dark:text-neutral-200" }, Cn = { key: 0 }, $n = {
|
1281
|
-
key: 0,
|
1282
|
-
class: "font-semibold text-gray-800 dark:text-neutral-200"
|
1283
|
-
};
|
1284
|
-
function An(t, e, n, a, s, r) {
|
1285
|
-
var E, H, R, W, J, G, K, Q, X, Y, Z, ee, te, se, ne, le, oe, re, ae, ie, ce, ue, de, pe, be, he, fe;
|
1286
|
-
const u = p("AdminCustomButtonAdd"), f = p("IconPlus"), x = p("router-link"), b = p("AdminTableTabs"), c = p("IconSearch"), k = p("VsText"), m = p("AdminTableCustomButtons"), h = p("AdminTableCustomFilters"), w = p("AdminTableColumnsHidden"), g = p("AdminTableExport"), C = p("AdminTableFilters"), S = p("IconOpenCard"), q = p("AdminTableColumn"), P = p("AdminComponentIs"), Ve = p("AdminTableControl"), De = p("AdminTableTotalsList"), Fe = p("AdminNodata"), je = p("VsPagination"), Me = p("AdminTableCardInfo");
|
1287
|
-
return l(), i("div", nn, [
|
1288
|
-
o("div", ln, [
|
1289
|
-
o("h2", on, I(n.title), 1),
|
1290
|
-
r.isForm ? (l(), i($, { key: 0 }, [
|
1291
|
-
(H = (E = s.tableData) == null ? void 0 : E.slots) != null && H.addButton ? (l(), _(u, {
|
1292
|
-
key: 0,
|
1293
|
-
slots: (R = s.tableData) == null ? void 0 : R.slots
|
1294
|
-
}, null, 8, ["slots"])) : (l(), _(x, {
|
1295
|
-
key: 1,
|
1296
|
-
to: `/add?table=${(J = (W = t.$route) == null ? void 0 : W.params) == null ? void 0 : J.catchAll}`,
|
1297
|
-
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"
|
1298
|
-
}, {
|
1299
|
-
default: A(() => [
|
1300
|
-
y(f, {
|
1301
|
-
height: "16",
|
1302
|
-
width: "16"
|
1303
|
-
}),
|
1304
|
-
e[5] || (e[5] = j(" Додати "))
|
1305
|
-
]),
|
1306
|
-
_: 1
|
1307
|
-
}, 8, ["to"]))
|
1308
|
-
], 64)) : v("", !0)
|
1309
|
-
]),
|
1310
|
-
o("div", rn, [
|
1311
|
-
o("div", an, [
|
1312
|
-
(K = (G = s.tableData) == null ? void 0 : G.filterState) != null && K.length ? (l(), _(b, {
|
1313
|
-
key: 0,
|
1314
|
-
tabsList: (Q = s.tableData) == null ? void 0 : Q.filterState,
|
1315
|
-
filterState: s.filterState,
|
1316
|
-
"onUpdate:filterState": e[0] || (e[0] = (d) => s.filterState = d)
|
1317
|
-
}, null, 8, ["tabsList", "filterState"])) : v("", !0),
|
1318
|
-
o("div", cn, [
|
1319
|
-
o("div", {
|
1320
|
-
class: D([s.isVisibleCardInfo ? "w-[calc(100%-360px)]" : "w-full"])
|
1321
|
-
}, [
|
1322
|
-
o("div", {
|
1323
|
-
class: D(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative", { "pr-[20px]": !s.isVisibleCardInfo }])
|
1324
|
-
}, [
|
1325
|
-
y(c, {
|
1326
|
-
height: "14",
|
1327
|
-
width: "14",
|
1328
|
-
class: "absolute top-[10px] left-[14px] text-gray-500 z-[1]"
|
1329
|
-
}),
|
1330
|
-
y(k, {
|
1331
|
-
modelValue: s.searchValue,
|
1332
|
-
"onUpdate:modelValue": e[1] || (e[1] = (d) => s.searchValue = d),
|
1333
|
-
placeholder: "Пошук...",
|
1334
|
-
clearable: !0,
|
1335
|
-
class: "[&>input]:py-[7px] [&>input]:max-h-[36px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600"
|
1336
|
-
}, null, 8, ["modelValue"]),
|
1337
|
-
o("div", un, [
|
1338
|
-
(X = s.tableData) != null && X.slots ? (l(), _(m, {
|
1339
|
-
key: 0,
|
1340
|
-
slots: (Y = s.tableData) == null ? void 0 : Y.slots
|
1341
|
-
}, null, 8, ["slots"])) : v("", !0),
|
1342
|
-
(ee = (Z = s.tableData) == null ? void 0 : Z.filterCustom) != null && ee.length ? (l(), _(h, {
|
1343
|
-
key: 1,
|
1344
|
-
customList: (te = s.tableData) == null ? void 0 : te.filterCustom,
|
1345
|
-
filterCustom: s.filterCustom,
|
1346
|
-
"onUpdate:filterCustom": e[2] || (e[2] = (d) => s.filterCustom = d)
|
1347
|
-
}, null, 8, ["customList", "filterCustom"])) : v("", !0),
|
1348
|
-
y(w, {
|
1349
|
-
columns: (se = s.tableData) == null ? void 0 : se.columns,
|
1350
|
-
onUpdateColumns: e[3] || (e[3] = (d) => s.tableData.columns = d)
|
1351
|
-
}, null, 8, ["columns"]),
|
1352
|
-
((ne = s.tableData) == null ? void 0 : ne.export) !== !1 ? (l(), _(g, {
|
1353
|
-
key: 2,
|
1354
|
-
table: n.table,
|
1355
|
-
columns: (le = s.tableData) == null ? void 0 : le.columns,
|
1356
|
-
page: s.page,
|
1357
|
-
"filter-state": s.filterState,
|
1358
|
-
"filter-custom": s.filterCustom,
|
1359
|
-
filters: s.filters
|
1360
|
-
}, null, 8, ["table", "columns", "page", "filter-state", "filter-custom", "filters"])) : v("", !0),
|
1361
|
-
(oe = s.filterScheme) != null && oe.length ? (l(), _(C, {
|
1362
|
-
key: 3,
|
1363
|
-
scheme: s.filterScheme,
|
1364
|
-
onFilters: s.onFilters,
|
1365
|
-
table: n.table,
|
1366
|
-
onFilterChange: r.filterChange
|
1367
|
-
}, null, 8, ["scheme", "onFilters", "table", "onFilterChange"])) : v("", !0),
|
1368
|
-
o("button", {
|
1369
|
-
onClick: e[4] || (e[4] = (...d) => r.toggleCardInfo && r.toggleCardInfo(...d)),
|
1370
|
-
class: "py-2 px-2.5 max-h-[34px] md:inline-flex hidden items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"
|
1371
|
-
}, [
|
1372
|
-
y(S, {
|
1373
|
-
class: D({ "rotate-180 duration-300": !s.isVisibleCardInfo })
|
1374
|
-
}, null, 8, ["class"])
|
1375
|
-
])
|
1376
|
-
])
|
1377
|
-
], 2),
|
1378
|
-
o("div", {
|
1379
|
-
class: D(["flex items-start justify-start w-full space-y-5", { "pr-[20px]": !s.isVisibleCardInfo }])
|
1380
|
-
}, [
|
1381
|
-
o("div", {
|
1382
|
-
style: Te({
|
1383
|
-
height: (ae = (re = s.tableData) == null ? void 0 : re.filterState) != null && ae.length ? "calc(100vh - 370px)" : "calc(100vh - 330px)"
|
1384
|
-
}),
|
1385
|
-
class: "overflow-x-auto w-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"
|
1386
|
-
}, [
|
1387
|
-
o("div", dn, [
|
1388
|
-
r.isNoData ? (l(), _(Fe, { key: 1 })) : (l(), i("table", pn, [
|
1389
|
-
o("thead", bn, [
|
1390
|
-
o("tr", hn, [
|
1391
|
-
(l(!0), i($, null, V(r.columns, (d) => (l(), _(q, {
|
1392
|
-
key: d.name,
|
1393
|
-
style: Te({
|
1394
|
-
width: r.rowWidth(d == null ? void 0 : d.name),
|
1395
|
-
textAlign: d == null ? void 0 : d.align,
|
1396
|
-
wordBreak: d == null ? void 0 : d.wrap
|
1397
|
-
}),
|
1398
|
-
data: d,
|
1399
|
-
activeColumn: s.activeColumn,
|
1400
|
-
onChangeActive: r.changeActiveColumn
|
1401
|
-
}, null, 8, ["style", "data", "activeColumn", "onChangeActive"]))), 128)),
|
1402
|
-
(ce = (ie = r.getActions) == null ? void 0 : ie.filter(
|
1403
|
-
(d) => d !== "add" && d !== "view"
|
1404
|
-
)) != null && ce.length ? (l(), i("th", fn)) : v("", !0)
|
1405
|
-
])
|
1406
|
-
]),
|
1407
|
-
o("tbody", mn, [
|
1408
|
-
(l(!0), i($, null, V((ue = s.tableData) == null ? void 0 : ue.rows, (d, qe) => {
|
1409
|
-
var me, ge, xe, ye, _e, ve, ke, we, Ce, $e;
|
1410
|
-
return l(), i("tr", {
|
1411
|
-
key: qe,
|
1412
|
-
class: D({
|
1413
|
-
"bg-gray-50": ((ge = (me = t.$route) == null ? void 0 : me.query) == null ? void 0 : ge.card) === (d == null ? void 0 : d.id)
|
1414
|
-
})
|
1415
|
-
}, [
|
1416
|
-
o("td", gn, [
|
1417
|
-
o("button", {
|
1418
|
-
onClick: () => r.pushToCard(d == null ? void 0 : d.id),
|
1419
|
-
class: D(["font-medium", [
|
1420
|
-
((xe = s.tableData) == null ? void 0 : xe.card) === !1 ? "" : "text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"
|
1421
|
-
]])
|
1422
|
-
}, [
|
1423
|
-
y(P, {
|
1424
|
-
row: d,
|
1425
|
-
column: r.columns[0],
|
1426
|
-
table: n.table,
|
1427
|
-
onUpdateTable: r.getTableData
|
1428
|
-
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1429
|
-
], 10, xn)
|
1430
|
-
]),
|
1431
|
-
(l(!0), i($, null, V((ye = r.columns) == null ? void 0 : ye.slice(1), (M) => (l(), i("td", {
|
1432
|
-
onClick: (Dn) => r.changeActiveCardInfo(d == null ? void 0 : d.id),
|
1433
|
-
class: D(["px-3 py-3 text-gray-600 text-start", { "cursor-pointer": s.isVisibleCardInfo }]),
|
1434
|
-
key: M.name
|
1435
|
-
}, [
|
1436
|
-
y(P, {
|
1437
|
-
row: d,
|
1438
|
-
column: M,
|
1439
|
-
table: n.table,
|
1440
|
-
onUpdateTable: r.getTableData
|
1441
|
-
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1442
|
-
], 10, yn))), 128)),
|
1443
|
-
(ve = (_e = r.getActions) == null ? void 0 : _e.filter(
|
1444
|
-
(M) => M !== "add" && M !== "view"
|
1445
|
-
)) != null && ve.length ? (l(), i("td", {
|
1446
|
-
key: 0,
|
1447
|
-
class: D(["text-center sticky right-0 w-[80px] px-[10px]", {
|
1448
|
-
"bg-gray-50": ((we = (ke = t.$route) == null ? void 0 : ke.query) == null ? void 0 : we.card) === (d == null ? void 0 : d.id),
|
1449
|
-
"bg-white": (($e = (Ce = t.$route) == null ? void 0 : Ce.query) == null ? void 0 : $e.card) !== (d == null ? void 0 : d.id)
|
1450
|
-
}])
|
1451
|
-
}, [
|
1452
|
-
y(Ve, {
|
1453
|
-
actions: r.getActions,
|
1454
|
-
isForm: r.isForm,
|
1455
|
-
item: d,
|
1456
|
-
table: n.table,
|
1457
|
-
onUpdateTable: r.getTableData
|
1458
|
-
}, null, 8, ["actions", "isForm", "item", "table", "onUpdateTable"])
|
1459
|
-
], 2)) : v("", !0)
|
1460
|
-
], 2);
|
1461
|
-
}), 128))
|
1462
|
-
]),
|
1463
|
-
y(De, {
|
1464
|
-
columns: r.columns,
|
1465
|
-
agg: (de = s.tableData) == null ? void 0 : de.agg
|
1466
|
-
}, null, 8, ["columns", "agg"])
|
1467
|
-
]))
|
1468
|
-
])
|
1469
|
-
], 4)
|
1470
|
-
], 2),
|
1471
|
-
o("div", _n, [
|
1472
|
-
o("div", vn, [
|
1473
|
-
o("p", kn, [
|
1474
|
-
o("span", wn, [
|
1475
|
-
j(I(s.filters || s.searchValue ? "Знайдено" : "Об'єктів") + " " + I(((pe = s.tableData) == null ? void 0 : pe.count) || "0 ") + " ", 1),
|
1476
|
-
s.filters || s.searchValue ? (l(), i("span", Cn, " з")) : v("", !0)
|
1477
|
-
]),
|
1478
|
-
s.filters || s.searchValue ? (l(), i("span", $n, I(" " + ((be = s.tableData) == null ? void 0 : be.filtered) || 0), 1)) : v("", !0)
|
1479
|
-
])
|
1480
|
-
]),
|
1481
|
-
Math.ceil(((he = s.tableData) == null ? void 0 : he.filtered) / s.limit) > 1 ? (l(), _(je, {
|
1482
|
-
key: 0,
|
1483
|
-
goTo: !1,
|
1484
|
-
class: "justify-end",
|
1485
|
-
"default-page": parseInt(r.defaultPage),
|
1486
|
-
total: ((fe = s.tableData) == null ? void 0 : fe.filtered) || 0,
|
1487
|
-
pageSize: parseInt(s.limit),
|
1488
|
-
onPageChange: r.handlePageChange,
|
1489
|
-
pageSizes: [10, 16, 20],
|
1490
|
-
onPageSizeChange: r.changeLimit,
|
1491
|
-
backgroundColor: "#F3F4F6"
|
1492
|
-
}, null, 8, ["default-page", "total", "pageSize", "onPageChange", "onPageSizeChange"])) : v("", !0)
|
1493
|
-
])
|
1494
|
-
], 2),
|
1495
|
-
y(N, { name: "slide-fade" }, {
|
1496
|
-
default: A(() => {
|
1497
|
-
var d;
|
1498
|
-
return [
|
1499
|
-
s.isVisibleCardInfo ? (l(), _(Me, {
|
1500
|
-
key: 0,
|
1501
|
-
table: n.table,
|
1502
|
-
columns: (d = s.tableData) == null ? void 0 : d.columns,
|
1503
|
-
row: r.activeCardRow
|
1504
|
-
}, null, 8, ["table", "columns", "row"])) : v("", !0)
|
1505
|
-
];
|
1506
|
-
}),
|
1507
|
-
_: 1
|
1508
|
-
})
|
1509
|
-
])
|
1510
|
-
])
|
1511
|
-
])
|
1512
|
-
]);
|
1513
|
-
}
|
1514
|
-
const Tn = /* @__PURE__ */ T(sn, [["render", An], ["__scopeId", "data-v-2c38e227"]]), In = {
|
1515
|
-
components: { AdminTable: Tn },
|
1516
|
-
data() {
|
1517
|
-
return {
|
1518
|
-
table: !1,
|
1519
|
-
interface: "",
|
1520
|
-
title: ""
|
1521
|
-
};
|
1522
|
-
},
|
1523
|
-
watch: {
|
1524
|
-
$route: {
|
1525
|
-
async handler() {
|
1526
|
-
var t;
|
1527
|
-
(t = Ae) != null && t.value || await this.getMenu(), await this.checkPageType();
|
1528
|
-
},
|
1529
|
-
deep: !0
|
1530
|
-
},
|
1531
|
-
title(t) {
|
1532
|
-
var e;
|
1533
|
-
t && (document.title = (((e = Ge.value) == null ? void 0 : e.titlePrefix) || "") + t);
|
1534
|
-
}
|
1535
|
-
},
|
1536
|
-
async mounted() {
|
1537
|
-
await this.checkPageType();
|
1538
|
-
},
|
1539
|
-
methods: {
|
1540
|
-
flattenMenu(t) {
|
1541
|
-
const e = [];
|
1542
|
-
return t.forEach((n) => {
|
1543
|
-
n.menu ? e.push(...this.flattenMenu(n.menu)) : e.push(n);
|
1544
|
-
}), e;
|
1545
|
-
},
|
1546
|
-
async checkPageType() {
|
1547
|
-
var a, s;
|
1548
|
-
const t = this.flattenMenu(Ae.value);
|
1549
|
-
t != null && t.length || this.$router.replace("/404");
|
1550
|
-
const e = t == null ? void 0 : t.find((r) => {
|
1551
|
-
var u, f;
|
1552
|
-
return (r == null ? void 0 : r.path) == ((f = (u = this.$route) == null ? void 0 : u.params) == null ? void 0 : f.catchAll);
|
1553
|
-
});
|
1554
|
-
this.title = e == null ? void 0 : e.ua, e || this.$router.replace("/404"), e != null && e.component && this.$router.replace((s = (a = this.$route) == null ? void 0 : a.params) == null ? void 0 : s.catchAll);
|
1555
|
-
const n = e == null ? void 0 : e.table;
|
1556
|
-
this.table = n || !1, !n && this.getInterface();
|
1557
|
-
},
|
1558
|
-
async getInterface() {
|
1559
|
-
var t, e;
|
1560
|
-
try {
|
1561
|
-
const { data: n } = await F.get(
|
1562
|
-
`/api/template/interface/${((e = (t = this.$route) == null ? void 0 : t.params) == null ? void 0 : e.catchAll) || ""}`
|
1563
|
-
);
|
1564
|
-
this.interface = n || "";
|
1565
|
-
} catch {
|
1566
|
-
this.interface = "";
|
1567
|
-
}
|
1568
|
-
}
|
1569
|
-
}
|
1570
|
-
}, Sn = ["innerHTML"];
|
1571
|
-
function Vn(t, e, n, a, s, r) {
|
1572
|
-
const u = p("AdminTable");
|
1573
|
-
return s.table ? (l(), _(u, {
|
1574
|
-
key: 0,
|
1575
|
-
table: s.table,
|
1576
|
-
title: s.title
|
1577
|
-
}, null, 8, ["table", "title"])) : (l(), i("div", {
|
1578
|
-
key: 1,
|
1579
|
-
class: "w-full bg-gray-50",
|
1580
|
-
style: { height: "calc(100vh - 120px)" },
|
1581
|
-
innerHTML: s.interface
|
1582
|
-
}, null, 8, Sn));
|
1583
|
-
}
|
1584
|
-
const Mn = /* @__PURE__ */ T(In, [["render", Vn]]);
|
1585
|
-
export {
|
1586
|
-
Mn as default
|
1587
|
-
};
|