detect/detect.gui/Embedded/dist/assets/index-f87222c9.js
2024-11-13 17:09:15 +08:00

2 lines
2.4 KiB
JavaScript

import{B as g,u as C}from"./useTable-f8594a7b.js";import{T as v}from"./useForm-322569b9.js";import{S as w,r as T,l as B,s as S,_ as R}from"./index.js";import{u as k}from"./index-922f0b14.js";import{R as D,c as y,s as I}from"./drawer-e97b5bda.js";import{O as $}from"./antd-fb8ca017.js";import{d as A,l 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 O}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";import"./authorityApi-15a5fdf7.js";const P=A({name:"UserPage",methods:{PlusOutlined:$,h:E},components:{SvgIcon:w,BasicTable:g,RoleDrawer:D,TableAction:v},setup(){const{createMessage:e}=B(),[o,{openDrawer:i}]=k(),[p,{reload:l}]=C({api:S,columns:y,formConfig:{labelWidth:0,schemas:I,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,pagination:!1,actionColumn:{width:80,title:"操作",dataIndex:"action",fixed:void 0}});function f(){i(!0,{isUpdate:!1})}function c(t){i(!0,{record:t,isUpdate:!0})}function u(t){T(t.id).then(n=>{e.success("删除用户成功!"),l()},n=>{e.error(`删除用户失败:${n}`)})}function d(){l()}return{registerTable:p,registerDrawer:o,handleCreate:f,handleEdit:c,handleDelete:u,handleSuccess:d}}});const U={class:"header"};function x(e,o,i,p,l,f){const c=a("SvgIcon"),u=a("a-button"),d=a("TableAction"),t=a("BasicTable"),n=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(t,{onRegister:e.registerTable},{toolbar:m(()=>[r(u,{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(d,{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"])):O("",!0)]),_:1},8,["onRegister"]),r(n,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const Y=R(P,[["render",x],["__scopeId","data-v-f25e0200"]]);export{Y as default};