Files
accountbook/frontend/.next/server/chunks/261.js
T
DeveloperandClaude Opus 4.6 3347a256b2 Initial commit: accountbook project
- Node.js backend server
- Frontend application
- Backup script
- Project specification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:24:10 +08:00

1 line
13 KiB
JavaScript

exports.id=261,exports.ids=[261],exports.modules={1712:(e,r,n)=>{"use strict";n.d(r,{Z:()=>l});var t=n(997),o=n(6689),s=n(1163),i=n(349);let a=[{href:"/",label:"首页",icon:"home"},{href:"/stats",label:"统计",icon:"chart"},{href:"/recurring",label:"周期",icon:"repeat"},{href:"/categories",label:"分类",icon:"tags"}];function l({title:e,subtitle:r,actions:n,headerContent:l,children:c,contentClassName:d="",hideNav:u=!1,compactHeader:h=!1}){let p=(0,s.useRouter)(),k=(0,o.useMemo)(()=>{let e=a.find(e=>e.href===p.pathname);return e?.href||null},[p.pathname]),f=l||(e?(0,t.jsxs)("div",{className:"app-header__text",children:[t.jsx("h1",{children:e}),r?t.jsx("p",{children:r}):null]}):null),x=["app-header",h?"app-header--compact":"",f?"app-header--with-content":"app-header--actions-only",n?"app-header--with-actions":""].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:`app-shell${u?" app-shell--standalone":""}`,children:[t.jsx("header",{className:x,children:(0,t.jsxs)("div",{className:"app-shell__container app-header__inner",children:[f?t.jsx("div",{className:"app-header__main",children:f}):t.jsx("div",{className:"app-header__spacer","aria-hidden":"true"}),n?t.jsx("div",{className:"app-header__actions",children:n}):null]})}),t.jsx("main",{className:`app-content ${d}`.trim(),children:t.jsx("div",{className:"app-shell__container app-content__inner",children:c})}),u?null:t.jsx("nav",{className:"bottom-nav","aria-label":"主导航",children:t.jsx("div",{className:"app-shell__container bottom-nav__inner",children:a.map(e=>{let r=k===e.href;return(0,t.jsxs)("button",{type:"button",className:`bottom-nav__item${r?" is-active":""}`,onClick:()=>p.push(e.href),"aria-current":r?"page":void 0,children:[t.jsx(i.J,{name:e.icon,size:20}),t.jsx("span",{children:e.label})]},e.href)})})})]})}},4407:(e,r,n)=>{"use strict";n.d(r,{N:()=>l,W:()=>a});var t=n(997),o=n(6689),s=n(349);let i=(0,o.createContext)(null);function a({children:e}){let[r,n]=(0,o.useState)(null),a=(0,o.useCallback)(e=>new Promise(r=>{n({title:e.title||"请确认操作",description:e.description||"",confirmText:e.confirmText||"确认",cancelText:e.cancelText||"取消",tone:e.tone||"danger",resolve:r})}),[]),l=(0,o.useCallback)(e=>{n(r=>(r?.resolve(e),null))},[]),c=(0,o.useMemo)(()=>({confirm:a}),[a]);return(0,t.jsxs)(i.Provider,{value:c,children:[e,r?t.jsx("div",{className:"modal-overlay modal-overlay--center",onClick:()=>l(!1),children:(0,t.jsxs)("div",{className:"confirm-card",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",children:[t.jsx("div",{className:`confirm-card__icon confirm-card__icon--${r.tone}`,children:t.jsx(s.J,{name:"danger"===r.tone?"trash":"info",size:18})}),(0,t.jsxs)("div",{className:"confirm-card__body",children:[t.jsx("h2",{id:"confirm-title",children:r.title}),r.description?t.jsx("p",{children:r.description}):null]}),(0,t.jsxs)("div",{className:"confirm-card__actions",children:[t.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>l(!1),children:r.cancelText}),t.jsx("button",{type:"button",className:`btn ${"danger"===r.tone?"btn-danger":"btn-primary"}`,onClick:()=>l(!0),children:r.confirmText})]})]})}):null]})}function l(){let e=(0,o.useContext)(i);if(!e)throw Error("useConfirm must be used within ConfirmProvider");return e}},4190:(e,r,n)=>{"use strict";n.d(r,{V:()=>a,p:()=>l});var t=n(997),o=n(6689),s=n(349);let i=(0,o.createContext)(null);function a({children:e}){let[r,n]=(0,o.useState)([]),a=(0,o.useRef)(new Map),l=(0,o.useCallback)(e=>{let r=a.current.get(e);r&&(clearTimeout(r),a.current.delete(e)),n(r=>r.filter(r=>r.id!==e))},[]),c=(0,o.useCallback)((e,r={})=>{let t=`${Date.now()}-${Math.random()}`,o={id:t,message:e,tone:r.tone||"info"};n(e=>[...e,o]);let s=setTimeout(()=>l(t),r.duration??2600);return a.current.set(t,s),t},[l]),d=(0,o.useMemo)(()=>({showToast:c,removeToast:l}),[c,l]);return(0,t.jsxs)(i.Provider,{value:d,children:[e,t.jsx("div",{className:"toast-stack","aria-live":"polite","aria-atomic":"true",children:r.map(e=>(0,t.jsxs)("div",{className:`toast toast--${e.tone}`,children:[t.jsx("span",{className:"toast__icon",children:t.jsx(s.J,{name:"success"===e.tone?"check":"error"===e.tone?"close":"info",size:16})}),t.jsx("span",{className:"toast__message",children:e.message}),t.jsx("button",{type:"button",className:"icon-button icon-button--ghost toast__close","aria-label":"关闭提示",onClick:()=>l(e.id),children:t.jsx(s.J,{name:"close",size:16})})]},e.id))})]})}function l(){let e=(0,o.useContext)(i);if(!e)throw Error("useToast must be used within ToastProvider");return e}},349:(e,r,n)=>{"use strict";n.d(r,{J:()=>i});var t=n(997),o=n(6689);let s={home:t.jsx("path",{d:"M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5.5v-6h-5v6H4a1 1 0 0 1-1-1v-9.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),chart:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M7 16v-4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M12 16V8",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M17 16v-7",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),repeat:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M17 3l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M3 7h18",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M7 21l-4-4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M21 17H3",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),tags:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M11 4H5a2 2 0 0 0-2 2v6l8.5 8.5a2.1 2.1 0 0 0 3 0l6-6a2.1 2.1 0 0 0 0-3L12 4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("circle",{cx:"7.5",cy:"8.5",r:"1.2",fill:"currentColor"})]}),settings:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M12 8.5A3.5 3.5 0 1 0 12 15.5A3.5 3.5 0 1 0 12 8.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),t.jsx("path",{d:"M19.4 15a1 1 0 0 0 .2 1.1l.1.1a2 2 0 0 1-2.8 2.8l-.1-.1a1 1 0 0 0-1.1-.2 1 1 0 0 0-.6.9V20a2 2 0 0 1-4 0v-.2a1 1 0 0 0-.6-.9 1 1 0 0 0-1.1.2l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1 1 0 0 0 .2-1.1 1 1 0 0 0-.9-.6H4a2 2 0 0 1 0-4h.2a1 1 0 0 0 .9-.6 1 1 0 0 0-.2-1.1l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1 1 0 0 0 1.1.2 1 1 0 0 0 .6-.9V4a2 2 0 0 1 4 0v.2a1 1 0 0 0 .6.9 1 1 0 0 0 1.1-.2l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1 1 0 0 0-.2 1.1 1 1 0 0 0 .9.6H20a2 2 0 0 1 0 4h-.2a1 1 0 0 0-.4 1Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),search:(0,t.jsxs)(t.Fragment,{children:[t.jsx("circle",{cx:"11",cy:"11",r:"6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),t.jsx("path",{d:"m16 16 4.5 4.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),plus:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M12 5v14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),chevronLeft:t.jsx("path",{d:"m14.5 6-5 6 5 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),chevronRight:t.jsx("path",{d:"m9.5 6 5 6-5 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),close:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M6 6l12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M18 6 6 18",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),trash:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M4 7h16",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M9 4h6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M7 7l1 12a1 1 0 0 0 1 .9h6a1 1 0 0 0 1-.9l1-12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M10 11v5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"M14 11v5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),logout:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M10 5H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M14 8l5 4-5 4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M19 12H9",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),download:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M12 4v10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"m8 10 4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M5 19h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),upload:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M12 20V10",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("path",{d:"m8 14 4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M5 5h14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]}),check:t.jsx("path",{d:"m5 12 4.2 4.2L19 7",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),info:(0,t.jsxs)(t.Fragment,{children:[t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),t.jsx("path",{d:"M12 10v5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"7.25",r:"1",fill:"currentColor"})]}),spinner:(0,t.jsxs)(t.Fragment,{children:[t.jsx("path",{d:"M12 3a9 9 0 1 1-6.36 2.64",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",opacity:"0.28"}),t.jsx("path",{d:"M5.64 5.64A9 9 0 0 1 12 3",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})};function i({name:e,size:r=20,className:n="",title:t}){return(0,o.createElement)("svg",{viewBox:"0 0 24 24",width:r,height:r,className:n,"aria-hidden":t?void 0:"true",role:t?"img":"presentation",fill:"none"},t?(0,o.createElement)("title",null,t):null,s[e]||s.info)}},7751:(e,r,n)=>{"use strict";async function t(e,r={}){let n=await fetch(`${e}`,{...r,headers:{"Content-Type":"application/json",...r.headers}}),t=await n.json();if(!n.ok)throw Error(t.error||"请求失败");return t}async function o(e,r){return await t("/api/auth/login",{method:"POST",body:JSON.stringify({username:e,password:r})})}async function s(e,r){return await t("/api/auth/register",{method:"POST",body:JSON.stringify({username:e,password:r})})}function i(){}async function a(e,r="all"){let n=`/api/records?month=${e}`;return"all"!==r&&(n+=`&type=${r}`),t(n)}async function l(e){return t(`/api/stats?month=${e}`)}async function c(e){return t("/api/records",{method:"POST",body:JSON.stringify(e)})}async function d(e,r){return t(`/api/records/${e}`,{method:"PUT",body:JSON.stringify(r)})}async function u(e){return t(`/api/records/${e}`,{method:"DELETE"})}async function h(e){return t(`/api/records/search?q=${encodeURIComponent(e)}`)}async function p(e="month",r){let n=`/api/stats/trend?period=${e}`;return r&&(n+=`&month=${r}`),t(n)}async function k(e,r="all"){let n=`/api/stats/category?type=${r}`;return e&&(n+=`&month=${e}`),t(n)}async function f(){return t("/api/recurring")}async function x(e){return t("/api/recurring",{method:"POST",body:JSON.stringify(e)})}async function m(e,r){return t(`/api/recurring/${e}`,{method:"PUT",body:JSON.stringify(r)})}async function j(e){return t(`/api/recurring/${e}`,{method:"DELETE"})}async function C(e){return t(`/api/recurring/${e}/apply`,{method:"POST"})}async function y(){return t("/api/categories")}async function v(e){return t("/api/categories",{method:"POST",body:JSON.stringify(e)})}async function g(e){return t(`/api/categories/${e}`,{method:"DELETE"})}async function L(){return t("/api/export")}async function b(e){return t("/api/import",{method:"POST",body:JSON.stringify(e)})}n.d(r,{Ap:()=>k,CP:()=>y,JS:()=>u,Kp:()=>h,Q6:()=>a,TZ:()=>j,Vn:()=>f,Vs:()=>d,Xu:()=>C,ae:()=>c,dk:()=>b,fy:()=>l,gR:()=>p,k4:()=>v,kS:()=>i,u1:()=>L,uO:()=>m,uu:()=>g,x4:()=>o,z0:()=>x,z2:()=>s})},3414:(e,r,n)=>{"use strict";n.r(r),n.d(r,{default:()=>i});var t=n(997);n(6764);var o=n(4190),s=n(4407);function i({Component:e,pageProps:r}){return t.jsx(s.W,{children:t.jsx(o.V,{children:t.jsx(e,{...r})})})}},6764:()=>{}};