PageSourceSearch

https://www.etfinfo.tw/_nuxt/KEwtQi_b.js

js etfinfo.tw collected 2026-09-25 03:40:41 UTC 24,568 bytes, 1 lines download raw bytes

1import{d as le,e as u,f as e,G as T,k as n,F as w,j as W,y as f,o as i,t as a,p as k,q as oe,T as ee,aj as Ae,x as te,n as _,a0 as Ee,a1 as ne,$ as ve,h as E,a3 as Te,u as Se,P as xe,Q as Ne,R as Ie,b as Me,g as R,w as B,m as Pe,_ as Re,a4 as qe,r as Fe}from"./DgKpLXVQ.js";import{i as se,b as Ve,a as ze,f as $,c as We,s as Oe,d as pe,_ as Be,e as je,g as Ge}from"./AQT7CZhV.js";import{u as Ue}from"./CLDz70AZ.js";import{r as He}from"./DCKqD10M.js";const Ye={class:"performance-calendar","aria-label":"每日投資損益日曆"},Ze={class:"calendar-toolbar"},Ke={class:"mode-toggle","aria-label":"日曆顯示方式"},Xe={class:"weekday-row","aria-hidden":"true"},Qe={class:"calendar-grid"},Je=["aria-label","disabled","aria-haspopup","onClick"],et={class:"day-number"},tt={key:0},nt={key:1,class:"no-data"},st={key:1,class:"calendar-cell spacer"},lt=le({__name:"InvestmentPerformanceCalendar",props:{month:{},days:{},selectedDate:{}},emits:["select"],setup(c,{emit:C}){const m=c,N=C,b=f("profit"),d=k(()=>Ve(m.month,m.days));function S(g){if(!g)return"empty";if(g.status==="pending")return"flat";const y=b.value==="profit"?g.profitLoss:g.returnRate??0;return y>0?"up":y<0?"down":"flat"}function D(g){return se(g,b.value)}return(g,y)=>(i(),u("section",Ye,[e("header",Ze,[y[2]||(y[2]=e("div",null,[e("p",{class:"calendar-kicker"},"DAILY PERFORMANCE"),e("h2",null,"每日損益")],-1)),e("div",Ke,[e("button",{type:"button",class:T({active:n(b)==="profit"}),onClick:y[0]||(y[0]=s=>b.value="profit")},"損益",2),e("button",{type:"button",class:T({active:n(b)==="return"}),onClick:y[1]||(y[1]=s=>b.value="return")},"日報酬率",2)])]),e("div",Xe,[(i(),u(w,null,W(["一","二","三","四","五"],s=>e("span",{key:s},a(s),1)),64))]),e("div",Qe,[(i(!0),u(w,null,W(n(d),s=>(i(),u(w,{key:s.key},[s.date?(i(),u("button",{key:0,type:"button",class:T(["calendar-cell",S(s.performance),{selected:c.selectedDate===s.date,pending:s.performance?.status==="pending"}]),"aria-label":s.performance?`${s.date} ${D(s.performance)}`:`${s.date} 無損益資料`,disabled:!s.performance,"aria-haspopup":s.performance?"dialog":void 0,onClick:r=>N("select",s.date)},[e("span",et,a(s.day),1),s.performance?(i(),u("strong",tt,a(D(s.performance)),1)):(i(),u("span",nt,"—"))],10,Je)):(i(),u("div",st))],64))),128))]),y[3]||(y[3]=e("p",{class:"calendar-note"},"點日期查看當天明細;「待更新」表示還不能計算,不代表損益為 0。",-1))]))}}),ot=oe(lt,[["__scopeId","data-v-83861189"]]),at={class:"day-detail-header"},it={class:"day-detail-body"},ut={key:0,class:"detail-notice"},rt={class:"day-result"},dt={key:1,class:"detail-list"},ct={key:2,class:"detail-list"},pt=le({__name:"InvestmentDayDetailDialog",props:{day:{},events:{}},emits:["close"],setup(c,{emit:C}){const m=c,N=C,b=f(null),d=f(null),S=k(()=>m.day!==null);Ue(S),ee(()=>m.day,async()=>{await Te(),m.day&&!b.value?.open?b.value?.showModal():!m.day&&b.value?.open&&b.value.close()},{flush:"post",immediate:!0}),Ae(()=>b.value?.close());function D(s){if(!b.value||s.target!==b.value)return;const r=b.value.getBoundingClientRect();(s.clientX<r.left||s.clientX>r.right||s.clientY<r.top||s.clientY>r.bottom)&&N("close")}function g(s){return s==null||s===0?"":s>0?"positive-value":"negative-value"}function y(s){if(s.type==="position_adjustment")return`${s.targetShares??"—"} 股${s.totalCost==null?"":` · 總成本 ${$(Number(s.totalCost))} 元`}`;if(s.type==="cost_adjustment")return`總成本 ${$(Number(s.totalCost))} 元`;if(s.type==="income_adjustment")return`${$(Number(s.cashAmount),!0)} 元`;if(s.type==="bonus_share_adjustment")return`${s.shares??"0"} 股/${$(Number(s.cashAmount??0),!0)} 元`;if(s.type==="bonus_share_settlement")return`${s.shares??"0"} 股入帳${s.cashAmount==null?"":`/畸零款 ${$(Number(s.cashAmount))} 元`}`;if(s.type==="corporate_action_override"){const r=[];return s.cashAmount!=null&&r.push(`實收現金 ${$(Number(s.cashAmount))} 元`),s.shares!=null&&r.push(`實收 ${s.shares} 股`),s.fractionalCashAmount!=null&&r.push(`畸零款 ${$(Number(s.fractionalCashAmount))} 元`),r.join("/")||"沿用公開資料"}return(s.type==="buy"||s.type==="sell")&&s.price!=null?`${s.shares??"—"}
1 股 × ${Number(s.price).toLocaleString("zh-TW",{maximumFractionDigits:4})} 元`:`${s.shares??"—"} 股`}return(s,r)=>(i(),te(ve,{to:"body"},[e("dialog",{ref_key:"dialog",ref:b,class:"day-detail-dialog","aria-labelledby":"investment-day-title",onCancel:r[1]||(r[1]=ne(h=>N("close"),["prevent"])),onKeydown:r[2]||(r[2]=Ee(ne(h=>n(d)?.focus(),["prevent"]),["tab"])),onClick:D},[c.day?(i(),u(w,{key:0},[e("header",at,[e("div",null,[e("span",null,a(c.day.date),1),r[3]||(r[3]=e("h2",{id:"investment-day-title"},"當日明細",-1))]),e("button",{ref_key:"closeButton",ref:d,type:"button",class:"close-button","aria-label":"關閉當日明細",autofocus:"",onClick:r[0]||(r[0]=h=>N("close"))},"×",512)]),e("div",it,[c.day.status==="pending"?(i(),u("p",ut,a(n(ze)(c.day))+"。你不需要修改持股,盤後資料到齊後即可查看損益。",1)):_("",!0),e("div",rt,[e("div",null,[r[4]||(r[4]=e("span",null,"損益",-1)),e("strong",{class:T(g(c.day.status==="pending"?null:c.day.profitLoss))},a(n(se)(c.day,"profit")),3)]),e("div",null,[r[5]||(r[5]=e("span",null,"日報酬率",-1)),e("strong",{class:T(g(c.day.status==="pending"?null:c.day.returnRate))},a(n(se)(c.day,"return")),3)]),e("div",null,[r[6]||(r[6]=e("span",null,"股利收入",-1)),e("strong",null,a(c.day.estimatedCorporateActionCodes.length||c.day.incompleteCorporateActionHistoryCodes?.length?"待更新":n($)(c.day.income,!0)),1)]),e("div",null,[r[7]||(r[7]=e("span",null,"淨投入",-1)),e("strong",null,a(n($)(c.day.externalFlow,!0)),1)])]),c.day.status==="completed"&&c.day.contributions.length?(i(),u("section",dt,[r[8]||(r[8]=e("h3",null,"標的貢獻",-1)),(i(!0),u(w,null,W(c.day.contributions,h=>(i(),u("div",{key:h.code,class:"detail-row"},[e("span",null,[e("strong",null,a(h.code),1),E(a(h.name||""),1)]),e("strong",{class:T(g(h.profitLoss))},a(n($)(h.profitLoss,!0)),3)]))),128))])):_("",!0),c.events.length?(i(),u("section",ct,[r[9]||(r[9]=e("h3",null,"當日異動",-1)),(i(!0),u(w,null,W(c.events,h=>(i(),u("div",{key:h.id,class:"detail-row"},[e("span",null,[e("strong",null,a(n(We)[h.type]),1),E(a(h.code),1)]),e("span",null,a(y(h)),1)]))),128))])):_("",!0)])],64)):_("",!0)],544)]))}}),vt=oe(pt,[["__scopeId","data-v-433b1f74"]]),yt={class:"shell holdings-page","aria-labelledby":"holdings-page-title"},mt={class:"holdings-header"},bt={key:0,class:"state-panel"},gt={key:1,class:"login-panel"},ft={class:"login-actions"},ht=["disabled"],kt=["disabled"],$t={key:2,class:"state-panel error-panel"},Ct={key:3,class:"state-panel"},_t={key:4,class:"state-panel error-panel"},Dt={key:0,class:"notice error-notice"},wt={key:1,class:"notice success-notice",role:"status"},Lt={key:2,class:"onboarding-actions saved-actions"},At=["disabled"],Et={key:3,class:"empty-onboarding"},Tt={class:"onboarding-actions"},St={class:"account-overview"},xt={class:"hero-value"},Nt={class:"overview-metrics"},It={class:"performance-section"},Mt={class:"month-header"},Pt=["disabled"],Rt={key:0,class:"update-inline",role:"status"},qt={key:1,class:"update-inline",role:"status"},Ft={key:2,class:"update-notice",role:"status"},Vt={class:"cumulative-date"},zt={class:"month-summary"},Wt={class:"primary-summary"},Ot={key:1,class:"update-inline",role:"status"},Bt={id:"current-holdings",class:"positions-section"},jt={class:"section-heading"},Gt={class:"holdings-actions"},Ut={class:"positions-table-wrap"},Ht={class:"positions-table"},Yt={key:0},Zt={class:"price-date"},Kt={class:"cost-cell"},Xt={key:0},Qt={class:"position-actions"},Jt=["onClick"],en={class:"position-more"},tn={class:"position-menu"},nn=["onClick"],sn={key:0,class:"historical-section"},ln={class:"historical-list"},on=["onClick"],an=["onClick"],un={class:"void-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"position-delete-title"},rn={id:"position-delete-title"},dn={key:0,class:"void-error",role:"alert"},cn={class:"void-actions"},pn=["disabled"],vn=["disabled"],yn=le({__name:"index",setup(c){const C=Se(),m=xe(),N=Ne(),b=f(!1),d=f(null),S=f(!1),D=f(null),g=f(null),y=f(!1),s=f(null),r=f(null),h=f([]),j=f(null),q=f(null),O=f(!1),x=f(null),F=f(!1),ae=f(null);let G=0;const ye=typeof m.query.month=="string"&&/^\d{4}-(0[1-9]|1[0-2])$/.test(m.query.month)?m.query.month:new Date().toLocaleDateString("en-CA",{timeZone:"Asia/Taipei"}).slice(0,7),L=f(ye),ie=new Date().toLocaleDateString("en-CA",{timeZone:"Asia/Taipei"}).slice(0,7),V=k(()=>He({mounted:b.value,authReady:C.ready.value,userId:C.user.value?.uid??null,sessionReady:C.sessionReady.value,authPending:C.pending.value})),A=k(()=>d.value?.positions??[]),I=k(()=>d.value?.events.filter(l=>l.status==="active")??[]),me=k(()=>x.value?I.value.filter(l=>l.code===x.value?.code).length:0),be=k(()=>d.value?.performance.days.find(l=>l.date===g.value)??null),ge=k(()=>I.value.filter(l=>l.date===g.value)),Z=k(()=>A.value.every(l=>l.referenceMarketValue!=null)?A.value.reduce((l,t)=>
1l+t.referenceMarketValue,0):null),ue=k(()=>A.value.every(l=>l.costComplete)?A.value.reduce((l,t)=>l+(t.totalCost??0),0):null),re=k(()=>ue.value==null||Z.value==null?null:Z.value-ue.value),K=k(()=>{const l=new Set(A.value.map(p=>p.code)),t=new Map;for(const p of d.value?.events??[]){if(p.status!=="active"||l.has(p.code))continue;const v=t.get(p.code)??[];v.push(p),t.set(p.code,v)}return[...t.entries()].map(([p,v])=>{const z=h.value.find(Q=>Q.code===p);return{code:p,name:z?.label.replace(new RegExp(`^${p}\\s*`),"")||null,activeEventCount:v.length}}).sort((p,v)=>p.code.localeCompare(v.code))}),fe=k(()=>`${L.value.slice(0,4)} 年 ${Number(L.value.slice(5,7))} 月`),he=k(()=>L.value<ie),M=k(()=>d.value?.performance.cumulative),P=k(()=>Ge(d.value?.performance.days??[],new Date().toLocaleDateString("en-CA",{timeZone:"Asia/Taipei"}))),ke=k(()=>{const l=I.value[0];return!!l&&!P.value&&!!d.value?.marketDate&&l.type==="opening_balance"&&l.date.slice(0,7)===L.value&&I.value.every(t=>t.type==="opening_balance"&&t.date===l.date)&&d.value.marketDate<=l.date&&d.value.performance.days.every(t=>t.date<=l.date)}),$e=k(()=>{const l=[...new Set(A.value.map(t=>t.priceDate).filter(Boolean))];return l.length===1?`收盤價日期 ${l[0]}`:"各標的價格日期見持股表格"});Ie(()=>{b.value=!0,Ce()}),ee([()=>V.value,L],([l])=>{l==="ready"&&U(),l==="signed-out"&&(G+=1,d.value=null,g.value=null,y.value=!1,q.value=null,O.value=!1)},{immediate:!0}),ee([V,S,()=>m.query.start,()=>m.query.code],()=>{if(V.value!=="ready"||S.value||!d.value||D.value||m.query.start!=="holding")return;const l=typeof m.query.code=="string"&&/^\d{4,6}[A-Z]?$/.test(m.query.code)?m.query.code:void 0,{start:t,code:p,...v}=m.query;if(l&&(A.value.some(z=>z.code===l)||I.value.some(z=>z.code===l))){N.replace({path:`/my/holdings/${l}`,query:v});return}N.replace({query:v}),H("opening_balance",l)});async function Ce(){try{const[l,t]=await Promise.all([$fetch("/api/etf/list",{query:{compact:1}}),$fetch("/api/stock/list",{query:{compact:1}})]),p=[...l.items.map(v=>({code:v.code,label:`${v.code} ${v.name}`})),...t.items.map(v=>({code:v.code,label:`${v.code} ${v.name}`}))];h.value=[...new Map(p.map(v=>[v.code,v])).values()]}catch{h.value=[]}}async function U(){const l=++G;S.value=!0,D.value=null;try{const t=await $fetch("/api/user/investments",{query:{month:L.value}});if(l!==G)return;d.value=t,qe("holdings")}catch(t){l===G&&(D.value=pe(t))}finally{l===G&&(S.value=!1)}}async function de(l){const t=Oe(L.value,l);t>ie||(L.value=t,g.value=null,await N.replace({query:{...m.query,month:L.value}}))}function H(l="opening_balance",t){O.value=!1,q.value=null,s.value=null,r.value={type:l,code:t},y.value=!0}function X(l="buy",t){s.value=null,r.value={type:l,code:t},y.value=!0}function ce(l){x.value=l,ae.value=d.value?.account.ledgerVersion??null,j.value=null,q.value=null}async function _e(){if(!x.value||F.value)return;const l=x.value.code;F.value=!0,j.value=null;try{const t=await $fetch(`/api/user/investments/positions/${encodeURIComponent(l)}`,{method:"DELETE",body:{expectedLedgerVersion:ae.value}});x.value=null,q.value=`已刪除 ${t.code} 持股與 ${t.removedEventCount} 筆相關紀錄。`,await U()}catch(t){j.value=pe(t)}finally{F.value=!1}}async function De(l){O.value=l.created&&I.value.length===0&&["opening_balance","buy"].includes(l.type),q.value=O.value?`已${l.type==="buy"?"記錄買進":"加入"} ${l.code},${Number(l.shares).toLocaleString("zh-TW")} 股。`:"紀錄已儲存。",y.value=!1,s.value=null,r.value=null,await U()}function Y(l){return l==null||l===0?"neutral-value":l>0?"positive-value":"negative-value"}function we(l){return l.toLocaleString("zh-TW",{maximumFractionDigits:1})}return Me({title:"我的持股損益日曆|ETF資訊網",description:"記錄個股與 ETF 持股,查看每日、每月損益與時間加權報酬率。",robots:"noindex,nofollow"}),(l,t)=>{const p=Re,v=ot,z=vt,Q=Be,Le=Fe("login-source");return i(),u("section",yt,[e("header",mt,[e("div",null,[R(p,{to:"/my",class:"back-link"},{default:B(()=>[...t[16]||(t[16]=[E("← 回到我的",-1)])]),_:1}),t[17]||(t[17]=e("p",{class:"eyebrow"},"PERSONAL PERFORMANCE",-1)),t[18]||(t[18]=e("h1",{id:"holdings-p
1age-title"},"持股損益日曆",-1)),t[19]||(t[19]=e("p",{class:"lead"},"記錄持股與買賣,看清楚每天與每月的投資表現。",-1))])]),n(V)==="auth-loading"||n(V)==="session-loading"?(i(),u("div",bt,[...t[20]||(t[20]=[e("span",{class:"loading-dot"},null,-1),e("p",null,"正在整理你的持股紀錄",-1)])])):n(V)==="signed-out"?Pe((i(),u("section",gt,[t[21]||(t[21]=e("div",null,[e("p",{class:"eyebrow"},"PRIVATE DATA"),e("h2",null,"登入後建立你的持股紀錄"),e("p",null,"持股與交易紀錄只屬於你的帳號,登入後才能跨裝置保存。")],-1)),e("div",ft,[e("button",{type:"button",class:"btn btn-primary",disabled:n(C).pending.value,onClick:t[0]||(t[0]=(...o)=>n(C).signInWithGoogle&&n(C).signInWithGoogle(...o))},"使用 Google 登入",8,ht),e("button",{type:"button",class:"btn btn-outline",disabled:n(C).pending.value,onClick:t[1]||(t[1]=(...o)=>n(C).signInWithApple&&n(C).signInWithApple(...o))},"使用 Apple 登入",8,kt)])])),[[Le,"holdings"]]):n(V)==="session-error"?(i(),u("div",$t,[e("p",null,a(n(C).error.value||"登入已完成,但雲端資料暫時無法連線。"),1),e("button",{type:"button",class:"btn btn-outline btn-sm",onClick:t[2]||(t[2]=(...o)=>n(C).refreshSession&&n(C).refreshSession(...o))},"重新連線")])):n(S)&&!n(d)?(i(),u("div",Ct,[...t[22]||(t[22]=[e("span",{class:"loading-dot"},null,-1),e("p",null,"正在更新你的損益",-1)])])):n(D)&&!n(d)?(i(),u("div",_t,[e("p",null,a(n(D)),1),e("button",{type:"button",class:"btn btn-outline btn-sm",onClick:U},"重新載入")])):n(d)?(i(),u(w,{key:5},[n(D)?(i(),u("div",Dt,[e("span",null,a(n(D)),1),e("button",{type:"button",onClick:U},"重新載入")])):_("",!0),n(q)?(i(),u("p",wt,a(n(q)),1)):_("",!0),n(O)&&n(I).length>0&&!n(D)?(i(),u("div",Lt,[e("button",{type:"button",class:"btn btn-primary",disabled:n(S)||!!n(D),onClick:t[3]||(t[3]=o=>H("opening_balance"))},"再加入一檔",8,At),e("a",{href:"#current-holdings",class:"btn btn-outline",onClick:t[4]||(t[4]=o=>O.value=!1)},"查看我的持股")])):_("",!0),n(A).length===0&&n(I).length===0?(i(),u("section",Et,[t[24]||(t[24]=e("p",{class:"eyebrow"},"START HERE",-1)),t[25]||(t[25]=e("h2",null,"先加入一檔,開始看自己的投資表現",-1)),t[26]||(t[26]=e("p",null,"填入目前持有的股票或 ETF 與股數,不用補齊過去每筆交易。成本不確定可以稍後補。",-1)),e("div",Tt,[e("button",{type:"button",class:"btn btn-primary",onClick:t[5]||(t[5]=o=>H("opening_balance"))},"加入第一檔持股"),e("button",{type:"button",class:"btn btn-ghost",onClick:t[6]||(t[6]=o=>H("buy"))},"想從一筆交易開始?記錄買進 →"),n(d).events.length?(i(),te(p,{key:0,to:"/my/holdings/records",class:"btn btn-outline"},{default:B(()=>[...t[23]||(t[23]=[E("全部異動",-1)])]),_:1})):_("",!0)])])):(i(),u(w,{key:4},[e("section",St,[e("div",xt,[t[27]||(t[27]=e("span",null,"目前參考市值",-1)),e("strong",null,a(n($)(n(Z))),1),e("small",null,a(n($e))+" · 以最新可用收盤價估算",1)]),e("div",Nt,[e("div",null,[t[28]||(t[28]=e("span",null,"累計未實現損益",-1)),e("strong",{class:T(Y(n(re)))},a(n($)(n(re),!0)),3)]),e("div",null,[t[29]||(t[29]=e("span",null,"記錄筆數",-1)),e("strong",null,a(n(I).length),1)]),e("div",null,[t[30]||(t[30]=e("span",null,"持有標的",-1)),e("strong",null,a(n(A).length),1)])])]),e("section",It,[e("header",Mt,[e("button",{type:"button","aria-label":"上一個月",onClick:t[7]||(t[7]=o=>de(-1))},"‹"),e("div",null,[t[31]||(t[31]=e("p",{class:"eyebrow"},"MONTHLY RESULT",-1)),e("h2",null,a(n(fe)),1)]),e("button",{type:"button","aria-label":"下一個月",disabled:!n(he),onClick:t[8]||(t[8]=o=>de(1))},"›",8,Pt)]),n(d).performance.month===n(L)?(i(),u(w,{key:0},[n(ke)?(i(),u("p",Rt,"已開始追蹤。從記錄日期的下一個交易日起,盤後資料更新後就能看到每日損益。")):_("",!0),n(P)?.todayPricesOnly?(i(),u("p",qt,a(n(P).message),1)):n(P)?(i(),u("aside",Ft,[e("strong",null,a(n(P).title),1),e("p",null,a(n(P).message),1),e("details",null,[t[32]||(t[32]=e("summary",null,"查看未更新日期與原因",-1)),e("ul",null,[(i(!0),u(w,null,W(n(P).days,o=>(i(),u("li",{key:o.date},a(o.date)+":"+a(o.reason),1))),128))])])])):_("",!0),e("p",Vt,a(n(M)?.asOfDate?`累積截至 ${n(M).asOfDate}`:n(P)?"尚無完整資料可累積,盤後資料到齊後更新":"這個月尚無損益紀錄"),1),e("div",zt,[e("div",Wt,[t[33]||(t[33]=e("span",null,"本月累積損益",-1)),e("strong",{class:T(Y(n(M)?.totalProfitLoss??null))},a(n($)(n(M)?.totalProfitLoss??null,!0)),3)]),e("div",null,[t[34]||(t[34]=e("span",null,"本月累積報酬率",-1)),e("strong",{class:T(Y(n(M)?.twr??null))},a(n(je)(n(M)?.twr??null,!0)),3)]),e("div",null,[t[35]||(t[35]=e("span",null,"淨投入",-1)),e("strong",null,a(n($)(n(M)?.totalExternalFlow??null,!0)),1)]),e("div",null,[t[3
16]||(t[36]=e("span",null,"投資收入",-1)),e("strong",null,a(n($)(n(M)?.totalIncome??null,!0)),1)])]),R(v,{month:n(L),days:n(d).performance.days,"selected-date":n(g),onSelect:t[9]||(t[9]=o=>g.value=o)},null,8,["month","days","selected-date"])],64)):(i(),u("p",Ot,a(n(D)?"這個月的資料尚未載入,請重新載入。":"正在載入這個月的損益…"),1))]),e("section",Bt,[e("div",jt,[t[38]||(t[38]=e("div",null,[e("p",{class:"eyebrow"},"HOLDINGS"),e("h2",null,"目前持股")],-1)),e("div",Gt,[R(p,{to:"/my/holdings/records",class:"btn btn-outline"},{default:B(()=>[...t[37]||(t[37]=[E("全部異動",-1)])]),_:1}),e("button",{type:"button",class:"btn btn-outline",onClick:t[10]||(t[10]=o=>H("opening_balance"))},"加入持股"),e("button",{type:"button",class:"btn btn-primary",onClick:t[11]||(t[11]=o=>X("buy"))},"記錄買賣")])]),e("div",Ut,[e("table",Ht,[t[43]||(t[43]=e("thead",null,[e("tr",null,[e("th",null,"標的"),e("th",null,"股數"),e("th",null,"收盤價"),e("th",null,"參考市值"),e("th",null,"參考平均成本"),e("th",null,"已實現"),e("th",null,"未實現"),e("th",null,[e("span",{class:"sr-only"},"操作")])])],-1)),e("tbody",null,[(i(!0),u(w,null,W(n(A),o=>(i(),u("tr",{key:o.code},[e("td",null,[R(p,{to:{path:`/my/holdings/${o.code}`,query:{month:n(L)}},class:"position-link"},{default:B(()=>[e("strong",null,a(o.code),1),e("span",null,a(o.name||(o.instrumentType==="stock"?"個股":"ETF")),1),t[39]||(t[39]=e("small",null,"查看個別紀錄 →",-1))]),_:2},1032,["to"])]),e("td",null,[E(a(o.economicShares.toLocaleString("zh-TW",{maximumFractionDigits:6}))+" ",1),o.receivableShares>0?(i(),u("small",Yt,"已入帳 "+a(o.settledShares.toLocaleString("zh-TW",{maximumFractionDigits:6}))+"/應收 "+a(o.receivableShares.toLocaleString("zh-TW",{maximumFractionDigits:6})),1)):_("",!0)]),e("td",null,[E(a(o.price?.toLocaleString("zh-TW",{maximumFractionDigits:4})??"—"),1),e("small",Zt,a(o.priceDate||"尚無價格"),1)]),e("td",null,a(n($)(o.referenceMarketValue??null)),1),e("td",Kt,[o.averageCost!=null?(i(),u(w,{key:0},[E(" 約 "+a(we(o.averageCost))+" ",1),o.costComplete?_("",!0):(i(),u("small",Xt,"部分成本未設定"))],64)):(i(),u(w,{key:1},[t[41]||(t[41]=e("span",{class:"missing-cost"},"未設定",-1)),R(p,{class:"inline-correction",to:`/my/holdings/${o.code}`},{default:B(()=>[...t[40]||(t[40]=[E("查看紀錄補上成本",-1)])]),_:1},8,["to"])],64))]),e("td",{class:T(Y(o.realizedProfitLoss))},a(n($)(o.realizedProfitLoss,!0)),3),e("td",{class:T(Y(o.referenceUnrealizedProfitLoss??null))},a(n($)(o.referenceUnrealizedProfitLoss??null,!0)),3),e("td",null,[e("div",Qt,[e("button",{type:"button",class:"text-button",onClick:J=>X("buy",o.code)},"買賣",8,Jt),e("details",en,[t[42]||(t[42]=e("summary",null,"更多",-1)),e("div",tn,[e("button",{type:"button",class:"danger-action",onClick:J=>ce(o)},"刪除全部紀錄",8,nn)])])])])]))),128))])])])]),n(K).length?(i(),u("section",sn,[e("details",null,[e("summary",null,"已結清標的("+a(n(K).length)+")",1),e("div",ln,[(i(!0),u(w,null,W(n(K),o=>(i(),u("article",{key:o.code},[e("div",null,[e("strong",null,a(o.code),1),e("span",null,a(o.name||"")+" · 持股已結清",1)]),e("div",null,[R(p,{to:`/my/holdings/${o.code}`},{default:B(()=>[...t[44]||(t[44]=[E("查看紀錄",-1)])]),_:1},8,["to"]),e("button",{type:"button",onClick:J=>X("buy",o.code)},"再次買進",8,on),e("button",{type:"button",class:"danger-action",onClick:J=>ce({code:o.code,name:o.name})},"刪除全部紀錄",8,an)])]))),128))])])])):_("",!0)],64)),t[45]||(t[45]=e("details",{class:"calculation-note"},[e("summary",null,"損益怎麼計算?何時更新?"),e("p",null,"參考市值以目前股數乘上各標的最新可用收盤價,新增持股不用等今天收盤;若價格跨越分割或除權息,會等待新收盤價,不需修改持股。"),e("p",null,[e("strong",null,"這是參考試算。"),E("損益於交易日盤後更新,非即時報價;取得官方收盤價與除權息資料後才會重新計算。各來源公布時間不同,不保證收盤後立即完成;頁面標示的「累積截至」日期才是本月數字的計算範圍。")]),e("p",null,"本月累積損益加總到最近連續資料完整的日期,報酬率也使用相同期間。今天尚未更新時保留先前累積;若中間有資料缺漏,先停在缺漏前,不跳過缺漏日繼續加總。資料到齊後重新開啟本頁即
1可查看;新增或修正交易後會重新計算。"),e("p",null,"日曆記錄開始追蹤後的價格變動、交易費用及股利。買進投入的金額不會直接算成獲利,賣出收回的金額也不會直接算成虧損。資料填錯或漏記時,請到個別異動歷史修正原紀錄,或補上買賣。"),e("p",null,"費用、稅額及券商成本計算方式可能不同,平均成本與損益僅供參考,請以券商交割與對帳資料為準。"),e("p",null,"月報酬率使用每日 Modified Dietz 報酬率連乘,作為排除投入與取回資金影響後的 TWR 估計值。")],-1))],64)):_("",!0),R(z,{day:n(be),events:n(ge),onClose:t[12]||(t[12]=o=>g.value=null)},null,8,["day","events"]),R(Q,{open:n(y),"ledger-version":n(d)?.account.ledgerVersion,options:n(h),positions:n(A),"corporate-actions":n(d)?.corporateActions??[],"latest-trading-date":n(d)?.marketDate,event:n(s),preset:n(r),onClose:t[13]||(t[13]=o=>y.value=!1),onSaved:De},null,8,["open","ledger-version","options","positions","corporate-actions","latest-trading-date","event","preset"]),(i(),te(ve,{to:"body"},[n(x)?(i(),u("div",{key:0,class:"void-backdrop",onMousedown:t[15]||(t[15]=ne(o=>!n(F)&&(x.value=null),["self"]))},[e("section",un,[t[46]||(t[46]=e("p",{class:"eyebrow"},"DELETE HOLDING",-1)),e("h2",rn,"永久刪除 "+a(n(x).code)+" 的全部紀錄?",1),e("p",null,"將刪除 "+a(n(me))+" 筆紀錄及所有修改版本,無法復原。其他標的的紀錄不會刪除,持股與每日、每月損益會重新計算。",1),t[47]||(t[47]=e("p",null,"如果只是賣光持股,請改用「記錄買賣」的賣出,保留投資歷史。",-1)),n(j)?(i(),u("p",dn,a(n(j)),1)):_("",!0),e("div",cn,[e("button",{type:"button",class:"btn btn-outline",disabled:n(F),onClick:t[14]||(t[14]=o=>x.value=null)},"取消",8,pn),e("button",{type:"button",class:"btn btn-primary",disabled:n(F),onClick:_e},a(n(F)?"刪除中":"永久刪除"),9,vn)])])],32)):_("",!0)]))])}}}),hn=oe(yn,[["__scopeId","data-v-f67ce6ce"]]);export{hn 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.