@ozdao/prometheus-framework 0.2.92 → 0.2.94
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/events.server.js +14 -6
- package/dist/events.server.mjs +14 -6
- package/dist/main-CX2ISR43.mjs +13629 -0
- package/dist/main-cffh4bbv.js +92 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +37 -23
- package/dist/orders.server.mjs +37 -23
- package/dist/organizations.server.js +2 -1
- package/dist/organizations.server.mjs +2 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +45 -45
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +28 -28
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +28 -26
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +47 -44
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +14 -15
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-CQQEUA9l.js +1 -0
- package/dist/web-D2Em-p-C.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +23 -34
- package/src/components/LocationMarker/LocationMarker.vue +6 -1
- package/src/components/LocationSelection/LocationSelection.vue +4 -0
- package/src/components/Map/Map.vue +29 -15
- package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
- package/src/modules/events/controllers/events.controller.js +4 -4
- package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
- package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
- package/src/modules/landing/components/pages/Farming.vue +226 -0
- package/src/modules/landing/components/pages/Governance.vue +3 -5
- package/src/modules/landing/components/pages/Home.vue +0 -3
- package/src/modules/landing/components/pages/Hotel.vue +1 -3
- package/src/modules/landing/components/pages/Page.vue +0 -3
- package/src/modules/landing/components/sections/Examples.vue +4 -56
- package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
- package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
- package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
- package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
- package/src/modules/landing/router/landing.js +11 -0
- package/src/modules/marketplace/components/sections/Filters.vue +26 -23
- package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
- package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
- package/src/modules/orders/components/pages/Order.vue +2 -6
- package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
- package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
- package/src/modules/orders/components/pages/Orders.vue +60 -11
- package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
- package/src/modules/orders/controllers/orders.controller.js +30 -19
- package/src/modules/orders/models/order.model.js +8 -2
- package/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/src/modules/orders/router/orders.router.js +2 -2
- package/src/modules/orders/store/orders.js +3 -7
- package/src/modules/orders/store/shopcart.js +1 -1
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
- package/src/modules/organizations/components/pages/Department.vue +5 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
- package/src/modules/organizations/components/pages/Members.vue +2 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +3 -1
- package/src/modules/organizations/store/memberships.js +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +2 -3
- package/src/modules/products/components/pages/ProductEdit.vue +10 -13
- package/src/modules/products/components/pages/Products.vue +2 -0
- package/src/modules/products/store/products.js +25 -2
- package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
- package/src/modules/users/components/blocks/CardUser.vue +1 -0
- package/src/modules/landing/components/sections/AboutSection.vue +0 -69
package/dist/orders.server.js
CHANGED
@@ -30,6 +30,11 @@ var order_model = (db) => {
|
|
30
30
|
status: {
|
31
31
|
type: String
|
32
32
|
},
|
33
|
+
deadline: {
|
34
|
+
type: Date,
|
35
|
+
default: () => new Date(Date.now() + 30 * 6e4)
|
36
|
+
// Добавляет 30 минут к текущему времени
|
37
|
+
},
|
33
38
|
status_history: [{
|
34
39
|
status: {
|
35
40
|
type: String,
|
@@ -55,11 +60,13 @@ var order_model = (db) => {
|
|
55
60
|
payment: {
|
56
61
|
type: {
|
57
62
|
type: String,
|
58
|
-
trim: true
|
63
|
+
trim: true,
|
64
|
+
default: "cash"
|
59
65
|
},
|
60
66
|
status: {
|
61
67
|
type: String,
|
62
|
-
trim: true
|
68
|
+
trim: true,
|
69
|
+
default: "unpaid"
|
63
70
|
}
|
64
71
|
},
|
65
72
|
delivery: {
|
@@ -213,17 +220,7 @@ ${formatPositions(order.positions)}
|
|
213
220
|
🧑 Agent: ${order.referralCode}
|
214
221
|
`;
|
215
222
|
}
|
216
|
-
function
|
217
|
-
orderData.status = "created";
|
218
|
-
orderData.status_history = orderData.status_history || [];
|
219
|
-
orderData.status_history.push({
|
220
|
-
status: orderData.status,
|
221
|
-
changedBy: userId,
|
222
|
-
timestamp: /* @__PURE__ */ new Date(),
|
223
|
-
comment: ""
|
224
|
-
});
|
225
|
-
}
|
226
|
-
async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
|
223
|
+
async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
|
227
224
|
let searchCriteria = {};
|
228
225
|
if (customerInfo.phone) {
|
229
226
|
searchCriteria.phone = customerInfo.phone;
|
@@ -239,8 +236,14 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
|
|
239
236
|
const newCustomerData = {
|
240
237
|
...customerInfo,
|
241
238
|
owner: orderOwner,
|
242
|
-
creator:
|
243
|
-
|
239
|
+
creator: {
|
240
|
+
type: customerInfo.creator.type || orderCreator.type,
|
241
|
+
target: customerInfo.creator.target || orderCreator.target
|
242
|
+
},
|
243
|
+
identity: {
|
244
|
+
type: customerInfo.identity.type || orderCreator.type,
|
245
|
+
target: customerInfo.identity.target || orderCreator.target
|
246
|
+
}
|
244
247
|
};
|
245
248
|
customer = await Customer.create(newCustomerData);
|
246
249
|
}
|
@@ -254,6 +257,16 @@ async function sendOrderMessage(orderData) {
|
|
254
257
|
console.error(err);
|
255
258
|
}
|
256
259
|
}
|
260
|
+
function initializeOrder(orderData, userId) {
|
261
|
+
orderData.status = "created";
|
262
|
+
orderData.status_history = orderData.status_history || [];
|
263
|
+
orderData.status_history.push({
|
264
|
+
status: orderData.status,
|
265
|
+
changedBy: userId,
|
266
|
+
timestamp: /* @__PURE__ */ new Date(),
|
267
|
+
comment: ""
|
268
|
+
});
|
269
|
+
}
|
257
270
|
const controllerFactory$1 = (db) => {
|
258
271
|
const Order = db.order;
|
259
272
|
const Customer = db.customer;
|
@@ -263,9 +276,9 @@ const controllerFactory$1 = (db) => {
|
|
263
276
|
initializeOrder(orderData, userId);
|
264
277
|
try {
|
265
278
|
if (!orderData.customer.target) {
|
266
|
-
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.
|
279
|
+
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
|
267
280
|
orderData.customer = { type: "Customer", target: customer._id };
|
268
|
-
if (!orderData.creator
|
281
|
+
if (!orderData.creator.target) {
|
269
282
|
orderData.creator = { type: "Customer", target: customer._id };
|
270
283
|
}
|
271
284
|
}
|
@@ -278,7 +291,7 @@ const controllerFactory$1 = (db) => {
|
|
278
291
|
}
|
279
292
|
};
|
280
293
|
const read = async (req, res) => {
|
281
|
-
stages = [
|
294
|
+
let stages = [
|
282
295
|
...queryProcessorGlobals.getBasicOptions(
|
283
296
|
req.query
|
284
297
|
),
|
@@ -326,7 +339,8 @@ const controllerFactory$1 = (db) => {
|
|
326
339
|
}
|
327
340
|
};
|
328
341
|
const update = async (req, res) => {
|
329
|
-
|
342
|
+
console.log(req.body);
|
343
|
+
const order = await Order.findOne({ _id: req.body._id });
|
330
344
|
if (!order) {
|
331
345
|
return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
|
332
346
|
}
|
@@ -491,8 +505,8 @@ let CRUD$1 = class CRUD {
|
|
491
505
|
}
|
492
506
|
async read(req, res) {
|
493
507
|
try {
|
494
|
-
let
|
495
|
-
|
508
|
+
let stages = [];
|
509
|
+
stages = [
|
496
510
|
...globalsQuery.getBasicOptions(
|
497
511
|
req.query
|
498
512
|
),
|
@@ -514,10 +528,10 @@ let CRUD$1 = class CRUD {
|
|
514
528
|
),
|
515
529
|
globalsQuery.removeTempPropeties()
|
516
530
|
];
|
517
|
-
const cacheKey = JSON.stringify({ stages
|
531
|
+
const cacheKey = JSON.stringify({ stages });
|
518
532
|
let data = await this.cache.get(cacheKey);
|
519
533
|
if (!data) {
|
520
|
-
data = await this.model.aggregate(
|
534
|
+
data = await this.model.aggregate(stages).exec();
|
521
535
|
await this.cache.set(cacheKey, data);
|
522
536
|
}
|
523
537
|
res.json(data);
|
package/dist/orders.server.mjs
CHANGED
@@ -29,6 +29,11 @@ var order_model = (db) => {
|
|
29
29
|
status: {
|
30
30
|
type: String
|
31
31
|
},
|
32
|
+
deadline: {
|
33
|
+
type: Date,
|
34
|
+
default: () => new Date(Date.now() + 30 * 6e4)
|
35
|
+
// Добавляет 30 минут к текущему времени
|
36
|
+
},
|
32
37
|
status_history: [{
|
33
38
|
status: {
|
34
39
|
type: String,
|
@@ -54,11 +59,13 @@ var order_model = (db) => {
|
|
54
59
|
payment: {
|
55
60
|
type: {
|
56
61
|
type: String,
|
57
|
-
trim: true
|
62
|
+
trim: true,
|
63
|
+
default: "cash"
|
58
64
|
},
|
59
65
|
status: {
|
60
66
|
type: String,
|
61
|
-
trim: true
|
67
|
+
trim: true,
|
68
|
+
default: "unpaid"
|
62
69
|
}
|
63
70
|
},
|
64
71
|
delivery: {
|
@@ -212,17 +219,7 @@ ${formatPositions(order.positions)}
|
|
212
219
|
🧑 Agent: ${order.referralCode}
|
213
220
|
`;
|
214
221
|
}
|
215
|
-
function
|
216
|
-
orderData.status = "created";
|
217
|
-
orderData.status_history = orderData.status_history || [];
|
218
|
-
orderData.status_history.push({
|
219
|
-
status: orderData.status,
|
220
|
-
changedBy: userId,
|
221
|
-
timestamp: /* @__PURE__ */ new Date(),
|
222
|
-
comment: ""
|
223
|
-
});
|
224
|
-
}
|
225
|
-
async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
|
222
|
+
async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
|
226
223
|
let searchCriteria = {};
|
227
224
|
if (customerInfo.phone) {
|
228
225
|
searchCriteria.phone = customerInfo.phone;
|
@@ -238,8 +235,14 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
|
|
238
235
|
const newCustomerData = {
|
239
236
|
...customerInfo,
|
240
237
|
owner: orderOwner,
|
241
|
-
creator:
|
242
|
-
|
238
|
+
creator: {
|
239
|
+
type: customerInfo.creator.type || orderCreator.type,
|
240
|
+
target: customerInfo.creator.target || orderCreator.target
|
241
|
+
},
|
242
|
+
identity: {
|
243
|
+
type: customerInfo.identity.type || orderCreator.type,
|
244
|
+
target: customerInfo.identity.target || orderCreator.target
|
245
|
+
}
|
243
246
|
};
|
244
247
|
customer = await Customer.create(newCustomerData);
|
245
248
|
}
|
@@ -253,6 +256,16 @@ async function sendOrderMessage(orderData) {
|
|
253
256
|
console.error(err);
|
254
257
|
}
|
255
258
|
}
|
259
|
+
function initializeOrder(orderData, userId) {
|
260
|
+
orderData.status = "created";
|
261
|
+
orderData.status_history = orderData.status_history || [];
|
262
|
+
orderData.status_history.push({
|
263
|
+
status: orderData.status,
|
264
|
+
changedBy: userId,
|
265
|
+
timestamp: /* @__PURE__ */ new Date(),
|
266
|
+
comment: ""
|
267
|
+
});
|
268
|
+
}
|
256
269
|
const controllerFactory$1 = (db) => {
|
257
270
|
const Order = db.order;
|
258
271
|
const Customer = db.customer;
|
@@ -262,9 +275,9 @@ const controllerFactory$1 = (db) => {
|
|
262
275
|
initializeOrder(orderData, userId);
|
263
276
|
try {
|
264
277
|
if (!orderData.customer.target) {
|
265
|
-
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.
|
278
|
+
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
|
266
279
|
orderData.customer = { type: "Customer", target: customer._id };
|
267
|
-
if (!orderData.creator
|
280
|
+
if (!orderData.creator.target) {
|
268
281
|
orderData.creator = { type: "Customer", target: customer._id };
|
269
282
|
}
|
270
283
|
}
|
@@ -277,7 +290,7 @@ const controllerFactory$1 = (db) => {
|
|
277
290
|
}
|
278
291
|
};
|
279
292
|
const read = async (req, res) => {
|
280
|
-
stages = [
|
293
|
+
let stages = [
|
281
294
|
...queryProcessorGlobals.getBasicOptions(
|
282
295
|
req.query
|
283
296
|
),
|
@@ -325,7 +338,8 @@ const controllerFactory$1 = (db) => {
|
|
325
338
|
}
|
326
339
|
};
|
327
340
|
const update = async (req, res) => {
|
328
|
-
|
341
|
+
console.log(req.body);
|
342
|
+
const order = await Order.findOne({ _id: req.body._id });
|
329
343
|
if (!order) {
|
330
344
|
return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
|
331
345
|
}
|
@@ -490,8 +504,8 @@ let CRUD$1 = class CRUD {
|
|
490
504
|
}
|
491
505
|
async read(req, res) {
|
492
506
|
try {
|
493
|
-
let
|
494
|
-
|
507
|
+
let stages = [];
|
508
|
+
stages = [
|
495
509
|
...globalsQuery.getBasicOptions(
|
496
510
|
req.query
|
497
511
|
),
|
@@ -513,10 +527,10 @@ let CRUD$1 = class CRUD {
|
|
513
527
|
),
|
514
528
|
globalsQuery.removeTempPropeties()
|
515
529
|
];
|
516
|
-
const cacheKey = JSON.stringify({ stages
|
530
|
+
const cacheKey = JSON.stringify({ stages });
|
517
531
|
let data = await this.cache.get(cacheKey);
|
518
532
|
if (!data) {
|
519
|
-
data = await this.model.aggregate(
|
533
|
+
data = await this.model.aggregate(stages).exec();
|
520
534
|
await this.cache.set(cacheKey, data);
|
521
535
|
}
|
522
536
|
res.json(data);
|
@@ -462,7 +462,8 @@ const controllerFactory$4 = (db) => {
|
|
462
462
|
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
463
463
|
...req.query.type && { type: req.query.type },
|
464
464
|
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
465
|
-
...req.query.role && { role: req.query.role }
|
465
|
+
// ...(req.query.role && { role: req.query.role }),
|
466
|
+
...req.query.role && { role: { $in: req.query.role } }
|
466
467
|
}
|
467
468
|
},
|
468
469
|
{
|
@@ -461,7 +461,8 @@ const controllerFactory$4 = (db) => {
|
|
461
461
|
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
462
462
|
...req.query.type && { type: req.query.type },
|
463
463
|
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
464
|
-
...req.query.role && { role: req.query.role }
|
464
|
+
// ...(req.query.role && { role: req.query.role }),
|
465
|
+
...req.query.role && { role: { $in: req.query.role } }
|
465
466
|
}
|
466
467
|
},
|
467
468
|
{
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("./Address.vue.cjs");const v=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),_={key:0,class:"t-transp mn-r-small"},h=["placeholder","value"],k={key:0,class:"mn-t-thin invalid-feedback"},b={__name:"Address",props:{apiKey:{type:String,required:!0},label:null,placeholder:"Enter something here",field:null,location:{type:Object,default:{lat:48.6900735,lng:41.1620239}},address:{type:String,default:""},locale:{type:String,default:"en"}},emits:["update:address","update:location","update:country","update:state","update:city"],setup(l,{emit:u}){const p=l,o=u,c=e.ref(null);let d;const m=()=>{const t=d.getPlace();if(!t.geometry||!t.address_components)return;let a="",s="",i="";for(let r=0;r<t.address_components.length;r++){let n=t.address_components[r];n.types.includes("country")&&(a=n.long_name),n.types.includes("administrative_area_level_1")&&(s=n.long_name),n.types.includes("locality")&&(i=n.long_name)}const y=t.formatted_address,g={lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};o("update:address",y),o("update:location",g),o("update:country",a),o("update:state",s),o("update:city",i)};return e.onMounted(()=>{new f.Loader({apiKey:p.apiKey,version:"weekly",libraries:["places"]}).load().then(()=>{d=new google.maps.places.Autocomplete(c.value),d.addListener("place_changed",m)}).catch(a=>{console.error(a)})}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$attrs.class,"flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"addressInput",ref:c,class:"w-100",placeholder:l.placeholder,value:l.address,onInput:a[0]||(a[0]=(...s)=>t.onInput&&t.onInput(...s))},null,40,h),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[t.validation?(e.openBlock(),e.createElementBlock("div",k," * "+e.toDisplayString(t.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],2))}},w=v.default(b,[["__scopeId","data-v-1fe1017e"]]);exports.default=w;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { ref as
|
2
|
-
import { Loader as
|
1
|
+
import { ref as w, onMounted as k, openBlock as r, createElementBlock as i, normalizeClass as b, createElementVNode as u, toDisplayString as m, createCommentVNode as y, createVNode as I, Transition as A, withCtx as C } from "vue";
|
2
|
+
import { Loader as S } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
|
3
3
|
import "./Address.vue.js";
|
4
|
-
import
|
5
|
-
const
|
4
|
+
import E from "../../../../_virtual/_plugin-vue_export-helper.js";
|
5
|
+
const K = {
|
6
6
|
key: 0,
|
7
7
|
class: "t-transp mn-r-small"
|
8
|
-
},
|
8
|
+
}, L = ["placeholder", "value"], N = {
|
9
9
|
key: 0,
|
10
10
|
class: "mn-t-thin invalid-feedback"
|
11
|
-
},
|
11
|
+
}, V = {
|
12
12
|
__name: "Address",
|
13
13
|
props: {
|
14
14
|
apiKey: {
|
@@ -25,67 +25,65 @@ const S = {
|
|
25
25
|
address: {
|
26
26
|
type: String,
|
27
27
|
default: ""
|
28
|
+
},
|
29
|
+
locale: {
|
30
|
+
type: String,
|
31
|
+
default: "en"
|
28
32
|
}
|
29
33
|
},
|
30
34
|
emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
|
31
|
-
setup(
|
32
|
-
const
|
35
|
+
setup(n, { emit: f }) {
|
36
|
+
const g = n, o = f, c = w(null);
|
33
37
|
let s;
|
34
|
-
const
|
35
|
-
new L({
|
36
|
-
apiKey: d.apiKey,
|
37
|
-
version: "weekly",
|
38
|
-
libraries: ["places"]
|
39
|
-
}).load().then(() => {
|
40
|
-
s = new google.maps.places.Autocomplete(l.value), s.addListener("place_changed", v);
|
41
|
-
}).catch((n) => {
|
42
|
-
console.error(n);
|
43
|
-
});
|
44
|
-
}, h = () => {
|
45
|
-
s || p();
|
46
|
-
}, v = () => {
|
38
|
+
const h = () => {
|
47
39
|
const e = s.getPlace();
|
48
40
|
if (!e.geometry || !e.address_components)
|
49
41
|
return;
|
50
|
-
let
|
51
|
-
for (let
|
52
|
-
|
53
|
-
|
54
|
-
t.types.includes("country") && (n = t.long_name), t.types.includes("administrative_area_level_1") && (u = t.long_name), t.types.includes("locality") && (m = t.long_name);
|
42
|
+
let t = "", l = "", p = "";
|
43
|
+
for (let d = 0; d < e.address_components.length; d++) {
|
44
|
+
let a = e.address_components[d];
|
45
|
+
a.types.includes("country") && (t = a.long_name), a.types.includes("administrative_area_level_1") && (l = a.long_name), a.types.includes("locality") && (p = a.long_name);
|
55
46
|
}
|
56
|
-
const
|
57
|
-
o("update:address",
|
47
|
+
const _ = e.formatted_address, v = { lat: e.geometry.location.lat(), lng: e.geometry.location.lng() };
|
48
|
+
o("update:address", _), o("update:location", v), o("update:country", t), o("update:state", l), o("update:city", p);
|
58
49
|
};
|
59
|
-
return
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
return k(() => {
|
51
|
+
new S({
|
52
|
+
apiKey: g.apiKey,
|
53
|
+
version: "weekly",
|
54
|
+
libraries: ["places"]
|
55
|
+
// language: props.locale,
|
56
|
+
}).load().then(() => {
|
57
|
+
s = new google.maps.places.Autocomplete(c.value), s.addListener("place_changed", h);
|
58
|
+
}).catch((t) => {
|
59
|
+
console.error(t);
|
60
|
+
});
|
61
|
+
}), (e, t) => (r(), i("div", {
|
62
|
+
class: b([e.$attrs.class, "flex-nowrap flex"])
|
65
63
|
}, [
|
66
|
-
|
67
|
-
|
68
|
-
])) :
|
69
|
-
|
64
|
+
n.label ? (r(), i("div", K, [
|
65
|
+
u("span", null, m(n.label), 1)
|
66
|
+
])) : y("", !0),
|
67
|
+
u("input", {
|
70
68
|
ref_key: "addressInput",
|
71
|
-
ref:
|
69
|
+
ref: c,
|
72
70
|
class: "w-100",
|
73
|
-
placeholder:
|
74
|
-
value:
|
75
|
-
onInput:
|
76
|
-
}, null, 40,
|
77
|
-
|
71
|
+
placeholder: n.placeholder,
|
72
|
+
value: n.address,
|
73
|
+
onInput: t[0] || (t[0] = (...l) => e.onInput && e.onInput(...l))
|
74
|
+
}, null, 40, L),
|
75
|
+
I(A, {
|
78
76
|
mode: "out-in",
|
79
77
|
name: "fade"
|
80
78
|
}, {
|
81
|
-
default:
|
82
|
-
e.validation ? (
|
79
|
+
default: C(() => [
|
80
|
+
e.validation ? (r(), i("div", N, " * " + m(e.validation.message), 1)) : y("", !0)
|
83
81
|
]),
|
84
82
|
_: 1
|
85
83
|
})
|
86
84
|
], 2));
|
87
85
|
}
|
88
|
-
},
|
86
|
+
}, x = /* @__PURE__ */ E(V, [["__scopeId", "data-v-1fe1017e"]]);
|
89
87
|
export {
|
90
|
-
|
88
|
+
x as default
|
91
89
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs"),w=require("../Loader/Loader.vue2.cjs");require("./LocationMarker.vue.cjs");const L=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),_=c=>(e.pushScopeId("data-v-eecb8ce4"),c=c(),e.popScopeId(),c),b={class:"pos-relative"},k={key:0,class:"i-regular",width:"98",height:"98",viewBox:"0 0 98 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M=_(()=>e.createElementVNode("path",{d:"M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",fill:"rgb(var(--white))"},null,-1)),E=_(()=>e.createElementVNode("path",{d:"M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",fill:"rgb(var(--white))"},null,-1)),V=[M,E],x={__name:"LocationMarker",props:{location:{type:Object,default:()=>({lat:15.87,lng:100.9925})},address:{type:String,default:null},apiKey:String,locale:{type:String,default:"en"}},emits:["update:location","update:address","update:country","update:state","update:city"],setup(c,{emit:y}){const o=c,n=y,u=e.ref(null),s=e.ref(!1);let i,d;e.onMounted(()=>{new v.Loader({apiKey:o.apiKey,version:"weekly",libraries:["places"]}).load().then(()=>{i=new google.maps.Map(u.value,{center:o.location,zoom:15,mapTypeControl:!1,fullscreenControl:!1,disableDefaultUI:!0}),d=new google.maps.Marker({position:o.location,map:i,draggable:!0}),d.addListener("dragend",t=>{const l={lat:t.latLng.lat(),lng:t.latLng.lng()};n("update:location",l),p(l)})}).catch(t=>{console.error(t)})}),e.watchEffect(()=>{o.location&&d&&d.setPosition(new google.maps.LatLng(o.location.lat,o.location.lng))}),e.watchEffect(()=>{if(o.location&&i){const a=new google.maps.LatLng(o.location.lat,o.location.lng);i.setCenter(a),i.setZoom(15)}});function p(a){new google.maps.Geocoder().geocode({location:a},(l,g)=>{if(g==="OK")if(l[0]){n("update:address",l[0].formatted_address);let f="",m="",C="";l[0].address_components.forEach(r=>{r.types.includes("country")&&(f=r.long_name),r.types.includes("administrative_area_level_1")&&(m=r.long_name),r.types.includes("locality")&&(C=r.long_name)}),n("update:country",f),n("update:state",m),n("update:city",C)}else console.error("No results found");else console.error("Geocoder failed due to: "+g)})}async function h(){s.value=!0,navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>{const t={lat:a.coords.latitude,lng:a.coords.longitude};n("update:location",t),p(t),s.value=!1},()=>{console.error("Error getting location"),s.value=!1}):(console.error("Geolocation is not supported by this browser."),s.value=!1)}return(a,t)=>(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("div",{ref_key:"mapContainer",ref:u,class:"w-100 h-100"},null,512),e.createElementVNode("button",{class:"cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",onClick:h},[e.createVNode(e.Transition,{name:"ScaleOut",mode:"out-in"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(w.default,{key:1,class:"pos-t-0 pos-l-0 i-small"})):(e.openBlock(),e.createElementBlock("svg",k,V))]),_:1})])]))}},S=L.default(x,[["__scopeId","data-v-eecb8ce4"]]);exports.default=S;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as y, onMounted as k, watchEffect as h, openBlock as p, createElementBlock as w, createElementVNode as d, createVNode as x, Transition as M, withCtx as S, createBlock as V, pushScopeId as E, popScopeId as I } from "vue";
|
2
2
|
import { Loader as Z } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
|
3
3
|
import B from "../Loader/Loader.vue2.js";
|
4
4
|
import "./LocationMarker.vue.js";
|
5
5
|
import H from "../../../../_virtual/_plugin-vue_export-helper.js";
|
6
|
-
const v = (r) => (E("data-v-
|
6
|
+
const v = (r) => (E("data-v-eecb8ce4"), r = r(), I(), r), K = { class: "pos-relative" }, G = {
|
7
7
|
key: 0,
|
8
8
|
class: "i-regular",
|
9
9
|
width: "98",
|
@@ -31,41 +31,46 @@ const v = (r) => (E("data-v-20234f27"), r = r(), I(), r), K = { class: "pos-rela
|
|
31
31
|
type: String,
|
32
32
|
default: null
|
33
33
|
},
|
34
|
-
apiKey: String
|
34
|
+
apiKey: String,
|
35
|
+
locale: {
|
36
|
+
type: String,
|
37
|
+
default: "en"
|
38
|
+
}
|
35
39
|
},
|
36
40
|
emits: ["update:location", "update:address", "update:country", "update:state", "update:city"],
|
37
41
|
setup(r, { emit: L }) {
|
38
|
-
const e = r, a = L, u =
|
39
|
-
let
|
40
|
-
|
42
|
+
const e = r, a = L, u = y(null), s = y(!1);
|
43
|
+
let c, i;
|
44
|
+
k(() => {
|
41
45
|
new Z({
|
42
46
|
apiKey: e.apiKey,
|
43
47
|
version: "weekly",
|
44
48
|
libraries: ["places"]
|
49
|
+
// language: props.locale,
|
45
50
|
}).load().then(() => {
|
46
|
-
|
51
|
+
c = new google.maps.Map(u.value, {
|
47
52
|
center: e.location,
|
48
53
|
zoom: 15,
|
49
54
|
mapTypeControl: !1,
|
50
55
|
fullscreenControl: !1,
|
51
56
|
disableDefaultUI: !0
|
52
|
-
}),
|
57
|
+
}), i = new google.maps.Marker({
|
53
58
|
position: e.location,
|
54
|
-
map:
|
59
|
+
map: c,
|
55
60
|
draggable: !0
|
56
|
-
}),
|
61
|
+
}), i.addListener("dragend", (o) => {
|
57
62
|
const n = { lat: o.latLng.lat(), lng: o.latLng.lng() };
|
58
63
|
a("update:location", n), g(n);
|
59
64
|
});
|
60
65
|
}).catch((o) => {
|
61
66
|
console.error(o);
|
62
67
|
});
|
63
|
-
}),
|
64
|
-
e.location &&
|
65
|
-
}),
|
66
|
-
if (e.location &&
|
68
|
+
}), h(() => {
|
69
|
+
e.location && i && i.setPosition(new google.maps.LatLng(e.location.lat, e.location.lng));
|
70
|
+
}), h(() => {
|
71
|
+
if (e.location && c) {
|
67
72
|
const t = new google.maps.LatLng(e.location.lat, e.location.lng);
|
68
|
-
|
73
|
+
c.setCenter(t), c.setZoom(15);
|
69
74
|
}
|
70
75
|
});
|
71
76
|
function g(t) {
|
@@ -83,7 +88,7 @@ const v = (r) => (E("data-v-20234f27"), r = r(), I(), r), K = { class: "pos-rela
|
|
83
88
|
console.error("Geocoder failed due to: " + f);
|
84
89
|
});
|
85
90
|
}
|
86
|
-
async function
|
91
|
+
async function b() {
|
87
92
|
s.value = !0, navigator.geolocation ? navigator.geolocation.getCurrentPosition((t) => {
|
88
93
|
const o = { lat: t.coords.latitude, lng: t.coords.longitude };
|
89
94
|
a("update:location", o), g(o), s.value = !1;
|
@@ -91,7 +96,7 @@ const v = (r) => (E("data-v-20234f27"), r = r(), I(), r), K = { class: "pos-rela
|
|
91
96
|
console.error("Error getting location"), s.value = !1;
|
92
97
|
}) : (console.error("Geolocation is not supported by this browser."), s.value = !1);
|
93
98
|
}
|
94
|
-
return (t, o) => (p(),
|
99
|
+
return (t, o) => (p(), w("div", K, [
|
95
100
|
d("div", {
|
96
101
|
ref_key: "mapContainer",
|
97
102
|
ref: u,
|
@@ -99,7 +104,7 @@ const v = (r) => (E("data-v-20234f27"), r = r(), I(), r), K = { class: "pos-rela
|
|
99
104
|
}, null, 512),
|
100
105
|
d("button", {
|
101
106
|
class: "cursor-pointer flex-center flex pos-absolute pos-t-regular pos-r-regular i-semi bg-second pd-nano radius-extra",
|
102
|
-
onClick:
|
107
|
+
onClick: b
|
103
108
|
}, [
|
104
109
|
x(M, {
|
105
110
|
name: "ScaleOut",
|
@@ -109,14 +114,14 @@ const v = (r) => (E("data-v-20234f27"), r = r(), I(), r), K = { class: "pos-rela
|
|
109
114
|
s.value ? (p(), V(B, {
|
110
115
|
key: 1,
|
111
116
|
class: "pos-t-0 pos-l-0 i-small"
|
112
|
-
})) : (p(),
|
117
|
+
})) : (p(), w("svg", G, P))
|
113
118
|
]),
|
114
119
|
_: 1
|
115
120
|
})
|
116
121
|
])
|
117
122
|
]));
|
118
123
|
}
|
119
|
-
}, F = /* @__PURE__ */ H(T, [["__scopeId", "data-v-
|
124
|
+
}, F = /* @__PURE__ */ H(T, [["__scopeId", "data-v-eecb8ce4"]]);
|
120
125
|
export {
|
121
126
|
F as default
|
122
127
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue");require("./Map.vue2.cjs");const
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),i=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("./Map.vue2.cjs");const s=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),p={__name:"Map",props:{location:Object,apiKey:String},setup(r){const e=r;let a=o.ref(null),l=null,t=null;return o.onMounted(async()=>{new i.Loader({apiKey:e.apiKey,version:"weekly",libraries:["places"]}).load().then(()=>{l=new google.maps.Map(a.value,{zoom:13,center:{lat:e.location.lat,lng:e.location.lng}}),t=new google.maps.Marker({position:{lat:e.location.lat,lng:e.location.lng},map:l})}).catch(n=>{console.error(n)})}),o.watch(()=>e.location,()=>{l&&t&&(t.setPosition(new google.maps.LatLng(e.location.lat,e.location.lng)),l.setCenter(new google.maps.LatLng(e.location.lat,e.location.lng)))},{deep:!0}),(c,n)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"gmap",ref:a,class:"gmap"},null,512))}},u=s.default(p,[["__scopeId","data-v-bd6db019"]]);exports.default=u;
|