mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 13:34:13 +08:00
2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
import{B as g,u as v}from"./useTable-d1207d4e.js";import{T as C}from"./useForm-e7697b0a.js";import{S as w,r as S,s as T,t as B,_ as R}from"./index.js";import{u as k}from"./index-4d8a4acc.js";import{R as D,c as y,s as I}from"./drawer-d14164bb.js";import{d as $,l as A,o as E,a6 as t,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-9db9238b.js";import"./index-b65f63bb.js";import"./useWindowSizeFn-c13a0e28.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-e4460fb5.js";import"./authorityApi-323b0ce5.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(a=>{e.success("删除用户成功!"),l()},a=>{e.error(`删除用户失败:${a}`)})}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=t("SvgIcon"),d=t("a-button"),u=t("TableAction"),n=t("BasicTable"),a=t("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(a,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const ee=R(P,[["render",z],["__scopeId","data-v-90dcdd60"]]);export{ee as default};
|