import{aJ as x,b as M,g as B,F as N,K}from"./vendor-ui-CGT0cG1n.js";import{m as n,B as $,u as m,i as T}from"./index-D88CvPWT.js";import{v as F,y as G,aA as Y,aC as H,aD as V,ac as _,aF as E,a9 as z,aP as Q,ax as p,ab as J,l as W,r as g,aO as j,af as X,g as i,ao as C,Y as Z}from"./vendor-core-BKehvho7.js";import{c as q,b as ee,a as oe}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";import{c as te}from"./useCompEditStore-DhXxYAqN.js";import{_ as ae}from"./index.vue_vue_type_style_index_0_lang-BipgSalp.js";import{u as re}from"./useTeamHeaders-DxHN7-t0.js";import{u as ne}from"./useKeyword-CjhhChz4.js";import"./index-B9hCLAJk.js";import"./useCompMetaLocalStore-BKTMp_k8.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useVscodeOpen-BBdyQ3W2.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";/* empty css                */import"./v4-EwEgHOG0.js";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 se={class:"size-full overflow-hidden"},Pe=F({__name:"index",setup(ie){const y=G()?.uid,{t:a}=Y(),h=H(),v=V(),{headers:l,teamId:d}=re(),r=q(`${h.path}_${n.SCOPE_ID_TEAM_COMP_LIST}`)();_(n.PROVIDE_KEY_COMP_LIST_STORE,r);const I=new Map;_(n.PROVIDE_KEY_CALLBACKS,I);const S=te(h.path,n.DIALOG_TYPE_EDIT)();_(n.PROVIDE_KEY_COMP_EDIT_STORE,S);const w=ee(d)(),k=E("compUpdateDialog"),L=E("compIframeContainer"),u=X({data:[],search:{column:[{prop:"keyword",component:C(M),label:i(()=>a("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:i(()=>a("comp.keywordPlaceholder")),fetchSuggestions:R,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}},{prop:"group",component:C(B),label:i(()=>a("team.group")),value:"",attributes:{options:i(()=>w.menuGroup),clearable:!0,props:{value:"id",checkStrictly:!0}}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:b}),O=i(()=>u.value?.search?.column[0]?.value??"");ne(O,L);function R(e,o){if(e.length<=1)return o([]);m.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compTeam"},{headers:l}).then(t=>{const{keywords:s=[]}=t.data||{};o(s)})}async function b(e){r.renderList([]),await Z(),r.setLoading(!0),e.keyword&&window?.umami?.track(T.SEARCH_COMPONENT,{keyword:e.keyword,page:"team"});const{group:o=[]}=e||{};delete e.group,o.length&&window?.umami?.track(T.TEAM_FILTER_GROUP,{teamId:d,group:o});const t=o?.[o.length-1];if(t){let c=w.getSelectedGroupLeafNodes(t);c=c.length===0?[t]:c,e.leafNodeIds=c}const s=await m.v1Team.teamcontrollerTeamcomps({...e,scene:"library"},{headers:l}),{rows:f,total:U}=s.data??{};r.renderList(f??[]),u.value.pagination.total=U??0}function P(e){v.push({path:`/previewTeam/${d}/${e}`})}async function D(e){const o=N.service({fullscreen:!0});try{const t=e,s=await m.v1Team.teamcontrollerCheckcompupdatepermission({compId:t},{headers:l}),{result:f}=s.data||{};if(f==="cannot_update"){K.confirm(a("message.noUpdatePermission"),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).finally(()=>{});return}k.value?.open(t)}finally{o.close()}}function A(e){m.v1Comp.compcontrollerCompdetail({compId:e}).then(o=>{r.updateCompListItemById(e,o.data)})}return z(()=>{r.$reset()}),(e,o)=>{const t=x;return Q((J(),W("div",se,[g(p($),{tableConfig:u.value},{table:j(()=>[g(oe,{ref:"compIframeContainer",iuid:p(y),compType:p(n).IFRAME_ROUTES.CONTAINER.TEAM_ALL,onPreview:P,onUpdate:D},null,8,["iuid","compType"])]),_:1},8,["tableConfig"]),g(ae,{ref:"compUpdateDialog",onUpdateSuccess:A},null,512)])),[[t,p(r).loading]])}}});export{Pe as default};
