@opengis/admin 0.1.67 → 0.1.69

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/dist/{IconChevronDown-DN0s3TF_.js → IconChevronDown-D29D5cN_.js} +1 -1
  2. package/dist/add-page-w-DxgCiS.js +97 -0
  3. package/dist/{admin-interface-DUuz9KgB.js → admin-interface-DA_PeVj7.js} +265 -240
  4. package/dist/{admin-view-MSa57inW.js → admin-view-DrOVwYHu.js} +198 -188
  5. package/dist/admin.js +1 -1
  6. package/dist/admin.umd.cjs +48 -48
  7. package/dist/{card-page-B1zuuqAR.js → card-page-Pw97vvNR.js} +19 -19
  8. package/dist/{card-view-Bzt2AvI2.js → card-view-eMucbOjz.js} +1 -1
  9. package/dist/edit-page-DqEf35J2.js +101 -0
  10. package/dist/{import-file-B80Ws8by.js → import-file-z-nSvLVJ.js} +255 -244
  11. package/dist/style.css +1 -1
  12. package/package.json +5 -5
  13. package/server/plugins/hook.js +11 -44
  14. package/server/routes/calendar/index.mjs +2 -12
  15. package/server/routes/calendar/schema.js +22 -0
  16. package/server/routes/data/controllers/tableData.js +5 -107
  17. package/server/routes/data/index.mjs +4 -4
  18. package/server/routes/data/schema.js +49 -2
  19. package/server/routes/menu/controllers/getMenu.js +3 -1
  20. package/server/routes/menu/schema.js +0 -0
  21. package/server/routes/notifications/controllers/readNotifications.js +7 -14
  22. package/server/routes/notifications/controllers/userNotifications.js +15 -22
  23. package/server/routes/notifications/index.mjs +5 -30
  24. package/server/routes/notifications/schema.js +11 -0
  25. package/server/routes/properties/index.mjs +6 -18
  26. package/server/routes/properties/schema.js +11 -0
  27. package/server/routes/templates/scheme.js +9 -0
  28. package/dist/add-page-Cm4aSGoA.js +0 -92
  29. package/dist/edit-page-DoY4S7v6.js +0 -103
@@ -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-B80Ws8by.js";
2
+ import { _ as r } from "./import-file-z-nSvLVJ.js";
3
3
  const l = {}, s = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
5
  viewBox: "0 0 24 24",
@@ -0,0 +1,97 @@
1
+ import { _ as m, u as d, a as i } from "./import-file-z-nSvLVJ.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 = {
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(r) {
17
+ const e = [];
18
+ return r.forEach((s) => {
19
+ s.menu ? e.push(...this.flattenMenu(s.menu)) : e.push(s);
20
+ }), e;
21
+ },
22
+ async getFormScheme() {
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) => {
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);
29
+ });
30
+ e || this.$router.replace("/404");
31
+ const s = e == null ? void 0 : e.table;
32
+ this.table = s;
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}`
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;
38
+ } catch {
39
+ }
40
+ },
41
+ async createObject() {
42
+ try {
43
+ await this.$refs.form.doValidation(), await i.post(`/api/table/${this.token}`, this.formValues), await this.$router.back(), await this.$notify({
44
+ title: "Успішно!",
45
+ message: "Об'єкт успішно створено",
46
+ type: "success"
47
+ });
48
+ } catch {
49
+ this.$notify({
50
+ title: "Помилка!",
51
+ message: "Сталася помилка",
52
+ type: "error"
53
+ });
54
+ }
55
+ }
56
+ }
57
+ }, g = {
58
+ style: { width: "calc(100vw - 260px)" },
59
+ 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 = {
61
+ style: { height: "calc(100vh - 165px)", width: "calc(100vw - 260px)" },
62
+ 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, [
68
+ e[3] || (e[3] = n("h2", { class: "text-xl font-medium" }, "Створити", -1)),
69
+ n("div", k, [
70
+ n("button", {
71
+ onClick: e[0] || (e[0] = (l) => r.$router.back()),
72
+ 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
+ }, " Скасувати "),
74
+ n("button", {
75
+ onClick: e[1] || (e[1] = (...l) => t.createObject && t.createObject(...l)),
76
+ 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
+ }, " Зберегти ")
78
+ ])
79
+ ]),
80
+ n("div", y, [
81
+ n("div", v, [
82
+ a.scheme ? (u(), p(o, {
83
+ key: 0,
84
+ ref: "form",
85
+ scheme: a.scheme,
86
+ modelValue: a.formValues,
87
+ "onUpdate:modelValue": e[2] || (e[2] = (l) => a.formValues = l),
88
+ class: "p-0 mt-[20px]"
89
+ }, null, 8, ["scheme", "modelValue"])) : f("", !0)
90
+ ])
91
+ ])
92
+ ]);
93
+ }
94
+ const j = /* @__PURE__ */ m(x, [["render", V]]);
95
+ export {
96
+ j as default
97
+ };