import{aJ as T,U as L,b}from"./vendor-ui-DXwyveTF.js";import{E as a,B as P,s as c}from"./index-B5qe6yln.js";import{c as k,a as M}from"./index.vue_vue_type_script_setup_true_lang-D3xHCy9f.js";import{_ as U}from"./index.vue_vue_type_style_index_0_lang-DQhqVyhA.js";import{c as A}from"./useCompEditStore-KBTFiinR.js";import{v as x,aA as K,y as B,aC as Y,aD as F,ac as l,aF as _,a9 as N,aP as V,ax as i,ab as $,l as H,r as p,aO as E,af as z,g as m,ao as Q}from"./vendor-core-CzvSW5ae.js";import{u as q}from"./useKeyword-CoagiMo1.js";import"./index-CEQStqDa.js";import"./useCompMetaLocalStore-eE-CBcE9.js";/* empty css                */import"./useVscodeOpen-Dx3IRL0P.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-CgV6_zzd.js";import"./useCacheOssStore-DApHt9lQ.js";import"./useTeamHeaders-Cc060CP0.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js";import"./useMessage-CYVXvlqq.js";import"./v4-EwEgHOG0.js";/* empty css                */import"./index.vue_vue_type_style_index_0_lang-BQWxY2F1.js";import"./core-B1GcTOER.js";import"./PanelBackground.vue_vue_type_script_setup_true_lang-DBIlZFl0.js";import"./BaseSegmented.vue_vue_type_script_setup_true_lang-CW16Y3Jx.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-bBtkKtmz.js";const G={class:"size-full p-[10px]"},he=x({__name:"index",setup(J){const{t:u}=K(),g=B()?.uid,d=Y(),C=F(),o=k(d.path)();l(a.PROVIDE_KEY_COMP_LIST_STORE,o);const h=A(d.path,a.DIALOG_TYPE_EDIT)();l(a.PROVIDE_KEY_COMP_EDIT_STORE,h);const f=new Map;l(a.PROVIDE_KEY_CALLBACKS,f);const y=_("compUpdateDialog"),v=_("compIframeContainer"),n=z({data:[],search:{column:[{prop:"keyword",component:Q(b),label:m(()=>u("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:m(()=>u("comp.keywordPlaceholder")),fetchSuggestions:I,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:O}),w=m(()=>n.value?.search?.column[0]?.value??"");q(w,v);function I(e,t){if(e.length<=1)return t([]);c.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compMy"}).then(r=>{const{keywords:s=[]}=r.data||{};t(s)})}async function O(e){o.setLoading(!0);const t=await c.v1Comp.compcontrollerMycomps(e),{rows:r,total:s}=t.data??{};o.renderList(r??[]),n.value.pagination.total=s??0,o.setLoading(!1)}function R(e){C.push({path:`/preview/${e}`})}async function S(e){y.value?.open(e)}function D(e){c.v1Comp.compcontrollerCompdetail({compId:e}).then(t=>{o.updateCompListItemById(e,t.data)})}return f.set(a.COMP_METHOD_KEY_AFTER_COMP_DEL,()=>{n.value.pagination.total--}),N(()=>{o.$reset()}),(e,t)=>{const r=L,s=T;return V(($(),H("div",G,[p(i(P),{tableConfig:n.value},{table:E(()=>[p(r,null,{default:E(()=>[p(M,{ref:"compIframeContainer",iuid:i(g),compType:i(a).IFRAME_ROUTES.CONTAINER.MINE,onPreview:R,onUpdate:S},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"]),p(U,{ref:"compUpdateDialog",onUpdateSuccess:D},null,512)])),[[s,i(o).loading]])}}});export{he as default};
