@ozdao/prometheus-framework 0.2.65 → 0.2.67
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/community.server.js +3 -3
- package/dist/community.server.mjs +2 -2
- package/dist/events.server.js +3 -3
- package/dist/events.server.mjs +2 -2
- package/dist/main-BDrW8oeL.mjs +13755 -0
- package/dist/main-CNIKtifM.js +91 -0
- package/dist/main.css +1 -1
- package/dist/metadata.schema-BLGSCSmy.mjs +55 -0
- package/dist/metadata.schema-DWR97jhW.js +54 -0
- package/dist/ownership.schema-CGqscZIi.js +159 -0
- package/dist/ownership.schema-DtT2IgqC.mjs +160 -0
- package/dist/products.server.js +50 -15
- package/dist/products.server.mjs +50 -15
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +55 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -55
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +40 -39
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -83
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -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/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -72
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +72 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -46
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +46 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.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/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 +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +10 -9
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +60 -46
- package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.js +5 -5
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +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 +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- 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 +2 -2
- 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 +5 -5
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js +86 -56
- 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/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- 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 +82 -67
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +15 -15
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- 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/store/leftovers.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +5 -5
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +25 -24
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-6-zYDWMA.js +1 -0
- package/dist/web-TZtLKurO.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Feed/Feed.vue +17 -18
- package/src/components/Field/Field.vue +1 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/modules/globals/components/blocks/CardHeader.vue +6 -3
- package/src/modules/globals/controllers/utils/queryProcessor.js +2 -1
- package/src/modules/globals/store/globals.js +3 -4
- package/src/modules/products/components/blocks/CardLeftover.vue +47 -27
- package/src/modules/products/components/pages/EditLeftover.vue +13 -0
- package/src/modules/products/components/pages/Leftovers.vue +3 -3
- package/src/modules/products/controllers/leftovers.controller.js +55 -19
- package/src/modules/products/models/leftover.model.js +4 -0
- package/src/modules/products/routes/leftovers.routes.js +1 -1
- package/src/modules/products/store/leftovers.js +1 -1
- package/src/styles/config.scss +2 -2
@@ -0,0 +1,54 @@
|
|
1
|
+
import { W as p } from "./main-BDrW8oeL.mjs";
|
2
|
+
class f extends p {
|
3
|
+
constructor() {
|
4
|
+
super(...arguments), this.group = "CapacitorStorage";
|
5
|
+
}
|
6
|
+
async configure({ group: e }) {
|
7
|
+
typeof e == "string" && (this.group = e);
|
8
|
+
}
|
9
|
+
async get(e) {
|
10
|
+
return { value: this.impl.getItem(this.applyPrefix(e.key)) };
|
11
|
+
}
|
12
|
+
async set(e) {
|
13
|
+
this.impl.setItem(this.applyPrefix(e.key), e.value);
|
14
|
+
}
|
15
|
+
async remove(e) {
|
16
|
+
this.impl.removeItem(this.applyPrefix(e.key));
|
17
|
+
}
|
18
|
+
async keys() {
|
19
|
+
return { keys: this.rawKeys().map((t) => t.substring(this.prefix.length)) };
|
20
|
+
}
|
21
|
+
async clear() {
|
22
|
+
for (const e of this.rawKeys())
|
23
|
+
this.impl.removeItem(e);
|
24
|
+
}
|
25
|
+
async migrate() {
|
26
|
+
var e;
|
27
|
+
const t = [], s = [], n = "_cap_", o = Object.keys(this.impl).filter((i) => i.indexOf(n) === 0);
|
28
|
+
for (const i of o) {
|
29
|
+
const r = i.substring(n.length), a = (e = this.impl.getItem(i)) !== null && e !== void 0 ? e : "", { value: l } = await this.get({ key: r });
|
30
|
+
typeof l == "string" ? s.push(r) : (await this.set({ key: r, value: a }), t.push(r));
|
31
|
+
}
|
32
|
+
return { migrated: t, existing: s };
|
33
|
+
}
|
34
|
+
async removeOld() {
|
35
|
+
const e = "_cap_", t = Object.keys(this.impl).filter((s) => s.indexOf(e) === 0);
|
36
|
+
for (const s of t)
|
37
|
+
this.impl.removeItem(s);
|
38
|
+
}
|
39
|
+
get impl() {
|
40
|
+
return window.localStorage;
|
41
|
+
}
|
42
|
+
get prefix() {
|
43
|
+
return this.group === "NativeStorage" ? "" : `${this.group}.`;
|
44
|
+
}
|
45
|
+
rawKeys() {
|
46
|
+
return Object.keys(this.impl).filter((e) => e.indexOf(this.prefix) === 0);
|
47
|
+
}
|
48
|
+
applyPrefix(e) {
|
49
|
+
return this.prefix + e;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
export {
|
53
|
+
f as PreferencesWeb
|
54
|
+
};
|
package/package.json
CHANGED
@@ -2,18 +2,20 @@
|
|
2
2
|
|
3
3
|
<TransitionGroup tag="ul" name="scaleTransition" >
|
4
4
|
<BlockSearch
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
v-if="search"
|
6
|
+
@search="updateSearch"
|
7
|
+
placeholder="Enter product name"
|
8
|
+
class="bg-white mn-b-thin"
|
9
|
+
/>
|
10
10
|
</TransitionGroup>
|
11
|
+
|
11
12
|
<TransitionGroup v-if="isLoading" tag="ul" name="scaleTransition" class="o-hidden bg-grey radius-big">
|
12
13
|
<SkeletonEvent
|
13
14
|
v-if="isLoading"
|
14
15
|
v-for="i in currentLimit" :key="i"
|
15
16
|
/>
|
16
17
|
</TransitionGroup>
|
18
|
+
|
17
19
|
<transition name="scaleTransition">
|
18
20
|
<EmptyState
|
19
21
|
v-if="!isLoading && itemsList.length < 1"
|
@@ -24,8 +26,6 @@
|
|
24
26
|
</transition>
|
25
27
|
|
26
28
|
<TransitionGroup tag="ul" name="scaleTransition" :class="$attrs.class">
|
27
|
-
|
28
|
-
|
29
29
|
<slot
|
30
30
|
v-if="!isLoading && itemsList.length > 0"
|
31
31
|
:items="itemsList"
|
@@ -41,7 +41,6 @@
|
|
41
41
|
</button>
|
42
42
|
</TransitionGroup>
|
43
43
|
|
44
|
-
|
45
44
|
</template>
|
46
45
|
|
47
46
|
<script setup>
|
@@ -106,6 +105,14 @@ let isLoading = ref(true);
|
|
106
105
|
let currentSkip = ref(props.options.skip ? props.options.skip : 0);
|
107
106
|
let currentLimit = ref(props.options.limit ? props.options.limit : 10);
|
108
107
|
|
108
|
+
let currentSearch = ref('');
|
109
|
+
|
110
|
+
function updateSearch(search) {
|
111
|
+
currentSearch.value = search
|
112
|
+
|
113
|
+
fetchItems();
|
114
|
+
}
|
115
|
+
|
109
116
|
const loadMoreItems = async () => {
|
110
117
|
if (hasMoreItems.value) {
|
111
118
|
currentSkip.value += currentLimit.value;
|
@@ -113,6 +120,7 @@ const loadMoreItems = async () => {
|
|
113
120
|
const data = await props.store.read({
|
114
121
|
skip: currentSkip.value,
|
115
122
|
limit: currentLimit.value,
|
123
|
+
search: currentSearch.value,
|
116
124
|
...props.options
|
117
125
|
});
|
118
126
|
|
@@ -132,6 +140,7 @@ const fetchItems = async () => {
|
|
132
140
|
const data = await props.store.read({
|
133
141
|
skip: currentSkip.value,
|
134
142
|
limit: currentLimit.value,
|
143
|
+
search: currentSearch.value,
|
135
144
|
...props.options
|
136
145
|
});
|
137
146
|
|
@@ -143,8 +152,6 @@ const fetchItems = async () => {
|
|
143
152
|
hasMoreItems.value = true;
|
144
153
|
}
|
145
154
|
|
146
|
-
console.log(data)
|
147
|
-
|
148
155
|
itemsList.value = data;
|
149
156
|
isLoading.value = false;
|
150
157
|
};
|
@@ -164,14 +171,6 @@ watch(() => props.options, (newVal, oldVal) => {
|
|
164
171
|
}
|
165
172
|
}, { deep: true });
|
166
173
|
|
167
|
-
function updateSearch(search) {
|
168
|
-
props.options.search = search
|
169
|
-
|
170
|
-
console.log(search)
|
171
|
-
|
172
|
-
fetchItems();
|
173
|
-
}
|
174
|
-
|
175
174
|
|
176
175
|
onMounted(async () => {
|
177
176
|
await fetchItems()
|
@@ -35,7 +35,6 @@
|
|
35
35
|
})"
|
36
36
|
/>
|
37
37
|
|
38
|
-
|
39
38
|
<span
|
40
39
|
v-if="type !== 'short'"
|
41
40
|
class="t-semi"
|
@@ -62,9 +61,13 @@
|
|
62
61
|
>
|
63
62
|
· by {{creator.target?.profile?.name}}
|
64
63
|
</span>
|
65
|
-
|
64
|
+
|
65
|
+
<span v-if="date" class="pos-relative">
|
66
|
+
<Tooltip v-if="date" :text="formatDate(date)">
|
66
67
|
· {{getTimeElapsed(date)}}
|
68
|
+
</Tooltip>
|
67
69
|
</span>
|
70
|
+
|
68
71
|
<span v-if="dateFormatted">
|
69
72
|
· {{dateFormatted}}
|
70
73
|
</span>
|
@@ -182,7 +185,7 @@
|
|
182
185
|
|
183
186
|
import PlaceholderUserpic from '@pf/src/modules/icons/placeholders/PlaceholderUserpic.vue'
|
184
187
|
import FormReport from '@pf/src/modules/reports/components/sections/FormReport.vue'
|
185
|
-
|
188
|
+
import Tooltip from '@pf/src/components/Tooltip/Tooltip.vue'
|
186
189
|
import Dropdown from "@pf/src/components/Dropdown/Dropdown.vue";
|
187
190
|
import ButtonToggleMembership from '@pf/src/modules/organizations/components/elements/ButtonToggleMembership.vue'
|
188
191
|
|
@@ -2,7 +2,7 @@ const ObjectId = require('mongoose').Types.ObjectId;
|
|
2
2
|
|
3
3
|
function getBasicOptions(query) {
|
4
4
|
// Деструктуризация для извлечения параметров запроса
|
5
|
-
const { _id, url, status, owner, creator } = query;
|
5
|
+
const { _id, url, status, type, owner, creator } = query;
|
6
6
|
|
7
7
|
// Подготовка условий для каждого возможного параметра
|
8
8
|
const conditions = [];
|
@@ -10,6 +10,7 @@ function getBasicOptions(query) {
|
|
10
10
|
if (_id) { conditions.push({ _id: new ObjectId(_id) }); }
|
11
11
|
if (url) { conditions.push({ url: url }); }
|
12
12
|
if (status) { conditions.push({ status: status }); }
|
13
|
+
if (type) { conditions.push({ type: type }); }
|
13
14
|
if (owner) { conditions.push({ "owner.target": new ObjectId(owner) }); }
|
14
15
|
if (creator) { conditions.push({ "creator.target": new ObjectId(creator) }); }
|
15
16
|
|
@@ -66,17 +66,16 @@ const actions = {
|
|
66
66
|
array[existingItemIndex] = item
|
67
67
|
}
|
68
68
|
},
|
69
|
-
|
70
69
|
update(array, item) {
|
71
70
|
const existingItemIndex = array.findIndex(i => i._id === item._id);
|
72
|
-
|
73
71
|
if (existingItemIndex === -1) {
|
72
|
+
// If the item doesn't exist, push it to the array
|
74
73
|
array.push(item);
|
75
74
|
} else {
|
76
|
-
array
|
75
|
+
// Update the item in the array without creating a new array
|
76
|
+
Object.assign(array[existingItemIndex], item);
|
77
77
|
}
|
78
78
|
},
|
79
|
-
|
80
79
|
delete(array, item) {
|
81
80
|
const existingItemIndex = array.findIndex(c => c._id === item._id);
|
82
81
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="flex-column pos-relative flex-wrap">
|
3
|
+
|
3
4
|
<CardHeader
|
4
5
|
:entity="leftover"
|
5
6
|
:entityType="'leftover'"
|
@@ -9,45 +10,64 @@
|
|
9
10
|
:date="leftover.createdAt"
|
10
11
|
/>
|
11
12
|
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
<router-link
|
14
|
+
:to="{
|
15
|
+
name: 'LeftoverEdit',
|
16
|
+
params: {
|
17
|
+
_id: leftover.organization,
|
18
|
+
leftover: leftover._id
|
19
|
+
}
|
20
|
+
}"
|
21
|
+
class="
|
22
|
+
cursor-pointer
|
23
|
+
pos-absolute pos-t-regular pos-r-regular
|
24
|
+
radius-extra pd-thin bg-second
|
25
|
+
"
|
26
|
+
>
|
16
27
|
<IconEdit
|
17
|
-
|
18
|
-
|
19
|
-
params: {
|
20
|
-
_id: leftover.organization,
|
21
|
-
leftover: leftover._id
|
22
|
-
}
|
23
|
-
})"
|
24
|
-
class="pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
|
28
|
+
class="i-regular"
|
29
|
+
classes="fill-white"
|
25
30
|
/>
|
26
|
-
</
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
</router-link>
|
32
|
+
|
33
|
+
<div class="mn-t-small w-100 bg-white radius-small pd-small spoiler">
|
34
|
+
<div @click="spoiler = !spoiler" class="flex-v-center flex">
|
35
|
+
<span
|
36
|
+
class="flex-child flex-child-shrink-0 capitalize w-max mn-r-thin t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin"
|
37
|
+
:class="{
|
38
|
+
'bg-green': leftover.type === 'stock-in',
|
39
|
+
'bg-red': leftover.type === 'stock-out'
|
40
|
+
}"
|
41
|
+
>
|
42
|
+
{{leftover.type}}
|
43
|
+
</span>
|
44
|
+
<span class="flex-child flex-child-shrink-0">Positions {{leftover.positions.length}}</span>
|
45
|
+
<span v-if="leftover.order" class="mn-r-thin mn-l-thin t-transp">|</span>
|
46
|
+
<span class="flex-child flex-child-shrink-0" v-if="leftover.order">For order {{leftover.order}}</span>
|
47
|
+
<span v-if="leftover.comment" class="mn-r-thin mn-l-thin t-transp">|</span>
|
48
|
+
<p v-if="leftover.comment" class="t-truncate">Comment: {{leftover.comment}}</p>
|
33
49
|
<!-- <img :class="{ 'spoiler-active': spoiler }" class="button-icon" src="@/assets/icons/arrow-down-spoiler.svg"> -->
|
34
50
|
</div>
|
51
|
+
|
35
52
|
<transition name="fade">
|
36
53
|
<div v-if="spoiler">
|
37
54
|
<div v-for="position in leftover.positions" class="mn-t-small w-100 mn-b-thin flex">
|
38
55
|
<div class=" w-50 flex">
|
39
56
|
<span>
|
40
|
-
<!-- <span class="t-transp">Название:</span> -->
|
41
57
|
{{position.name}}
|
42
58
|
</span>
|
59
|
+
<span class="mn-r-thin mn-l-thin t-transp">|</span>
|
60
|
+
|
61
|
+
<span class="w-50">
|
62
|
+
{{position.price}}
|
63
|
+
<span class="t-transp">{{returnCurrency()}}</span>
|
64
|
+
</span>
|
65
|
+
|
43
66
|
</div>
|
44
67
|
|
45
|
-
<div class="t-right w-50
|
46
|
-
|
47
|
-
|
48
|
-
{{position.quantity}}
|
49
|
-
<span class="t-transp">{{declOfNum(position.quantity, ['единица', ' единицы', ' единиц'])}}</span>
|
50
|
-
</span>
|
68
|
+
<div class="t-right w-50">
|
69
|
+
{{position.quantity}}
|
70
|
+
<span class="t-transp">{{position.type}}</span>
|
51
71
|
</div>
|
52
72
|
</div>
|
53
73
|
</div>
|
@@ -76,7 +96,7 @@
|
|
76
96
|
});
|
77
97
|
|
78
98
|
|
79
|
-
const spoiler = ref(
|
99
|
+
const spoiler = ref(true)
|
80
100
|
|
81
101
|
function declOfNum(number, words) {
|
82
102
|
return words[(number % 100 > 4 && number % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(number % 10 < 5) ? number % 10 : 5]];
|
@@ -89,6 +89,19 @@
|
|
89
89
|
class="mn-b-small radius-medium bg-white pd-small"
|
90
90
|
/>
|
91
91
|
</Block>
|
92
|
+
|
93
|
+
<Block
|
94
|
+
title="Comment"
|
95
|
+
class="mn-b-semi"
|
96
|
+
>
|
97
|
+
<Field
|
98
|
+
v-model:field="leftovers.state.current.comment"
|
99
|
+
label="Comment"
|
100
|
+
type="textarea"
|
101
|
+
class="w-100 bg-white radius-small pd-medium"
|
102
|
+
/>
|
103
|
+
|
104
|
+
</Block>
|
92
105
|
|
93
106
|
<Block class="">
|
94
107
|
<section class="gap-thin flex-v-center flex-nojustify flex">
|
@@ -12,7 +12,7 @@
|
|
12
12
|
</header>
|
13
13
|
|
14
14
|
<section class="mn-b-semi pd-medium bg-grey radius-big">
|
15
|
-
<p class="mn-b-thin">
|
15
|
+
<p class="mn-b-thin">Balance:</p>
|
16
16
|
<h3>{{formatPrice(totalPrice)}}</h3>
|
17
17
|
</section>
|
18
18
|
|
@@ -47,6 +47,7 @@
|
|
47
47
|
/>
|
48
48
|
|
49
49
|
<Feed
|
50
|
+
:search="true"
|
50
51
|
:states="{
|
51
52
|
empty: {
|
52
53
|
title: 'No Leftovers Found',
|
@@ -58,9 +59,8 @@
|
|
58
59
|
}"
|
59
60
|
:options="{
|
60
61
|
limit: 15,
|
61
|
-
|
62
|
+
owner: route.params._id,
|
62
63
|
...(tab !== 'all' && { type: tab })
|
63
|
-
// user: user
|
64
64
|
}"
|
65
65
|
v-slot="{
|
66
66
|
items
|
@@ -1,29 +1,66 @@
|
|
1
|
+
const queryProcessorGlobals = require('@pf/src/modules/globals/controllers/utils/queryProcessor');
|
2
|
+
|
1
3
|
const controllerFactory = (db) => {
|
2
4
|
const Leftover = db.leftover;
|
3
5
|
|
4
|
-
const
|
6
|
+
const read = async (req, res) => {
|
5
7
|
try {
|
6
|
-
let query = {};
|
7
|
-
let options = {};
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
let matchConditions = [];
|
10
|
+
|
11
|
+
const search = req.query.search;
|
12
|
+
|
13
|
+
if (search) {
|
14
|
+
const parts = search.split('.');
|
15
|
+
|
16
|
+
let regexPattern = '';
|
14
17
|
|
15
|
-
|
16
|
-
|
18
|
+
if (parts.length === 2) {
|
19
|
+
// Создаем паттерн, который допускает замену одного символа в каждой части
|
20
|
+
regexPattern = parts.map(part => part.substr(0, part.length - 1) + '.{1}').join('\\.');
|
21
|
+
} else {
|
22
|
+
// Если нет точки, применяем аналогичный подход к всей строке
|
23
|
+
regexPattern = search.substr(0, search.length - 1) + '.{1}';
|
24
|
+
}
|
25
|
+
|
26
|
+
matchConditions.push({
|
27
|
+
$or: [
|
28
|
+
{ "comment ": { $regex: regexPattern, $options: 'i' } },
|
29
|
+
{ "positions.name": { $regex: regexPattern, $options: 'i' } }
|
30
|
+
]
|
31
|
+
});
|
17
32
|
}
|
18
33
|
|
19
|
-
|
34
|
+
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
35
|
+
|
36
|
+
let stages = [
|
37
|
+
...queryProcessorGlobals.getBasicOptions(
|
38
|
+
req.query
|
39
|
+
),
|
40
|
+
// For creator
|
41
|
+
queryProcessorGlobals.getCreatorUserLookupStage(),
|
42
|
+
queryProcessorGlobals.getCreatorOrganizationLookupStage(),
|
43
|
+
// For owner
|
44
|
+
queryProcessorGlobals.getOwnerUserLookupStage(),
|
45
|
+
queryProcessorGlobals.getOwnerOrganizationLookupStage(),
|
46
|
+
queryProcessorGlobals.getAddFieldsCreatorOwnerStage(),
|
20
47
|
|
21
|
-
|
22
|
-
|
23
|
-
.
|
48
|
+
...(matchStage != null ? [matchStage] : []),
|
49
|
+
// Pagination
|
50
|
+
...queryProcessorGlobals.getSortingOptions(
|
51
|
+
req.query.sortParam,
|
52
|
+
req.query.sortOrder,
|
53
|
+
),
|
54
|
+
...queryProcessorGlobals.getPaginationOptions(
|
55
|
+
req.query.skip,
|
56
|
+
req.query.limit
|
57
|
+
)
|
58
|
+
];
|
24
59
|
|
25
|
-
|
26
|
-
|
60
|
+
const leftoveres = await Leftover.aggregate(stages).exec();
|
61
|
+
|
62
|
+
if (!leftoveres.length) {
|
63
|
+
return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
|
27
64
|
}
|
28
65
|
|
29
66
|
res.status(200).send(leftoveres);
|
@@ -35,8 +72,7 @@ const controllerFactory = (db) => {
|
|
35
72
|
|
36
73
|
const create = async (req, res) => {
|
37
74
|
try {
|
38
|
-
|
39
|
-
console.log(req.body)
|
75
|
+
console.log('order is', req.body.order)
|
40
76
|
const leftover = await Leftover.create({
|
41
77
|
organization: req.body.organization,
|
42
78
|
type: req.body.type,
|
@@ -93,7 +129,7 @@ const controllerFactory = (db) => {
|
|
93
129
|
};
|
94
130
|
|
95
131
|
return {
|
96
|
-
|
132
|
+
read,
|
97
133
|
create,
|
98
134
|
get,
|
99
135
|
update,
|
package/src/styles/config.scss
CHANGED