import{u as e,r as a,b as t,ad as r,c as s,bQ as o,d as l,e as i,h as n,f as d,k as p,g as c,n as u,w as m,j as f,aO as g,E as b,q as v,p as j}from"./index.286e9b79.js";import{v as y}from"./loading.c49775a6.js";import{E as h}from"./pagination.22bb50f6.js";import{E as k}from"./input.31de1b37.js";/* empty css            */import"./select.297a82d5.js";import{E as w,a as x}from"./table-column.7b4f59a2.js";import"./checkbox.f06171a4.js";import{E as _,a as z}from"./form.ad10dcd5.js";import"./form-item.9355e6dc.js";import{E as C}from"./message-box.6a8eb828.js";import"./overlay.2c1583ac.js";import{g as E}from"./http.f588794f.js";import"./isEqual.57d72c4a.js";import"./_initCloneObject.fb8fbaea.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./strings.8c60bfae.js";import"./scroll.a50153b5.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";import"./validator.18338d56.js";const q={class:"search"},T={class:"search-box"},U={canplay:"search-wrap"},V={class:"table-wrap"},B={class:"table-box"},F={class:"toolbar"},O={class:"tabs-content"},R=n("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),S={class:"page"},G=n("div",{class:"l"},null,-1),I={class:"r"},P={__name:"index",setup(P){const Q=e(),W=a([]);let $=a(!1),A=a("all"),D=a();const H=t({keywords:"",current:1,size:10,total:0}),J=()=>{$.value=!0,H.active=A.value,E("users.group/index",H).then((e=>{$.value=!1,e.code?(W.value=e.data.list,H.total=e.data.total):b.error(e.msg)})).catch((e=>{$.value=!1,b.error(e)}))};r((()=>{J()}));const K=e=>{H.size=e,H.current=1,J()},L=e=>{H.current=e,J()},M=()=>{Q.push("/group/editor")},N=a(),X=t({keywords:""}),Y=()=>{if(X.keywords.trim().length<=0)return b({message:"请输入搜索关键字",type:"warning"}),!1;H.keywords=X.keywords,J()},Z=()=>{H.keywords="",J(),N.value.resetFields()};return(e,a)=>{const t=k,r=_,P=v,A=z,J=s("Warning"),ee=j,ae=w,te=x,re=h,se=o("auth"),oe=y;return l(),i("div",null,[n("div",q,[n("div",T,[n("div",U,[d(A,{ref_key:"searchFormRef",ref:N,inline:!0,model:c(X)},{default:p((()=>[d(r,{label:"搜索内容",prop:"keywords"},{default:p((()=>[d(t,{modelValue:c(X).keywords,"onUpdate:modelValue":a[0]||(a[0]=e=>c(X).keywords=e),placeholder:"请输入搜索信息",class:"search-item-box"},null,8,["modelValue"])])),_:1}),d(r,null,{default:p((()=>[d(P,{type:"primary",onClick:Y},{default:p((()=>[u("搜索")])),_:1}),d(P,{onClick:Z},{default:p((()=>[u("重置")])),_:1})])),_:1})])),_:1},8,["model"])])])]),n("div",V,[n("div",B,[n("div",F,[m((l(),f(P,{onClick:M},{default:p((()=>[u("添加")])),_:1})),[[se,"users.group/editor"]])]),n("div",O,[m((l(),f(te,{ref_key:"GoodsTableRef",ref:D,data:c(W),size:"large",style:{width:"100%"}},{empty:p((()=>[d(ee,{size:"18",style:{position:"relative",top:"4px"}},{default:p((()=>[d(J)])),_:1}),R])),default:p((()=>[d(ae,{type:"selection",width:"55"}),d(ae,{prop:"name",label:"分组名称","header-align":"center",align:"center"}),d(ae,{label:"操作","header-align":"center",align:"center",width:"150"},{default:p((e=>[m((l(),f(P,{type:"primary",size:"small",onClick:g((a=>{return t=e.row.id,void Q.push({path:"/group/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:p((()=>[u("编辑")])),_:2},1032,["onClick"])),[[se,"users.group/editor"]]),m((l(),f(P,{type:"danger",size:"small",onClick:g((a=>{return t=e.row.id,r=e.$index,void C.confirm("您确定要删除选中内容吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{E("users.group/delete",{id:t}).then((e=>{e.code?(W.value.splice(r,1),b.success("删除成功")):b.error(e.msg)}))}));var t,r}),["prevent"]),link:""},{default:p((()=>[u("删除")])),_:2},1032,["onClick"])),[[se,"users.group/delete"]])])),_:1})])),_:1},8,["data"])),[[oe,c($)]])]),n("div",S,[G,n("div",I,[d(re,{"current-page":c(H).current,"onUpdate:currentPage":a[1]||(a[1]=e=>c(H).current=e),"page-size":c(H).size,"onUpdate:pageSize":a[2]||(a[2]=e=>c(H).size=e),small:!0,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"prev, pager, next, jumper, sizes, total",total:c(H).total,onSizeChange:K,onCurrentChange:L},null,8,["current-page","page-size","total"])])])])])])}}};export{P as default};
