@opengis/admin 0.1.74 → 0.1.75

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