import{B as g,u as v}from"./useTable-e949a6b7.js";import{T as C}from"./useForm-baba730a.js";import{S as w,r as S,q as T,s as B,_ as R}from"./index.js";import{u as k}from"./index-679d8a0a.js";import{R as D,c as y,s as I}from"./drawer-b1df0d5f.js";import{d as $,l as A,o as E,a6 as a,Z as _,_ as F,$ as h,k as r,a5 as m,G as N,a4 as V,a8 as x}from"./vue-72a104e4.js";import{N as M}from"./antd-0679333d.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";import"./authorityApi-b12c1221.js";const P=$({name:"UserPage",methods:{PlusOutlined:M,h:A},components:{SvgIcon:w,BasicTable:g,RoleDrawer:D,TableAction:C},setup(){const{createMessage:e}=T(),[o,{openDrawer:i}]=k(),[p,{reload:l}]=v({api:B,columns:y,formConfig:{labelWidth:0,schemas:I,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,pagination:!1,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});function f(){i(!0,{isUpdate:!1})}function c(n){i(!0,{record:n,isUpdate:!0})}function d(n){S(n.id).then(t=>{e.success("删除用户成功！"),l()},t=>{e.error(`删除用户失败：${t}`)})}function u(){l()}return E(()=>{WebViewService.setIsLoading(!1).then(()=>{})}),{registerTable:p,registerDrawer:o,handleCreate:f,handleEdit:c,handleDelete:d,handleSuccess:u}}});const U={class:"header"};function z(e,o,i,p,l,f){const c=a("SvgIcon"),d=a("a-button"),u=a("TableAction"),n=a("BasicTable"),t=a("RoleDrawer");return _(),F("div",null,[h("div",U,[r(c,{size:"19",name:"list"}),o[0]||(o[0]=h("div",{class:"title"},"用户列表",-1))]),r(n,{onRegister:e.registerTable},{toolbar:m(()=>[r(d,{type:"primary",onClick:e.handleCreate,icon:e.h(e.PlusOutlined)},{default:m(()=>o[1]||(o[1]=[N("新 增")])),_:1},8,["onClick","icon"])]),bodyCell:m(({column:b,record:s})=>[b.key==="action"?(_(),V(u,{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,s),divider:!0,disabled:s.username==="admin"},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:e.handleDelete.bind(null,s),placement:"topRight"},disabled:s.username==="admin"}]},null,8,["actions"])):x("",!0)]),_:1},8,["onRegister"]),r(t,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const ee=R(P,[["render",z],["__scopeId","data-v-90dcdd60"]]);export{ee as default};
