var C=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var Y=(a,d)=>{var i={};for(var t in a)H.call(a,t)&&d.indexOf(t)<0&&(i[t]=a[t]);if(a!=null&&C)for(var t of C(a))d.indexOf(t)<0&&I.call(a,t)&&(i[t]=a[t]);return i};import{l as P,o as $,j,_ as O}from"./index.js";import{u as E,B as N}from"./useTable-e949a6b7.js";import{T as U}from"./useForm-baba730a.js";import{j as _}from"./antd-0679333d.js";import{s as V,r as F}from"./authorityApi-b12c1221.js";import{u as K}from"./index-679d8a0a.js";import{_ as z}from"./drawer.vue_vue_type_script_setup_true_lang-52006c48.js";import{c as G,s as w}from"./schema-9d07929f.js";import{d as W,a6 as Z,Z as x,_ as q,k as h,a5 as b,G as J,a4 as L,u as m,a8 as Q}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const X=W({name:"AUTH_SYSTEM_AUTHORITY",__name:"index",setup(a){P();const d=$(),[i,{openDrawer:t}]=K(),[D,{reload:g,setSelectedRowKeys:ee}]=E({title:"权限表",api:e=>V(T(e)),columns:G,formConfig:{labelWidth:120,schemas:w,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),T=e=>{const y=e,{pageNum:l,pageSize:p,field:u="id",order:c="descend"}=y,B=Y(y,["pageNum","pageSize","field","order"]),n={pageNum:l,pageSize:p,orderByClause:`${u} ${c==="descend"?"desc":"asc"}`};return Object.keys(B).forEach(f=>{const r=w.find(M=>M.field===f),o=e[f],s=f;r?o!==void 0&&o!==""&&(r.component==="Input"?n[s]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(r.component)?n[s]=j(o)?o.value:o:r.component==="RangePicker"?(n[`${s}From`]=_(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),n[`${s}To`]=_(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):r.component==="DatePicker"?n[s]=_(o).format(r.componentProps.format||"YYYY-MM-DD"):n[s]=o):n[s]=o}),n},v=()=>{t(!0,{isUpdate:!1})},S=e=>{t(!0,{record:e,isUpdate:!0})},k=e=>{F(e.id).then(l=>{g()})},R=()=>{g()},A=e=>{d("/system/authority/detail/"+e.id)};return(e,l)=>{const p=Z("a-button");return x(),q("div",null,[h(m(N),{onRegister:m(D)},{toolbar:b(()=>[h(p,{type:"primary",onClick:v},{default:b(()=>l[0]||(l[0]=[J(" 新增")])),_:1})]),bodyCell:b(({column:u,record:c})=>[u.dataIndex==="action"?(x(),L(m(U),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:S.bind(null,c),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:A.bind(null,c),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:k.bind(null,c),placement:"topRight"}}]},null,8,["actions","dropDownActions"])):Q("",!0)]),_:1},8,["onRegister"]),h(z,{onRegister:m(i),onSuccess:R},null,8,["onRegister"])])}}});const he=O(X,[["__scopeId","data-v-0e16eaba"]]);export{he as default};
