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.a44c6a23.js";import{T as D}from"./useForm.d5b43e2d.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.1f7d25e9.js";import{u as H}from"./index.187f904b.js";import{b as J}from"./index.e980f1c4.js";import L from"./AccountDrawer.3f628381.js";import O from"./passwordModel.318ae12b.js";import{c as Q,s as X}from"./account.data.dae91656.js";import"./index.d7098dbd.js";import"./Checkbox.36b5df89.js";import"./index.7275e559.js";import"./index.46b54a73.js";import"./index.95a5c9e5.js";import"./index.1c593919.js";import"./useSize.99a4f943.js";import"./eagerComputed.9246bd1b.js";import"./onMountedOrActivated.36e055c5.js";import"./useWindowSizeFn.793e718b.js";import"./useContentViewHeight.8d11d5bb.js";import"./ArrowLeftOutlined.8bba6732.js";import"./transButton.d6e0d56f.js";import"./index.04c37fba.js";import"./index.c1b07704.js";import"./index.f8460443.js";import"./index.868c43ec.js";import"./dateUtil.c30f15a5.js";import"./_baseMerge.8959575a.js";import"./_isIterateeCall.1c2e901f.js";import"./_baseEach.72947e09.js";import"./get.f554c0ea.js";import"./index.d73d7311.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.e38d7363.js";import"./FullscreenOutlined.57336edf.js";import"./index.bc7521b5.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.953abb63.js";import"./scrollTo.a6082086.js";import"./index.658a3a14.js";import"./index.241abd4a.js";import"./index.a5a5ac20.js";import"./_baseIteratee.9a6d11c8.js";import"./index.1c376dc3.js";import"./useRefs.533ff99f.js";import"./download.73fec536.js";import"./index.5eeaea1a.js";import"./uniqBy.a47dd7b5.js";import"./index.92775e2c.js";import"./md5.ffba7add.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};
|