@opengis/admin 0.2.133 → 0.2.135

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,78 @@
1
+ import { _ as n, f as m } from "./import-file-D-sIzmab.js";
2
+ import { u as p } from "./user-B_2kh6ic.js";
3
+ import { resolveComponent as d, openBlock as u, createElementBlock as f, createElementVNode as o, createBlock as h, createCommentVNode as b } from "vue";
4
+ const x = {
5
+ data() {
6
+ return {
7
+ formScheme: null,
8
+ formValues: {}
9
+ };
10
+ },
11
+ mounted() {
12
+ this.getFormScheme();
13
+ },
14
+ computed: {
15
+ userData() {
16
+ return p.value;
17
+ }
18
+ },
19
+ methods: {
20
+ async updateUser() {
21
+ var r;
22
+ try {
23
+ await m.put(`/user/${(r = this.userData.user) == null ? void 0 : r.uid}`, this.formValues), await this.$notify({
24
+ title: "Успішно!",
25
+ message: "Дані успішно оновлені",
26
+ type: "success"
27
+ });
28
+ } catch {
29
+ this.$notify({
30
+ title: "Помилка!",
31
+ message: "Сталася помилка",
32
+ type: "error"
33
+ });
34
+ }
35
+ },
36
+ async getFormScheme() {
37
+ var r, t, a, l;
38
+ try {
39
+ const { data: e } = await m.get(
40
+ "/api/template/form/admin.profile.form"
41
+ );
42
+ console.log(this.userData);
43
+ for (const s in e == null ? void 0 : e.schema)
44
+ (t = (r = this.userData) == null ? void 0 : r.user) != null && t[s] && (this.formValues[s] = (l = (a = this.userData) == null ? void 0 : a.user) == null ? void 0 : l[s]);
45
+ this.formScheme = e.schema;
46
+ } catch (e) {
47
+ console.error(e);
48
+ }
49
+ }
50
+ }
51
+ }, g = { class: "flex justify-center pt-[20px] pb-[20px] pl-[20px] h-[calc(100vh-58px)]" }, k = { class: "bg-white rounded-xl border p-[20px]" }, y = { class: "flex-1 overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-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" }, w = { class: "flex" };
52
+ function _(r, t, a, l, e, s) {
53
+ const i = d("VsForm");
54
+ return u(), f("div", g, [
55
+ o("div", k, [
56
+ t[2] || (t[2] = o("h2", { class: "mb-[20px] text-center" }, "Профіль", -1)),
57
+ o("div", y, [
58
+ e.formScheme ? (u(), h(i, {
59
+ key: 0,
60
+ scheme: e.formScheme,
61
+ modelValue: e.formValues,
62
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => e.formValues = c),
63
+ class: "pb-0"
64
+ }, null, 8, ["scheme", "modelValue"])) : b("", !0),
65
+ o("div", w, [
66
+ o("button", {
67
+ onClick: t[1] || (t[1] = (...c) => s.updateUser && s.updateUser(...c)),
68
+ class: "ml-auto text-[18px] bg-blue-500 text-white px-[8px] py-[4px] rounded hover:bg-blue-700 duration-300"
69
+ }, " Зберегти ")
70
+ ])
71
+ ])
72
+ ])
73
+ ]);
74
+ }
75
+ const D = /* @__PURE__ */ n(x, [["render", _]]);
76
+ export {
77
+ D as default
78
+ };