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((_,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?_(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.792cc9b8.js";import{T as D}from"./useForm.7bfdaab3.js";import{a as $,aC as I,bP as K,o as d,h as E,p as f,x as C,w as P,j as k,y as W,k as s,l as B,cu as h,fT as q,fU as z,fV as G}from"./index.10bef8d9.js";import{u as H}from"./index.11d0d4f7.js";import{b as J}from"./index.ebbd9b0a.js";import L from"./AccountDrawer.6b5d2cd6.js";import O from"./passwordModel.3622ac1d.js";import{c as Q,s as X}from"./account.data.f3a6e96a.js";import"./index.e2b21023.js";import"./Checkbox.3916bf4f.js";import"./index.2c46e1c2.js";import"./index.e1b248c7.js";import"./index.63bd55f9.js";import"./index.7d64c1fd.js";import"./useSize.a3cc155e.js";import"./eagerComputed.6cbc98cb.js";import"./onMountedOrActivated.1a52296b.js";import"./useWindowSizeFn.828b4ed1.js";import"./useContentViewHeight.34af3465.js";import"./ArrowLeftOutlined.00865997.js";import"./transButton.fa379ab6.js";import"./index.2cfaf595.js";import"./index.d11714a0.js";import"./index.04b03248.js";import"./index.603dbfe2.js";import"./dateUtil.9f7564f2.js";import"./_baseMerge.4ec785d2.js";import"./_isIterateeCall.048b9e2b.js";import"./_baseEach.9a9c295f.js";import"./get.54ea2f74.js";import"./index.7c202422.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.5e7f9ab6.js";import"./FullscreenOutlined.1a57dd79.js";import"./index.8d3663fe.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.f79ea720.js";import"./scrollTo.29e5c0fe.js";import"./index.405564ab.js";import"./index.6b7c6906.js";import"./index.ac844111.js";import"./_baseIteratee.ca4916de.js";import"./index.be423f4b.js";import"./useRefs.c7d6606b.js";import"./download.8b305a5b.js";import"./index.0fbf50e1.js";import"./uniqBy.3a475547.js";import"./index.88228e57.js";import"./md5.d699466e.js";const Y={key:0,class:"flex items-center justify-center"},Ot=$({__name:"index",setup(o){const[e,{openModal:t}]=J(),[_,{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=()=>{h.success("\u64CD\u4F5C\u6210\u529F"),n()},r=()=>{a(!0,{id:!1})},m=i=>{a(!0,{id:i.id,isUpdate:!0})},x=i=>c(this,null,function*(){yield q(i.id),h.success("\u5220\u9664\u6210\u529F"),n()}),R=i=>{t(!0,{id:i.id})},T=()=>{h.success("\u64CD\u4F5C\u6210\u529F")},v=i=>c(this,null,function*(){yield z(i.id),h.success("\u89E3\u5C01\u6210\u529F"),n()});return(i,F)=>{const p=I("a-button"),S=K("auth");return d(),E("div",null,[f(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,[f(s(D),{actions:[{label:"\u7F16\u8F91",onClick:m.bind(null,l),auth:"endpoint.admin_users.edit"},{label:"\u4FEE\u6539\u5BC6\u7801",onClick:R.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:x.bind(null,l)}}]},null,8,["actions"]),l.banned_at?(d(),k(s(D),{key:0,actions:[{label:"\u89E3\u5C01",auth:"super",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u89E3\u5C01\u8D26\u53F7",placement:"topRight",confirm:v.bind(null,l)}}]},null,8,["actions"])):B("",!0)])):B("",!0)]),_:1},8,["onRegister"]),f(L,{onRegister:s(_),onSuccess:u},null,8,["onRegister"]),f(O,{onRegister:s(e),onSuccess:T},null,8,["onRegister"])])}}});export{Ot as default};
|