@ozdao/martyrs 0.2.563 → 0.2.565

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/dist/abac-BPl9Bmf9.js +1527 -0
  2. package/dist/builder.js +51 -39
  3. package/dist/{common.schema-GFSlNJo7.js → common.schema-DswiUXKB.js} +1 -1
  4. package/dist/community.server.js +48 -9
  5. package/dist/core.server.js +6 -4
  6. package/dist/{crud-C7FSTUes.js → crud-q1ye5IhV.js} +7 -7
  7. package/dist/events.server.js +3 -3
  8. package/dist/gallery.server.js +2 -2
  9. package/dist/inventory.server.js +4 -6
  10. package/dist/{main-CmjWiDVF.js → main-B9o1iBAZ.js} +1279 -1287
  11. package/dist/marketplace.server.js +1 -1
  12. package/dist/martyrs/src/components/Button/Button.vue2.js +33 -42
  13. package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -1
  14. package/dist/martyrs/src/components/EditImages/{EditImages.vue.js → EditImages.vue2.js} +2 -2
  15. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -0
  16. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  17. package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js +1 -1
  18. package/dist/martyrs/src/components/FieldPhone/FieldPhone.vue.js.map +1 -1
  19. package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -2
  20. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
  21. package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
  22. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
  23. package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
  24. package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
  25. package/dist/martyrs/src/components/Tree/Tree.vue.js +6 -3
  26. package/dist/martyrs/src/components/Tree/Tree.vue.js.map +1 -1
  27. package/dist/martyrs/src/modules/auth/auth.client.js +10 -7
  28. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  29. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
  30. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  31. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
  32. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
  33. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
  34. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +12 -12
  35. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  36. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
  37. package/dist/martyrs/src/modules/auth/views/router/auth.router.js +116 -0
  38. package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -0
  39. package/dist/martyrs/src/modules/auth/views/router/users.router.js +180 -0
  40. package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -0
  41. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +3 -3
  42. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +1 -1
  43. package/dist/martyrs/src/modules/core/locales/en.js +45 -0
  44. package/dist/martyrs/src/modules/core/locales/en.js.map +1 -1
  45. package/dist/martyrs/src/modules/core/locales/ru.js +45 -0
  46. package/dist/martyrs/src/modules/core/locales/ru.js.map +1 -1
  47. package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js +9 -0
  48. package/dist/martyrs/src/modules/core/views/classes/i18n.manager.js.map +1 -1
  49. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue.js → Filters.vue2.js} +2 -2
  50. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +1 -0
  51. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
  52. package/dist/martyrs/src/modules/core/views/mixins/mixins.js +1 -2
  53. package/dist/martyrs/src/modules/core/views/mixins/mixins.js.map +1 -1
  54. package/dist/martyrs/src/modules/core/views/router/addRoutes.js +6 -1
  55. package/dist/martyrs/src/modules/core/views/router/addRoutes.js.map +1 -1
  56. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  57. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  58. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
  59. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  60. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
  61. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js.map +1 -1
  62. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  63. package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js +0 -16
  64. package/dist/martyrs/src/modules/marketplace/views/store/marketplace.js.map +1 -1
  65. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +4 -4
  66. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
  67. package/dist/martyrs/src/modules/notifications/components/pages/Notifications.vue.js +1 -1
  68. package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js +3 -0
  69. package/dist/martyrs/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue.js.map +1 -1
  70. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  71. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
  72. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  73. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  74. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  75. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  76. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  77. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  78. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
  79. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  80. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  81. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js +1 -1
  82. package/dist/martyrs/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
  83. package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js +15 -2
  84. package/dist/martyrs/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
  85. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +9 -6
  86. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  87. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +4 -3
  88. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  89. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +11 -2
  90. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  91. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  92. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +2 -2
  93. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
  94. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +11 -8
  95. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js.map +1 -1
  96. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  97. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  98. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +210 -60
  99. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js.map +1 -1
  100. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +3 -3
  101. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js.map +1 -1
  102. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  103. package/dist/martyrs.css +1 -1
  104. package/dist/martyrs.es.js +1 -1
  105. package/dist/music.server.js +11 -12
  106. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  107. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  108. package/dist/notifications.server.js +0 -3
  109. package/dist/orders.server.js +5 -6
  110. package/dist/organizations.server.js +9 -10
  111. package/dist/products.server.js +27 -26
  112. package/dist/{queryProcessor-CBQgZycY.js → queryProcessor-C_5Iipam.js} +4 -1
  113. package/dist/rents.server.js +2 -3
  114. package/dist/spots.server.js +1 -1
  115. package/dist/style.css +38 -23
  116. package/dist/{web-cNKIl_cL.js → web-BF3ijvEr.js} +1 -1
  117. package/package.json +1 -1
  118. package/src/builder/modes/ssr.rspack.dev.js +4 -3
  119. package/src/builder/rspack/rspack.config.api.js +15 -4
  120. package/src/builder/rspack/rspack.config.base.js +3 -3
  121. package/src/builder/rspack/rspack.config.ssr.client.js +28 -28
  122. package/src/builder/templates/page.js +2 -2
  123. package/src/components/Button/Button.vue +50 -37
  124. package/src/components/FieldPhone/FieldPhone.vue +1 -1
  125. package/src/components/Loader/Loader.vue +1 -1
  126. package/src/components/Tree/Tree.vue +6 -3
  127. package/src/modules/PROCESS.md +0 -0
  128. package/src/modules/TASKS.MD +17 -0
  129. package/src/modules/auth/auth.client.js +11 -7
  130. package/src/modules/auth/views/components/pages/SignIn.vue +1 -1
  131. package/src/modules/auth/views/router/auth.router.js +94 -0
  132. package/src/modules/auth/views/router/users.router.js +153 -0
  133. package/src/modules/backoffice/components/partials/Sidebar.vue +7 -7
  134. package/src/modules/community/community.server.js +8 -0
  135. package/src/modules/community/policies/blog.policies.js +55 -0
  136. package/src/modules/community/routes/blog.routes.js +1 -1
  137. package/src/modules/community/routes/comments.routes.js +1 -1
  138. package/src/modules/community/routes/reactions.routes.js +1 -4
  139. package/src/modules/core/controllers/classes/abac/abac.adapter.express.js +206 -124
  140. package/src/modules/core/controllers/classes/abac/abac.adapter.ws.js +203 -50
  141. package/src/modules/core/controllers/classes/abac/abac.core.js +127 -36
  142. package/src/modules/core/controllers/classes/abac/abac.fields.js +144 -179
  143. package/src/modules/core/controllers/classes/abac/abac.js +201 -10
  144. package/src/modules/core/controllers/classes/abac/abac.policies.js +147 -57
  145. package/src/modules/core/controllers/classes/crud/crud.policies.js +5 -5
  146. package/src/modules/core/controllers/policies/core.policies.js +5 -2
  147. package/src/modules/core/controllers/utils/queryProcessor.js +4 -1
  148. package/src/modules/core/core.server.js +1 -0
  149. package/src/modules/core/locales/en.js +45 -0
  150. package/src/modules/core/locales/ru.js +45 -0
  151. package/src/modules/core/models/schemas/common.schema.js +1 -1
  152. package/src/modules/core/views/classes/i18n.manager.js +13 -0
  153. package/src/modules/core/views/components/sections/filters/FilterPrice.vue +81 -0
  154. package/src/modules/core/views/mixins/mixins.js +1 -2
  155. package/src/modules/core/views/router/addRoutes.js +6 -1
  156. package/src/modules/events/routes/events.routes.js +1 -1
  157. package/src/modules/inventory/components/pages/InventoryEdit.vue +3 -3
  158. package/src/modules/inventory/policies/inventory.policies.js +1 -1
  159. package/src/modules/inventory/routes/inventory.routes.js +1 -1
  160. package/src/modules/marketplace/marketplace.router.js +66 -0
  161. package/src/modules/marketplace/views/components/layouts/Marketplace.vue +363 -0
  162. package/src/modules/marketplace/views/components/pages/Catalog.vue +73 -0
  163. package/src/modules/marketplace/views/store/marketplace.js +0 -16
  164. package/src/modules/music/controllers/stream.controller.js +1 -1
  165. package/src/modules/music/music.server.js +1 -1
  166. package/src/modules/music/policies/music.policies.js +3 -2
  167. package/src/modules/music/router/library.router.js +26 -0
  168. package/src/modules/music/router/music.router.js +176 -0
  169. package/src/modules/notifications/components/elements/NotificationBadge.vue +5 -6
  170. package/src/modules/notifications/notifications.server.js +1 -3
  171. package/src/modules/orders/components/elements/FieldSubscribeNewsletter.vue +5 -0
  172. package/src/modules/orders/orders.server.js +0 -1
  173. package/src/modules/organizations/components/blocks/CardOrganization.vue +2 -2
  174. package/src/modules/organizations/components/pages/DepartmentEdit.vue +2 -2
  175. package/src/modules/organizations/components/pages/OrganizationEdit.vue +2 -2
  176. package/src/modules/organizations/policies/organizations.policies.js +12 -6
  177. package/src/modules/organizations/routes/organizations.routes.js +1 -3
  178. package/src/modules/products/components/blocks/CardCategory.vue +1 -1
  179. package/src/modules/products/components/blocks/CardProduct.vue +16 -2
  180. package/src/modules/products/components/pages/Categories.vue +9 -6
  181. package/src/modules/products/components/pages/CategoryEdit.vue +8 -4
  182. package/src/modules/products/components/pages/Product.vue +11 -5
  183. package/src/modules/products/components/sections/SectionProduct.vue +11 -7
  184. package/src/modules/products/controllers/categories.controller.js +32 -27
  185. package/src/modules/products/routes/categories.routes.js +1 -1
  186. package/src/modules/rents/controllers/routes/rents.routes.js +1 -1
  187. package/src/modules/rents/views/components/pages/RentsEdit.vue +208 -49
  188. package/src/modules/spots/components/pages/Map.vue +2 -2
  189. package/dist/abac-DYoheWuc.js +0 -1031
  190. package/dist/core.abac-DUPBnlk6.js +0 -298
  191. package/dist/core.logger-C3q8A9dl.js +0 -51
  192. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +0 -1
  193. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
  194. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
  195. package/dist/martyrs/src/modules/auth/auth.router.js +0 -342
  196. package/dist/martyrs/src/modules/auth/auth.router.js.map +0 -1
  197. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +0 -1
  198. package/src/modules/auth/auth.router.js +0 -262
  199. package/src/modules/core/controllers/classes/abac/v2/abac-core-fixed.js +0 -313
  200. package/src/modules/core/controllers/classes/abac/v2/abac-express-fixed.js +0 -276
  201. package/src/modules/core/controllers/classes/abac/v2/abac-fields-fixed.js +0 -425
  202. package/src/modules/core/controllers/classes/abac/v2/abac-main-fixed.js +0 -295
  203. package/src/modules/core/controllers/classes/abac/v2/abac-policies-fixed.js +0 -316
  204. package/src/modules/core/controllers/classes/abac/v2/abac-ws-fixed.js +0 -237
  205. package/src/modules/core/controllers/classes/core.abac.js +0 -310
  206. package/src/modules/core/controllers/classes/core.crud.js +0 -89
  207. package/src/modules/governance/reactcode/eslint.config.js +0 -28
@@ -1,27 +1,45 @@
1
- import { ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, unref, withCtx, Fragment, renderList, createBlock, createCommentVNode } from "vue";
1
+ import { ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, unref, withCtx, Fragment, renderList, createBlock, createCommentVNode, createTextVNode } from "vue";
2
2
  import _sfc_main$4 from "../../../../../components/Block/Block.vue.js";
3
+ import _sfc_main$5 from "../../../../../components/Button/Button.vue2.js";
3
4
  import Field from "../../../../../components/Field/Field.vue.js";
4
5
  import _sfc_main$2 from "../../../../../components/Feed/Feed.vue.js";
5
6
  import _sfc_main$1 from "../../../../../components/Popup/Popup.vue.js";
7
+ import { useGlobalMixins } from "../../../../core/views/mixins/mixins.js";
6
8
  import _sfc_main$3 from "../../../../orders/components/blocks/CardOrderItem.vue.js";
7
9
  import { useRoute, useRouter } from "vue-router";
8
10
  import { state as state$2 } from "../../../../auth/views/store/auth.js";
9
11
  import { state as state$1, actions, mutations } from "../../store/rents.store.js";
10
12
  import { state, actions as actions$1 } from "../../../../products/store/products.js";
13
+ import variantsStore from "../../../../products/store/variants.store.js";
11
14
  /* empty css */
12
15
  const _hoisted_1 = { class: "pd-thin" };
13
16
  const _hoisted_2 = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" };
14
- const _hoisted_3 = { class: "bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" };
15
- const _hoisted_4 = { class: "flex gap-small" };
16
- const _hoisted_5 = { class: "gap-thin flex-v-center flex-nojustify flex" };
17
- const _hoisted_6 = { class: "mn-r-auto" };
17
+ const _hoisted_3 = { class: "gap-thin flex flex-column" };
18
+ const _hoisted_4 = ["onClick"];
19
+ const _hoisted_5 = {
20
+ key: 0,
21
+ class: "aspect-1x1 h-3r radius-small o-hidden"
22
+ };
23
+ const _hoisted_6 = ["src"];
24
+ const _hoisted_7 = { class: "t-medium" };
25
+ const _hoisted_8 = {
26
+ key: 0,
27
+ class: "t-small t-transp"
28
+ };
29
+ const _hoisted_9 = { class: "mn-l-auto" };
30
+ const _hoisted_10 = { class: "flex gap-small" };
31
+ const _hoisted_11 = { class: "gap-thin flex-v-center flex-nojustify flex" };
32
+ const _hoisted_12 = { class: "mn-r-auto" };
18
33
  const _sfc_main = {
19
34
  __name: "RentsEdit",
20
35
  setup(__props) {
21
36
  const route = useRoute();
22
37
  const router = useRouter();
38
+ const { formatPrice } = useGlobalMixins();
23
39
  const Products = ref(state.all);
24
40
  const isOpenProductsPopup = ref(false);
41
+ const isVariantsPopupOpen = ref(false);
42
+ const selectedProduct = ref({});
25
43
  const totalDays = computed(() => {
26
44
  const start = new Date(state$1.current.startDate);
27
45
  const end = new Date(state$1.current.endDate);
@@ -35,9 +53,40 @@ const _sfc_main = {
35
53
  function closeProductsPopup() {
36
54
  isOpenProductsPopup.value = false;
37
55
  }
38
- function addProduct(product) {
39
- state$1.current.product = product;
56
+ function closeVariantsPopup() {
57
+ isVariantsPopupOpen.value = false;
58
+ selectedProduct.value = {};
59
+ }
60
+ function selectProduct(product) {
61
+ selectedProduct.value = product;
40
62
  closeProductsPopup();
63
+ if (product.variants && product.variants.length === 1) {
64
+ addVariantToRent(product.variants[0]);
65
+ return;
66
+ }
67
+ isVariantsPopupOpen.value = true;
68
+ }
69
+ function formatProductName(product, variant) {
70
+ if (!variant || product.variants?.length === 1 && !variant.attributes?.length)
71
+ return product.name;
72
+ const attrs = variant.attributes?.map((a) => a.value).filter(Boolean);
73
+ if (attrs?.length) {
74
+ return `${product.name} / ${attrs.join(" / ")}`;
75
+ }
76
+ return variant.name || product.name;
77
+ }
78
+ function addVariantToRent(variant) {
79
+ state$1.current.product = {
80
+ _id: selectedProduct.value._id,
81
+ variant: variant._id,
82
+ name: formatProductName(selectedProduct.value, variant),
83
+ images: variant.images || selectedProduct.value.images || [],
84
+ price: variant.price || variant.cost || 0,
85
+ unit: variant.unit || "pcs",
86
+ quantity: 1,
87
+ listing: "rent"
88
+ };
89
+ closeVariantsPopup();
41
90
  }
42
91
  onMounted(async () => {
43
92
  try {
@@ -46,7 +95,7 @@ const _sfc_main = {
46
95
  } else {
47
96
  mutations.clean();
48
97
  }
49
- await actions$1.read({ organization: route.params._id, listing: "rent", limit: 100 });
98
+ await actions$1.read({ owner: route.params._id, listing: "rent", limit: 100 });
50
99
  Products.value = state.all;
51
100
  } catch (error) {
52
101
  console.error("Ошибка при загрузке данных:", error);
@@ -55,21 +104,30 @@ const _sfc_main = {
55
104
  async function onSubmit() {
56
105
  try {
57
106
  if (route.params.rent) {
58
- let newProduct = state$1.current;
59
- newProduct.product = state$1.current.product._id;
60
- newProduct.startDate = new Date(state$1.current.startDate);
61
- newProduct.endDate = new Date(state$1.current.endDate);
62
- await actions.update(newProduct);
107
+ const rentData = {
108
+ _id: state$1.current._id,
109
+ product: state$1.current.product._id,
110
+ variant: state$1.current.product.variant,
111
+ startDate: new Date(state$1.current.startDate),
112
+ endDate: new Date(state$1.current.endDate),
113
+ comment: state$1.current.comment,
114
+ status: state$1.current.status
115
+ };
116
+ await actions.update(rentData);
63
117
  } else {
64
- state$1.current.creator = { type: "user", target: state$2.user._id };
65
- state$1.current.owner = { type: "organization", target: route.params._id };
66
- state$1.current.owner = { type: "organization", target: route.params._id };
67
- let newProduct = state$1.current;
68
- newProduct.product = state$1.current.product._id;
69
- newProduct.startDate = new Date(state$1.current.startDate);
70
- newProduct.endDate = new Date(state$1.current.endDate);
71
- await actions.create(newProduct);
118
+ const rentData = {
119
+ product: state$1.current.product._id,
120
+ variant: state$1.current.product.variant,
121
+ startDate: new Date(state$1.current.startDate),
122
+ endDate: new Date(state$1.current.endDate),
123
+ comment: state$1.current.comment || "",
124
+ status: state$1.current.status || "active",
125
+ creator: { type: "user", target: state$2.user._id },
126
+ owner: { type: "organization", target: route.params._id }
127
+ };
128
+ await actions.create(rentData);
72
129
  }
130
+ router.push({ name: "Rents", params: { _id: route.params._id } });
73
131
  } catch (error) {
74
132
  console.error("Ошибка при отправке данных:", error);
75
133
  }
@@ -102,30 +160,104 @@ const _sfc_main = {
102
160
  title: "Add Product to Rent",
103
161
  onClosePopup: closeProductsPopup,
104
162
  isPopupOpen: isOpenProductsPopup.value,
105
- class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
163
+ class: "bg-white w-100 w-max-30r radius-medium pd-medium"
106
164
  }, {
107
165
  default: withCtx(() => [
108
- createElementVNode("div", _hoisted_3, [
109
- createVNode(_sfc_main$2, {
110
- search: true,
111
- states: { empty: { title: "No Products Found", description: "No products available for rent." } },
112
- store: { read: (options) => actions$1.read(options) },
113
- options: { organization: unref(route).params._id, listing: "rent" }
114
- }, {
115
- default: withCtx(({ items }) => [
116
- (openBlock(true), createElementBlock(Fragment, null, renderList(items, (product) => {
117
- return openBlock(), createBlock(_sfc_main$3, {
118
- key: product._id,
119
- editable: false,
120
- product,
121
- onClick: ($event) => addProduct(product),
122
- class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
123
- }, null, 8, ["product", "onClick"]);
166
+ createVNode(_sfc_main$2, {
167
+ search: {
168
+ class: "bg-light radius-small"
169
+ },
170
+ states: {
171
+ empty: {
172
+ title: "No Products Found",
173
+ description: "No products available for rent."
174
+ }
175
+ },
176
+ store: {
177
+ read: (options) => actions$1.read(options),
178
+ state: null
179
+ },
180
+ options: {
181
+ owner: unref(route).params._id,
182
+ listing: "rent"
183
+ },
184
+ class: "flex-column flex gap-thin h-max-20r o-scroll"
185
+ }, {
186
+ default: withCtx(({ items }) => [
187
+ (openBlock(true), createElementBlock(Fragment, null, renderList(items, (product, index) => {
188
+ return openBlock(), createBlock(_sfc_main$3, {
189
+ key: `${product._id}_${product.variant || "no-variant"}_${index}`,
190
+ editable: false,
191
+ productId: product._id,
192
+ variantId: product.variant,
193
+ images: product.images,
194
+ name: product.name,
195
+ quantity: product.quantity || 1,
196
+ unit: product.unit,
197
+ dates: product.date,
198
+ listing: product.listing,
199
+ price: product.price,
200
+ onClick: () => selectProduct(product),
201
+ class: "bg-light pd-small radius-small w-100"
202
+ }, null, 8, ["productId", "variantId", "images", "name", "quantity", "unit", "dates", "listing", "price", "onClick"]);
203
+ }), 128))
204
+ ]),
205
+ _: 1
206
+ }, 8, ["store", "options"])
207
+ ]),
208
+ _: 1
209
+ }, 8, ["isPopupOpen"]),
210
+ createVNode(_sfc_main$1, {
211
+ title: "Select variant",
212
+ onClosePopup: closeVariantsPopup,
213
+ isPopupOpen: isVariantsPopupOpen.value,
214
+ class: "bg-white w-100 w-max-30r radius-medium pd-medium"
215
+ }, {
216
+ default: withCtx(() => [
217
+ createVNode(_sfc_main$2, {
218
+ store: unref(variantsStore),
219
+ options: {
220
+ product: selectedProduct.value._id
221
+ },
222
+ skeleton: {
223
+ structure: [
224
+ { block: "text", size: "small" },
225
+ { block: "text", size: "medium" },
226
+ { block: "text", size: "small" }
227
+ ]
228
+ },
229
+ states: {
230
+ empty: {
231
+ title: "No variants",
232
+ description: "Create your first variant"
233
+ }
234
+ }
235
+ }, {
236
+ default: withCtx(({ items }) => [
237
+ createElementVNode("div", _hoisted_3, [
238
+ (openBlock(true), createElementBlock(Fragment, null, renderList(items, (variant, index) => {
239
+ return openBlock(), createElementBlock("div", {
240
+ key: index,
241
+ onClick: ($event) => addVariantToRent(variant),
242
+ class: "w-100 cursor-pointer hover-scale-1 bg-light pd-small radius-small flex-v-center flex-nowrap flex gap-thin"
243
+ }, [
244
+ variant.images && variant.images.length ? (openBlock(), createElementBlock("div", _hoisted_5, [
245
+ createElementVNode("img", {
246
+ src: (_ctx.FILE_SERVER_URL || "") + variant.images[0],
247
+ class: "w-100 h-100 object-fit-cover"
248
+ }, null, 8, _hoisted_6)
249
+ ])) : createCommentVNode("", true),
250
+ createElementVNode("div", null, [
251
+ createElementVNode("p", _hoisted_7, toDisplayString(variant.name || "Default variant"), 1),
252
+ variant.attributes && variant.attributes.length ? (openBlock(), createElementBlock("p", _hoisted_8, toDisplayString(variant.attributes.map((attr) => `${attr.name}: ${attr.value}`).join(", ")), 1)) : createCommentVNode("", true)
253
+ ]),
254
+ createElementVNode("p", _hoisted_9, toDisplayString(unref(formatPrice)(variant.price || variant.cost)), 1)
255
+ ], 8, _hoisted_4);
124
256
  }), 128))
125
- ]),
126
- _: 1
127
- }, 8, ["store", "options"])
128
- ])
257
+ ])
258
+ ]),
259
+ _: 1
260
+ }, 8, ["store", "options"])
129
261
  ]),
130
262
  _: 1
131
263
  }, 8, ["isPopupOpen"]),
@@ -134,7 +266,7 @@ const _sfc_main = {
134
266
  class: "mn-b-semi"
135
267
  }, {
136
268
  default: withCtx(() => [
137
- createElementVNode("div", _hoisted_4, [
269
+ createElementVNode("div", _hoisted_10, [
138
270
  createVNode(Field, {
139
271
  field: state$1.current.startDate,
140
272
  "onUpdate:field": _cache[0] || (_cache[0] = ($event) => state$1.current.startDate = $event),
@@ -154,8 +286,8 @@ const _sfc_main = {
154
286
  _: 1
155
287
  }),
156
288
  createVNode(_sfc_main$4, {
157
- title: "Rented Products",
158
- actions: [{ label: "+", function: openProductsPopup }],
289
+ title: "Rented Product",
290
+ actions: state$1.current.product ? [] : [{ label: "+", function: openProductsPopup }],
159
291
  placeholder: "No products added yet",
160
292
  class: "mn-b-semi"
161
293
  }, {
@@ -168,7 +300,10 @@ const _sfc_main = {
168
300
  name: state$1.current.product.name,
169
301
  quantity: state$1.current.product.quantity || 1,
170
302
  unit: state$1.current.product.unit,
171
- dates: state$1.current.product.date,
303
+ dates: {
304
+ start: state$1.current.startDate,
305
+ end: state$1.current.endDate
306
+ },
172
307
  listing: state$1.current.product.listing,
173
308
  price: state$1.current.product.price,
174
309
  editable: false,
@@ -195,21 +330,36 @@ const _sfc_main = {
195
330
  }),
196
331
  createVNode(_sfc_main$4, null, {
197
332
  default: withCtx(() => [
198
- createElementVNode("section", _hoisted_5, [
199
- createElementVNode("h3", _hoisted_6, "Total Days: " + toDisplayString(totalDays.value), 1),
200
- createElementVNode("a", {
201
- onClick: onSubmit,
202
- class: "bg-main button"
203
- }, "Save"),
204
- createElementVNode("a", {
205
- onClick: onReset,
206
- class: "t-white bg-second button"
207
- }, "Reset"),
208
- unref(route).params._id ? (openBlock(), createElementBlock("a", {
333
+ createElementVNode("section", _hoisted_11, [
334
+ createElementVNode("h3", _hoisted_12, "Total Days: " + toDisplayString(totalDays.value), 1),
335
+ createVNode(_sfc_main$5, {
336
+ submit: onSubmit,
337
+ class: "pd-small radius-medium bg-main t-black uppercase t-medium"
338
+ }, {
339
+ default: withCtx(() => _cache[4] || (_cache[4] = [
340
+ createTextVNode(" Save ")
341
+ ])),
342
+ _: 1
343
+ }),
344
+ createVNode(_sfc_main$5, {
345
+ submit: onReset,
346
+ class: "pd-small radius-medium t-white bg-second uppercase t-medium"
347
+ }, {
348
+ default: withCtx(() => _cache[5] || (_cache[5] = [
349
+ createTextVNode(" Reset ")
350
+ ])),
351
+ _: 1
352
+ }),
353
+ unref(route).params._id ? (openBlock(), createBlock(_sfc_main$5, {
209
354
  key: 0,
210
- onClick: onDelete,
211
- class: "t-white bg-red button"
212
- }, "Delete")) : createCommentVNode("", true)
355
+ submit: onDelete,
356
+ class: "pd-small radius-medium t-white bg-red uppercase t-medium"
357
+ }, {
358
+ default: withCtx(() => _cache[6] || (_cache[6] = [
359
+ createTextVNode(" Delete ")
360
+ ])),
361
+ _: 1
362
+ })) : createCommentVNode("", true)
213
363
  ])
214
364
  ]),
215
365
  _: 1
@@ -1 +1 @@
1
- {"version":3,"file":"RentsEdit.vue.js","sources":["../../../../../../../../src/modules/rents/views/components/pages/RentsEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin\">\n <header class=\"mn-b-medium gap-small flex-v-center flex-nowrap flex\">\n <h2>{{ route.params._id ? 'Edit' : 'Add' }} Rent</h2>\n </header>\n\n <Popup \n title=\"Add Product to Rent\" \n @close-popup=\"closeProductsPopup\" \n :isPopupOpen=\"isOpenProductsPopup\"\n class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n >\n <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n <Feed\n :search=\"true\"\n :states=\"{ empty: { title: 'No Products Found', description: 'No products available for rent.' } }\"\n :store=\"{ read: (options) => products.actions.read(options) }\"\n :options=\"{ organization: route.params._id, listing: 'rent' }\"\n v-slot=\"{ items }\"\n >\n <CardOrderItem\n v-for=\"product in items\" \n :key=\"product._id\"\n :editable=\"false\" \n :product=\"product\" \n @click=\"addProduct(product)\"\n class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n />\n </Feed>\n </div>\n </Popup>\n\n <Block title=\"Rent Period\" class=\"mn-b-semi\">\n <div class=\"flex gap-small\">\n <Field v-model:field=\"rents.state.current.startDate\" label=\"Start Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n <Field v-model:field=\"rents.state.current.endDate\" label=\"End Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n </div>\n </Block>\n\n <Block\n title=\"Rented Products\"\n :actions=\"[{ label: '+', function: openProductsPopup }]\"\n placeholder=\"No products added yet\"\n class=\"mn-b-semi\"\n >\n <CardOrderItem\n v-if=\"rents.state.current.product\"\n :key=\"rents.state.current.product._id\" \n :productId=\"rents.state.current.product._id\"\n :variantId=\"rents.state.current.product.variant\"\n :images=\"rents.state.current.product.images\"\n :name=\"rents.state.current.product.name\"\n :quantity=\"rents.state.current.product.quantity || 1\"\n :unit=\"rents.state.current.product.unit\"\n :dates=\"rents.state.current.product.date\"\n :listing=\"rents.state.current.product.listing\"\n :price=\"rents.state.current.product.price\"\n :editable=\"false\" \n @click=\"() => rents.state.current.product = null\"\n class=\"mn-b-small radius-medium bg-white pd-small\"\n />\n </Block>\n\n <Block title=\"Comment\" class=\"mn-b-semi\">\n <Field v-model:field=\"rents.state.current.comment\" label=\"Comment\" type=\"textarea\" class=\"w-100 bg-white radius-small pd-medium\" /> \n </Block>\n\n <Block>\n <section class=\"gap-thin flex-v-center flex-nojustify flex\">\n <h3 class=\"mn-r-auto\">Total Days: {{ totalDays }}</h3>\n <a @click=\"onSubmit\" class=\"bg-main button\">Save</a> \n <a @click=\"onReset\" class=\"t-white bg-second button\">Reset</a>\n <a v-if=\"route.params._id\" @click=\"onDelete\" class=\"t-white bg-red button\">Delete</a>\n </section>\n </Block>\n </div>\n</template>\n\n<script setup>\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\nimport CardPosition from '@martyrs/src/modules/products/components/blocks/CardPosition.vue';\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';\n\nimport { computed, onMounted, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport * as rents from '@martyrs/src/modules/rents/views/store/rents.store';\nimport * as products from '@martyrs/src/modules/products/store/products.js';\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst Products = ref(products.state.all);\nconst isOpenProductsPopup = ref(false);\n\nconst totalDays = computed(() => {\n const start = new Date(rents.state.current.startDate);\n const end = new Date(rents.state.current.endDate);\n if (!start || !end) return 0;\n const diffTime = Math.abs(end - start);\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n});\n\nfunction openProductsPopup() { isOpenProductsPopup.value = true; }\nfunction closeProductsPopup() { isOpenProductsPopup.value = false; }\n\nfunction addProduct(product) {\n rents.state.current.product = product\n closeProductsPopup();\n}\n\nfunction updateItem(index, updatedItem) {\n rents.state.current.items[index] = { product: updatedItem.product._id || updatedItem.product, quantity: updatedItem.quantity || 1 };\n}\n\nfunction deleteItem(index) {\n try {\n rents.state.current.items.splice(index, 1);\n } catch (error) {\n console.error('Ошибка при удалении элемента:', error);\n }\n}\n\nonMounted(async () => {\n try {\n if (route.params.rent) {\n await rents.actions.read({ _id: route.params.rent });\n } else {\n rents.mutations.clean();\n }\n\n await products.actions.read({ organization: route.params._id, listing: 'rent', limit: 100 });\n Products.value = products.state.all;\n } catch (error) {\n console.error('Ошибка при загрузке данных:', error);\n }\n});\n\nasync function onSubmit() {\n try {\n if (route.params.rent) {\n let newProduct = rents.state.current\n newProduct.product = rents.state.current.product._id\n newProduct.startDate = new Date(rents.state.current.startDate);\n newProduct.endDate = new Date(rents.state.current.endDate);\n await rents.actions.update(newProduct);\n } else {\n rents.state.current.creator = { type: 'user', target: auth.state.user._id };\n rents.state.current.owner = { type: 'organization', target: route.params._id };\n rents.state.current.owner = { type: 'organization', target: route.params._id };\n let newProduct = rents.state.current\n newProduct.product = rents.state.current.product._id\n newProduct.startDate = new Date(rents.state.current.startDate);\n newProduct.endDate = new Date(rents.state.current.endDate);\n await rents.actions.create(newProduct);\n }\n // router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при отправке данных:', error);\n }\n}\n\nasync function onReset() {\n try {\n if (route.params._id) {\n await rents.actions.read({ _id: route.params._id });\n } else {\n rents.mutations.clean();\n }\n } catch (error) {\n console.error('Ошибка при сбросе данных:', error);\n }\n}\n\nasync function onDelete() {\n try {\n await rents.actions.delete(route.params._id);\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при удалении:', error);\n }\n}\n\n</script>\n\n<style lang=\"scss\">\n.round-stat {\n padding: 1rem;\n border-radius: 5rem;\n width: 3rem;\n height: 3rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(0,0,0,0.1);\n}\n</style>"],"names":["products.state","rents.state","rents.actions","rents.mutations","products.actions","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4FA,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,WAAW,IAAIA,MAAe,GAAG;AACvC,UAAM,sBAAsB,IAAI,KAAK;AAErC,UAAM,YAAY,SAAS,MAAM;AAC/B,YAAM,QAAQ,IAAI,KAAKC,QAAY,QAAQ,SAAS;AACpD,YAAM,MAAM,IAAI,KAAKA,QAAY,QAAQ,OAAO;AAChD,UAAI,CAAC,SAAS,CAAC,IAAK,QAAO;AAC3B,YAAM,WAAW,KAAK,IAAI,MAAM,KAAK;AACrC,aAAO,KAAK,KAAK,YAAY,MAAO,KAAK,KAAK,GAAG;AAAA,IACnD,CAAC;AAED,aAAS,oBAAoB;AAAE,0BAAoB,QAAQ;AAAA,IAAM;AACjE,aAAS,qBAAqB;AAAE,0BAAoB,QAAQ;AAAA,IAAO;AAEnE,aAAS,WAAW,SAAS;AAC3BA,cAAY,QAAQ,UAAU;AAC9B,yBAAkB;AAAA,IACpB;AAcA,cAAU,YAAY;AACpB,UAAI;AACF,YAAI,MAAM,OAAO,MAAM;AACrB,gBAAMC,QAAc,KAAK,EAAE,KAAK,MAAM,OAAO,MAAM;AAAA,QACrD,OAAO;AACLC,oBAAgB,MAAK;AAAA,QACvB;AAEA,cAAMC,UAAiB,KAAK,EAAE,cAAc,MAAM,OAAO,KAAK,SAAS,QAAQ,OAAO,IAAG,CAAE;AAC3F,iBAAS,QAAQJ,MAAe;AAAA,MAClC,SAAS,OAAO;AACd,gBAAQ,MAAM,+BAA+B,KAAK;AAAA,MACpD;AAAA,IACF,CAAC;AAED,mBAAe,WAAW;AACxB,UAAI;AACF,YAAI,MAAM,OAAO,MAAM;AACrB,cAAI,aAAaC,QAAY;AAC7B,qBAAW,UAAUA,QAAY,QAAQ,QAAQ;AACjD,qBAAW,YAAY,IAAI,K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RentsEdit.vue.js","sources":["../../../../../../../../src/modules/rents/views/components/pages/RentsEdit.vue"],"sourcesContent":["<template>\n <div class=\"pd-thin\">\n <header class=\"mn-b-medium gap-small flex-v-center flex-nowrap flex\">\n <h2>{{ route.params._id ? 'Edit' : 'Add' }} Rent</h2>\n </header>\n\n <Popup\n title=\"Add Product to Rent\"\n @close-popup=\"closeProductsPopup\"\n :isPopupOpen=\"isOpenProductsPopup\"\n class=\"bg-white w-100 w-max-30r radius-medium pd-medium\"\n >\n <Feed\n :search=\"{\n class: 'bg-light radius-small'\n }\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'No products available for rent.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: null\n }\"\n :options=\"{\n owner: route.params._id,\n listing: 'rent'\n }\"\n v-slot=\"{ items }\"\n class=\"flex-column flex gap-thin h-max-20r o-scroll\"\n >\n <CardOrderItem\n v-for=\"(product, index) in items\"\n :key=\"`${product._id}_${product.variant || 'no-variant'}_${index}`\"\n :editable=\"false\"\n :productId=\"product._id\"\n :variantId=\"product.variant\"\n :images=\"product.images\"\n :name=\"product.name\"\n :quantity=\"product.quantity || 1\"\n :unit=\"product.unit\"\n :dates=\"product.date\"\n :listing=\"product.listing\"\n :price=\"product.price\"\n @click=\"() => selectProduct(product)\"\n class=\"bg-light pd-small radius-small w-100\"\n />\n </Feed>\n </Popup>\n\n <!-- Popup for selecting variant of the product -->\n <Popup\n title=\"Select variant\"\n @close-popup=\"closeVariantsPopup\"\n :isPopupOpen=\"isVariantsPopupOpen\"\n class=\"bg-white w-100 w-max-30r radius-medium pd-medium\"\n >\n <Feed\n :store=\"variants\"\n :options=\"{\n product: selectedProduct._id,\n }\"\n :skeleton=\"{\n structure: [\n { block: 'text', size: 'small' },\n { block: 'text', size: 'medium' },\n { block: 'text', size: 'small' }\n ]\n }\"\n :states=\"{\n empty: {\n title: 'No variants',\n description: 'Create your first variant'\n }\n }\"\n v-slot=\"{ items }\"\n >\n <div class=\"gap-thin flex flex-column\">\n <div\n v-for=\"(variant, index) in items\"\n :key=\"index\"\n @click=\"addVariantToRent(variant)\"\n class=\"w-100 cursor-pointer hover-scale-1 bg-light pd-small radius-small flex-v-center flex-nowrap flex gap-thin\"\n >\n <div v-if=\"variant.images && variant.images.length\" class=\"aspect-1x1 h-3r radius-small o-hidden\">\n <img\n :src=\"(FILE_SERVER_URL || '') + variant.images[0]\"\n class=\"w-100 h-100 object-fit-cover\"\n />\n </div>\n <div>\n <p class=\"t-medium\">{{ variant.name || 'Default variant' }}</p>\n <p v-if=\"variant.attributes && variant.attributes.length\" class=\"t-small t-transp\">\n {{ variant.attributes.map(attr => `${attr.name}: ${attr.value}`).join(', ') }}\n </p>\n </div>\n <p class=\"mn-l-auto\">{{ formatPrice(variant.price || variant.cost) }}</p>\n </div>\n </div>\n </Feed>\n </Popup>\n\n <Block title=\"Rent Period\" class=\"mn-b-semi\">\n <div class=\"flex gap-small\">\n <Field v-model:field=\"rents.state.current.startDate\" label=\"Start Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n <Field v-model:field=\"rents.state.current.endDate\" label=\"End Date\" type=\"date\" class=\"w-100 bg-white radius-small pd-medium\" />\n </div>\n </Block>\n\n <Block\n title=\"Rented Product\"\n :actions=\"rents.state.current.product ? [] : [{ label: '+', function: openProductsPopup }]\"\n placeholder=\"No products added yet\"\n class=\"mn-b-semi\"\n >\n <CardOrderItem\n v-if=\"rents.state.current.product\"\n :key=\"rents.state.current.product._id\"\n :productId=\"rents.state.current.product._id\"\n :variantId=\"rents.state.current.product.variant\"\n :images=\"rents.state.current.product.images\"\n :name=\"rents.state.current.product.name\"\n :quantity=\"rents.state.current.product.quantity || 1\"\n :unit=\"rents.state.current.product.unit\"\n :dates=\"{\n start: rents.state.current.startDate,\n end: rents.state.current.endDate\n }\"\n :listing=\"rents.state.current.product.listing\"\n :price=\"rents.state.current.product.price\"\n :editable=\"false\"\n @click=\"() => rents.state.current.product = null\"\n class=\"mn-b-small radius-medium bg-white pd-small\"\n />\n </Block>\n\n <Block title=\"Comment\" class=\"mn-b-semi\">\n <Field v-model:field=\"rents.state.current.comment\" label=\"Comment\" type=\"textarea\" class=\"w-100 bg-white radius-small pd-medium\" /> \n </Block>\n\n <Block>\n <section class=\"gap-thin flex-v-center flex-nojustify flex\">\n <h3 class=\"mn-r-auto\">Total Days: {{ totalDays }}</h3>\n\n <Button\n :submit=\"onSubmit\"\n class=\"pd-small radius-medium bg-main t-black uppercase t-medium\"\n >\n Save\n </Button>\n\n <Button\n :submit=\"onReset\"\n class=\"pd-small radius-medium t-white bg-second uppercase t-medium\"\n >\n Reset\n </Button>\n\n <Button\n v-if=\"route.params._id\"\n :submit=\"onDelete\"\n class=\"pd-small radius-medium t-white bg-red uppercase t-medium\"\n >\n Delete\n </Button>\n </section>\n </Block>\n </div>\n</template>\n\n<script setup>\nimport Block from '@martyrs/src/components/Block/Block.vue';\nimport Button from '@martyrs/src/components/Button/Button.vue';\nimport Field from '@martyrs/src/components/Field/Field.vue';\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport Popup from '@martyrs/src/components/Popup/Popup.vue';\nimport CardPosition from '@martyrs/src/modules/products/components/blocks/CardPosition.vue';\nimport CardOrderItem from '@martyrs/src/modules/orders/components/blocks/CardOrderItem.vue';\n\nimport { computed, onMounted, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js';\n\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport * as rents from '@martyrs/src/modules/rents/views/store/rents.store';\nimport * as products from '@martyrs/src/modules/products/store/products.js';\nimport variants from '@martyrs/src/modules/products/store/variants.store.js';\n\nconst route = useRoute();\nconst router = useRouter();\nconst { formatPrice } = useGlobalMixins();\n\nconst Products = ref(products.state.all);\nconst isOpenProductsPopup = ref(false);\nconst isVariantsPopupOpen = ref(false);\nconst selectedProduct = ref({});\n\nconst totalDays = computed(() => {\n const start = new Date(rents.state.current.startDate);\n const end = new Date(rents.state.current.endDate);\n if (!start || !end) return 0;\n const diffTime = Math.abs(end - start);\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n});\n\nfunction openProductsPopup() {\n isOpenProductsPopup.value = true;\n}\n\nfunction closeProductsPopup() {\n isOpenProductsPopup.value = false;\n}\n\nfunction closeVariantsPopup() {\n isVariantsPopupOpen.value = false;\n selectedProduct.value = {};\n}\n\nfunction selectProduct(product) {\n selectedProduct.value = product;\n closeProductsPopup();\n\n // If product has only one variant, add it directly without showing popup\n if (product.variants && product.variants.length === 1) {\n addVariantToRent(product.variants[0]);\n return;\n }\n\n // If product has multiple variants or no variants defined, show popup\n isVariantsPopupOpen.value = true;\n}\n\nfunction formatProductName(product, variant) {\n if (!variant || product.variants?.length === 1 && !(variant.attributes?.length))\n return product.name;\n\n const attrs = variant.attributes?.map(a => a.value).filter(Boolean);\n if (attrs?.length) {\n return `${product.name} / ${attrs.join(' / ')}`;\n }\n\n // Если variant.name уже содержит product.name, не дублируем\n return variant.name || product.name;\n}\n\nfunction addVariantToRent(variant) {\n // Create product object with variant information\n rents.state.current.product = {\n _id: selectedProduct.value._id,\n variant: variant._id,\n name: formatProductName(selectedProduct.value, variant),\n images: variant.images || selectedProduct.value.images || [],\n price: variant.price || variant.cost || 0,\n unit: variant.unit || 'pcs',\n quantity: 1,\n listing: 'rent'\n };\n\n closeVariantsPopup();\n}\n\nfunction updateItem(index, updatedItem) {\n rents.state.current.items[index] = { product: updatedItem.product._id || updatedItem.product, quantity: updatedItem.quantity || 1 };\n}\n\nfunction deleteItem(index) {\n try {\n rents.state.current.items.splice(index, 1);\n } catch (error) {\n console.error('Ошибка при удалении элемента:', error);\n }\n}\n\nonMounted(async () => {\n try {\n if (route.params.rent) {\n await rents.actions.read({ _id: route.params.rent });\n } else {\n rents.mutations.clean();\n }\n\n await products.actions.read({ owner: route.params._id, listing: 'rent', limit: 100 });\n Products.value = products.state.all;\n } catch (error) {\n console.error('Ошибка при загрузке данных:', error);\n }\n});\n\nasync function onSubmit() {\n try {\n if (route.params.rent) {\n // Update existing rent\n const rentData = {\n _id: rents.state.current._id,\n product: rents.state.current.product._id,\n variant: rents.state.current.product.variant,\n startDate: new Date(rents.state.current.startDate),\n endDate: new Date(rents.state.current.endDate),\n comment: rents.state.current.comment,\n status: rents.state.current.status\n };\n await rents.actions.update(rentData);\n } else {\n // Create new rent - БЕЗ _id!\n const rentData = {\n product: rents.state.current.product._id,\n variant: rents.state.current.product.variant,\n startDate: new Date(rents.state.current.startDate),\n endDate: new Date(rents.state.current.endDate),\n comment: rents.state.current.comment || '',\n status: rents.state.current.status || 'active',\n creator: { type: 'user', target: auth.state.user._id },\n owner: { type: 'organization', target: route.params._id }\n };\n await rents.actions.create(rentData);\n }\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при отправке данных:', error);\n }\n}\n\nasync function onReset() {\n try {\n if (route.params._id) {\n await rents.actions.read({ _id: route.params._id });\n } else {\n rents.mutations.clean();\n }\n } catch (error) {\n console.error('Ошибка при сбросе данных:', error);\n }\n}\n\nasync function onDelete() {\n try {\n await rents.actions.delete(route.params._id);\n router.push({ name: 'Rents', params: { _id: route.params._id } });\n } catch (error) {\n console.error('Ошибка при удалении:', error);\n }\n}\n\n</script>\n\n<style lang=\"scss\">\n.round-stat {\n padding: 1rem;\n border-radius: 5rem;\n width: 3rem;\n height: 3rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid rgba(0,0,0,0.1);\n}\n</style>"],"names":["products.state","rents.state","rents.actions","rents.mutations","products.actions","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8LA,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AACxB,UAAM,EAAE,YAAW,IAAK,gBAAe;AAEvC,U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@@ -432,7 +432,7 @@ const _sfc_main = {
432
432
  }
433
433
  });
434
434
  marker.addListener("click", () => {
435
- router.push({ name: "Organization", params: { _id: org._id } });
435
+ router.push("/organizations/" + org._id);
436
436
  });
437
437
  return marker;
438
438
  }
@@ -494,7 +494,7 @@ const _sfc_main = {
494
494
  }
495
495
  });
496
496
  marker.addListener("click", () => {
497
- router.push({ name: "Organization", params: { _id: org._id } });
497
+ router.push("/organizations/" + org._id);
498
498
  });
499
499
  return marker;
500
500
  }
@@ -525,7 +525,7 @@ const _sfc_main = {
525
525
  };
526
526
  }
527
527
  };
528
- const Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-31c24ebe"]]);
528
+ const Map = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e9370e2c"]]);
529
529
  export {
530
530
  Map as default
531
531
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Map.vue.js","sources":["../../../../../../../src/modules/spots/components/pages/Map.vue"],"sourcesContent":["<template>\n <div class=\"h-100 w-100 pos-relative\">\n <div class=\"w-100 pos-absolute z-index-2 pos-b-10 \">\n <Button \n :submit=\"searchInCurrentLocation\" \n class=\"mn-l-auto mn-r-auto bg-black t-white w-min-20 button\"\n >\n Search in This Location\n </Button>\n </div>\n\n <div id=\"map\" class=\"h-100 w-100 pos-relative o-hidden\">\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted, watch, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router'\n\nimport { Loader as GMLoader } from \"@googlemaps/js-api-loader\";\n\nimport Button from '@martyrs/src/components/Button/Button.vue'\n\nimport { state, actions } from '@martyrs/src/modules/organizations/store/organizations.js'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js';\nimport * as marketplace from '@martyrs/src/modules/marketplace/views/store/marketplace.js';\n\nconst store = useStore();\n\nconst router = useRouter();\nconst route = useRoute();\n\nconst props = defineProps({\n localPosition: Object,\n location: {\n type: Object,\n default: () => ({ lat: 15.8700, lng: 100.9925 })\n },\n address: {\n type: String,\n default: null\n },\n apiKey: String,\n locale: {\n type: String,\n default: 'en'\n }\n})\n\nlet map = ref(null);\nlet markers = ref([]);\n\nlet skip = ref(0);\nlet limit = ref(50);\n\nlet currentMapCenter = ref({lat: 0, lng: 0});\nlet currentMapZoom = ref(null);\n\nasync function getCountry() {\n try {\n const response = await fetch('https://ip2c.org/s');\n const result = await response.text();\n\n if (!result || result[0] !== '1') {\n throw new Error('Unable to fetch the country');\n }\n\n // Разделение строки и извлечение кода страны\n const parts = result.split(';');\n if (parts.length < 4) {\n throw new Error('Invalid response format');\n }\n\n console.log(parts[3])\n\n return parts[3]; // Возвращает двухбуквенный код страны\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n\n\nonMounted(async () => {\n let lat = parseFloat(route.query.lat || store.core.state.position?.location?.lat);\n let lng = parseFloat(route.query.lng || store.core.state.position?.location?.lng);\n\n let zoomLevel;\n\n // Определите уровень зума в зависимости от доступной информации\n if (route.params.location || store.core.state.position?.location) {\n zoomLevel = 15;\n } else if (route.params.country || store.core.state.position?.country) {\n zoomLevel = 9;\n } else if (route.params.state || store.core.state.position?.state) {\n zoomLevel = 6;\n } else if (route.params.city || store.core.state.position?.city) {\n zoomLevel = 14;\n } else {\n zoomLevel = 2;\n }\n\n const loader = new GMLoader({\n apiKey: props.apiKey,\n version: \"weekly\",\n libraries: [\"places\"],\n language: 'en'\n });\n\n loader.load().then(async () => {\n\n // Если координаты не заданы, попробуйте их получить\n if (!lat || !lng) {\n let country\n\n const geocoder = new google.maps.Geocoder();\n\n try {\n country = await getCountry();\n } catch {\n country = 'Thailand' \n console.log(error)\n }\n\n try {\n const results = await geocoder.geocode({ 'address': country })\n\n console.log(results);\n\n if (results) {\n lat = results.results[0].geometry.location.lat();\n lng = results.results[0].geometry.location.lng();\n zoomLevel = 6;\n } else {\n console.error('No results found for the country code.');\n }\n } catch (error) {\n console.error('Error getting coordinates from country code:', error);\n }\n }\n \n // If there's no lat/lng in the query, try to use country/state/city to get the lat/lng\n if (!lat && !lng && (route.params.country || route.params.state || route.params.city)) {\n const geocoder = new google.maps.Geocoder();\n\n const address = [\n route.params.city,\n route.params.state,\n route.params.country\n ].filter(Boolean).join(', ');\n\n try {\n const results = await geocoder.geocode({ address });\n\n if (results[0]) {\n lat = results[0].geometry.location.lat();\n lng = results[0].geometry.location.lng();\n }\n\n } catch (error) {\n console.error('Error getting coordinates:', error);\n }\n }\n\n\n skip.value += limit.value;\n\n const params = {\n // country: route.params.country,\n // state: route.params.state,\n // city: route.params.city,\n // categories: route.query.categories,\n // prices: route.query.prices,\n // delivery: route.query.delivery,\n country: route.params.country,\n state: route.params.state,\n city: route.params.city,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n sortParam: route.query.sortParam || marketplace.state.sort.param,\n sortOrder: route.query.sortOrder || marketplace.state.sort.order,\n location: {coordinates: [lng,lat] },\n locationRadius: 1000,\n limit: 500,\n };\n\n console.log(params)\n\n const data = await actions.read(params);\n\n state.all = [...state.all, ...data];\n\n map.value = new google.maps.Map(document.getElementById('map'), {\n mapTypeControl: false,\n fullscreenControl: false,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n // {\n // \"visibility\": \"off\"\n // }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#181818\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1b1b1b\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#2c2c2c\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8a8a8a\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#373737\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels\",\n \"stylers\": [\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3c3c3c\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#4e4e4e\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3d3d3d\"\n }\n ]\n }\n ],\n center: { lat, lng },\n zoom: parseInt(route.query.zoom || zoomLevel || '12')\n });\n\n \n\n for (let marker of markers.value) {\n marker.setMap(null);\n }\n\n markers.value = [];\n\n // Add new markers\n markers.value = data.map(org => {\n // Get the first spot's location\n let location = org.spots[0]?.location;\n\n if (location && location.type === 'Point') {\n let [lng, lat] = location.coordinates; // Note that coordinates are in [lng, lat] format\n \n let markerIcon = '/marker_2.png'; // Default marker icon\n\n if (org.products && org.products.length === 0) {\n markerIcon = '/marker.png'; // If there are no products, set a different icon\n }\n \n const marker = new google.maps.Marker({\n position: { lng, lat },\n map: map.value,\n icon: {\n url: markerIcon, // URL to the icon\n scaledSize: new google.maps.Size(32, 48), // icon dimensions\n origin: new google.maps.Point(0,0), // coordinate origin for this icon\n anchor: new google.maps.Point(16, 48) // point on the icon that corresponds to the geographic location of the marker\n }\n });\n\n // Add click listener to the marker\n marker.addListener('click', () => {\n router.push({name: 'Organization', params: {_id: org._id}});\n });\n\n return marker;\n }\n return null;\n }).filter(marker => marker !== null); // Remove null markers\n\n google.maps.event.addListener(map.value, 'center_changed', () => {\n let center = map.value.getCenter();\n currentMapCenter.value = {\n lat: center.lat(),\n lng: center.lng()\n };\n });\n\n google.maps.event.addListener(map.value, 'zoom_changed', () => {\n currentMapZoom.value = map.value.getZoom();\n });\n\n })\n\n});\n\nconst searchInCurrentLocation = async () => {\n // Use currentMapCenter for the location\n const params = {\n country: route.params.country,\n state: route.params.state,\n city: route.params.city,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n sortParam: route.query.sortParam || marketplace.state.sort.param,\n sortOrder: route.query.sortOrder || marketplace.state.sort.order,\n locationRadius: 8000/currentMapZoom.value,\n limit: 100,\n location: {\n type: \"Point\",\n coordinates: [currentMapCenter.value.lng, currentMapCenter.value.lat]\n }\n };\n\n console.log([currentMapCenter.value.lng, currentMapCenter.value.lat])\n\n try {\n const data = await actions.read(params);\n // Remove old markers\n for (let marker of markers.value) {\n marker.setMap(null);\n }\n markers.value = [];\n\n // Add new markers\n markers.value = data.map(org => {\n let location = org.spots[0]?.location;\n if (location && location.type === 'Point') {\n let [lng, lat] = location.coordinates; // Note that coordinates are in [lng, lat] format\n let markerIcon = org.products && org.products.length > 0 ? '/marker_2.png' : '/marker.png';\n\n const marker = new google.maps.Marker({\n position: { lng, lat },\n map: map.value,\n icon: {\n url: markerIcon, // URL to the icon\n scaledSize: new google.maps.Size(32, 48), // icon dimensions\n origin: new google.maps.Point(0,0), // coordinate origin for this icon\n anchor: new google.maps.Point(16, 48) // point on the icon that corresponds to the geographic location of the marker\n }\n });\n\n // Add click listener to the marker\n marker.addListener('click', () => {\n router.push({ name: 'Organization', params: { _id: org._id } });\n });\n\n return marker;\n }\n return null;\n }).filter(marker => marker !== null); // Remove null markers\n } catch (error) {\n console.error('Error fetching organizations:', error);\n }\n};\n\n\n\n</script>\n\n<style scoped lang=\"scss\">\n #map {\n &:focus {\n outline: none;\n }\n }\n</style>\n"],"names":["error","GMLoader","marketplace.state","state","lng","lat"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,UAAM,QAAQ,SAAQ;AAEtB,UAAM,SAAS,UAAS;AACxB,UAAM,QAAQ,SAAQ;AAEtB,UAAM,QAAQ;AAiBd,QAAI,MAAM,IAAI,IAAI;AAClB,QAAI,UAAU,IAAI,EAAE;AAEpB,QAAI,OAAO,IAAI,CAAC;AAChB,QAAI,QAAQ,IAAI,EAAE;AAElB,QAAI,mBAAmB,IAAI,EAAC,KAAK,GAAG,KAAK,EAAC,CAAC;AAC3C,QAAI,iBAAiB,IAAI,IAAI;AAE7B,mBAAe,aAAa;AAC1B,UAAI;AACF,cAAM,WAAW,MAAM,MAAM,oBAAoB;AACjD,cAAM,SAAS,MAAM,SAAS,KAAI;AAElC,YAAI,CAAC,UAAU,OAAO,CAAC,MAAM,KAAK;AAChC,gBAAM,IAAI,MAAM,6BAA6B;AAAA,QAC/C;AAGA,cAAM,QAAQ,OAAO,MAAM,GAAG;AAC9B,YAAI,MAAM,SAAS,GAAG;AACpB,gBAAM,IAAI,MAAM,yBAAyB;AAAA,QAC3C;AAEA,gBAAQ,IAAI,MAAM,CAAC,CAAC;AAEpB,eAAO,MAAM,CAAC;AAAA,MAChB,SAASA,QAAO;AACd,gBAAQ,MAAMA,MAAK;AACnB,cAAMA;AAAA,MACR;AAAA,IACF;AAGA,cAAU,YAAY;AACpB,UAAI,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,KAAK,MAAM,UAAU,UAAU,GAAG;AAChF,UAAI,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,KAAK,MAAM,UAAU,UAAU,GAAG;AAEhF,UAAI;AAGJ,UAAI,MAAM,OAAO,YAA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AAC;AAAA;AAAA,gBACjC,QAAQ,IAAI,OAAO,KAAK,MAAM,IAAI,EAAE;AAAA;AAAA,cAChD;AAAA,YACA,CAAS;AAGD,mBAAO,YAAY,SAAS,MAAM;AAChC,qBAAO,KAAK,EAAE,MAAM,gBAAgB,QAAQ,EAAE,KAAK,IAAI,IAAG,GAAI;AAAA,YAChE,CAAC;AAED,mBAAO;AAAA,UACT;AACA,iBAAO;AAAA,QACT,CAAC,EAAE,OAAO,YAAU,WAAW,IAAI;AAAA,MACrC,SAASF,QAAO;AACd,gBAAQ,MAAM,iCAAiCA,MAAK;AAAA,MACtD;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Map.vue.js","sources":["../../../../../../../src/modules/spots/components/pages/Map.vue"],"sourcesContent":["<template>\n <div class=\"h-100 w-100 pos-relative\">\n <div class=\"w-100 pos-absolute z-index-2 pos-b-10 \">\n <Button \n :submit=\"searchInCurrentLocation\" \n class=\"mn-l-auto mn-r-auto bg-black t-white w-min-20 button\"\n >\n Search in This Location\n </Button>\n </div>\n\n <div id=\"map\" class=\"h-100 w-100 pos-relative o-hidden\">\n </div>\n </div>\n</template>\n\n<script setup>\nimport { onMounted, watch, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router'\n\nimport { Loader as GMLoader } from \"@googlemaps/js-api-loader\";\n\nimport Button from '@martyrs/src/components/Button/Button.vue'\n\nimport { state, actions } from '@martyrs/src/modules/organizations/store/organizations.js'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js';\nimport * as marketplace from '@martyrs/src/modules/marketplace/views/store/marketplace.js';\n\nconst store = useStore();\n\nconst router = useRouter();\nconst route = useRoute();\n\nconst props = defineProps({\n localPosition: Object,\n location: {\n type: Object,\n default: () => ({ lat: 15.8700, lng: 100.9925 })\n },\n address: {\n type: String,\n default: null\n },\n apiKey: String,\n locale: {\n type: String,\n default: 'en'\n }\n})\n\nlet map = ref(null);\nlet markers = ref([]);\n\nlet skip = ref(0);\nlet limit = ref(50);\n\nlet currentMapCenter = ref({lat: 0, lng: 0});\nlet currentMapZoom = ref(null);\n\nasync function getCountry() {\n try {\n const response = await fetch('https://ip2c.org/s');\n const result = await response.text();\n\n if (!result || result[0] !== '1') {\n throw new Error('Unable to fetch the country');\n }\n\n // Разделение строки и извлечение кода страны\n const parts = result.split(';');\n if (parts.length < 4) {\n throw new Error('Invalid response format');\n }\n\n console.log(parts[3])\n\n return parts[3]; // Возвращает двухбуквенный код страны\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n\n\nonMounted(async () => {\n let lat = parseFloat(route.query.lat || store.core.state.position?.location?.lat);\n let lng = parseFloat(route.query.lng || store.core.state.position?.location?.lng);\n\n let zoomLevel;\n\n // Определите уровень зума в зависимости от доступной информации\n if (route.params.location || store.core.state.position?.location) {\n zoomLevel = 15;\n } else if (route.params.country || store.core.state.position?.country) {\n zoomLevel = 9;\n } else if (route.params.state || store.core.state.position?.state) {\n zoomLevel = 6;\n } else if (route.params.city || store.core.state.position?.city) {\n zoomLevel = 14;\n } else {\n zoomLevel = 2;\n }\n\n const loader = new GMLoader({\n apiKey: props.apiKey,\n version: \"weekly\",\n libraries: [\"places\"],\n language: 'en'\n });\n\n loader.load().then(async () => {\n\n // Если координаты не заданы, попробуйте их получить\n if (!lat || !lng) {\n let country\n\n const geocoder = new google.maps.Geocoder();\n\n try {\n country = await getCountry();\n } catch {\n country = 'Thailand' \n console.log(error)\n }\n\n try {\n const results = await geocoder.geocode({ 'address': country })\n\n console.log(results);\n\n if (results) {\n lat = results.results[0].geometry.location.lat();\n lng = results.results[0].geometry.location.lng();\n zoomLevel = 6;\n } else {\n console.error('No results found for the country code.');\n }\n } catch (error) {\n console.error('Error getting coordinates from country code:', error);\n }\n }\n \n // If there's no lat/lng in the query, try to use country/state/city to get the lat/lng\n if (!lat && !lng && (route.params.country || route.params.state || route.params.city)) {\n const geocoder = new google.maps.Geocoder();\n\n const address = [\n route.params.city,\n route.params.state,\n route.params.country\n ].filter(Boolean).join(', ');\n\n try {\n const results = await geocoder.geocode({ address });\n\n if (results[0]) {\n lat = results[0].geometry.location.lat();\n lng = results[0].geometry.location.lng();\n }\n\n } catch (error) {\n console.error('Error getting coordinates:', error);\n }\n }\n\n\n skip.value += limit.value;\n\n const params = {\n // country: route.params.country,\n // state: route.params.state,\n // city: route.params.city,\n // categories: route.query.categories,\n // prices: route.query.prices,\n // delivery: route.query.delivery,\n country: route.params.country,\n state: route.params.state,\n city: route.params.city,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n sortParam: route.query.sortParam || marketplace.state.sort.param,\n sortOrder: route.query.sortOrder || marketplace.state.sort.order,\n location: {coordinates: [lng,lat] },\n locationRadius: 1000,\n limit: 500,\n };\n\n console.log(params)\n\n const data = await actions.read(params);\n\n state.all = [...state.all, ...data];\n\n map.value = new google.maps.Map(document.getElementById('map'), {\n mapTypeControl: false,\n fullscreenControl: false,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#212121\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n // {\n // \"visibility\": \"off\"\n // }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#181818\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1b1b1b\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#2c2c2c\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8a8a8a\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#373737\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels\",\n \"stylers\": [\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3c3c3c\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#4e4e4e\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#000000\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3d3d3d\"\n }\n ]\n }\n ],\n center: { lat, lng },\n zoom: parseInt(route.query.zoom || zoomLevel || '12')\n });\n\n \n\n for (let marker of markers.value) {\n marker.setMap(null);\n }\n\n markers.value = [];\n\n // Add new markers\n markers.value = data.map(org => {\n // Get the first spot's location\n let location = org.spots[0]?.location;\n\n if (location && location.type === 'Point') {\n let [lng, lat] = location.coordinates; // Note that coordinates are in [lng, lat] format\n \n let markerIcon = '/marker_2.png'; // Default marker icon\n\n if (org.products && org.products.length === 0) {\n markerIcon = '/marker.png'; // If there are no products, set a different icon\n }\n \n const marker = new google.maps.Marker({\n position: { lng, lat },\n map: map.value,\n icon: {\n url: markerIcon, // URL to the icon\n scaledSize: new google.maps.Size(32, 48), // icon dimensions\n origin: new google.maps.Point(0,0), // coordinate origin for this icon\n anchor: new google.maps.Point(16, 48) // point on the icon that corresponds to the geographic location of the marker\n }\n });\n\n // Add click listener to the marker\n marker.addListener('click', () => {\n router.push('/organizations/' + org._id);\n });\n\n return marker;\n }\n return null;\n }).filter(marker => marker !== null); // Remove null markers\n\n google.maps.event.addListener(map.value, 'center_changed', () => {\n let center = map.value.getCenter();\n currentMapCenter.value = {\n lat: center.lat(),\n lng: center.lng()\n };\n });\n\n google.maps.event.addListener(map.value, 'zoom_changed', () => {\n currentMapZoom.value = map.value.getZoom();\n });\n\n })\n\n});\n\nconst searchInCurrentLocation = async () => {\n // Use currentMapCenter for the location\n const params = {\n country: route.params.country,\n state: route.params.state,\n city: route.params.city,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n sortParam: route.query.sortParam || marketplace.state.sort.param,\n sortOrder: route.query.sortOrder || marketplace.state.sort.order,\n locationRadius: 8000/currentMapZoom.value,\n limit: 100,\n location: {\n type: \"Point\",\n coordinates: [currentMapCenter.value.lng, currentMapCenter.value.lat]\n }\n };\n\n console.log([currentMapCenter.value.lng, currentMapCenter.value.lat])\n\n try {\n const data = await actions.read(params);\n // Remove old markers\n for (let marker of markers.value) {\n marker.setMap(null);\n }\n markers.value = [];\n\n // Add new markers\n markers.value = data.map(org => {\n let location = org.spots[0]?.location;\n if (location && location.type === 'Point') {\n let [lng, lat] = location.coordinates; // Note that coordinates are in [lng, lat] format\n let markerIcon = org.products && org.products.length > 0 ? '/marker_2.png' : '/marker.png';\n\n const marker = new google.maps.Marker({\n position: { lng, lat },\n map: map.value,\n icon: {\n url: markerIcon, // URL to the icon\n scaledSize: new google.maps.Size(32, 48), // icon dimensions\n origin: new google.maps.Point(0,0), // coordinate origin for this icon\n anchor: new google.maps.Point(16, 48) // point on the icon that corresponds to the geographic location of the marker\n }\n });\n\n // Add click listener to the marker\n marker.addListener('click', () => {\n router.push('/organizations/' + org._id);\n });\n\n return marker;\n }\n return null;\n }).filter(marker => marker !== null); // Remove null markers\n } catch (error) {\n console.error('Error fetching organizations:', error);\n }\n};\n\n\n\n</script>\n\n<style scoped lang=\"scss\">\n #map {\n &:focus {\n outline: none;\n }\n }\n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C;AAED,mBAAO;AAAA,UACT;AACA,iBAAO;AAAA,QACT,CAAC,EAAE,OAAO,YAAU,WAAW,IAAI;AAAA,MACrC,SAASF,QAAO;AACd,gBAAQ,MAAM,iCAAiCA,MAAK;AAAA,MACtD;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { ref, onMounted, createElementBlock, createCommentVNode, openBlock, crea
2
2
  import { useRouter, useRoute } from "vue-router";
3
3
  import _sfc_main$1 from "../../../../components/Block/Block.vue.js";
4
4
  import UploadImage from "../../../../components/UploadImage/UploadImage.vue.js";
5
- /* empty css */
5
+ /* empty css */
6
6
  import Field from "../../../../components/Field/Field.vue.js";
7
7
  import Select from "../../../../components/Select/Select.vue.js";
8
8
  import _sfc_main$3 from "../../../../components/Checkbox/Checkbox.vue.js";