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.c7e44100.js";import{T as D}from"./useForm.00f4ca4b.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.203f4f59.js";import{u as H}from"./index.659a3b4b.js";import{b as J}from"./index.2df2f55e.js";import L from"./AccountDrawer.1d5aeb69.js";import O from"./passwordModel.5bb4150a.js";import{c as Q,s as X}from"./account.data.5baffa6b.js";import"./index.591fff11.js";import"./Checkbox.7e429acc.js";import"./index.110550df.js";import"./index.69680028.js";import"./index.2ae54a5f.js";import"./index.e73e6cfc.js";import"./useSize.b54d9f00.js";import"./eagerComputed.543f2a69.js";import"./onMountedOrActivated.1c54c33a.js";import"./useWindowSizeFn.c9935f53.js";import"./useContentViewHeight.7130ce69.js";import"./ArrowLeftOutlined.96202fc8.js";import"./transButton.e0e63a17.js";import"./index.41982f04.js";import"./index.7d012f39.js";import"./index.f7891775.js";import"./index.f088aa20.js";import"./dateUtil.dbb1f8a5.js";import"./_baseMerge.f81cc583.js";import"./_isIterateeCall.46a90246.js";import"./_baseEach.1e1090eb.js";import"./get.8707ab1b.js";import"./index.c64eb697.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.42264666.js";import"./FullscreenOutlined.e6752e93.js";import"./index.c7b50250.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.55559160.js";import"./scrollTo.dc8ad3b7.js";import"./index.940eaa5c.js";import"./index.3d3fb3fd.js";import"./index.71283b4e.js";import"./_baseIteratee.d4400dec.js";import"./index.07575255.js";import"./useRefs.432b35dd.js";import"./download.af366e23.js";import"./index.886f9be4.js";import"./uniqBy.e27e2980.js";import"./index.0d50a5eb.js";import"./md5.fba10b59.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};
|