@opengis/admin 0.1.68 → 0.1.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { g as V, h as z, _ as A, u as L, a as q } from "./import-file-DGI0k9si.js";
1
+ import { g as V, h as z, _ as A, u as L, a as q } from "./import-file-z-nSvLVJ.js";
2
2
  import { computed as B, resolveComponent as R, openBlock as r, createElementBlock as s, createElementVNode as u, toDisplayString as M, createVNode as N, withCtx as E, createTextVNode as S, createBlock as H, createCommentVNode as b, normalizeClass as j, Fragment as w, renderList as C, resolveDynamicComponent as T } from "vue";
3
3
  const G = { class: "h-[76px] bg-white border rounded-xl flex items-center justify-between px-[20px] mb-[16px]" }, O = { class: "text-lg font-semibold md:text-xl text-stone-800 dark:text-neutral-200" }, F = { class: "flex items-center gap-[6px]" }, I = {
4
4
  __name: "admin-card-header",
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as e, openBlock as r, createBlock as t } from "vue";
2
- import { _ as c } from "./import-file-DGI0k9si.js";
2
+ import { _ as c } from "./import-file-z-nSvLVJ.js";
3
3
  const n = {};
4
4
  function s(_, p, a, i, f, m) {
5
5
  const o = e("router-view");
@@ -0,0 +1,101 @@
1
+ import { _ as m, u as b, a as i } from "./import-file-z-nSvLVJ.js";
2
+ import { resolveComponent as d, openBlock as u, createElementBlock as h, createElementVNode as n, createBlock as p, createCommentVNode as f } from "vue";
3
+ const g = {
4
+ data() {
5
+ return {
6
+ formValues: {},
7
+ scheme: null,
8
+ table: "",
9
+ token: ""
10
+ };
11
+ },
12
+ mounted() {
13
+ this.getFormScheme();
14
+ },
15
+ methods: {
16
+ flattenMenu(t) {
17
+ const e = [];
18
+ return t.forEach((a) => {
19
+ a.menu ? e.push(...this.flattenMenu(a.menu)) : e.push(a);
20
+ }), e;
21
+ },
22
+ async getFormScheme() {
23
+ var c, l;
24
+ const t = this.flattenMenu(b.value);
25
+ t != null && t.length || this.$router.replace("/404");
26
+ const e = t == null ? void 0 : t.find((o) => {
27
+ var s, r;
28
+ return (o == null ? void 0 : o.path) == ((r = (s = this.$route) == null ? void 0 : s.query) == null ? void 0 : r.table);
29
+ });
30
+ e || this.$router.replace("/404");
31
+ const a = e == null ? void 0 : e.table;
32
+ this.table = a;
33
+ try {
34
+ const {
35
+ data: { form: o }
36
+ } = await i.get(`/api/template/table/${a}`), { data: s } = await i.get(
37
+ `/api/table/${this.table}/${(l = (c = this.$route) == null ? void 0 : c.query) == null ? void 0 : l.id}`
38
+ );
39
+ this.token = (s == null ? void 0 : s.token) || "", this.formValues = s || {};
40
+ const { data: r } = await i.get(`/api/template/form/${o}`);
41
+ this.scheme = (r == null ? void 0 : r.schema) || r;
42
+ } catch {
43
+ }
44
+ },
45
+ async editObject() {
46
+ try {
47
+ await this.$refs.form.doValidation(), await i.put(`/api/table/${this.token}`, this.formValues), await this.$router.back(), await this.$notify({
48
+ title: "Успішно!",
49
+ message: "Об'єкт успішно створено",
50
+ type: "success"
51
+ });
52
+ } catch {
53
+ this.$notify({
54
+ title: "Помилка!",
55
+ message: "Сталася помилка",
56
+ type: "error"
57
+ });
58
+ }
59
+ }
60
+ }
61
+ }, x = {
62
+ style: { width: "calc(100vw - 260px)" },
63
+ class: "bg-gray-50"
64
+ }, w = { class: "h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl" }, y = { class: "flex items-center gap-[6px]" }, k = {
65
+ style: { height: "calc(100vh - 155px)", width: "calc(100vw - 260px)" },
66
+ class: "bg-gray-50 p-[20px] flex"
67
+ }, v = { class: "bg-white w-full rounded-xl border p-[20px] 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" };
68
+ function V(t, e, a, c, l, o) {
69
+ const s = d("VsForm");
70
+ return u(), h("div", x, [
71
+ n("div", w, [
72
+ e[3] || (e[3] = n("h2", { class: "text-xl font-medium" }, "Редагувати", -1)),
73
+ n("div", y, [
74
+ n("button", {
75
+ onClick: e[0] || (e[0] = (r) => t.$router.back()),
76
+ class: "flex items-center px-3 py-2 text-sm font-medium text-gray-800 duration-300 bg-white border border-gray-100 rounded-lg shadow gap-x-2 focus:outline-none hover:bg-gray-50 hover:border-gray-100"
77
+ }, " Скасувати "),
78
+ n("button", {
79
+ onClick: e[1] || (e[1] = (...r) => o.editObject && o.editObject(...r)),
80
+ 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"
81
+ }, " Зберегти ")
82
+ ])
83
+ ]),
84
+ n("div", k, [
85
+ n("div", v, [
86
+ l.scheme ? (u(), p(s, {
87
+ key: 0,
88
+ ref: "form",
89
+ scheme: l.scheme,
90
+ modelValue: l.formValues,
91
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => l.formValues = r),
92
+ class: "p-0 mt-[20px]"
93
+ }, null, 8, ["scheme", "modelValue"])) : f("", !0)
94
+ ])
95
+ ])
96
+ ]);
97
+ }
98
+ const j = /* @__PURE__ */ m(g, [["render", V]]);
99
+ export {
100
+ j as default
101
+ };