import{aJ as k,U as D,b as L}from"./vendor-ui-CGT0cG1n.js";import{m as a,B as b,u as c,i as P}from"./index-D88CvPWT.js";import{c as M,a as x}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";import{_ as A}from"./index.vue_vue_type_style_index_0_lang-BipgSalp.js";import{c as U}from"./useCompEditStore-DhXxYAqN.js";import{v as K,aA as B,y as N,aC as Y,aD as F,ac as m,aF as _,a9 as H,aP as V,ax as i,ab as $,l as z,r as p,aO as w,af as Q,g as l,ao as G,Y as J}from"./vendor-core-BKehvho7.js";import{u as W}from"./useKeyword-CjhhChz4.js";import"./index-B9hCLAJk.js";import"./useCompMetaLocalStore-BKTMp_k8.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useVscodeOpen-BBdyQ3W2.js";import"./useTeamHeaders-DxHN7-t0.js";/* empty css                */import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-Cbhfk7Nk.js";import"./v4-EwEgHOG0.js";/* empty css                */import"./index.vue_vue_type_style_index_0_lang-BZ1LzI3x.js";import"./core-CcVTMiBP.js";import"./PanelBackground.vue_vue_type_script_setup_true_lang-BELCrrRh.js";import"./BaseSegmented.vue_vue_type_script_setup_true_lang-DU79Plk1.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-kJcgjuK5.js";const j={class:"size-full p-[10px] pr-0"},he=K({__name:"index",setup(X){const{t:u}=B(),C=N()?.uid,d=Y(),E=F(),o=M(d.path)();m(a.PROVIDE_KEY_COMP_LIST_STORE,o);const y=U(d.path,a.DIALOG_TYPE_EDIT)();m(a.PROVIDE_KEY_COMP_EDIT_STORE,y);const f=new Map;m(a.PROVIDE_KEY_CALLBACKS,f);const g=_("compUpdateDialog"),h=_("compIframeContainer"),n=Q({data:[],search:{column:[{prop:"keyword",component:G(L),label:l(()=>u("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:l(()=>u("comp.keywordPlaceholder")),fetchSuggestions:I,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:O}),v=l(()=>n.value?.search?.column[0]?.value??"");W(v,h);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.renderList([]),await J(),o.setLoading(!0),e.keyword&&window?.umami?.track(P.SEARCH_COMPONENT,{keyword:e.keyword,page:"mine"});const t=await c.v1Comp.compcontrollerMycomps(e),{rows:r,total:s}=t.data??{};o.renderList(r??[]),n.value.pagination.total=s??0}function T(e){E.push({path:`/preview/${e}`})}async function R(e){g.value?.open(e)}function S(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--}),H(()=>{o.$reset()}),(e,t)=>{const r=D,s=k;return V(($(),z("div",j,[p(i(b),{tableConfig:n.value},{table:w(()=>[p(r,{always:"",wrapClass:"pr-[10px]"},{default:w(()=>[p(x,{ref:"compIframeContainer",iuid:i(C),compType:i(a).IFRAME_ROUTES.CONTAINER.MINE,onPreview:T,onUpdate:R},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"]),p(A,{ref:"compUpdateDialog",onUpdateSuccess:S},null,512)])),[[s,i(o).loading]])}}});export{he as default};
