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