PageSourceSearch

https://www.a-lab.ru/assets/WeekStat-BLq-a7Vu.js

js a-lab.ru collected 2026-10-04 17:42:00 UTC 7,708 bytes, 1 lines download raw bytes

1import{R as d,j as e}from"./react-vendor-DSL1QzMr.js";import{h as D,H as C}from"./Header-Cjzt4eZ3.js";import{F}from"./Footer-Blb3XuSv.js";import{E as I}from"./EChart-DuInWB5K.js";import{u as A}from"./useIntervalUpdate--7bkkc0W.js";import{g as f,t as T,d as i,a as m,c as p,e as n,h as j}from"./tradingPresentation-vjtiUWuC.js";import"./vendor-CIXbc20S.js";import"./index-CwX7mxf3.js";import"./router-query-vendor-D3DrV8AV.js";import"./axios-vendor-xsH4HHeE.js";import"./usePublicSiteContent-CCuD7mVq.js";import"./charts-vendor-CyFBUgeU.js";const u=new Date;u.setDate(u.getDate()-1);const h=T(u),N=f(-14),v="app-input min-w-0 py-2.5 text-sm",q=()=>{const[a,c]=d.useState(N),[l,o]=d.useState(h),y=d.useCallback(t=>D({dateFrom:a,dateTo:l},t),[a,l]),[g,k]=A(y,1e4,void 0,`${a}-${l}`),s=d.useMemo(()=>(Array.isArray(g)?g:[]).filter(t=>!!(t!=null&&t.week)),[g]),x=s.reduce((t,r)=>t+(i(r.profit)??0),0),w=s.reduce((t,r)=>t+(i(r.turnover)??0),0),b=s.reduce((t,r)=>t+(i(r.trades)??0),0),S=d.useMemo(()=>({tooltip:{trigger:"axis"},legend:{data:["Прибыль","Сделок"]},xAxis:{type:"category",data:s.map(t=>m(t.week))},yAxis:[{type:"value",name:"Прибыль"},{type:"value",name:"Сделок"}],grid:{left:40,right:40,top:40,bottom:50},series:[{name:"Прибыль",type:"bar",data:s.map(t=>i(t.profit)??0),itemStyle:{color:t=>t.value>=0?"#60a5fa":"#f87171"}},{name:"Сделок",type:"line",yAxisIndex:1,smooth:!0,data:s.map(t=>i(t.trades)??0),itemStyle:{color:"#0f172a"},lineStyle:{width:3}}]}),[s]);return e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsx("main",{className:"app-shell min-h-screen pb-16",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-8 px-4 py-8 md:px-6",children:[e.jsx("section",{className:"app-panel overflow-hidden p-6 md:p-8",children:e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_360px] lg:items-end",children:[e.jsxs("div",{children:[e.jsx("span",{className:"app-chip",children:"Weekly Stats"}),e.jsx("h1",{className:"mt-4 text-3xl font-extrabold tracking-[-0.03em] text-slate-950 md:text-5xl",children:"Недельная статистика торговли"}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-slate-600 md:text-base",children:"Прибыль, оборот и количество сделок в разбивке по торговым неделям. Прибыль и «Сделок» считаются по зафиксированным результатам операций счёта (как в «Едином счёте»), оборот — по биржевым исполнениям."})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3 lg:grid-cols-1",children:[e.jsxs("div",{className:"app-stat-card",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-slate-500",children:"Недель в выборке"}),e.jsx("div",{className:"mt-3 text-3xl font-extrabold tracking-[-0.04em] text-slate-950",children:p(s.length)})]}),e.jsxs("div",{className:"app-stat-card",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-slate-500",children:"Итоговая прибыль"}),e.jsx("div",{className:`mt-3 text-2xl font-extrabold tracking-[-0.04em] ${j(x)}`,children:n(x,{fraction:2})})]}),e.jsxs("div",{className:"app-stat-card",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-slate-500",children:"Сделок"}),e.jsx("div",{className:"mt-3 text-3xl font-extrabold tracking-[-0.04em] text-slate-950",children:p(b)})]})]})]})}),e.jsxs("section",{className:"app-panel p-5 md:p-6",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-3 md:max-w-[460px] md:grid-cols-2",children:[e.jsx("input",{type:"date",className:v,value:a,max:l,onChange:t=>c(t.target.value)}),e.jsx("input",{type:"date",className:v,value:l,min:a,onChange:t=>o(t.target.value)})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",className:"app-button-secondary !px-4 !py-2",onClick:()=>{c(f(-7)),o(h)},children:"7 дней"}),e.jsx("button",{type:"button",className:"app-button-secondary !px-4 !py-2",onClick:()=>{c(N),o(h)},children:"14 дней"}),e.jsx("button",{type:"button",className:"app-button-secondary !px-4 !py-2",onClick:()=>{c(f(-30)),o(h)},children:"30 дней"})]}),e.jsxs("p",{className:"text-sm text-slate-500",children:["Период: ",m(a)," - ",m(l),". Внутри экрана данные собираются по Ð
1½ÐµÐ´ÐµÐ»ÑÐ¼, поэтому изменение диапазона отражается на недельных агрегатах."]})]}),k&&s.length===0?e.jsx("div",{className:"py-10 text-center text-slate-400",children:"Загрузка статистики..."}):s.length===0?e.jsx("div",{className:"rounded-[24px] border border-slate-200/80 bg-slate-50/80 px-6 py-8 text-center text-slate-400",children:"Нет данных за выбранный период"}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"overflow-hidden rounded-[24px] border border-slate-200/80 bg-white p-4",children:e.jsx(I,{style:{height:340,width:"100%"},option:S})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[24px] border border-slate-200/70 bg-slate-50/80 p-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-slate-500",children:"Оборот"}),e.jsx("div",{className:"mt-3 text-2xl font-bold text-slate-950",children:n(w,{fraction:2})})]}),e.jsxs("div",{className:"rounded-[24px] border border-slate-200/70 bg-slate-50/80 p-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-slate-500",children:"Средняя прибыль на неделю"}),e.jsx("div",{className:`mt-3 text-2xl font-bold ${j(s.length>0?x/s.length:null)}`,children:n(s.length>0?x/s.length:null,{fraction:2})})]}),e.jsxs("div",{className:"rounded-[24px] border border-slate-200/70 bg-slate-50/80 p-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-slate-500",children:"Среднее число сделок"}),e.jsx("div",{className:"mt-3 text-2xl font-bold text-slate-950",children:p(s.length>0?b/s.length:null)})]})]}),e.jsx("div",{className:"overflow-x-auto rounded-[24px] border border-slate-200/80 bg-white",children:e.jsxs("table",{className:"w-full min-w-[640px] table-fixed text-sm tabular-nums",children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:"w-[25%]"}),e.jsx("col",{className:"w-[25%]"}),e.jsx("col",{className:"w-[30%]"}),e.jsx("col",{className:"w-[20%]"})]}),e.jsx("thead",{className:"bg-slate-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-4 text-left font-semibold text-slate-700",children:"Неделя"}),e.jsx("th",{className:"p-4 text-left font-semibold text-slate-700",children:"Прибыль"}),e.jsx("th",{className:"p-4 text-left font-semibold text-slate-700",children:"Оборот"}),e.jsx("th",{className:"p-4 text-left font-semibold text-slate-700",children:"Сделок"})]})}),e.jsx("tbody",{children:s.map(t=>e.jsxs("tr",{className:"border-t border-slate-100",children:[e.jsx("td",{className:"p-4 whitespace-nowrap font-medium text-slate-950",children:m(t.week)}),e.jsx("td",{className:`p-4 whitespace-nowrap text-left font-semibold ${j(t.profit)}`,children:n(t.profit,{fraction:2})}),e.jsx("td",{className:"p-4 whitespace-nowrap text-left text-slate-700",children:n(t.turnover,{fraction:2})}),e.jsx("td",{className:"p-4 whitespace-nowrap text-left text-slate-700",children:p(t.trades)})]},t.week))})]})})]})]})]})}),e.jsx(F,{})]})};export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.