import{u as e,r as a,b as t,ad as s,c as r,bQ as i,d as l,e as o,h as d,f as n,k as p,g as c,n as m,w as u,j as f,aO as b,E as v,q as g,p as y}from"./index.286e9b79.js";import{v as j}from"./loading.c49775a6.js";import{E as w}from"./pagination.22bb50f6.js";import{E as h}from"./input.31de1b37.js";/* empty css            */import"./select.297a82d5.js";import{E as k,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=d("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),S={class:"page"},G=d("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("system.purview/index",H).then((e=>{$.value=!1,e.code?(W.value=e.data.list,H.total=e.data.total):v.error(e.msg)})).catch((e=>{$.value=!1,v.error(e)}))};s((()=>{J()}));const K=e=>{H.size=e,H.current=1,J()},L=e=>{H.current=e,J()},M=()=>{Q.push("/system/purview/editor")},N=a(),X=t({keywords:""}),Y=()=>{if(X.keywords.trim().length<=0)return v({message:"请输入搜索关键字",type:"warning"}),!1;H.keywords=X.keywords,J()},Z=()=>{H.keywords="",J(),N.value.resetFields()};return(e,a)=>{const t=h,s=_,P=g,A=z,J=r("Warning"),ee=y,ae=k,te=x,se=w,re=i("auth"),ie=j;return l(),o("div",null,[d("div",q,[d("div",T,[d("div",U,[n(A,{ref_key:"searchFormRef",ref:N,inline:!0,model:c(X)},{default:p((()=>[n(s,{label:"搜索内容",prop:"keywords"},{default:p((()=>[n(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}),n(s,null,{default:p((()=>[n(P,{type:"primary",onClick:Y},{default:p((()=>[m("搜索")])),_:1}),n(P,{onClick:Z},{default:p((()=>[m("重置")])),_:1})])),_:1})])),_:1},8,["model"])])])]),d("div",V,[d("div",B,[d("div",F,[n(P,{onClick:M},{default:p((()=>[m("添加")])),_:1})]),d("div",O,[u((l(),f(te,{ref_key:"GoodsTableRef",ref:D,data:c(W),size:"large",style:{width:"100%"}},{empty:p((()=>[n(ee,{size:"18",style:{position:"relative",top:"4px"}},{default:p((()=>[n(J)])),_:1}),R])),default:p((()=>[n(ae,{type:"selection",width:"55"}),n(ae,{prop:"title",label:"权限名称","header-align":"center",align:"center"}),n(ae,{label:"操作",fixed:"right","header-align":"center",align:"center",width:"150"},{default:p((e=>[u((l(),f(P,{disabled:1==e.row.lock,type:"primary",size:"small",onClick:b((a=>{return t=e.row.id,void Q.push({path:"/system/purview/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:p((()=>[m("编辑")])),_:2},1032,["disabled","onClick"])),[[re,"system.purview/editor"]]),u((l(),f(P,{disabled:1==e.row.lock,type:"danger",size:"small",onClick:b((a=>{return t=e.row.id,s=e.$index,void C.confirm("您确定要删除选中内容吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{E("system.purview/delete",{id:t}).then((e=>{e.code?(W.value.splice(s,1),v.success("删除成功")):v.error(e.msg)}))}));var t,s}),["prevent"]),link:""},{default:p((()=>[m("删除")])),_:2},1032,["disabled","onClick"])),[[re,"system.purview/delete"]])])),_:1})])),_:1},8,["data"])),[[ie,c($)]])]),d("div",S,[G,d("div",I,[n(se,{"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};
