@opengis/admin 0.1.98 → 0.1.100
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/add-page-Dl_bGhPC.js +92 -0
- package/dist/admin-interface-Dma-D4A9.js +1351 -0
- package/dist/admin-view-TeTAUVK1.js +640 -0
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +83 -128
- package/dist/card-page-D-3aubBo.js +230 -0
- package/dist/{card-view-BpcpqR_U.js → card-view-CZjPaUKx.js} +1 -1
- package/dist/edit-page-RhKgRai9.js +103 -0
- package/dist/{import-file-eH-_Imyb.js → import-file-DgJqxKyF.js} +18308 -19458
- package/dist/style.css +1 -1
- package/module/settings/card/admin.accounts.table/index.yml +8 -0
- package/module/settings/card/admin.accounts.table/rules.hbs +19 -0
- package/module/settings/card/admin.accounts.table/users.hbs +14 -0
- package/module/settings/card/admin.roles.table/access.hbs +3 -24
- package/module/settings/card/admin.roles.table/general_info.hbs +1 -17
- package/module/settings/card/admin.roles.table/index.yml +4 -1
- package/module/settings/card/admin.roles.table/users.hbs +6 -27
- package/module/settings/card/admin.routes.table/general_info.hbs +14 -41
- package/module/settings/card/admin.routes.table/groups.hbs +12 -0
- package/module/settings/card/admin.routes.table/index.yml +3 -0
- package/module/settings/card/admin.routes.table/users.hbs +16 -33
- package/module/settings/card/admin.users.table/context.hbs +15 -0
- package/module/settings/card/admin.users.table/general_info.hbs +13 -26
- package/module/settings/card/admin.users.table/index.yml +17 -7
- package/module/settings/card/admin.users.table/last_login.hbs +10 -0
- package/module/settings/card/admin.users.table/logs.hbs +11 -31
- package/module/settings/card/admin.users.table/routes.hbs +8 -0
- package/module/settings/card/admin.users.table/user_roles.hbs +13 -25
- package/module/settings/form/admin.accounts.form.json +13 -0
- package/module/settings/form/admin.rules.form.json +31 -0
- package/module/settings/form/admin.user_roles.form.json +0 -8
- package/module/settings/form/admin.user_roles_card.form.json +14 -0
- package/module/settings/form/admin.users.form.json +2 -2
- package/module/settings/form/context.account_grants.form.json +24 -0
- package/module/settings/form/context.account_users.form.json +12 -0
- package/module/settings/menu.json +24 -0
- package/module/settings/select/core.accounts.sql +1 -0
- package/module/settings/select/core.roles.sql +1 -1
- package/module/settings/select/core.rules.sql +1 -0
- package/module/settings/select/core.user_uid.sql +0 -1
- package/module/settings/table/admin.accounts.table.json +42 -0
- package/module/settings/table/admin.roles.table.json +1 -1
- package/module/settings/table/admin.routes.table.json +9 -4
- package/module/settings/table/admin.rules.table.json +77 -0
- package/module/settings/table/admin.users.table.json +17 -6
- package/module/settings/table/context.account_grants.table.json +68 -0
- package/module/settings/table/context.account_users.table.json +38 -0
- package/package.json +3 -2
- package/server/helpers/core/select.js +4 -6
- package/server/helpers/list/tableList.js +9 -6
- package/server/routes/access/controllers/access.group.js +1 -1
- package/server/routes/access/controllers/access.group.post.js +4 -4
- package/server/routes/data/controllers/cardData.js +11 -0
- package/server/routes/data/controllers/tableData.js +13 -4
- package/server/routes/menu/controllers/getMenu.js +12 -25
- package/dist/IconChevronDown-irxwDmQp.js +0 -26
- package/dist/add-page-UtwEANeW.js +0 -105
- package/dist/admin-interface-PJfd31TQ.js +0 -1600
- package/dist/admin-view-BuVQ8ziq.js +0 -383
- package/dist/assets/favicon.svg +0 -1
- package/dist/assets/logo.svg +0 -42
- package/dist/edit-page-Bd6VW9hb.js +0 -120
- package/module/settings/select/core.roles.json +0 -3
@@ -0,0 +1,1351 @@
|
|
1
|
+
import { _ as m, b as ue, a as A, c as he, d as pe, e as be, f as fe, I as me, u as te } from "./import-file-DgJqxKyF.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 c, 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 S, 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] = (d) => 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 Se = /* @__PURE__ */ m(ke, [["render", Te]]), Ve = {}, 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(Ve, [["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: "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" }, 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 d = c("IconMore"), p = c("IconEdit"), h = c("router-link"), u = c("IconDelete"), _ = c("VsPopover"), w = c("VsDialog");
|
206
|
+
return s(), i(C, null, [
|
207
|
+
l("div", Le, [
|
208
|
+
b(_, {
|
209
|
+
trigger: "click",
|
210
|
+
placement: "bottom-left"
|
211
|
+
}, {
|
212
|
+
reference: y(() => [
|
213
|
+
l("button", Ue, [
|
214
|
+
b(d, {
|
215
|
+
height: "16",
|
216
|
+
width: "16"
|
217
|
+
})
|
218
|
+
])
|
219
|
+
]),
|
220
|
+
default: y(() => {
|
221
|
+
var k, $, g, V, 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=${(V = r.item) == null ? void 0 : V.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 d = c("IconExport"), p = c("VsCheckbox"), h = c("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(d, {
|
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 = {}, ct = {
|
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 dt(t, e, r, a, n, o) {
|
445
|
+
return s(), i("svg", ct, 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", dt]]), 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 d, 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(((d = r.column) == null ? void 0 : d.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 d = c("IconColumns"), p = c("AdminTableColumnsHiddenItem"), h = c("VsPopover");
|
492
|
+
return s(), x(h, {
|
493
|
+
trigger: "click",
|
494
|
+
placement: "bottom"
|
495
|
+
}, {
|
496
|
+
reference: y(() => [
|
497
|
+
l("button", gt, [
|
498
|
+
b(d, {
|
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 St = /* @__PURE__ */ m($t, [["render", Tt]]), Vt = {
|
542
|
+
props: { row: Object, column: Object, table: String }
|
543
|
+
};
|
544
|
+
function At(t, e, r, a, n, o) {
|
545
|
+
var d, p, h, u, _, w, k, $;
|
546
|
+
return s(), x(ye(
|
547
|
+
((d = r.column) == null ? void 0 : d.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
|
+
column: r.column,
|
555
|
+
edit: ($ = r.column) == null ? void 0 : $.edit
|
556
|
+
}, null, 40, ["name", "data", "value", "table", "column", "edit"]);
|
557
|
+
}
|
558
|
+
const se = /* @__PURE__ */ m(Vt, [["render", At]]), Ft = {}, Dt = {
|
559
|
+
xmlns: "http://www.w3.org/2000/svg",
|
560
|
+
viewBox: "0 0 24 24",
|
561
|
+
fill: "none",
|
562
|
+
stroke: "currentColor",
|
563
|
+
"stroke-width": "2",
|
564
|
+
"stroke-linecap": "round",
|
565
|
+
"stroke-linejoin": "round",
|
566
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-minus"
|
567
|
+
};
|
568
|
+
function Mt(t, e, r, a, n, o) {
|
569
|
+
return s(), i("svg", Dt, e[0] || (e[0] = [
|
570
|
+
l("path", {
|
571
|
+
stroke: "none",
|
572
|
+
d: "M0 0h24v24H0z",
|
573
|
+
fill: "none"
|
574
|
+
}, null, -1),
|
575
|
+
l("path", { d: "M5 12l14 0" }, null, -1)
|
576
|
+
]));
|
577
|
+
}
|
578
|
+
const jt = /* @__PURE__ */ m(Ft, [["render", Mt]]), zt = {
|
579
|
+
components: { IconPlus: le, IconMinus: jt },
|
580
|
+
props: { title: String },
|
581
|
+
data() {
|
582
|
+
return { expanded: !1 };
|
583
|
+
}
|
584
|
+
}, 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" };
|
585
|
+
function Ut(t, e, r, a, n, o) {
|
586
|
+
const d = c("IconPlus"), p = c("IconMinus");
|
587
|
+
return s(), i("div", null, [
|
588
|
+
l("div", null, [
|
589
|
+
l("div", Pt, [
|
590
|
+
l("div", qt, [
|
591
|
+
l("div", {
|
592
|
+
onClick: e[0] || (e[0] = (h) => n.expanded = !n.expanded),
|
593
|
+
class: "grow rounded-md cursor-pointer"
|
594
|
+
}, [
|
595
|
+
l("span", Bt, I(r.title), 1)
|
596
|
+
]),
|
597
|
+
l("button", {
|
598
|
+
class: "size-6 flex justify-center items-center hover:bg-gray-100 rounded-md",
|
599
|
+
onClick: e[1] || (e[1] = (h) => n.expanded = !n.expanded)
|
600
|
+
}, [
|
601
|
+
n.expanded ? (s(), x(p, {
|
602
|
+
key: 1,
|
603
|
+
width: "14"
|
604
|
+
})) : (s(), x(d, { key: 0 }))
|
605
|
+
])
|
606
|
+
]),
|
607
|
+
b(P, { name: "fade" }, {
|
608
|
+
default: y(() => [
|
609
|
+
z(l("div", Lt, [
|
610
|
+
_e(t.$slots, "default", {}, void 0, !0)
|
611
|
+
], 512), [
|
612
|
+
[ne, n.expanded]
|
613
|
+
])
|
614
|
+
]),
|
615
|
+
_: 3
|
616
|
+
})
|
617
|
+
])
|
618
|
+
])
|
619
|
+
]);
|
620
|
+
}
|
621
|
+
const Ot = /* @__PURE__ */ m(zt, [["render", Ut], ["__scopeId", "data-v-4139bc00"]]), Et = {
|
622
|
+
components: {
|
623
|
+
AdminComponentIs: se,
|
624
|
+
AdminTree: Ot,
|
625
|
+
VsNoData: he,
|
626
|
+
VsWidgetComments: pe,
|
627
|
+
VsWidgetMap: be,
|
628
|
+
VsWidgetFileList: fe
|
629
|
+
},
|
630
|
+
props: { table: String, columns: Array, row: Object }
|
631
|
+
}, Nt = {
|
632
|
+
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",
|
633
|
+
style: { height: "calc(100vh - 310px)" }
|
634
|
+
}, Ht = {
|
635
|
+
class: "border-l",
|
636
|
+
style: { height: "calc(100vh - 360px)" }
|
637
|
+
}, 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" };
|
638
|
+
function Xt(t, e, r, a, n, o) {
|
639
|
+
var k, $;
|
640
|
+
const d = c("AdminComponentIs"), p = c("AdminTree"), h = c("VsWidgetMap"), u = c("VsNoData"), _ = c("VsWidgetComments"), w = c("VsWidgetFileList");
|
641
|
+
return s(), i("div", Nt, [
|
642
|
+
e[0] || (e[0] = l("div", { class: "p-[10px] pl-[18px] pb-[18px] border-b" }, [
|
643
|
+
l("h2", { class: "text-sm font-medium" }, "Інформація про об'єкт")
|
644
|
+
], -1)),
|
645
|
+
l("div", Ht, [
|
646
|
+
($ = (k = t.$route) == null ? void 0 : k.query) != null && $.card ? (s(), i(C, { key: 0 }, [
|
647
|
+
r.row ? (s(), x(p, {
|
648
|
+
key: 0,
|
649
|
+
title: "Основна інформація",
|
650
|
+
class: "border-b p-[10px] py-[16px]"
|
651
|
+
}, {
|
652
|
+
default: y(() => [
|
653
|
+
(s(!0), i(C, null, T(r.columns, (g) => (s(), i("dl", Wt, [
|
654
|
+
l("dt", Rt, [
|
655
|
+
l("p", Gt, I((g == null ? void 0 : g.ua) || (g == null ? void 0 : g.title)) + ": ", 1)
|
656
|
+
]),
|
657
|
+
l("dd", Zt, [
|
658
|
+
l("p", Jt, [
|
659
|
+
b(d, {
|
660
|
+
row: r.row,
|
661
|
+
column: g,
|
662
|
+
table: r.table
|
663
|
+
}, null, 8, ["row", "column", "table"])
|
664
|
+
])
|
665
|
+
])
|
666
|
+
]))), 256))
|
667
|
+
]),
|
668
|
+
_: 1
|
669
|
+
})) : v("", !0),
|
670
|
+
b(p, {
|
671
|
+
title: "Карта",
|
672
|
+
class: "border-b p-[10px] py-[16px]"
|
673
|
+
}, {
|
674
|
+
default: y(() => {
|
675
|
+
var g, V;
|
676
|
+
return [
|
677
|
+
(g = r.row) != null && g.geom ? (s(), x(h, {
|
678
|
+
key: 0,
|
679
|
+
geometry: (V = r.row) == null ? void 0 : V.geom,
|
680
|
+
zoom: 14
|
681
|
+
}, null, 8, ["geometry"])) : (s(), x(u, {
|
682
|
+
key: 1,
|
683
|
+
title: "У об'єкта відсутня геометрія",
|
684
|
+
text: "",
|
685
|
+
class: "[&>div]:h-[200px] [&>div]:min-h-[400px] h-[400px]"
|
686
|
+
}))
|
687
|
+
];
|
688
|
+
}),
|
689
|
+
_: 1
|
690
|
+
}),
|
691
|
+
b(p, {
|
692
|
+
title: "Коментарі",
|
693
|
+
class: "border-b p-[10px] py-[16px]"
|
694
|
+
}, {
|
695
|
+
default: y(() => {
|
696
|
+
var g;
|
697
|
+
return [
|
698
|
+
l("div", Kt, [
|
699
|
+
b(_, {
|
700
|
+
id: (g = r.row) == null ? void 0 : g.id
|
701
|
+
}, null, 8, ["id"])
|
702
|
+
])
|
703
|
+
];
|
704
|
+
}),
|
705
|
+
_: 1
|
706
|
+
}),
|
707
|
+
b(p, {
|
708
|
+
title: "Файли",
|
709
|
+
class: "border-b p-[10px] py-[16px]"
|
710
|
+
}, {
|
711
|
+
default: y(() => {
|
712
|
+
var g;
|
713
|
+
return [
|
714
|
+
l("div", Qt, [
|
715
|
+
b(w, {
|
716
|
+
id: (g = r.row) == null ? void 0 : g.id
|
717
|
+
}, null, 8, ["id"])
|
718
|
+
])
|
719
|
+
];
|
720
|
+
}),
|
721
|
+
_: 1
|
722
|
+
})
|
723
|
+
], 64)) : (s(), x(u, {
|
724
|
+
key: 1,
|
725
|
+
text: "Оберіть один з об'єктів в таблиці для відображення інформаціі про нього"
|
726
|
+
}))
|
727
|
+
])
|
728
|
+
]);
|
729
|
+
}
|
730
|
+
const Yt = /* @__PURE__ */ m(Et, [["render", Xt]]), er = {}, tr = {
|
731
|
+
class: "hidden xl:block shrink-0 size-4",
|
732
|
+
xmlns: "http://www.w3.org/2000/svg",
|
733
|
+
viewBox: "0 0 24 24",
|
734
|
+
fill: "none",
|
735
|
+
stroke: "currentColor",
|
736
|
+
"stroke-width": "2",
|
737
|
+
"stroke-linecap": "round",
|
738
|
+
"stroke-linejoin": "round"
|
739
|
+
};
|
740
|
+
function rr(t, e, r, a, n, o) {
|
741
|
+
return s(), i("svg", tr, e[0] || (e[0] = [
|
742
|
+
l("rect", {
|
743
|
+
width: "18",
|
744
|
+
height: "18",
|
745
|
+
x: "3",
|
746
|
+
y: "3",
|
747
|
+
rx: "2"
|
748
|
+
}, null, -1),
|
749
|
+
l("path", { d: "M15 3v18" }, null, -1),
|
750
|
+
l("path", { d: "m8 9 3 3-3 3" }, null, -1)
|
751
|
+
]));
|
752
|
+
}
|
753
|
+
const nr = /* @__PURE__ */ m(er, [["render", rr]]), lr = {}, sr = {
|
754
|
+
class: "h21yx vs0hq",
|
755
|
+
xmlns: "http://www.w3.org/2000/svg",
|
756
|
+
width: "24",
|
757
|
+
height: "24",
|
758
|
+
viewBox: "0 0 24 24",
|
759
|
+
fill: "none",
|
760
|
+
stroke: "currentColor",
|
761
|
+
"stroke-width": "2",
|
762
|
+
"stroke-linecap": "round",
|
763
|
+
"stroke-linejoin": "round"
|
764
|
+
};
|
765
|
+
function or(t, e, r, a, n, o) {
|
766
|
+
return s(), i("svg", sr, e[0] || (e[0] = [
|
767
|
+
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)
|
768
|
+
]));
|
769
|
+
}
|
770
|
+
const ar = /* @__PURE__ */ m(lr, [["render", or]]), ir = {
|
771
|
+
props: { scheme: { type: Object }, onFilters: { type: Number } },
|
772
|
+
components: { IconFilter: ar },
|
773
|
+
data() {
|
774
|
+
return {
|
775
|
+
isFilters: !1
|
776
|
+
};
|
777
|
+
},
|
778
|
+
methods: {
|
779
|
+
closeFilter({ target: t }) {
|
780
|
+
this.isFilters && t.classList.contains("filter-container") && (this.isFilters = !1);
|
781
|
+
}
|
782
|
+
}
|
783
|
+
}, cr = {
|
784
|
+
key: 0,
|
785
|
+
class: "font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full dark:bg-neutral-500"
|
786
|
+
}, dr = { 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" };
|
787
|
+
function ur(t, e, r, a, n, o) {
|
788
|
+
const d = c("IconFilter"), p = c("VsFilter");
|
789
|
+
return s(), i(C, null, [
|
790
|
+
l("button", {
|
791
|
+
onClick: e[0] || (e[0] = (h) => n.isFilters = !n.isFilters),
|
792
|
+
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"
|
793
|
+
}, [
|
794
|
+
b(d, {
|
795
|
+
height: "16",
|
796
|
+
width: "16"
|
797
|
+
}),
|
798
|
+
e[4] || (e[4] = F(" Фільтри ")),
|
799
|
+
r.onFilters ? (s(), i("span", cr, I(r.onFilters), 1)) : v("", !0)
|
800
|
+
]),
|
801
|
+
b(P, { name: "fade" }, {
|
802
|
+
default: y(() => {
|
803
|
+
var h;
|
804
|
+
return [
|
805
|
+
z(l("div", {
|
806
|
+
onClick: e[3] || (e[3] = (...u) => o.closeFilter && o.closeFilter(...u)),
|
807
|
+
style: { height: "100vh" },
|
808
|
+
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)]"
|
809
|
+
}, [
|
810
|
+
l("div", dr, [
|
811
|
+
(h = r.scheme) != null && h.length ? (s(), x(p, {
|
812
|
+
key: 0,
|
813
|
+
ref: "filter",
|
814
|
+
scheme: r.scheme,
|
815
|
+
layout: "default",
|
816
|
+
"apply-vue-router": "",
|
817
|
+
history: "",
|
818
|
+
name: "filter",
|
819
|
+
onFilterChange: e[1] || (e[1] = (u) => t.$emit("filterChange", u)),
|
820
|
+
closeFilterBtn: !0,
|
821
|
+
onFilterClose: e[2] || (e[2] = (u) => n.isFilters = !1)
|
822
|
+
}, null, 8, ["scheme"])) : v("", !0)
|
823
|
+
])
|
824
|
+
], 512), [
|
825
|
+
[ne, n.isFilters]
|
826
|
+
])
|
827
|
+
];
|
828
|
+
}),
|
829
|
+
_: 1
|
830
|
+
})
|
831
|
+
], 64);
|
832
|
+
}
|
833
|
+
const hr = /* @__PURE__ */ m(ir, [["render", ur]]), pr = {
|
834
|
+
props: { tabsList: { type: Array, default: () => [] }, filterState: String }
|
835
|
+
}, br = {
|
836
|
+
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",
|
837
|
+
"aria-label": "Tabs",
|
838
|
+
role: "tablist",
|
839
|
+
"aria-orientation": "horizontal"
|
840
|
+
}, fr = ["onClick"];
|
841
|
+
function mr(t, e, r, a, n, o) {
|
842
|
+
return s(), i("nav", br, [
|
843
|
+
(s(!0), i(C, null, T(r.tabsList, (d) => (s(), i("button", {
|
844
|
+
onClick: (p) => t.$emit("update:filterState", d == null ? void 0 : d.name),
|
845
|
+
class: S(["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", {
|
846
|
+
" 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) === r.filterState
|
847
|
+
}])
|
848
|
+
}, I(d == null ? void 0 : d.label), 11, fr))), 256))
|
849
|
+
]);
|
850
|
+
}
|
851
|
+
const gr = /* @__PURE__ */ m(pr, [["render", mr]]), xr = {}, yr = {
|
852
|
+
xmlns: "http://www.w3.org/2000/svg",
|
853
|
+
viewBox: "0 0 24 24",
|
854
|
+
fill: "none",
|
855
|
+
stroke: "currentColor",
|
856
|
+
"stroke-width": "2",
|
857
|
+
"stroke-linecap": "round",
|
858
|
+
"stroke-linejoin": "round",
|
859
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-filter"
|
860
|
+
};
|
861
|
+
function _r(t, e, r, a, n, o) {
|
862
|
+
return s(), i("svg", yr, e[0] || (e[0] = [
|
863
|
+
l("path", {
|
864
|
+
stroke: "none",
|
865
|
+
d: "M0 0h24v24H0z",
|
866
|
+
fill: "none"
|
867
|
+
}, null, -1),
|
868
|
+
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)
|
869
|
+
]));
|
870
|
+
}
|
871
|
+
const kr = /* @__PURE__ */ m(xr, [["render", _r]]), wr = {
|
872
|
+
components: { IconFilter2: kr },
|
873
|
+
props: { filterCustom: String, customList: Array }
|
874
|
+
}, 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"];
|
875
|
+
function Ir(t, e, r, a, n, o) {
|
876
|
+
const d = c("IconFilter2"), p = c("VsPopover");
|
877
|
+
return s(), x(p, {
|
878
|
+
ref: "popover",
|
879
|
+
placement: "bottom"
|
880
|
+
}, {
|
881
|
+
reference: y(() => [
|
882
|
+
l("button", vr, [
|
883
|
+
b(d, {
|
884
|
+
height: "20",
|
885
|
+
width: "20"
|
886
|
+
})
|
887
|
+
])
|
888
|
+
]),
|
889
|
+
default: y(() => [
|
890
|
+
l("div", Cr, [
|
891
|
+
(s(!0), i(C, null, T(r.customList, (h, u) => (s(), i("button", {
|
892
|
+
onClick: (_) => {
|
893
|
+
var w;
|
894
|
+
t.$emit("update:filterCustom", h == null ? void 0 : h.name), (w = t.$refs) == null || w.popover.togglePopover();
|
895
|
+
},
|
896
|
+
key: u,
|
897
|
+
class: S(["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) }])
|
898
|
+
}, I(h == null ? void 0 : h.label), 11, $r))), 128)),
|
899
|
+
l("button", {
|
900
|
+
class: "p-[8px] block rounded-lg w-[140px] text-start hover:bg-gray-100 !duration-300",
|
901
|
+
onClick: e[0] || (e[0] = (h) => {
|
902
|
+
var u;
|
903
|
+
t.$emit("update:filterCustom", void 0), (u = t.$refs) == null || u.popover.togglePopover();
|
904
|
+
})
|
905
|
+
}, " Скинути фільтри ")
|
906
|
+
])
|
907
|
+
]),
|
908
|
+
_: 1
|
909
|
+
}, 512);
|
910
|
+
}
|
911
|
+
const Tr = /* @__PURE__ */ m(wr, [["render", Ir]]), Sr = {
|
912
|
+
props: { table: String, title: String },
|
913
|
+
components: {
|
914
|
+
AdminTableControl: Re,
|
915
|
+
AdminTableExport: at,
|
916
|
+
AdminTableColumnsHidden: kt,
|
917
|
+
AdminTableColumn: Se,
|
918
|
+
AdminNodata: St,
|
919
|
+
IconPlus: le,
|
920
|
+
IconSearch: me,
|
921
|
+
AdminTableCardInfo: Yt,
|
922
|
+
IconOpenCard: nr,
|
923
|
+
AdminComponentIs: se,
|
924
|
+
AdminTableFilters: hr,
|
925
|
+
AdminTableTabs: gr,
|
926
|
+
AdminTableCustomFilters: Tr
|
927
|
+
},
|
928
|
+
data() {
|
929
|
+
return {
|
930
|
+
tableData: {},
|
931
|
+
filterScheme: [],
|
932
|
+
page: 1,
|
933
|
+
searchValue: "",
|
934
|
+
limit: 0,
|
935
|
+
filters: null,
|
936
|
+
activeColumn: "",
|
937
|
+
isVisibleCardInfo: !1,
|
938
|
+
onFilters: 0,
|
939
|
+
filterState: null,
|
940
|
+
filterCustom: null
|
941
|
+
};
|
942
|
+
},
|
943
|
+
async mounted() {
|
944
|
+
await this.checkUrlMounted(), await this.getTableData(), await this.getFilters();
|
945
|
+
},
|
946
|
+
computed: {
|
947
|
+
defaultPage() {
|
948
|
+
var t, e;
|
949
|
+
return ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.page) || 1;
|
950
|
+
},
|
951
|
+
columns() {
|
952
|
+
var t, e;
|
953
|
+
return (e = (t = this.tableData) == null ? void 0 : t.columns) == null ? void 0 : e.filter((r) => (r == null ? void 0 : r.hidden) !== !0);
|
954
|
+
},
|
955
|
+
isForm() {
|
956
|
+
var t;
|
957
|
+
return (t = this.tableData) == null ? void 0 : t.form;
|
958
|
+
},
|
959
|
+
isNoData() {
|
960
|
+
var t, e;
|
961
|
+
return !((t = this.tableData) != null && t.rows) || !((e = this.columns) != null && e.length);
|
962
|
+
},
|
963
|
+
activeCardRow() {
|
964
|
+
var t, e;
|
965
|
+
return ((e = (t = this.tableData) == null ? void 0 : t.rows) == null ? void 0 : e.find((r) => {
|
966
|
+
var a, n;
|
967
|
+
return (r == null ? void 0 : r.id) === ((n = (a = this.$route) == null ? void 0 : a.query) == null ? void 0 : n.card);
|
968
|
+
})) || {};
|
969
|
+
},
|
970
|
+
getActions() {
|
971
|
+
var t;
|
972
|
+
return (t = this.tableData) == null ? void 0 : t.actions;
|
973
|
+
}
|
974
|
+
},
|
975
|
+
watch: {
|
976
|
+
async table() {
|
977
|
+
this.tableData = null, await this.getTableData();
|
978
|
+
},
|
979
|
+
searchValue() {
|
980
|
+
this.getTableData();
|
981
|
+
},
|
982
|
+
$route: {
|
983
|
+
handler(t, e) {
|
984
|
+
var r, a;
|
985
|
+
((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());
|
986
|
+
},
|
987
|
+
deep: !0
|
988
|
+
},
|
989
|
+
limit(t) {
|
990
|
+
var e;
|
991
|
+
this.$router.replace({ query: { ...(e = this.$route) == null ? void 0 : e.query, limit: t } });
|
992
|
+
},
|
993
|
+
filterState(t) {
|
994
|
+
var e;
|
995
|
+
t && (this.$router.replace({
|
996
|
+
...this.$route,
|
997
|
+
query: { ...(e = this.$route) == null ? void 0 : e.query, filterState: t }
|
998
|
+
}), this.getTableData());
|
999
|
+
},
|
1000
|
+
filterCustom(t) {
|
1001
|
+
var e;
|
1002
|
+
this.$router.push({
|
1003
|
+
...this.$route,
|
1004
|
+
query: { ...(e = this.$route) == null ? void 0 : e.query, filterCustom: t }
|
1005
|
+
}), this.getTableData();
|
1006
|
+
}
|
1007
|
+
},
|
1008
|
+
methods: {
|
1009
|
+
async checkUrlMounted() {
|
1010
|
+
var t, e, r, a, n, o, d, p, h;
|
1011
|
+
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 = (d = this.$route) == null ? void 0 : d.query) == null ? void 0 : p.filterCustom) || null, (h = this.$route) != null && h.query.card && (this.isVisibleCardInfo = !0);
|
1012
|
+
},
|
1013
|
+
rowWidth(t) {
|
1014
|
+
var r, a;
|
1015
|
+
const e = (a = (r = this.tableData) == null ? void 0 : r.columns) == null ? void 0 : a.find((n) => n.name === t);
|
1016
|
+
if (e) {
|
1017
|
+
const n = e == null ? void 0 : e.width;
|
1018
|
+
return n != null && n.includes("px") ? n : `${n}px`;
|
1019
|
+
}
|
1020
|
+
},
|
1021
|
+
unmountedData() {
|
1022
|
+
this.page = 1, this.filterCustom = null, this.filterState = null, this.isVisibleCardInfo = !1, this.filterScheme = null, this.filters = null, this.onFilters = 0;
|
1023
|
+
},
|
1024
|
+
async getTableData() {
|
1025
|
+
var t, e;
|
1026
|
+
try {
|
1027
|
+
const { data: r } = await A.get(`/api/template/table/${this.table}`), a = await A.get(`/api/table-data/${this.table}`, {
|
1028
|
+
params: {
|
1029
|
+
page: this.page,
|
1030
|
+
search: this.searchValue || null,
|
1031
|
+
limit: this.limit,
|
1032
|
+
filter: this.filters || null,
|
1033
|
+
order: ((e = (t = this.$route) == null ? void 0 : t.query) == null ? void 0 : e.sort) || null,
|
1034
|
+
state: this.filterState || null,
|
1035
|
+
custom: this.filterCustom || null
|
1036
|
+
}
|
1037
|
+
});
|
1038
|
+
this.tableData = {
|
1039
|
+
...r,
|
1040
|
+
...(a == null ? void 0 : a.data) || {}
|
1041
|
+
};
|
1042
|
+
} catch {
|
1043
|
+
}
|
1044
|
+
},
|
1045
|
+
async getFilters() {
|
1046
|
+
var t;
|
1047
|
+
try {
|
1048
|
+
const { data: e } = await A.get(`/api/table-filter/${this.table}`);
|
1049
|
+
this.filterScheme = (t = e == null ? void 0 : e.list) == null ? void 0 : t.map((r) => ({
|
1050
|
+
...r,
|
1051
|
+
label: (r == null ? void 0 : r.label) || (r == null ? void 0 : r.ua)
|
1052
|
+
}));
|
1053
|
+
} catch {
|
1054
|
+
}
|
1055
|
+
},
|
1056
|
+
async handlePageChange(t) {
|
1057
|
+
const e = this.$route.query;
|
1058
|
+
this.page = t, !(!(e != null && e.page) && t === 1 || e.page === t) && (await this.$router.replace({ query: { ...e, page: t } }), await this.getTableData());
|
1059
|
+
},
|
1060
|
+
async changeLimit(t) {
|
1061
|
+
this.limit = await t, this.defaultPage = 1, await this.getTableData();
|
1062
|
+
},
|
1063
|
+
async filterChange({ url: t, state: e }) {
|
1064
|
+
var r;
|
1065
|
+
this.filters = t !== "no-url" ? t : null, this.onFilters = (r = Object.entries(e)) == null ? void 0 : r.length, this.page = 1, await this.getTableData();
|
1066
|
+
},
|
1067
|
+
changeActiveColumn(t) {
|
1068
|
+
this.activeColumn = t, this.getTableData();
|
1069
|
+
},
|
1070
|
+
pushToCard(t) {
|
1071
|
+
var e;
|
1072
|
+
((e = this.tableData) == null ? void 0 : e.card) === !1 || this.$router.push(`/card/${this.table}/${t}`);
|
1073
|
+
},
|
1074
|
+
changeActiveCardInfo(t) {
|
1075
|
+
var e;
|
1076
|
+
this.isVisibleCardInfo && this.$router.push({
|
1077
|
+
...this.$route,
|
1078
|
+
query: { ...(e = this.$route) == null ? void 0 : e.query, card: t }
|
1079
|
+
});
|
1080
|
+
},
|
1081
|
+
toggleCardInfo() {
|
1082
|
+
var t;
|
1083
|
+
this.isVisibleCardInfo = !this.isVisibleCardInfo, this.isVisibleCardInfo || this.$router.push({
|
1084
|
+
...this.$route,
|
1085
|
+
query: { ...(t = this.$route) == null ? void 0 : t.query, card: void 0 }
|
1086
|
+
});
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
}, Vr = { 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 = {
|
1090
|
+
style: { height: "calc(100vh - 140px)", width: "calc(100vw - 260px)" },
|
1091
|
+
class: "bg-gray-50 p-[20px] flex pt-[10px]"
|
1092
|
+
}, 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 = {
|
1093
|
+
key: 0,
|
1094
|
+
class: "relative min-w-full divide-y divide-gray-200 table-fixed dark:divide-neutral-700"
|
1095
|
+
}, 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 = {
|
1096
|
+
key: 0,
|
1097
|
+
class: "text-center sticky right-0 bg-white w-[80px] px-[10px]"
|
1098
|
+
}, Wr = { class: "p-[20px] flex justify-end w-full" };
|
1099
|
+
function Rr(t, e, r, a, n, o) {
|
1100
|
+
var q, B, L, U, O, E, N, H, W, R, G, Z, J, K;
|
1101
|
+
const d = c("IconPlus"), p = c("router-link"), h = c("AdminTableTabs"), u = c("IconSearch"), _ = c("VsText"), w = c("AdminTableCustomFilters"), k = c("AdminTableColumnsHidden"), $ = c("AdminTableExport"), g = c("AdminTableFilters"), V = c("IconOpenCard"), D = c("AdminTableColumn"), M = c("AdminComponentIs"), oe = c("AdminTableControl"), ae = c("AdminNodata"), ie = c("VsPagination"), ce = c("AdminTableCardInfo");
|
1102
|
+
return s(), i("div", Vr, [
|
1103
|
+
l("div", Ar, [
|
1104
|
+
l("h2", Fr, I(r.title), 1),
|
1105
|
+
o.isForm ? (s(), x(p, {
|
1106
|
+
key: 0,
|
1107
|
+
to: `/add?table=${(B = (q = t.$route) == null ? void 0 : q.params) == null ? void 0 : B.catchAll}`,
|
1108
|
+
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"
|
1109
|
+
}, {
|
1110
|
+
default: y(() => [
|
1111
|
+
b(d, {
|
1112
|
+
height: "16",
|
1113
|
+
width: "16"
|
1114
|
+
}),
|
1115
|
+
e[5] || (e[5] = F(" Додати "))
|
1116
|
+
]),
|
1117
|
+
_: 1
|
1118
|
+
}, 8, ["to"])) : v("", !0)
|
1119
|
+
]),
|
1120
|
+
l("div", Dr, [
|
1121
|
+
l("div", Mr, [
|
1122
|
+
(U = (L = n.tableData) == null ? void 0 : L.filterState) != null && U.length ? (s(), x(h, {
|
1123
|
+
key: 0,
|
1124
|
+
tabsList: (O = n.tableData) == null ? void 0 : O.filterState,
|
1125
|
+
filterState: n.filterState,
|
1126
|
+
"onUpdate:filterState": e[0] || (e[0] = (f) => n.filterState = f)
|
1127
|
+
}, null, 8, ["tabsList", "filterState"])) : v("", !0),
|
1128
|
+
l("div", jr, [
|
1129
|
+
l("div", {
|
1130
|
+
class: S([n.isVisibleCardInfo ? "w-[calc(100%-360px)]" : "w-full"])
|
1131
|
+
}, [
|
1132
|
+
l("div", {
|
1133
|
+
class: S(["flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px] relative", { "pr-[20px]": !n.isVisibleCardInfo }])
|
1134
|
+
}, [
|
1135
|
+
b(u, {
|
1136
|
+
height: "14",
|
1137
|
+
width: "14",
|
1138
|
+
class: "absolute top-[10px] left-[14px] text-gray-500 z-[1]"
|
1139
|
+
}),
|
1140
|
+
b(_, {
|
1141
|
+
modelValue: n.searchValue,
|
1142
|
+
"onUpdate:modelValue": e[1] || (e[1] = (f) => n.searchValue = f),
|
1143
|
+
placeholder: "Пошук...",
|
1144
|
+
clearable: !0,
|
1145
|
+
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"
|
1146
|
+
}, null, 8, ["modelValue"]),
|
1147
|
+
l("div", zr, [
|
1148
|
+
(N = (E = n.tableData) == null ? void 0 : E.filterCustom) != null && N.length ? (s(), x(w, {
|
1149
|
+
key: 0,
|
1150
|
+
customList: (H = n.tableData) == null ? void 0 : H.filterCustom,
|
1151
|
+
filterCustom: n.filterCustom,
|
1152
|
+
"onUpdate:filterCustom": e[2] || (e[2] = (f) => n.filterCustom = f)
|
1153
|
+
}, null, 8, ["customList", "filterCustom"])) : v("", !0),
|
1154
|
+
b(k, {
|
1155
|
+
columns: (W = n.tableData) == null ? void 0 : W.columns,
|
1156
|
+
onUpdateColumns: e[3] || (e[3] = (f) => n.tableData.columns = f)
|
1157
|
+
}, null, 8, ["columns"]),
|
1158
|
+
b($, {
|
1159
|
+
table: r.table,
|
1160
|
+
columns: (R = n.tableData) == null ? void 0 : R.columns
|
1161
|
+
}, null, 8, ["table", "columns"]),
|
1162
|
+
b(g, {
|
1163
|
+
scheme: n.filterScheme,
|
1164
|
+
onFilters: n.onFilters,
|
1165
|
+
onFilterChange: o.filterChange
|
1166
|
+
}, null, 8, ["scheme", "onFilters", "onFilterChange"]),
|
1167
|
+
l("button", {
|
1168
|
+
onClick: e[4] || (e[4] = (...f) => o.toggleCardInfo && o.toggleCardInfo(...f)),
|
1169
|
+
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"
|
1170
|
+
}, [
|
1171
|
+
b(V, {
|
1172
|
+
class: S({ "rotate-180 duration-300": !n.isVisibleCardInfo })
|
1173
|
+
}, null, 8, ["class"])
|
1174
|
+
])
|
1175
|
+
])
|
1176
|
+
], 2),
|
1177
|
+
l("div", {
|
1178
|
+
class: S(["flex items-start justify-start w-full space-y-5", { "pr-[20px]": !n.isVisibleCardInfo }])
|
1179
|
+
}, [
|
1180
|
+
l("div", {
|
1181
|
+
style: re({
|
1182
|
+
height: (Z = (G = n.tableData) == null ? void 0 : G.filterState) != null && Z.length ? "calc(100vh - 370px)" : "calc(100vh - 315px)"
|
1183
|
+
}),
|
1184
|
+
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"
|
1185
|
+
}, [
|
1186
|
+
l("div", Pr, [
|
1187
|
+
o.isNoData ? (s(), x(ae, { key: 1 })) : (s(), i("table", qr, [
|
1188
|
+
l("thead", Br, [
|
1189
|
+
l("tr", Lr, [
|
1190
|
+
(s(!0), i(C, null, T(o.columns, (f) => (s(), x(D, {
|
1191
|
+
key: f.name,
|
1192
|
+
style: re({
|
1193
|
+
width: o.rowWidth(f == null ? void 0 : f.name)
|
1194
|
+
}),
|
1195
|
+
data: f,
|
1196
|
+
activeColumn: n.activeColumn,
|
1197
|
+
onChangeActive: o.changeActiveColumn
|
1198
|
+
}, null, 8, ["style", "data", "activeColumn", "onChangeActive"]))), 128)),
|
1199
|
+
e[6] || (e[6] = l("th", { class: "w-[70px] sticky right-0 top-0 bg-white" }, null, -1))
|
1200
|
+
])
|
1201
|
+
]),
|
1202
|
+
l("tbody", Ur, [
|
1203
|
+
(s(!0), i(C, null, T((J = n.tableData) == null ? void 0 : J.rows, (f, de) => {
|
1204
|
+
var Q, X, Y;
|
1205
|
+
return s(), i("tr", { key: de }, [
|
1206
|
+
l("td", Or, [
|
1207
|
+
l("button", {
|
1208
|
+
onClick: () => o.pushToCard(f == null ? void 0 : f.id),
|
1209
|
+
class: S(["text-sm font-medium", [
|
1210
|
+
((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"
|
1211
|
+
]])
|
1212
|
+
}, [
|
1213
|
+
b(M, {
|
1214
|
+
row: f,
|
1215
|
+
column: o.columns[0],
|
1216
|
+
table: r.table,
|
1217
|
+
onUpdateTable: o.getTableData
|
1218
|
+
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1219
|
+
], 10, Er)
|
1220
|
+
]),
|
1221
|
+
(s(!0), i(C, null, T((X = o.columns) == null ? void 0 : X.slice(1), (ee) => (s(), i("td", {
|
1222
|
+
onClick: (Qr) => o.changeActiveCardInfo(f == null ? void 0 : f.id),
|
1223
|
+
class: S(["text-start px-3 py-3 text-sm text-gray-600 whitespace-nowrap", { "cursor-pointer": n.isVisibleCardInfo }]),
|
1224
|
+
key: ee.name
|
1225
|
+
}, [
|
1226
|
+
b(M, {
|
1227
|
+
row: f,
|
1228
|
+
column: ee,
|
1229
|
+
table: r.table,
|
1230
|
+
onUpdateTable: o.getTableData
|
1231
|
+
}, null, 8, ["row", "column", "table", "onUpdateTable"])
|
1232
|
+
], 10, Nr))), 128)),
|
1233
|
+
(Y = o.getActions) != null && Y.length ? (s(), i("td", Hr, [
|
1234
|
+
b(oe, {
|
1235
|
+
actions: o.getActions,
|
1236
|
+
isForm: o.isForm,
|
1237
|
+
item: f,
|
1238
|
+
table: r.table,
|
1239
|
+
onUpdateTable: o.getTableData
|
1240
|
+
}, null, 8, ["actions", "isForm", "item", "table", "onUpdateTable"])
|
1241
|
+
])) : v("", !0)
|
1242
|
+
]);
|
1243
|
+
}), 128))
|
1244
|
+
])
|
1245
|
+
]))
|
1246
|
+
])
|
1247
|
+
], 4)
|
1248
|
+
], 2),
|
1249
|
+
l("div", Wr, [
|
1250
|
+
n.limit ? (s(), x(ie, {
|
1251
|
+
key: 0,
|
1252
|
+
goTo: !1,
|
1253
|
+
class: "justify-end",
|
1254
|
+
"default-page": o.defaultPage,
|
1255
|
+
total: ((K = n.tableData) == null ? void 0 : K.total) || 0,
|
1256
|
+
pageSize: parseInt(n.limit),
|
1257
|
+
onPageChange: o.handlePageChange,
|
1258
|
+
pageSizes: [10, 16, 20],
|
1259
|
+
onPageSizeChange: o.changeLimit
|
1260
|
+
}, null, 8, ["default-page", "total", "pageSize", "onPageChange", "onPageSizeChange"])) : v("", !0)
|
1261
|
+
])
|
1262
|
+
], 2),
|
1263
|
+
b(P, { name: "slide-fade" }, {
|
1264
|
+
default: y(() => [
|
1265
|
+
n.isVisibleCardInfo ? (s(), x(ce, {
|
1266
|
+
key: 0,
|
1267
|
+
table: r.table,
|
1268
|
+
columns: o.columns,
|
1269
|
+
row: o.activeCardRow
|
1270
|
+
}, null, 8, ["table", "columns", "row"])) : v("", !0)
|
1271
|
+
]),
|
1272
|
+
_: 1
|
1273
|
+
})
|
1274
|
+
])
|
1275
|
+
])
|
1276
|
+
])
|
1277
|
+
]);
|
1278
|
+
}
|
1279
|
+
const Gr = /* @__PURE__ */ m(Sr, [["render", Rr], ["__scopeId", "data-v-9b255a47"]]), Zr = {
|
1280
|
+
components: { AdminTable: Gr },
|
1281
|
+
data() {
|
1282
|
+
return {
|
1283
|
+
table: !1,
|
1284
|
+
interface: "",
|
1285
|
+
title: ""
|
1286
|
+
};
|
1287
|
+
},
|
1288
|
+
watch: {
|
1289
|
+
$route: {
|
1290
|
+
async handler() {
|
1291
|
+
var t;
|
1292
|
+
(t = te) != null && t.value || await this.getMenu(), await this.checkPageType();
|
1293
|
+
},
|
1294
|
+
deep: !0
|
1295
|
+
},
|
1296
|
+
title(t) {
|
1297
|
+
t && (document.title = t);
|
1298
|
+
}
|
1299
|
+
},
|
1300
|
+
async mounted() {
|
1301
|
+
await this.checkPageType();
|
1302
|
+
},
|
1303
|
+
methods: {
|
1304
|
+
flattenMenu(t) {
|
1305
|
+
const e = [];
|
1306
|
+
return t.forEach((r) => {
|
1307
|
+
r.menu ? e.push(...this.flattenMenu(r.menu)) : e.push(r);
|
1308
|
+
}), e;
|
1309
|
+
},
|
1310
|
+
async checkPageType() {
|
1311
|
+
var a, n;
|
1312
|
+
const t = this.flattenMenu(te.value);
|
1313
|
+
t != null && t.length || this.$router.replace("/404");
|
1314
|
+
const e = t == null ? void 0 : t.find((o) => {
|
1315
|
+
var d, p;
|
1316
|
+
return (o == null ? void 0 : o.path) == ((p = (d = this.$route) == null ? void 0 : d.params) == null ? void 0 : p.catchAll);
|
1317
|
+
});
|
1318
|
+
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);
|
1319
|
+
const r = e == null ? void 0 : e.table;
|
1320
|
+
this.table = r || !1, !r && this.getInterface();
|
1321
|
+
},
|
1322
|
+
async getInterface() {
|
1323
|
+
var t, e;
|
1324
|
+
try {
|
1325
|
+
const { data: r } = await A.get(
|
1326
|
+
`/api/template/interface/${((e = (t = this.$route) == null ? void 0 : t.params) == null ? void 0 : e.catchAll) || ""}`
|
1327
|
+
);
|
1328
|
+
this.interface = r || "";
|
1329
|
+
} catch {
|
1330
|
+
this.interface = "";
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
}
|
1334
|
+
}, Jr = ["innerHTML"];
|
1335
|
+
function Kr(t, e, r, a, n, o) {
|
1336
|
+
const d = c("AdminTable");
|
1337
|
+
return n.table ? (s(), x(d, {
|
1338
|
+
key: 0,
|
1339
|
+
table: n.table,
|
1340
|
+
title: n.title
|
1341
|
+
}, null, 8, ["table", "title"])) : (s(), i("div", {
|
1342
|
+
key: 1,
|
1343
|
+
class: "w-full bg-gray-50",
|
1344
|
+
style: { height: "calc(100vh - 120px)" },
|
1345
|
+
innerHTML: n.interface
|
1346
|
+
}, null, 8, Jr));
|
1347
|
+
}
|
1348
|
+
const en = /* @__PURE__ */ m(Zr, [["render", Kr]]);
|
1349
|
+
export {
|
1350
|
+
en as default
|
1351
|
+
};
|