var C=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var Y=(n,d)=>{var i={};for(var t in n)H.call(n,t)&&d.indexOf(t)<0&&(i[t]=n[t]);if(n!=null&&C)for(var t of C(n))d.indexOf(t)<0&&I.call(n,t)&&(i[t]=n[t]);return i};import{l as P,o as $,j,_ as E}from"./index.js";import{u as O,B as U}from"./useTable-e949a6b7.js";import{T as N}from"./useForm-baba730a.js";import{j as _}from"./antd-0679333d.js";import{s as V,c as F,b as w,r as K}from"./userAuthorityApi-5e5c6315.js";import{u as z}from"./index-679d8a0a.js";import{_ as G}from"./drawer.vue_vue_type_script_setup_true_lang-95f18621.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_USER_AUTHORITY",__name:"index",setup(n){P();const d=$(),[i,{openDrawer:t}]=z(),[D,{reload:g,setSelectedRowKeys:ee}]=O({title:"用户权限对应表",api:e=>V(S(e)),columns:F,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"}}),S=e=>{const y=e,{pageNum:l,pageSize:u,field:p="id",order:c="descend"}=y,B=Y(y,["pageNum","pageSize","field","order"]),s={pageNum:l,pageSize:u,orderByClause:`${p} ${c==="descend"?"desc":"asc"}`};return Object.keys(B).forEach(f=>{const r=w.find(M=>M.field===f),o=e[f],a=f;r?o!==void 0&&o!==""&&(r.component==="Input"?s[a]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(r.component)?s[a]=j(o)?o.value:o:r.component==="RangePicker"?(s[`${a}From`]=_(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),s[`${a}To`]=_(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):r.component==="DatePicker"?s[a]=_(o).format(r.componentProps.format||"YYYY-MM-DD"):s[a]=o):s[a]=o}),s},T=()=>{t(!0,{isUpdate:!1})},v=e=>{t(!0,{record:e,isUpdate:!0})},R=e=>{K(e.id).then(l=>{g()})},k=()=>{g()},A=e=>{d("/system/user-authority/detail/"+e.id)};return(e,l)=>{const u=Z("a-button");return x(),q("div",null,[h(m(U),{onRegister:m(D)},{toolbar:b(()=>[h(u,{type:"primary",onClick:T},{default:b(()=>l[0]||(l[0]=[J(" 新增")])),_:1})]),bodyCell:b(({column:p,record:c})=>[p.dataIndex==="action"?(x(),L(m(N),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:v.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:R.bind(null,c),placement:"topRight"}}]},null,8,["actions","dropDownActions"])):Q("",!0)]),_:1},8,["onRegister"]),h(G,{onRegister:m(i),onSuccess:k},null,8,["onRegister"])])}}});const _e=E(X,[["__scopeId","data-v-dd25c025"]]);export{_e as default};
