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