@opengis/admin 0.1.59 → 0.1.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{add-page-BOXd-uV_.js → add-page-C3Wh2-Ml.js} +13 -11
- package/dist/admin-interface-C4m7uvG2.js +896 -0
- package/dist/admin-view-YtM2-LrW.js +225 -0
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +95 -207
- package/dist/card-page-WrYs8chM.js +133 -0
- package/dist/{card-view-NLu0N8TA.js → card-view-BwtqUSFP.js} +1 -1
- package/dist/{edit-page-z7ozrw2C.js → edit-page-CMTqsvJf.js} +34 -33
- package/dist/import-file-bdYAo8iW.js +29759 -0
- package/dist/style.css +1 -1
- package/dist/userMenu-CT1xO2Pt.js +5 -0
- package/module/settings/select/core.roles.json +2 -2
- package/package.json +4 -4
- package/plugin.js +5 -69
- package/server/plugins/adminHook.js +165 -0
- package/server/plugins/cron.js +11 -0
- package/server/plugins/hook.js +145 -221
- package/server/routes/data/controllers/cardData.js +5 -4
- package/server/routes/data/controllers/funcs/getFilterSQL/util/formatValue.js +5 -5
- package/server/routes/data/controllers/tableData.js +9 -42
- package/server/routes/data/controllers/tableFilter.js +3 -3
- package/server/routes/data/controllers/utils/getColumns.js +2 -15
- package/server/routes/templates/controllers/getTemplate.js +5 -1
- package/dist/admin-interface-DbfKIAnw.js +0 -1347
- package/dist/admin-view-DDDd_P1v.js +0 -461
- package/dist/card-page-Bq7fUm5C.js +0 -230
- package/dist/import-file-BBA7riUK.js +0 -47257
@@ -1,1347 +0,0 @@
|
|
1
|
-
import { _ as m, b as ue, a as A, V as he, c as pe, d as be, e as fe, I as me, u as te } from "./import-file-BBA7riUK.js";
|
2
|
-
import { openBlock as s, createElementBlock as i, createTextVNode as F, toDisplayString as I, createCommentVNode as v, createStaticVNode as j, Fragment as C, createElementVNode as l, resolveComponent as d, createVNode as b, withCtx as y, createBlock as x, withModifiers as ge, renderList as T, withDirectives as z, vModelCheckbox as xe, resolveDynamicComponent as ye, Transition as P, renderSlot as _e, vShow as ne, normalizeClass as V, normalizeStyle as re } from "vue";
|
3
|
-
const ke = {
|
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: r, ...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
|
-
}, we = {
|
62
|
-
scope: "col",
|
63
|
-
class: "text-start px-2 py-1"
|
64
|
-
}, ve = {
|
65
|
-
class: "flex-shrink-0 size-3.5",
|
66
|
-
xmlns: "http://www.w3.org/2000/svg",
|
67
|
-
width: "24",
|
68
|
-
height: "24",
|
69
|
-
viewBox: "0 0 24 24",
|
70
|
-
fill: "none",
|
71
|
-
stroke: "currentColor",
|
72
|
-
"stroke-width": "2",
|
73
|
-
"stroke-linecap": "round",
|
74
|
-
"stroke-linejoin": "round"
|
75
|
-
}, Ce = {
|
76
|
-
key: 0,
|
77
|
-
d: "m7 15 5 5 5-5"
|
78
|
-
}, $e = {
|
79
|
-
key: 1,
|
80
|
-
d: "m7 9 5-5 5 5"
|
81
|
-
}, Ie = {
|
82
|
-
key: 1,
|
83
|
-
class: "text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500"
|
84
|
-
};
|
85
|
-
function Te(t, e, r, a, n, o) {
|
86
|
-
return s(), i("th", we, [
|
87
|
-
o.getVisibleIcon ? (s(), i("button", {
|
88
|
-
key: 0,
|
89
|
-
type: "button",
|
90
|
-
class: "text-sm text-stone-500 px-[4px] py-2.5 text-start font-normal text-gray-500 flex items-center gap-[6px]",
|
91
|
-
onClick: e[0] || (e[0] = (c) => o.handleClickSortBtn(n.currentSort))
|
92
|
-
}, [
|
93
|
-
F(I(o.label) + " ", 1),
|
94
|
-
(s(), i("svg", ve, [
|
95
|
-
n.currentSort === "asc" || n.currentSort === "" ? (s(), i("path", Ce)) : v("", !0),
|
96
|
-
n.currentSort === "desc" || n.currentSort === "" ? (s(), i("path", $e)) : v("", !0)
|
97
|
-
]))
|
98
|
-
])) : (s(), i("p", Ie, I(o.label), 1))
|
99
|
-
]);
|
100
|
-
}
|
101
|
-
const Ve = /* @__PURE__ */ m(ke, [["render", Te]]), Se = {}, Ae = {
|
102
|
-
class: "flex-shrink-0 size-3.5",
|
103
|
-
xmlns: "http://www.w3.org/2000/svg",
|
104
|
-
viewBox: "0 0 24 24",
|
105
|
-
fill: "none",
|
106
|
-
stroke: "currentColor",
|
107
|
-
"stroke-width": "2",
|
108
|
-
"stroke-linecap": "round",
|
109
|
-
"stroke-linejoin": "round"
|
110
|
-
};
|
111
|
-
function Fe(t, e, r, a, n, o) {
|
112
|
-
return s(), i("svg", Ae, e[0] || (e[0] = [
|
113
|
-
j('<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)
|
114
|
-
]));
|
115
|
-
}
|
116
|
-
const De = /* @__PURE__ */ m(Se, [["render", Fe]]), Me = {
|
117
|
-
props: {
|
118
|
-
height: { type: String, default: "16" },
|
119
|
-
width: { type: String, default: "12" },
|
120
|
-
color: { type: String, default: "black" }
|
121
|
-
}
|
122
|
-
}, je = { style: { display: "none" } }, ze = ["height", "width", "fill"];
|
123
|
-
function Pe(t, e, r, a, n, o) {
|
124
|
-
return s(), i(C, null, [
|
125
|
-
(s(), i("svg", je, e[0] || (e[0] = [
|
126
|
-
l("symbol", {
|
127
|
-
id: "icon-pencil",
|
128
|
-
viewBox: "0 0 32 32"
|
129
|
-
}, [
|
130
|
-
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" })
|
131
|
-
], -1)
|
132
|
-
]))),
|
133
|
-
(s(), i("svg", {
|
134
|
-
height: r.height,
|
135
|
-
width: r.width,
|
136
|
-
fill: r.color
|
137
|
-
}, e[1] || (e[1] = [
|
138
|
-
l("use", { "xlink:href": "#icon-pencil" }, null, -1)
|
139
|
-
]), 8, ze))
|
140
|
-
], 64);
|
141
|
-
}
|
142
|
-
const qe = /* @__PURE__ */ m(Me, [["render", Pe]]), Be = {
|
143
|
-
components: {
|
144
|
-
IconMore: ue,
|
145
|
-
IconDelete: De,
|
146
|
-
IconEdit: qe
|
147
|
-
},
|
148
|
-
emits: ["updateTable"],
|
149
|
-
props: {
|
150
|
-
item: Object,
|
151
|
-
table: String,
|
152
|
-
isForm: null,
|
153
|
-
actions: Array,
|
154
|
-
default: () => []
|
155
|
-
},
|
156
|
-
data() {
|
157
|
-
return {
|
158
|
-
formVisible: !1,
|
159
|
-
isDeleteConfirm: !1,
|
160
|
-
formValue: {},
|
161
|
-
top: 0,
|
162
|
-
left: 0
|
163
|
-
};
|
164
|
-
},
|
165
|
-
methods: {
|
166
|
-
openConfirm() {
|
167
|
-
this.isDeleteConfirm = !0, document.querySelector("body").click();
|
168
|
-
},
|
169
|
-
async getData() {
|
170
|
-
var t;
|
171
|
-
try {
|
172
|
-
const { data: e } = await A.get(
|
173
|
-
`/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`
|
174
|
-
);
|
175
|
-
this.formValue = e;
|
176
|
-
} catch (e) {
|
177
|
-
console.error(e);
|
178
|
-
}
|
179
|
-
},
|
180
|
-
doSomethingOnCancel() {
|
181
|
-
this.formVisible = !1;
|
182
|
-
},
|
183
|
-
async deleteElement() {
|
184
|
-
var t;
|
185
|
-
try {
|
186
|
-
A.delete(`/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`), this.$notify({
|
187
|
-
title: "Успішно!",
|
188
|
-
message: "Об`єкт успішно видалeно",
|
189
|
-
type: "success"
|
190
|
-
}), await this.$emit("update-table"), this.isDeleteConfirm = !1;
|
191
|
-
} catch {
|
192
|
-
this.$notify({
|
193
|
-
title: "Помилка!",
|
194
|
-
message: "Сталася помилка",
|
195
|
-
type: "error"
|
196
|
-
});
|
197
|
-
}
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}, Le = { class: "hs-dropdown [--placement:bottom-right] inline-flex" }, Ue = { class: "size-7 inline-flex justify-center items-center gap-x-2 rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50" }, Oe = { class: "flex flex-col items-start" }, Ee = {
|
201
|
-
key: 1,
|
202
|
-
class: "h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto"
|
203
|
-
}, Ne = { class: "p-4" }, He = { class: "flex justify-end mt-4 gap-x-3" };
|
204
|
-
function We(t, e, r, a, n, o) {
|
205
|
-
const c = d("IconMore"), p = d("IconEdit"), h = d("router-link"), u = d("IconDelete"), _ = d("VsPopover"), w = d("VsDialog");
|
206
|
-
return s(), i(C, null, [
|
207
|
-
l("div", Le, [
|
208
|
-
b(_, {
|
209
|
-
trigger: "click",
|
210
|
-
placement: "bottom"
|
211
|
-
}, {
|
212
|
-
reference: y(() => [
|
213
|
-
l("button", Ue, [
|
214
|
-
b(c, {
|
215
|
-
height: "16",
|
216
|
-
width: "16"
|
217
|
-
})
|
218
|
-
])
|
219
|
-
]),
|
220
|
-
default: y(() => {
|
221
|
-
var k, $, g, S, D;
|
222
|
-
return [
|
223
|
-
l("div", Oe, [
|
224
|
-
(k = r.actions) != null && k.includes("edit") && r.isForm ? (s(), x(h, {
|
225
|
-
key: 0,
|
226
|
-
to: `/edit?table=${(g = ($ = t.$route) == null ? void 0 : $.params) == null ? void 0 : g.catchAll}&id=${(S = r.item) == null ? void 0 : S.id}`,
|
227
|
-
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"
|
228
|
-
}, {
|
229
|
-
default: y(() => [
|
230
|
-
b(p, { color: "#000" }),
|
231
|
-
e[4] || (e[4] = F(" Редагувати "))
|
232
|
-
]),
|
233
|
-
_: 1
|
234
|
-
}, 8, ["to"])) : v("", !0),
|
235
|
-
r.isForm ? (s(), i("div", Ee)) : v("", !0),
|
236
|
-
(D = r.actions) != null && D.includes("del") ? (s(), i("button", {
|
237
|
-
key: 2,
|
238
|
-
onClick: e[0] || (e[0] = ge((...M) => o.openConfirm && o.openConfirm(...M), ["stop"])),
|
239
|
-
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"
|
240
|
-
}, [
|
241
|
-
b(u),
|
242
|
-
e[5] || (e[5] = l("span", { class: "text-gray-800" }, "Видалити", -1))
|
243
|
-
])) : v("", !0)
|
244
|
-
])
|
245
|
-
];
|
246
|
-
}),
|
247
|
-
_: 1
|
248
|
-
})
|
249
|
-
]),
|
250
|
-
b(w, {
|
251
|
-
visible: n.isDeleteConfirm,
|
252
|
-
"onUpdate:visible": e[3] || (e[3] = (k) => n.isDeleteConfirm = k),
|
253
|
-
title: "Ви впевнені?"
|
254
|
-
}, {
|
255
|
-
default: y(() => [
|
256
|
-
l("div", Ne, [
|
257
|
-
e[6] || (e[6] = l("p", { class: "mt-1 text-gray-500 dark:text-neutral-500" }, " Ви впевнені, що хочете видалити цей об'єкт? ", -1)),
|
258
|
-
l("div", He, [
|
259
|
-
l("button", {
|
260
|
-
type: "button",
|
261
|
-
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",
|
262
|
-
onClick: e[1] || (e[1] = (k) => n.isDeleteConfirm = !1)
|
263
|
-
}, " Скасувати "),
|
264
|
-
l("button", {
|
265
|
-
type: "button",
|
266
|
-
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",
|
267
|
-
onClick: e[2] || (e[2] = (...k) => o.deleteElement && o.deleteElement(...k))
|
268
|
-
}, " Так, я впевнена/ий ")
|
269
|
-
])
|
270
|
-
])
|
271
|
-
]),
|
272
|
-
_: 1
|
273
|
-
}, 8, ["visible"])
|
274
|
-
], 64);
|
275
|
-
}
|
276
|
-
const Re = /* @__PURE__ */ m(Be, [["render", We]]), Ge = {}, Ze = {
|
277
|
-
class: "flex-shrink-0 mt-0.5 size-3.5",
|
278
|
-
xmlns: "http://www.w3.org/2000/svg",
|
279
|
-
viewBox: "0 0 24 24",
|
280
|
-
fill: "none",
|
281
|
-
stroke: "currentColor",
|
282
|
-
"stroke-width": "2",
|
283
|
-
"stroke-linecap": "round",
|
284
|
-
"stroke-linejoin": "round"
|
285
|
-
};
|
286
|
-
function Je(t, e, r, a, n, o) {
|
287
|
-
return s(), i("svg", Ze, e[0] || (e[0] = [
|
288
|
-
l("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
289
|
-
l("path", { d: "M7 20V4" }, null, -1),
|
290
|
-
l("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
291
|
-
l("path", { d: "M17 4v16" }, null, -1)
|
292
|
-
]));
|
293
|
-
}
|
294
|
-
const Ke = /* @__PURE__ */ m(Ge, [["render", Je]]), Qe = {
|
295
|
-
components: { IconExport: Ke },
|
296
|
-
props: { table: String, columns: Array },
|
297
|
-
data() {
|
298
|
-
return {
|
299
|
-
isOpen: !1,
|
300
|
-
tableFormats: ["json", "csv", "xlsx"],
|
301
|
-
format: "",
|
302
|
-
cols: []
|
303
|
-
};
|
304
|
-
},
|
305
|
-
methods: {
|
306
|
-
async exportTable() {
|
307
|
-
try {
|
308
|
-
const t = await A.get("/api/export", {
|
309
|
-
params: {
|
310
|
-
table: this.table,
|
311
|
-
format: this.format,
|
312
|
-
cols: this.cols.join(",")
|
313
|
-
},
|
314
|
-
responseType: "blob"
|
315
|
-
}), e = new Blob([t.data], {
|
316
|
-
type: "application/octet-stream"
|
317
|
-
}), r = window.URL.createObjectURL(e), a = document.createElement("a");
|
318
|
-
a.href = r, a.setAttribute(
|
319
|
-
"download",
|
320
|
-
`${this.table.split(".")[0]}.${this.format}`
|
321
|
-
), document.body.appendChild(a), a.click(), document.body.removeChild(a), window.URL.revokeObjectURL(r), this.$notify({
|
322
|
-
type: "success",
|
323
|
-
title: "Експорт",
|
324
|
-
message: "Файл успішно експортовано!"
|
325
|
-
});
|
326
|
-
} catch (t) {
|
327
|
-
console.error("Ошибка при экспорте файла:", t), this.$notify({
|
328
|
-
type: "error",
|
329
|
-
title: "Помилка",
|
330
|
-
message: "Не вдалося експортувати файл."
|
331
|
-
});
|
332
|
-
}
|
333
|
-
},
|
334
|
-
selectFormat(t) {
|
335
|
-
this.format = t;
|
336
|
-
}
|
337
|
-
}
|
338
|
-
}, Xe = { class: "p-4" }, Ye = { class: "pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700" }, et = { class: "mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]" }, tt = { class: "pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700" }, rt = { class: "mt-2 space-y-2" }, nt = ["id", "onChange"], lt = ["for"], st = { class: "flex w-full justify-end p-[20px] gap-[6px] border-t" };
|
339
|
-
function ot(t, e, r, a, n, o) {
|
340
|
-
const c = d("IconExport"), p = d("VsCheckbox"), h = d("VsDialog");
|
341
|
-
return s(), i(C, null, [
|
342
|
-
l("button", {
|
343
|
-
onClick: e[0] || (e[0] = (u) => n.isOpen = !0),
|
344
|
-
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"
|
345
|
-
}, [
|
346
|
-
b(c, {
|
347
|
-
height: "16",
|
348
|
-
width: "16"
|
349
|
-
}),
|
350
|
-
e[4] || (e[4] = F(" Експорт ")),
|
351
|
-
e[5] || (e[5] = l("svg", {
|
352
|
-
class: "shrink-0 size-3.5",
|
353
|
-
xmlns: "http://www.w3.org/2000/svg",
|
354
|
-
width: "24",
|
355
|
-
height: "24",
|
356
|
-
viewBox: "0 0 24 24",
|
357
|
-
fill: "none",
|
358
|
-
stroke: "currentColor",
|
359
|
-
"stroke-width": "2",
|
360
|
-
"stroke-linecap": "round",
|
361
|
-
"stroke-linejoin": "round"
|
362
|
-
}, [
|
363
|
-
l("path", { d: "m6 9 6 6 6-6" })
|
364
|
-
], -1))
|
365
|
-
]),
|
366
|
-
b(h, {
|
367
|
-
visible: n.isOpen,
|
368
|
-
"onUpdate:visible": e[3] || (e[3] = (u) => n.isOpen = u),
|
369
|
-
title: "Експорт таблиці",
|
370
|
-
size: "small"
|
371
|
-
}, {
|
372
|
-
footer: y(() => [
|
373
|
-
l("div", st, [
|
374
|
-
e[8] || (e[8] = l("button", {
|
375
|
-
type: "button",
|
376
|
-
class: "py-2 px-3 text-nowrap inline-flex justify-center items-center text-start bg-white border border-gray-200 text-gray-800 text-sm font-medium rounded-lg shadow-sm align-middle 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",
|
377
|
-
"data-hs-overlay": "#hs-pro-decm"
|
378
|
-
}, " Скасувати ", -1)),
|
379
|
-
l("button", {
|
380
|
-
type: "button",
|
381
|
-
class: "py-2 px-3 text-nowrap inline-flex justify-center items-center gap-x-2 text-start bg-blue-600 border border-blue-600 text-white text-sm font-medium rounded-lg shadow-sm align-middle 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",
|
382
|
-
onClick: e[2] || (e[2] = (...u) => o.exportTable && o.exportTable(...u))
|
383
|
-
}, " Завантажити таблицю ")
|
384
|
-
])
|
385
|
-
]),
|
386
|
-
default: y(() => [
|
387
|
-
e[9] || (e[9] = l("div", { class: "dark:border-neutral-700" }, null, -1)),
|
388
|
-
l("div", Xe, [
|
389
|
-
l("div", Ye, [
|
390
|
-
e[6] || (e[6] = l("h2", { class: "text-sm text-gray-500" }, " Виберіть стовпці таблиці для експорту: ", -1)),
|
391
|
-
l("div", et, [
|
392
|
-
(s(!0), i(C, null, T(r.columns, (u, _) => (s(), i("div", {
|
393
|
-
class: "flex items-center",
|
394
|
-
key: _,
|
395
|
-
style: { width: "calc((100% - 10px) / 2)" }
|
396
|
-
}, [
|
397
|
-
b(p, {
|
398
|
-
class: "[&>label]:text-sm [&>label]:text-gray-800 [&>label]:ms-3 !gap-x-[1px] !p-0",
|
399
|
-
modelValue: n.cols,
|
400
|
-
"onUpdate:modelValue": e[1] || (e[1] = (w) => n.cols = w),
|
401
|
-
value: u == null ? void 0 : u.name,
|
402
|
-
label: u == null ? void 0 : u.ua
|
403
|
-
}, null, 8, ["modelValue", "value", "label"])
|
404
|
-
]))), 128))
|
405
|
-
])
|
406
|
-
]),
|
407
|
-
l("div", tt, [
|
408
|
-
e[7] || (e[7] = l("h2", { class: "text-sm text-gray-500" }, "Виберіть формат таблиці:", -1)),
|
409
|
-
l("div", rt, [
|
410
|
-
(s(!0), i(C, null, T(n.tableFormats, (u, _) => (s(), i("div", {
|
411
|
-
class: "flex items-center",
|
412
|
-
key: _
|
413
|
-
}, [
|
414
|
-
l("input", {
|
415
|
-
type: "radio",
|
416
|
-
name: "hs-pro-duecmfm",
|
417
|
-
class: "shrink-0 border-gray-300 rounded-full text-blue-600 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",
|
418
|
-
id: u,
|
419
|
-
onChange: (w) => o.selectFormat(u)
|
420
|
-
}, null, 40, nt),
|
421
|
-
l("label", {
|
422
|
-
for: u,
|
423
|
-
class: "text-sm text-gray-800 ms-3 dark:text-neutral-400"
|
424
|
-
}, " Формат " + I(u), 9, lt)
|
425
|
-
]))), 128))
|
426
|
-
])
|
427
|
-
])
|
428
|
-
])
|
429
|
-
]),
|
430
|
-
_: 1
|
431
|
-
}, 8, ["visible"])
|
432
|
-
], 64);
|
433
|
-
}
|
434
|
-
const at = /* @__PURE__ */ m(Qe, [["render", ot]]), it = {}, dt = {
|
435
|
-
xmlns: "http://www.w3.org/2000/svg",
|
436
|
-
viewBox: "0 0 24 24",
|
437
|
-
fill: "none",
|
438
|
-
stroke: "currentColor",
|
439
|
-
"stroke-width": "2",
|
440
|
-
"stroke-linecap": "round",
|
441
|
-
"stroke-linejoin": "round",
|
442
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-columns"
|
443
|
-
};
|
444
|
-
function ct(t, e, r, a, n, o) {
|
445
|
-
return s(), i("svg", dt, e[0] || (e[0] = [
|
446
|
-
j('<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)
|
447
|
-
]));
|
448
|
-
}
|
449
|
-
const ut = /* @__PURE__ */ m(it, [["render", ct]]), ht = {
|
450
|
-
props: { column: Object },
|
451
|
-
emits: ["update-column"],
|
452
|
-
data() {
|
453
|
-
return {
|
454
|
-
value: !1
|
455
|
-
};
|
456
|
-
},
|
457
|
-
watch: {
|
458
|
-
value(t) {
|
459
|
-
this.$emit("update-column", { ...this.column, hidden: !t });
|
460
|
-
}
|
461
|
-
},
|
462
|
-
mounted() {
|
463
|
-
var t;
|
464
|
-
((t = this.column) == null ? void 0 : t.hidden) !== !0 && (this.value = !0);
|
465
|
-
}
|
466
|
-
}, pt = { class: "flex w-full gap-[8px] items-centr" };
|
467
|
-
function bt(t, e, r, a, n, o) {
|
468
|
-
var c, p;
|
469
|
-
return s(), i("label", pt, [
|
470
|
-
z(l("input", {
|
471
|
-
"onUpdate:modelValue": e[0] || (e[0] = (h) => n.value = h),
|
472
|
-
type: "checkbox"
|
473
|
-
}, null, 512), [
|
474
|
-
[xe, n.value]
|
475
|
-
]),
|
476
|
-
F(" " + I(((c = r.column) == null ? void 0 : c.ua) || ((p = r.column) == null ? void 0 : p.title)), 1)
|
477
|
-
]);
|
478
|
-
}
|
479
|
-
const ft = /* @__PURE__ */ m(ht, [["render", bt]]), mt = {
|
480
|
-
components: { IconColumns: ut, AdminTableColumnsHiddenItem: ft },
|
481
|
-
emits: ["update-columns"],
|
482
|
-
props: { columns: Array },
|
483
|
-
methods: {
|
484
|
-
updateColumn(t) {
|
485
|
-
const e = this.columns.findIndex((a) => (a == null ? void 0 : a.name) === (t == null ? void 0 : t.name)), r = this.columns;
|
486
|
-
r[e] = t, this.$emit("update-columns", [...r]);
|
487
|
-
}
|
488
|
-
}
|
489
|
-
}, gt = { 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" }, xt = { class: "py-[10px] px-[10px] w-[260px]" }, yt = { class: "flex flex-col gap-[3px] max-h-[400px] w-full overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500" };
|
490
|
-
function _t(t, e, r, a, n, o) {
|
491
|
-
const c = d("IconColumns"), p = d("AdminTableColumnsHiddenItem"), h = d("VsPopover");
|
492
|
-
return s(), x(h, {
|
493
|
-
trigger: "click",
|
494
|
-
placement: "bottom"
|
495
|
-
}, {
|
496
|
-
reference: y(() => [
|
497
|
-
l("button", gt, [
|
498
|
-
b(c, {
|
499
|
-
height: "20",
|
500
|
-
width: "16"
|
501
|
-
})
|
502
|
-
])
|
503
|
-
]),
|
504
|
-
default: y(() => [
|
505
|
-
l("div", xt, [
|
506
|
-
e[0] || (e[0] = l("h2", { class: "text-sm mb-[8px]" }, "Оберіть колонки, щоб приховати", -1)),
|
507
|
-
l("ul", yt, [
|
508
|
-
(s(!0), i(C, null, T(r.columns, (u, _) => (s(), i("li", { key: _ }, [
|
509
|
-
b(p, {
|
510
|
-
column: u,
|
511
|
-
onUpdateColumn: o.updateColumn
|
512
|
-
}, null, 8, ["column", "onUpdateColumn"])
|
513
|
-
]))), 128))
|
514
|
-
])
|
515
|
-
])
|
516
|
-
]),
|
517
|
-
_: 1
|
518
|
-
});
|
519
|
-
}
|
520
|
-
const kt = /* @__PURE__ */ m(mt, [["render", _t]]), wt = {}, vt = {
|
521
|
-
class: "hidden sm:block shrink-0 size-3",
|
522
|
-
xmlns: "http://www.w3.org/2000/svg",
|
523
|
-
fill: "currentColor",
|
524
|
-
viewBox: "0 0 16 16"
|
525
|
-
};
|
526
|
-
function Ct(t, e, r, a, n, o) {
|
527
|
-
return s(), i("svg", vt, e[0] || (e[0] = [
|
528
|
-
l("path", {
|
529
|
-
"fill-rule": "evenodd",
|
530
|
-
"clip-rule": "evenodd",
|
531
|
-
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"
|
532
|
-
}, null, -1)
|
533
|
-
]));
|
534
|
-
}
|
535
|
-
const le = /* @__PURE__ */ m(wt, [["render", Ct]]), $t = {}, It = { class: "vs-table-interface__table-wrp w-full rounded h-fit overflow-hidden" };
|
536
|
-
function Tt(t, e, r, a, n, o) {
|
537
|
-
return s(), i("div", It, e[0] || (e[0] = [
|
538
|
-
j('<div><div class="p-5 min-h-[500px] flex flex-col justify-center items-center text-center"><svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg><div class="max-w-sm mx-auto mt-6"><p class="font-medium text-gray-800 dark:text-neutral-200"> Дані для відображення відсутні </p><p class="mt-2 text-sm text-gray-500 dark:text-neutral-500"> Змініть параметри пошуку або спробуйте пізніше </p></div></div></div>', 1)
|
539
|
-
]));
|
540
|
-
}
|
541
|
-
const Vt = /* @__PURE__ */ m($t, [["render", Tt]]), St = {
|
542
|
-
props: { row: Object, column: Object, table: String }
|
543
|
-
};
|
544
|
-
function At(t, e, r, a, n, o) {
|
545
|
-
var c, p, h, u, _, w, k, $;
|
546
|
-
return s(), x(ye(
|
547
|
-
((c = r.column) == null ? void 0 : c.format) === "custom" ? (p = r.column) == null ? void 0 : p.component : t.$componentsConfig[`table-format-${((u = (h = r.column) == null ? void 0 : h.format) == null ? void 0 : u.toLowerCase()) || "text"}`]
|
548
|
-
), {
|
549
|
-
onUpdateTable: e[0] || (e[0] = (g) => t.$emit("update-table")),
|
550
|
-
name: (_ = r.column) == null ? void 0 : _.name,
|
551
|
-
data: r.row,
|
552
|
-
value: (k = r.row) == null ? void 0 : k[(w = r.column) == null ? void 0 : w.name],
|
553
|
-
table: r.table,
|
554
|
-
edit: ($ = r.column) == null ? void 0 : $.edit
|
555
|
-
}, null, 40, ["name", "data", "value", "table", "edit"]);
|
556
|
-
}
|
557
|
-
const se = /* @__PURE__ */ m(St, [["render", At]]), Ft = {}, Dt = {
|
558
|
-
xmlns: "http://www.w3.org/2000/svg",
|
559
|
-
viewBox: "0 0 24 24",
|
560
|
-
fill: "none",
|
561
|
-
stroke: "currentColor",
|
562
|
-
"stroke-width": "2",
|
563
|
-
"stroke-linecap": "round",
|
564
|
-
"stroke-linejoin": "round",
|
565
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-minus"
|
566
|
-
};
|
567
|
-
function Mt(t, e, r, a, n, o) {
|
568
|
-
return s(), i("svg", Dt, e[0] || (e[0] = [
|
569
|
-
l("path", {
|
570
|
-
stroke: "none",
|
571
|
-
d: "M0 0h24v24H0z",
|
572
|
-
fill: "none"
|
573
|
-
}, null, -1),
|
574
|
-
l("path", { d: "M5 12l14 0" }, null, -1)
|
575
|
-
]));
|
576
|
-
}
|
577
|
-
const jt = /* @__PURE__ */ m(Ft, [["render", Mt]]), zt = {
|
578
|
-
components: { IconPlus: le, IconMinus: jt },
|
579
|
-
props: { title: String },
|
580
|
-
data() {
|
581
|
-
return { expanded: !1 };
|
582
|
-
}
|
583
|
-
}, Pt = { class: "hs-accordion" }, qt = { class: "py-0.5 flex items-center gap-x-0.5 w-full" }, Bt = { class: "text-sm font-medium" }, Lt = { class: "w-full duration-150 before:block before:absolute relative inline-block b cursor-pointer" };
|
584
|
-
function Ut(t, e, r, a, n, o) {
|
585
|
-
const c = d("IconPlus"), p = d("IconMinus");
|
586
|
-
return s(), i("div", null, [
|
587
|
-
l("div", null, [
|
588
|
-
l("div", Pt, [
|
589
|
-
l("div", qt, [
|
590
|
-
l("div", {
|
591
|
-
onClick: e[0] || (e[0] = (h) => n.expanded = !n.expanded),
|
592
|
-
class: "grow rounded-md cursor-pointer"
|
593
|
-
}, [
|
594
|
-
l("span", Bt, I(r.title), 1)
|
595
|
-
]),
|
596
|
-
l("button", {
|
597
|
-
class: "size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",
|
598
|
-
onClick: e[1] || (e[1] = (h) => n.expanded = !n.expanded)
|
599
|
-
}, [
|
600
|
-
n.expanded ? (s(), x(p, {
|
601
|
-
key: 1,
|
602
|
-
width: "14"
|
603
|
-
})) : (s(), x(c, { key: 0 }))
|
604
|
-
])
|
605
|
-
]),
|
606
|
-
b(P, { name: "fade" }, {
|
607
|
-
default: y(() => [
|
608
|
-
z(l("div", Lt, [
|
609
|
-
_e(t.$slots, "default", {}, void 0, !0)
|
610
|
-
], 512), [
|
611
|
-
[ne, n.expanded]
|
612
|
-
])
|
613
|
-
]),
|
614
|
-
_: 3
|
615
|
-
})
|
616
|
-
])
|
617
|
-
])
|
618
|
-
]);
|
619
|
-
}
|
620
|
-
const Ot = /* @__PURE__ */ m(zt, [["render", Ut], ["__scopeId", "data-v-4139bc00"]]), Et = {
|
621
|
-
components: {
|
622
|
-
AdminComponentIs: se,
|
623
|
-
AdminTree: Ot,
|
624
|
-
VsNoData: he,
|
625
|
-
VsWidgetComments: pe,
|
626
|
-
VsWidgetMap: be,
|
627
|
-
VsWidgetFileList: fe
|
628
|
-
},
|
629
|
-
props: { table: String, columns: Array, row: Object }
|
630
|
-
}, Nt = {
|
631
|
-
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",
|
632
|
-
style: { height: "calc(100vh - 310px)" }
|
633
|
-
}, Ht = {
|
634
|
-
class: "border-l",
|
635
|
-
style: { height: "calc(100vh - 360px)" }
|
636
|
-
}, Wt = { class: "flex items-center justify-between py-1 gap-x-4" }, Rt = { class: "col-span-1" }, Gt = { class: "inline-flex items-center gap-x-2 text-[13px] text-gray-500 dark:text-neutral-500" }, Zt = { class: "col-span-2" }, Jt = { class: "font-medium text-[13px] text-gray-800 dark:text-neutral-200" }, Kt = { class: "table-info-card" }, Qt = { class: "table-info-card" };
|
637
|
-
function Xt(t, e, r, a, n, o) {
|
638
|
-
var k, $;
|
639
|
-
const c = d("AdminComponentIs"), p = d("AdminTree"), h = d("VsWidgetMap"), u = d("VsNoData"), _ = d("VsWidgetComments"), w = d("VsWidgetFileList");
|
640
|
-
return s(), i("div", Nt, [
|
641
|
-
e[0] || (e[0] = l("div", { class: "p-[10px] pl-[18px] pb-[18px] border-b" }, [
|
642
|
-
l("h2", { class: "text-sm font-medium" }, "Інформація про об'єкт")
|
643
|
-
], -1)),
|
644
|
-
l("div", Ht, [
|
645
|
-
($ = (k = t.$route) == null ? void 0 : k.query) != null && $.card ? (s(), i(C, { key: 0 }, [
|
646
|
-
r.row ? (s(), x(p, {
|
647
|
-
key: 0,
|
648
|
-
title: "Основна інформація",
|
649
|
-
class: "border-b p-[10px] py-[16px]"
|
650
|
-
}, {
|
651
|
-
default: y(() => [
|
652
|
-
(s(!0), i(C, null, T(r.columns, (g) => (s(), i("dl", Wt, [
|
653
|
-
l("dt", Rt, [
|
654
|
-
l("p", Gt, I((g == null ? void 0 : g.ua) || (g == null ? void 0 : g.title)) + ": ", 1)
|
655
|
-
]),
|
656
|
-
l("dd", Zt, [
|
657
|
-
l("p", Jt, [
|
658
|
-
b(c, {
|
659
|
-
row: r.row,
|
660
|
-
column: g,
|
661
|
-
table: r.table
|
662
|
-
}, null, 8, ["row", "column", "table"])
|
663
|
-
])
|
664
|
-
])
|
665
|
-
]))), 256))
|
666
|
-
]),
|
667
|
-
_: 1
|
668
|
-
})) : v("", !0),
|
669
|
-
b(p, {
|
670
|
-
title: "Карта",
|
671
|
-
class: "border-b p-[10px] py-[16px]"
|
672
|
-
}, {
|
673
|
-
default: y(() => {
|
674
|
-
var g, S;
|
675
|
-
return [
|
676
|
-
(g = r.row) != null && g.geom ? (s(), x(h, {
|
677
|
-
key: 0,
|
678
|
-
geometry: (S = r.row) == null ? void 0 : S.geom,
|
679
|
-
zoom: 14
|
680
|
-
}, null, 8, ["geometry"])) : (s(), x(u, {
|
681
|
-
key: 1,
|
682
|
-
title: "У об'єкта відсутня геометрія",
|
683
|
-
text: "",
|
684
|
-
class: "[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"
|
685
|
-
}))
|
686
|
-
];
|
687
|
-
}),
|
688
|
-
_: 1
|
689
|
-
}),
|
690
|
-
b(p, {
|
691
|
-
title: "Коментарі",
|
692
|
-
class: "border-b p-[10px] py-[16px]"
|
693
|
-
}, {
|
694
|
-
default: y(() => {
|
695
|
-
var g;
|
696
|
-
return [
|
697
|
-
l("div", Kt, [
|
698
|
-
b(_, {
|
699
|
-
id: (g = r.row) == null ? void 0 : g.id
|
700
|
-
}, null, 8, ["id"])
|
701
|
-
])
|
702
|
-
];
|
703
|
-
}),
|
704
|
-
_: 1
|
705
|
-
}),
|
706
|
-
b(p, {
|
707
|
-
title: "Файли",
|
708
|
-
class: "border-b p-[10px] py-[16px]"
|
709
|
-
}, {
|
710
|
-
default: y(() => {
|
711
|
-
var g;
|
712
|
-
return [
|
713
|
-
l("div", Qt, [
|
714
|
-
b(w, {
|
715
|
-
id: (g = r.row) == null ? void 0 : g.id
|
716
|
-
}, null, 8, ["id"])
|
717
|
-
])
|
718
|
-
];
|
719
|
-
}),
|
720
|
-
_: 1
|
721
|
-
})
|
722
|
-
], 64)) : (s(), x(u, {
|
723
|
-
key: 1,
|
724
|
-
text: "Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"
|
725
|
-
}))
|
726
|
-
])
|
727
|
-
]);
|
728
|
-
}
|
729
|
-
const Yt = /* @__PURE__ */ m(Et, [["render", Xt]]), er = {}, tr = {
|
730
|
-
class: "hidden xl:block shrink-0 size-4",
|
731
|
-
xmlns: "http://www.w3.org/2000/svg",
|
732
|
-
viewBox: "0 0 24 24",
|
733
|
-
fill: "none",
|
734
|
-
stroke: "currentColor",
|
735
|
-
"stroke-width": "2",
|
736
|
-
"stroke-linecap": "round",
|
737
|
-
"stroke-linejoin": "round"
|
738
|
-
};
|
739
|
-
function rr(t, e, r, a, n, o) {
|
740
|
-
return s(), i("svg", tr, e[0] || (e[0] = [
|
741
|
-
l("rect", {
|
742
|
-
width: "18",
|
743
|
-
height: "18",
|
744
|
-
x: "3",
|
745
|
-
y: "3",
|
746
|
-
rx: "2"
|
747
|
-
}, null, -1),
|
748
|
-
l("path", { d: "M15 3v18" }, null, -1),
|
749
|
-
l("path", { d: "m8 9 3 3-3 3" }, null, -1)
|
750
|
-
]));
|
751
|
-
}
|
752
|
-
const nr = /* @__PURE__ */ m(er, [["render", rr]]), lr = {}, sr = {
|
753
|
-
class: "h21yx vs0hq",
|
754
|
-
xmlns: "http://www.w3.org/2000/svg",
|
755
|
-
width: "24",
|
756
|
-
height: "24",
|
757
|
-
viewBox: "0 0 24 24",
|
758
|
-
fill: "none",
|
759
|
-
stroke: "currentColor",
|
760
|
-
"stroke-width": "2",
|
761
|
-
"stroke-linecap": "round",
|
762
|
-
"stroke-linejoin": "round"
|
763
|
-
};
|
764
|
-
function or(t, e, r, a, n, o) {
|
765
|
-
return s(), i("svg", sr, e[0] || (e[0] = [
|
766
|
-
j('<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)
|
767
|
-
]));
|
768
|
-
}
|
769
|
-
const ar = /* @__PURE__ */ m(lr, [["render", or]]), ir = {
|
770
|
-
props: { scheme: { type: Object }, onFilters: { type: Number } },
|
771
|
-
components: { IconFilter: ar },
|
772
|
-
data() {
|
773
|
-
return {
|
774
|
-
isFilters: !1
|
775
|
-
};
|
776
|
-
},
|
777
|
-
methods: {
|
778
|
-
closeFilter({ target: t }) {
|
779
|
-
this.isFilters && t.classList.contains("filter-container") && (this.isFilters = !1);
|
780
|
-
}
|
781
|
-
}
|
782
|
-
}, dr = {
|
783
|
-
key: 0,
|
784
|
-
class: "font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"
|
785
|
-
}, cr = { 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" };
|
786
|
-
function ur(t, e, r, a, n, o) {
|
787
|
-
const c = d("IconFilter"), p = d("VsFilter");
|
788
|
-
return s(), i(C, null, [
|
789
|
-
l("button", {
|
790
|
-
onClick: e[0] || (e[0] = (h) => n.isFilters = !n.isFilters),
|
791
|
-
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"
|
792
|
-
}, [
|
793
|
-
b(c, {
|
794
|
-
height: "16",
|
795
|
-
width: "16"
|
796
|
-
}),
|
797
|
-
e[4] || (e[4] = F(" Фільтри ")),
|
798
|
-
r.onFilters ? (s(), i("span", dr, I(r.onFilters), 1)) : v("", !0)
|
799
|
-
]),
|
800
|
-
b(P, { name: "fade" }, {
|
801
|
-
default: y(() => {
|
802
|
-
var h;
|
803
|
-
return [
|
804
|
-
z(l("div", {
|
805
|
-
onClick: e[3] || (e[3] = (...u) => o.closeFilter && o.closeFilter(...u)),
|
806
|
-
style: { height: "100vh" },
|
807
|
-
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)]"
|
808
|
-
}, [
|
809
|
-
l("div", cr, [
|
810
|
-
(h = r.scheme) != null && h.length ? (s(), x(p, {
|
811
|
-
key: 0,
|
812
|
-
ref: "filter",
|
813
|
-
scheme: r.scheme,
|
814
|
-
layout: "default",
|
815
|
-
"apply-vue-router": "",
|
816
|
-
history: "",
|
817
|
-
name: "filter",
|
818
|
-
onFilterChange: e[1] || (e[1] = (u) => t.$emit("filterChange", u)),
|
819
|
-
closeFilterBtn: !0,
|
820
|
-
onFilterClose: e[2] || (e[2] = (u) => n.isFilters = !1)
|
821
|
-
}, null, 8, ["scheme"])) : v("", !0)
|
822
|
-
])
|
823
|
-
], 512), [
|
824
|
-
[ne, n.isFilters]
|
825
|
-
])
|
826
|
-
];
|
827
|
-
}),
|
828
|
-
_: 1
|
829
|
-
})
|
830
|
-
], 64);
|
831
|
-
}
|
832
|
-
const hr = /* @__PURE__ */ m(ir, [["render", ur]]), pr = {
|
833
|
-
props: { tabsList: { type: Array, default: () => [] }, filterState: String }
|
834
|
-
}, br = {
|
835
|
-
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",
|
836
|
-
"aria-label": "Tabs",
|
837
|
-
role: "tablist",
|
838
|
-
"aria-orientation": "horizontal"
|
839
|
-
}, fr = ["onClick"];
|
840
|
-
function mr(t, e, r, a, n, o) {
|
841
|
-
return s(), i("nav", br, [
|
842
|
-
(s(!0), i(C, null, T(r.tabsList, (c) => (s(), i("button", {
|
843
|
-
onClick: (p) => t.$emit("update:filterState", c == null ? void 0 : c.name),
|
844
|
-
class: V(["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", {
|
845
|
-
" 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": (c == null ? void 0 : c.name) === r.filterState
|
846
|
-
}])
|
847
|
-
}, I(c == null ? void 0 : c.label), 11, fr))), 256))
|
848
|
-
]);
|
849
|
-
}
|
850
|
-
const gr = /* @__PURE__ */ m(pr, [["render", mr]]), xr = {}, yr = {
|
851
|
-
xmlns: "http://www.w3.org/2000/svg",
|
852
|
-
viewBox: "0 0 24 24",
|
853
|
-
fill: "none",
|
854
|
-
stroke: "currentColor",
|
855
|
-
"stroke-width": "2",
|
856
|
-
"stroke-linecap": "round",
|
857
|
-
"stroke-linejoin": "round",
|
858
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-filter"
|
859
|
-
};
|
860
|
-
function _r(t, e, r, a, n, o) {
|
861
|
-
return s(), i("svg", yr, e[0] || (e[0] = [
|
862
|
-
l("path", {
|
863
|
-
stroke: "none",
|
864
|
-
d: "M0 0h24v24H0z",
|
865
|
-
fill: "none"
|
866
|
-
}, null, -1),
|
867
|
-
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)
|
868
|
-
]));
|
869
|
-
}
|
870
|
-
const kr = /* @__PURE__ */ m(xr, [["render", _r]]), wr = {
|
871
|
-
components: { IconFilter2: kr },
|
872
|
-
props: { filterCustom: String, customList: Array }
|
873
|
-
}, vr = { 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" }, Cr = { class: "flex flex-col gap-[4px]" }, $r = ["onClick"];
|
874
|
-
function Ir(t, e, r, a, n, o) {
|
875
|
-
const c = d("IconFilter2"), p = d("VsPopover");
|
876
|
-
return s(), x(p, {
|
877
|
-
ref: "popover",
|
878
|
-
placement: "bottom"
|
879
|
-
}, {
|
880
|
-
reference: y(() => [
|
881
|
-
l("button", vr, [
|
882
|
-
b(c, {
|
883
|
-
height: "20",
|
884
|
-
width: "20"
|
885
|
-
})
|
886
|
-
])
|
887
|
-
]),
|
888
|
-
default: y(() => [
|
889
|
-
l("div", Cr, [
|
890
|
-
(s(!0), i(C, null, T(r.customList, (h, u) => (s(), i("button", {
|
891
|
-
onClick: (_) => {
|
892
|
-
var w;
|
893
|
-
t.$emit("update:filterCustom", h == null ? void 0 : h.name), (w = t.$refs) == null || w.popover.togglePopover();
|
894
|
-
},
|
895
|
-
key: u,
|
896
|
-
class: V(["p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300", { "bg-gray-100": r.filterCustom === (h == null ? void 0 : h.name) }])
|
897
|
-
}, I(h == null ? void 0 : h.label), 11, $r))), 128)),
|
898
|
-
l("button", {
|
899
|
-
class: "p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",
|
900
|
-
onClick: e[0] || (e[0] = (h) => {
|
901
|
-
var u;
|
902
|
-
t.$emit("update:filterCustom", void 0), (u = t.$refs) == null || u.popover.togglePopover();
|
903
|
-
})
|
904
|
-
}, " Скинути фільтри ")
|
905
|
-
])
|
906
|
-
]),
|
907
|
-
_: 1
|
908
|
-
}, 512);
|
909
|
-
}
|
910
|
-
const Tr = /* @__PURE__ */ m(wr, [["render", Ir]]), Vr = {
|
911
|
-
props: { table: String, title: String },
|
912
|
-
components: {
|
913
|
-
AdminTableControl: Re,
|
914
|
-
AdminTableExport: at,
|
915
|
-
AdminTableColumnsHidden: kt,
|
916
|
-
AdminTableColumn: Ve,
|
917
|
-
AdminNodata: Vt,
|
918
|
-
IconPlus: le,
|
919
|
-
IconSearch: me,
|
920
|
-
AdminTableCardInfo: Yt,
|
921
|
-
IconOpenCard: nr,
|
922
|
-
AdminComponentIs: se,
|
923
|
-
AdminTableFilters: hr,
|
924
|
-
AdminTableTabs: gr,
|
925
|
-
AdminTableCustomFilters: Tr
|
926
|
-
},
|
927
|
-
data() {
|
928
|
-
return {
|
929
|
-
tableData: {},
|
930
|
-
filterScheme: [],
|
931
|
-
page: 1,
|
932
|
-
searchValue: "",
|
933
|
-
limit: 0,
|
934
|
-
filters: null,
|
935
|
-
activeColumn: "",
|
936
|
-
isVisibleCardInfo: !1,
|
937
|
-
onFilters: 0,
|
938
|
-
filterState: null,
|
939
|
-
filterCustom: null
|
940
|
-
};
|
941
|
-
},
|
942
|
-
async mounted() {
|
943
|
-
await this.checkUrlMounted(), await this.getTableData(), await this.getFilters();
|
944
|
-
},
|
945
|
-
computed: {
|
946
|
-
defaultPage() {
|
947
|
-
var t, e;
|
948
|
-
return ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.page) || 1;
|
949
|
-
},
|
950
|
-
columns() {
|
951
|
-
var t, e;
|
952
|
-
return (e = (t = this.tableData) == null ? void 0 : t.columns) == null ? void 0 : e.filter((r) => (r == null ? void 0 : r.hidden) !== !0);
|
953
|
-
},
|
954
|
-
isForm() {
|
955
|
-
var t;
|
956
|
-
return (t = this.tableData) == null ? void 0 : t.form;
|
957
|
-
},
|
958
|
-
isNoData() {
|
959
|
-
var t, e;
|
960
|
-
return !((t = this.tableData) != null && t.rows) || !((e = this.columns) != null && e.length);
|
961
|
-
},
|
962
|
-
activeCardRow() {
|
963
|
-
var t, e;
|
964
|
-
return ((e = (t = this.tableData) == null ? void 0 : t.rows) == null ? void 0 : e.find((r) => {
|
965
|
-
var a, n;
|
966
|
-
return (r == null ? void 0 : r.id) === ((n = (a = this.$route) == null ? void 0 : a.query) == null ? void 0 : n.card);
|
967
|
-
})) || {};
|
968
|
-
},
|
969
|
-
getActions() {
|
970
|
-
var t;
|
971
|
-
return (t = this.tableData) == null ? void 0 : t.actions;
|
972
|
-
}
|
973
|
-
},
|
974
|
-
watch: {
|
975
|
-
async table() {
|
976
|
-
this.tableData = null, await this.getTableData();
|
977
|
-
},
|
978
|
-
searchValue() {
|
979
|
-
this.getTableData();
|
980
|
-
},
|
981
|
-
$route: {
|
982
|
-
handler(t, e) {
|
983
|
-
var r, a;
|
984
|
-
((r = t == null ? void 0 : t.params) == null ? void 0 : r.catchAll) !== ((a = e == null ? void 0 : e.params) == null ? void 0 : a.catchAll) && (this.unmountedData(), this.getFilters());
|
985
|
-
},
|
986
|
-
deep: !0
|
987
|
-
},
|
988
|
-
limit(t) {
|
989
|
-
var e;
|
990
|
-
this.$router.replace({ query: { ...(e = this.$route) == null ? void 0 : e.query, limit: t } });
|
991
|
-
},
|
992
|
-
filterState(t) {
|
993
|
-
var e;
|
994
|
-
t && (this.$router.replace({
|
995
|
-
...this.$route,
|
996
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, filterState: t }
|
997
|
-
}), this.getTableData());
|
998
|
-
},
|
999
|
-
filterCustom(t) {
|
1000
|
-
var e;
|
1001
|
-
this.$router.push({
|
1002
|
-
...this.$route,
|
1003
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, filterCustom: t }
|
1004
|
-
}), this.getTableData();
|
1005
|
-
}
|
1006
|
-
},
|
1007
|
-
methods: {
|
1008
|
-
async checkUrlMounted() {
|
1009
|
-
var t, e, r, a, n, o, c, p, h;
|
1010
|
-
this.page = ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.page) || 1, this.limit = ((a = (r = this.$route) == null ? void 0 : r.query) == null ? void 0 : a.limit) || 20, this.filterState = ((o = (n = this.$route) == null ? void 0 : n.query) == null ? void 0 : o.filterState) || null, this.filterCustom = ((p = (c = this.$route) == null ? void 0 : c.query) == null ? void 0 : p.filterCustom) || null, (h = this.$route) != null && h.query.card && (this.isVisibleCardInfo = !0);
|
1011
|
-
},
|
1012
|
-
rowWidth(t) {
|
1013
|
-
var r, a;
|
1014
|
-
const e = (a = (r = this.tableData) == null ? void 0 : r.columns) == null ? void 0 : a.find((n) => n.name === t);
|
1015
|
-
if (e) return e == null ? void 0 : e.width;
|
1016
|
-
},
|
1017
|
-
unmountedData() {
|
1018
|
-
this.page = 1, this.filterCustom = null, this.filterState = null, this.isVisibleCardInfo = !1, this.filterScheme = null, this.filters = null, this.onFilters = 0;
|
1019
|
-
},
|
1020
|
-
async getTableData() {
|
1021
|
-
var t, e;
|
1022
|
-
try {
|
1023
|
-
const { data: r } = await A.get(`/api/template/table/${this.table}`), a = await A.get(`/api/table-data/${this.table}`, {
|
1024
|
-
params: {
|
1025
|
-
page: this.page,
|
1026
|
-
search: this.searchValue || null,
|
1027
|
-
limit: this.limit,
|
1028
|
-
filter: this.filters || null,
|
1029
|
-
order: ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.sort) || null,
|
1030
|
-
state: this.filterState || null,
|
1031
|
-
custom: this.filterCustom || null
|
1032
|
-
}
|
1033
|
-
});
|
1034
|
-
this.tableData = {
|
1035
|
-
...r,
|
1036
|
-
...(a == null ? void 0 : a.data) || {}
|
1037
|
-
};
|
1038
|
-
} catch {
|
1039
|
-
}
|
1040
|
-
},
|
1041
|
-
async getFilters() {
|
1042
|
-
var t;
|
1043
|
-
try {
|
1044
|
-
const { data: e } = await A.get(`/api/table-filter/${this.table}`);
|
1045
|
-
this.filterScheme = (t = e == null ? void 0 : e.list) == null ? void 0 : t.map((r) => ({
|
1046
|
-
...r,
|
1047
|
-
label: (r == null ? void 0 : r.label) || (r == null ? void 0 : r.ua)
|
1048
|
-
}));
|
1049
|
-
} catch {
|
1050
|
-
}
|
1051
|
-
},
|
1052
|
-
async handlePageChange(t) {
|
1053
|
-
const e = this.$route.query;
|
1054
|
-
this.page = t, !(!(e != null && e.page) && t === 1 || e.page === t) && (await this.$router.replace({ query: { ...e, page: t } }), await this.getTableData());
|
1055
|
-
},
|
1056
|
-
async changeLimit(t) {
|
1057
|
-
this.limit = await t, this.defaultPage = 1, await this.getTableData();
|
1058
|
-
},
|
1059
|
-
async filterChange({ url: t, state: e }) {
|
1060
|
-
var r;
|
1061
|
-
this.filters = t !== "no-url" ? t : null, this.onFilters = (r = Object.entries(e)) == null ? void 0 : r.length, this.page = 1, await this.getTableData();
|
1062
|
-
},
|
1063
|
-
changeActiveColumn(t) {
|
1064
|
-
this.activeColumn = t, this.getTableData();
|
1065
|
-
},
|
1066
|
-
pushToCard(t) {
|
1067
|
-
var e;
|
1068
|
-
((e = this.tableData) == null ? void 0 : e.card) === !1 || this.$router.push(`/card/${this.table}/${t}`);
|
1069
|
-
},
|
1070
|
-
changeActiveCardInfo(t) {
|
1071
|
-
var e;
|
1072
|
-
this.isVisibleCardInfo && this.$router.push({
|
1073
|
-
...this.$route,
|
1074
|
-
query: { ...(e = this.$route) == null ? void 0 : e.query, card: t }
|
1075
|
-
});
|
1076
|
-
},
|
1077
|
-
toggleCardInfo() {
|
1078
|
-
var t;
|
1079
|
-
this.isVisibleCardInfo = !this.isVisibleCardInfo, this.isVisibleCardInfo || this.$router.push({
|
1080
|
-
...this.$route,
|
1081
|
-
query: { ...(t = this.$route) == null ? void 0 : t.query, card: void 0 }
|
1082
|
-
});
|
1083
|
-
}
|
1084
|
-
}
|
1085
|
-
}, Sr = { class: "w-[calc(100vw - 320px)]" }, Ar = { class: "h-[76px] bg-gray-50 flex items-center justify-between px-[30px]" }, Fr = { class: "text-xl font-medium h-[20px]" }, Dr = {
|
1086
|
-
style: { height: "calc(100vh - 140px)", width: "calc(100vw - 260px)" },
|
1087
|
-
class: "bg-gray-50 p-[20px] flex pt-[10px]"
|
1088
|
-
}, Mr = { class: "bg-white w-full rounded-xl border p-[20px] pr-0" }, jr = { class: "flex" }, zr = { class: "flex gap-[6px] ml-auto" }, Pr = { class: "inline-block w-full align-middle" }, qr = {
|
1089
|
-
key: 0,
|
1090
|
-
class: "relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"
|
1091
|
-
}, Br = { class: "sticky top-0 bg-white w-full after:absolute after:content-[''] z-[1] after:block after:w-full after:h-px after:bg-stone-200" }, Lr = { class: "right-0 border-t border-stone-200" }, Ur = { class: "divide-y divide-gray-200" }, Or = { class: "text-sm text-gray-600 px-4 py-3" }, Er = ["onClick"], Nr = ["onClick"], Hr = {
|
1092
|
-
key: 0,
|
1093
|
-
class: "text-center sticky right-0 bg-white w-[80px] px-[10px]"
|
1094
|
-
}, Wr = { class: "p-[20px] flex justify-end w-full" };
|
1095
|
-
function Rr(t, e, r, a, n, o) {
|
1096
|
-
var q, B, L, U, O, E, N, H, W, R, G, Z, J, K;
|
1097
|
-
const c = d("IconPlus"), p = d("router-link"), h = d("AdminTableTabs"), u = d("IconSearch"), _ = d("VsText"), w = d("AdminTableCustomFilters"), k = d("AdminTableColumnsHidden"), $ = d("AdminTableExport"), g = d("AdminTableFilters"), S = d("IconOpenCard"), D = d("AdminTableColumn"), M = d("AdminComponentIs"), oe = d("AdminTableControl"), ae = d("AdminNodata"), ie = d("VsPagination"), de = d("AdminTableCardInfo");
|
1098
|
-
return s(), i("div", Sr, [
|
1099
|
-
l("div", Ar, [
|
1100
|
-
l("h2", Fr, I(r.title), 1),
|
1101
|
-
o.isForm ? (s(), x(p, {
|
1102
|
-
key: 0,
|
1103
|
-
to: `/add?table=${(B = (q = t.$route) == null ? void 0 : q.params) == null ? void 0 : B.catchAll}`,
|
1104
|
-
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"
|
1105
|
-
}, {
|
1106
|
-
default: y(() => [
|
1107
|
-
b(c, {
|
1108
|
-
height: "16",
|
1109
|
-
width: "16"
|
1110
|
-
}),
|
1111
|
-
e[5] || (e[5] = F(" Додати "))
|
1112
|
-
]),
|
1113
|
-
_: 1
|
1114
|
-
}, 8, ["to"])) : v("", !0)
|
1115
|
-
]),
|
1116
|
-
l("div", Dr, [
|
1117
|
-
l("div", Mr, [
|
1118
|
-
(U = (L = n.tableData) == null ? void 0 : L.filterState) != null && U.length ? (s(), x(h, {
|
1119
|
-
key: 0,
|
1120
|
-
tabsList: (O = n.tableData) == null ? void 0 : O.filterState,
|
1121
|
-
filterState: n.filterState,
|
1122
|
-
"onUpdate:filterState": e[0] || (e[0] = (f) => n.filterState = f)
|
1123
|
-
}, null, 8, ["tabsList", "filterState"])) : v("", !0),
|
1124
|
-
l("div", jr, [
|
1125
|
-
l("div", {
|
1126
|
-
class: V([n.isVisibleCardInfo ? "w-[calc(100%-360px)]" : "w-full"])
|
1127
|
-
}, [
|
1128
|
-
l("div", {
|
1129
|
-
class: V(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative", { "pr-[20px]": !n.isVisibleCardInfo }])
|
1130
|
-
}, [
|
1131
|
-
b(u, {
|
1132
|
-
height: "14",
|
1133
|
-
width: "14",
|
1134
|
-
class: "absolute top-[10px] left-[14px] text-gray-500 z-[1]"
|
1135
|
-
}),
|
1136
|
-
b(_, {
|
1137
|
-
modelValue: n.searchValue,
|
1138
|
-
"onUpdate:modelValue": e[1] || (e[1] = (f) => n.searchValue = f),
|
1139
|
-
placeholder: "Пошук...",
|
1140
|
-
clearable: !0,
|
1141
|
-
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"
|
1142
|
-
}, null, 8, ["modelValue"]),
|
1143
|
-
l("div", zr, [
|
1144
|
-
(N = (E = n.tableData) == null ? void 0 : E.filterCustom) != null && N.length ? (s(), x(w, {
|
1145
|
-
key: 0,
|
1146
|
-
customList: (H = n.tableData) == null ? void 0 : H.filterCustom,
|
1147
|
-
filterCustom: n.filterCustom,
|
1148
|
-
"onUpdate:filterCustom": e[2] || (e[2] = (f) => n.filterCustom = f)
|
1149
|
-
}, null, 8, ["customList", "filterCustom"])) : v("", !0),
|
1150
|
-
b(k, {
|
1151
|
-
columns: (W = n.tableData) == null ? void 0 : W.columns,
|
1152
|
-
onUpdateColumns: e[3] || (e[3] = (f) => n.tableData.columns = f)
|
1153
|
-
}, null, 8, ["columns"]),
|
1154
|
-
b($, {
|
1155
|
-
table: r.table,
|
1156
|
-
columns: (R = n.tableData) == null ? void 0 : R.columns
|
1157
|
-
}, null, 8, ["table", "columns"]),
|
1158
|
-
b(g, {
|
1159
|
-
scheme: n.filterScheme,
|
1160
|
-
onFilters: n.onFilters,
|
1161
|
-
onFilterChange: o.filterChange
|
1162
|
-
}, null, 8, ["scheme", "onFilters", "onFilterChange"]),
|
1163
|
-
l("button", {
|
1164
|
-
onClick: e[4] || (e[4] = (...f) => o.toggleCardInfo && o.toggleCardInfo(...f)),
|
1165
|
-
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"
|
1166
|
-
}, [
|
1167
|
-
b(S, {
|
1168
|
-
class: V({ "rotate-180 duration-300": !n.isVisibleCardInfo })
|
1169
|
-
}, null, 8, ["class"])
|
1170
|
-
])
|
1171
|
-
])
|
1172
|
-
], 2),
|
1173
|
-
l("div", {
|
1174
|
-
class: V(["flex items-start justify-start w-full space-y-5", { "pr-[20px]": !n.isVisibleCardInfo }])
|
1175
|
-
}, [
|
1176
|
-
l("div", {
|
1177
|
-
style: re({
|
1178
|
-
height: (Z = (G = n.tableData) == null ? void 0 : G.filterState) != null && Z.length ? "calc(100vh - 370px)" : "calc(100vh - 315px)"
|
1179
|
-
}),
|
1180
|
-
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"
|
1181
|
-
}, [
|
1182
|
-
l("div", Pr, [
|
1183
|
-
o.isNoData ? (s(), x(ae, { key: 1 })) : (s(), i("table", qr, [
|
1184
|
-
l("thead", Br, [
|
1185
|
-
l("tr", Lr, [
|
1186
|
-
(s(!0), i(C, null, T(o.columns, (f) => (s(), x(D, {
|
1187
|
-
key: f.name,
|
1188
|
-
style: re({
|
1189
|
-
width: o.rowWidth(f == null ? void 0 : f.name)
|
1190
|
-
}),
|
1191
|
-
data: f,
|
1192
|
-
activeColumn: n.activeColumn,
|
1193
|
-
onChangeActive: o.changeActiveColumn
|
1194
|
-
}, null, 8, ["style", "data", "activeColumn", "onChangeActive"]))), 128)),
|
1195
|
-
e[6] || (e[6] = l("th", { class: "w-[70px] sticky right-0 top-0 bg-white" }, null, -1))
|
1196
|
-
])
|
1197
|
-
]),
|
1198
|
-
l("tbody", Ur, [
|
1199
|
-
(s(!0), i(C, null, T((J = n.tableData) == null ? void 0 : J.rows, (f, ce) => {
|
1200
|
-
var Q, X, Y;
|
1201
|
-
return s(), i("tr", { key: ce }, [
|
1202
|
-
l("td", Or, [
|
1203
|
-
l("button", {
|
1204
|
-
onClick: () => o.pushToCard(f == null ? void 0 : f.id),
|
1205
|
-
class: V(["text-sm font-medium", [
|
1206
|
-
((Q = n.tableData) == null ? void 0 : Q.card) === !1 ? "" : "text-blue-600 decoration-2 focus:outline-none focus:underline hover:text-blue-600 hover:underline"
|
1207
|
-
]])
|
1208
|
-
}, [
|
1209
|
-
b(M, {
|
1210
|
-
row: f,
|
1211
|
-
column: o.columns[0],
|
1212
|
-
table: r.table,
|
1213
|
-
onUpdateTable: o.getTableData
|
1214
|
-
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1215
|
-
], 10, Er)
|
1216
|
-
]),
|
1217
|
-
(s(!0), i(C, null, T((X = o.columns) == null ? void 0 : X.slice(1), (ee) => (s(), i("td", {
|
1218
|
-
onClick: (Qr) => o.changeActiveCardInfo(f == null ? void 0 : f.id),
|
1219
|
-
class: V(["text-start px-3 py-3 text-sm text-gray-600 whitespace-nowrap", { "cursor-pointer": n.isVisibleCardInfo }]),
|
1220
|
-
key: ee.name
|
1221
|
-
}, [
|
1222
|
-
b(M, {
|
1223
|
-
row: f,
|
1224
|
-
column: ee,
|
1225
|
-
table: r.table,
|
1226
|
-
onUpdateTable: o.getTableData
|
1227
|
-
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1228
|
-
], 10, Nr))), 128)),
|
1229
|
-
(Y = o.getActions) != null && Y.length ? (s(), i("td", Hr, [
|
1230
|
-
b(oe, {
|
1231
|
-
actions: o.getActions,
|
1232
|
-
isForm: o.isForm,
|
1233
|
-
item: f,
|
1234
|
-
table: r.table,
|
1235
|
-
onUpdateTable: o.getTableData
|
1236
|
-
}, null, 8, ["actions", "isForm", "item", "table", "onUpdateTable"])
|
1237
|
-
])) : v("", !0)
|
1238
|
-
]);
|
1239
|
-
}), 128))
|
1240
|
-
])
|
1241
|
-
]))
|
1242
|
-
])
|
1243
|
-
], 4)
|
1244
|
-
], 2),
|
1245
|
-
l("div", Wr, [
|
1246
|
-
n.limit ? (s(), x(ie, {
|
1247
|
-
key: 0,
|
1248
|
-
goTo: !1,
|
1249
|
-
class: "justify-end",
|
1250
|
-
"default-page": o.defaultPage,
|
1251
|
-
total: ((K = n.tableData) == null ? void 0 : K.total) || 0,
|
1252
|
-
pageSize: parseInt(n.limit),
|
1253
|
-
onPageChange: o.handlePageChange,
|
1254
|
-
pageSizes: [10, 16, 20],
|
1255
|
-
onPageSizeChange: o.changeLimit
|
1256
|
-
}, null, 8, ["default-page", "total", "pageSize", "onPageChange", "onPageSizeChange"])) : v("", !0)
|
1257
|
-
])
|
1258
|
-
], 2),
|
1259
|
-
b(P, { name: "slide-fade" }, {
|
1260
|
-
default: y(() => [
|
1261
|
-
n.isVisibleCardInfo ? (s(), x(de, {
|
1262
|
-
key: 0,
|
1263
|
-
table: r.table,
|
1264
|
-
columns: o.columns,
|
1265
|
-
row: o.activeCardRow
|
1266
|
-
}, null, 8, ["table", "columns", "row"])) : v("", !0)
|
1267
|
-
]),
|
1268
|
-
_: 1
|
1269
|
-
})
|
1270
|
-
])
|
1271
|
-
])
|
1272
|
-
])
|
1273
|
-
]);
|
1274
|
-
}
|
1275
|
-
const Gr = /* @__PURE__ */ m(Vr, [["render", Rr], ["__scopeId", "data-v-52abfa94"]]), Zr = {
|
1276
|
-
components: { AdminTable: Gr },
|
1277
|
-
data() {
|
1278
|
-
return {
|
1279
|
-
table: !1,
|
1280
|
-
interface: "",
|
1281
|
-
title: ""
|
1282
|
-
};
|
1283
|
-
},
|
1284
|
-
watch: {
|
1285
|
-
$route: {
|
1286
|
-
async handler() {
|
1287
|
-
var t;
|
1288
|
-
(t = te) != null && t.value || await this.getMenu(), await this.checkPageType();
|
1289
|
-
},
|
1290
|
-
deep: !0
|
1291
|
-
},
|
1292
|
-
title(t) {
|
1293
|
-
t && (document.title = t);
|
1294
|
-
}
|
1295
|
-
},
|
1296
|
-
async mounted() {
|
1297
|
-
await this.checkPageType();
|
1298
|
-
},
|
1299
|
-
methods: {
|
1300
|
-
flattenMenu(t) {
|
1301
|
-
const e = [];
|
1302
|
-
return t.forEach((r) => {
|
1303
|
-
r.menu ? e.push(...this.flattenMenu(r.menu)) : e.push(r);
|
1304
|
-
}), e;
|
1305
|
-
},
|
1306
|
-
async checkPageType() {
|
1307
|
-
var a, n;
|
1308
|
-
const t = this.flattenMenu(te.value);
|
1309
|
-
t != null && t.length || this.$router.replace("/404");
|
1310
|
-
const e = t == null ? void 0 : t.find((o) => {
|
1311
|
-
var c, p;
|
1312
|
-
return (o == null ? void 0 : o.path) == ((p = (c = this.$route) == null ? void 0 : c.params) == null ? void 0 : p.catchAll);
|
1313
|
-
});
|
1314
|
-
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);
|
1315
|
-
const r = e == null ? void 0 : e.table;
|
1316
|
-
this.table = r || !1, !r && this.getInterface();
|
1317
|
-
},
|
1318
|
-
async getInterface() {
|
1319
|
-
var t, e;
|
1320
|
-
try {
|
1321
|
-
const { data: r } = await A.get(
|
1322
|
-
`/api/template/interface/${((e = (t = this.$route) == null ? void 0 : t.params) == null ? void 0 : e.catchAll) || ""}`
|
1323
|
-
);
|
1324
|
-
this.interface = r || "";
|
1325
|
-
} catch {
|
1326
|
-
this.interface = "";
|
1327
|
-
}
|
1328
|
-
}
|
1329
|
-
}
|
1330
|
-
}, Jr = ["innerHTML"];
|
1331
|
-
function Kr(t, e, r, a, n, o) {
|
1332
|
-
const c = d("AdminTable");
|
1333
|
-
return n.table ? (s(), x(c, {
|
1334
|
-
key: 0,
|
1335
|
-
table: n.table,
|
1336
|
-
title: n.title
|
1337
|
-
}, null, 8, ["table", "title"])) : (s(), i("div", {
|
1338
|
-
key: 1,
|
1339
|
-
class: "w-full bg-gray-50",
|
1340
|
-
style: { height: "calc(100vh - 120px)" },
|
1341
|
-
innerHTML: n.interface
|
1342
|
-
}, null, 8, Jr));
|
1343
|
-
}
|
1344
|
-
const en = /* @__PURE__ */ m(Zr, [["render", Kr]]);
|
1345
|
-
export {
|
1346
|
-
en as default
|
1347
|
-
};
|