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.7ea9c316.js";import{T as D}from"./useForm.6d8c74d3.js";import{a as $,aC as z,bP as I,o as d,h as E,p as f,y as C,w as K,j as k,z as P,k as s,l as B,cu as h,fT as W,fU as q,fV as G}from"./index.2d67f695.js";import{u as H}from"./index.b7dccfea.js";import{b as J}from"./index.668f43cb.js";import L from"./AccountDrawer.a493daba.js";import O from"./passwordModel.0502dfd5.js";import{c as Q,s as X}from"./account.data.355f6eb7.js";import"./index.be50a083.js";import"./Checkbox.7aeabef3.js";import"./index.ed73334e.js";import"./index.449f3f45.js";import"./index.71a40077.js";import"./index.f0b1b4f3.js";import"./useSize.afbbf7a8.js";import"./eagerComputed.a263e8bc.js";import"./onMountedOrActivated.84711fd1.js";import"./useWindowSizeFn.a1de7260.js";import"./useContentViewHeight.d3685a6c.js";import"./ArrowLeftOutlined.89c958a1.js";import"./transButton.caaf42fd.js";import"./index.052c8775.js";import"./index.a6c30269.js";import"./index.96fc7f2a.js";import"./index.067e7536.js";import"./dateUtil.411279a6.js";import"./_baseMerge.5dafd402.js";import"./_isIterateeCall.296204c7.js";import"./_baseEach.ffda1513.js";import"./get.fedb4b7c.js";import"./index.46989e11.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.4a02ad1f.js";import"./FullscreenOutlined.944e5604.js";import"./index.9f588f5b.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.77bac509.js";import"./scrollTo.26a09e8a.js";import"./index.5147a12e.js";import"./index.60bd948f.js";import"./index.47269ecc.js";import"./_baseIteratee.35e8d02a.js";import"./index.47e70fdb.js";import"./useRefs.593a31cc.js";import"./download.d8a7eb76.js";import"./index.de5f8d2c.js";import"./uniqBy.34ebbb75.js";import"./index.d41d4fb4.js";import"./md5.e3619890.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})},R=i=>c(this,null,function*(){yield W(i.id),h.success("\u5220\u9664\u6210\u529F"),n()}),T=i=>{t(!0,{id:i.id})},v=()=>{h.success("\u64CD\u4F5C\u6210\u529F")},x=i=>c(this,null,function*(){yield q(i.id),h.success("\u89E3\u5C01\u6210\u529F"),n()});return(i,F)=>{const p=z("a-button"),S=I("auth");return d(),E("div",null,[f(s(j),{onRegister:s(b)},{toolbar:C(()=>[K((d(),k(p,{type:"primary",onClick:r},{default:C(()=>[P(" \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: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:"super",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"]),f(L,{onRegister:s(_),onSuccess:u},null,8,["onRegister"]),f(O,{onRegister:s(e),onSuccess:v},null,8,["onRegister"])])}}});export{Ot as default};
|