import{a2 as B,e as H,a3 as A,A as S,J as j}from"./vendor-ui-DXwyveTF.js";import{B as z,s as k}from"./index-B5qe6yln.js";import"./el-table-column-8qfe8CVK.js";import{b as D}from"./index.vue_vue_type_script_setup_true_lang-D3xHCy9f.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-RJnk970E.js";import{u as P}from"./useTeamHeaders-Cc060CP0.js";import{v as R,aA as V,ab as u,l as d,r as t,p as q,ax as s,aO as o,_ as h,A as C,q as _,ap as f,af as w,g as c,ao as J}from"./vendor-core-CzvSW5ae.js";import{_ as M}from"./LoadingWrapper.vue_vue_type_script_setup_true_lang-bBtkKtmz.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";const O={class:"size-full"},Q={key:0},F={key:1},pa=R({__name:"index",setup(G){const{t:a}=V(),{headers:v,teamId:I}=P(),T=D(I)(),i=w({data:[],column:[{slot:"avatar",prop:"userId.avatar",label:c(()=>a("user.avatar")),align:"center"},{prop:"userId.account",label:c(()=>a("user.account")),align:"center"},{prop:"userId.nickname",label:c(()=>a("user.nickname")),align:"center",formatter(r){return r.userId.nickname||"--"}},{slot:"operation",prop:"operation",label:c(()=>a("common.operation")),align:"center"}],pagination:{total:0},search:{column:[{prop:"keyword",component:J(S),value:"",autoQuery:!1,attributes:{placeholder:c(()=>`${a("user.account")}/${a("user.nickname")}`)}}]},fixedHeight:!1,fetchData:x});async function x(r){const p=await k.v1Team.teamcontrollerApplylist({...r},{headers:v}),{rows:n,total:e}=p.data||{};i.value.data=n||[],i.value.pagination.total=e||0}function g(r,p,n){n.start(),k.v1Team.teamcontrollerHandleapply({applyId:r._id,isAgree:p},{headers:v}).then(()=>{i.value.data=i.value.data?.map(e=>(e._id===r._id&&(e.status=p?"approved":"rejected"),e)),j.success(a("message.success.operation"))}).finally(()=>{n.end()})}return(r,p)=>{const n=B,e=H,E=A;return u(),d("div",O,[t(s(z),{tableConfig:i.value,border:""},q({avatar:o(({col:m})=>[t(n,h(C(m)),{default:o(({row:l})=>[t(N,{src:l.userId.avatar,size:40},null,8,["src"])]),_:1},16)]),_:2},[s(T).isCreator?{name:"operation",fn:o(({col:m})=>[t(n,h(C(m)),{default:o(({row:l})=>[l.status==="pending"?(u(),d("div",Q,[t(s(M),null,{default:o(({instance:y,loading:b})=>[t(e,{type:"danger",loading:b,onClick:$=>g(l,!1,y)},{default:o(()=>[_(f(s(a)("team.reject")),1)]),_:1},8,["loading","onClick"]),t(e,{type:"primary",loading:b,onClick:$=>g(l,!0,y)},{default:o(()=>[_(f(s(a)("team.agree")),1)]),_:1},8,["loading","onClick"])]),_:2},1024)])):(u(),d("div",F,[t(E,{type:"info"},{default:o(()=>[_(f(l.status==="approved"?s(a)("team.approved"):s(a)("team.rejected")),1)]),_:2},1024)]))]),_:1},16)]),key:"0"}:void 0]),1032,["tableConfig"])])}}});export{pa as default};
