PageSourceSearch

https://alphasquare.co.kr/assets/AddStockToWatchlistModal-b3ecaa98.js

js alphasquare.co.kr collected 2026-10-02 14:44:32 UTC 4,302 bytes, 2 lines download raw bytes

1import{d as N,N as $,bL as B,b5 as V,ad as D,aC as L,W as n,f as P,o as m,k as M,i as E,a,h as g,u as h,cT as G,c as I,F,j,t as p,e as q,be as _,bH as H,cA as O,bM as R,a1 as f,p as U,m as z,_ as J}from"./index-69969a08.js";import{N as K}from"./NewModal-e9c5141f.js";import{a as Q}from"./use-watchlist-9cdb28d8.js";import{_ as X}from"./LockCloseIcon.vue_vue_type_script_setup_true_lang-e9e827ab.js";import{_ as Y}from"./PlusIcon.vue_vue_type_script_setup_true_lang-bef041db.js";import"./WarpContent.vue_vue_type_style_index_0_lang-ffb29e01.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[c]="654894f9-6ea0-4c26-a16d-613a627f2f24",o._sentryDebugIdIdentifier="sentry-dbid-654894f9-6ea0-4c26-a16d-613a627f2f24")}catch{}})();const S=o=>(U("data-v-7ede2cd7"),o=o(),z(),o),Z={class:"add-stock-to-watchlist-modal"},tt={class:"modal-header"},st=S(()=>a("h2",{class:"title"},"관심목록에 추가하기",-1)),et={class:"modal-body"},at=S(()=>a("span",{class:"btn-text"},"새 관심목록에 추가",-1)),ot={class:"watchlist-list"},it=["onClick"],ct={class:"name-and-lock-close-icon"},lt={class:"name text-overflow"},dt={class:"stock-count"},nt=N({__name:"AddStockToWatchlistModal",setup(o){const c=$(),{watchlistLimit:k,watchlists:w}=Q(),{createWatchlist:v}=B(),{addBulkStock:y}=V(),{myPermissions:W}=D(),{hasRole:C}=L(),i=c.useArgs(n.AddStockToWatchlistModal),b=P(()=>W.value.watchlist_stock_limit);async function x(e){var l,t,d;if(!e.allowed){c.show(n.MembershipGuideModal,{permissionCategory:"watchlist_limit"});return}try{const s=await y({watchlistId:e.id,stockIds:i.stockIds});_({title:"관심종목 추가 완료",html:`${i.stockIds.length}개의 종목이 '${e.name}'에 추가되었습니다.`}),(l=i.onStocksAdd)==null||l.call(i,s.filter(r=>r.type==="stock").map(r=>r.stock.id))}catch(s){if(!H.isAxiosError(s)||!((t=s.response)!=null&&t.data))throw s;const{code:r}=s.response.data;((d=s.response)==null?void 0:d.data[0])==="Number of stock exceedeed the allowable value."?_({title:"추가할 수 있는 종목 개수를<br />초과했습니다."}):r==="COUNT_LIMIT"?C("alphasquare:premium")?_({title:`추가할 수 있는 종목 개수를<br />초과했습니다. (최대 ${b.value}개)`}):c.show(n.MembershipGuideModal,{permissionCategory:"watchlist_stock_limit"}):(_({title:"관심종목 추가 중 오류가 발생했습니다."}),O(s))}finally{u()}}async function A(){var e;if(k.value<=w.value.length){c.show(n.MembershipGuideModal,{permissionCategory:"watchlist_limit"});return}try{const{isConfirmed:l,value:t}=await R({title:"새 관심목록의 이름을 입력해 주세요.",confirmButtonText:"새 관심목록 생성",inputPlaceholder:"새 관심목록",inputAttributes:{minlength:"1",maxlength:"12"},preConfirm:async d=>await T(d)});if(l){const d=await y({watchlistId:t.id,stockIds:i.stockIds});(e=i.onStocksAdd)==null||e.call(i,d.filter(s=>s.type==="stock").map(s=>s.stock.id))}}finally{u()}}async function T(e){var l;if(e.trim()==="")f.showValidationMessage("내용을 입력해 주세요");else if(e.trim().length>12)f.showValidationMessage("12자 이내로 입력해 주세요");else try{return await v({watchlistName:e})}catch(t){((l=t.response)==null?void 0:l.status)===400&&f.showValidationMessage("동일한 이름의 관심목록이 존재합니다")}}function u(){c.hide(n.AddStockToWatchlistModal)}return(e,l)=>(m(),M(K,{name:h(n).AddStockToWatchlistModal},{default:E(()=>[a("div",Z,[a("div",tt,[st,a("button",{type:"button",class:"btn-close-modal clickable-layer",onClick:u},[g(h(G),{width:20,height:20})])]),a("div",et,[a("button",{type:"button",class:"btn-create-watchlist clickable-layer",onClick:A},[g(h(Y),{width:20,height:20}),at]),a("ul",ot,[(m(!0),I(F,null,j(h(w),t=>(m(),I("li",{key:t.id,class:"watchlist-item clickable-layer",onClick:d=>x(t)},[a("div",ct,[a("span",lt,p(t.name),1),t.allowed?q("",!0):(m(),M(h(X),{key:0,class:"add-stock-to-watchlist-modal__lock-close-icon",width:20,height:20}))]),a("span",dt," ("+p(t.stock_count)+"/"+p(b.value)+") ",1)],8,it))),128))])])])]),_:1},8,["name"]))}});
1const ft=J(nt,[["__scopeId","data-v-7ede2cd7"]]);export{ft as default};
2//# sourceMappingURL=AddStockToWatchlistModal-b3ecaa98.js.map

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.