import{aH as I,b as k,W as x,aJ as D,U as P}from"./vendor-ui-DXwyveTF.js";import{y as U,E as p,T as B,s as m,B as F,t as d}from"./index-B5qe6yln.js";import{c as G,a as K}from"./index.vue_vue_type_script_setup_true_lang-D3xHCy9f.js";import{v as N,aA as $,y as H,aC as J,aD as M,ac as f,aF as V,af as z,g as r,ao as _,a9 as Q,aP as W,ax as l,ab as Y,l as q,r as u,aO as g}from"./vendor-core-CzvSW5ae.js";import{u as X}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";const j={class:"size-full p-[10px]"},fe=N({__name:"index",setup(Z){const{t:n}=$(),v=H()?.uid,h=J(),E=M(),y=U(),t=G(h.path)();f(p.PROVIDE_KEY_COMP_LIST_STORE,t);const w=new Map;f(p.PROVIDE_KEY_CALLBACKS,w);const c=I(`${B}`,"XTTJ"),C=V("compIframeContainer"),S=r(()=>d.DEFAULT_TAG_GROUP.map(e=>({label:n(e.label),value:e.value}))),i=z({data:[],search:{column:[{prop:"keyword",component:_(k),label:r(()=>n("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:r(()=>n("comp.keywordPlaceholder")),fetchSuggestions:L,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}},{prop:"tag",component:_(x),label:r(()=>n("common.filter")),value:c.value,attributes:{options:S,style:"width: 200px",onChange:e=>c.value=e}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:R}),T=r(()=>i.value?.search?.column[0]?.value??"");X(T,C);function b(e){return e===d.DEFAULT_TAG_GROUP[0].value?JSON.stringify(y?.deps||[]):"[]"}function L(e,o){if(e.length<=1)return o([]);m.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compShare"}).then(s=>{const{keywords:a=[]}=s.data||{};o(a)})}async function R(e){t.setLoading(!0);const o={...e,deps:b(c.value)},s=await m.v1Comp.compcontrollerComps({...o}),{rows:a,total:O}=s.data??{};t.renderList(a??[]),i.value.pagination.total=O??0,i.value.data=a??[],t.setLoading(!1)}function A(e){E.push({path:`/preview/${e}`})}return Q(()=>{t.$reset()}),(e,o)=>{const s=P,a=D;return W((Y(),q("div",j,[u(l(F),{tableConfig:i.value},{table:g(()=>[u(s,{class:"flex-1"},{default:g(()=>[u(K,{ref:"compIframeContainer",iuid:l(v),compType:l(p).IFRAME_ROUTES.CONTAINER.SHARE,onPreview:A},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[a,l(t).loading]])}}});export{fe as default};
