@ozdao/prometheus-framework 0.0.87 → 0.0.89
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs +1944 -0
- package/dist/ButtonFollow-001c4a65.mjs +130 -0
- package/dist/ButtonFollow-48043cc7.js +1 -0
- package/dist/CardHeader-0677d446.js +1 -0
- package/dist/CardHeader-e361dada.mjs +96 -0
- package/dist/CardOrganization-51309400.js +1 -0
- package/dist/CardOrganization-bacc2ef6.mjs +202 -0
- package/dist/Feed-4b28adc5.mjs +423 -0
- package/dist/Feed-51e4e232.js +1 -0
- package/dist/Feed-5d8d5c21.js +1 -0
- package/dist/Feed-76b2997e.mjs +367 -0
- package/dist/Feed-dc8b66bf.mjs +367 -0
- package/dist/Feed-eeb63363.js +1 -0
- package/dist/IconEdit-3028a3b7.js +1 -0
- package/dist/IconEdit-8df23653.mjs +205 -0
- package/dist/Image-30f04604.js +9 -0
- package/dist/Image-6c7584f5.mjs +477 -0
- package/dist/Image-6ec294f3.mjs +477 -0
- package/dist/Image-9a870c88.js +9 -0
- package/dist/PlaceholderUserpic-10fd9026.js +1 -0
- package/dist/PlaceholderUserpic-eb9820ce.mjs +28 -0
- package/dist/Popup-7c331e1c.js +1 -0
- package/dist/Popup-bdf043ba.mjs +76 -0
- package/dist/Product-1724d88d.mjs +837 -0
- package/dist/Product-a94d8b65.js +7 -0
- package/dist/Product-b233e2a3.js +7 -0
- package/dist/Product-eb00f35e.mjs +837 -0
- package/dist/ProductEdit-57484f1e.mjs +349 -0
- package/dist/ProductEdit-61413d02.mjs +349 -0
- package/dist/ProductEdit-ef301baa.js +1 -0
- package/dist/ProductEdit-fca68ff9.js +1 -0
- package/dist/ProfileBlogposts-6704a38c.js +1 -0
- package/dist/ProfileBlogposts-775b1cfa.mjs +63 -0
- package/dist/ProfileComments-175e42da.js +1 -0
- package/dist/ProfileComments-fd7d66bf.mjs +43 -0
- package/dist/ProfileEvents-1cfe6858.mjs +55 -0
- package/dist/ProfileEvents-4f2a5f00.js +1 -0
- package/dist/ProfileEvents-7a51a9e6.mjs +55 -0
- package/dist/ProfileEvents-d8e16509.js +1 -0
- package/dist/ProfileLikes-20a8a3c9.mjs +43 -0
- package/dist/ProfileLikes-b3b1350a.js +1 -0
- package/dist/ProfileOrganizations-4b866823.mjs +211 -0
- package/dist/ProfileOrganizations-6d3a43e4.js +1 -0
- package/dist/Publics-0e44c61e.mjs +122 -0
- package/dist/Publics-4e1c14fc.js +1 -0
- package/dist/Tab-a243605d.mjs +46 -0
- package/dist/UploadImage-6e312c46.mjs +83 -0
- package/dist/UploadImage-9e7e7468.js +1 -0
- package/dist/auth-2bc18d1e.js +8 -0
- package/dist/auth-fefd15a3.mjs +1503 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +5 -5
- package/dist/auth.validation-4a617c0b.mjs +20 -0
- package/dist/auth.validation-78a90fed.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +206 -222
- package/dist/components/Field/Field.vue.d.ts.map +1 -1
- package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
- package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +332 -312
- package/dist/events.server.js +77 -0
- package/dist/events.server.mjs +77 -0
- package/dist/inputs.validation-14e8e01f.mjs +93 -0
- package/dist/main.css +1 -1
- package/dist/organizations-1581c013.mjs +121 -0
- package/dist/organizations-c455dad7.js +1 -0
- package/dist/organizations.client-040ec107.js +3 -0
- package/dist/organizations.client-686845be.mjs +3179 -0
- package/dist/organizations.client-7937e180.mjs +3037 -0
- package/dist/organizations.client-99bfc474.js +3 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +39 -39
- package/dist/organizations.server.js +7 -3
- package/dist/organizations.server.mjs +7 -3
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +3 -2
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +265 -256
- package/dist/users.server.js +2 -2
- package/dist/users.server.mjs +2 -2
- package/package.json +1 -1
- package/src/components/Field/Field.vue +2 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +2 -1
- package/src/modules/events/components/blocks/CardEvent.vue +1 -1
- package/src/modules/events/components/pages/EditEvent.vue +9 -3
- package/src/modules/events/components/pages/Event.vue +43 -4
- package/src/modules/events/middlewares/server/index.js +10 -0
- package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
- package/src/modules/events/routes/events.routes.js +14 -1
- package/src/modules/organizations/components/blocks/Socials.vue +16 -3
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +39 -15
- package/src/modules/organizations/components/sections/DetailsTab.vue +13 -9
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/organization.model.js +6 -2
- package/src/modules/organizations/store/organizations.js +2 -2
- package/src/modules/users/components/pages/Profile.vue +26 -11
- package/src/modules/users/components/pages/ProfileEdit.vue +28 -10
- package/src/modules/users/models/user.model.js +2 -2
- package/src/modules/users/store/users.js +1 -2
@@ -0,0 +1,349 @@
|
|
1
|
+
import { toRefs as A, openBlock as n, createElementBlock as c, createTextVNode as C, toDisplayString as w, unref as s, createVNode as d, createElementVNode as e, createCommentVNode as k, createBlock as E, withCtx as N, Fragment as P, renderList as z, ref as U, withModifiers as B, withAsyncContext as D } from "vue";
|
2
|
+
import { useRoute as M, useRouter as R } from "vue-router";
|
3
|
+
import { s as r, a as V, b as $, _ as F, c as T } from "./organizations.client-686845be.mjs";
|
4
|
+
import "./inputs.validation-6960f71b.mjs";
|
5
|
+
import { F as v, b as L, a as j } from "./auth-35ef1791.mjs";
|
6
|
+
import { C as O } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs";
|
7
|
+
import "vue-i18n";
|
8
|
+
import { S as q } from "./Publics-9ebffff1.mjs";
|
9
|
+
import { u as G } from "./vuex.esm-bundler-57d8b6ba.mjs";
|
10
|
+
import { V as H } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
11
|
+
import "./globals-96ba60e4.mjs";
|
12
|
+
import "./Tab-58cd105f.mjs";
|
13
|
+
import "./ButtonFollow-728aab73.mjs";
|
14
|
+
import "./Feed-dc8b66bf.mjs";
|
15
|
+
import "./EmptyState-34d85f10.mjs";
|
16
|
+
import "./CardHeader-ce5a1a75.mjs";
|
17
|
+
import "./PlaceholderUserpic-995da0fc.mjs";
|
18
|
+
import "./Feed-a31c43c2.mjs";
|
19
|
+
import "./IconEdit-e9fd4c6c.mjs";
|
20
|
+
import "./organizations-1b4c84ee.mjs";
|
21
|
+
import "./UploadImage-ff8f9a0c.mjs";
|
22
|
+
import "./CardOrganization-f70bd169.mjs";
|
23
|
+
const J = { class: "mn-big flex-column flex" }, K = {
|
24
|
+
__name: "EditProductInfo",
|
25
|
+
props: {
|
26
|
+
product: Object
|
27
|
+
},
|
28
|
+
setup(m) {
|
29
|
+
const u = m, o = G();
|
30
|
+
return A(u), (t, l) => (n(), c("div", J, [
|
31
|
+
C(w(s(o).products.current) + " ", 1),
|
32
|
+
d(q, {
|
33
|
+
options: [
|
34
|
+
"unpublished",
|
35
|
+
"published",
|
36
|
+
"archivied"
|
37
|
+
],
|
38
|
+
select: s(o).products.state.current.status,
|
39
|
+
"onUpdate:select": l[0] || (l[0] = (a) => s(o).products.state.current.status = a),
|
40
|
+
placeholder: "Display product",
|
41
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
42
|
+
}, null, 8, ["select"]),
|
43
|
+
d(v, {
|
44
|
+
field: s(o).products.state.current.name,
|
45
|
+
"onUpdate:field": l[1] || (l[1] = (a) => s(o).products.state.current.name = a),
|
46
|
+
placeholder: "Введите название",
|
47
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
48
|
+
}, null, 8, ["field"]),
|
49
|
+
d(v, {
|
50
|
+
field: s(o).products.state.current.price,
|
51
|
+
"onUpdate:field": l[2] || (l[2] = (a) => s(o).products.state.current.price = a),
|
52
|
+
placeholder: "Введите цену",
|
53
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
54
|
+
type: "number"
|
55
|
+
}, null, 8, ["field"]),
|
56
|
+
d(v, {
|
57
|
+
field: s(o).products.state.current.description,
|
58
|
+
"onUpdate:field": l[3] || (l[3] = (a) => s(o).products.state.current.description = a),
|
59
|
+
placeholder: "Введите описание",
|
60
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
61
|
+
type: "textarea"
|
62
|
+
}, null, 8, ["field"])
|
63
|
+
]));
|
64
|
+
}
|
65
|
+
}, Q = { class: "mn-big" }, W = { class: "mn-small flex-nowrap flex" }, X = { class: "mn-r-thin" }, Y = { class: "flex-column flex" }, Z = {
|
66
|
+
key: 0,
|
67
|
+
class: "w-100 mn-small"
|
68
|
+
}, ee = ["onClick"], te = /* @__PURE__ */ e("svg", {
|
69
|
+
class: "i-small",
|
70
|
+
fill: "none",
|
71
|
+
height: "20",
|
72
|
+
viewBox: "0 0 20 20",
|
73
|
+
width: "20",
|
74
|
+
xmlns: "http://www.w3.org/2000/svg"
|
75
|
+
}, [
|
76
|
+
/* @__PURE__ */ e("path", {
|
77
|
+
"clip-rule": "evenodd",
|
78
|
+
d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
|
79
|
+
fill: "#8a8a8a",
|
80
|
+
"fill-rule": "evenodd"
|
81
|
+
})
|
82
|
+
], -1), se = [
|
83
|
+
te
|
84
|
+
], S = {
|
85
|
+
__name: "EditParameters",
|
86
|
+
props: {
|
87
|
+
items: {
|
88
|
+
type: Array,
|
89
|
+
default: () => []
|
90
|
+
},
|
91
|
+
title: String,
|
92
|
+
addButtonLabel: String,
|
93
|
+
emptyMessage: String,
|
94
|
+
keyName: String,
|
95
|
+
valueName: String
|
96
|
+
},
|
97
|
+
emits: ["add-info", "delete-info"],
|
98
|
+
setup(m, { emit: u }) {
|
99
|
+
const o = m;
|
100
|
+
function t() {
|
101
|
+
u("add-info", {});
|
102
|
+
}
|
103
|
+
function l(i) {
|
104
|
+
u("delete-info", i);
|
105
|
+
}
|
106
|
+
const { items: a, title: _, emptyMessage: b, addButtonLabel: f, keyName: p, valueName: g } = A(o);
|
107
|
+
return (i, I) => (n(), c("div", Q, [
|
108
|
+
e("div", W, [
|
109
|
+
e("h5", X, w(s(_)), 1),
|
110
|
+
e("button", {
|
111
|
+
onClick: t,
|
112
|
+
class: "i-small pd-thin button-delete button"
|
113
|
+
}, "+")
|
114
|
+
]),
|
115
|
+
e("div", Y, [
|
116
|
+
s(a).length == 0 ? (n(), c("p", Z, w(s(b)), 1)) : k("", !0),
|
117
|
+
s(a).length == 0 ? (n(), E(L, {
|
118
|
+
key: 1,
|
119
|
+
onClick: t,
|
120
|
+
class: "button"
|
121
|
+
}, {
|
122
|
+
default: N(() => [
|
123
|
+
C(w(s(f)), 1)
|
124
|
+
]),
|
125
|
+
_: 1
|
126
|
+
})) : k("", !0),
|
127
|
+
(n(!0), c(P, null, z(s(a), (h, x) => (n(), c("div", {
|
128
|
+
class: "mn-medium w-100 flex-nowrap flex",
|
129
|
+
key: x
|
130
|
+
}, [
|
131
|
+
d(v, {
|
132
|
+
field: h[s(p)],
|
133
|
+
"onUpdate:field": (y) => h[s(p)] = y,
|
134
|
+
placeholder: "Название параметра",
|
135
|
+
class: "w-100 mn-r-small bg-white radius-small pd-medium"
|
136
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
137
|
+
d(v, {
|
138
|
+
field: h[s(g)],
|
139
|
+
"onUpdate:field": (y) => h[s(g)] = y,
|
140
|
+
placeholder: "Значение параметра",
|
141
|
+
class: "w-100 bg-white radius-small pd-medium"
|
142
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
143
|
+
e("button", {
|
144
|
+
onClick: (y) => l(x),
|
145
|
+
class: "mn-l-small button"
|
146
|
+
}, se, 8, ee)
|
147
|
+
]))), 128))
|
148
|
+
])
|
149
|
+
]));
|
150
|
+
}
|
151
|
+
}, oe = /* @__PURE__ */ e("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), ae = {
|
152
|
+
__name: "UploadImageMultiple",
|
153
|
+
props: [
|
154
|
+
"uploadPath"
|
155
|
+
],
|
156
|
+
emits: ["update:images"],
|
157
|
+
setup(m, { emit: u }) {
|
158
|
+
const o = m, t = U([]), l = U(null);
|
159
|
+
function a() {
|
160
|
+
l.value.click();
|
161
|
+
}
|
162
|
+
async function _(f) {
|
163
|
+
let p = f.target.files, g = new FormData();
|
164
|
+
for (let i = 0; i < p.length; i++)
|
165
|
+
g.append("file", p[i]);
|
166
|
+
try {
|
167
|
+
(await j.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(o.uploadPath)}`, g, {
|
168
|
+
headers: {
|
169
|
+
"Content-Type": "multipart/form-data"
|
170
|
+
}
|
171
|
+
})).data.forEach((h) => {
|
172
|
+
t.value.push(h.filepath);
|
173
|
+
}), u("update:images", t.value);
|
174
|
+
} catch (i) {
|
175
|
+
console.error(i);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
function b(f) {
|
179
|
+
f.preventDefault(), _({
|
180
|
+
target: {
|
181
|
+
files: f.dataTransfer.files
|
182
|
+
}
|
183
|
+
});
|
184
|
+
}
|
185
|
+
return (f, p) => (n(), c("div", {
|
186
|
+
onClick: a,
|
187
|
+
onDrop: b,
|
188
|
+
onDragover: p[0] || (p[0] = B(() => {
|
189
|
+
}, ["prevent"])),
|
190
|
+
class: "flex-v-center flex-h-center flex"
|
191
|
+
}, [
|
192
|
+
oe,
|
193
|
+
e("input", {
|
194
|
+
type: "file",
|
195
|
+
ref_key: "fileInput",
|
196
|
+
ref: l,
|
197
|
+
onChange: _,
|
198
|
+
multiple: "",
|
199
|
+
style: { display: "none" }
|
200
|
+
}, null, 544)
|
201
|
+
], 32));
|
202
|
+
}
|
203
|
+
}, le = {
|
204
|
+
key: 0,
|
205
|
+
class: "mn-big"
|
206
|
+
}, ne = { class: "flex-column block" }, re = ["src"], ie = ["onClick"], de = {
|
207
|
+
__name: "EditProductImages",
|
208
|
+
props: {
|
209
|
+
product: Object
|
210
|
+
},
|
211
|
+
setup(m) {
|
212
|
+
function u(t) {
|
213
|
+
console.log(t), console.log(r.current.images), r.current.images.push(...t);
|
214
|
+
}
|
215
|
+
function o(t) {
|
216
|
+
r.current.images.splice(t, 1);
|
217
|
+
}
|
218
|
+
return (t, l) => (n(), c("div", null, [
|
219
|
+
m.product.images.length < 1 ? (n(), c("p", le, " The product doesn't have any images yet. ")) : k("", !0),
|
220
|
+
d(s(H), {
|
221
|
+
class: "cols-4 dragArea list-group w-full",
|
222
|
+
list: m.product.images,
|
223
|
+
sort: !0,
|
224
|
+
onChange: t.log
|
225
|
+
}, {
|
226
|
+
default: N(() => [
|
227
|
+
(n(!0), c(P, null, z(m.product.images, (a, _) => (n(), c("div", ne, [
|
228
|
+
e("img", {
|
229
|
+
class: "w-100 mn-small",
|
230
|
+
src: a
|
231
|
+
}, null, 8, re),
|
232
|
+
e("a", {
|
233
|
+
onClick: (b) => o(_),
|
234
|
+
class: "w-100 br-grey br-solid br-1px button"
|
235
|
+
}, "Удалить", 8, ie)
|
236
|
+
]))), 256))
|
237
|
+
]),
|
238
|
+
_: 1
|
239
|
+
}, 8, ["list", "onChange"]),
|
240
|
+
d(ae, {
|
241
|
+
"onUpdate:images": u,
|
242
|
+
uploadPath: "organizations/" + t.$route.params._id + "/products",
|
243
|
+
class: "mn-t-semi pd-small w-100 button bg-main"
|
244
|
+
}, null, 8, ["uploadPath"])
|
245
|
+
]));
|
246
|
+
}
|
247
|
+
};
|
248
|
+
const ce = { class: "for-transition w-100" }, ue = { class: "pd-b-zero pd-t-zero pd-thin" }, me = { class: "pd-thin" }, pe = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, fe = {
|
249
|
+
key: 0,
|
250
|
+
class: "mn-r-auto"
|
251
|
+
}, he = {
|
252
|
+
key: 1,
|
253
|
+
class: "mn-r-auto"
|
254
|
+
}, _e = { class: "flex-nowrap flex pd-thin" }, ge = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, be = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, ve = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Profile", -1), ye = { class: "mn-semi" }, we = /* @__PURE__ */ e("h5", null, "Categories", -1), xe = { class: "" }, $e = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, ke = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Images", -1), Je = {
|
255
|
+
__name: "ProductEdit",
|
256
|
+
async setup(m) {
|
257
|
+
let u, o;
|
258
|
+
const t = M(), l = R();
|
259
|
+
[u, o] = D(() => V.fetchCategories()), await u, o(), t.params.product && ([u, o] = D(() => $.read({ _id: t.params.product })), await u, o());
|
260
|
+
function a() {
|
261
|
+
r.current.information.push({ name: "", value: "" });
|
262
|
+
}
|
263
|
+
function _(i) {
|
264
|
+
r.current.information.splice(i, 1);
|
265
|
+
}
|
266
|
+
function b() {
|
267
|
+
r.current.localization.push({ locale: "", text: "" });
|
268
|
+
}
|
269
|
+
function f(i) {
|
270
|
+
r.current.localization.splice(i, 1);
|
271
|
+
}
|
272
|
+
function p() {
|
273
|
+
t.params.product ? $.update(t.params.product, r.current) : $.create(t.params._id, r.current);
|
274
|
+
}
|
275
|
+
function g() {
|
276
|
+
l.push({ name: "ProductEdit", params: { _id: t.params._id, product: r.current._id } });
|
277
|
+
}
|
278
|
+
return (i, I) => (n(), c("div", ce, [
|
279
|
+
e("div", ue, [
|
280
|
+
d(F, { class: "pd-medium bg-grey radius-big" })
|
281
|
+
]),
|
282
|
+
e("div", me, [
|
283
|
+
e("header", pe, [
|
284
|
+
s(t).params.product ? (n(), c("h1", fe, "Edit Product")) : (n(), c("h1", he, "Create Product")),
|
285
|
+
e("section", _e, [
|
286
|
+
d(L, {
|
287
|
+
submit: p,
|
288
|
+
callback: g
|
289
|
+
}, {
|
290
|
+
default: N(() => [
|
291
|
+
C("Save Product")
|
292
|
+
]),
|
293
|
+
_: 1
|
294
|
+
})
|
295
|
+
])
|
296
|
+
])
|
297
|
+
]),
|
298
|
+
e("div", ge, [
|
299
|
+
e("div", be, [
|
300
|
+
ve,
|
301
|
+
d(K, {
|
302
|
+
product: r.current
|
303
|
+
}, null, 8, ["product"]),
|
304
|
+
e("div", ye, [
|
305
|
+
we,
|
306
|
+
(n(!0), c(P, null, z(T.all, (h, x) => (n(), E(O, {
|
307
|
+
label: h.name,
|
308
|
+
name: "categories",
|
309
|
+
value: h.url,
|
310
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
311
|
+
radio: r.current.category
|
312
|
+
}, null, 8, ["label", "value", "radio"]))), 256))
|
313
|
+
]),
|
314
|
+
d(S, {
|
315
|
+
items: r.current.information,
|
316
|
+
title: "Parameters",
|
317
|
+
emptyMessage: "No parameters",
|
318
|
+
addButtonLabel: "Add parameter",
|
319
|
+
keyName: "name",
|
320
|
+
valueName: "value",
|
321
|
+
onAddInfo: a,
|
322
|
+
onDeleteInfo: _
|
323
|
+
}, null, 8, ["items"]),
|
324
|
+
d(S, {
|
325
|
+
items: r.current.localization,
|
326
|
+
title: "Localization",
|
327
|
+
emptyMessage: "No localizations",
|
328
|
+
addButtonLabel: "Add localization",
|
329
|
+
keyName: "locale",
|
330
|
+
valueName: "text",
|
331
|
+
onAddInfo: b,
|
332
|
+
onDeleteInfo: f
|
333
|
+
}, null, 8, ["items"])
|
334
|
+
]),
|
335
|
+
e("div", xe, [
|
336
|
+
e("div", $e, [
|
337
|
+
ke,
|
338
|
+
d(de, {
|
339
|
+
product: r.current
|
340
|
+
}, null, 8, ["product"])
|
341
|
+
])
|
342
|
+
])
|
343
|
+
])
|
344
|
+
]));
|
345
|
+
}
|
346
|
+
};
|
347
|
+
export {
|
348
|
+
Je as default
|
349
|
+
};
|
@@ -0,0 +1,349 @@
|
|
1
|
+
import { toRefs as A, openBlock as n, createElementBlock as c, createTextVNode as C, toDisplayString as w, unref as s, createVNode as d, createElementVNode as e, createCommentVNode as k, createBlock as E, withCtx as N, Fragment as P, renderList as z, ref as U, withModifiers as B, withAsyncContext as D } from "vue";
|
2
|
+
import { useRoute as M, useRouter as R } from "vue-router";
|
3
|
+
import { s as r, a as V, b as $, _ as F, c as T } from "./organizations.client-7937e180.mjs";
|
4
|
+
import "./inputs.validation-14e8e01f.mjs";
|
5
|
+
import { F as v, b as L, a as j } from "./auth-fefd15a3.mjs";
|
6
|
+
import { C as O } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs";
|
7
|
+
import "vue-i18n";
|
8
|
+
import { S as q } from "./Publics-0e44c61e.mjs";
|
9
|
+
import { u as G } from "./vuex.esm-bundler-57d8b6ba.mjs";
|
10
|
+
import { V as H } from "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
|
11
|
+
import "./globals-96ba60e4.mjs";
|
12
|
+
import "./Tab-a243605d.mjs";
|
13
|
+
import "./ButtonFollow-001c4a65.mjs";
|
14
|
+
import "./Feed-76b2997e.mjs";
|
15
|
+
import "./EmptyState-34d85f10.mjs";
|
16
|
+
import "./CardHeader-e361dada.mjs";
|
17
|
+
import "./PlaceholderUserpic-eb9820ce.mjs";
|
18
|
+
import "./Feed-4b28adc5.mjs";
|
19
|
+
import "./IconEdit-8df23653.mjs";
|
20
|
+
import "./organizations-1581c013.mjs";
|
21
|
+
import "./UploadImage-6e312c46.mjs";
|
22
|
+
import "./CardOrganization-bacc2ef6.mjs";
|
23
|
+
const J = { class: "mn-big flex-column flex" }, K = {
|
24
|
+
__name: "EditProductInfo",
|
25
|
+
props: {
|
26
|
+
product: Object
|
27
|
+
},
|
28
|
+
setup(m) {
|
29
|
+
const u = m, o = G();
|
30
|
+
return A(u), (t, l) => (n(), c("div", J, [
|
31
|
+
C(w(s(o).products.current) + " ", 1),
|
32
|
+
d(q, {
|
33
|
+
options: [
|
34
|
+
"unpublished",
|
35
|
+
"published",
|
36
|
+
"archivied"
|
37
|
+
],
|
38
|
+
select: s(o).products.state.current.status,
|
39
|
+
"onUpdate:select": l[0] || (l[0] = (a) => s(o).products.state.current.status = a),
|
40
|
+
placeholder: "Display product",
|
41
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
42
|
+
}, null, 8, ["select"]),
|
43
|
+
d(v, {
|
44
|
+
field: s(o).products.state.current.name,
|
45
|
+
"onUpdate:field": l[1] || (l[1] = (a) => s(o).products.state.current.name = a),
|
46
|
+
placeholder: "Введите название",
|
47
|
+
class: "w-100 mn-small bg-white radius-small pd-medium"
|
48
|
+
}, null, 8, ["field"]),
|
49
|
+
d(v, {
|
50
|
+
field: s(o).products.state.current.price,
|
51
|
+
"onUpdate:field": l[2] || (l[2] = (a) => s(o).products.state.current.price = a),
|
52
|
+
placeholder: "Введите цену",
|
53
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
54
|
+
type: "number"
|
55
|
+
}, null, 8, ["field"]),
|
56
|
+
d(v, {
|
57
|
+
field: s(o).products.state.current.description,
|
58
|
+
"onUpdate:field": l[3] || (l[3] = (a) => s(o).products.state.current.description = a),
|
59
|
+
placeholder: "Введите описание",
|
60
|
+
class: "w-100 mn-small bg-white radius-small pd-medium",
|
61
|
+
type: "textarea"
|
62
|
+
}, null, 8, ["field"])
|
63
|
+
]));
|
64
|
+
}
|
65
|
+
}, Q = { class: "mn-big" }, W = { class: "mn-small flex-nowrap flex" }, X = { class: "mn-r-thin" }, Y = { class: "flex-column flex" }, Z = {
|
66
|
+
key: 0,
|
67
|
+
class: "w-100 mn-small"
|
68
|
+
}, ee = ["onClick"], te = /* @__PURE__ */ e("svg", {
|
69
|
+
class: "i-small",
|
70
|
+
fill: "none",
|
71
|
+
height: "20",
|
72
|
+
viewBox: "0 0 20 20",
|
73
|
+
width: "20",
|
74
|
+
xmlns: "http://www.w3.org/2000/svg"
|
75
|
+
}, [
|
76
|
+
/* @__PURE__ */ e("path", {
|
77
|
+
"clip-rule": "evenodd",
|
78
|
+
d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
|
79
|
+
fill: "#8a8a8a",
|
80
|
+
"fill-rule": "evenodd"
|
81
|
+
})
|
82
|
+
], -1), se = [
|
83
|
+
te
|
84
|
+
], S = {
|
85
|
+
__name: "EditParameters",
|
86
|
+
props: {
|
87
|
+
items: {
|
88
|
+
type: Array,
|
89
|
+
default: () => []
|
90
|
+
},
|
91
|
+
title: String,
|
92
|
+
addButtonLabel: String,
|
93
|
+
emptyMessage: String,
|
94
|
+
keyName: String,
|
95
|
+
valueName: String
|
96
|
+
},
|
97
|
+
emits: ["add-info", "delete-info"],
|
98
|
+
setup(m, { emit: u }) {
|
99
|
+
const o = m;
|
100
|
+
function t() {
|
101
|
+
u("add-info", {});
|
102
|
+
}
|
103
|
+
function l(i) {
|
104
|
+
u("delete-info", i);
|
105
|
+
}
|
106
|
+
const { items: a, title: _, emptyMessage: b, addButtonLabel: f, keyName: p, valueName: g } = A(o);
|
107
|
+
return (i, I) => (n(), c("div", Q, [
|
108
|
+
e("div", W, [
|
109
|
+
e("h5", X, w(s(_)), 1),
|
110
|
+
e("button", {
|
111
|
+
onClick: t,
|
112
|
+
class: "i-small pd-thin button-delete button"
|
113
|
+
}, "+")
|
114
|
+
]),
|
115
|
+
e("div", Y, [
|
116
|
+
s(a).length == 0 ? (n(), c("p", Z, w(s(b)), 1)) : k("", !0),
|
117
|
+
s(a).length == 0 ? (n(), E(L, {
|
118
|
+
key: 1,
|
119
|
+
onClick: t,
|
120
|
+
class: "button"
|
121
|
+
}, {
|
122
|
+
default: N(() => [
|
123
|
+
C(w(s(f)), 1)
|
124
|
+
]),
|
125
|
+
_: 1
|
126
|
+
})) : k("", !0),
|
127
|
+
(n(!0), c(P, null, z(s(a), (h, x) => (n(), c("div", {
|
128
|
+
class: "mn-medium w-100 flex-nowrap flex",
|
129
|
+
key: x
|
130
|
+
}, [
|
131
|
+
d(v, {
|
132
|
+
field: h[s(p)],
|
133
|
+
"onUpdate:field": (y) => h[s(p)] = y,
|
134
|
+
placeholder: "Название параметра",
|
135
|
+
class: "w-100 mn-r-small bg-white radius-small pd-medium"
|
136
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
137
|
+
d(v, {
|
138
|
+
field: h[s(g)],
|
139
|
+
"onUpdate:field": (y) => h[s(g)] = y,
|
140
|
+
placeholder: "Значение параметра",
|
141
|
+
class: "w-100 bg-white radius-small pd-medium"
|
142
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
143
|
+
e("button", {
|
144
|
+
onClick: (y) => l(x),
|
145
|
+
class: "mn-l-small button"
|
146
|
+
}, se, 8, ee)
|
147
|
+
]))), 128))
|
148
|
+
])
|
149
|
+
]));
|
150
|
+
}
|
151
|
+
}, oe = /* @__PURE__ */ e("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), ae = {
|
152
|
+
__name: "UploadImageMultiple",
|
153
|
+
props: [
|
154
|
+
"uploadPath"
|
155
|
+
],
|
156
|
+
emits: ["update:images"],
|
157
|
+
setup(m, { emit: u }) {
|
158
|
+
const o = m, t = U([]), l = U(null);
|
159
|
+
function a() {
|
160
|
+
l.value.click();
|
161
|
+
}
|
162
|
+
async function _(f) {
|
163
|
+
let p = f.target.files, g = new FormData();
|
164
|
+
for (let i = 0; i < p.length; i++)
|
165
|
+
g.append("file", p[i]);
|
166
|
+
try {
|
167
|
+
(await j.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(o.uploadPath)}`, g, {
|
168
|
+
headers: {
|
169
|
+
"Content-Type": "multipart/form-data"
|
170
|
+
}
|
171
|
+
})).data.forEach((h) => {
|
172
|
+
t.value.push(h.filepath);
|
173
|
+
}), u("update:images", t.value);
|
174
|
+
} catch (i) {
|
175
|
+
console.error(i);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
function b(f) {
|
179
|
+
f.preventDefault(), _({
|
180
|
+
target: {
|
181
|
+
files: f.dataTransfer.files
|
182
|
+
}
|
183
|
+
});
|
184
|
+
}
|
185
|
+
return (f, p) => (n(), c("div", {
|
186
|
+
onClick: a,
|
187
|
+
onDrop: b,
|
188
|
+
onDragover: p[0] || (p[0] = B(() => {
|
189
|
+
}, ["prevent"])),
|
190
|
+
class: "flex-v-center flex-h-center flex"
|
191
|
+
}, [
|
192
|
+
oe,
|
193
|
+
e("input", {
|
194
|
+
type: "file",
|
195
|
+
ref_key: "fileInput",
|
196
|
+
ref: l,
|
197
|
+
onChange: _,
|
198
|
+
multiple: "",
|
199
|
+
style: { display: "none" }
|
200
|
+
}, null, 544)
|
201
|
+
], 32));
|
202
|
+
}
|
203
|
+
}, le = {
|
204
|
+
key: 0,
|
205
|
+
class: "mn-big"
|
206
|
+
}, ne = { class: "flex-column block" }, re = ["src"], ie = ["onClick"], de = {
|
207
|
+
__name: "EditProductImages",
|
208
|
+
props: {
|
209
|
+
product: Object
|
210
|
+
},
|
211
|
+
setup(m) {
|
212
|
+
function u(t) {
|
213
|
+
console.log(t), console.log(r.current.images), r.current.images.push(...t);
|
214
|
+
}
|
215
|
+
function o(t) {
|
216
|
+
r.current.images.splice(t, 1);
|
217
|
+
}
|
218
|
+
return (t, l) => (n(), c("div", null, [
|
219
|
+
m.product.images.length < 1 ? (n(), c("p", le, " The product doesn't have any images yet. ")) : k("", !0),
|
220
|
+
d(s(H), {
|
221
|
+
class: "cols-4 dragArea list-group w-full",
|
222
|
+
list: m.product.images,
|
223
|
+
sort: !0,
|
224
|
+
onChange: t.log
|
225
|
+
}, {
|
226
|
+
default: N(() => [
|
227
|
+
(n(!0), c(P, null, z(m.product.images, (a, _) => (n(), c("div", ne, [
|
228
|
+
e("img", {
|
229
|
+
class: "w-100 mn-small",
|
230
|
+
src: a
|
231
|
+
}, null, 8, re),
|
232
|
+
e("a", {
|
233
|
+
onClick: (b) => o(_),
|
234
|
+
class: "w-100 br-grey br-solid br-1px button"
|
235
|
+
}, "Удалить", 8, ie)
|
236
|
+
]))), 256))
|
237
|
+
]),
|
238
|
+
_: 1
|
239
|
+
}, 8, ["list", "onChange"]),
|
240
|
+
d(ae, {
|
241
|
+
"onUpdate:images": u,
|
242
|
+
uploadPath: "organizations/" + t.$route.params._id + "/products",
|
243
|
+
class: "mn-t-semi pd-small w-100 button bg-main"
|
244
|
+
}, null, 8, ["uploadPath"])
|
245
|
+
]));
|
246
|
+
}
|
247
|
+
};
|
248
|
+
const ce = { class: "for-transition w-100" }, ue = { class: "pd-b-zero pd-t-zero pd-thin" }, me = { class: "pd-thin" }, pe = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, fe = {
|
249
|
+
key: 0,
|
250
|
+
class: "mn-r-auto"
|
251
|
+
}, he = {
|
252
|
+
key: 1,
|
253
|
+
class: "mn-r-auto"
|
254
|
+
}, _e = { class: "flex-nowrap flex pd-thin" }, ge = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, be = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, ve = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Profile", -1), ye = { class: "mn-semi" }, we = /* @__PURE__ */ e("h5", null, "Categories", -1), xe = { class: "" }, $e = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, ke = /* @__PURE__ */ e("h3", { class: "mn-semi" }, "Images", -1), Je = {
|
255
|
+
__name: "ProductEdit",
|
256
|
+
async setup(m) {
|
257
|
+
let u, o;
|
258
|
+
const t = M(), l = R();
|
259
|
+
[u, o] = D(() => V.fetchCategories()), await u, o(), t.params.product && ([u, o] = D(() => $.read({ _id: t.params.product })), await u, o());
|
260
|
+
function a() {
|
261
|
+
r.current.information.push({ name: "", value: "" });
|
262
|
+
}
|
263
|
+
function _(i) {
|
264
|
+
r.current.information.splice(i, 1);
|
265
|
+
}
|
266
|
+
function b() {
|
267
|
+
r.current.localization.push({ locale: "", text: "" });
|
268
|
+
}
|
269
|
+
function f(i) {
|
270
|
+
r.current.localization.splice(i, 1);
|
271
|
+
}
|
272
|
+
function p() {
|
273
|
+
t.params.product ? $.update(t.params.product, r.current) : $.create(t.params._id, r.current);
|
274
|
+
}
|
275
|
+
function g() {
|
276
|
+
l.push({ name: "ProductEdit", params: { _id: t.params._id, product: r.current._id } });
|
277
|
+
}
|
278
|
+
return (i, I) => (n(), c("div", ce, [
|
279
|
+
e("div", ue, [
|
280
|
+
d(F, { class: "pd-medium bg-grey radius-big" })
|
281
|
+
]),
|
282
|
+
e("div", me, [
|
283
|
+
e("header", pe, [
|
284
|
+
s(t).params.product ? (n(), c("h1", fe, "Edit Product")) : (n(), c("h1", he, "Create Product")),
|
285
|
+
e("section", _e, [
|
286
|
+
d(L, {
|
287
|
+
submit: p,
|
288
|
+
callback: g
|
289
|
+
}, {
|
290
|
+
default: N(() => [
|
291
|
+
C("Save Product")
|
292
|
+
]),
|
293
|
+
_: 1
|
294
|
+
})
|
295
|
+
])
|
296
|
+
])
|
297
|
+
]),
|
298
|
+
e("div", ge, [
|
299
|
+
e("div", be, [
|
300
|
+
ve,
|
301
|
+
d(K, {
|
302
|
+
product: r.current
|
303
|
+
}, null, 8, ["product"]),
|
304
|
+
e("div", ye, [
|
305
|
+
we,
|
306
|
+
(n(!0), c(P, null, z(T.all, (h, x) => (n(), E(O, {
|
307
|
+
label: h.name,
|
308
|
+
name: "categories",
|
309
|
+
value: h.url,
|
310
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
311
|
+
radio: r.current.category
|
312
|
+
}, null, 8, ["label", "value", "radio"]))), 256))
|
313
|
+
]),
|
314
|
+
d(S, {
|
315
|
+
items: r.current.information,
|
316
|
+
title: "Parameters",
|
317
|
+
emptyMessage: "No parameters",
|
318
|
+
addButtonLabel: "Add parameter",
|
319
|
+
keyName: "name",
|
320
|
+
valueName: "value",
|
321
|
+
onAddInfo: a,
|
322
|
+
onDeleteInfo: _
|
323
|
+
}, null, 8, ["items"]),
|
324
|
+
d(S, {
|
325
|
+
items: r.current.localization,
|
326
|
+
title: "Localization",
|
327
|
+
emptyMessage: "No localizations",
|
328
|
+
addButtonLabel: "Add localization",
|
329
|
+
keyName: "locale",
|
330
|
+
valueName: "text",
|
331
|
+
onAddInfo: b,
|
332
|
+
onDeleteInfo: f
|
333
|
+
}, null, 8, ["items"])
|
334
|
+
]),
|
335
|
+
e("div", xe, [
|
336
|
+
e("div", $e, [
|
337
|
+
ke,
|
338
|
+
d(de, {
|
339
|
+
product: r.current
|
340
|
+
}, null, 8, ["product"])
|
341
|
+
])
|
342
|
+
])
|
343
|
+
])
|
344
|
+
]));
|
345
|
+
}
|
346
|
+
};
|
347
|
+
export {
|
348
|
+
Je as default
|
349
|
+
};
|