var B=Object.defineProperty,E=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var U=(t,l,a)=>l in t?B(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a,y=(t,l)=>{for(var a in l||(l={}))N.call(l,a)&&U(t,a,l[a]);if(x)for(var a of x(l))V.call(l,a)&&U(t,a,l[a]);return t},M=(t,l)=>E(t,K(l));var p=(t,l,a)=>new Promise((R,n)=>{var C=i=>{try{g(a.next(i))}catch(_){n(_)}},o=i=>{try{g(a.throw(i))}catch(_){n(_)}},g=i=>i.done?R(i.value):Promise.resolve(i.value).then(C,o);g((a=a.apply(t,l)).next())});import{_ as j}from"./form.vue_vue_type_script_setup_true_lang-DWkvuK7p.js";import{_ as G}from"./memberList.vue_vue_type_script_setup_true_lang-BIA3qUx3.js";import{_ as H}from"./roomList.vue_vue_type_script_setup_true_lang-C3mqxAhb.js";import{_ as J}from"./mergeForm.vue_vue_type_script_setup_true_lang-CBC0VMWv.js";import{n as d,b as z,r as $,aA as r,aK as b,ag as S,fI as Q}from"./index-CRmU-Qpi.js";import{q as T,d as W,g as X,c as Y,a as Z,e as w}from"./union-ZelC57cN.js";import"./index-An8nOBwL.js";import"./index.vue_vue_type_script_setup_true_lang-B9ljupwd.js";import"./hooks-ItYVRz1P.js";import"./xlsx-DaVhO591.js";function he(){const t=d(),l=d(!0),a=d([]),R=d(!1),n=d({search_id:"",search_name:"",search_stime:"",search_etime:""}),C=d([{label:"公会ID",prop:"search_id",type:"input"},{label:"公会名称",prop:"search_name",type:"input"},{label:"添加时间",prop:"search_stime",type:"date"},{label:"结束时间",prop:"search_etime",type:"date"}]),o=d({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),g=d([{type:"selection",align:"left"},{label:"公会号",prop:"code_id"},{label:"公会名称",prop:"guild_name"},{label:"公会靓号",prop:"guild_special_id"},{label:"会长ID-昵称",prop:"user_name"},{label:"封面图",prop:"guild_logo",cellRenderer:({row:e})=>z($("el-image"),{fit:"cover","preview-teleported":!0,src:e.guild_logo,"preview-src-list":Array.of(e.guild_logo),class:"w-[24px] h-[24px] align-middle"},null)},{label:"今日流水",prop:"today_money"},{label:"公会状态",prop:"status_str",cellRenderer:({row:e})=>z($("el-tag"),{type:e.status_str==="正常"?"success":"error"},{default:()=>[e.status_str]})},{label:"显示状态",prop:"is_show",cellRenderer:({row:e})=>z("div",null,[e.status_str==="正常"?e.is_show_str:"-"])},{label:"创建时间",prop:"createtime"},{label:"操作",fixed:"right",width:300,slot:"operation"}]),i=e=>p(this,null,function*(){l.value=!0,n.value=y({},e);const{data:s,code:c}=yield T(M(y({},e),{page:o.value.currentPage,page_limit:o.value.pageSize}));c&&(a.value=s.list,o.value.total=s.count,o.value.currentPage=s.page),l.value=!1});return{searchForm:n,searchLabel:C,onSearch:i,isShow:R,tableList:a,tableLabel:g,pagination:o,handleSizeChange:e=>{o.value.pageSize=e,i(n.value)},handleCurrentChange:e=>{o.value.currentPage=e,i(n.value)},loading:l,handleDelete:e=>p(this,null,function*(){const{code:s}=yield W({id:e.id});s==="0"&&(r(`您删除了公会名称为【${e.guild_name}】的这条数据`,{type:"success"}),i(n.value))}),openDialog:(e="新增",s)=>{var c,u,f,h,v;b({title:`${e}分类`,props:{formInline:{guild_special_id:(c=s==null?void 0:s.guild_special_id)!=null?c:"",user_id:(u=s==null?void 0:s.user_id)!=null?u:"",guild_name:(f=s==null?void 0:s.guild_name)!=null?f:"",guild_desc:(h=s==null?void 0:s.guild_desc)!=null?h:"",guild_logo:(v=s==null?void 0:s.guild_logo)!=null?v:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>S(j,{ref:t,formInline:null}),beforeSure:(L,{options:O})=>{const P=t.value.getRef(),k=O.props.formInline,F=m=>p(this,null,function*(){const{code:I,msg:A}=yield Z(m);I?(r("新增成功",{type:"success"}),i(n.value),L()):r(A,{type:"error"})}),q=m=>p(this,null,function*(){const{code:I}=yield w(M(y({},m),{id:s.id}));I?(r("修改成功",{type:"success"}),i(n.value),L()):r("修改失败",{type:"error"})});P.validate(m=>{m&&(e==="新增"?F(k):q(k))})}})},viewMember:e=>{b({title:"查看成员列表",props:{rowData:e},width:"60%",closeOnClickModal:!1,contentRenderer:()=>S(G),beforeSure:s=>{s()}})},viewRoomList:e=>{b({title:"查看房间列表",props:{rowData:e},width:"60%",closeOnClickModal:!1,contentRenderer:()=>S(H),beforeSure:s=>{s()}})},changeShowStatus:e=>p(this,null,function*(){const{data:s,code:c,msg:u}=yield Y({id:e.id});c?(r("操作成功",{type:"success"}),i(n.value)):r(u,{type:"error"})}),mergeData:()=>p(this,null,function*(){b({title:"合并公会",props:{formInline:{guild_id:"",merge_guild_id:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>S(J,{ref:t,formInline:null}),beforeSure:(e,{options:s})=>{const c=t.value.getRef(),u=s.props.formInline;c.validate(f=>{f&&Q.confirm("此操作不可更改,是否继续?","提示",{type:"warning"}).then(()=>p(this,null,function*(){const{code:h,msg:v}=yield X(u);h?(r("操作成功",{type:"success"}),i(n.value),e()):r(v,{type:"error"})})).catch(()=>{})})}})})}}export{he as useData};