var A=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var C=(a,p)=>{var i={};for(var o in a)K.call(a,o)&&p.indexOf(o)<0&&(i[o]=a[o]);if(a!=null&&A)for(var o of A(a))p.indexOf(o)<0&&z.call(a,o)&&(i[o]=a[o]);return i};import{j as G,k as L,m as W,l as Z}from"./index.js";import{u as q,B as J}from"./useTable-f8594a7b.js";import{T as Q}from"./useForm-322569b9.js";import{j as Y,N as X,P as ee}from"./antd-fb8ca017.js";import{s as te,r as oe,b as se}from"./authorityApi-dc76c7ff.js";import{u as ne}from"./index-922f0b14.js";import{_ as ae}from"./drawer.vue_vue_type_script_setup_true_lang-f9d2c764.js";import{c as re,s as E}from"./schema-3cd89a70.js";import{d as ie,f as le,a6 as ce,n as de,Z as m,_ as y,k as _,a5 as c,u as n,F as me,$ as H,a0 as ue,G as R,a4 as v,a8 as x,m as fe}from"./vue-08ef39cb.js";import"./index-9a268806.js";import"./useWindowSizeFn-40274562.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-bf4926ca.js";const pe={key:1},He=ie({name:"AUTH_SYSTEM_AUTHORITY",__name:"index",setup(a){const{createMessage:p}=Z(),{hasPermission:i}=G(),o=L(),u=le([]),M=e=>{u.value=e.filter(t=>typeof t!="undefined")},[U,{openDrawer:k}]=ne(),[I,{reload:g,setSelectedRowKeys:S}]=q({title:"权限表",api:e=>te(B(e)),columns:re,formConfig:{labelWidth:120,schemas:E,showAdvancedButton:!1},rowSelection:{type:"checkbox",onChange:M},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),B=e=>{const w=e,{pageNum:t,pageSize:h,field:b="id",order:T="descend"}=w,f=C(w,["pageNum","pageSize","field","order"]),r={pageNum:t,pageSize:h,orderByClause:`${b} ${T==="descend"?"desc":"asc"}`};return Object.keys(f).forEach(D=>{const d=E.find(V=>V.field===D),s=e[D],l=D;d?s!==void 0&&s!==""&&(d.component==="Input"?r[l]=`%${s.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(d.component)?r[l]=W(s)?s.value:s:d.component==="RangePicker"?(r[`${l}From`]=Y(s[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),r[`${l}To`]=Y(s[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):d.component==="DatePicker"?r[l]=Y(s).format(d.componentProps.format||"YYYY-MM-DD"):r[l]=s):r[l]=s}),r},O=()=>{k(!0,{isUpdate:!1})},P=e=>{k(!0,{record:e,isUpdate:!0})},$=e=>{oe(e.id).then(t=>{g(),S([])})},N=()=>{if(u.value.length===0){p.error("当前未选中任何项目！");return}se(u.value).then(e=>{g(),S([])})},j=()=>{g()},F=e=>{o("/system/authority/detail/"+e.id)};return(e,t)=>{const h=ce("a-button"),b=de("auth");return m(),y("div",null,[_(n(J),{onRegister:n(I)},{headerTop:c(()=>[_(n(X),{type:"info","show-icon":""},{message:c(()=>[u.value.length>0?(m(),y(me,{key:0},[H("span",null,"已选中"+ue(u.value.length)+"条记录",1),_(h,{type:"link",onClick:t[0]||(t[0]=T=>n(S)([])),size:"small"},{default:c(()=>t[1]||(t[1]=[R("清空")])),_:1}),n(i)("AUTH_SYSTEM_AUTHORITY:DELETE")?(m(),v(n(ee),{key:0,class:"ml-4",title:"确定要全部删除吗？","ok-text":"是","cancel-text":"否",onConfirm:N},{default:c(()=>t[2]||(t[2]=[H("a",{href:"#",class:"text-red-500"},"删除",-1)])),_:1})):x("",!0)],64)):(m(),y("span",pe,"未选中任何项目"))]),_:1})]),toolbar:c(()=>[fe((m(),v(h,{type:"primary",onClick:O},{default:c(()=>t[3]||(t[3]=[R(" 新增")])),_:1})),[[b,"AUTH_SYSTEM_AUTHORITY:ADD"]])]),bodyCell:c(({column:T,record:f})=>[T.dataIndex==="action"?(m(),v(n(Q),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:P.bind(null,f),ifShow:n(i)("AUTH_SYSTEM_AUTHORITY:EDIT"),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:F.bind(null,f),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:$.bind(null,f),placement:"topRight"},ifShow:n(i)("AUTH_SYSTEM_AUTHORITY:DELETE")}]},null,8,["actions","dropDownActions"])):x("",!0)]),_:1},8,["onRegister"]),_(ae,{onRegister:n(U),onSuccess:j},null,8,["onRegister"])])}}});export{He as default};
