@ozdao/prometheus-framework 0.2.309 → 0.2.311
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/products.server.js +192 -195
- package/dist/products.server.mjs +192 -195
- 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.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.js +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.js.map +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/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 +2 -4
- 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 +3 -5
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/BottomNavigationBar.vue.cjs +3 -3
- 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 +3 -3
- 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 +18 -15
- 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 +21 -18
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- 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 +1 -2
- 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 +2 -3
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +554 -554
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +554 -554
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +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/pages/Categories.vue.cjs +78 -43
- 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 +80 -30
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +119 -80
- 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 +132 -93
- 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/EditProductInfo.vue.cjs +21 -7
- 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 +21 -7
- 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/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/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/pages/SpotEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.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 +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- 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 +3 -3
- package/src/modules/globals/views/components/partials/NavigationBar.vue +4 -4
- 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 +175 -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
@@ -1,168 +1,202 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
2
|
+
<div class="pd-thin bg-white for-transition w-100">
|
3
|
+
<Block v-if="!MOBILE_APP" class="radius-big mn-b-thin flex-nowrap flex-v-center flex">
|
4
|
+
<h1 class="mn-r-auto">
|
5
|
+
{{route.params.category ? 'Edit Category' : 'Add Category'}}
|
6
|
+
</h1>
|
7
|
+
|
8
|
+
<Button
|
9
|
+
:submit="onSubmit"
|
10
|
+
:callback="redirectTo"
|
11
|
+
class="pd-small radius-big bg-main t-black uppercase t-medium"
|
12
|
+
>
|
13
|
+
Save Category
|
14
|
+
</Button>
|
15
|
+
</Block>
|
16
|
+
|
17
|
+
<Block
|
18
|
+
title="Profile"
|
19
|
+
class="mn-b-thin"
|
11
20
|
>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
<div class="mn-b-medium w-100 flex-nowrap gap-thin flex">
|
22
|
+
<Field
|
23
|
+
v-model:field="categories.state.current.order"
|
24
|
+
label="Order"
|
25
|
+
:disabled="true"
|
26
|
+
class="w-40 bg-white radius-small pd-medium"
|
27
|
+
/>
|
28
|
+
<Field
|
29
|
+
v-model:field="categories.state.current.url"
|
30
|
+
label="URL"
|
31
|
+
placeholder="Enter category URL"
|
32
|
+
class="w-100 bg-white radius-small pd-medium"
|
33
|
+
/>
|
34
|
+
|
35
|
+
</div>
|
27
36
|
<Field
|
28
|
-
|
29
|
-
|
30
|
-
|
37
|
+
v-model:field="categories.state.current.name"
|
38
|
+
label="Name"
|
39
|
+
placeholder="Enter category name"
|
40
|
+
class="w-100 mn-b-small bg-white radius-small pd-medium"
|
41
|
+
/>
|
42
|
+
|
43
|
+
<Select
|
44
|
+
v-model:select="categories.state.current.status"
|
45
|
+
label="Status"
|
46
|
+
:options="[
|
47
|
+
'draft',
|
48
|
+
'internal',
|
49
|
+
'published',
|
50
|
+
'removed'
|
51
|
+
]"
|
52
|
+
placeholder="Display product"
|
53
|
+
class="pos-relative w-100 mn-b-small bg-white radius-small pd-medium"
|
54
|
+
/>
|
55
|
+
|
56
|
+
<div class="flex-v-center flex-nowrap flex">
|
57
|
+
<h4 class="mn-r-thin t-medium">Localization</h4>
|
58
|
+
|
59
|
+
<button
|
60
|
+
@click="() => categories.state.current.localization.push({locale: '', text: ''})"
|
61
|
+
class="i-small pd-thin button-delete button"
|
62
|
+
>
|
63
|
+
+
|
64
|
+
</button>
|
65
|
+
</div>
|
66
|
+
<div
|
67
|
+
class="gap-thin mn-b-thin flex-nowrap flex"
|
68
|
+
v-for="(item, index) in categories.state.current.localization"
|
69
|
+
:key="index"
|
70
|
+
>
|
71
|
+
<Field
|
72
|
+
v-model:field="item.locale"
|
73
|
+
placeholder="Locale"
|
31
74
|
class="w-100 bg-white radius-small pd-medium"
|
32
75
|
/>
|
33
76
|
<Field
|
34
|
-
v-model:field="
|
35
|
-
|
36
|
-
placeholder="Enter category name"
|
77
|
+
v-model:field="item.text"
|
78
|
+
placeholder="Text"
|
37
79
|
class="w-100 bg-white radius-small pd-medium"
|
38
|
-
/>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<Select
|
42
|
-
v-model:select="categories.state.current.status"
|
43
|
-
label="Status"
|
44
|
-
:options="[
|
45
|
-
'draft',
|
46
|
-
'internal',
|
47
|
-
'published',
|
48
|
-
'removed'
|
49
|
-
]"
|
50
|
-
placeholder="Display product"
|
51
|
-
class="pos-relative w-100 mn-b-small bg-white radius-small pd-medium"
|
52
|
-
/>
|
53
|
-
|
54
|
-
<div class="flex-v-center flex-nowrap flex">
|
55
|
-
<h4 class="mn-r-thin t-medium">Localization</h4>
|
56
|
-
|
57
|
-
<button
|
58
|
-
@click="() => categories.state.current.localization.push({locale: '', text: ''})"
|
59
|
-
class="i-small pd-thin button-delete button"
|
60
|
-
>
|
61
|
-
+
|
62
|
-
</button>
|
63
|
-
</div>
|
64
|
-
<div
|
65
|
-
class="gap-thin mn-b-thin flex-nowrap flex"
|
66
|
-
v-for="(item, index) in categories.state.current.localization"
|
67
|
-
:key="index"
|
68
|
-
>
|
69
|
-
<Field
|
70
|
-
v-model:field="item.locale"
|
71
|
-
placeholder="Locale"
|
72
|
-
class="w-100 bg-white radius-small pd-medium"
|
73
|
-
/>
|
74
|
-
<Field
|
75
|
-
v-model:field="item.text"
|
76
|
-
placeholder="Text"
|
77
|
-
class="w-100 bg-white radius-small pd-medium"
|
78
|
-
/>
|
79
|
-
<div
|
80
|
-
@click="() => categories.state.current.localization.splice(index, 1)"
|
81
|
-
class="radius-small pd-small flex-center flex aspect-1x1 bg-red"
|
82
|
-
>
|
83
|
-
<IconDelete
|
84
|
-
class="i-medium"
|
85
80
|
/>
|
81
|
+
<div
|
82
|
+
@click="() => categories.state.current.localization.splice(index, 1)"
|
83
|
+
class="radius-small pd-small flex-center flex aspect-1x1 bg-red"
|
84
|
+
>
|
85
|
+
<IconDelete
|
86
|
+
class="i-medium"
|
87
|
+
/>
|
88
|
+
</div>
|
86
89
|
</div>
|
87
|
-
</div>
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
91
|
+
|
92
|
+
</Block>
|
93
|
+
<!-- Subcategories -->
|
94
|
+
<Block
|
95
|
+
title="Subcategories"
|
96
|
+
placeholder="No subcategories added yet"
|
97
|
+
:actions="[{
|
98
|
+
label: '+',
|
99
|
+
function: () => categories.state.current.children.push({name: '', url: ''})
|
100
|
+
}]"
|
101
|
+
class="mn-b-thin"
|
102
|
+
>
|
103
|
+
|
104
|
+
{{categories.state.current.children}}
|
105
|
+
<Feed
|
106
|
+
:states="{
|
107
|
+
empty: {
|
108
|
+
title: 'No Events Found',
|
109
|
+
description: 'Currently, there are no events available.'
|
110
|
+
}
|
111
|
+
}"
|
112
|
+
:store="{
|
113
|
+
read: (options) => categories.actions.read(options),
|
114
|
+
state: categories.state
|
115
|
+
}"
|
116
|
+
:options="{
|
117
|
+
user: auth.state.user._id,
|
118
|
+
limit: 10
|
119
|
+
}"
|
120
|
+
v-slot="{
|
121
|
+
items
|
122
|
+
}"
|
119
123
|
>
|
120
|
-
<
|
121
|
-
|
124
|
+
<div
|
125
|
+
v-for="(category,index) in items"
|
126
|
+
@click="() => { categories.state.current.children.push(category._id) }"
|
127
|
+
class="bg-white pd-medium radius-small mn-b-medium"
|
128
|
+
>
|
129
|
+
{{category.name}}
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</Feed>
|
133
|
+
|
134
|
+
<div
|
135
|
+
class="gap-thin mn-b-thin flex-nowrap flex"
|
136
|
+
v-for="(item, index) in categories.state.current.children"
|
137
|
+
:key="index"
|
138
|
+
>
|
139
|
+
<Field
|
140
|
+
v-model:field="item.name"
|
141
|
+
placeholder="Subcategory name"
|
142
|
+
class="w-100 bg-white radius-small pd-medium"
|
143
|
+
/>
|
144
|
+
<Field
|
145
|
+
v-model:field="item.url"
|
146
|
+
placeholder="Subcategory"
|
147
|
+
class="w-100 bg-white radius-small pd-medium"
|
122
148
|
/>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
class="
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
class="
|
149
|
+
<div
|
150
|
+
@click="() => categories.state.current.children.splice(index, 1)"
|
151
|
+
class="radius-small pd-small flex-center flex aspect-1x1 bg-red"
|
152
|
+
>
|
153
|
+
<IconDelete
|
154
|
+
class="i-medium"
|
155
|
+
/>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
</Block>
|
159
|
+
<!-- Filters -->
|
160
|
+
<Block
|
161
|
+
title="Filters"
|
162
|
+
placeholder="No filters added yet"
|
163
|
+
:actions="[{
|
164
|
+
label: '+',
|
165
|
+
function: () => categories.state.current.filters.push({name: '', url: ''})
|
166
|
+
}]"
|
167
|
+
>
|
168
|
+
<div
|
169
|
+
class="gap-thin mn-b-thin flex-nowrap flex"
|
170
|
+
v-for="(item, index) in categories.state.current.filters"
|
171
|
+
:key="index"
|
172
|
+
>
|
173
|
+
<Field
|
174
|
+
v-model:field="item.name"
|
175
|
+
placeholder="Filter name"
|
176
|
+
class="w-100 bg-white radius-small pd-medium"
|
177
|
+
/>
|
178
|
+
<Field
|
179
|
+
v-model:field="item.options"
|
180
|
+
placeholder="Filter options divided by ,"
|
181
|
+
class="w-100 bg-white radius-small pd-medium"
|
156
182
|
/>
|
157
|
-
|
158
|
-
|
159
|
-
|
183
|
+
<div
|
184
|
+
@click="() => categories.state.current.filters.splice(index, 1)"
|
185
|
+
class="radius-small pd-small flex-center flex aspect-1x1 bg-red"
|
186
|
+
>
|
187
|
+
<IconDelete
|
188
|
+
class="i-medium"
|
189
|
+
/>
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
</Block>
|
193
|
+
</div>
|
160
194
|
|
161
195
|
</template>
|
162
196
|
|
163
197
|
<script setup>
|
164
198
|
// Import libs
|
165
|
-
import { computed } from 'vue'
|
199
|
+
import { computed, onUnmounted } from 'vue'
|
166
200
|
import { useRoute,useRouter } from 'vue-router'
|
167
201
|
|
168
202
|
import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';
|
@@ -170,10 +204,15 @@
|
|
170
204
|
import Button from "@pf/src/components/Button/Button.vue";
|
171
205
|
import Select from "@pf/src/components/Select/Select.vue";
|
172
206
|
import Field from "@pf/src/components/Field/Field.vue";
|
207
|
+
import Feed from '@pf/src/components/Feed/Feed.vue'
|
173
208
|
|
174
209
|
import Block from '@pf/src/components/Block/Block.vue';
|
175
210
|
|
211
|
+
import IconCheckmark from '@pf/src/modules/icons/navigation/IconCheckmark.vue'
|
212
|
+
|
176
213
|
// Import the new store structure
|
214
|
+
import * as globals from '@pf/src/modules/globals/views/store/globals';
|
215
|
+
import * as auth from '@pf/src/modules/auth/views/store/auth';
|
177
216
|
import * as categories from '@pf/src/modules/products/store/categories';
|
178
217
|
|
179
218
|
const route = useRoute()
|
@@ -181,21 +220,37 @@
|
|
181
220
|
|
182
221
|
// Data prefetching
|
183
222
|
if (route.params.category) {
|
184
|
-
categories.actions.
|
223
|
+
categories.actions.read({url: route.params.category})
|
185
224
|
} else {
|
186
|
-
categories.actions.
|
225
|
+
categories.actions.clean() // Adjusted based on the new store's method to reset the category state
|
187
226
|
}
|
188
227
|
|
189
228
|
// Accessing state
|
190
229
|
const category = computed(() => categories.state.current)
|
191
230
|
const routePath = computed(() => route.name)
|
192
231
|
|
232
|
+
// Navigation Bar
|
233
|
+
globals.state.navigation_bar.actions = [{
|
234
|
+
component: IconCheckmark,
|
235
|
+
props: {
|
236
|
+
fill: "rgb(var(--main))"
|
237
|
+
},
|
238
|
+
condition: () => auth.state.user && auth.state.user._id,
|
239
|
+
action: () => onSubmit()
|
240
|
+
}],
|
241
|
+
|
242
|
+
onUnmounted(() => {
|
243
|
+
globals.state.navigation_bar.actions = [];
|
244
|
+
});
|
245
|
+
|
246
|
+
|
247
|
+
|
193
248
|
// Functions
|
194
249
|
function onSubmit() {
|
195
250
|
if (route.params.category) {
|
196
|
-
categories.actions.
|
251
|
+
categories.actions.update(categories.state.current)
|
197
252
|
} else {
|
198
|
-
categories.actions.
|
253
|
+
categories.actions.create(categories.state.current)
|
199
254
|
}
|
200
255
|
}
|
201
256
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="for-transition w-100 cols-1 pd-thin gap-thin">
|
2
|
+
<div class="for-transition w-100 cols-1 bg-white pd-thin gap-thin">
|
3
3
|
|
4
|
-
<Block class="flex-nowrap flex-v-center flex">
|
4
|
+
<Block v-if="!MOBILE_APP" class="flex-nowrap gap-small flex-v-center flex">
|
5
5
|
|
6
|
-
<
|
6
|
+
<h2 class="t-nowrap mn-r-auto">
|
7
7
|
{{ route.params.product ? products.state.current.name : 'Create Product' }}
|
8
|
-
</
|
8
|
+
</h2>
|
9
9
|
|
10
10
|
<Button
|
11
11
|
v-if="route.params.product"
|
@@ -46,6 +46,63 @@
|
|
46
46
|
/>
|
47
47
|
</Block>
|
48
48
|
|
49
|
+
<Block
|
50
|
+
title="Categories"
|
51
|
+
:actions="[{
|
52
|
+
label: '+',
|
53
|
+
function: () => router.push({
|
54
|
+
name: 'Categories',
|
55
|
+
params: {
|
56
|
+
_id: route.params._id
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}]"
|
60
|
+
>
|
61
|
+
<Checkbox
|
62
|
+
v-for="(category, index) in categories.state.all"
|
63
|
+
:label="category.name"
|
64
|
+
name="categories"
|
65
|
+
:value="category.url"
|
66
|
+
class="w-100 mn-t-small bg-white radius-small pd-small"
|
67
|
+
:radio="products.state.current.category"
|
68
|
+
@update:radio="event => products.state.current.category = event"
|
69
|
+
/>
|
70
|
+
</Block>
|
71
|
+
|
72
|
+
<Block
|
73
|
+
title="Parameters"
|
74
|
+
placeholder="No parameters added yet"
|
75
|
+
:actions="[{
|
76
|
+
label: '+',
|
77
|
+
function: () => products.state.current.information.push({name: '', value: ''})
|
78
|
+
}]"
|
79
|
+
class="cols-1 gap-thin"
|
80
|
+
>
|
81
|
+
<div
|
82
|
+
class="gap-thin flex-nowrap flex"
|
83
|
+
v-for="(item, index) in products.state.current.information"
|
84
|
+
:key="index"
|
85
|
+
>
|
86
|
+
<Field
|
87
|
+
v-model:field="item.name"
|
88
|
+
placeholder="Название параметра"
|
89
|
+
class="w-100 bg-white radius-small pd-medium"
|
90
|
+
/>
|
91
|
+
<Field
|
92
|
+
v-model:field="item.value"
|
93
|
+
placeholder="Значение параметра"
|
94
|
+
class="w-100 bg-white radius-small pd-medium"
|
95
|
+
/>
|
96
|
+
<div class="radius-small h-100 i-big flex-center flex aspect-1x1 bg-red">
|
97
|
+
<IconDelete
|
98
|
+
@click="() => products.state.current.information.splice(index, 1)"
|
99
|
+
class="i-medium"
|
100
|
+
/>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
</Block>
|
104
|
+
|
105
|
+
|
49
106
|
<Block
|
50
107
|
title="Ingredients"
|
51
108
|
placeholder="No ingridients added yet"
|
@@ -127,64 +184,6 @@
|
|
127
184
|
|
128
185
|
</div>
|
129
186
|
|
130
|
-
<Block
|
131
|
-
title="Categories"
|
132
|
-
:actions="[{
|
133
|
-
label: '+',
|
134
|
-
function: () => router.push({
|
135
|
-
name: 'Categories Organization',
|
136
|
-
params: {
|
137
|
-
_id: route.params._id
|
138
|
-
}
|
139
|
-
})
|
140
|
-
}]"
|
141
|
-
>
|
142
|
-
<Checkbox
|
143
|
-
v-for="(category, index) in categories.state.all"
|
144
|
-
:label="category.name"
|
145
|
-
name="categories"
|
146
|
-
:value="category.url"
|
147
|
-
class="w-100 mn-t-small bg-white radius-small pd-small"
|
148
|
-
:radio="products.state.current.category"
|
149
|
-
@update:radio="event => products.state.current.category = event"
|
150
|
-
/>
|
151
|
-
</Block>
|
152
|
-
|
153
|
-
|
154
|
-
<Block
|
155
|
-
title="Parameters"
|
156
|
-
placeholder="No parameters added yet"
|
157
|
-
:actions="[{
|
158
|
-
label: '+',
|
159
|
-
function: () => products.state.current.information.push({name: '', value: ''})
|
160
|
-
}]"
|
161
|
-
class="cols-1 gap-thin"
|
162
|
-
>
|
163
|
-
<div
|
164
|
-
class="gap-thin flex-nowrap flex"
|
165
|
-
v-for="(item, index) in products.state.current.information"
|
166
|
-
:key="index"
|
167
|
-
>
|
168
|
-
<Field
|
169
|
-
v-model:field="item.name"
|
170
|
-
placeholder="Название параметра"
|
171
|
-
class="w-100 bg-white radius-small pd-medium"
|
172
|
-
/>
|
173
|
-
<Field
|
174
|
-
v-model:field="item.value"
|
175
|
-
placeholder="Значение параметра"
|
176
|
-
class="w-100 bg-white radius-small pd-medium"
|
177
|
-
/>
|
178
|
-
<div class="radius-small h-100 i-big flex-center flex aspect-1x1 bg-red">
|
179
|
-
<IconDelete
|
180
|
-
@click="() => products.state.current.information.splice(index, 1)"
|
181
|
-
class="i-medium"
|
182
|
-
/>
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
</Block>
|
186
|
-
|
187
|
-
|
188
187
|
<Block
|
189
188
|
title="Localization"
|
190
189
|
placeholder="No localizations added yet"
|
@@ -217,6 +216,23 @@
|
|
217
216
|
</div>
|
218
217
|
</Block>
|
219
218
|
|
219
|
+
<Button
|
220
|
+
v-if="route.params.product"
|
221
|
+
:submit="onDelete"
|
222
|
+
:callback="redirectTo"
|
223
|
+
class="bg-red w-100 mn-b-thin"
|
224
|
+
>
|
225
|
+
Delete
|
226
|
+
</Button>
|
227
|
+
|
228
|
+
<Button
|
229
|
+
:submit="onSubmit"
|
230
|
+
:callback="redirectTo"
|
231
|
+
class="w-100 bg-main"
|
232
|
+
>
|
233
|
+
Save
|
234
|
+
</Button>
|
235
|
+
|
220
236
|
|
221
237
|
|
222
238
|
<!-- <Block
|
@@ -278,7 +294,7 @@
|
|
278
294
|
import Popup from "@pf/src/components/Popup/Popup.vue";
|
279
295
|
import Feed from "@pf/src/components/Feed/Feed.vue";
|
280
296
|
|
281
|
-
import EditImages
|
297
|
+
import EditImages from '@pf/src/components/EditImages/EditImages.vue';
|
282
298
|
|
283
299
|
import IconDelete from '@pf/src/modules/icons/navigation/IconDelete.vue';
|
284
300
|
|
@@ -291,9 +307,12 @@
|
|
291
307
|
|
292
308
|
// Accessing router and store
|
293
309
|
import * as globals from '@pf/src/modules/globals/views/store/globals';
|
310
|
+
import * as auth from '@pf/src/modules/auth/views/store/auth';
|
294
311
|
import * as products from '@pf/src/modules/products/store/products';
|
295
312
|
import * as categories from '@pf/src/modules/products/store/categories';
|
296
313
|
|
314
|
+
import { setError } from '@pf/src/modules/globals/views/store/globals'
|
315
|
+
|
297
316
|
const route = useRoute()
|
298
317
|
const router = useRouter()
|
299
318
|
|
@@ -340,12 +359,31 @@
|
|
340
359
|
products.state.current.images = newImages;
|
341
360
|
}
|
342
361
|
|
343
|
-
function onSubmit() {
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
362
|
+
async function onSubmit() {
|
363
|
+
try {
|
364
|
+
if (route.params.product) {
|
365
|
+
await products.actions.update(route.params.product, products.state.current)
|
366
|
+
} else {
|
367
|
+
products.state.current.owner = {
|
368
|
+
target: route.params._id || auth.state.user._id,
|
369
|
+
type: route.params._id ? 'organization' : 'user'
|
370
|
+
}
|
371
|
+
|
372
|
+
products.state.current.creator = {
|
373
|
+
target: auth.state.user._id,
|
374
|
+
type: 'user',
|
375
|
+
hidden: false
|
376
|
+
}
|
377
|
+
await products.actions.create(products.state.current)
|
378
|
+
}
|
379
|
+
} catch (error) {
|
380
|
+
setError({ response: { data: { errorCode: "PRODUCT_NOT_CREATED" }} })
|
381
|
+
console.error('Product creation error:', error)
|
382
|
+
// Здесь можно добавить обработку ошибки, например:
|
383
|
+
// - показать уведомление пользователю
|
384
|
+
// - отправить ошибку в систему мониторинга
|
385
|
+
// - выполнить откат изменений при необходимости
|
386
|
+
}
|
349
387
|
}
|
350
388
|
|
351
389
|
function onDelete() {
|