Files
yusheng-admin/dist/static/js/hook-CJCd_xO4.js

2 lines
3.1 KiB
JavaScript
Raw Normal View History

2025-10-23 11:07:17 +08:00
var K=Object.defineProperty,j=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var P=(i,s,n)=>s in i?K(i,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[s]=n,M=(i,s)=>{for(var n in s||(s={}))E.call(s,n)&&P(i,n,s[n]);if(z)for(var n of z(s))G.call(s,n)&&P(i,n,s[n]);return i},L=(i,s)=>j(i,B(s));var o=(i,s,n)=>new Promise((_,d)=>{var I=c=>{try{t(n.next(c))}catch(f){d(f)}},S=c=>{try{t(n.throw(c))}catch(f){d(f)}},t=c=>c.done?_(c.value):Promise.resolve(c.value).then(I,S);t((n=n.apply(i,s)).next())});import{_ as H}from"./form.vue_vue_type_script_setup_true_lang-HMVJcCXl.js";import{n as u,aK as W,ag as q,aA as p}from"./index-CRmU-Qpi.js";import{q as J,g as Q,d as T,a as U,e as F}from"./admin-QtfaJQYK.js";import{_ as V}from"./password.vue_vue_type_script_setup_true_lang-BxW5V9xR.js";import"./permission-DJnI7MjS.js";function le(){const i=u(),s=u(!0),n=u([]),_=u(!1),d=u({total:0,pageSize:10,currentPage:1,pageSizes:[10,20,50,100],background:!0}),S=u([{type:"index",index:l=>l+1},{label:"用户名",prop:"username"},{label:"昵称",prop:"nickname"},{label:"邮箱",prop:"email"},{label:"手机",prop:"mobile"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),t=()=>o(this,null,function*(){s.value=!0;const{data:l,code:e}=yield J({});e&&(n.value=l.rows,d.value.total=l.rows.length),s.value=!1});return{onSearch:t,isShow:_,tableList:n,tableLabel:S,pagination:d,handleSizeChange:l=>{d.value.pageSize=l,t()},handleCurrentChange:l=>{d.value.currentPage=l,t()},loading:s,openDialog:(l="新增",e)=>o(this,null,function*(){var m,g,h,y,b,a,v,R;e.id&&(yield Q({id:e.id})),W({title:`${l}管理员`,props:{formInline:{id:(m=e==null?void 0:e.id)!=null?m:"",username:(g=e==null?void 0:e.username)!=null?g:"",nickname:(h=e==null?void 0:e.nickname)!=null?h:"",email:(y=e==null?void 0:e.email)!=null?y:"",mobile:(b=e==null?void 0:e.mobile)!=null?b:"",password:(a=e==null?void 0:e.password)!=null?a:"",status:(v=e==null?void 0:e.status)!=null?v:"",group:(R=e==null?void 0:e.groupids)!=null?R:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>q(H,{ref:i,formInline:null}),beforeSure:(k,{options:N})=>{const O=i.value.getRef(),x=N.props.formInline,$=r=>o(this,null,function*(){const{code:C}=yield U(r);C?(p("新增成功",{type:"success"}),t(),k()):p("新增失败",{type:"error"})}),A=r=>o(this,null,function*(){const{code:C}=yield F(L(M({},r),{id:e.id}));C?(p("修改成功",{type:"success"}),t(),k()):p("修改失败",{type:"error"})});O.validate(r=>{r&&(l==="新增"?$(x):A(x))})}})}),handleDelete:l=>o(this,null,function*(){const{code:e}=yield T({id:l.id});e&&(p("删除成功",{type:"success"}),t())}),settingPassWord:(l,e)=>{W({title:l,width:"40%",props:{formInline:{new_pwd:""}},closeOnClickModal:!1,contentRenderer:()=>q(V,{ref:i,formInline:null}),beforeSure:(m,{options:g})=>{const h=i.value.getRef(),y=g.props.formInline,b=a=>o(this,null,function*(){const{code:v}=yield F({password:a.new_pwd,id:e.id});v?(p("设置成功",{type:"success"}),t(),m()):p("设置失败",{type:"error"})});h.validate(a=>{a&&b({new_pwd:y.new_pwd,user_id:e.id})})}})}}}export{le as useData};