TmallWeb-dist/js/account-information.B4PmwtDo.js

2 lines
5.0 KiB
JavaScript
Raw Normal View History

2025-08-09 19:15:33 +08:00
import{ag as a,r as e,o,bU as l,bV as i,c as s,e as t,m as d,N as n,w as r,l as g,an as u,O as p,g as _,bv as c,bw as m,am as w,R as D,a_ as b,bu as L}from"./index.CvHI241L.js";import{_ as f}from"./index.BO4Zm8Vx.js";import{c as h,a as v}from"./account.YTepH484.js";import"./el-col.kvWDRKmP.js";const y={class:"operate"},V={class:"dialog-footer"},k={__name:"account-information",setup(k){const F=a({columns:[{prop:"user_name",label:"名称",width:100},{prop:"id",label:"编号",width:100},{prop:"user_name",label:"用户名称",width:100},{prop:"user_name",label:"登录账户",width:100},{prop:"remark",label:"备注",width:100},{prop:"status",label:"状态",width:100,slot:"status"},{prop:"created_at",label:"创建时间",width:180},{prop:"operate",label:"操作",width:240,slot:"operate",align:"center",fixed:"right"}],tableData:[],searchFields:[],eidtLoginDialog:{title:"",showAddDialog:!1,btnLoading:!1,rules:{old_password:[{required:!0,message:"请输入密码",trigger:"blur"}],new_password:[{required:!0,message:"请输入密码",trigger:"blur"}],confirm_password:[{required:!0,message:"请输入确认密码",trigger:"blur"},{validator:(a,e,o)=>{""===e?o(new Error("请再次输入新密码")):e!==F.eidtLoginDialog.values.new_password?o(new Error("两次输入的密码不一致")):o()},trigger:"blur"}]},values:{old_password:"",new_password:"",confirm_password:""}},paginationSlot:!1,loading:!1}),x=e();o(()=>{A()});const A=()=>{F.loading=!0,l().then(a=>{F.tableData=[a],F.total=0,F.loading=!1}).catch(()=>{F.loading=!1})},C=()=>{x.value&&x.value.resetFields(),F.eidtLoginDialog.showAddDialog=!1},U=async()=>{await x.value.validate((a,e)=>{if(a){let a=null;F.eidtLoginDialog.btnLoading=!0;let e=null;"修改登录密码"==F.eidtLoginDialog.title?(e=F.eidtLoginDialog.values,a=h):(e={old_pay_password:F.eidtLoginDialog.values.old_password,new_pay_password:F.eidtLoginDialog.values.new_password,confirm_pay_password:F.eidtLoginDialog.values.confirm_password},a=v),a(e).then(a=>{L.success(F.eidtLoginDialog.title+"成功"),F.eidtLoginDialog.showAddDialog=!1,F.eidtLoginDialog.btnLoading=!1}).catch(()=>{F.eidtLoginDialog.btnLoading=!1})}})};return(a,e)=>{const o=u,l=w,L=m,h=c,v=b,k=i("click-debounce");return t(),s("div",null,[(t(),d(f,{type:"account-information",columns:_(F).columns,searchFields:_(F).searchFields,"onUpdate:searchFields":e[0]||(e[0]=a=>_(F).searchFields=a),data:_(F).tableData,showRightRefreshSlot:!1,paginationSlot:!1,onGetTableData:A,loading:_(F).loading,name:"account-information",key:"account-information"},{status:r(({row:a})=>[1==a.status?(t(),d(o,{key:0,type:"success",size:"small",disabled:""},{default:r(()=>e[6]||(e[6]=[p("正常")])),_:1,__:[6]})):(t(),d(o,{key:1,type:"warning",size:"small",disabled:""},{default:r(()=>e[7]||(e[7]=[p("不正常")])),_:1,__:[7]}))]),operate:r(({row:a,$index:l})=>[g("div",y,[n(o,{size:"small",type:"primary",onClick:a=>(F.eidtLoginDialog.title="修改登录密码",void(F.eidtLoginDialog.showAddDialog=!0))},{default:r(()=>e[8]||(e[8]=[p(" 修改登录密码 ")])),_:2,__:[8]},1032,["onClick"]),n(o,{size:"small",type:"danger",onClick:a=>(F.eidtLoginDialog.title="修改支付密码",void(F.eidtLoginDialog.showAddDialog=!0))},{default:r(()=>e[9]||(e[9]=[p(" 修改支付密码 ")])),_:2,__:[9]},1032,["onClick"])])]),_:1},8,["columns","searchFields","data","loading"])),n(v,{title:_(F).eidtLoginDialog.title,"model-value":_(F).eidtLoginDialog.showAddDialog,onClose:C,"destroy-on-close":!0,"close-on-click-modal":!1,center:"",style:{"max-width":"600px"}},{footer:r(()=>[g("span",V,[n(o,{onClick:e[5]||(e[5]=a=>_(F).eidtLoginDialog.showAddDialog=!1)},{default:r(()=>e[10]||(e[10]=[p("取消")])),_:1,__:[10]}),D((t(),d(o,{type:"primary",loading:_(F).eidtLoginDialog.btnLoading},{default:r(()=>e[11]||(e[11]=[p("确定")])),_:1,__:[11]},8,["loading"])),[[k,U]])])]),default:r(()=>[n(h,{"label-width":"auto",rules:_(F).eidtLoginDialog.rules,model:_(F).eidtLoginDialog.values,ref_key:"eidtLoginDialogFormRef",ref:x},{default:r(()=>[n(L,{label:"登录账号"},{default:r(()=>[n(l,{modelValue:_(F).tableData[0].user_name,"onUpd