@opengis/admin 0.1.92 → 0.1.93

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as t, createElementVNode as n } from "vue";
2
- import { _ as r } from "./import-file-Cobra4kl.js";
2
+ import { _ as r } from "./import-file-d3YrkRd6.js";
3
3
  const l = {}, s = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
5
  viewBox: "0 0 24 24",
@@ -1,6 +1,6 @@
1
- import { _ as d, u as h, c as i } from "./import-file-Cobra4kl.js";
2
- import { resolveComponent as p, openBlock as m, createElementBlock as g, createElementVNode as n, createBlock as f, createCommentVNode as x } from "vue";
3
- const w = {
1
+ import { _ as g, u as f, c as u } from "./import-file-d3YrkRd6.js";
2
+ import { resolveComponent as x, openBlock as b, createElementBlock as w, createElementVNode as n, createBlock as k, createCommentVNode as y } from "vue";
3
+ const v = {
4
4
  data() {
5
5
  return {
6
6
  formValues: {},
@@ -15,61 +15,62 @@ const w = {
15
15
  methods: {
16
16
  flattenMenu(t) {
17
17
  const e = [];
18
- return t.forEach((s) => {
19
- s.menu ? e.push(...this.flattenMenu(s.menu)) : e.push(s);
18
+ return t.forEach((o) => {
19
+ o.menu ? e.push(...this.flattenMenu(o.menu)) : e.push(o);
20
20
  }), e;
21
21
  },
22
22
  async getFormScheme() {
23
23
  var c, a;
24
- const t = this.flattenMenu(h.value);
24
+ const t = this.flattenMenu(f.value);
25
25
  t != null && t.length || this.$router.replace("/404");
26
26
  const e = t == null ? void 0 : t.find((r) => {
27
- var o, l;
28
- return (r == null ? void 0 : r.path) == ((l = (o = this.$route) == null ? void 0 : o.query) == null ? void 0 : l.table);
27
+ var s, l;
28
+ return (r == null ? void 0 : r.path) == ((l = (s = this.$route) == null ? void 0 : s.query) == null ? void 0 : l.table);
29
29
  });
30
30
  e || this.$router.replace("/404");
31
- const s = e == null ? void 0 : e.table;
32
- this.table = s;
31
+ const o = e == null ? void 0 : e.table;
32
+ this.table = o;
33
33
  try {
34
- const r = await i.get(`/api/table-data/${s}`), { data: o } = await i.get(
34
+ const r = await u.get(`/api/table-data/${o}`), { data: s } = await u.get(
35
35
  `/api/template/form/${(c = r == null ? void 0 : r.data) == null ? void 0 : c.form}`
36
36
  );
37
- this.scheme = (o == null ? void 0 : o.schema) || o, this.token = (a = r == null ? void 0 : r.data) == null ? void 0 : a.addToken;
37
+ this.scheme = (s == null ? void 0 : s.schema) || s, this.token = (a = r == null ? void 0 : r.data) == null ? void 0 : a.addToken;
38
38
  } catch {
39
39
  }
40
40
  },
41
41
  async createObject() {
42
- var e, s, c, a, r, o, l, u;
42
+ var e, o, c, a, r, s, l, m, d;
43
43
  const t = this.$refs.form;
44
44
  try {
45
- await t.doValidation(), await i.post(`/api/table/${this.token}`, this.formValues), await this.$router.back(), await this.$notify({
45
+ await t.doValidation(), await u.post(`/api/table/${this.token}`, this.formValues), await this.$router.back(), await this.$notify({
46
46
  title: "Успішно!",
47
47
  message: "Об'єкт успішно створено",
48
48
  type: "success"
49
49
  });
50
- } catch {
51
- let b = ((a = (c = (s = (e = Object.entries(t == null ? void 0 : t.formErrors)) == null ? void 0 : e[0]) == null ? void 0 : s[1]) == null ? void 0 : c[0]) == null ? void 0 : a.message) === "Це поле обов'язкове" ? "Заповніть обов'язкові поля" : (u = (l = (o = (r = Object.entries(t == null ? void 0 : t.formErrors)) == null ? void 0 : r[0]) == null ? void 0 : o[1]) == null ? void 0 : l[0]) == null ? void 0 : u.message;
50
+ } catch (i) {
51
+ const h = ((e = i == null ? void 0 : i.response) == null ? void 0 : e.data) || "";
52
+ let p = ((r = (a = (c = (o = Object.entries(t == null ? void 0 : t.formErrors)) == null ? void 0 : o[0]) == null ? void 0 : c[1]) == null ? void 0 : a[0]) == null ? void 0 : r.message) === "Це поле обов'язкове" ? "Заповніть обов'язкові поля" : (d = (m = (l = (s = Object.entries(t == null ? void 0 : t.formErrors)) == null ? void 0 : s[0]) == null ? void 0 : l[1]) == null ? void 0 : m[0]) == null ? void 0 : d.message;
52
53
  this.$notify({
53
54
  title: "Помилка!",
54
- message: b || "Сталася помилка валідаціі",
55
+ message: h || p || "Сталася помилка валідаціі",
55
56
  type: "error"
56
57
  });
57
58
  }
58
59
  }
59
60
  }
60
- }, k = {
61
+ }, V = {
61
62
  style: { width: "calc(100vw - 260px)" },
62
63
  class: "bg-gray-50"
63
- }, y = { class: "h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl" }, v = { class: "flex items-center gap-[6px]" }, V = {
64
+ }, _ = { class: "h-[76px] mt-[15px] flex items-center justify-between mx-[20px] px-[20px] bg-white border rounded-xl" }, $ = { class: "flex items-center gap-[6px]" }, j = {
64
65
  style: { height: "calc(100vh - 165px)", width: "calc(100vw - 260px)" },
65
66
  class: "bg-gray-50 p-[20px] flex"
66
- }, _ = { 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" };
67
- function $(t, e, s, c, a, r) {
68
- const o = p("VsForm");
69
- return m(), g("div", k, [
70
- n("div", y, [
67
+ }, E = { 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 O(t, e, o, c, a, r) {
69
+ const s = x("VsForm");
70
+ return b(), w("div", V, [
71
+ n("div", _, [
71
72
  e[3] || (e[3] = n("h2", { class: "text-xl font-medium" }, "Створити", -1)),
72
- n("div", v, [
73
+ n("div", $, [
73
74
  n("button", {
74
75
  onClick: e[0] || (e[0] = (l) => t.$router.back()),
75
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"
@@ -80,21 +81,21 @@ function $(t, e, s, c, a, r) {
80
81
  }, " Зберегти ")
81
82
  ])
82
83
  ]),
83
- n("div", V, [
84
- n("div", _, [
85
- a.scheme ? (m(), f(o, {
84
+ n("div", j, [
85
+ n("div", E, [
86
+ a.scheme ? (b(), k(s, {
86
87
  key: 0,
87
88
  ref: "form",
88
89
  scheme: a.scheme,
89
90
  modelValue: a.formValues,
90
91
  "onUpdate:modelValue": e[2] || (e[2] = (l) => a.formValues = l),
91
92
  class: "p-0 mt-[20px]"
92
- }, null, 8, ["scheme", "modelValue"])) : x("", !0)
93
+ }, null, 8, ["scheme", "modelValue"])) : y("", !0)
93
94
  ])
94
95
  ])
95
96
  ]);
96
97
  }
97
- const C = /* @__PURE__ */ d(w, [["render", $]]);
98
+ const M = /* @__PURE__ */ g(v, [["render", O]]);
98
99
  export {
99
- C as default
100
+ M as default
100
101
  };