mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 13:34:13 +08:00
2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{B as g,u as v}from"./useTable-30a173d2.js";import{T as C}from"./useForm-da122ba5.js";import{S as w,r as T,o as B,s as S,_ as R}from"./index.js";import{u as k}from"./index-82593f0d.js";import{R as D,c as y,s as I}from"./drawer-a3ad9fdc.js";import{d as $,l as A,a6 as a,Z as _,_ as E,$ as h,k as r,a5 as m,G as F,a4 as N,a8 as V}from"./vue-08ef39cb.js";import{N as x}from"./antd-86d2ef3c.js";import"./index-3c4a1ed6.js";import"./useWindowSizeFn-46f0db92.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-9a0fd4f0.js";import"./authorityApi-b12c1221.js";const P=$({name:"UserPage",methods:{PlusOutlined:x,h:A},components:{SvgIcon:w,BasicTable:g,RoleDrawer:D,TableAction:C},setup(){const{createMessage:e}=B(),[o,{openDrawer:i}]=k(),[p,{reload:l}]=v({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:180,title:"操作",dataIndex:"action",fixed:void 0}});function f(){i(!0,{isUpdate:!1})}function c(n){i(!0,{record:n,isUpdate:!0})}function u(n){T(n.id).then(t=>{e.success("删除用户成功!"),l()},t=>{e.error(`删除用户失败:${t}`)})}function d(){l()}return{registerTable:p,registerDrawer:o,handleCreate:f,handleEdit:c,handleDelete:u,handleSuccess:d}}});const U={class:"header"};function z(e,o,i,p,l,f){const c=a("SvgIcon"),u=a("a-button"),d=a("TableAction"),n=a("BasicTable"),t=a("RoleDrawer");return _(),E("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(u,{type:"primary",onClick:e.handleCreate,icon:e.h(e.PlusOutlined)},{default:m(()=>o[1]||(o[1]=[F("新增")])),_:1},8,["onClick","icon"])]),bodyCell:m(({column:b,record:s})=>[b.key==="action"?(_(),N(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"])):V("",!0)]),_:1},8,["onRegister"]),r(t,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const Y=R(P,[["render",z],["__scopeId","data-v-87c55e0c"]]);export{Y as default};
|