2 lines
4.1 KiB
JavaScript
2 lines
4.1 KiB
JavaScript
var M=Object.defineProperty;var g=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var w=(o,e,t)=>e in o?M(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,y=(o,e)=>{for(var t in e||(e={}))V.call(e,t)&&w(o,t,e[t]);if(g)for(var t of g(e))A.call(e,t)&&w(o,t,e[t]);return o};var c=(o,e,t)=>new Promise((h,a)=>{var b=r=>{try{u(t.next(r))}catch(m){a(m)}},n=r=>{try{u(t.throw(r))}catch(m){a(m)}},u=r=>r.done?h(r.value):Promise.resolve(r.value).then(b,n);u((t=t.apply(o,e)).next())});import{u as N,B as j}from"./useTable.0fe7b343.js";import{T as D}from"./useForm.501f3f59.js";import{a as $,aE as I,bP as K,o as d,h as E,p as _,B as C,y as P,j as k,D as W,k as s,l as B,cu as f,fT as q,fU as z,fV as G}from"./index.ed5deffd.js";import{u as H}from"./index.a73969f1.js";import{b as J}from"./index.5b432cd4.js";import L from"./AccountDrawer.e4307871.js";import O from"./passwordModel.71b50f74.js";import{c as Q,s as X}from"./account.data.29c65afa.js";import"./index.57e79dcc.js";import"./Checkbox.0ade27c0.js";import"./index.dfe580e1.js";import"./index.271eb465.js";import"./index.0292c9d3.js";import"./index.78c12dec.js";import"./useSize.f4cf68f5.js";import"./eagerComputed.890ab31a.js";import"./onMountedOrActivated.9d9d02f7.js";import"./useWindowSizeFn.a262cec0.js";import"./useContentViewHeight.b8e37cbd.js";import"./ArrowLeftOutlined.9abfd432.js";import"./transButton.f4575a26.js";import"./index.d726974a.js";import"./index.8d83801a.js";import"./index.cf1b1f15.js";import"./index.afc21ce4.js";import"./dateUtil.91a9b59f.js";import"./_baseMerge.9fac86cf.js";import"./_isIterateeCall.779fe698.js";import"./_baseEach.aed94d5c.js";import"./get.b38b45ae.js";import"./index.cca952d1.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.a1f78ebd.js";import"./FullscreenOutlined.a18420c1.js";import"./index.af1b13fa.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.51b9ef19.js";import"./scrollTo.707f46cf.js";import"./index.3b4e2932.js";import"./index.09a74575.js";import"./index.f6ae7164.js";import"./_baseIteratee.7c3a5712.js";import"./index.272fae53.js";import"./useRefs.045d664d.js";import"./download.b80ee91a.js";import"./index.c3b59272.js";import"./uniqBy.6fa12436.js";import"./index.141e5e7b.js";import"./md5.24fc5fe1.js";const Y={key:0,class:"flex items-center justify-center"},Ot=$({__name:"index",setup(o){const[e,{openModal:t}]=J(),[h,{openDrawer:a}]=H(),[b,{reload:n}]=N({title:"\u8D26\u53F7\u5217\u8868",api:i=>c(this,null,function*(){const{data:F,meta:p}=yield G(y({},i));return{items:F,total:p==null?void 0:p.total}}),rowKey:"id",columns:Q,formConfig:{labelWidth:120,schemas:X},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),u=()=>{f.success("\u64CD\u4F5C\u6210\u529F"),n()},r=()=>{a(!0,{id:!1})},m=i=>{a(!0,{id:i.id,isUpdate:!0})},R=i=>c(this,null,function*(){yield q(i.id),f.success("\u5220\u9664\u6210\u529F"),n()}),T=i=>{t(!0,{id:i.id})},v=()=>{f.success("\u64CD\u4F5C\u6210\u529F")},x=i=>c(this,null,function*(){yield z(i.id),f.success("\u89E3\u5C01\u6210\u529F"),n()});return(i,F)=>{const p=I("a-button"),S=K("auth");return d(),E("div",null,[_(s(j),{onRegister:s(b)},{toolbar:C(()=>[P((d(),k(p,{type:"primary",onClick:r},{default:C(()=>[W(" \u65B0\u589E\u8D26\u53F7 ")]),_:1})),[[S,"endpoint.admin_users.create"]])]),bodyCell:C(({column:U,record:l})=>[U.key==="action"?(d(),E("div",Y,[_(s(D),{actions:[{label:"\u7F16\u8F91",onClick:m.bind(null,l),auth:"endpoint.admin_users.edit"},{label:"\u4FEE\u6539\u5BC6\u7801",onClick:T.bind(null,l),auth:"endpoint.admin_users.edit_password"},{label:"\u5220\u9664",auth:"endpoint.admin_users.destroy",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:R.bind(null,l)}}]},null,8,["actions"]),l.banned_at?(d(),k(s(D),{key:0,actions:[{label:"\u89E3\u5C01",auth:"endpoint.admin_users.unban",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u89E3\u5C01\u8D26\u53F7",placement:"topRight",confirm:x.bind(null,l)}}]},null,8,["actions"])):B("",!0)])):B("",!0)]),_:1},8,["onRegister"]),_(L,{onRegister:s(h),onSuccess:u},null,8,["onRegister"]),_(O,{onRegister:s(e),onSuccess:v},null,8,["onRegister"])])}}});export{Ot as default};
|