@opengis/admin 0.1.68 → 0.1.69

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-DGI0k9si.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
+ };
@@ -1,6 +1,6 @@
1
- import { _ as g, b as pe, a as V, c as be, d as fe, e as me, f as ge, I as xe, u as ne } from "./import-file-DGI0k9si.js";
1
+ import { _ as g, b as pe, a as T, c as be, d as fe, e as me, f as ge, I as xe, u as ne } from "./import-file-z-nSvLVJ.js";
2
2
  import { openBlock as s, createElementBlock as a, createTextVNode as D, toDisplayString as $, createCommentVNode as w, createStaticVNode as j, Fragment as C, createElementVNode as l, resolveComponent as d, createVNode as f, withCtx as v, createBlock as k, withModifiers as ye, renderList as I, normalizeClass as A, withDirectives as q, vModelCheckbox as _e, resolveDynamicComponent as ke, Transition as z, renderSlot as ve, vShow as se, normalizeStyle as le } from "vue";
3
- import { I as we } from "./IconChevronDown-Co0qOLyQ.js";
3
+ import { I as we } from "./IconChevronDown-D29D5cN_.js";
4
4
  const Ce = {
5
5
  data() {
6
6
  return {
@@ -170,7 +170,7 @@ const Ue = /* @__PURE__ */ g(ze, [["render", Le]]), Oe = {
170
170
  async getData() {
171
171
  var t;
172
172
  try {
173
- const { data: e } = await V.get(
173
+ const { data: e } = await T.get(
174
174
  `/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`
175
175
  );
176
176
  this.formValue = e;
@@ -184,17 +184,22 @@ const Ue = /* @__PURE__ */ g(ze, [["render", Le]]), Oe = {
184
184
  async deleteElement() {
185
185
  var t;
186
186
  try {
187
- V.delete(`/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`), this.$notify({
187
+ const { data: e } = await T.get(
188
+ `/api/table/${this.table}/${(t = this.item) == null ? void 0 : t.id}`
189
+ );
190
+ await T.delete(`/api/table/${e == null ? void 0 : e.token}`), await this.$notify({
188
191
  title: "Успішно!",
189
192
  message: "Об`єкт успішно видалeно",
190
193
  type: "success"
191
- }), await this.$emit("update-table"), this.isDeleteConfirm = !1;
194
+ }), await this.$emit("update-table");
192
195
  } catch {
193
196
  this.$notify({
194
197
  title: "Помилка!",
195
198
  message: "Сталася помилка",
196
199
  type: "error"
197
200
  });
201
+ } finally {
202
+ this.isDeleteConfirm = !1;
198
203
  }
199
204
  }
200
205
  }
@@ -219,12 +224,12 @@ function Ze(t, e, r, i, n, o) {
219
224
  ])
220
225
  ]),
221
226
  default: v(() => {
222
- var x, S, y, T, F;
227
+ var x, S, y, V, F;
223
228
  return [
224
229
  l("div", He, [
225
230
  (x = r.actions) != null && x.includes("edit") && r.isForm ? (s(), k(p, {
226
231
  key: 0,
227
- to: `/edit?table=${(y = (S = t.$route) == null ? void 0 : S.params) == null ? void 0 : y.catchAll}&id=${(T = r.item) == null ? void 0 : T.id}`,
232
+ to: `/edit?table=${(y = (S = t.$route) == null ? void 0 : S.params) == null ? void 0 : y.catchAll}&id=${(V = r.item) == null ? void 0 : V.id}`,
228
233
  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"
229
234
  }, {
230
235
  default: v(() => [
@@ -251,6 +256,7 @@ function Ze(t, e, r, i, n, o) {
251
256
  f(c, {
252
257
  visible: n.isDeleteConfirm,
253
258
  "onUpdate:visible": e[3] || (e[3] = (x) => n.isDeleteConfirm = x),
259
+ size: "small",
254
260
  title: "Ви впевнені?"
255
261
  }, {
256
262
  default: v(() => [
@@ -369,7 +375,7 @@ const nt = /* @__PURE__ */ g(et, [["render", rt]]), lt = {
369
375
  return;
370
376
  }
371
377
  try {
372
- const e = await V.get("/api/export", {
378
+ const e = await T.get("/api/export", {
373
379
  params: {
374
380
  table: this.table,
375
381
  format: this.format,
@@ -790,11 +796,11 @@ function dr(t, e, r, i, n, o) {
790
796
  class: "border-b p-[10px] py-[16px]"
791
797
  }, {
792
798
  default: v(() => {
793
- var y, T;
799
+ var y, V;
794
800
  return [
795
801
  (y = r.row) != null && y.geom ? (s(), k(p, {
796
802
  key: 0,
797
- geometry: (T = r.row) == null ? void 0 : T.geom,
803
+ geometry: (V = r.row) == null ? void 0 : V.geom,
798
804
  zoom: 14
799
805
  }, null, 8, ["geometry"])) : (s(), k(h, {
800
806
  key: 1,
@@ -1153,12 +1159,12 @@ const Ur = /* @__PURE__ */ g(qr, [["render", Lr]]), Or = {
1153
1159
  }
1154
1160
  },
1155
1161
  unmountedData() {
1156
- this.page = 1, this.visibleColumns = [], this.filterCustom = null, this.filterState = null, this.isVisibleCardInfo = !1, this.filterScheme = null, this.filters = null, this.onFilters = 0;
1162
+ this.page = 1, this.visibleColumns = [], this.filterCustom = null, this.filterState = null, this.isVisibleCardInfo = !1, this.filterScheme = null, this.filters = null, this.onFilters = 0, this.searchValue = "";
1157
1163
  },
1158
1164
  async getTableData() {
1159
1165
  var t, e, r, i, n, o, u;
1160
1166
  try {
1161
- const { data: b } = await V.get(`/api/template/table/${this.table}`), p = await V.get(`/api/table-data/${this.table}`, {
1167
+ const { data: b } = await T.get(`/api/template/table/${this.table}`), p = await T.get(`/api/table-data/${this.table}`, {
1162
1168
  params: {
1163
1169
  page: this.page,
1164
1170
  search: this.searchValue || null,
@@ -1182,7 +1188,7 @@ const Ur = /* @__PURE__ */ g(qr, [["render", Lr]]), Or = {
1182
1188
  async getFilters() {
1183
1189
  var t;
1184
1190
  try {
1185
- const { data: e } = await V.get(`/api/table-filter/${this.table}`);
1191
+ const { data: e } = await T.get(`/api/table-filter/${this.table}`);
1186
1192
  this.filterScheme = (t = e == null ? void 0 : e.list) == null ? void 0 : t.map((r) => ({
1187
1193
  ...r,
1188
1194
  label: (r == null ? void 0 : r.label) || (r == null ? void 0 : r.ua)
@@ -1235,7 +1241,7 @@ const Ur = /* @__PURE__ */ g(qr, [["render", Lr]]), Or = {
1235
1241
  }, ln = { class: "p-[20px] flex justify-start items-center w-full" }, sn = { class: "w-[200px]" }, on = { class: "text-sm text-gray-600 dark:text-neutral-400" }, an = { class: "font-semibold text-gray-800 dark:text-neutral-200" }, cn = { class: "font-semibold text-gray-800 dark:text-neutral-200" };
1236
1242
  function un(t, e, r, i, n, o) {
1237
1243
  var B, P, L, U, O, E, N, H, W, R, G, Z, J, K, Q, X;
1238
- const u = d("IconPlus"), b = d("router-link"), p = d("AdminTableTabs"), h = d("IconSearch"), _ = d("VsText"), c = d("AdminTableCustomFilters"), x = d("AdminTableColumnsHidden"), S = d("AdminTableExport"), y = d("AdminTableFilters"), T = d("IconOpenCard"), F = d("AdminTableColumn"), M = d("AdminComponentIs"), ie = d("AdminTableControl"), ce = d("AdminNodata"), ue = d("VsPagination"), de = d("AdminTableCardInfo");
1244
+ const u = d("IconPlus"), b = d("router-link"), p = d("AdminTableTabs"), h = d("IconSearch"), _ = d("VsText"), c = d("AdminTableCustomFilters"), x = d("AdminTableColumnsHidden"), S = d("AdminTableExport"), y = d("AdminTableFilters"), V = d("IconOpenCard"), F = d("AdminTableColumn"), M = d("AdminComponentIs"), ie = d("AdminTableControl"), ce = d("AdminNodata"), ue = d("VsPagination"), de = d("AdminTableCardInfo");
1239
1245
  return s(), a("div", Er, [
1240
1246
  l("div", Nr, [
1241
1247
  l("h2", Hr, $(r.title), 1),
@@ -1309,7 +1315,7 @@ function un(t, e, r, i, n, o) {
1309
1315
  onClick: e[4] || (e[4] = (...m) => o.toggleCardInfo && o.toggleCardInfo(...m)),
1310
1316
  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"
1311
1317
  }, [
1312
- f(T, {
1318
+ f(V, {
1313
1319
  class: A({ "rotate-180 duration-300": !n.isVisibleCardInfo })
1314
1320
  }, null, 8, ["class"])
1315
1321
  ])
@@ -1425,7 +1431,7 @@ function un(t, e, r, i, n, o) {
1425
1431
  ])
1426
1432
  ]);
1427
1433
  }
1428
- const dn = /* @__PURE__ */ g(Or, [["render", un], ["__scopeId", "data-v-58248090"]]), hn = {
1434
+ const dn = /* @__PURE__ */ g(Or, [["render", un], ["__scopeId", "data-v-0f46a883"]]), hn = {
1429
1435
  components: { AdminTable: dn },
1430
1436
  data() {
1431
1437
  return {
@@ -1471,7 +1477,7 @@ const dn = /* @__PURE__ */ g(Or, [["render", un], ["__scopeId", "data-v-58248090
1471
1477
  async getInterface() {
1472
1478
  var t, e;
1473
1479
  try {
1474
- const { data: r } = await V.get(
1480
+ const { data: r } = await T.get(
1475
1481
  `/api/template/interface/${((e = (t = this.$route) == null ? void 0 : t.params) == null ? void 0 : e.catchAll) || ""}`
1476
1482
  );
1477
1483
  this.interface = r || "";
@@ -1,6 +1,6 @@
1
- import { _ as w, I as Q, u as B, V as F, a as O } from "./import-file-DGI0k9si.js";
1
+ import { _ as w, I as Q, u as B, V as F, a as O } from "./import-file-z-nSvLVJ.js";
2
2
  import { openBlock as s, createElementBlock as r, createElementVNode as t, createStaticVNode as R, resolveComponent as _, normalizeClass as E, createTextVNode as L, toDisplayString as V, createVNode as c, Transition as T, withCtx as M, withDirectives as q, Fragment as N, renderList as S, vShow as G, ref as D, createCommentVNode as H, getCurrentInstance as J, watch as K, onBeforeUnmount as W, createBlock as X, withModifiers as Y } from "vue";
3
- import { I as ee } from "./IconChevronDown-Co0qOLyQ.js";
3
+ import { I as ee } from "./IconChevronDown-D29D5cN_.js";
4
4
  const te = {}, oe = {
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  viewBox: "0 0 24 24",
package/dist/admin.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as f } from "./import-file-DGI0k9si.js";
1
+ import { i as f } from "./import-file-z-nSvLVJ.js";
2
2
  export {
3
3
  f as default
4
4
  };