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

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};