PageSourceSearch

https://cfadata.com/assets/index-BTRquRN8.js

js cfadata.com collected 2026-09-25 11:59:35 UTC 32,999 bytes, 3 lines download raw bytes

1import{I as G,_ as K,j as e,d as ee,aG as je,ad as Y,p as w,a9 as x,C as N,b4 as M,b5 as y,dU as oe,T as Q,B as F,ac as P,l as ue,dV as ye,aC as me,u as ve,cu as we,al as Ce,a as Se,dW as le,cb as Re,z as ke}from"./index-Dzola9Kd.js";import{a as g,g as Ie}from"./echarts-DgtDMHXn.js";import{L as Ne}from"./LooseDatePicker-SI-CmKDN.js";import{u as E}from"./useMoneyFormatter-DdARfGZG.js";import{C as $e,a as Oe}from"./ConsoleHeader-By2BNBn8.js";import"./consoleMotifs-HD4rcuuE.js";import{R as se}from"./InfoCircleOutlined-CKx4Bo6Q.js";import{S}from"./index-W8Wq_8PZ.js";import{R as re}from"./DownloadOutlined-Dv-y-NL-.js";import{F as j}from"./Table-H1nqLpkd.js";import{T as D}from"./index-BIhIFrsy.js";import{R as ae}from"./WarningOutlined-CMfv84ln.js";import{R as Fe}from"./PrinterOutlined-BK-vIHi0.js";import{R as ze,a as Le}from"./ArrowUpOutlined-Fiemnlzh.js";import{R as xe}from"./SwapOutlined-CU5hWR18.js";import{E as De}from"./index-CrI3g7Ly.js";import{S as Z}from"./index-C3b1PNE2.js";import"./index-CnQQvX_j.js";import"./ArrowLeftOutlined-B9eHp_u0.js";import"./motifs-BzK3sym4.js";import"./DownOutlined-CsUcB2ZQ.js";var Me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M925.9 804l-24-199.2c-.8-6.6-8.9-9.4-13.6-4.7L829 659.5 557.7 388.3c-6.3-6.2-16.4-6.2-22.6 0L433.3 490 156.6 213.3a8.03 8.03 0 00-11.3 0l-45 45.2a8.03 8.03 0 000 11.3L422 591.7c6.2 6.3 16.4 6.3 22.6 0L546.4 490l226.1 226-59.3 59.3a8.01 8.01 0 004.7 13.6l199.2 24c5.1.7 9.5-3.7 8.8-8.9z"}}]},name:"fall",theme:"outlined"},Pe=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Me}))},he=g.forwardRef(Pe),Ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},Te=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Ee}))},Ae=g.forwardRef(Te),Be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M956 686.5l-.1-.1-.1-.1C911.7 593 843.4 545 752.5 545s-159.2 48.1-203.4 141.3v.1a42.92 42.92 0 000 36.4C593.3 816 661.6 864 752.5 864s159.2-48.1 203.4-141.3c5.4-11.5 5.4-24.8.1-36.2zM752.5 800c-62.1 0-107.4-30-141.1-95.5C645 639 690.4 609 752.5 609c62.1 0 107.4 30 141.1 95.5C860 770 814.6 800 752.5 800z"}},{tag:"path",attrs:{d:"M697 705a56 56 0 10112 0 56 56 0 10-112 0zM136 232h704v253h72V192c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h352v-72H136V232z"}},{tag:"path",attrs:{d:"M724.9 338.1l-36.8-36.8a8.03 8.03 0 00-11.3 0L493 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L251.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.2-3.1 3.2-8.2 0-11.3z"}}]},name:"fund-view",theme:"outlined"},We=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Be}))},qe=g.forwardRef(We),Ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917 211.1l-199.2 24c-6.6.8-9.4 8.9-4.7 13.6l59.3 59.3-226 226-101.8-101.7c-6.3-6.3-16.4-6.2-22.6 0L100.3 754.1a8.03 8.03 0 000 11.3l45 45.2c3.1 3.1 8.2 3.1 11.3 0L433.3 534 535 635.7c6.3 6.2 16.4 6.2 22.6 0L829 364.5l59.3 59.3a8.01 8.01 0 0013.6-4.7l24-199.2c.7-5.1-3.7-9.5-8.9-8.8z"}}]},name:"rise",theme:"outlined"},Ve=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Ye}))},te=g.forwardRef(Ve);const _e=({item:t})=>{const r=t.active;return e.jsxs("button",{type:"button",onClick:t.onSelect,"aria-current":r,className:`group relative flex w-full items-center gap-2.5 rounded-console-sm py-2 pl-3 pr-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-console-accent focus-visible:ring-offset-1 ${t.locked?"cursor-pointer opacity-55 hover:opacity-80":"cursor-pointer"}`,style:{backgroundColor:r?"var(--console-accent-soft)":void 0},children:[e.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 roun
1ded-full transition-all",style:{backgroundColor:"var(--console-accent)",width:r?4:3,height:r?"100%":"60%"},"aria-hidden":!0}),r?e.jsx("span",{className:"absolute right-0 top-0 h-full w-[3px]",style:{backgroundColor:"var(--console-accent)"},"aria-hidden":!0}):null,e.jsx("span",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-console-sm text-[15px] ${t.locked?"bg-console-surface-tint text-console-muted":"bg-console-accent-soft text-console-accent-strong"}`,children:t.icon}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("span",{className:"truncate text-[13px] font-medium leading-5 text-console-ink",children:t.label}),t.note?e.jsx(ee,{title:t.note,children:e.jsx(se,{className:"shrink-0 cursor-help text-[11px] text-console-muted opacity-60"})}):null]}),t.description?e.jsx("span",{className:"block truncate text-[12px] leading-4 text-console-muted",children:t.description}):null]}),t.locked?e.jsx(ee,{title:"开启「高级模式」以解锁(设置 → 高级模式)",children:e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-[12px] text-console-muted",children:e.jsx(je,{})})}):t.metric!==void 0?e.jsxs("span",{className:"shrink-0 text-right",children:[e.jsx("span",{className:"block text-[13px] font-semibold tabular-nums leading-5 text-console-ink",children:t.metric}),t.metricLabel?e.jsx("span",{className:"block text-[11px] leading-4 text-console-muted",children:t.metricLabel}):null]}):null]})},He=({groups:t,className:r})=>e.jsx("div",{className:`flex flex-col ${r??""}`,children:t.map(l=>e.jsxs("div",{className:"mb-1 last:mb-0",children:[e.jsx("div",{className:"flex items-center gap-1.5 px-3 pb-1 pt-2",children:e.jsx("span",{className:"text-[12px] font-medium text-console-muted",children:l.label})}),l.items.map(p=>e.jsx(_e,{item:p},p.id))]},l.key))});var U={exports:{}},Ue=U.exports,ie;function Ge(){return ie||(ie=1,(function(t,r){(function(l,p){t.exports=p()})(Ue,(function(){var l="month",p="quarter";return function(m,h){var o=h.prototype;o.quarter=function(c){return this.$utils().u(c)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(c-1))};var b=o.add;o.add=function(c,u){return c=Number(c),this.$utils().p(u)===p?this.add(3*c,l):b.bind(this)(c,u)};var a=o.startOf;o.startOf=function(c,u){var n=this.$utils(),s=!!n.u(u)||u;if(n.p(c)===p){var f=this.quarter()-1;return s?this.month(3*f).startOf(l).startOf("day"):this.month(3*f+2).endOf(l).endOf("day")}return a.bind(this)(c,u)}}}))})(U)),U.exports}var Ke=Ge();const Qe=Ie(Ke),V=t=>{const r=new URLSearchParams;Object.entries(t).forEach(([p,m])=>{m&&r.set(p,m)});const l=r.toString();return l?`?${l}`:""},_={assetLiability:(t,r)=>Y(`/reports/asset-liability${V({currency:t,modules:r.join(",")})}`),investmentPerformance:t=>Y(`/reports/investment-performance${V({currency:t})}`),debtRepaymentSchedule:t=>Y(`/reports/debt-repayment-schedule${V({currency:t})}`),cashFlowSummary:(t,r)=>Y(`/reports/cash-flow-summary${V({startDate:t,endDate:r})}`)},Je={assets:{cash:0,lending:0,fund:0,stock:0,bond:0,deposit:0,wealth:0,insurance:0,realEstate:0,vehicle:0,total:0},liabilities:{mortgage:0,auto:0,consumer:0,personal:0,business:0,other:0,total:0},netAssets:0,pensionAssets:0},v=t=>Number(t??0),Xe={summary:!0,investment:!0,debt:!1,cashflow:!1},Ze=t=>{const r=t.currency||"CNY",[l,p]=g.useState(Je),[m,h]=g.useState([]),[o,b]=g.useState([]),[a,c]=g.useState({income:0,expense:0,net:0}),[u,n]=g.useState(!0),[s,f]=g.useState(null);return g.useEffect(()=>{let k=!1;n(!0),f(null);const T=t.dateRange?.[0]?.format("YYYY-MM-DD"),I=t.dateRange?.[1]?.format("YYYY-MM-DD");return Promise.all([_.assetLiability(r,t.modules),_.investmentPerformance(r),_.debtRepaymentSchedule(r),_.cashFlowSummary(T,I)]).then(([$,A,J,L])=>{if(k)return;p({assets:Object.fromEntries(Object.entries($.assets||{}).map(([d,C])=>[d,v(C)])),liabilities:Object.fromEntries(Object.entries($.liabilities||{}).map(([d,C])=>[d,v(C)])),netAssets:v($.netAssets),pensionAssets:v($.pensionAssets)}),h(A.filter(()=>t.modules.includes("all")||t.modules.includes("invest")).filter(d=>{const C=t.dateRange?.[0],O=t.dateRange?.[1];return!(d.status==="sold"&&d.soldDate&&C&&w(d.soldDate).isBefore(C,"day")||d.purchaseDate&&O&&w(d.purchaseDate).isAfter(O,"day"))}).map(d=>{const C=v(d.convertedPurchase),O=v(d.convertedCurrent),B=v(d.profit),W=v(d.profitRate),q=d.purchaseDate?w().diff(w(d.purchaseDate),"day"):0;return{...d,convertedPurchase:C,convertedCurrent:O,profit:B,profitRate:W,annualizedReturn:q>0?W/q*365:0}}));const X=J.map(d=>({...d,amount:v(d.amount),remainingPrincipal:v(d.remainingPrincipal)})).filter(d=>d.amount>0).sort((d,C)=>d.date.localeCompare(C.date));b(X),c({income:v(L.income),expense:v(L.expense),net:v(L.net)}),n(!1)}).catch($=>{k||(console.error("报表数据加载失败:",$),f("报表数据加载失败,请稍后重试"),n(!1))}),()=>{k=!0}},[t,r]),{assetLiabilityData:l,investmentPerformanceData:m,debtRepaymentSchedule:o,cashFlowData:a,targetCurrency:r,loading:u,error:s}},ne=(t,r,l)=>{const p=r.map(c=>c.title).join(","),m=l.map(c=>r.map(u=>{let n=c[u.dataIndex];u.render&&(n=u.render(n,c));const s=String(n??"");return s.includes(",")||s.includes('"')||s.includes(`
2`)?`"${s.replace(/"/g,'""')}"`:s}).join(",")),h="\uFEFF"+[p,...m].join(`
3`),o=new Blob([h],{type:"text/csv;charset=utf-8;"}),b=URL.createObjectURL(o),a=document.createElement("a");a.setAttribute("href",b),a.setAttribute("download",`${t}_${new Date().toISOString().split("T")[0]}.csv`),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)},{Text:z}
3=Q,{useBreakpoint:et}=P,tt=({data:t,currency:r,hideZeroAssets:l=!1,onToggleHideZeroAssets:p})=>{const h=!et().md,o=E(),a=[...[{key:"cash",type:"现金/活期",amount:t.assets.cash||0},{key:"lending",type:"借出垫资",amount:t.assets.lending||0},{key:"fund",type:"基金投资",amount:t.assets.fund||0},{key:"stock",type:"股票投资",amount:t.assets.stock||0},{key:"bond",type:"债券投资",amount:t.assets.bond||0},{key:"deposit",type:"定期存款",amount:t.assets.deposit||0},{key:"wealth",type:"银行理财",amount:t.assets.wealth||0},{key:"insurance",type:"保险资产",amount:t.assets.insurance||0},{key:"realEstate",type:"不动产",amount:t.assets.realEstate||0},{key:"vehicle",type:"车辆资产",amount:t.assets.vehicle||0}],{key:"pensionOfWhich",type:"其中:养老资产",amount:t.pensionAssets||0,ofWhich:!0}].filter(s=>!l||s.amount>0),c=[{key:"mortgage",type:"房贷",amount:t.liabilities.mortgage||0},{key:"auto",type:"车贷",amount:t.liabilities.auto||0},{key:"consumer",type:"消费贷",amount:t.liabilities.consumer||0},{key:"personal",type:"个人借款",amount:t.liabilities.personal||0},{key:"business",type:"经营贷款",amount:t.liabilities.business||0},{key:"other",type:"其他债务",amount:t.liabilities.other||0}].filter(s=>!l||s.amount>0),u=[{title:"类别",dataIndex:"type",key:"type",render:(s,f)=>f?.ofWhich?e.jsx("span",{style:{paddingLeft:16},children:s}):s},{title:`金额 (${r})`,dataIndex:"amount",key:"amount",align:"right",render:s=>o(s,r,{showCode:"never"})}],n=()=>{const s=[{title:"项目",dataIndex:"type"},{title:`金额 (${r})`,dataIndex:"amount",render:k=>typeof k=="number"?k.toFixed(2):""}],f=[{type:"--- 资产 ---",amount:0},...a,{type:"资产总计",amount:t.assets.total},{type:"注:养老资产是跨类别的切片,已包含在上述各类中,不重复计入资产总计。",amount:""},{type:"",amount:0},{type:"--- 负债 ---",amount:0},...c,{type:"负债总计",amount:t.liabilities.total},{type:"",amount:0},{type:"净资产",amount:t.netAssets}];ne("资产负债汇总表",s,f)};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(oe,{style:{color:"#1677ff"}}),e.jsx("span",{children:"财务概览"})]}),extra:e.jsxs(x,{wrap:!0,children:[e.jsx(F,{type:l?"primary":"default",onClick:p,children:l?"显示所有项目":"隐藏零值项目"}),e.jsx(F,{icon:e.jsx(re,{}),onClick:n,children:"导出 CSV"})]}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-red-50 to-orange-50 border border-red-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(te,{style:{color:"#ff4d4f"}}),e.jsx("span",{children:"资产总额"})]}),value:t.assets.total,precision:2,valueStyle:{color:"#ff4d4f",fontWeight:600},formatter:s=>o(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-green-50 to-emerald-50 border border-green-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(he,{style:{color:"#52c41a"}}),e.jsx("span",{children:"负债总额"})]}),value:t.liabilities.total,precision:2,valueStyle:{color:"#52c41a",fontWeight:600},formatter:s=>o(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${t.netAssets>=0?"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-100":"bg-gradient-to-br from-amber-50 to-red-50 border-amber-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(oe,{style:{color:t.netAssets>=0?"#1677ff":"#faad14"}}),e.jsx("span",{children:"净资产"})]}),value:t.netAssets,precision:2,valueStyle:{color:t.netAssets>=0?"#1677ff":"#faad14",fontWeight:700},formatter:s=>o(s,r,{showCode:"never"})}),t.assets.total>0&&e.jsxs(z,{type:"secondary",style:{fontSize:"12px"},children:["资产负债率: ",(t.liabilities.total/t.assets.total*100).toFixed(1),"%"]})]})})]})}),e.jsxs(M,{gutter:[20,20],children:[e.jsx(y,{xs:24,md:12,children:e.jsxs(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-red-400 rounded-full"}),e.jsx("span",{children:"资产明细"})]}
3),styles:{header:{borderBottom:"2px solid #fee2e2"}},className:"h-full",children:[e.jsx(j,{dataSource:a,columns:u,pagination:!1,scroll:{x:"max-content"},size:h?"small":"middle",onRow:s=>s?.ofWhich?{style:{backgroundColor:"#fafafa"}}:{},summary:()=>e.jsxs(j.Summary.Row,{children:[e.jsx(j.Summary.Cell,{index:0,children:e.jsx(z,{strong:!0,style:{color:"#ff4d4f"},children:"资产总计"})}),e.jsx(j.Summary.Cell,{index:1,align:"right",children:e.jsx(z,{strong:!0,style:{color:"#ff4d4f"},children:o(t.assets.total,r,{showCode:"never"})})})]})}),e.jsx(z,{type:"secondary",style:{fontSize:"12px",display:"block",marginTop:8},children:"养老资产是跨类别的切片(现金、基金、理财、保险里都可能有一部分),已包含在上述各类中,不重复计入资产总计。"})]})}),e.jsx(y,{xs:24,md:12,children:e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-green-400 rounded-full"}),e.jsx("span",{children:"负债明细"})]}),styles:{header:{borderBottom:"2px solid #dcfce7"}},className:"h-full",children:e.jsx(j,{dataSource:c,columns:u,pagination:!1,scroll:{x:"max-content"},size:h?"small":"middle",summary:()=>e.jsxs(j.Summary.Row,{children:[e.jsx(j.Summary.Cell,{index:0,children:e.jsx(z,{strong:!0,style:{color:"#52c41a"},children:"负债总计"})}),e.jsx(j.Summary.Cell,{index:1,align:"right",children:e.jsx(z,{strong:!0,style:{color:"#52c41a"},children:o(t.liabilities.total,r,{showCode:"never"})})})]})})})})]})]})},{Text:H}=Q,{useBreakpoint:st}=P,rt=({data:t,currency:r})=>{const p=!st().md,m=E(),{advancedMode:h}=ue(),o=t.reduce((n,s)=>({purchase:n.purchase+s.convertedPurchase,current:n.current+s.convertedCurrent,profit:n.profit+s.profit}),{purchase:0,current:0,profit:0}),b=o.purchase!==0?o.profit/o.purchase*100:0,a=t.filter(n=>n.status==="holding").length,c=[{title:"名称",dataIndex:"name",key:"name"},{title:"类型",dataIndex:"type",key:"type",filters:h?[{text:"基金",value:"fund"},{text:"股票",value:"stock"},{text:"定存",value:"deposit"},{text:"债券",value:"bond"}]:void 0,onFilter:h?(n,s)=>s.type===n:void 0,render:n=>({fund:"基金",stock:"股票",deposit:"定存",bond:"债券"})[n]||n},{title:`买入金额 (${r})`,dataIndex:"convertedPurchase",key:"convertedPurchase",align:"right",render:n=>m(n,r,{showCode:"never"}),sorter:(n,s)=>n.convertedPurchase-s.convertedPurchase},{title:`当前市值 (${r})`,dataIndex:"convertedCurrent",key:"convertedCurrent",align:"right",render:n=>m(n,r,{showCode:"never"}),sorter:(n,s)=>n.convertedCurrent-s.convertedCurrent},{title:`盈亏金额 (${r})`,dataIndex:"profit",key:"profit",align:"right",render:n=>e.jsxs(H,{type:n>=0?"danger":"success",children:[n>=0?"+":"",m(n,r,{showCode:"never"})]}),sorter:(n,s)=>n.profit-s.profit},{title:"盈亏率",dataIndex:"profitRate",key:"profitRate",align:"right",render:n=>e.jsxs(D,{color:n>=0?"error":"success",children:[n>=0?"+":"",n.toFixed(2),"%"]}),sorter:(n,s)=>n.profitRate-s.profitRate},{title:"年化收益率",dataIndex:"annualizedReturn",key:"annualizedReturn",align:"right",render:n=>e.jsxs(H,{strong:!0,type:n>=0?"danger":"success",children:[n.toFixed(2),"%"]}),sorter:(n,s)=>n.annualizedReturn-s.annualizedReturn},{title:"状态",dataIndex:"status",key:"status",render:n=>e.jsx(D,{color:n==="holding"?"blue":"default",children:n==="holding"?"持有中":"已卖出"}),filters:[{text:"持有中",value:"holding"},{text:"已卖出",value:"sold"}],onFilter:(n,s)=>s.status===n}],u=()=>{ne("投资业绩报表",[{title:"名称",dataIndex:"name"},{title:"类型",dataIndex:"type"},{title:"买入金额",dataIndex:"convertedPurchase",render:s=>s.toFixed(2)},{title:"当前市值",dataIndex:"convertedCurrent",render:s=>s.toFixed(2)},{title:"盈亏金额",dataIndex:"profit",render:s=>s.toFixed(2)},{title:"盈亏率(%)",dataIndex:"profitRate",render:s=>s.toFixed(2)},{title:"年化收益率(%)",dataIndex:"annualizedReturn",render:s=>s.toFixed(2)},{title:"状态",dataIndex:"status"}],t)};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(me,{style:{color:"#722ed1"}}),e.jsx("span",{children:"投资业绩概览"})]}),extra:h&&e.jsx(F,{icon:e.jsx(re,{}),onClick:u,children:"导出 CSV"}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-purple-50 to-violet-50 border border-purple-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ye,{style:{color:"#722ed1"}}),e.jsx("span",{children:"投入本金"})]}),value:o.purchase,precision:2,valueStyle:{color:"#722ed1",fontWeight:600},formatter:n=>m(n,r,{showCode:"never"})}),e.jsxs(H,{type:"secondary",style:{fontSize:"12px"},children:["持仓: ",a," / ",t.length," 项"]})]})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-indigo-50 to-blue-50 border border-indigo-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(te,{style:{color:"#1677ff"}}),e.jsx("span",{children:"当前市值"})]}),value:o.current,precision:2,valueStyle:{color:"#1677ff",fontWeight:600},formatter:n=>m(n,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${o.profit>=0?"bg-gradient-to-br from-red-50 to-orange-50 border-red-100":"bg-gradient-to-br from-green-50 to-emerald-50 border-green-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[o.profit>=0?e.jsx(te,{style:{color:"#ff4d4f"}}):e.jsx(he,{style:{color:"#52c41a"}}),e.jsx("span",{children:"累计盈亏"})]}),value:o.profit,precision:2,valueStyle:{color:o.profit>=0?"#ff4d4f":"#52c41a",fontWeight:700},formatter:n=>`${o.profit>=0?"+":""}${m(n,r,{showCode:"never"})}`}),e.jsxs(D,{color:b>=0?"error":"success",style:{marginTop:4},children:[b>=0?"+":"",b.toFixed(2),"% 收益率"]})]})})]})}),e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-purple-400 rounded-full"}),e.jsx("span",{children:"投资业绩明细"})]}
3),styles:{header:{borderBottom:"2px solid #f3e8ff"}},children:e.jsx(j,{dataSource:t,columns:c,rowKey:"id",scroll:{x:"max-content"},size:p?"small":"middle",summary:()=>e.jsxs(j.Summary.Row,{style:{background:"#fafafa",fontWeight:"bold"},children:[e.jsx(j.Summary.Cell,{index:0,colSpan:2,children:"汇总"}),e.jsx(j.Summary.Cell,{index:2,align:"right",children:m(o.purchase,r,{showCode:"never"})}),e.jsx(j.Summary.Cell,{index:3,align:"right",children:m(o.current,r,{showCode:"never"})}),e.jsx(j.Summary.Cell,{index:4,align:"right",children:e.jsxs(H,{type:o.profit>=0?"danger":"success",children:[o.profit>=0?"+":"",m(o.profit,r,{showCode:"never"})]})}),e.jsx(j.Summary.Cell,{index:5,align:"right",children:e.jsxs(D,{color:b>=0?"error":"success",children:[b>=0?"+":"",b.toFixed(2),"%"]})}),e.jsx(j.Summary.Cell,{index:6,colSpan:2})]})})})]})},{Text:ce}=Q,{useBreakpoint:nt}=P,ot=({data:t,currency:r})=>{const p=!nt().md,m=E(),h=ve(),o=t.reduce((s,f)=>s+(f.amount||0),0),b=new Set(t.map(s=>s.name)).size,a=t.length>0?o/12:0,c=[{title:"还款日期",dataIndex:"date",key:"date",sorter:(s,f)=>s.date.localeCompare(f.date)},{title:"债务名称",dataIndex:"name",key:"name",render:s=>e.jsx(F,{type:"link",onClick:()=>h("/assets/debts"),style:{padding:0},children:s})},{title:"债权人",dataIndex:"creditor",key:"creditor"},{title:`本期应还 (${r})`,dataIndex:"amount",key:"amount",align:"right",render:s=>e.jsx(ce,{strong:!0,type:"success",children:m(s,r,{showCode:"never"})})},{title:`剩余本金 (${r})`,dataIndex:"remainingPrincipal",key:"remainingPrincipal",align:"right",render:s=>m(s,r,{showCode:"never"})}],u=()=>{ne("未来12个月还款计划",[{title:"还款日期",dataIndex:"date"},{title:"债务名称",dataIndex:"name"},{title:"债权人",dataIndex:"creditor"},{title:"本期应还",dataIndex:"amount",render:f=>f.toFixed(2)},{title:"剩余本金",dataIndex:"remainingPrincipal",render:f=>f.toFixed(2)}],t)},n=()=>{window.print()};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(ae,{style:{color:"#faad14"}}),e.jsx("span",{children:"还款计划概览"}),e.jsx(ee,{title:"基于当前债务设置模拟生成,仅供参考",children:e.jsx(se,{style:{color:"#1677ff"}})})]}),extra:e.jsxs(x,{children:[e.jsx(F,{icon:e.jsx(Fe,{}),onClick:n,children:"打印"}),e.jsx(F,{icon:e.jsx(re,{}),onClick:u,type:"primary",children:"导出 CSV"})]}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-amber-50 to-yellow-50 border border-amber-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(we,{style:{color:"#faad14"}}),e.jsx("span",{children:"待还笔数"})]}),value:t.length,suffix:"笔",valueStyle:{color:"#faad14",fontWeight:600}}),e.jsxs(ce,{type:"secondary",style:{fontSize:"12px"},children:["涉及 ",b," 项债务"]})]})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-orange-50 to-red-50 border border-orange-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(Ce,{style:{color:"#f5222d"}}),e.jsx("span",{children:"预计总还款"})]}),value:o,precision:2,valueStyle:{color:"#f5222d",fontWeight:600},formatter:s=>m(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-cyan-50 to-blue-50 border border-cyan-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ae,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"月均还款"})]}),value:a,precision:2,valueStyle:{color:"#13c2c2",fontWeight:700},formatter:s=>m(s,r,{showCode:"never"})}),e.jsx(D,{color:"blue",style:{marginTop:4},children:"未来 12 个月"})]})})]})}),e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-amber-400 rounded-full"}),e.jsx("span",{children:"未来 12 个月还款计划"})]}),styles:{header:{borderBottom:"2px solid #fef3c7"}},children:e.jsx(j,{dataSource:t,columns:c,rowKey:"id",pagination:{pageSize:12},scroll:{x:"max-content"},size:p?"small":"middle"})})]})},{Paragraph:lt,Text:at}
3=Q,{useBreakpoint:it}=P,ct=({data:t,currency:r})=>{const p=!it().md,m=E(),h=t.income!==0||t.expense!==0;return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs(N,{title:e.jsxs(x,{children:[e.jsx(qe,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"现金流概览"})]}),styles:{body:{padding:"20px"}},children:[e.jsx(lt,{type:"secondary",style:{marginTop:0},children:"基于筛选期间内的活动日志统计。定义:新增资产视为流出,删除资产视为流入(销账/变现)。"}),e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-green-50 to-emerald-50 border border-green-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ze,{style:{color:"#52c41a"}}),e.jsx("span",{children:"期间总流入"})]}),value:t.income,precision:2,valueStyle:{color:"#52c41a",fontWeight:600},formatter:o=>m(Number(o),r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-red-50 to-orange-50 border border-red-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(Le,{style:{color:"#ff4d4f"}}),e.jsx("span",{children:"期间总流出"})]}),value:t.expense,precision:2,valueStyle:{color:"#ff4d4f",fontWeight:600},formatter:o=>m(Number(o),r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${t.net>=0?"bg-gradient-to-br from-cyan-50 to-blue-50 border-cyan-100":"bg-gradient-to-br from-rose-50 to-red-50 border-rose-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(xe,{style:{color:t.net>=0?"#13c2c2":"#f5222d"}}),e.jsx("span",{children:"净现金流"})]}),value:t.net,precision:2,valueStyle:{color:t.net>=0?"#13c2c2":"#f5222d",fontWeight:700},formatter:o=>m(Number(o),r,{showCode:"never"})}),h&&t.income>0&&e.jsxs(at,{type:"secondary",style:{fontSize:"12px"},children:["净流入率: ",((t.income-t.expense)/t.income*100).toFixed(1),"%"]})]})})]}),!h&&e.jsx(De,{description:"筛选期间内暂无现金流记录",style:{marginTop:24}})]}),e.jsx(N,{title:e.jsxs(x,{size:p?4:8,children:[e.jsx("div",{className:"w-1 h-4 bg-cyan-400 rounded-full"}),e.jsx(se,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"计算规则说明"})]}),styles:{header:{borderBottom:"2px solid #cffafe"}},size:p?"small":"default",children:e.jsxs("ul",{style:{paddingLeft:20,color:"rgba(0, 0, 0, 0.45)",margin:0},children:[e.jsx("li",{style:{marginBottom:8},children:"数据来源于「活动日志」模块的实时记录。"}),e.jsxs("li",{style:{marginBottom:8},children:[e.jsx("strong",{children:"流入"}),":包括资产删除(如借款收回、资产卖出等产生的记录)。"]}),e.jsxs("li",{style:{marginBottom:8},children:[e.jsx("strong",{children:"流出"}),":包括新增资产(如现金增加、购入股票、购买房产等产生的记录)。"]}),e.jsx("li",{children:"注意:账户间互转等内部资金流动暂未单独剔除,统计时可能重复计入。"})]})})]})};w.extend(Qe);const{RangePicker:dt}=Ne,{useBreakpoint:ut}=P,mt=[{label:"全部模块",value:"all"},{label:"流动钱包",value:"liquid"},{label:"财富引擎",value:"invest"},{label:"保险保障",value:"insurance"},{label:"硬核资产",value:"physical"},{label:"信用盾牌",value:"credit"}],xt=[{label:"本月",value:[w().startOf("month"),w().endOf("month")]},{label:"本季度",value:[w().startOf("quarter"),w().endOf("quarter")]},{label:"本年",value:[w().startOf("year"),w().endOf("year")]}],de={summary:"资产与负债按所选币种汇率折算后汇总;覆盖现金 / 借出 / 基金 / 股票 / 债券 / 定存 / 理财 / 保险 / 房产 / 车辆,不含数字宝藏。",investment:"按模块筛选(全部 / 财富引擎)展示持仓盈亏;已卖出且不在时间范围内的持仓不计入。"},Mt=()=>{const r=!ut().md,l=E(),{currencies:p,mainCurrency:m}=Se(),{advancedMode:h}=ue(),[o,b]=g.useState(!1),[a,c]=g.useState({dateRange:[w().startOf("month"),w().endOf("month")],modules:["all"],currency:m.code}),[u,n]=g.useState("summary"),{assetLiabilityData:s,investmentPerformanceData:f,debtRepaymentSchedule:k,cashFlowData:T,targetCurrency:I,loading:$,error:A}=Ze(a);g.useEffect(()=>{!h&&(u==="debt"||u==="cashflow")&&n("summary")}
3,[h,u]);const J=i=>{c({...a,dateRange:i})},L=i=>{i.includes("all")&&!a.modules.includes("all")?c({...a,modules:["all"]}):i.length>1&&i.includes("all")?c({...a,modules:i.filter(R=>R!=="all")}):i.length===0?c({...a,modules:["all"]}):c({...a,modules:i})},X=i=>{c({...a,currency:i})},d=(i,R)=>{if(R){ke.info("开启「高级模式」后可解锁债务还款计划与现金流汇总(设置 → 高级模式)");return}n(i)},C=s.netAssets,O=f.reduce((i,R)=>({purchase:i.purchase+(R.convertedPurchase||0),profit:i.profit+(R.profit||0)}),{purchase:0,profit:0}),B=O.purchase!==0?O.profit/O.purchase*100:0,W=k.reduce((i,R)=>i+(R.amount||0),0),q=T.net,pe=[{key:"basic",label:"基础报表",items:[{id:"summary",label:"资产负债汇总",icon:e.jsx(le,{}),description:"资产 / 负债 / 净资产",note:de.summary,metric:l(C,I,{showCode:"never"}),metricLabel:"净资产",active:u==="summary",onSelect:()=>d("summary",!1)},{id:"investment",label:"投资业绩报表",icon:e.jsx(me,{}),description:"持仓盈亏与收益率",note:de.investment,metric:`${B>=0?"+":""}${B.toFixed(1)}%`,metricLabel:"收益率",active:u==="investment",onSelect:()=>d("investment",!1)}]},{key:"advanced",label:"高级报表",items:[{id:"debt",label:"债务还款计划",icon:e.jsx(Ae,{}),description:"未来 12 个月还款",metric:l(W,I,{showCode:"never"}),metricLabel:"待还总额",locked:!h,active:u==="debt",onSelect:()=>d("debt",!h)},{id:"cashflow",label:"现金流汇总",icon:e.jsx(xe,{}),description:"期间流入 / 流出",metric:l(q,I,{showCode:"never"}),metricLabel:"净现金流",locked:!h,active:u==="cashflow",onSelect:()=>d("cashflow",!h)}]}],fe=Xe[u]===!1&&!(a.modules.length===1&&a.modules[0]==="all"),ge=()=>{switch(u){case"summary":return e.jsx(tt,{data:s,currency:I,hideZeroAssets:o,onToggleHideZeroAssets:()=>b(i=>!i)});case"investment":return e.jsx(rt,{data:f,currency:I});case"debt":return e.jsx(ot,{data:k,currency:I});case"cashflow":return e.jsx(ct,{data:T,currency:I});default:return null}},be=[{value:"summary",label:"资产负债汇总"},{value:"investment",label:"投资业绩报表"},{value:"debt",label:"债务还款计划",disabled:!h},{value:"cashflow",label:"现金流汇总",disabled:!h}];return e.jsxs($e,{motif:"reports",children:[e.jsx(Oe,{title:"报表中心",subtitle:"全面透视您的资产分布、投资收益及未来现金流",icon:e.jsx(le,{})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-console border border-console-border bg-console-surface px-3 py-2",children:[e.jsx(dt,{value:a.dateRange,onChange:J,className:"w-full sm:w-auto",size:"small"}),e.jsx(x,{size:4,wrap:!0,children:xt.map(i=>{const R=a.dateRange?.[0]?.isSame(i.value[0],"day")&&a.dateRange?.[1]?.isSame(i.value[1],"day");return e.jsx(F,{size:"small",type:R?"primary":"default",onClick:()=>c({...a,dateRange:i.value}),children:i.label},i.label)})}),e.jsx(Z,{mode:"multiple",size:"small",className:"min-w-[140px] flex-1 sm:flex-none",placeholder:"选择统计模块",maxTagCount:"responsive",value:a.modules,onChange:L,options:mt}),e.jsx(Z,{size:"small",className:"w-[120px]",value:a.currency,onChange:X,showSearch:!0,optionFilterProp:"label",options:p.map(i=>({label:`${i.name} (${i.code})`,value:i.code}))})]}),e.jsxs("div",{className:"flex gap-3 lg:gap-4",children:[e.jsx("aside",{className:"hidden w-[224px] shrink-0 rounded-console border border-console-border bg-console-surface p-1.5 md:flex md:flex-col lg:w-[296px]",children:e.jsx(He,{groups:pe})}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[r?e.jsx(Z,{value:u,onChange:i=>d(i,!h&&(i==="debt"||i==="cashflow")),options:be,className:"w-full"}):null,fe?e.jsx("div",{className:"rounded-console border border-console-border bg-console-surface-tint px-3 py-2 text-[13px] text-console-muted",children:"本报表不按模块统计,顶部「模块」筛选对其不生效;时间范围与币种仍然有效。"}):null,A?e.jsxs("div",{className:"rounded-console border border-console-border bg-console-surface px-3 py-6 text-center",children:[e.jsx("p",{className:"text-[14px] font-medium text-console-ink",children:A}),e.jsx("p",{className:"mt-1 text-[13px] text-console-muted",children:"当前展示的 0 值不代表实际数据,请重试或稍后再来。"})]}):$?e.jsxs("div",{className:"rounded-console border border-console-border bg-console-surface px-3 py-10 text-center",children:[e.jsx(Re,{size:"small"}),e.jsx("p",{className:"mt-2 text-[13px] text-console-muted",children:"正在加载报表数据…"})]}):ge()]})]})]})};export{Mt 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.