first commit

This commit is contained in:
2025-07-24 20:14:43 +03:00
commit 4423badefd
30 changed files with 131277 additions and 0 deletions

BIN
api/static/icons/ozon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

16
api/static/icons/wb.svg Normal file
View File

@ -0,0 +1,16 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 12C0 5.37258 5.37258 0 12 0H36C42.6274 0 48 5.37258 48 12V36C48 42.6274 42.6274 48 36 48H12C5.37258 48 0 42.6274 0 36V12Z" fill="url(#paint0_linear_11_61)"/>
<path d="M13.85 32.5H10.6958L6 16H8.86965L12.3559 28.8936L16.1268 16H18.6407L22.3878 28.8936L25.8741 16H28.7437L24.0479 32.5H20.8937L17.3837 20.455L13.85 32.5ZM39.6758 23.9436C41.1225 24.6979 42 26.065 42 27.7857C42 29.1293 41.5257 30.2607 40.5533 31.1564C39.581 32.0521 38.4189 32.5 37.0196 32.5H29.9048V16H36.4979C37.8497 16 39.0118 16.4479 39.9367 17.32C40.8853 18.1921 41.3597 19.2764 41.3597 20.5729C41.3597 22.0107 40.7905 23.1186 39.6758 23.9436ZM36.4979 18.5457H32.6321V22.8829H36.4979C37.7074 22.8829 38.6323 21.94 38.6323 20.7143C38.6323 19.4886 37.7074 18.5457 36.4979 18.5457ZM32.6321 29.9543H37.0196C38.2766 29.9543 39.2727 28.9407 39.2727 27.6443C39.2727 26.3479 38.2766 25.3343 37.0196 25.3343H32.6321V29.9543Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear_11_61" x1="-0.101122" y1="2.88128" x2="52.4352" y2="9.57311" gradientUnits="userSpaceOnUse">
<stop stop-color="#ED3CCA"/>
<stop offset="0.145833" stop-color="#DF34D2"/>
<stop offset="0.291667" stop-color="#D02BD9"/>
<stop offset="0.432292" stop-color="#BF22E1"/>
<stop offset="0.572917" stop-color="#AE1AE8"/>
<stop offset="0.713542" stop-color="#9A10F0"/>
<stop offset="0.854167" stop-color="#8306F7"/>
<stop offset="1" stop-color="#7C1AF8"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
api/static/icons/ym.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

View File

@ -0,0 +1,74 @@
import {r as l, ad as i} from "./index-CdMy-Rhi.js";
function M(p=[]) {
const [r,n] = l.useState(p);
return [r, {
setState: n,
append: (...e) => n(t => [...t, ...e]),
prepend: (...e) => n(t => [...e, ...t]),
insert: (e, ...t) => n(o => [...o.slice(0, e), ...t, ...o.slice(e)]),
pop: () => n(e => {
const t = [...e];
return t.pop(),
t
}
),
shift: () => n(e => {
const t = [...e];
return t.shift(),
t
}
),
apply: e => n(t => t.map( (o, s) => e(o, s))),
applyWhere: (e, t) => n(o => o.map( (s, c) => e(s, c) ? t(s, c) : s)),
remove: (...e) => n(t => t.filter( (o, s) => !e.includes(s))),
reorder: ({from: e, to: t}) => n(o => {
const s = [...o]
, c = o[e];
return s.splice(e, 1),
s.splice(t, 0, c),
s
}
),
swap: ({from: e, to: t}) => n(o => {
const s = [...o]
, c = s[e]
, a = s[t];
return s.splice(t, 1, c),
s.splice(e, 1, a),
s
}
),
setItem: (e, t) => n(o => {
const s = [...o];
return s[e] = t,
s
}
),
setItemProp: (e, t, o) => n(s => {
const c = [...s];
return c[e] = {
...c[e],
[t]: o
},
c
}
),
filter: e => {
n(t => t.filter(e))
}
}]
}
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var W = i("outline", "player-pause", "IconPlayerPause", [["path", {
d: "M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",
key: "svg-0"
}], ["path", {
d: "M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",
key: "svg-1"
}]]);
export {W as I, M as u};

98
assets/List-Xt0hH74q.js Normal file
View File

@ -0,0 +1,98 @@
import {aO as N, h as f, a as v, j as n, B as b, b as _, d as w, aP as R, aQ as B, aR as C} from "./index-CdMy-Rhi.js";
const [W,z] = N("List component was not found in tree");
var h = {
root: "m_abbac491",
item: "m_abb6bec2",
itemWrapper: "m_75cd9f71",
itemIcon: "m_60f83e5b"
};
const A = {}
, u = f( (a, e) => {
const t = v("ListItem", A, a)
, {classNames: c, className: r, style: l, styles: m, vars: L, icon: p, children: d, mod: y, ...g} = t
, s = z()
, i = p || s.icon
, o = {
classNames: c,
styles: m
};
return n.jsx(b, {
...s.getStyles("item", {
...o,
className: r,
style: l
}),
component: "li",
mod: [{
"with-icon": !!i,
centered: s.center
}, y],
ref: e,
...g,
children: n.jsxs("div", {
...s.getStyles("itemWrapper", o),
children: [i && n.jsx("span", {
...s.getStyles("itemIcon", o),
children: i
}), n.jsx("span", {
...s.getStyles("itemLabel", o),
children: d
})]
})
})
}
);
u.classes = h;
u.displayName = "@mantine/core/ListItem";
const E = {
type: "unordered"
}
, F = w( (a, {size: e, spacing: t}) => ({
root: {
"--list-fz": R(e),
"--list-lh": B(e),
"--list-spacing": C(t)
}
}))
, x = f( (a, e) => {
const t = v("List", E, a)
, {classNames: c, className: r, style: l, styles: m, unstyled: L, vars: p, children: d, type: y, withPadding: g, icon: s, spacing: i, center: o, listStyleType: j, mod: P, ...I} = t
, S = _({
name: "List",
classes: h,
props: t,
className: r,
style: l,
classNames: c,
styles: m,
unstyled: L,
vars: p,
varsResolver: F
});
return n.jsx(W, {
value: {
center: o,
icon: s,
getStyles: S
},
children: n.jsx(b, {
...S("root", {
style: {
listStyleType: j
}
}),
component: y === "unordered" ? "ul" : "ol",
mod: [{
"with-padding": g
}, P],
ref: e,
...I,
children: d
})
})
}
);
x.classes = h;
x.displayName = "@mantine/core/List";
x.Item = u;
export {x as L};

View File

@ -0,0 +1,23 @@
._container_1gmcu_1 {
display: flex;
flex-direction: column;
flex: 1 1 0%;
gap: calc(.625rem * var(--mantine-scale));
}
._top-panel_1gmcu_11 {
padding: calc(.3125rem * var(--mantine-scale));
gap: calc(.625rem * var(--mantine-scale));
display: flex;
justify-content: space-between;
}
._table-container_1gmcu_18 {
display: flex;
gap: calc(.625rem * var(--mantine-scale));
flex-direction: column;
}
._table-pagination_1gmcu_24 {
align-self: flex-end;
}

View File

@ -0,0 +1,9 @@
const n = "_container_1gmcu_1"
, t = {
container: n,
"body-container": "_body-container_1gmcu_8",
"top-panel": "_top-panel_1gmcu_11",
"table-container": "_table-container_1gmcu_18",
"table-pagination": "_table-pagination_1gmcu_24"
};
export {t as s};

View File

@ -0,0 +1,16 @@
._container_b84hd_1 {
display: flex;
flex-direction: column;
flex: 1 1 0%;
gap: calc(.625rem * var(--mantine-scale));
}
._top-panel_b84hd_8 {
padding: calc(.3125rem * var(--mantine-scale));
gap: calc(.625rem * var(--mantine-scale));
display: flex;
}
._top-panel-last-item_b84hd_14 {
margin-left: auto;
}

View File

@ -0,0 +1,7 @@
const t = "_container_b84hd_1"
, n = {
container: t,
"top-panel": "_top-panel_b84hd_8",
"top-panel-last-item": "_top-panel-last-item_b84hd_14"
};
export {n as s};

789
assets/admin-CjeWXnXD.css Normal file
View File

@ -0,0 +1,789 @@
._container_1t4rs_1 {
display: flex;
flex-direction: column;
flex: 1 1 0%;
}
._icon_1t3nk_1 {
width: calc(.8125rem * var(--mantine-scale));
height: auto;
vertical-align: calc(-.0625rem * var(--mantine-scale));
margin-right: calc(.5rem * var(--mantine-scale));
}
._expandIcon_1t3nk_8 {
transition: transform 0.2s;
}
._expandIconRotated_1t3nk_12 {
transform: rotate(90deg);
}
._usersTableBorder_1t3nk_16 {
border-bottom: solid 1px var(--mantine-color-dark-5);
}
.mantine-datatable-nowrap {
white-space: nowrap;
}
.mantine-datatable-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
}
.mantine-datatable-pointer-cursor {
cursor: pointer;
}
.mantine-datatable-context-menu-cursor {
cursor: context-menu;
}
.mantine-datatable-text-selection-disabled {
user-select: none;
}
.mantine-datatable-text-align-left {
text-align: left;
}
.mantine-datatable-text-align-center {
text-align: center;
}
.mantine-datatable-text-align-right {
text-align: right;
}
.mantine-datatable {
--mantine-datatable-color: var( --mantine-datatable-color-light,var(--mantine-color-text) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-color: var( --mantine-datatable-color-dark,var(--mantine-color-text) );
}
.mantine-datatable {
--mantine-datatable-background-color: var( --mantine-datatable-background-color-light,var(--mantine-color-body) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-background-color: var( --mantine-datatable-background-color-dark,var(--mantine-color-body) );
}
.mantine-datatable {
--mantine-datatable-border-color: var( --mantine-datatable-border-color-light,var(--mantine-color-gray-3) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-border-color: var( --mantine-datatable-border-color-dark,var(--mantine-color-dark-4) );
}
.mantine-datatable {
--mantine-datatable-row-border-color: var( --mantine-datatable-row-border-color-light,var(--mantine-datatable-border-color) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-row-border-color: var( --mantine-datatable-row-border-color-dark,var(--mantine-datatable-border-color) );
}
.mantine-datatable {
--mantine-datatable-striped-color: var( --mantine-datatable-striped-color-light,var(--mantine-color-gray-0) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-striped-color: var( --mantine-datatable-striped-color-dark,var(--mantine-color-dark-6) );
}
.mantine-datatable {
--mantine-datatable-highlight-on-hover-color: var( --mantine-datatable-highlight-on-hover-color-light,var(--mantine-color-gray-1) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-highlight-on-hover-color: var( --mantine-datatable-highlight-on-hover-color-dark,var(--mantine-color-dark-5) );
}
.mantine-datatable {
--mantine-datatable-shadow-background-top: linear-gradient(rgba(0,0,0,.05),transparent),linear-gradient(rgba(0,0,0,.05) 30%,transparent);
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-shadow-background-top: linear-gradient(rgba(0,0,0,.25),transparent),linear-gradient(rgba(0,0,0,.25) 30%,transparent);
}
.mantine-datatable {
--mantine-datatable-shadow-background-right: linear-gradient(270deg,rgba(0,0,0,.05),transparent),linear-gradient(270deg,rgba(0,0,0,.05),transparent 30%);
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-shadow-background-right: linear-gradient(270deg,rgba(0,0,0,.25),transparent),linear-gradient(270deg,rgba(0,0,0,.25),transparent 30%);
}
.mantine-datatable {
--mantine-datatable-shadow-background-bottom: linear-gradient(transparent,rgba(0,0,0,.05)),linear-gradient(transparent 30%,rgba(0,0,0,.05));
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-shadow-background-bottom: linear-gradient(transparent,rgba(0,0,0,.25)),linear-gradient(transparent 30%,rgba(0,0,0,.25));
}
.mantine-datatable {
--mantine-datatable-shadow-background-left: linear-gradient(90deg,rgba(0,0,0,.05),transparent),linear-gradient(90deg,rgba(0,0,0,.05),transparent 30%);
}
[data-mantine-color-scheme="dark"] .mantine-datatable {
--mantine-datatable-shadow-background-left: linear-gradient(90deg,rgba(0,0,0,.25),transparent),linear-gradient(90deg,rgba(0,0,0,.25),transparent 30%);
}
.mantine-datatable {
background: var(--mantine-datatable-background-color);
color: var(--mantine-datatable-color);
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
.mantine-datatable-with-border {
border: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-border-color);
}
.mantine-datatable-table {
background: var(--mantine-datatable-background-color);
border-collapse: separate;
border-spacing: 0px;
color: inherit;
}
.mantine-datatable-table td, .mantine-datatable-table th {
border-color: var(--mantine-datatable-row-border-color);
}
.mantine-datatable-table tbody, .mantine-datatable-table td, .mantine-datatable-table tfoot, .mantine-datatable-table tfoot tr, .mantine-datatable-table th, .mantine-datatable-table thead, .mantine-datatable-table thead tr {
background: inherit;
}
.mantine-datatable-table[data-striped] tbody tr:nth-of-type(2n+1) {
background: var(--mantine-datatable-striped-color);
}
.mantine-datatable-table[data-highlight-on-hover] tbody tr:hover {
background: var(--mantine-datatable-highlight-on-hover-color);
}
.mantine-datatable-table tbody tr:last-of-type {
border-bottom: 0px;
}
.mantine-datatable-vertical-align-top td {
vertical-align: top;
}
.mantine-datatable-vertical-align-bottom td {
vertical-align: bottom;
}
.mantine-datatable-last-row-border-bottom-visible tr:last-of-type:not(.mantine-datatable-empty-row) td {
border-bottom: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-row-border-color);
}
.mantine-datatable-pin-last-column td:not(.mantine-datatable-row-expansion-cell):last-of-type, .mantine-datatable-pin-last-column th:last-of-type {
position: sticky;
right: calc(-.025rem*var(--mantine-scale));
z-index: 1;
}
.mantine-datatable-pin-last-column td:not(.mantine-datatable-row-expansion-cell):last-of-type::after, .mantine-datatable-pin-last-column th:last-of-type::after {
background: var(--mantine-datatable-shadow-background-right);
border-right: 1px solid var(--mantine-datatable-row-border-color);
bottom: 0px;
content: "";
left: calc(var(--mantine-spacing-xs)*-1);
opacity: 0;
pointer-events: none;
position: absolute;
top: 0px;
transition: opacity 0.2s;
width: var(--mantine-spacing-xs);
}
.mantine-datatable-pin-last-column th:last-of-type::after, .mantine-datatable-pin-last-column tr[data-with-row-border]:not(:last-of-type) td:not(.mantine-datatable-row-expansion-cell):last-of-type::after {
bottom: calc(-.0625rem*var(--mantine-scale));
top: calc(-.0625rem*var(--mantine-scale));
}
.mantine-datatable-pin-last-column tfoot th:last-of-type::after {
top: calc(-.0625rem*var(--mantine-scale));
}
.mantine-datatable-pin-last-column tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):last-of-type {
background: inherit;
}
.mantine-datatable-pin-last-column tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):last-of-type::before {
background: var(--mantine-primary-color-light);
inset: 0px;
content: "";
position: absolute;
}
.mantine-datatable-pin-last-column-scrolled td:not(.mantine-datatable-row-expansion-cell):last-of-type::after, .mantine-datatable-pin-last-column-scrolled th:last-of-type::after {
opacity: 1;
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2), .mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th.mantine-datatable-column-group-header-cell:nth-of-type(2), .mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th:first-of-type, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) td:not(.mantine-datatable-row-expansion-cell):first-of-type, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) th:first-of-type {
left: var(--mantine-datatable-selection-column-width);
position: sticky;
z-index: 1;
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2)::after, .mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th.mantine-datatable-column-group-header-cell:nth-of-type(2)::after, .mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th:first-of-type::after, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) td:not(.mantine-datatable-row-expansion-cell):first-of-type::after, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) th:first-of-type::after {
background: var(--mantine-datatable-shadow-background-left);
border-left: 1px solid var(--mantine-datatable-row-border-color);
bottom: 0px;
content: "";
opacity: 0;
pointer-events: none;
position: absolute;
right: calc(var(--mantine-spacing-xs)*-1);
top: 0px;
transition: opacity 0.2s;
width: var(--mantine-spacing-xs);
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th.mantine-datatable-header-selector-cell {
left: 0px;
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible th.mantine-datatable-column-group-header-cell:nth-of-type(2)::after, .mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible tr[data-with-row-border]:not(:last-of-type) td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2)::after, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) th:first-of-type::after, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) tr[data-with-row-border]:not(:last-of-type) td:not(.mantine-datatable-row-expansion-cell):first-of-type::after {
bottom: calc(-.0625rem*var(--mantine-scale));
top: calc(-.0625rem*var(--mantine-scale));
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible tfoot th:nth-of-type(2)::after, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) tfoot th:first-of-type::after {
top: calc(-.0625rem*var(--mantine-scale));
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2), .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):first-of-type {
background: inherit;
}
.mantine-datatable-pin-first-column.mantine-datatable-selection-column-visible tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2)::before, .mantine-datatable-pin-first-column:not(.mantine-datatable-selection-column-visible) tr[data-selected] td:not(.mantine-datatable-row-expansion-cell):first-of-type::before {
background: var(--mantine-primary-color-light);
inset: 0px;
content: "";
position: absolute;
}
.mantine-datatable-pin-first-column-scrolled.mantine-datatable-selection-column-visible td:not(.mantine-datatable-row-expansion-cell):nth-of-type(2)::after, .mantine-datatable-pin-first-column-scrolled.mantine-datatable-selection-column-visible th.mantine-datatable-column-group-header-cell:nth-of-type(2)::after, .mantine-datatable-pin-first-column-scrolled.mantine-datatable-selection-column-visible th:first-of-type::after, .mantine-datatable-pin-first-column-scrolled:not(.mantine-datatable-selection-column-visible) td:not(.mantine-datatable-row-expansion-cell):first-of-type::after, .mantine-datatable-pin-first-column-scrolled:not(.mantine-datatable-selection-column-visible) th:first-of-type::after {
opacity: 1;
}
.mantine-datatable-empty-row, .mantine-datatable-table[data-highlight-on-hover] tbody .mantine-datatable-empty-row:hover {
background: transparent;
}
.mantine-datatable-empty-state {
inset: 0px;
color: var(--mantine-color-gray-6);
flex-direction: column;
pointer-events: none;
position: absolute;
}
[data-mantine-color-scheme="dark"] .mantine-datatable-empty-state {
color: var(--mantine-color-dark-3);
}
.mantine-datatable-empty-state {
opacity: 0;
transition: opacity 0.2s;
}
.mantine-datatable-empty-state[data-active] {
opacity: 1;
}
.mantine-datatable-empty-state-icon {
background: var(--mantine-color-gray-2);
border-radius: 50%;
font-size: 0px;
padding: var(--mantine-spacing-xs);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-empty-state-icon {
background: var(--mantine-color-dark-5);
}
.mantine-datatable-empty-state-icon {
margin-bottom: calc(var(--mantine-spacing-xs)/2);
}
.mantine-datatable-footer {
z-index: 2;
}
.mantine-datatable-footer th {
border-top: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-border-color);
}
.mantine-datatable-footer-selector-placeholder-cell {
left: 0px;
position: sticky;
width: 0px;
}
.mantine-datatable-footer-selector-placeholder-cell::after {
background: var(--mantine-datatable-shadow-background-left);
border-left: 1px solid var(--mantine-datatable-row-border-color);
bottom: calc(-.0625rem*var(--mantine-scale));
content: "";
opacity: 0;
pointer-events: none;
position: absolute;
right: calc(var(--mantine-spacing-xs)*-1);
top: 0px;
transition: opacity 0.2s;
width: var(--mantine-spacing-xs);
}
.mantine-datatable-footer-selector-placeholder-cell[data-shadow-visible]::after {
opacity: 1;
}
.mantine-datatable-header {
position: sticky;
top: 0px;
z-index: 2;
}
.mantine-datatable-header th {
border-bottom: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-border-color);
}
.mantine-datatable-header-column-toggle-checkbox-label {
user-select: none;
}
.mantine-datatable-header-cell-sortable {
cursor: pointer;
transition: background 0.2s;
}
.mantine-datatable-header-cell-sortable:hover:not(:has(button:hover)) {
background: var(--mantine-color-gray-0);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-cell-sortable:hover:not(:has(button:hover)) {
background: var(--mantine-color-dark-6);
}
.mantine-datatable-header-cell-draggable {
border-radius: calc(.375rem*var(--mantine-scale));
cursor: grab;
transition: 0.2s;
}
.mantine-datatable-header-cell-draggable:active {
cursor: grabbing;
}
.mantine-datatable-header-cell-draggable:hover:not(:has(button:hover)) {
background: var(--mantine-color-gray-2);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-cell-draggable:hover:not(:has(button:hover)) {
background: var(--mantine-color-dark-6);
}
.mantine-datatable-header-cell-draggable-action-icon {
cursor: inherit;
margin: calc(-.125rem*var(--mantine-scale)) calc(.125rem*var(--mantine-scale)) 0;
}
.mantine-datatable-header-cell-drag-over {
background: var(--mantine-color-gray-3);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-cell-drag-over {
background: var(--mantine-color-dark-6);
}
.mantine-datatable-header-cell-toggleable-icon {
opacity: 0.1;
transition: opacity 0.2s;
}
.mantine-datatable-header-cell-toggleable:hover .mantine-datatable-header-cell-toggleable-icon {
opacity: 1;
}
.mantine-datatable-header-cell-resizable {
position: relative;
}
.mantine-datatable-header-resizable-handle {
background: inherit;
bottom: 0px;
cursor: col-resize;
opacity: 0;
position: absolute;
top: 0px;
transform: translate(50%);
transition: opacity 0.2s;
width: calc(.5rem*var(--mantine-scale));
z-index: 1;
}
.mantine-datatable-header-resizable-handle::after {
border-right: calc(.25rem*var(--mantine-scale)) dotted var(--mantine-color-gray-3);
bottom: calc(.0625rem*var(--mantine-scale));
content: "";
left: calc(.125rem*var(--mantine-scale));
position: absolute;
top: calc(.0625rem*var(--mantine-scale));
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-resizable-handle::after {
border-right: calc(.25rem*var(--mantine-scale)) dotted var(--mantine-color-dark-4);
}
.mantine-datatable-header-resizable-handle:hover::after {
border-color: var(--mantine-primary-color-6);
}
tr:hover .mantine-datatable-header-resizable-handle {
opacity: 1;
}
.mantine-datatable-header-cell-sortable-group {
gap: 0.25em;
}
.mantine-datatable-header-cell-sortable-text {
flex-grow: 1;
min-width: 0px;
}
.mantine-datatable-header-cell-sortable-icon {
transition: transform 0.2s;
}
.mantine-datatable-header-cell-sortable-icon-reversed {
transform: scaleY(-1);
}
.mantine-datatable-header-cell-sortable-unsorted-icon {
color: var(--mantine-color-gray-5);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-cell-sortable-unsorted-icon {
color: var(--mantine-color-dark-3);
}
.mantine-datatable-header-cell-sortable-unsorted-icon {
transition: color 0.2s;
}
th:hover .mantine-datatable-header-cell-sortable-unsorted-icon {
color: var(--mantine-color-gray-6);
}
[data-mantine-color-scheme="dark"] th:hover .mantine-datatable-header-cell-sortable-unsorted-icon {
color: var(--mantine-color-dark-2);
}
.mantine-datatable-header-cell-filter-action-icon {
border: 0px;
color: var(--mantine-color-gray-5);
}
[data-mantine-color-scheme="dark"] .mantine-datatable-header-cell-filter-action-icon {
color: var(--mantine-color-dark-3);
}
.mantine-datatable-header-cell-filter-action-icon[data-active] {
color: var(--mantine-color-text);
}
.mantine-datatable-header-selector-cell {
left: 0px;
position: sticky;
width: 0px;
}
.mantine-datatable-header-selector-cell::after {
background: var(--mantine-datatable-shadow-background-left);
border-left: 1px solid var(--mantine-datatable-row-border-color);
bottom: calc(-.0625rem*var(--mantine-scale));
content: "";
opacity: 0;
pointer-events: none;
position: absolute;
right: calc(var(--mantine-spacing-xs)*-1);
top: 0px;
transition: opacity 0.2s;
width: var(--mantine-spacing-xs);
}
.mantine-datatable-header-selector-cell[data-shadow-visible]::after {
opacity: 1;
}
.mantine-datatable-loader {
background: color-mix(in srgb,var(--mantine-datatable-background-color),transparent 25%);
inset: 0px;
opacity: 0;
pointer-events: none;
position: absolute;
transition: opacity 0.2s;
z-index: 3;
}
.mantine-datatable-loader-fetching {
opacity: 1;
pointer-events: all;
}
.mantine-datatable-page-size-selector-button-icon {
margin: 0 calc(-.25rem*var(--mantine-scale)) 0 calc(.125rem*var(--mantine-scale));
}
.mantine-datatable-page-size-selector-menu-arrow {
z-index: -1;
}
.mantine-datatable-page-size-selector-active {
--mantine-datatable-pagination-active-text-color: var( --mantine-datatable-pagination-active-text-color-light,var(--mantine-color-white) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-page-size-selector-active {
--mantine-datatable-pagination-active-text-color: var( --mantine-datatable-pagination-active-text-color-dark,var(--mantine-color-white) );
}
.mantine-datatable-page-size-selector-active {
--mantine-datatable-pagination-active-background-color: var( --mantine-datatable-pagination-active-background-color-light,var(--mantine-primary-color-filled) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-page-size-selector-active {
--mantine-datatable-pagination-active-background-color: var( --mantine-datatable-pagination-active-background-color-dark,var(--mantine-primary-color-filled) );
}
.mantine-datatable-page-size-selector-active {
background: var(--mantine-datatable-pagination-active-background-color);
color: var(--mantine-datatable-pagination-active-text-color);
opacity: 1;
}
.mantine-datatable-pagination {
align-items: center;
background: inherit;
border-top: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-border-color);
display: flex;
gap: var(--mantine-spacing-xs);
justify-content: space-between;
}
.mantine-datatable-pagination-text {
flex: 1 1 auto;
}
.mantine-datatable-pagination-pages {
--mantine-datatable-pagination-active-text-color: var( --mantine-datatable-pagination-active-text-color-light,var(--mantine-color-white) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-pagination-pages {
--mantine-datatable-pagination-active-text-color: var( --mantine-datatable-pagination-active-text-color-dark,var(--mantine-color-white) );
}
.mantine-datatable-pagination-pages {
--mantine-datatable-pagination-active-background-color: var( --mantine-datatable-pagination-active-background-color-light,var(--mantine-primary-color-filled) );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-pagination-pages {
--mantine-datatable-pagination-active-background-color: var( --mantine-datatable-pagination-active-background-color-dark,var(--mantine-primary-color-filled) );
}
.mantine-datatable-pagination-pages {
opacity: 1;
transition: opacity 0.2s;
}
.mantine-datatable-pagination-pages-fetching {
opacity: 0;
}
.mantine-datatable-pagination-pages-control {
border-color: var(--mantine-datatable-border-color);
color: var(--mantine-datatable-color);
}
.mantine-datatable-pagination-pages-control[data-active] {
background: var(--mantine-datatable-pagination-active-background-color);
border-color: transparent;
color: var(--mantine-datatable-pagination-active-text-color);
}
.mantine-datatable-row {
--mantine-datatable-row-color: var( --mantine-datatable-row-color-light );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-row {
--mantine-datatable-row-color: var( --mantine-datatable-row-color-dark );
}
.mantine-datatable-row {
--mantine-datatable-row-background-color: var( --mantine-datatable-row-background-color-light );
}
[data-mantine-color-scheme="dark"] .mantine-datatable-row {
--mantine-datatable-row-background-color: var( --mantine-datatable-row-background-color-dark );
}
.mantine-datatable-row {
background: var(--mantine-datatable-row-background-color,inherit);
color: var(--mantine-datatable-row-color,inherit);
}
.mantine-datatable-row[data-with-row-border]:not(:last-of-type) td {
border-bottom: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-row-border-color);
}
.mantine-datatable-row[data-selected] td {
background: var(--mantine-primary-color-light);
}
.mantine-datatable-row-expansion-cell {
padding: 0px;
}
tr:not(:last-of-type) .mantine-datatable-row-expansion-cell-content {
border-bottom: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-row-border-color);
}
.mantine-datatable-row-expansion-cell-content {
border-top: calc(.0625rem*var(--mantine-scale)) solid var(--mantine-datatable-row-border-color);
}
[data-with-row-border] .mantine-datatable-row-expansion-cell-content {
border-top: 0px;
}
.mantine-datatable-row-selector-cell {
left: 0px;
position: sticky;
width: 0px;
z-index: 1;
}
tr[data-selected] .mantine-datatable-row-selector-cell {
background: inherit;
}
tr[data-selected] .mantine-datatable-row-selector-cell::before {
background: var(--mantine-primary-color-light);
inset: 0px;
content: "";
position: absolute;
}
.mantine-datatable-row-selector-cell::after {
background: var(--mantine-datatable-shadow-background-left);
border-left: 1px solid var(--mantine-datatable-row-border-color);
bottom: 0px;
content: "";
opacity: 0;
pointer-events: none;
position: absolute;
right: calc(var(--mantine-spacing-xs)*-1);
top: 0px;
transition: opacity 0.2s;
width: var(--mantine-spacing-xs);
}
tr[data-with-row-border] .mantine-datatable-row-selector-cell::after {
bottom: calc(-.0625rem*var(--mantine-scale));
top: calc(-.0625rem*var(--mantine-scale));
}
tr:last-of-type .mantine-datatable-row-selector-cell::after {
bottom: 0px;
}
.mantine-datatable-row-selector-cell[data-shadow-visible]::after {
opacity: 1;
}
.mantine-datatable-row-selector-cell-checkbox {
cursor: pointer;
}
.mantine-datatable-scroll-area {
flex: 1 1 100%;
}
.mantine-datatable-scroll-area-corner {
background: transparent;
}
.mantine-datatable-scroll-area-thumb {
z-index: 3;
}
.mantine-datatable-scroll-area-scrollbar[data-state="visible"] {
background: transparent;
}
.mantine-datatable-scroll-area-scrollbar div::before {
pointer-events: none;
}
.mantine-datatable-scroll-area-shadow {
opacity: 0;
pointer-events: none;
position: absolute;
transition: opacity 0.2s;
}
.mantine-datatable-scroll-area-top-shadow {
background: var(--mantine-datatable-shadow-background-top);
height: calc(var(--mantine-spacing-xs)/2);
left: 0px;
right: 0px;
z-index: 2;
}
.mantine-datatable-scroll-area-left-shadow {
background: var(--mantine-datatable-shadow-background-left);
bottom: 0px;
left: 0px;
top: 0px;
width: var(--mantine-spacing-xs);
z-index: 3;
}
.mantine-datatable-scroll-area-right-shadow {
background: var(--mantine-datatable-shadow-background-right);
bottom: 0px;
right: 0px;
top: 0px;
width: calc(var(--mantine-spacing-xs)/2);
z-index: 3;
}
.mantine-datatable-scroll-area-shadow-behind {
z-index: 0;
}
.mantine-datatable-scroll-area-bottom-shadow {
background: var(--mantine-datatable-shadow-background-bottom);
height: calc(var(--mantine-spacing-xs)/2);
left: 0px;
right: 0px;
z-index: 2;
}
.mantine-datatable-scroll-area-shadow-visible {
opacity: 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,148 @@
import {r as j, j as e, aD as C, aF as f, a1 as B, a2 as T, a3 as m, a4 as p, a5 as g, a6 as y, a7 as b, b1 as F, s as x, X as I, b2 as d, ac as u, c as k} from "./index-CdMy-Rhi.js";
const v = "_container_kxb8n_1"
, h = {
container: v,
"top-panel": "_top-panel_kxb8n_8"
}
, w = () => j.useMemo( () => [{
accessorKey: "name",
header: "Название"
}, {
accessorKey: "attributes",
header: "Атрибуты",
Cell: ({row: n}) => e.jsx(e.Fragment, {
children: n.original.attributes.map(s => s.name).join(", ")
})
}, {
accessorKey: "size.name",
header: "Размер"
}, {
accessorKey: "isDefault",
header: "По умолчанию",
Cell: ({row: n}) => n.original.isDefault ? e.jsx(C, {}) : e.jsx(f, {})
}], [])
, _ = ({items: n, onDelete: s, onChange: c}) => {
const i = w()
, l = o => {
c && b.openContextModal({
modal: "barcodeTemplateFormModal",
title: "Создание шаблона",
withCloseButton: !1,
innerProps: {
onChange: t => c(t),
element: o
}
})
}
;
return e.jsx(e.Fragment, {
children: e.jsx(B, {
striped: !0,
data: n,
columns: i,
restProps: {
enableColumnActions: !1,
enableRowActions: !0,
renderRowActions: ({row: o}) => e.jsxs(T, {
gap: "md",
children: [e.jsx(m, {
label: "Редактировать",
children: e.jsx(p, {
onClick: () => l(o.original),
variant: "default",
children: e.jsx(g, {})
})
}), e.jsx(m, {
label: "Удалить",
children: e.jsx(p, {
onClick: () => {
s && s(o.original)
}
,
variant: "default",
children: e.jsx(y, {})
})
})]
})
}
})
})
}
, A = () => {
const {barcodeTemplates: n, refetch: s} = F()
, c = t => {
d.createBarcodeTemplate({
requestBody: {
...t,
attributeIds: t.attributes.map(a => a.id)
}
}).then(async ({ok: a, message: r}) => {
u.guess(a, {
message: r
}),
a && await s()
}
)
}
, i = t => {
d.updateBarcodeTemplate({
requestBody: {
...t,
attributeIds: t.attributes.map(a => a.id)
}
}).then(async ({ok: a, message: r}) => {
u.guess(a, {
message: r
}),
a && await s()
}
)
}
, l = t => {
d.deleteBarcodeTemplate({
requestBody: {
id: t.id
}
}).then(async ({ok: a, message: r}) => {
u.guess(a, {
message: r
}),
a && await s()
}
)
}
, o = () => {
b.openContextModal({
modal: "barcodeTemplateFormModal",
title: "Создание шаблона",
withCloseButton: !1,
innerProps: {
onCreate: c
}
})
}
;
return e.jsxs("div", {
className: h.container,
children: [e.jsx(x, {
children: e.jsx("div", {
className: h["top-panel"],
children: e.jsx(I, {
onClick: () => o(),
variant: "default",
children: "Создать шаблон"
})
})
}), e.jsx(x, {
children: e.jsx(_, {
items: n,
onChange: i,
onDelete: l
})
})]
})
}
, P = k("/barcode")({
component: A
});
export {P as Route};

View File

@ -0,0 +1,12 @@
._container_kxb8n_1 {
display: flex;
flex-direction: column;
flex: 1 1 0%;
gap: calc(.625rem * var(--mantine-scale));
}
._top-panel_kxb8n_8 {
padding: calc(.3125rem * var(--mantine-scale));
gap: calc(.625rem * var(--mantine-scale));
display: flex;
}

View File

@ -0,0 +1,150 @@
import {r as j, j as e, a1 as y, a2 as f, a3 as m, a4 as h, a5 as b, a6 as g, a7 as C, b0 as B, s as p, X as K, aq as d, ac as u, c as v} from "./index-CdMy-Rhi.js";
const A = () => j.useMemo( () => [{
accessorKey: "name",
header: "Имя"
}, {
accessorKey: "details.telegram",
header: "Телеграм"
}, {
accessorKey: "details.email",
header: "EMAIL"
}, {
accessorKey: "details.phoneNumber",
header: "Телефон"
}, {
accessorKey: "details.inn",
header: "ИНН"
}, {
accessorKey: "companyName",
header: "Название компании"
}, {
accessorKey: "barcodeTemplate.name",
header: "Шаблон штрихкодов"
}], [])
, M = ({items: i, onDelete: t, onChange: c}) => {
const r = A()
, l = n => {
c && C.openContextModal({
modal: "productFormModal",
title: "Создание клиента",
withCloseButton: !1,
innerProps: {
onChange: s => c(s),
element: n
}
})
}
;
return e.jsx(e.Fragment, {
children: e.jsx(y, {
striped: !0,
data: i,
columns: r,
restProps: {
enableColumnActions: !1,
enableRowActions: !0,
renderRowActions: ({row: n}) => e.jsxs(f, {
gap: "md",
children: [e.jsx(m, {
label: "Редактировать",
children: e.jsx(h, {
onClick: () => l(n.original),
variant: "default",
children: e.jsx(b, {})
})
}), e.jsx(m, {
label: "Удалить",
children: e.jsx(h, {
onClick: () => {
t && t(n.original)
}
,
variant: "default",
children: e.jsx(g, {})
})
})]
})
}
})
})
}
, T = "_container_kxb8n_1"
, x = {
container: T,
"top-panel": "_top-panel_kxb8n_8"
}
, _ = () => {
const {clients: i, refetch: t} = B()
, c = s => {
d.createClientApi({
requestBody: {
data: s
}
}).then(async ({ok: a, message: o}) => {
u.guess(a, {
message: o
}),
a && await t()
}
)
}
, r = s => {
d.updateClient({
requestBody: {
data: s
}
}).then(async ({ok: a, message: o}) => {
u.guess(a, {
message: o
}),
a && await t()
}
)
}
, l = s => {
d.deleteClient({
requestBody: {
clientId: s.id
}
}).then(async ({ok: a, message: o}) => {
u.guess(a, {
message: o
}),
a && await t()
}
)
}
, n = () => {
C.openContextModal({
modal: "productFormModal",
title: "Создание клиента",
innerProps: {
onCreate: c
}
})
}
;
return e.jsxs("div", {
className: x.container,
children: [e.jsx(p, {
children: e.jsx("div", {
className: x["top-panel"],
children: e.jsx(K, {
onClick: n,
variant: "default",
children: "Создать клиента"
})
})
}), e.jsx(p, {
children: e.jsx(M, {
onChange: r,
onDelete: l,
items: i
})
})]
})
}
, w = v("/clients")({
component: _
});
export {w as Route};

90703
assets/index-CdMy-Rhi.js Normal file

File diff suppressed because it is too large Load Diff

9503
assets/index-aKkxMv5g.css Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
import {$ as a, j as t, a0 as o, c as s} from "./index-CdMy-Rhi.js";
const r = () => a(e => e.auth).isAuthorized ? t.jsx(o, {
to: "/leads"
}) : t.jsx(t.Fragment, {})
, i = s("/")({
component: r
});
export {i as Route};

View File

@ -0,0 +1,5 @@
import {c as e, a$ as a} from "./index-CdMy-Rhi.js";
const t = e("/leads")({
component: a
});
export {t as Route};

View File

@ -0,0 +1,4 @@
._title_hwj38_1 {
font-family: Greycliff CF,var(--mantine-font-family);
font-weight: 900
}

View File

@ -0,0 +1,177 @@
import {h as P, a as w, b as T, j as o, B as v, d as S, aX as N, f, O as y, P as a, r as m, aS as z, $ as L, aY as O, ac as b, a0 as C, ax as E, aZ as R, X as _, a_ as B, c as q} from "./index-CdMy-Rhi.js";
var j = {
root: "m_7485cace"
};
const D = {}
, W = S( (i, {size: e, fluid: s}) => ({
root: {
"--container-size": s ? void 0 : N(e, "container-size")
}
}))
, h = P( (i, e) => {
const s = w("Container", D, i)
, {classNames: r, className: c, style: d, styles: n, unstyled: l, vars: p, fluid: u, mod: t, ...g} = s
, x = T({
name: "Container",
classes: j,
props: s,
className: c,
style: d,
classNames: r,
styles: n,
unstyled: l,
vars: p,
varsResolver: W
});
return o.jsx(v, {
ref: e,
mod: [{
fluid: u
}, t],
...x("root"),
...g
})
}
);
h.classes = j;
h.displayName = "@mantine/core/Container";
class k {
static loginAuthLoginPost({requestBody: e}) {
return f(y, {
method: "POST",
url: "/auth/login",
body: e,
mediaType: "application/json",
errors: {
422: "Validation Error"
}
})
}
static testAuthTestPost() {
return f(y, {
method: "POST",
url: "/auth/test"
})
}
}
const F = "_title_hwj38_1"
, V = {
title: F
}
, A = ({wrapperProps: i, dataAuthUrl: e, usePic: s=!1, botName: r, className: c, buttonSize: d="large", dataOnauth: n, cornerRadius: l, requestAccess: p=!0}) => {
const u = m.useRef(null);
return m.useEffect( () => {
if (u.current === null)
return;
if (typeof n > "u" && typeof e > "u")
throw new Error("One of this props should be defined: dataAuthUrl (redirect URL), dataOnauth (callback fn) should be defined.");
typeof n == "function" && (window.TelegramLoginWidget = {
dataOnauth: g => n(g)
});
const t = document.createElement("script");
t.src = "https://telegram.org/js/telegram-widget.js?22",
t.setAttribute("data-telegram-login", r),
t.setAttribute("data-size", d),
l !== void 0 && t.setAttribute("data-radius", l.toString()),
p && t.setAttribute("data-request-access", "write"),
t.setAttribute("data-userpic", s.toString()),
typeof e == "string" ? t.setAttribute("data-auth-url", e) : t.setAttribute("data-onauth", "TelegramLoginWidget.dataOnauth(user)"),
t.async = !0,
u.current.appendChild(t)
}
, [r, d, l, n, p, s, u, e]),
o.jsx("div", {
ref: u,
className: c,
...i
})
}
;
A.propTypes = {
botName: a.string.isRequired,
usePic: a.bool,
className: a.string,
cornerRadius: a.number,
requestAccess: a.bool,
wrapperProps: a.object,
dataOnauth: a.func,
dataAuthUrl: a.string,
buttonSize: a.oneOf(["large", "medium", "small"])
};
const X = () => {
const i = z()
, e = L(r => r.auth)
, s = O();
return m.useEffect( () => {
e.isAuthorized && s({
to: "/leads"
}).then( () => {
s({
to: "/leads"
}).then( () => {
b.success({
message: "Вы успешно вошли!"
})
}
)
}
)
}
, [e.isAuthorized]),
e.isAuthorized ? o.jsx(C, {
to: "/leads"
}) : o.jsxs(h, {
size: 420,
my: 40,
children: [o.jsx(E, {
ta: "center",
className: V.title,
children: "Добро пожаловать"
}), o.jsxs(R, {
withBorder: !0,
shadow: "md",
p: 30,
mt: 30,
radius: "md",
children: [o.jsx(A, {
botName: "LogidexCRMBot",
dataOnauth: () => {}
,
wrapperProps: {
style: {
display: "none"
}
}
}), o.jsx(_, {
fullWidth: !0,
onClick: () => {
window.Telegram.Login.auth({
bot_id: "8223019480",
request_access: !0
}, r => {
k.loginAuthLoginPost({
requestBody: r
}).then( ({accessToken: c}) => {
i(B({
accessToken: c
}))
}
).catch( () => {
b.error({
message: "Не удалось войти!"
})
}
)
}
)
}
,
children: "Войти через Telegram"
})]
})]
})
}
, I = q("/login")({
component: X
});
export {I as Route};

View File

@ -0,0 +1,263 @@
import {ad as v, aS as T, $ as I, r as h, aT as p, ac as u, aU as S, aV as B, j as e, a4 as m, aW as _, a1 as R, a2 as b, e as P, X as w, a3 as j, a5 as E, a6 as q, a7 as C, t as A, s as M, N as D, c as F} from "./index-CdMy-Rhi.js";
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var N = v("outline", "refresh", "IconRefresh", [["path", {
d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",
key: "svg-0"
}], ["path", {
d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",
key: "svg-1"
}]]);
const $ = "_container_b84hd_1"
, y = {
container: $,
"top-panel": "_top-panel_b84hd_8",
"top-panel-last-item": "_top-panel-last-item_b84hd_14"
}
, z = () => {
const s = T()
, o = I(a => a.tasks.tasks)
, [l,f] = h.useState()
, [i,d] = h.useState([])
, c = async () => {
l && p.getClientMarketplaces({
requestBody: {
clientId: l.id
}
}).then(a => {
d(a.marketplaces)
}
)
}
, x = a => {
p.createMarketplace({
requestBody: {
marketplace: {
...a,
clientId: a.client.id,
baseMarketplaceKey: a.baseMarketplace.key
}
}
}).then(async ({ok: n, message: r}) => {
u.guess(n, {
message: r
}),
n && await c()
}
)
}
, k = a => {
p.deleteMarketplace({
requestBody: {
marketplaceId: a.id
}
}).then(async ({ok: n, message: r}) => {
u.guess(n, {
message: r
}),
n && await c()
}
)
}
, g = a => {
p.updateMarketplace({
requestBody: {
marketplace: a
}
}).then(async ({ok: n, message: r}) => {
u.guess(n, {
message: r
}),
n && await c()
}
)
}
, t = a => {
if (o.find(r => r.info.marketplaceId === a.id)) {
u.error({
title: "Ошибка",
message: `Синхронизация маркетплейса ${a.name} уже запущена`
});
return
}
S.createSynchronizeMarketplaceTask({
requestBody: {
marketplaceId: a.id
}
}).then( ({taskId: r}) => {
s(B({
id: r,
config: {
onErrorData: {
title: "Ошибка",
message: `Ошибка синхронизации маркетплейса: ${a.name}`
},
onLoadingData: {
title: "Синхронизация",
message: `Синхронизация маркетплейса: ${a.name}`
},
onSuccessData: {
title: "Успех",
message: `Маркетплейс ${a.name} успешно синхронизирован`
}
},
info: {
marketplaceId: a.id
}
}))
}
)
}
;
return h.useEffect( () => {
c()
}
, [l]),
{
client: l,
setClient: f,
items: i,
onDelete: k,
onChange: g,
onCreate: x,
onSynchronize: t
}
}
, K = () => h.useMemo( () => [{
header: "Маркетплейс",
size: 10,
Cell: ({row: s}) => {
var o;
return e.jsx(m, {
variant: "transparent",
children: e.jsx(_, {
src: ((o = s.original.baseMarketplace) == null ? void 0 : o.iconUrl) || ""
})
})
}
}, {
accessorKey: "name",
header: "Название",
enableSorting: !1
}, {
accessorKey: "client.name",
header: "Клиент",
enableSorting: !1
}], [])
, L = ({onDelete: s, onChange: o, onCreate: l, items: f, client: i, onSynchronize: d}) => {
const c = K()
, x = t => {
s && C.openConfirmModal({
title: "Удаление маркетплейса",
children: e.jsxs(A, {
size: "sm",
children: ["Вы уверены что хотите удалить маркетплейс ", t.name]
}),
labels: {
confirm: "Да",
cancel: "Нет"
},
confirmProps: {
color: "red"
},
onConfirm: () => s(t)
})
}
, k = t => {
o && C.openContextModal({
modal: "marketplaceFormModal",
withCloseButton: !1,
innerProps: {
onChange: a => o(a),
element: t
}
})
}
, g = () => {
!l || !i || C.openContextModal({
modal: "marketplaceFormModal",
withCloseButton: !1,
innerProps: {
onCreate: t => l({
...t,
client: i
})
}
})
}
;
return e.jsx(R, {
data: f,
columns: c,
restProps: {
enableSorting: !1,
enableColumnActions: !1,
enableTopToolbar: !0,
renderTopToolbar: e.jsx(b, {
p: P(10),
justify: "end",
children: e.jsx(w, {
disabled: !i,
variant: "default",
onClick: () => g(),
children: "Добавить"
})
}),
enableRowActions: !0,
renderRowActions: ({row: t}) => e.jsxs(b, {
gap: "md",
children: [e.jsx(j, {
label: "Редактировать",
children: e.jsx(m, {
onClick: () => k(t.original),
variant: "default",
children: e.jsx(E, {})
})
}), e.jsx(j, {
label: "Удалить",
children: e.jsx(m, {
onClick: () => x(t.original),
variant: "default",
children: e.jsx(q, {})
})
}), e.jsx(j, {
label: "Синхронизировать",
children: e.jsx(m, {
onClick: () => d && d(t.original),
variant: "default",
children: e.jsx(N, {})
})
})]
})
}
})
}
, U = () => {
const s = z();
return e.jsxs("div", {
className: y.container,
children: [e.jsx(M, {
children: e.jsx("div", {
className: y["top-panel"],
children: e.jsx(D, {
placeholder: "Выберите клиента",
onChange: s.setClient
})
})
}), e.jsx(M, {
children: e.jsx(e.Fragment, {
children: e.jsx(L, {
...s
})
})
})]
})
}
, W = F("/marketplaces")({
component: U
});
export {W as Route};

View File

@ -0,0 +1,265 @@
import {i as w, r as i, j as e, aJ as L, a1 as M, a2 as y, a3 as C, a4 as P, aH as N, a5 as R, a6 as k, a7 as f, aK as A, aA as E, s as S, e as F, az as q, X as H, aL as D, aM as V, aN as b, ac as g, t as J, c as X} from "./index-CdMy-Rhi.js";
import {s as d} from "./ProductsPage.module-BjEXBNuV.js";
import {L as z} from "./List-Xt0hH74q.js";
const G = () => {
const n = w();
return i.useMemo( () => [{
accessorKey: "article",
header: "Артикул",
enableSorting: !1,
size: 100
}, {
accessorKey: "factoryArticle",
header: "Складской артикул",
enableSorting: !1,
size: 100
}, {
accessorKey: "name",
header: "Название",
enableSorting: !1,
size: 150
}, {
accessorKey: "barcodes",
header: "Штрихкоды",
Cell: ({cell: o}) => e.jsx(z, {
size: "sm",
children: e.jsx(L, {
maxHeight: parseFloat(n.lineHeights.sm) * 25,
showLabel: "Показать все",
hideLabel: "Скрыть",
children: o.getValue().map(r => e.jsx(z.Item, {
children: r
}, r))
})
}),
enableSorting: !1,
size: 50
}, {
accessorKey: "barcodeTemplate.name",
header: "Шаблон штрихкода",
enableSorting: !1,
size: 50
}, {
accessorKey: "brand",
header: "Бренд",
enableSorting: !1,
size: 50
}, {
accessorKey: "composition",
header: "Состав",
enableSorting: !1,
size: 50
}, {
accessorKey: "color",
header: "Цвет",
enableSorting: !1,
size: 50
}, {
accessorKey: "size",
header: "Размер",
enableSorting: !1,
size: 50
}, {
accessorKey: "additionalInfo",
header: "Доп. информация",
enableSorting: !1,
size: 120
}], [])
}
, O = ({items: n, onDelete: o, onChange: r, tableRef: x}) => {
const c = G()
, u = s => {
r && f.openContextModal({
modal: "createProduct",
title: "Создание товара",
withCloseButton: !1,
innerProps: {
onChange: p => r(p),
product: s
}
})
}
, h = s => {
f.openContextModal({
modal: "printBarcode",
title: "Печать штрихкода",
withCloseButton: !0,
innerProps: {
productId: s.id
}
})
}
;
return e.jsx(M, {
ref: x,
data: n,
columns: c,
restProps: {
enableColumnActions: !1,
enableRowActions: !0,
renderRowActions: ({row: s}) => e.jsxs(y, {
gap: "md",
children: [e.jsx(C, {
label: "Печать штрихкода",
children: e.jsx(P, {
onClick: () => h(s.original),
variant: "default",
children: e.jsx(N, {})
})
}), e.jsx(C, {
label: "Редактировать",
children: e.jsx(P, {
onClick: () => u(s.original),
variant: "default",
children: e.jsx(R, {})
})
}), e.jsx(C, {
label: "Удалить",
children: e.jsx(P, {
onClick: () => {
o && o(s.original)
}
,
variant: "default",
children: e.jsx(k, {})
})
})]
})
}
})
}
, Q = () => {
const [n,o] = i.useState(-1)
, [r,x] = i.useState(1)
, [c,u] = i.useState(1)
, [h,s] = i.useState("")
, [p] = A(h, 500)
, {products: I, paginationInfo: m, refetch: j} = E({
clientId: n,
page: c - 1,
itemsPerPage: 10,
searchInput: p
})
, v = a => {
b.createProduct({
requestBody: a
}).then(async ({ok: t, message: l}) => {
g.guess(t, {
message: l
}),
t && await j()
}
)
}
, B = a => {
b.updateProduct({
requestBody: {
product: a
}
}).then(async ({ok: t, message: l}) => {
g.guess(t, {
message: l
}),
t && await j()
}
)
}
, K = () => {
if (n < 0) {
g.error({
message: "Необходимо выбрать клиента"
});
return
}
f.openContextModal({
modal: "createProduct",
title: "Создание товара",
withCloseButton: !1,
innerProps: {
clientId: n,
onCreate: v
}
})
}
, T = a => {
f.openConfirmModal({
title: "Удаление товара",
children: e.jsxs(J, {
size: "sm",
children: ["Вы уверены что хотите удалить товар ", a.name]
}),
labels: {
confirm: "Да",
cancel: "Нет"
},
confirmProps: {
color: "red"
},
onConfirm: () => b.deleteProduct({
requestBody: {
productId: a.id
}
}).then(async ({ok: t, message: l}) => {
g.guess(t, {
message: l
}),
t && await j()
}
)
})
}
;
return i.useEffect( () => {
m && (x(m.totalPages),
c > m.totalPages && u(1))
}
, [m]),
e.jsx(e.Fragment, {
children: e.jsxs("div", {
className: d.container,
children: [e.jsx(S, {
children: e.jsxs("div", {
className: d["top-panel"],
children: [e.jsxs(y, {
gap: F(10),
children: [e.jsx(q, {
onChange: a => o(a.id)
}), e.jsx(H, {
onClick: () => K(),
variant: "default",
children: "Создать"
})]
}), e.jsx(y, {
children: e.jsx(D, {
placeholder: "Артикул, название, шк",
onChange: a => s(a.currentTarget.value),
value: h
})
})]
})
}), e.jsx(S, {
children: e.jsx("div", {
className: d["body-container"],
children: e.jsxs("div", {
className: d["table-container"],
children: [e.jsx(O, {
onChange: B,
onDelete: T,
items: I
}), e.jsx(V, {
className: d["table-pagination"],
withEdges: !0,
onChange: a => u(a),
total: r,
value: c
})]
})
})
})]
})
})
}
, Z = X("/products")({
component: Q
});
export {Z as Route};

View File

@ -0,0 +1,447 @@
import {r as g, ao as G, j as e, a7 as I, t as k, ap as p, ac as m, aq as M, G as R, ar as S, as as K, a1 as U, a2 as $, a3 as B, a4 as y, a6 as T, a5 as F, at as j, C as D, au as N, V as z, av as V, aw as H, z as b, e as L, ax as _, X as O, ay as Q, az as W, s as X, c as J} from "./index-CdMy-Rhi.js";
import {s as Y} from "./ProductsPage.module-BjEXBNuV.js";
function A(t) {
const s = g.useRef(new Set(t))
, c = G();
return s.current.add = (...l) => {
const a = Set.prototype.add.apply(s.current, l);
return c(),
a
}
,
s.current.clear = (...l) => {
Set.prototype.clear.apply(s.current, l),
c()
}
,
s.current.delete = (...l) => {
const a = Set.prototype.delete.apply(s.current, l);
return c(),
a
}
,
s.current
}
const q = g.createContext(void 0)
, Z = () => {
const [t,s] = g.useState()
, c = A()
, l = A()
, a = n => {
if (!n) {
s(void 0);
return
}
M.getClient({
clientId: n
}).then(d => {
s(d.client)
}
).catch(d => console.log(d))
}
, u = n => {
a(n == null ? void 0 : n.id)
}
, i = () => {
a(t == null ? void 0 : t.id)
}
, r = n => {
p.deleteResidualPallet({
palletId: n
}).then( ({ok: d, message: C}) => {
if (!d) {
m.error({
message: C
});
return
}
l.delete(n),
i()
}
).catch(d => console.log(d))
}
, h = n => {
if (t) {
if (n.boxes.length === 0 && n.residualProducts.length === 0) {
r(n.id);
return
}
I.openConfirmModal({
title: "Удаление паллета",
children: e.jsx(k, {
size: "sm",
children: "Вы уверены что хотите удалить паллет?"
}),
labels: {
confirm: "Да",
cancel: "Нет"
},
confirmProps: {
color: "red"
},
onConfirm: () => r(n.id)
})
}
}
, f = n => {
p.deleteResidualBox({
boxId: n
}).then( ({ok: d, message: C}) => {
if (!d) {
m.error({
message: C
});
return
}
c.delete(n),
i()
}
).catch(d => console.log(d))
}
;
return {
selectedClient: t,
selectClient: u,
refetchClient: i,
onDeletePalletClick: h,
onCreatePalletClick: () => {
t && p.createResidualPallet({
requestBody: {
clientId: t.id
}
}).then( ({ok: n, message: d}) => {
n || m.error({
message: d
}),
i()
}
).catch(n => console.log(n))
}
,
onDeleteBoxClick: n => {
if (t) {
if (n.residualProducts.length === 0) {
f(n.id);
return
}
I.openConfirmModal({
title: "Удаление короба",
children: e.jsx(k, {
size: "sm",
children: "Вы уверены что хотите удалить короб?"
}),
labels: {
confirm: "Да",
cancel: "Нет"
},
confirmProps: {
color: "red"
},
onConfirm: () => f(n.id)
})
}
}
,
onCreateBoxClick: n => {
t && p.createResidualBox({
requestBody: {
palletId: n ?? null,
clientId: n ? null : t.id
}
}).then( ({ok: d, message: C}) => {
d || m.error({
message: C
}),
i()
}
).catch(d => console.log(d))
}
,
boxIdsToPrint: c,
palletIdsToPrint: l
}
}
, ee = ({children: t}) => {
const s = Z();
return e.jsx(q.Provider, {
value: s,
children: t
})
}
, P = () => {
const t = g.useContext(q);
if (!t)
throw new Error("useResiduesContext must be used within a ResiduesContextProvider");
return t
}
, te = () => {
const {palletIdsToPrint: t, boxIdsToPrint: s} = P()
, c = "/api/v1/residues/pdf"
, l = u => {
const i = window.open(u);
i && i.print()
}
;
return {
onGetPalletsPdfClick: () => {
if (t.size === 0 && s.size === 0) {
m.show({
message: "Не выбран ни один элемент для печати "
});
return
}
const u = t.values().toArray().join(",")
, i = s.values().toArray().join(",");
l(`${c}/?pallet_ids=${u}&box_ids=${i}`)
}
}
}
, se = () => {
const {onCreatePalletClick: t, onCreateBoxClick: s} = P()
, {onGetPalletsPdfClick: c} = te();
return e.jsxs(R, {
children: [e.jsx(S, {
onClick: () => t(),
children: "Добавить паллет"
}), e.jsx(S, {
onClick: () => s(),
children: "Добавить короб"
}), e.jsxs(S, {
onClick: () => c(),
children: [e.jsx(K, {}), "Печать"]
})]
})
}
, ne = () => g.useMemo( () => [{
header: "Название",
accessorKey: "product.name",
Cell: ({row: t}) => {
var s;
return ((s = t.original.product) == null ? void 0 : s.name) ?? "-"
}
}, {
header: "Артикул",
accessorKey: "product.article",
Cell: ({row: t}) => {
var s;
return ((s = t.original.product) == null ? void 0 : s.article) ?? "-"
}
}, {
header: "Размер",
accessorKey: "product.size",
Cell: ({row: t}) => {
var s;
return ((s = t.original.product) == null ? void 0 : s.size) ?? "-"
}
}, {
header: "Количество",
accessorKey: "quantity"
}], [])
, E = ({items: t}) => {
const s = ne()
, {selectedClient: c, refetchClient: l} = P()
, a = i => {
p.deleteResidualProduct({
residualProductId: i.id
}).then( ({ok: r, message: h}) => {
m.guess(r, {
message: h
}),
l()
}
).catch(r => console.log(r))
}
, u = i => {
c && I.openContextModal({
modal: "residualProductModal",
title: "Редактирование товара на паллете",
withCloseButton: !1,
innerProps: {
client: c,
updateOnSubmit: l,
residuesData: {
residualProductId: i.id,
product: i.product,
quantity: i.quantity
}
}
})
}
;
return e.jsx(U, {
data: t,
columns: s,
restProps: {
enableSorting: !1,
enableColumnActions: !1,
enableRowActions: !0,
enableRowNumbers: !0,
positionActionsColumn: "last",
renderRowActions: ({row: i}) => e.jsxs($, {
gap: "md",
children: [e.jsx(B, {
label: "Удалить",
children: e.jsx(y, {
onClick: () => a(i.original),
variant: "default",
children: e.jsx(T, {})
})
}), e.jsx(B, {
label: "Редактировать",
children: e.jsx(y, {
onClick: () => u(i.original),
variant: "default",
children: e.jsx(F, {})
})
})]
})
}
})
}
, v = ({boxes: t}) => {
const {onDeleteBoxClick: s, boxIdsToPrint: c} = P();
if (!t || t.length == 0)
return;
const l = t.map(r => r.id.toString())
, a = r => e.jsx(B, {
label: "Удалить короб",
children: e.jsx(y, {
variant: "default",
onClick: () => s(r),
mx: "md",
children: e.jsx(T, {})
})
})
, u = r => e.jsx(z, {
ml: "sm",
checked: c.has(r.id),
onChange: () => {
c.has(r.id) ? c.delete(r.id) : c.add(r.id)
}
})
, i = r => e.jsxs(j.Item, {
value: r.id.toString(),
children: [e.jsxs(D, {
children: [e.jsxs(j.Control, {
icon: e.jsx(N, {}),
children: ["Короб ", r.id]
}), u(r), a(r)]
}), e.jsx(j.Panel, {
children: r.residualProducts.length > 0 ? e.jsx(E, {
items: r.residualProducts.sort( (h, f) => h.id - f.id)
}) : e.jsx(k, {
children: "Пустой"
})
})]
}, r.id);
return e.jsx(j, {
multiple: !0,
defaultValue: l,
bd: "solid 1px gray",
children: t.sort( (r, h) => r.id - h.id).map(r => i(r))
})
}
, re = () => {
const {selectedClient: t, onDeletePalletClick: s, onCreateBoxClick: c, palletIdsToPrint: l} = P()
, a = []
, u = o => o == null ? void 0 : o.sort( (x, n) => x.id - n.id)
, i = o => e.jsx(z, {
ml: "sm",
checked: l.has(o.id),
onChange: () => {
l.has(o.id) ? l.delete(o.id) : l.add(o.id)
}
})
, r = () => {
const o = u(t == null ? void 0 : t.pallets);
return (o == null ? void 0 : o.map(x => (a.push(x.id.toString()),
e.jsxs(j.Item, {
value: x.id.toString(),
children: [e.jsxs(D, {
children: [e.jsxs(j.Control, {
icon: e.jsx(H, {}),
children: ["Паллет - П", x.id]
}), i(x), h(x)]
}), e.jsx(j.Panel, {
children: w(x)
})]
}, x.id)))) ?? []
}
, h = o => e.jsx(B, {
label: "Удалить паллет",
children: e.jsx(y, {
variant: "default",
onClick: () => s(o),
mx: "md",
children: e.jsx(T, {})
})
})
, f = o => e.jsx(O, {
variant: "default",
onClick: () => c(o),
children: e.jsxs(R, {
gap: "md",
children: [e.jsx(Q, {}), "Добавить короб"]
})
})
, w = o => {
const x = o.boxes.length === 0 && o.residualProducts.length === 0
, n = o.residualProducts.length === 0
, d = x ? "Пустой" : n ? "Короба" : "Товары"
, C = u(o.residualProducts);
return e.jsxs(b, {
gap: L(5),
children: [e.jsxs(R, {
justify: "space-between",
children: [e.jsxs(b, {
gap: "xs",
children: [e.jsxs(k, {
children: ["Дата добавления: ", new Date(o.createdAt).toLocaleString("ru-RU")]
}), e.jsx(_, {
order: 6,
children: d
})]
}), n && f(o.id)]
}), C.length > 0 && e.jsx(E, {
items: C
}), v.length > 0 && e.jsx(v, {
boxes: o.boxes
})]
})
}
;
return e.jsx(V, {
children: e.jsxs(j, {
multiple: !0,
defaultValue: a,
bd: "solid 1px gray",
children: [e.jsx(v, {
boxes: t == null ? void 0 : t.boxes
}), r()]
})
})
}
, oe = () => {
const {selectedClient: t, selectClient: s} = P();
return e.jsxs(b, {
h: "92vh",
children: [e.jsxs(R, {
children: [e.jsx(W, {
onChange: s
}), t && e.jsx(se, {})]
}), t && e.jsx(re, {})]
})
}
, ie = () => e.jsx("div", {
className: Y.container,
children: e.jsx(X, {
fullHeight: !0,
children: e.jsx(ee, {
children: e.jsx(oe, {})
})
})
})
, de = J("/residues")({
component: () => e.jsx(ie, {})
});
export {de as Route};

View File

@ -0,0 +1,672 @@
import {ad as w, r as R, j as e, S as L, ae as $, a1 as U, af as v, ac as p, a2 as I, a3 as x, a4 as m, a7 as f, a5 as M, a6 as P, ag as O, t as Q, ah as G, ai as _, s as V, e as b, X as E, aj as A, ak as N, al as z, am as q, an as T, c as H} from "./index-CdMy-Rhi.js";
import {L as F} from "./List-Xt0hH74q.js";
import {s as D} from "./ServicesPage.module-BAnCpO1K.js";
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var X = w("outline", "arrow-down", "IconArrowDown", [["path", {
d: "M12 5l0 14",
key: "svg-0"
}], ["path", {
d: "M18 13l-6 6",
key: "svg-1"
}], ["path", {
d: "M6 13l6 6",
key: "svg-2"
}]]);
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var J = w("outline", "arrow-up", "IconArrowUp", [["path", {
d: "M12 5l0 14",
key: "svg-0"
}], ["path", {
d: "M18 11l-6 -6",
key: "svg-1"
}], ["path", {
d: "M6 11l6 -6",
key: "svg-2"
}]]);
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var W = w("outline", "download", "IconDownload", [["path", {
d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",
key: "svg-0"
}], ["path", {
d: "M7 11l5 5l5 -5",
key: "svg-1"
}], ["path", {
d: "M12 4l0 12",
key: "svg-2"
}]]);
/**
* @license @tabler/icons-react v3.21.0 - MIT
*
* This source code is licensed under the MIT license.
* See the LICENSE file in the root directory of this source tree.
*/
var Y = w("outline", "file-type-pdf", "IconFileTypePdf", [["path", {
d: "M14 3v4a1 1 0 0 0 1 1h4",
key: "svg-0"
}], ["path", {
d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4",
key: "svg-1"
}], ["path", {
d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6",
key: "svg-2"
}], ["path", {
d: "M17 18h2",
key: "svg-3"
}], ["path", {
d: "M20 15h-3v6",
key: "svg-4"
}], ["path", {
d: "M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z",
key: "svg-5"
}]]);
const Z = () => {
const t = r => r.priceRanges.length == 0 ? e.jsxs(e.Fragment, {
children: [r.price, "₽"]
}) : e.jsx(e.Fragment, {
children: e.jsx(F, {
children: r.priceRanges.map(n => e.jsx(F.Item, {
children: `${n.fromQuantity} - ${n.toQuantity}: ${n.price}`
}, n.id))
})
});
return R.useMemo( () => [{
accessorKey: "category",
header: "Категория",
accessorFn: r => `${r.category.name}`,
enableColumnOrdering: !0,
enableSorting: !1
}, {
accessorKey: "name",
header: "Услуга",
enableGrouping: !1,
enableSorting: !1,
Cell: ({row: r, cell: n}) => r.original.isPlaceholder ? "" : n.renderValue()
}, {
accessorKey: "price",
header: "Цена",
enableGrouping: !1,
enableSorting: !1,
Cell: ({row: r}) => r.original.isPlaceholder ? "" : t(r.original)
}, {
accessorKey: "cost",
header: "Себестоимость",
enableGrouping: !1,
enableSorting: !1,
Cell: ({row: r}) => r.original.isPlaceholder ? "" : `${r.original.cost}`
}], [])
}
;
var h = (t => (t[t.DEAL_SERVICE = 0] = "DEAL_SERVICE",
t[t.PRODUCT_SERVICE = 1] = "PRODUCT_SERVICE",
t[t.SERVICES_KITS = 2] = "SERVICES_KITS",
t))(h || {});
const ee = [{
label: "Для товара",
value: "1"
}, {
label: "Для сделки",
value: "0"
}, {
label: "Наборы услуг",
value: "2"
}]
, te = t => e.jsx(L, {
data: ee,
...t
})
, re = ({items: t, onDelete: r, onChange: n, serviceType: u, editMode: S}) => {
const s = $()
, l = Z()
, C = t.map(a => a.category).map(a => u === h.DEAL_SERVICE ? a.dealServiceRank : a.productServiceRank)
, d = C.sort()[0]
, c = C.sort()[C.length - 1]
, g = a => {
n && f.openContextModal({
modal: "createService",
title: "Создание услуги",
withCloseButton: !1,
innerProps: {
onChange: o => n(o),
element: a
}
})
}
;
return e.jsx(U, {
data: t,
columns: l,
restProps: {
enableGrouping: !0,
initialState: {
grouping: ["category"]
},
state: {
columnVisibility: {
"mrt-row-drag": S
}
},
enableColumnActions: !1,
enableRowOrdering: !0,
mantineRowDragHandleProps: ({table: a}) => ({
onDragEnd: () => {
const {draggingRow: o, hoveredRow: i} = a.getState();
!(i != null && i.original) || !(o != null && o.original) || v.reorderService({
requestBody: {
drainingServiceId: o.original.id,
hoveredServiceId: i.original.id
}
}).then( ({ok: y, message: K}) => {
if (!y) {
p.guess(y, {
message: K
});
return
}
s.invalidateQueries({
queryKey: ["getAllServices"]
}).then( () => {}
)
}
)
}
}),
displayColumnDefOptions: {
"mrt-row-drag": {
AggregatedCell: ({row: a}) => {
const o = u === h.DEAL_SERVICE ? a.original.category.dealServiceRank : a.original.category.productServiceRank;
return e.jsxs(I, {
gap: "xs",
children: [e.jsx(x, {
label: "Поднять вверх",
children: e.jsx(m, {
disabled: o === d,
onClick: () => {
v.reorderServiceCategory({
requestBody: {
serviceType: u,
categoryId: a.original.category.id,
moveDown: !1,
moveUp: !0
}
}).then( ({ok: i, message: y}) => {
if (!i) {
p.guess(i, {
message: y
});
return
}
s.invalidateQueries({
queryKey: ["getAllServices"]
}).then( () => {}
)
}
)
}
,
variant: "default",
children: e.jsx(J, {})
})
}), e.jsx(x, {
label: "Опустить вниз",
children: e.jsx(m, {
disabled: o === c,
onClick: () => {
v.reorderServiceCategory({
requestBody: {
serviceType: u,
categoryId: a.original.category.id,
moveDown: !0,
moveUp: !1
}
}).then( ({ok: i, message: y}) => {
if (!i) {
p.guess(i, {
message: y
});
return
}
s.invalidateQueries({
queryKey: ["getAllServices"]
}).then( () => {}
)
}
)
}
,
variant: "default",
children: e.jsx(X, {})
})
})]
})
}
},
"mrt-row-actions": {
AggregatedCell: ({row: a}) => S && e.jsxs(I, {
gap: "xs",
children: [e.jsx(x, {
label: "Редактировать категорию",
children: e.jsx(m, {
onClick: () => {
f.openContextModal({
modal: "createServiceCategory",
title: "Создание категории",
withCloseButton: !1,
innerProps: {
element: a.original.category,
onChange: o => {
v.updateServiceCategory({
requestBody: {
category: o
}
}).then( ({ok: i, message: y}) => {
p.guess(i, {
message: y
}),
i && s.invalidateQueries({
queryKey: ["getAllServices"]
}).then( () => {}
)
}
)
}
}
})
}
,
variant: "default",
children: e.jsx(M, {})
})
}), e.jsx(x, {
label: "Удалить категорию",
children: e.jsx(m, {
onClick: () => {
f.openConfirmModal({
title: "Удаление категории",
children: `Вы уверены, что хотите удалить категорию: ${a.original.category.name}?`,
onConfirm: () => {
v.deleteServiceCategory({
requestBody: {
categoryId: a.original.category.id
}
}).then( ({ok: o, message: i}) => {
p.guess(o, {
message: i
}),
o && s.invalidateQueries({
queryKey: ["getAllServices"]
}).then( () => {}
)
}
)
}
})
}
,
variant: "default",
children: e.jsx(P, {})
})
})]
})
}
},
enableRowActions: !0,
renderRowActions: ({row: a}) => e.jsxs(I, {
display: a.original.isPlaceholder ? "none" : "flex",
gap: "xs",
children: [e.jsx(x, {
label: "Редактировать",
children: e.jsx(m, {
onClick: () => g(a.original),
variant: "default",
children: e.jsx(M, {})
})
}), e.jsx(x, {
label: "Удалить",
children: e.jsx(m, {
onClick: () => {
r && r(a.original)
}
,
variant: "default",
children: e.jsx(P, {})
})
})]
})
}
})
}
, ae = () => R.useMemo( () => [{
accessorKey: "name",
header: "Название набора"
}, {
header: "Кол-во услуг",
Cell: ({row: t}) => t.original.services.length
}], [])
, ne = ({items: t, onDelete: r, onChange: n}) => {
const u = ae()
, S = s => {
n && f.openContextModal({
modal: "serviceKitModalForm",
title: "Создание набора услуг",
withCloseButton: !1,
innerProps: {
element: s,
onChange: n
}
})
}
;
return e.jsx(U, {
data: t,
columns: u,
restProps: {
enableSorting: !1,
enableColumnActions: !1,
enableRowActions: !0,
renderRowActions: ({row: s}) => e.jsxs(I, {
gap: "md",
children: [e.jsx(x, {
label: "Редактировать",
children: e.jsx(m, {
onClick: () => S(s.original),
variant: "default",
children: e.jsx(M, {})
})
}), e.jsx(x, {
label: "Удалить",
children: e.jsx(m, {
onClick: () => {}
,
variant: "default",
children: e.jsx(P, {})
})
})]
})
}
})
}
, se = () => {
const {services: t, refetch: r} = O({
withPlaceholders: !0
})
, n = () => {
f.openContextModal({
modal: "createService",
title: "Создание услуги",
withCloseButton: !1,
innerProps: {
onCreate: u
}
})
}
, u = d => {
v.createService({
requestBody: {
service: d
}
}).then(async ({ok: c, message: g}) => {
p.guess(c, {
message: g
}),
c && await r()
}
)
}
, S = () => {
f.openContextModal({
modal: "createServiceCategory",
title: "Создание категории",
withCloseButton: !1,
innerProps: {
onCreate: s
}
})
}
, s = d => {
v.createServiceCategory({
requestBody: {
category: d
}
}).then( ({ok: c, message: g}) => p.guess(c, {
message: g
}))
}
;
return {
services: t,
onCreateClick: n,
onServiceDelete: d => {
f.openConfirmModal({
title: "Удаление услуги",
children: e.jsxs(Q, {
children: ['Вы уверены, что хотите удалить услугу "', d.name, '"?']
}),
onConfirm: () => {
v.deleteService({
requestBody: {
serviceId: d.id
}
}).then(async ({ok: c, message: g}) => {
p.guess(c, {
message: g
}),
c && await r()
}
)
}
,
labels: {
confirm: "Удалить",
cancel: "Отмена"
}
})
}
,
onServiceUpdate: d => {
v.updateService({
requestBody: {
data: d
}
}).then(async ({ok: c, message: g}) => {
p.guess(c, {
message: g
}),
c && await r()
}
)
}
,
onCreateCategoryClick: S
}
}
, ie = () => {
const {objects: t, refetch: r} = G()
, n = s => {
v.createServicesKit({
requestBody: {
data: {
..._.omit(s, ["services", "id"]),
servicesIds: s.services.map(l => l.id)
}
}
}).then(async ({ok: l, message: C}) => {
p.guess(l, {
message: C
}),
l && await r()
}
)
}
;
return {
onKitCreateClick: () => {
f.openContextModal({
modal: "serviceKitModalForm",
title: "Создание набора услуг",
withCloseButton: !1,
innerProps: {
onCreate: n
}
})
}
,
onKitUpdate: s => {
v.updateServicesKit({
requestBody: {
data: {
..._.omit(s, ["services"]),
servicesIds: s.services.map(l => l.id)
}
}
}).then(async ({ok: l, message: C}) => {
p.guess(l, {
message: C
}),
l && await r()
}
)
}
,
servicesKits: t
}
}
, oe = () => {
const [t,r] = R.useState(h.DEAL_SERVICE)
, [n,u] = R.useState(!1)
, {services: S, onServiceDelete: s, onServiceUpdate: l, onCreateClick: C, onCreateCategoryClick: d} = se()
, {servicesKits: c, onKitUpdate: g, onKitCreateClick: a} = ie()
, o = () => {
switch (t) {
case h.SERVICES_KITS:
return e.jsx(ne, {
items: c,
onChange: g
});
case h.DEAL_SERVICE:
case h.PRODUCT_SERVICE:
{
const j = S.filter(k => k.serviceType === t).sort( (k, B) => t === h.DEAL_SERVICE ? k.category.dealServiceRank.localeCompare(B.category.dealServiceRank) : k.category.productServiceRank.localeCompare(B.category.productServiceRank));
return e.jsx(re, {
onDelete: s,
onChange: l,
items: j,
serviceType: t,
editMode: n
})
}
}
}
, i = () => {
switch (t) {
case h.SERVICES_KITS:
return e.jsx(E, {
onClick: a,
variant: "default",
children: "Создать набор"
});
case h.DEAL_SERVICE:
case h.PRODUCT_SERVICE:
return e.jsxs(I, {
align: "center",
gap: b(10),
children: [e.jsxs("div", {
style: {
display: "grid",
gridAutoFlow: "column",
gridAutoColumns: "1fr",
width: "max-content",
gap: b(10)
},
children: [e.jsx(E, {
onClick: C,
variant: "default",
children: "Создать услугу"
}), e.jsx(E, {
onClick: d,
variant: "default",
children: "Создать категорию"
}), e.jsxs(A, {
withArrow: !0,
shadow: "md",
children: [e.jsx(A.Target, {
children: e.jsx(E, {
leftSection: e.jsx(W, {}),
variant: "default",
children: "Скачать"
})
}), e.jsx(A.Dropdown, {
children: e.jsxs(I, {
direction: "column",
gap: b(10),
children: [
e.jsx(E, {
onClick: y,
variant: "default",
leftSection: e.jsx(Y, {}),
children: "В формате PDF"
}), /*
e.jsx(E, {
onClick: K,
variant: "default",
leftSection: e.jsx(N, {}),
children: "В формате Excel"
})
*/
]
})
})]
})]
}), e.jsx(z, {
variant: "default",
label: "Режим редактирования",
checked: n,
onChange: () => u(!n)
})]
})
}
}
, y = () => {
const j = q();
T.saveAs("/api/v1/service/export-list/pdf", `прайс_лист_${j}.pdf`)
}
, K = () => {
const j = q();
T.saveAs("/api/v1/service/export-list/excel", `прайс_лист_${j}.xlsx`)
}
;
return e.jsxs("div", {
className: D.container,
children: [e.jsx(V, {
children: e.jsxs("div", {
className: D["top-panel"],
children: [i(), e.jsx(te, {
className: D["top-panel-last-item"],
value: t.toString(),
onChange: j => r(parseInt(j))
})]
})
}), e.jsx(V, {
children: o()
})]
})
}
, ue = H("/services")({
component: oe
});
export {ue as Route};

View File

@ -0,0 +1,154 @@
import {r as f, j as e, a1 as C, a2 as j, a3 as p, a4 as d, a5 as W, a6 as b, a7 as h, t as S, a8 as y, a9 as B, s as m, X as w, aa as v, ab as c, ac as u, c as I} from "./index-CdMy-Rhi.js";
import {s as g} from "./ServicesPage.module-BAnCpO1K.js";
const P = () => f.useMemo( () => [{
accessorKey: "id",
header: "ID"
}, {
accessorKey: "name",
header: "Название"
}], [])
, R = ({onChange: o, onDelete: n, items: t, summaries: r}) => {
const l = P()
, i = s => {
o && h.openContextModal({
modal: "shippingWarehouseForm",
title: "Редактирование склада отгрузки",
withCloseButton: !1,
innerProps: {
element: s,
onChange: o,
summaries: r.filter(x => x.shipmentWarehouseId === s.id).slice(0, 5)
},
size: "xl"
})
}
, a = s => {
n && h.openConfirmModal({
title: "Удаление склада отгрузки",
children: e.jsxs(S, {
size: "sm",
children: ["Вы уверены что хотите удалить склад отгрузки ", s.name]
}),
labels: {
confirm: "Да",
cancel: "Нет"
},
confirmProps: {
color: "red"
},
onConfirm: () => {
n(s)
}
})
}
;
return e.jsx(C, {
data: t,
columns: l,
restProps: {
enableColumnActions: !1,
enableSorting: !1,
enableRowActions: !0,
renderRowActions: ({row: s}) => e.jsxs(j, {
gap: "md",
children: [e.jsx(p, {
label: "Редактировать",
children: e.jsx(d, {
onClick: () => i(s.original),
variant: "default",
children: e.jsx(W, {})
})
}), e.jsx(p, {
label: "Удалить",
children: e.jsx(d, {
onClick: () => a(s.original),
variant: "default",
children: e.jsx(b, {})
})
})]
})
}
})
}
, T = () => {
const {shippingWarehouses: o, refetch: n} = y()
, {objects: t} = B()
, r = v({
onChange: i => {
c.updateShippingWarehouse({
requestBody: {
shippingWarehouse: i
}
}).then(async ({ok: a, message: s}) => {
u.guess(a, {
message: s
}),
a && await n()
}
)
}
,
onCreate: i => {
c.createShippingWarehouse({
requestBody: {
shippingWarehouse: i
}
}).then(async ({ok: a, message: s}) => {
u.guess(a, {
message: s
}),
a && await n()
}
)
}
,
onDelete: i => {
c.deleteShippingWarehouse({
requestBody: {
shippingWarehouseId: i.id
}
}).then(async ({ok: a, message: s}) => {
u.guess(a, {
message: s
}),
a && await n()
}
)
}
})
, l = () => {
h.openContextModal({
modal: "shippingWarehouseForm",
title: "Редактирование склада отгрузки",
withCloseButton: !1,
innerProps: {
onCreate: r.onCreate,
summaries: []
}
})
}
;
return e.jsxs("div", {
className: g.container,
children: [e.jsx(m, {
children: e.jsx("div", {
className: g["top-panel"],
children: e.jsx(w, {
onClick: l,
variant: "default",
children: "Создать склад отгрузки"
})
})
}), e.jsx(m, {
children: e.jsx(R, {
items: o,
summaries: t,
...r
})
})]
})
}
, A = I("/shipping_warehouses")({
component: T
});
export {A as Route};

View File

@ -0,0 +1,303 @@
._container_1kmgc_1 {
display: flex;
flex-direction: column;
flex: 1 1 0%;
gap: calc(.625rem * var(--mantine-scale));
}
._page-container_1kmgc_8 {
display: flex;
flex-flow: wrap;
gap: calc(.625rem * var(--mantine-scale));
height: 96vh;
}
._profit-chart-container_1kmgc_16 {
display: flex;
flex-flow: column;
gap: calc(.625rem * var(--mantine-scale));
height: 96vh;
flex: 3 1 0%;
min-width: 600px;
}
._top-panel_1kmgc_26 {
padding: calc(.3125rem * var(--mantine-scale));
gap: calc(.625rem * var(--mantine-scale));
display: flex;
}
.m_e4d36c9b {
min-width: calc(12.5rem * var(--mantine-scale));
background-color: var(--mantine-color-body);
box-shadow: var(--mantine-shadow-md);
border-radius: var(--mantine-radius-default);
}
:where([data-mantine-color-scheme="light"]) .m_e4d36c9b {
border: 1px solid var(--mantine-color-gray-3);
}
:where([data-mantine-color-scheme="dark"]) .m_e4d36c9b {
border: 1px solid var(--mantine-color-dark-4);
}
.m_7f4bcb19 {
padding: var(--mantine-spacing-xs) var(--mantine-spacing-md);
font-size: var(--mantine-font-size-md);
font-weight: 500;
color: var(--mantine-color-bright);
}
.m_3de554dd {
padding-right: ;
padding-bottom: ;
padding-left: ;
padding-top: 0px;
}
.m_e4d36c9b:where([data-type="radial"]) :where(.m_3de554dd) {
padding-top: var(--mantine-spacing-sm);
}
.m_b30369b5 {
width: calc(.75rem * var(--mantine-scale));
height: calc(.75rem * var(--mantine-scale));
}
.m_3de8964e {
font-size: var(--mantine-font-size-sm);
display: flex;
justify-content: space-between;
}
.m_3de8964e:where(.m_3de8964e + .m_3de8964e) {
margin-top: calc(var(--mantine-spacing-sm) / 2);
}
.m_3de8964e[data-type="scatter"] .m_b30369b5 {
display: none;
}
.m_50186d10 {
display: flex;
align-items: center;
gap: var(--mantine-spacing-sm);
margin-inline-end: var(--mantine-spacing-xl); }
.m_501dadf9 {
color: var(--mantine-color-text);
font-size: var(--mantine-font-size-sm);
}
.m_50192318 {
color: var(--mantine-color-bright);
}
.m_847eaf {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
height: 100%;
}
.m_847eaf:where([data-centered]) {
justify-content: center;
}
.m_847eaf:where([data-position="top"]) {
padding-bottom: var(--mantine-spacing-md);
}
.m_847eaf:where([data-position="bottom"]) {
padding-top: var(--mantine-spacing-md);
}
.m_17da7e62 {
display: flex;
align-items: center;
gap: calc(.4375rem * var(--mantine-scale));
padding: 7px var(--mantine-spacing-xs);
border-radius: var(--mantine-radius-default);
line-height: 1;
}
@media (hover: hover) {
:where([data-mantine-color-scheme="light"]) .m_17da7e62:where(:hover) {
background-color: var(--mantine-color-gray-0);
}
:where([data-mantine-color-scheme="dark"]) .m_17da7e62:where(:hover) {
background-color: var(--mantine-color-dark-5);
}
}
@media (hover: none) {
:where([data-mantine-color-scheme="light"]) .m_17da7e62:where(:active) {
background-color: var(--mantine-color-gray-0);
}
:where([data-mantine-color-scheme="dark"]) .m_17da7e62:where(:active) {
background-color: var(--mantine-color-dark-5);
}
}
.m_17da7e62[data-without-color] .m_6e236e21 {
display: none;
}
.m_8ff56c0d {
font-size: var(--mantine-font-size-sm);
margin: 0px;
padding: 0px;
}
.m_a50f3e58 {
display: block;
width: 100%;
--chart-bar-label-color: var(--mantine-color-dimmed);
}
.m_a50f3e58 svg {
overflow: visible;
}
:where([data-mantine-color-scheme="light"]) .m_a50f3e58 {
--chart-grid-color: rgba(173, 181, 189, .6);
--chart-cursor-fill: rgba(173, 181, 189, .15);
}
:where([data-mantine-color-scheme="dark"]) .m_a50f3e58 {
--chart-cursor-fill: rgba(105, 105, 105, .15);
--chart-grid-color: rgba(105, 105, 105, .6);
}
.m_a50f3e58 :where(text) {
font-family: var(--mantine-font-family);
color: var(--chart-text-color, var(--mantine-color-dimmed));
}
.m_a50f3e58:where([data-orientation="vertical"]) {
--chart-bar-label-color: var(--mantine-color-white);
}
.m_af9188cb {
height: 100%;
width: 100%;
}
.m_a50a48bc {
stroke: var(--chart-grid-color);
}
.m_a507a517 {
color: var(--chart-grid-color);
}
.m_2293801d {
color: var(--chart-text-color, var(--mantine-color-dimmed));
}
.m_92b296cd {
min-width: calc(12.5rem * var(--mantine-scale));
background-color: var(--mantine-color-body);
box-shadow: var(--mantine-shadow-md);
border-radius: var(--mantine-radius-default);
padding: var(--mantine-spacing-sm);
}
:where([data-mantine-color-scheme="light"]) .m_92b296cd {
border: 1px solid var(--mantine-color-gray-3);
}
:where([data-mantine-color-scheme="dark"]) .m_92b296cd {
border: 1px solid var(--mantine-color-dark-4);
}
.m_a410e613 {
min-height: var(--chart-size, auto);
height: var(--chart-size, auto);
width: var(--chart-size, auto);
min-width: var(--chart-size, auto);
}
.m_a410e613 :where(*) {
outline: 0px;
}
.m_ddb0bfe3 {
fill: var(--mantine-color-text);
font-size: var(--mantine-font-size-sm);
}
.m_cd8943fd {
min-height: var(--chart-size, auto);
height: var(--chart-size, auto);
width: var(--chart-size, auto);
min-width: var(--chart-size, auto);
}
.m_cd8943fd :where(*) {
outline: 0px;
}
:where([data-mantine-color-scheme="light"]) .m_1f271cf7 {
--chart-grid-color: rgba(173, 181, 189, .6);
--chart-text-color: var(--mantine-color-gray-7);
}
:where([data-mantine-color-scheme="dark"]) .m_1f271cf7 {
--chart-grid-color: rgba(105, 105, 105, .6);
--chart-text-color: var(--mantine-color-dark-1);
}
.m_1f271cf7 :where(text) {
font-size: var(--mantine-font-size-xs);
fill: var(--chart-text-color, var(--mantine-color-dimmed));
user-select: none;
}
.m_cf06f58c {
height: 100%;
width: 100%;
}
:where([data-mantine-color-scheme="light"]) .m_cd2bd9e5 {
--chart-empty-background: var(--mantine-color-gray-1);
--chart-cursor-color: var(--mantine-color-gray-4);
}
:where([data-mantine-color-scheme="dark"]) .m_cd2bd9e5 {
--chart-empty-background: var(--mantine-color-dark-6);
--chart-cursor-color: var(--mantine-color-dark-4);
}
.m_6bcc3420 {
padding: var(--mantine-spacing-md);
box-shadow: var(--mantine-shadow-md);
min-width: calc(12.5rem * var(--mantine-scale));
font-size: var(--mantine-font-size-sm);
display: flex;
align-items: center;
justify-content: space-between;
}
:where([data-mantine-color-scheme="light"]) .m_6bcc3420 {
border: 1px solid var(--mantine-color-gray-2);
}
:where([data-mantine-color-scheme="dark"]) .m_6bcc3420 {
border: 1px solid var(--mantine-color-dark-4);
}
.m_80d531e7 {
min-height: var(--chart-size, auto);
height: var(--chart-size, auto);
width: var(--chart-size, auto);
min-width: var(--chart-size, auto);
}
.m_80d531e7 :where(*) {
outline: 0px;
}

File diff suppressed because it is too large Load Diff

BIN
icons/logo-light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
icons/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

21
index.html Normal file
View File

@ -0,0 +1,21 @@
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/svg+xml"
href="icons/favicon.png" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>LOGIDEX: Fulfillment</title>
<script src="https://unpkg.com/html5-qrcode@2.3.8/html5-qrcode.min.js"></script>
<script type="module" src="assets/index-CdMy-Rhi.js"></script>
<link rel="stylesheet" href="assets/index-aKkxMv5g.css">
</head>
<body>
<div id="root"></div>
</body>
</html>