@ozdao/prometheus-framework 0.2.309 → 0.2.310
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/products.server.js +196 -198
- package/dist/products.server.mjs +196 -198
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +2 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +3 -2
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js.map +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +93 -0
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +94 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.cjs +0 -93
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.js +1 -94
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.js.map +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +13 -12
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +13 -12
- package/dist/prometheus-framework/src/components/Field/Field.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.js +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.cjs +6 -2
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.js +6 -2
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +3 -5
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +4 -6
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Card.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Card.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +4 -4
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +5 -5
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigationBar.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigationBar.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigationBar.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigationBar.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +5 -5
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.js +8 -8
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.cjs +4 -0
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.js +4 -0
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.js.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- 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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +2 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +3 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTabSection.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +743 -743
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +743 -743
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +11 -10
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +11 -10
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +79 -44
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +83 -48
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +81 -31
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +91 -41
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +122 -83
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +135 -96
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +39 -21
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +51 -33
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.cjs +96 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.js +96 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/CategoriesTree.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +22 -8
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +22 -8
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/products.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/products.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/categories.router.cjs +17 -5
- package/dist/prometheus-framework/src/modules/products/router/categories.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/categories.router.js +17 -5
- package/dist/prometheus-framework/src/modules/products/router/categories.router.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/products.router.cjs +1 -12
- package/dist/prometheus-framework/src/modules/products/router/products.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/products.router.js +1 -12
- package/dist/prometheus-framework/src/modules/products/router/products.router.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs +52 -71
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.js +52 -71
- package/dist/prometheus-framework/src/modules/products/store/categories.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +6 -8
- package/dist/prometheus-framework/src/modules/products/store/products.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +6 -8
- package/dist/prometheus-framework/src/modules/products/store/products.js.map +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/components/EditImages/EditImages.vue +1 -1
- package/src/modules/auth/views/middlewares/auth.validation.js +1 -0
- package/src/modules/auth/views/store/auth.js +6 -2
- package/src/modules/backoffice/components/pages/Dashboard.vue +1 -3
- package/src/modules/globals/views/components/partials/BottomNavigationBar.vue +1 -1
- package/src/modules/globals/views/components/partials/NavigationBar.vue +3 -3
- package/src/modules/globals/views/store/globals.js +5 -0
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/components/pages/OrganizationBackoffice.vue +1 -2
- package/src/modules/products/components/blocks/CardCategory.vue +14 -3
- package/src/modules/products/components/blocks/CardProduct.vue +12 -11
- package/src/modules/products/components/pages/Categories.vue +120 -28
- package/src/modules/products/components/pages/CategoryEdit.vue +206 -151
- package/src/modules/products/components/pages/ProductEdit.vue +107 -69
- package/src/modules/products/components/pages/Products.vue +35 -20
- package/src/modules/products/components/sections/CategoriesTree.vue +102 -0
- package/src/modules/products/components/sections/EditProductInfo.vue +53 -40
- package/src/modules/products/controllers/categories.controller.js +177 -97
- package/src/modules/products/controllers/products.controller.js +4 -2
- package/src/modules/products/models/category.model.js +15 -66
- package/src/modules/products/models/product.model.js +15 -12
- package/src/modules/products/products.client.js +0 -1
- package/src/modules/products/router/categories.router.js +17 -5
- package/src/modules/products/router/products.router.js +0 -12
- package/src/modules/products/routes/categories.routes.js +5 -34
- package/src/modules/products/store/categories.js +69 -83
- package/src/modules/products/store/products.js +6 -8
package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ProductEdit.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/ProductEdit.vue"],"sourcesContent":["<template>\n\t<div class=\"for-transition w-100 cols-1 pd-thin gap-thin\">\n \n <Block class=\"flex-nowrap flex-v-center flex\">\n \n <h1 class=\"mn-r-auto\">\n\t\t\t {{ route.params.product ? products.state.current.name : 'Create Product' }}\n\t\t\t</h1>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red mn-r-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-main\"\n >\n \t\tSave\n \t</Button>\n </Block>\n\n <Block\n\t\t\tplaceholder=\"The product doesn't have any images yet.\"\n\t\t\tclass=\"h-min\"\n\t\t>\n\t\t\t<EditImages \n\t\t\t\t:images=\"products.state.current.images\"\n\t\t\t\t:uploadPath=\"'photos'\" \n\t\t\t\t@update:images=\"(imagesNew) => { products.state.current.images = imagesNew }\" \n\t\t\t/>\n\t\t</Block>\n\n <div class=\"cols-2 gap-thin\">\n\n \t<Block\n \t\t\ttitle=\"Profile\"\n \t\t>\n\t\t\t\t<EditProductInfo \t\t\n\t\t\t\t\t:product=\"products.state.current\"\n\t\t\t\t/>\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t title=\"Ingredients\"\n\t\t\t\tplaceholder=\"No ingridients added yet\"\n\t\t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => openIngredientPopup()\n\t }]\"\n\t\t >\n\t\t \t<div v-if=\"products.state.current.ingredients.length > 0\" class=\"cols-1 gap-thin\">\n\t\t\t <CardPosition \n\t\t\t v-for=\"(product, index) in products.state.current.ingredients\" \n\t\t\t :key=\"product._id\" \n\t\t\t :product=\"product\"\n\t\t\t :array=\"products.state.current.ingredients\"\n\t\t\t :products=\"Products\"\n\t\t :showPrice=\"false\"\n\t\t\t @add=\"(item) => {\n\t\t\t\t\t globals.actions.add(products.state.current.ingredients, item);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @update=\"(item) => {\n\t\t\t\t\t globals.actions.update(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @delete=\"(item) => {\n\t\t\t\t\t globals.actions.delete(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t />\n\t\t\t </div>\n\t\t </Block>\n\n\t\t <Popup \n\t title=\"Add ingredient\" \n\t @close-popup=\"closeIngredientPopup\" \n\t :isPopupOpen=\"isOpenIngredientPopup\"\n\t class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n\t >\n\t <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n\t <Feed\n\t :search=\"{\n\t \tclass: 'bg-white mn-b-thin'\n\t }\"\n\t :states=\"{\n\t empty: {\n\t title: 'No Products Found',\n\t description: 'Currently, there are no such products available.'\n\t }\n\t }\"\n\t :store=\"{\n\t read: (options) => products.actions.read(options),\n\t state: null\n\t }\"\n\t :options=\"{\n\t organization: route.params._id\n\t }\"\n\t v-slot=\"{ \n\t items \n\t }\"\n\t class=\"\"\n\t >\n\t <CardOrderItem\n\t v-for=\"(product, index) in items\" :key=\"product._id\"\n\t :editable=\"false\" \n\t :product=\"product\" \n\t @click=\"() => { \n\t let p = { ...product };\n\t p.quantity = 1;\n\t p.type = 'pcs'\n\t globals.actions.add(products.state.current.ingredients,p)\n\t closeIngredientPopup();\n\t }\"\n\t class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n\t />\n\t </Feed>\n\t </div>\n\t </Popup>\n\n\n\t\t</div> \n\n\t\t\t<Block\n \t\t\ttitle=\"Categories\"\n \t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => router.push({\n\t\t\t\t\t\tname: 'Categories Organization', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\t_id: route.params._id\n\t\t\t\t\t\t} \n\t\t\t\t\t})\n\t }]\"\n \t\t>\n\t\t\t\t<Checkbox \n\t\t\t\t\tv-for=\"(category, index) in categories.state.all\"\n :label=\"category.name\"\n name=\"categories\"\n :value=\"category.url\"\n class=\"w-100 mn-t-small bg-white radius-small pd-small\"\n :radio=\"products.state.current.category\"\n @update:radio=\"event => products.state.current.category = event\"\n />\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Parameters\"\n\t\t\t\tplaceholder=\"No parameters added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.information.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t\tclass=\"cols-1 gap-thin\"\n\t\t\t>\n <div \n \tclass=\"gap-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.information\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.information.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n\t </div>\n </div>\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Localization\"\n\t\t\t\tplaceholder=\"No localizations added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.localization.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t>\n <div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.localization\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.localization.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n </div>\n </div>\n\t\t\t</Block>\n\n\t\n\t\t\n\t\t<!-- <Block\n\t title=\"Quantity Discount\"\n\t class=\"mn-b-semi\"\n\t :actions=\"[{\n\t\t\t\tlabel: '+',\n\t\t\t\tfunction: () => products.state.current.quantityDiscount.push({name: '', value: ''})\n\t\t\t}]\"\n\t >\n\t \t<div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.quantityDiscount\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Quantity\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Discount\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n <IconDelete \n \t@click=\"() => products.state.current.quantityDiscount.splice(index, 1)\" \n \tclass=\"i-medium\"\n />\n </div>\n </div>\n\t\t</Block> -->\n\n\t\t<!-- <EditModifications\n\t\t\t:product=\"products.state.current\"\n\t\t/> -->\n\n\n\n\t\t\n\n</div>\n\t\n</template>\n\n<script setup>\n\t// Import libs\n\timport { reactive, computed, onMounted, ref } from 'vue'\n\timport { useRoute, useRouter } from 'vue-router'\n\t// Import components\n\timport Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\n\timport Block from '@pf/src/components/Block/Block.vue';\n\timport Tab from \"@pf/src/components/Tab/Tab.vue\";\n\timport Field from \"@pf/src/components/Field/Field.vue\";\n\timport Checkbox from \"@pf/src/components/Checkbox/Checkbox.vue\";\n\timport Button from \"@pf/src/components/Button/Button.vue\";\n\timport Popup from \"@pf/src/components/Popup/Popup.vue\";\n\timport Feed from \"@pf/src/components/Feed/Feed.vue\";\n\n\timport EditImages from '@pf/src/components/EditImages/EditImages.vue';\n\n\timport IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n \timport CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';\n import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'\n\n\n\timport EditProductInfo from '@pf/src/modules/products/components/sections/EditProductInfo.vue';\n import EditModifications from '@pf/src/modules/products/components/sections/EditModifications.vue';\n \n\t// Accessing router and store\n\timport * as globals from '@pf/src/modules/globals/views/store/globals';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n const Products = ref(products.state.all);\n const isOpenIngredientPopup = ref(false);\n\n\n function openIngredientPopup(member) {\n\t isOpenIngredientPopup.value = true;\n\t // if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeIngredientPopup() {\n\t isOpenIngredientPopup.value = false;\n\t // selectedMember.value = null;\n\t}\n\n onMounted(async() => { \n\t products.mutations.resetProduct();\n\n \tif (route.params.product) {\n\t\t await products.actions.read({ _id: route.params.product });\n\t } \n\n\t if (!products.state.current.ingredients) {\n\t \tproducts.state.current.ingredients = []\n\t }\n\n \t// Data prefetching\n\t \tawait categories.actions.fetchCategories()\n\n try {\n const productsResponse = await products.actions.read({\n organization: route.params._id,\n limit: 100\n });\n Products.value = productsResponse;\n } catch (error) {\n console.error('error');\n }\n })\n\n\tfunction onImagesUpdate(newImages) {\n\t products.state.current.images = newImages;\n\t}\n\t\n\tfunction onSubmit() {\n\t\tif (route.params.product) {\n\t\t\tproducts.actions.update(route.params.product, products.state.current)\n\t\t} else {\n\t\t\tproducts.actions.create(route.params._id, products.state.current)\n\t\t}\n\t}\n\n\tfunction onDelete() {\n\t\tproducts.actions.deleteProduct(products.state.current._id)\n\t}\n\n\tfunction redirectTo () {\n\t\trouter.push({\n\t\t\tname: 'Organization', \n\t\t\tparams: { \n\t\t\t\t_id: route.params._id\n\t\t\t} \n\t\t})\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.main-photo {\n\t\tmax-width: 50%;\n\t\timg { width: 100%; }\n\t}\n</style>\n"],"names":["useRoute","useRouter","ref","products.state","onMounted","products.mutations","products.actions","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwSC,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAEzB,UAAM,WAAWC,IAAAA,IAAIC,SAAc,MAAC,GAAG;AACvC,UAAM,wBAAwBD,QAAI,KAAK;AAGvC,aAAS,oBAAoB,QAAQ;AACpC,4BAAsB,QAAQ;AAAA,IAE/B;AAED,aAAS,uBAAuB;AAC9B,4BAAsB,QAAQ;AAAA,IAE/B;AAEAE,QAAAA,UAAU,YAAW;AACpBC,eAAkB,UAAC,aAAY;AAE/B,UAAI,MAAM,OAAO,SAAS;AACzB,cAAMC,SAAAA,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAO,CAAE;AAAA,MACzD;AAED,UAAI,CAACH,SAAAA,MAAe,QAAQ,aAAa;AACxCA,uBAAe,QAAQ,cAAc,CAAE;AAAA,MACvC;AAGD,YAAMI,WAAAA,QAAmB,gBAAiB;AAEzC,UAAI;AACF,cAAM,mBAAmB,MAAMD,SAAgB,QAAC,KAAK;AAAA,UACnD,cAAc,MAAM,OAAO;AAAA,UAC3B,OAAO;AAAA,QACf,CAAO;AACD,iBAAS,QAAQ;AAAA,MAClB,SAAQ,OAAO;AACd,gBAAQ,MAAM,OAAO;AAAA,MACtB;AAAA,IACL,CAAG;AAMF,aAAS,WAAW;AACnB,UAAI,MAAM,OAAO,SAAS;AACzBA,iBAAgB,QAAC,OAAO,MAAM,OAAO,SAASH,SAAc,MAAC,OAAO;AAAA,MACvE,OAAS;AACNG,iBAAgB,QAAC,OAAO,MAAM,OAAO,KAAKH,SAAc,MAAC,OAAO;AAAA,MAChE;AAAA,IACD;AAED,aAAS,WAAW;AACnBG,eAAAA,QAAiB,cAAcH,eAAe,QAAQ,GAAG;AAAA,IACzD;AAED,aAAS,aAAc;AACtB,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,KAAK,MAAM,OAAO;AAAA,QAClB;AAAA,MACJ,CAAG;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"ProductEdit.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/ProductEdit.vue"],"sourcesContent":["<template>\n\t<div class=\"for-transition w-100 cols-1 bg-white pd-thin gap-thin\">\n \n <Block v-if=\"!MOBILE_APP\" class=\"flex-nowrap gap-small flex-v-center flex\">\n \n <h2 class=\"t-nowrap mn-r-auto\">\n\t\t\t {{ route.params.product ? products.state.current.name : 'Create Product' }}\n\t\t\t</h2>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red mn-r-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-main\"\n >\n \t\tSave\n \t</Button>\n </Block>\n\n <Block\n\t\t\tplaceholder=\"The product doesn't have any images yet.\"\n\t\t\tclass=\"h-min\"\n\t\t>\n\t\t\t<EditImages \n\t\t\t\t:images=\"products.state.current.images\"\n\t\t\t\t:uploadPath=\"'photos'\" \n\t\t\t\t@update:images=\"(imagesNew) => { products.state.current.images = imagesNew }\" \n\t\t\t/>\n\t\t</Block>\n\n <div class=\"cols-2 gap-thin\">\n\n \t<Block\n \t\t\ttitle=\"Profile\"\n \t\t>\n\t\t\t\t<EditProductInfo \t\t\n\t\t\t\t\t:product=\"products.state.current\"\n\t\t\t\t/>\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Categories\"\n\t\t\t\t:actions=\"[{\n\t\t label: '+',\n\t\t function: () => router.push({\n\t\t\t\t\t\tname: 'Categories', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\t_id: route.params._id\n\t\t\t\t\t\t} \n\t\t\t\t\t})\n\t\t }]\"\n\t\t\t>\n\t\t\t\t<Checkbox \n\t\t\t\t\tv-for=\"(category, index) in categories.state.all\"\n\t\t :label=\"category.name\"\n\t\t name=\"categories\"\n\t\t :value=\"category.url\"\n\t\t class=\"w-100 mn-t-small bg-white radius-small pd-small\"\n\t\t :radio=\"products.state.current.category\"\n\t\t @update:radio=\"event => products.state.current.category = event\"\n\t\t />\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Parameters\"\n\t\t\t\tplaceholder=\"No parameters added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.information.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t\tclass=\"cols-1 gap-thin\"\n\t\t\t>\n <div \n \tclass=\"gap-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.information\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.information.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n\t </div>\n </div>\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t title=\"Ingredients\"\n\t\t\t\tplaceholder=\"No ingridients added yet\"\n\t\t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => openIngredientPopup()\n\t }]\"\n\t\t >\n\t\t \t<div v-if=\"products.state.current.ingredients.length > 0\" class=\"cols-1 gap-thin\">\n\t\t\t <CardPosition \n\t\t\t v-for=\"(product, index) in products.state.current.ingredients\" \n\t\t\t :key=\"product._id\" \n\t\t\t :product=\"product\"\n\t\t\t :array=\"products.state.current.ingredients\"\n\t\t\t :products=\"Products\"\n\t\t :showPrice=\"false\"\n\t\t\t @add=\"(item) => {\n\t\t\t\t\t globals.actions.add(products.state.current.ingredients, item);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @update=\"(item) => {\n\t\t\t\t\t globals.actions.update(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @delete=\"(item) => {\n\t\t\t\t\t globals.actions.delete(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t />\n\t\t\t </div>\n\t\t </Block>\n\n\t\t <Popup \n\t title=\"Add ingredient\" \n\t @close-popup=\"closeIngredientPopup\" \n\t :isPopupOpen=\"isOpenIngredientPopup\"\n\t class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n\t >\n\t <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n\t <Feed\n\t :search=\"{\n\t \tclass: 'bg-white mn-b-thin'\n\t }\"\n\t :states=\"{\n\t empty: {\n\t title: 'No Products Found',\n\t description: 'Currently, there are no such products available.'\n\t }\n\t }\"\n\t :store=\"{\n\t read: (options) => products.actions.read(options),\n\t state: null\n\t }\"\n\t :options=\"{\n\t organization: route.params._id\n\t }\"\n\t v-slot=\"{ \n\t items \n\t }\"\n\t class=\"\"\n\t >\n\t <CardOrderItem\n\t v-for=\"(product, index) in items\" :key=\"product._id\"\n\t :editable=\"false\" \n\t :product=\"product\" \n\t @click=\"() => { \n\t let p = { ...product };\n\t p.quantity = 1;\n\t p.type = 'pcs'\n\t globals.actions.add(products.state.current.ingredients,p)\n\t closeIngredientPopup();\n\t }\"\n\t class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n\t />\n\t </Feed>\n\t </div>\n\t </Popup>\n\n\n\t\t</div> \n\n\t\t\t<Block\n\t\t\t\ttitle=\"Localization\"\n\t\t\t\tplaceholder=\"No localizations added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.localization.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t>\n <div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.localization\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.localization.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n </div>\n </div>\n\t\t\t</Block>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red w-100 mn-b-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"w-100 bg-main\"\n >\n \t\tSave\n \t</Button>\n\n\t\n\t\t\n\t\t<!-- <Block\n\t title=\"Quantity Discount\"\n\t class=\"mn-b-semi\"\n\t :actions=\"[{\n\t\t\t\tlabel: '+',\n\t\t\t\tfunction: () => products.state.current.quantityDiscount.push({name: '', value: ''})\n\t\t\t}]\"\n\t >\n\t \t<div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.quantityDiscount\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Quantity\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Discount\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n <IconDelete \n \t@click=\"() => products.state.current.quantityDiscount.splice(index, 1)\" \n \tclass=\"i-medium\"\n />\n </div>\n </div>\n\t\t</Block> -->\n\n\t\t<!-- <EditModifications\n\t\t\t:product=\"products.state.current\"\n\t\t/> -->\n\n\n\n\t\t\n\n</div>\n\t\n</template>\n\n<script setup>\n\t// Import libs\n\timport { reactive, computed, onMounted, ref } from 'vue'\n\timport { useRoute, useRouter } from 'vue-router'\n\t// Import components\n\timport Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\n\timport Block from '@pf/src/components/Block/Block.vue';\n\timport Tab from \"@pf/src/components/Tab/Tab.vue\";\n\timport Field from \"@pf/src/components/Field/Field.vue\";\n\timport Checkbox from \"@pf/src/components/Checkbox/Checkbox.vue\";\n\timport Button from \"@pf/src/components/Button/Button.vue\";\n\timport Popup from \"@pf/src/components/Popup/Popup.vue\";\n\timport Feed from \"@pf/src/components/Feed/Feed.vue\";\n\n\timport EditImages from '@pf/src/components/EditImages/EditImages.vue';\n\n\timport IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n \timport CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';\n import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'\n\n\n\timport EditProductInfo from '@pf/src/modules/products/components/sections/EditProductInfo.vue';\n import EditModifications from '@pf/src/modules/products/components/sections/EditModifications.vue';\n \n\t// Accessing router and store\n\timport * as globals from '@pf/src/modules/globals/views/store/globals';\n\timport * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\timport { setError } from '@pf/src/modules/globals/views/store/globals'\n\t\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n const Products = ref(products.state.all);\n const isOpenIngredientPopup = ref(false);\n\n\n function openIngredientPopup(member) {\n\t isOpenIngredientPopup.value = true;\n\t // if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeIngredientPopup() {\n\t isOpenIngredientPopup.value = false;\n\t // selectedMember.value = null;\n\t}\n\n onMounted(async() => { \n\t products.mutations.resetProduct();\n\n \tif (route.params.product) {\n\t\t await products.actions.read({ _id: route.params.product });\n\t } \n\n\t if (!products.state.current.ingredients) {\n\t \tproducts.state.current.ingredients = []\n\t }\n\n \t// Data prefetching\n\t \tawait categories.actions.fetchCategories()\n\n try {\n const productsResponse = await products.actions.read({\n organization: route.params._id,\n limit: 100\n });\n Products.value = productsResponse;\n } catch (error) {\n console.error('error');\n }\n })\n\n\tfunction onImagesUpdate(newImages) {\n\t products.state.current.images = newImages;\n\t}\n\t\n\tasync function onSubmit() {\n\t try {\n\t if (route.params.product) {\n\t await products.actions.update(route.params.product, products.state.current)\n\t } else {\n\t products.state.current.owner = {\n\t target: route.params._id || auth.state.user._id,\n\t type: route.params._id ? 'organization' : 'user'\n\t }\n\t \n\t products.state.current.creator = {\n\t target: auth.state.user._id,\n\t type: 'user',\n\t hidden: false\n\t }\n\t await products.actions.create(products.state.current)\n\t }\n\t } catch (error) {\n\t \tsetError({ response: { data: { errorCode: \"PRODUCT_NOT_CREATED\" }} })\n\t console.error('Product creation error:', error)\n\t // Здесь можно добавить обработку ошибки, например:\n\t // - показать уведомление пользователю\n\t // - отправить ошибку в систему мониторинга\n\t // - выполнить откат изменений при необходимости\n\t }\n\t}\n\n\tfunction onDelete() {\n\t\tproducts.actions.deleteProduct(products.state.current._id)\n\t}\n\n\tfunction redirectTo () {\n\t\trouter.push({\n\t\t\tname: 'Organization', \n\t\t\tparams: { \n\t\t\t\t_id: route.params._id\n\t\t\t} \n\t\t})\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.main-photo {\n\t\tmax-width: 50%;\n\t\timg { width: 100%; }\n\t}\n</style>\n"],"names":["useRoute","useRouter","ref","products.state","onMounted","products.mutations","products.actions","categories.actions","auth.state","setError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TC,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAEzB,UAAM,WAAWC,IAAAA,IAAIC,SAAc,MAAC,GAAG;AACvC,UAAM,wBAAwBD,QAAI,KAAK;AAGvC,aAAS,oBAAoB,QAAQ;AACpC,4BAAsB,QAAQ;AAAA,IAE/B;AAED,aAAS,uBAAuB;AAC9B,4BAAsB,QAAQ;AAAA,IAE/B;AAEAE,QAAAA,UAAU,YAAW;AACpBC,eAAkB,UAAC,aAAY;AAE/B,UAAI,MAAM,OAAO,SAAS;AACzB,cAAMC,SAAAA,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAO,CAAE;AAAA,MACzD;AAED,UAAI,CAACH,SAAAA,MAAe,QAAQ,aAAa;AACxCA,uBAAe,QAAQ,cAAc,CAAE;AAAA,MACvC;AAGD,YAAMI,WAAAA,QAAmB,gBAAiB;AAEzC,UAAI;AACF,cAAM,mBAAmB,MAAMD,SAAgB,QAAC,KAAK;AAAA,UACnD,cAAc,MAAM,OAAO;AAAA,UAC3B,OAAO;AAAA,QACf,CAAO;AACD,iBAAS,QAAQ;AAAA,MAClB,SAAQ,OAAO;AACd,gBAAQ,MAAM,OAAO;AAAA,MACtB;AAAA,IACL,CAAG;AAMF,mBAAe,WAAW;AACxB,UAAI;AACF,YAAI,MAAM,OAAO,SAAS;AACxB,gBAAMA,SAAAA,QAAiB,OAAO,MAAM,OAAO,SAASH,SAAc,MAAC,OAAO;AAAA,QACjF,OAAY;AACLA,mBAAc,MAAC,QAAQ,QAAQ;AAAA,YAC7B,QAAQ,MAAM,OAAO,OAAOK,KAAU,MAAC,KAAK;AAAA,YAC5C,MAAM,MAAM,OAAO,MAAM,iBAAiB;AAAA,UAC3C;AAEDL,mBAAc,MAAC,QAAQ,UAAU;AAAA,YAC/B,QAAQK,KAAAA,MAAW,KAAK;AAAA,YACxB,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AACD,gBAAMF,iBAAiB,OAAOH,SAAc,MAAC,OAAO;AAAA,QACrD;AAAA,MACF,SAAQ,OAAO;AACfM,gBAAQ,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,sBAAuB,EAAA,GAAG;AACnE,gBAAQ,MAAM,2BAA2B,KAAK;AAAA,MAK/C;AAAA,IACF;AAED,aAAS,WAAW;AACnBH,eAAAA,QAAiB,cAAcH,eAAe,QAAQ,GAAG;AAAA,IACzD;AAED,aAAS,aAAc;AACtB,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,KAAK,MAAM,OAAO;AAAA,QAClB;AAAA,MACJ,CAAG;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1,32 +1,33 @@
|
|
1
|
-
import { ref, onMounted, openBlock, createElementBlock,
|
1
|
+
import { ref, onMounted, openBlock, createElementBlock, createBlock, withCtx, createElementVNode, toDisplayString, unref, createTextVNode, createCommentVNode, createVNode, Fragment, renderList } from "vue";
|
2
2
|
import { useRoute, useRouter } from "vue-router";
|
3
3
|
import "vue-i18n";
|
4
4
|
/* empty css */
|
5
5
|
import _sfc_main$1 from "../../../../components/Block/Block.vue.js";
|
6
6
|
/* empty css */
|
7
|
-
import Field from "../../../../components/Field/Field.
|
8
|
-
import _sfc_main$
|
9
|
-
import _sfc_main$2 from "../../../../components/Button/Button.
|
10
|
-
import _sfc_main$
|
11
|
-
import _sfc_main$
|
12
|
-
import _sfc_main$3 from "../../../../components/EditImages/EditImages.
|
13
|
-
import _sfc_main$
|
14
|
-
import _sfc_main$
|
15
|
-
import _sfc_main$
|
7
|
+
import Field from "../../../../components/Field/Field.vue.js";
|
8
|
+
import _sfc_main$5 from "../../../../components/Checkbox/Checkbox.vue.js";
|
9
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue.js";
|
10
|
+
import _sfc_main$8 from "../../../../components/Popup/Popup.vue.js";
|
11
|
+
import _sfc_main$9 from "../../../../components/Feed/Feed.vue.js";
|
12
|
+
import _sfc_main$3 from "../../../../components/EditImages/EditImages.vue.js";
|
13
|
+
import _sfc_main$6 from "../../../icons/navigation/IconDelete.vue.js";
|
14
|
+
import _sfc_main$7 from "../blocks/CardPosition.vue.js";
|
15
|
+
import _sfc_main$a from "../../../orders/components/blocks/CardOrderItem.vue.js";
|
16
16
|
import _sfc_main$4 from "../sections/EditProductInfo.vue.js";
|
17
|
-
import { actions as actions$2 } from "../../../globals/views/store/globals.js";
|
17
|
+
import { actions as actions$2, setError } from "../../../globals/views/store/globals.js";
|
18
|
+
import { state as state$2 } from "../../../auth/views/store/auth.js";
|
18
19
|
import { state, mutations, actions } from "../../store/products.js";
|
19
20
|
import { actions as actions$1, state as state$1 } from "../../store/categories.js";
|
20
21
|
/* empty css */
|
21
|
-
const _hoisted_1 = { class: "for-transition w-100 cols-1 pd-thin gap-thin" };
|
22
|
-
const _hoisted_2 = { class: "mn-r-auto" };
|
22
|
+
const _hoisted_1 = { class: "for-transition w-100 cols-1 bg-white pd-thin gap-thin" };
|
23
|
+
const _hoisted_2 = { class: "t-nowrap mn-r-auto" };
|
23
24
|
const _hoisted_3 = { class: "cols-2 gap-thin" };
|
24
|
-
const _hoisted_4 = {
|
25
|
+
const _hoisted_4 = { class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red" };
|
26
|
+
const _hoisted_5 = {
|
25
27
|
key: 0,
|
26
28
|
class: "cols-1 gap-thin"
|
27
29
|
};
|
28
|
-
const
|
29
|
-
const _hoisted_6 = { class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red" };
|
30
|
+
const _hoisted_6 = { class: "bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" };
|
30
31
|
const _hoisted_7 = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" };
|
31
32
|
const _sfc_main = {
|
32
33
|
__name: "ProductEdit",
|
@@ -60,11 +61,25 @@ const _sfc_main = {
|
|
60
61
|
console.error("error");
|
61
62
|
}
|
62
63
|
});
|
63
|
-
function onSubmit() {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
async function onSubmit() {
|
65
|
+
try {
|
66
|
+
if (route.params.product) {
|
67
|
+
await actions.update(route.params.product, state.current);
|
68
|
+
} else {
|
69
|
+
state.current.owner = {
|
70
|
+
target: route.params._id || state$2.user._id,
|
71
|
+
type: route.params._id ? "organization" : "user"
|
72
|
+
};
|
73
|
+
state.current.creator = {
|
74
|
+
target: state$2.user._id,
|
75
|
+
type: "user",
|
76
|
+
hidden: false
|
77
|
+
};
|
78
|
+
await actions.create(state.current);
|
79
|
+
}
|
80
|
+
} catch (error) {
|
81
|
+
setError({ response: { data: { errorCode: "PRODUCT_NOT_CREATED" } } });
|
82
|
+
console.error("Product creation error:", error);
|
68
83
|
}
|
69
84
|
}
|
70
85
|
function onDelete() {
|
@@ -80,9 +95,12 @@ const _sfc_main = {
|
|
80
95
|
}
|
81
96
|
return (_ctx, _cache) => {
|
82
97
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
83
|
-
|
98
|
+
!_ctx.MOBILE_APP ? (openBlock(), createBlock(_sfc_main$1, {
|
99
|
+
key: 0,
|
100
|
+
class: "flex-nowrap gap-small flex-v-center flex"
|
101
|
+
}, {
|
84
102
|
default: withCtx(() => [
|
85
|
-
createElementVNode("
|
103
|
+
createElementVNode("h2", _hoisted_2, toDisplayString(unref(route).params.product ? state.current.name : "Create Product"), 1),
|
86
104
|
unref(route).params.product ? (openBlock(), createBlock(_sfc_main$2, {
|
87
105
|
key: 0,
|
88
106
|
submit: onDelete,
|
@@ -106,7 +124,7 @@ const _sfc_main = {
|
|
106
124
|
})
|
107
125
|
]),
|
108
126
|
_: 1
|
109
|
-
}),
|
127
|
+
})) : createCommentVNode("", true),
|
110
128
|
createVNode(_sfc_main$1, {
|
111
129
|
placeholder: "The product doesn't have any images yet.",
|
112
130
|
class: "h-min"
|
@@ -131,6 +149,70 @@ const _sfc_main = {
|
|
131
149
|
]),
|
132
150
|
_: 1
|
133
151
|
}),
|
152
|
+
createVNode(_sfc_main$1, {
|
153
|
+
title: "Categories",
|
154
|
+
actions: [{
|
155
|
+
label: "+",
|
156
|
+
function: () => unref(router).push({
|
157
|
+
name: "Categories",
|
158
|
+
params: {
|
159
|
+
_id: unref(route).params._id
|
160
|
+
}
|
161
|
+
})
|
162
|
+
}]
|
163
|
+
}, {
|
164
|
+
default: withCtx(() => [
|
165
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(state$1.all, (category, index) => {
|
166
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
167
|
+
label: category.name,
|
168
|
+
name: "categories",
|
169
|
+
value: category.url,
|
170
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
171
|
+
radio: state.current.category,
|
172
|
+
"onUpdate:radio": (event) => state.current.category = event
|
173
|
+
}, null, 8, ["label", "value", "radio", "onUpdate:radio"]);
|
174
|
+
}), 256))
|
175
|
+
]),
|
176
|
+
_: 1
|
177
|
+
}, 8, ["actions"]),
|
178
|
+
createVNode(_sfc_main$1, {
|
179
|
+
title: "Parameters",
|
180
|
+
placeholder: "No parameters added yet",
|
181
|
+
actions: [{
|
182
|
+
label: "+",
|
183
|
+
function: () => state.current.information.push({ name: "", value: "" })
|
184
|
+
}],
|
185
|
+
class: "cols-1 gap-thin"
|
186
|
+
}, {
|
187
|
+
default: withCtx(() => [
|
188
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(state.current.information, (item, index) => {
|
189
|
+
return openBlock(), createElementBlock("div", {
|
190
|
+
class: "gap-thin flex-nowrap flex",
|
191
|
+
key: index
|
192
|
+
}, [
|
193
|
+
createVNode(Field, {
|
194
|
+
field: item.name,
|
195
|
+
"onUpdate:field": ($event) => item.name = $event,
|
196
|
+
placeholder: "Название параметра",
|
197
|
+
class: "w-100 bg-white radius-small pd-medium"
|
198
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
199
|
+
createVNode(Field, {
|
200
|
+
field: item.value,
|
201
|
+
"onUpdate:field": ($event) => item.value = $event,
|
202
|
+
placeholder: "Значение параметра",
|
203
|
+
class: "w-100 bg-white radius-small pd-medium"
|
204
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
205
|
+
createElementVNode("div", _hoisted_4, [
|
206
|
+
createVNode(_sfc_main$6, {
|
207
|
+
onClick: () => state.current.information.splice(index, 1),
|
208
|
+
class: "i-medium"
|
209
|
+
}, null, 8, ["onClick"])
|
210
|
+
])
|
211
|
+
]);
|
212
|
+
}), 128))
|
213
|
+
]),
|
214
|
+
_: 1
|
215
|
+
}, 8, ["actions"]),
|
134
216
|
createVNode(_sfc_main$1, {
|
135
217
|
title: "Ingredients",
|
136
218
|
placeholder: "No ingridients added yet",
|
@@ -140,9 +222,9 @@ const _sfc_main = {
|
|
140
222
|
}]
|
141
223
|
}, {
|
142
224
|
default: withCtx(() => [
|
143
|
-
state.current.ingredients.length > 0 ? (openBlock(), createElementBlock("div",
|
225
|
+
state.current.ingredients.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
144
226
|
(openBlock(true), createElementBlock(Fragment, null, renderList(state.current.ingredients, (product, index) => {
|
145
|
-
return openBlock(), createBlock(_sfc_main$
|
227
|
+
return openBlock(), createBlock(_sfc_main$7, {
|
146
228
|
key: product._id,
|
147
229
|
product,
|
148
230
|
array: state.current.ingredients,
|
@@ -166,15 +248,15 @@ const _sfc_main = {
|
|
166
248
|
]),
|
167
249
|
_: 1
|
168
250
|
}, 8, ["actions"]),
|
169
|
-
createVNode(_sfc_main$
|
251
|
+
createVNode(_sfc_main$8, {
|
170
252
|
title: "Add ingredient",
|
171
253
|
onClosePopup: closeIngredientPopup,
|
172
254
|
isPopupOpen: isOpenIngredientPopup.value,
|
173
255
|
class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
|
174
256
|
}, {
|
175
257
|
default: withCtx(() => [
|
176
|
-
createElementVNode("div",
|
177
|
-
createVNode(_sfc_main$
|
258
|
+
createElementVNode("div", _hoisted_6, [
|
259
|
+
createVNode(_sfc_main$9, {
|
178
260
|
search: {
|
179
261
|
class: "bg-white mn-b-thin"
|
180
262
|
},
|
@@ -197,7 +279,7 @@ const _sfc_main = {
|
|
197
279
|
items
|
198
280
|
}) => [
|
199
281
|
(openBlock(true), createElementBlock(Fragment, null, renderList(items, (product, index) => {
|
200
|
-
return openBlock(), createBlock(_sfc_main$
|
282
|
+
return openBlock(), createBlock(_sfc_main$a, {
|
201
283
|
key: product._id,
|
202
284
|
editable: false,
|
203
285
|
product,
|
@@ -219,70 +301,6 @@ const _sfc_main = {
|
|
219
301
|
_: 1
|
220
302
|
}, 8, ["isPopupOpen"])
|
221
303
|
]),
|
222
|
-
createVNode(_sfc_main$1, {
|
223
|
-
title: "Categories",
|
224
|
-
actions: [{
|
225
|
-
label: "+",
|
226
|
-
function: () => unref(router).push({
|
227
|
-
name: "Categories Organization",
|
228
|
-
params: {
|
229
|
-
_id: unref(route).params._id
|
230
|
-
}
|
231
|
-
})
|
232
|
-
}]
|
233
|
-
}, {
|
234
|
-
default: withCtx(() => [
|
235
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(state$1.all, (category, index) => {
|
236
|
-
return openBlock(), createBlock(_sfc_main$9, {
|
237
|
-
label: category.name,
|
238
|
-
name: "categories",
|
239
|
-
value: category.url,
|
240
|
-
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
241
|
-
radio: state.current.category,
|
242
|
-
"onUpdate:radio": (event) => state.current.category = event
|
243
|
-
}, null, 8, ["label", "value", "radio", "onUpdate:radio"]);
|
244
|
-
}), 256))
|
245
|
-
]),
|
246
|
-
_: 1
|
247
|
-
}, 8, ["actions"]),
|
248
|
-
createVNode(_sfc_main$1, {
|
249
|
-
title: "Parameters",
|
250
|
-
placeholder: "No parameters added yet",
|
251
|
-
actions: [{
|
252
|
-
label: "+",
|
253
|
-
function: () => state.current.information.push({ name: "", value: "" })
|
254
|
-
}],
|
255
|
-
class: "cols-1 gap-thin"
|
256
|
-
}, {
|
257
|
-
default: withCtx(() => [
|
258
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(state.current.information, (item, index) => {
|
259
|
-
return openBlock(), createElementBlock("div", {
|
260
|
-
class: "gap-thin flex-nowrap flex",
|
261
|
-
key: index
|
262
|
-
}, [
|
263
|
-
createVNode(Field, {
|
264
|
-
field: item.name,
|
265
|
-
"onUpdate:field": ($event) => item.name = $event,
|
266
|
-
placeholder: "Название параметра",
|
267
|
-
class: "w-100 bg-white radius-small pd-medium"
|
268
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
269
|
-
createVNode(Field, {
|
270
|
-
field: item.value,
|
271
|
-
"onUpdate:field": ($event) => item.value = $event,
|
272
|
-
placeholder: "Значение параметра",
|
273
|
-
class: "w-100 bg-white radius-small pd-medium"
|
274
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
275
|
-
createElementVNode("div", _hoisted_6, [
|
276
|
-
createVNode(_sfc_main$a, {
|
277
|
-
onClick: () => state.current.information.splice(index, 1),
|
278
|
-
class: "i-medium"
|
279
|
-
}, null, 8, ["onClick"])
|
280
|
-
])
|
281
|
-
]);
|
282
|
-
}), 128))
|
283
|
-
]),
|
284
|
-
_: 1
|
285
|
-
}, 8, ["actions"]),
|
286
304
|
createVNode(_sfc_main$1, {
|
287
305
|
title: "Localization",
|
288
306
|
placeholder: "No localizations added yet",
|
@@ -310,7 +328,7 @@ const _sfc_main = {
|
|
310
328
|
class: "w-100 bg-white radius-small pd-medium"
|
311
329
|
}, null, 8, ["field", "onUpdate:field"]),
|
312
330
|
createElementVNode("div", _hoisted_7, [
|
313
|
-
createVNode(_sfc_main$
|
331
|
+
createVNode(_sfc_main$6, {
|
314
332
|
onClick: () => state.current.localization.splice(index, 1),
|
315
333
|
class: "i-medium"
|
316
334
|
}, null, 8, ["onClick"])
|
@@ -319,7 +337,28 @@ const _sfc_main = {
|
|
319
337
|
}), 128))
|
320
338
|
]),
|
321
339
|
_: 1
|
322
|
-
}, 8, ["actions"])
|
340
|
+
}, 8, ["actions"]),
|
341
|
+
unref(route).params.product ? (openBlock(), createBlock(_sfc_main$2, {
|
342
|
+
key: 1,
|
343
|
+
submit: onDelete,
|
344
|
+
callback: redirectTo,
|
345
|
+
class: "bg-red w-100 mn-b-thin"
|
346
|
+
}, {
|
347
|
+
default: withCtx(() => _cache[4] || (_cache[4] = [
|
348
|
+
createTextVNode(" Delete ")
|
349
|
+
])),
|
350
|
+
_: 1
|
351
|
+
})) : createCommentVNode("", true),
|
352
|
+
createVNode(_sfc_main$2, {
|
353
|
+
submit: onSubmit,
|
354
|
+
callback: redirectTo,
|
355
|
+
class: "w-100 bg-main"
|
356
|
+
}, {
|
357
|
+
default: withCtx(() => _cache[5] || (_cache[5] = [
|
358
|
+
createTextVNode(" Save ")
|
359
|
+
])),
|
360
|
+
_: 1
|
361
|
+
})
|
323
362
|
]);
|
324
363
|
};
|
325
364
|
}
|
package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ProductEdit.vue.js","sources":["../../../../../../../src/modules/products/components/pages/ProductEdit.vue"],"sourcesContent":["<template>\n\t<div class=\"for-transition w-100 cols-1 pd-thin gap-thin\">\n \n <Block class=\"flex-nowrap flex-v-center flex\">\n \n <h1 class=\"mn-r-auto\">\n\t\t\t {{ route.params.product ? products.state.current.name : 'Create Product' }}\n\t\t\t</h1>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red mn-r-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-main\"\n >\n \t\tSave\n \t</Button>\n </Block>\n\n <Block\n\t\t\tplaceholder=\"The product doesn't have any images yet.\"\n\t\t\tclass=\"h-min\"\n\t\t>\n\t\t\t<EditImages \n\t\t\t\t:images=\"products.state.current.images\"\n\t\t\t\t:uploadPath=\"'photos'\" \n\t\t\t\t@update:images=\"(imagesNew) => { products.state.current.images = imagesNew }\" \n\t\t\t/>\n\t\t</Block>\n\n <div class=\"cols-2 gap-thin\">\n\n \t<Block\n \t\t\ttitle=\"Profile\"\n \t\t>\n\t\t\t\t<EditProductInfo \t\t\n\t\t\t\t\t:product=\"products.state.current\"\n\t\t\t\t/>\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t title=\"Ingredients\"\n\t\t\t\tplaceholder=\"No ingridients added yet\"\n\t\t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => openIngredientPopup()\n\t }]\"\n\t\t >\n\t\t \t<div v-if=\"products.state.current.ingredients.length > 0\" class=\"cols-1 gap-thin\">\n\t\t\t <CardPosition \n\t\t\t v-for=\"(product, index) in products.state.current.ingredients\" \n\t\t\t :key=\"product._id\" \n\t\t\t :product=\"product\"\n\t\t\t :array=\"products.state.current.ingredients\"\n\t\t\t :products=\"Products\"\n\t\t :showPrice=\"false\"\n\t\t\t @add=\"(item) => {\n\t\t\t\t\t globals.actions.add(products.state.current.ingredients, item);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @update=\"(item) => {\n\t\t\t\t\t globals.actions.update(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @delete=\"(item) => {\n\t\t\t\t\t globals.actions.delete(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t />\n\t\t\t </div>\n\t\t </Block>\n\n\t\t <Popup \n\t title=\"Add ingredient\" \n\t @close-popup=\"closeIngredientPopup\" \n\t :isPopupOpen=\"isOpenIngredientPopup\"\n\t class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n\t >\n\t <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n\t <Feed\n\t :search=\"{\n\t \tclass: 'bg-white mn-b-thin'\n\t }\"\n\t :states=\"{\n\t empty: {\n\t title: 'No Products Found',\n\t description: 'Currently, there are no such products available.'\n\t }\n\t }\"\n\t :store=\"{\n\t read: (options) => products.actions.read(options),\n\t state: null\n\t }\"\n\t :options=\"{\n\t organization: route.params._id\n\t }\"\n\t v-slot=\"{ \n\t items \n\t }\"\n\t class=\"\"\n\t >\n\t <CardOrderItem\n\t v-for=\"(product, index) in items\" :key=\"product._id\"\n\t :editable=\"false\" \n\t :product=\"product\" \n\t @click=\"() => { \n\t let p = { ...product };\n\t p.quantity = 1;\n\t p.type = 'pcs'\n\t globals.actions.add(products.state.current.ingredients,p)\n\t closeIngredientPopup();\n\t }\"\n\t class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n\t />\n\t </Feed>\n\t </div>\n\t </Popup>\n\n\n\t\t</div> \n\n\t\t\t<Block\n \t\t\ttitle=\"Categories\"\n \t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => router.push({\n\t\t\t\t\t\tname: 'Categories Organization', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\t_id: route.params._id\n\t\t\t\t\t\t} \n\t\t\t\t\t})\n\t }]\"\n \t\t>\n\t\t\t\t<Checkbox \n\t\t\t\t\tv-for=\"(category, index) in categories.state.all\"\n :label=\"category.name\"\n name=\"categories\"\n :value=\"category.url\"\n class=\"w-100 mn-t-small bg-white radius-small pd-small\"\n :radio=\"products.state.current.category\"\n @update:radio=\"event => products.state.current.category = event\"\n />\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Parameters\"\n\t\t\t\tplaceholder=\"No parameters added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.information.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t\tclass=\"cols-1 gap-thin\"\n\t\t\t>\n <div \n \tclass=\"gap-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.information\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.information.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n\t </div>\n </div>\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Localization\"\n\t\t\t\tplaceholder=\"No localizations added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.localization.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t>\n <div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.localization\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.localization.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n </div>\n </div>\n\t\t\t</Block>\n\n\t\n\t\t\n\t\t<!-- <Block\n\t title=\"Quantity Discount\"\n\t class=\"mn-b-semi\"\n\t :actions=\"[{\n\t\t\t\tlabel: '+',\n\t\t\t\tfunction: () => products.state.current.quantityDiscount.push({name: '', value: ''})\n\t\t\t}]\"\n\t >\n\t \t<div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.quantityDiscount\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Quantity\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Discount\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n <IconDelete \n \t@click=\"() => products.state.current.quantityDiscount.splice(index, 1)\" \n \tclass=\"i-medium\"\n />\n </div>\n </div>\n\t\t</Block> -->\n\n\t\t<!-- <EditModifications\n\t\t\t:product=\"products.state.current\"\n\t\t/> -->\n\n\n\n\t\t\n\n</div>\n\t\n</template>\n\n<script setup>\n\t// Import libs\n\timport { reactive, computed, onMounted, ref } from 'vue'\n\timport { useRoute, useRouter } from 'vue-router'\n\t// Import components\n\timport Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\n\timport Block from '@pf/src/components/Block/Block.vue';\n\timport Tab from \"@pf/src/components/Tab/Tab.vue\";\n\timport Field from \"@pf/src/components/Field/Field.vue\";\n\timport Checkbox from \"@pf/src/components/Checkbox/Checkbox.vue\";\n\timport Button from \"@pf/src/components/Button/Button.vue\";\n\timport Popup from \"@pf/src/components/Popup/Popup.vue\";\n\timport Feed from \"@pf/src/components/Feed/Feed.vue\";\n\n\timport EditImages from '@pf/src/components/EditImages/EditImages.vue';\n\n\timport IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n \timport CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';\n import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'\n\n\n\timport EditProductInfo from '@pf/src/modules/products/components/sections/EditProductInfo.vue';\n import EditModifications from '@pf/src/modules/products/components/sections/EditModifications.vue';\n \n\t// Accessing router and store\n\timport * as globals from '@pf/src/modules/globals/views/store/globals';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n const Products = ref(products.state.all);\n const isOpenIngredientPopup = ref(false);\n\n\n function openIngredientPopup(member) {\n\t isOpenIngredientPopup.value = true;\n\t // if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeIngredientPopup() {\n\t isOpenIngredientPopup.value = false;\n\t // selectedMember.value = null;\n\t}\n\n onMounted(async() => { \n\t products.mutations.resetProduct();\n\n \tif (route.params.product) {\n\t\t await products.actions.read({ _id: route.params.product });\n\t } \n\n\t if (!products.state.current.ingredients) {\n\t \tproducts.state.current.ingredients = []\n\t }\n\n \t// Data prefetching\n\t \tawait categories.actions.fetchCategories()\n\n try {\n const productsResponse = await products.actions.read({\n organization: route.params._id,\n limit: 100\n });\n Products.value = productsResponse;\n } catch (error) {\n console.error('error');\n }\n })\n\n\tfunction onImagesUpdate(newImages) {\n\t products.state.current.images = newImages;\n\t}\n\t\n\tfunction onSubmit() {\n\t\tif (route.params.product) {\n\t\t\tproducts.actions.update(route.params.product, products.state.current)\n\t\t} else {\n\t\t\tproducts.actions.create(route.params._id, products.state.current)\n\t\t}\n\t}\n\n\tfunction onDelete() {\n\t\tproducts.actions.deleteProduct(products.state.current._id)\n\t}\n\n\tfunction redirectTo () {\n\t\trouter.push({\n\t\t\tname: 'Organization', \n\t\t\tparams: { \n\t\t\t\t_id: route.params._id\n\t\t\t} \n\t\t})\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.main-photo {\n\t\tmax-width: 50%;\n\t\timg { width: 100%; }\n\t}\n</style>\n"],"names":["products.state","products.mutations","products.actions","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwSC,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAEzB,UAAM,WAAW,IAAIA,MAAe,GAAG;AACvC,UAAM,wBAAwB,IAAI,KAAK;AAGvC,aAAS,oBAAoB,QAAQ;AACpC,4BAAsB,QAAQ;AAAA,IAE/B;AAED,aAAS,uBAAuB;AAC9B,4BAAsB,QAAQ;AAAA,IAE/B;AAEA,cAAU,YAAW;AACpBC,gBAAmB,aAAY;AAE/B,UAAI,MAAM,OAAO,SAAS;AACzB,cAAMC,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAO,CAAE;AAAA,MACzD;AAED,UAAI,CAACF,MAAe,QAAQ,aAAa;AACxCA,cAAe,QAAQ,cAAc,CAAE;AAAA,MACvC;AAGD,YAAMG,UAAmB,gBAAiB;AAEzC,UAAI;AACF,cAAM,mBAAmB,MAAMD,QAAiB,KAAK;AAAA,UACnD,cAAc,MAAM,OAAO;AAAA,UAC3B,OAAO;AAAA,QACf,CAAO;AACD,iBAAS,QAAQ;AAAA,MAClB,SAAQ,OAAO;AACd,gBAAQ,MAAM,OAAO;AAAA,MACtB;AAAA,IACL,CAAG;AAMF,aAAS,WAAW;AACnB,UAAI,MAAM,OAAO,SAAS;AACzBA,gBAAiB,OAAO,MAAM,OAAO,SAASF,MAAe,OAAO;AAAA,MACvE,OAAS;AACNE,gBAAiB,OAAO,MAAM,OAAO,KAAKF,MAAe,OAAO;AAAA,MAChE;AAAA,IACD;AAED,aAAS,WAAW;AACnBE,cAAiB,cAAcF,MAAe,QAAQ,GAAG;AAAA,IACzD;AAED,aAAS,aAAc;AACtB,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,KAAK,MAAM,OAAO;AAAA,QAClB;AAAA,MACJ,CAAG;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"ProductEdit.vue.js","sources":["../../../../../../../src/modules/products/components/pages/ProductEdit.vue"],"sourcesContent":["<template>\n\t<div class=\"for-transition w-100 cols-1 bg-white pd-thin gap-thin\">\n \n <Block v-if=\"!MOBILE_APP\" class=\"flex-nowrap gap-small flex-v-center flex\">\n \n <h2 class=\"t-nowrap mn-r-auto\">\n\t\t\t {{ route.params.product ? products.state.current.name : 'Create Product' }}\n\t\t\t</h2>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red mn-r-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-main\"\n >\n \t\tSave\n \t</Button>\n </Block>\n\n <Block\n\t\t\tplaceholder=\"The product doesn't have any images yet.\"\n\t\t\tclass=\"h-min\"\n\t\t>\n\t\t\t<EditImages \n\t\t\t\t:images=\"products.state.current.images\"\n\t\t\t\t:uploadPath=\"'photos'\" \n\t\t\t\t@update:images=\"(imagesNew) => { products.state.current.images = imagesNew }\" \n\t\t\t/>\n\t\t</Block>\n\n <div class=\"cols-2 gap-thin\">\n\n \t<Block\n \t\t\ttitle=\"Profile\"\n \t\t>\n\t\t\t\t<EditProductInfo \t\t\n\t\t\t\t\t:product=\"products.state.current\"\n\t\t\t\t/>\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Categories\"\n\t\t\t\t:actions=\"[{\n\t\t label: '+',\n\t\t function: () => router.push({\n\t\t\t\t\t\tname: 'Categories', \n\t\t\t\t\t\tparams: { \n\t\t\t\t\t\t\t_id: route.params._id\n\t\t\t\t\t\t} \n\t\t\t\t\t})\n\t\t }]\"\n\t\t\t>\n\t\t\t\t<Checkbox \n\t\t\t\t\tv-for=\"(category, index) in categories.state.all\"\n\t\t :label=\"category.name\"\n\t\t name=\"categories\"\n\t\t :value=\"category.url\"\n\t\t class=\"w-100 mn-t-small bg-white radius-small pd-small\"\n\t\t :radio=\"products.state.current.category\"\n\t\t @update:radio=\"event => products.state.current.category = event\"\n\t\t />\n\t\t\t</Block>\n\n\t\t\t<Block\n\t\t\t\ttitle=\"Parameters\"\n\t\t\t\tplaceholder=\"No parameters added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.information.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t\tclass=\"cols-1 gap-thin\"\n\t\t\t>\n <div \n \tclass=\"gap-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.information\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.information.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n\t </div>\n </div>\n\t\t\t</Block>\n\n\n\t\t\t<Block\n\t\t title=\"Ingredients\"\n\t\t\t\tplaceholder=\"No ingridients added yet\"\n\t\t\t\t:actions=\"[{\n\t label: '+',\n\t function: () => openIngredientPopup()\n\t }]\"\n\t\t >\n\t\t \t<div v-if=\"products.state.current.ingredients.length > 0\" class=\"cols-1 gap-thin\">\n\t\t\t <CardPosition \n\t\t\t v-for=\"(product, index) in products.state.current.ingredients\" \n\t\t\t :key=\"product._id\" \n\t\t\t :product=\"product\"\n\t\t\t :array=\"products.state.current.ingredients\"\n\t\t\t :products=\"Products\"\n\t\t :showPrice=\"false\"\n\t\t\t @add=\"(item) => {\n\t\t\t\t\t globals.actions.add(products.state.current.ingredients, item);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @update=\"(item) => {\n\t\t\t\t\t globals.actions.update(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t\t\t @delete=\"(item) => {\n\t\t\t\t\t globals.actions.delete(products.state.current.ingredients, item, index);\n\t\t\t\t\t closeIngredientPopup();\n\t\t\t\t\t }\"\n\t\t\t />\n\t\t\t </div>\n\t\t </Block>\n\n\t\t <Popup \n\t title=\"Add ingredient\" \n\t @close-popup=\"closeIngredientPopup\" \n\t :isPopupOpen=\"isOpenIngredientPopup\"\n\t class=\"bg-white w-min-30r w-max-30r radius-big pd-medium\"\n\t >\n\t <div class=\"bg-light mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big\">\n\t <Feed\n\t :search=\"{\n\t \tclass: 'bg-white mn-b-thin'\n\t }\"\n\t :states=\"{\n\t empty: {\n\t title: 'No Products Found',\n\t description: 'Currently, there are no such products available.'\n\t }\n\t }\"\n\t :store=\"{\n\t read: (options) => products.actions.read(options),\n\t state: null\n\t }\"\n\t :options=\"{\n\t organization: route.params._id\n\t }\"\n\t v-slot=\"{ \n\t items \n\t }\"\n\t class=\"\"\n\t >\n\t <CardOrderItem\n\t v-for=\"(product, index) in items\" :key=\"product._id\"\n\t :editable=\"false\" \n\t :product=\"product\" \n\t @click=\"() => { \n\t let p = { ...product };\n\t p.quantity = 1;\n\t p.type = 'pcs'\n\t globals.actions.add(products.state.current.ingredients,p)\n\t closeIngredientPopup();\n\t }\"\n\t class=\"bg-white pd-thin radius-medium w-100 mn-b-thin\"\n\t />\n\t </Feed>\n\t </div>\n\t </Popup>\n\n\n\t\t</div> \n\n\t\t\t<Block\n\t\t\t\ttitle=\"Localization\"\n\t\t\t\tplaceholder=\"No localizations added yet\"\n\t\t\t\t:actions=\"[{\n\t\t\t\t\tlabel: '+',\n\t\t\t\t\tfunction: () => products.state.current.localization.push({name: '', value: ''})\n\t\t\t\t}]\"\n\t\t\t>\n <div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.localization\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Название параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Значение параметра\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n\t <IconDelete \n\t \t@click=\"() => products.state.current.localization.splice(index, 1)\" \n\t \tclass=\"i-medium\"\n\t />\n </div>\n </div>\n\t\t\t</Block>\n\n\t\t\t<Button \n\t\t\t\tv-if=\"route.params.product\"\n \t:submit=\"onDelete\" \n \t:callback=\"redirectTo\"\n \tclass=\"bg-red w-100 mn-b-thin\"\n >\n \t\tDelete \n \t</Button>\n\n <Button \n \t:submit=\"onSubmit\" \n \t:callback=\"redirectTo\"\n \tclass=\"w-100 bg-main\"\n >\n \t\tSave\n \t</Button>\n\n\t\n\t\t\n\t\t<!-- <Block\n\t title=\"Quantity Discount\"\n\t class=\"mn-b-semi\"\n\t :actions=\"[{\n\t\t\t\tlabel: '+',\n\t\t\t\tfunction: () => products.state.current.quantityDiscount.push({name: '', value: ''})\n\t\t\t}]\"\n\t >\n\t \t<div \n \tclass=\"gap-thin mn-b-thin flex-nowrap flex\" \n \tv-for=\"(item, index) in products.state.current.quantityDiscount\" \n \t:key=\"index\"\n > \n <Field\n v-model:field=\"item.name\"\n placeholder=\"Quantity\"\n class=\"w-100 bg-white radius-small pd-medium\"\n /> \n <Field\n v-model:field=\"item.value\"\n placeholder=\"Discount\"\n class=\"w-100 bg-white radius-small pd-medium\"\n />\n <div class=\"radius-small pd-small flex-center flex aspect-1x1 bg-red\">\n <IconDelete \n \t@click=\"() => products.state.current.quantityDiscount.splice(index, 1)\" \n \tclass=\"i-medium\"\n />\n </div>\n </div>\n\t\t</Block> -->\n\n\t\t<!-- <EditModifications\n\t\t\t:product=\"products.state.current\"\n\t\t/> -->\n\n\n\n\t\t\n\n</div>\n\t\n</template>\n\n<script setup>\n\t// Import libs\n\timport { reactive, computed, onMounted, ref } from 'vue'\n\timport { useRoute, useRouter } from 'vue-router'\n\t// Import components\n\timport Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'\n\n\timport Block from '@pf/src/components/Block/Block.vue';\n\timport Tab from \"@pf/src/components/Tab/Tab.vue\";\n\timport Field from \"@pf/src/components/Field/Field.vue\";\n\timport Checkbox from \"@pf/src/components/Checkbox/Checkbox.vue\";\n\timport Button from \"@pf/src/components/Button/Button.vue\";\n\timport Popup from \"@pf/src/components/Popup/Popup.vue\";\n\timport Feed from \"@pf/src/components/Feed/Feed.vue\";\n\n\timport EditImages from '@pf/src/components/EditImages/EditImages.vue';\n\n\timport IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';\n\n \timport CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';\n import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'\n\n\n\timport EditProductInfo from '@pf/src/modules/products/components/sections/EditProductInfo.vue';\n import EditModifications from '@pf/src/modules/products/components/sections/EditModifications.vue';\n \n\t// Accessing router and store\n\timport * as globals from '@pf/src/modules/globals/views/store/globals';\n\timport * as auth from '@pf/src/modules/auth/views/store/auth';\n \timport * as products from '@pf/src/modules/products/store/products';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\timport { setError } from '@pf/src/modules/globals/views/store/globals'\n\t\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n const Products = ref(products.state.all);\n const isOpenIngredientPopup = ref(false);\n\n\n function openIngredientPopup(member) {\n\t isOpenIngredientPopup.value = true;\n\t // if (typeof member === \"number\") selectedMember.value = member;\n\t}\n\n\tfunction closeIngredientPopup() {\n\t isOpenIngredientPopup.value = false;\n\t // selectedMember.value = null;\n\t}\n\n onMounted(async() => { \n\t products.mutations.resetProduct();\n\n \tif (route.params.product) {\n\t\t await products.actions.read({ _id: route.params.product });\n\t } \n\n\t if (!products.state.current.ingredients) {\n\t \tproducts.state.current.ingredients = []\n\t }\n\n \t// Data prefetching\n\t \tawait categories.actions.fetchCategories()\n\n try {\n const productsResponse = await products.actions.read({\n organization: route.params._id,\n limit: 100\n });\n Products.value = productsResponse;\n } catch (error) {\n console.error('error');\n }\n })\n\n\tfunction onImagesUpdate(newImages) {\n\t products.state.current.images = newImages;\n\t}\n\t\n\tasync function onSubmit() {\n\t try {\n\t if (route.params.product) {\n\t await products.actions.update(route.params.product, products.state.current)\n\t } else {\n\t products.state.current.owner = {\n\t target: route.params._id || auth.state.user._id,\n\t type: route.params._id ? 'organization' : 'user'\n\t }\n\t \n\t products.state.current.creator = {\n\t target: auth.state.user._id,\n\t type: 'user',\n\t hidden: false\n\t }\n\t await products.actions.create(products.state.current)\n\t }\n\t } catch (error) {\n\t \tsetError({ response: { data: { errorCode: \"PRODUCT_NOT_CREATED\" }} })\n\t console.error('Product creation error:', error)\n\t // Здесь можно добавить обработку ошибки, например:\n\t // - показать уведомление пользователю\n\t // - отправить ошибку в систему мониторинга\n\t // - выполнить откат изменений при необходимости\n\t }\n\t}\n\n\tfunction onDelete() {\n\t\tproducts.actions.deleteProduct(products.state.current._id)\n\t}\n\n\tfunction redirectTo () {\n\t\trouter.push({\n\t\t\tname: 'Organization', \n\t\t\tparams: { \n\t\t\t\t_id: route.params._id\n\t\t\t} \n\t\t})\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.main-photo {\n\t\tmax-width: 50%;\n\t\timg { width: 100%; }\n\t}\n</style>\n"],"names":["products.state","products.mutations","products.actions","categories.actions","auth.state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TC,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAEzB,UAAM,WAAW,IAAIA,MAAe,GAAG;AACvC,UAAM,wBAAwB,IAAI,KAAK;AAGvC,aAAS,oBAAoB,QAAQ;AACpC,4BAAsB,QAAQ;AAAA,IAE/B;AAED,aAAS,uBAAuB;AAC9B,4BAAsB,QAAQ;AAAA,IAE/B;AAEA,cAAU,YAAW;AACpBC,gBAAmB,aAAY;AAE/B,UAAI,MAAM,OAAO,SAAS;AACzB,cAAMC,QAAiB,KAAK,EAAE,KAAK,MAAM,OAAO,QAAO,CAAE;AAAA,MACzD;AAED,UAAI,CAACF,MAAe,QAAQ,aAAa;AACxCA,cAAe,QAAQ,cAAc,CAAE;AAAA,MACvC;AAGD,YAAMG,UAAmB,gBAAiB;AAEzC,UAAI;AACF,cAAM,mBAAmB,MAAMD,QAAiB,KAAK;AAAA,UACnD,cAAc,MAAM,OAAO;AAAA,UAC3B,OAAO;AAAA,QACf,CAAO;AACD,iBAAS,QAAQ;AAAA,MAClB,SAAQ,OAAO;AACd,gBAAQ,MAAM,OAAO;AAAA,MACtB;AAAA,IACL,CAAG;AAMF,mBAAe,WAAW;AACxB,UAAI;AACF,YAAI,MAAM,OAAO,SAAS;AACxB,gBAAMA,QAAiB,OAAO,MAAM,OAAO,SAASF,MAAe,OAAO;AAAA,QACjF,OAAY;AACLA,gBAAe,QAAQ,QAAQ;AAAA,YAC7B,QAAQ,MAAM,OAAO,OAAOI,QAAW,KAAK;AAAA,YAC5C,MAAM,MAAM,OAAO,MAAM,iBAAiB;AAAA,UAC3C;AAEDJ,gBAAe,QAAQ,UAAU;AAAA,YAC/B,QAAQI,QAAW,KAAK;AAAA,YACxB,MAAM;AAAA,YACN,QAAQ;AAAA,UACT;AACD,gBAAMF,QAAiB,OAAOF,MAAe,OAAO;AAAA,QACrD;AAAA,MACF,SAAQ,OAAO;AACf,iBAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,sBAAuB,EAAA,GAAG;AACnE,gBAAQ,MAAM,2BAA2B,KAAK;AAAA,MAK/C;AAAA,IACF;AAED,aAAS,WAAW;AACnBE,cAAiB,cAAcF,MAAe,QAAQ,GAAG;AAAA,IACzD;AAED,aAAS,aAAc;AACtB,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,KAAK,MAAM,OAAO;AAAA,QAClB;AAAA,MACJ,CAAG;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -12,7 +12,9 @@ const marketplace = require("../../store/marketplace.cjs");
|
|
12
12
|
const BlockSearch = require("../../../globals/views/components/blocks/BlockSearch.vue.cjs");
|
13
13
|
const BlockFilter = require("../../../globals/views/components/blocks/BlockFilter.vue.cjs");
|
14
14
|
const CardProduct = require("../blocks/CardProduct.vue.cjs");
|
15
|
+
const IconPlus = require("../../../icons/navigation/IconPlus.vue.cjs");
|
15
16
|
const auth = require("../../../auth/views/store/auth.cjs");
|
17
|
+
const globals = require("../../../globals/views/store/globals.cjs");
|
16
18
|
const products = require("../../store/products.cjs");
|
17
19
|
const _hoisted_1 = { class: "h-100" };
|
18
20
|
const _hoisted_2 = {
|
@@ -38,7 +40,14 @@ const _sfc_main = {
|
|
38
40
|
vue.watch(tabProducts, (newValue) => {
|
39
41
|
if (route.name !== "Organization") router.replace({ query: { ...route.query, tabProducts: newValue } });
|
40
42
|
});
|
41
|
-
|
43
|
+
globals.state.navigation_bar.actions = [{
|
44
|
+
component: IconPlus.default,
|
45
|
+
props: {
|
46
|
+
fill: "rgb(var(--main))"
|
47
|
+
},
|
48
|
+
condition: () => auth.state.user && auth.state.user._id,
|
49
|
+
action: () => route.params._id ? router.push({ name: "Organization_ProductAdd", params: { _id: route.params._id } }) : router.push({ name: "ProductAdd" })
|
50
|
+
}], vue.onMounted(async () => {
|
42
51
|
let categoriesFilter = await categories.actions.fetchCategories();
|
43
52
|
categoriesFilter = categoriesFilter.map((category) => ({
|
44
53
|
value: category.url,
|
@@ -56,6 +65,9 @@ const _sfc_main = {
|
|
56
65
|
marketplace.state.filter.options.unshift(categoryOption);
|
57
66
|
}
|
58
67
|
});
|
68
|
+
vue.onUnmounted(() => {
|
69
|
+
globals.state.navigation_bar.actions = [];
|
70
|
+
});
|
59
71
|
vue.watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {
|
60
72
|
let query = { ...route.query };
|
61
73
|
query.sortParam = newSortValue.param;
|
@@ -82,13 +94,17 @@ const _sfc_main = {
|
|
82
94
|
router.replace({ query });
|
83
95
|
}
|
84
96
|
return (_ctx, _cache) => {
|
97
|
+
const _component_router_link = vue.resolveComponent("router-link");
|
85
98
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
86
99
|
vue.unref(route).name !== "Organization" && !_ctx.MOBILE_APP ? (vue.openBlock(), vue.createElementBlock("header", _hoisted_2, [
|
87
100
|
_cache[4] || (_cache[4] = vue.createElementVNode("h2", { class: "mn-r-medium" }, "Products", -1)),
|
88
101
|
vue.createElementVNode("button", {
|
89
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
90
|
-
|
91
|
-
|
102
|
+
onClick: _cache[0] || (_cache[0] = ($event) => {
|
103
|
+
var _a;
|
104
|
+
return _ctx.$router.push({
|
105
|
+
name: ((_a = vue.unref(route).params) == null ? void 0 : _a._id) ? "Organization_ProductAdd" : "ProductAdd"
|
106
|
+
});
|
107
|
+
}),
|
92
108
|
class: "radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"
|
93
109
|
}, " + ")
|
94
110
|
])) : vue.createCommentVNode("", true),
|
@@ -104,7 +120,7 @@ const _sfc_main = {
|
|
104
120
|
],
|
105
121
|
style: { "flex": "0 0 auto" },
|
106
122
|
class: "o-hidden h5 bg-light gap-micro pd-small pd-t-thin pd-b-thin pos-sticky pos-t-0 z-index-1",
|
107
|
-
tabClass: "bg-white pd-small radius-small w-100"
|
123
|
+
tabClass: "bg-white uppercase pd-small radius-small w-100"
|
108
124
|
}, null, 8, ["selected"])) : vue.createCommentVNode("", true),
|
109
125
|
vue.createElementVNode("div", _hoisted_3, [
|
110
126
|
vue.createVNode(BlockFilter.default, {
|
@@ -136,7 +152,7 @@ const _sfc_main = {
|
|
136
152
|
},
|
137
153
|
options: {
|
138
154
|
limit: 15,
|
139
|
-
|
155
|
+
owner: vue.unref(route).params._id,
|
140
156
|
categories: vue.unref(route).query.categories,
|
141
157
|
prices: vue.unref(route).query.prices,
|
142
158
|
delivery: vue.unref(route).query.delivery,
|
@@ -144,26 +160,28 @@ const _sfc_main = {
|
|
144
160
|
...tabProducts.value !== "all" && { status: tabProducts.value }
|
145
161
|
// user: user
|
146
162
|
},
|
147
|
-
class: "cols-4 pd-thin gap-thin"
|
163
|
+
class: "cols-4 rows-1 pd-t-zero pd-thin gap-thin"
|
148
164
|
}, {
|
149
165
|
default: vue.withCtx(({
|
150
166
|
items
|
151
167
|
}) => [
|
152
168
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (product) => {
|
153
|
-
return vue.openBlock(), vue.createBlock(
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
169
|
+
return vue.openBlock(), vue.createBlock(_component_router_link, {
|
170
|
+
to: vue.unref(route).params._id ? { name: "Organization_Product", params: { _id: vue.unref(route).params._id, product: product._id } } : { name: "Product", params: { product: product._id } }
|
171
|
+
}, {
|
172
|
+
default: vue.withCtx(() => [
|
173
|
+
(vue.openBlock(), vue.createBlock(CardProduct.default, {
|
174
|
+
key: product._id,
|
175
|
+
product,
|
176
|
+
user: auth.state.access,
|
177
|
+
organization: vue.unref(route).params._id,
|
178
|
+
access: _ctx.hasAccess(vue.unref(route).params._id, "products", "edit", auth.state.accesses),
|
179
|
+
class: "h-max bg-light"
|
180
|
+
}, null, 8, ["product", "user", "organization", "access"]))
|
181
|
+
]),
|
182
|
+
_: 2
|
183
|
+
}, 1032, ["to"]);
|
184
|
+
}), 256))
|
167
185
|
]),
|
168
186
|
_: 1
|
169
187
|
}, 8, ["filter", "store", "options"])
|