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