import{bo as e,a$ as a,r as o,ag as t,b4 as l,d6 as s,dj as r,dk as n,c as i,e as u,N as p,O as d,w as c,t as _,l as w,dl as m,an as h,m as g,al as y,bb as f,g as v,a7 as D,a8 as C,c9 as b,aO as k,a_ as R,dm as F,dn as S,dp as j,dq as x,dr as U,ds as B,dt as A}from"./index.1757923509869qCVB9d2E.js";import{_ as T}from"./index.1757923509869CurIaptO.js";/* empty css */import{E as z}from"./el-text.1757923509869CLpNzoA_.js";import M from"./modify_deposit.1757923509869L-oisFZm.js";import I from"./modify_deposit_log.1757923509869DAxJQonp.js";import P from"./single_channel_set.1757923509869CgFeHig_.js";import L from"./single_fee_set.1757923509869yZERMju-.js";import G from"./modify_password.1757923509869BiTlEwK9.js";import V from"./clear_account.1757923509869CuVn0Vkp.js";import E from"./aircraft.1757923509869TAKtEfqo.js";import O from"./user_gorup.1757923509869DV-tMErA.js";import $ from"./detail.1757923509869DgKEGk_1.js";import W from"./account_total.1757923509869iv73YG9V.js";import{b as q}from"./payee-order.1757923509869C-hBS3Ad.js";import{s as N}from"./staticData.17579235098698wZxkmL4.js";import{p as Z}from"./common.1757923509869CCwWzMi9.js";/* empty css */import"./el-col.1757923509869BNvjwtU3.js";import"./el-card.1757923509869C8bpZ1ZO.js";import"./settlement_log.1757923509869Cnm664A1.js";import"./payee-count.1757923509869t9_ot8XB.js";import"./lodash.1757923509869s7AXz7q8.js";import"./select_channel.1757923509869BcZM1UVr.js";import"./el-link.1757923509869462UTunf.js";import"./handle_balance.1757923509869BA6_n7DW.js";import"./freeze_balance.1757923509869C5l0Ph2G.js";import"./freeze_money_management.1757923509869Dl8j6SSk.js";import"./freeze_balance_management.1757923509869CpNDd52_.js";const H={class:"statistics-box"},J={style:{"font-size":"10px"}},K={style:{"font-size":"10px"}},Q=["onClick"],X={style:{"margin-top":"4px"}},Y={style:{"margin-top":"4px"}},ee={__name:"user-info",setup(ee,{expose:ae}){e();const oe=a(),te=N.userType,le=o([]),se=o("日切清账,关闭通道"),re=o("warning"),ne=o("0"),ie=t({sum_data:[],columns:[{prop:"shop_id",label:"商户号",align:"center",width:"100"},{prop:"username",label:"用户名",align:"center",slot:"username_slot",width:"100"},{prop:"group",label:"分组",align:"center",width:"100px",slot:"group_slot"},{prop:"",label:"预付操作",align:"center",slot:"modify_deposit_slot",width:"120"},{prop:"",label:"预付",align:"center",slot:"modify_deposit_log_slot"},{prop:"",label:"账号总额",align:"center",slot:"account_total_slot"},{prop:"",label:"通道",align:"center",slot:"channel_slot",width:"100px"},{prop:"",label:"费率",align:"center",slot:"fee_slot",width:"100px"},{prop:"",label:"状态",align:"center",slot:"status_slot"},{prop:"callback_white_ip",label:"回调IP",align:"center"},{prop:"",label:"操作",align:"center",slot:"operate_slot",width:"280"},{prop:"create_time",label:"注册时间",align:"center"},{prop:"login_time",label:"最后登录时间",align:"center",slot:"login_time_slot"}],tableData:[],searchFields:[{label:"商户号",prop:"shop_id",type:"input",value:""},{label:"用户名称",type:"input",prop:"username",value:""},{label:"用户定制类型",prop:"user_type",type:"select",value:"",options:te},{label:"用户分组",type:"select",prop:"user_group",value:"",options:le}],total:0,page:1,per_page:50,loading:!1,selectData:[],showAddDialog:!1,btnLoading:!1,addForm:{title:"新增用户",fields:[{label:"用户名称",prop:"username",type:"input",value:""},{label:"登录密码",prop:"password",type:"password"},{label:"登录IP白名单",prop:"login_white_ip",type:"textarea",value:""},{label:"回调IP白名单",prop:"callback_white_ip",type:"textarea",value:"",placeholder:"商户的回调IP,管理员有IP池,建议每个商户独立IP,若是包网,则改为批量,切记线下一定要记录每个商户的IP,若IP被打,则及时变更不影响其他商户用英文逗号隔开"}],rules:{},values:{username:"",name:"",user_type:"",password:"",login_white_ip:"",callback_white_ip:"",id:""}},showBatchChannel:!1,showBatchFee:!1,showWrongAccount:!1,showRepairRecord:!1,showModifyDeposit:!1,showModifyDepositLog:!1,showSingleChannelSet:!1,showSingleFeeSet:!1,showModifyPassword:!1,showClearAccount:!1,showBindAircraftDialog:!1,showUserGroupDialog:!1,showDetailDialog:!1,showTotalDetailDialog:!1,currentRow:{},freezeStatus:""}),ue=(e,a)=>{let o="";return(0===a?type_options:pay_type_options).some(a=>{if(a.value===e)return o=a.label,!0}),o},pe=()=>{ie.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),_e()};l(async()=>{le.value=[],(await s({})).data.forEach(e=>{le.value.push({label:e.name,value:e.id})}),_e(),ce()}),r(()=>{clearInterval(fe.value)});let de=!1;const ce=()=>{q().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(fe.value),ne.value=e.system_clear_status,1==e.system_clear_status&&(re.value="danger",se.value="日切清账中,所有支付通道已关闭",de||(De(),de=!0)),2==e.system_clear_status&&(re.value="success",se.value="日切清账完成,请手动点击开启所有通道")})};const _e=()=>{let e={limit:ie.per_page,page:ie.page,status:ie.freezeStatus},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(ie.searchFields);a.user_type?(e.private_status=1==a.user_type?1:"",e.private_pr=2==a.user_type?1:""):(e.private_status="",e.private_pr=""),delete a.user_type,n(Object.assign(e,a)).then(e=>{ie.tableData=e.data,ie.total=e.total,ie.sum_data=e.sum_data}).catch(()=>{ie.loading=!1})},we=e=>{ie.selectData=e},me=()=>{A({onoff:"on"}).then(e=>{ce(),_e(),se.value="日切清账,关闭通道",re.value="warning",clearInterval(fe.value)}).catch(()=>{})},he=()=>{let e={username:ie.addForm.values.username,name:ie.addForm.values.name,user_type:ie.addForm.values.user_type,password:ie.addForm.values.password,login_white_ip:ie.addForm.values.login_white_ip,callback_white_ip:ie.addForm.values.callback_white_ip};ie.addForm.values.id?(e.id=ie.addForm.values.id,x(e).then(e=>{ie.showAddDialog=!1,_e()})):U(e).then(e=>{ie.showAddDialog=!1,_e()})},ge=(e,a)=>{R.alert("是否确定对当前用户进行状态切换?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{j({id:e.id,status:1==a?e.status:e.recharge_status,type:a}).then(e=>{k.success("修改成功!")})}).catch(()=>{1==a?e.status=1==e.status?2:1:e.recharge_status=1==e.recharge_status?2:1})},ye=()=>{_e()};let fe=o(null);const ve=(e,a)=>{B({type:e,clear_ids:a}).then(e=>{ce(),De(),setTimeout(()=>{_e()},1e3)})},De=()=>{clearInterval(fe.value),fe.value=setInterval(()=>{ce()},1e4)};return ae({getFreezeUserList:()=>{ie.page=1,ie.freezeStatus=2,_e()}}),(e,a)=>{const o=h,t=z,l=f,s=m,r=T,n=b;return u(),i("div",null,[p(r,{type:"export",columns:v(ie).columns,searchFields:v(ie).searchFields,"onUpdate:searchFields":a[2]||(a[2]=e=>v(ie).searchFields=e),data:v(ie).tableData,per_page:v(ie).per_page,"onUpdate:per_page":a[3]||(a[3]=e=>v(ie).per_page=e),page:v(ie).page,"onUpdate:page":a[4]||(a[4]=e=>v(ie).page=e),total:v(ie).total,onGetTableData:_e,onResetForm:pe,loading:v(ie).loading,showSelection:!0,selectionChange:we,showRightRefreshSlot:!1},{btns:c(()=>[w("div",null,[p(o,{type:v(re),onClick:a[0]||(a[0]=e=>(()=>{if(1==ne.value)return k.warning("清账中,请勿重复点击");2!=ne.value?ie.showClearAccount=!0:R.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{me()}).catch(()=>{})})())},{default:c(()=>[d(_(v(se)),1)]),_:1},8,["type"]),p(o,{type:"primary",onClick:a[1]||(a[1]=e=>(ie.showAddDialog=!0,ie.addForm.values.id="",ie.addForm.fields[0].disabled=!1,void(ie.addForm.title="新增用户")))},{default:c(()=>a[17]||(a[17]=[d(" 添加用户 ")])),_:1,__:[17]})])]),count:c(({row:e})=>[w("div",H,[a[18]||(a[18]=d(" 商户数量: ")),p(t,{type:"primary"},{default:c(()=>[d(_(v(ie).sum_data.shop_num),1)]),_:1}),a[19]||(a[19]=d(" 总预付: ")),p(t,{type:"primary"},{default:c(()=>[d(_(v(Z)(v(ie).sum_data.sum_money)),1)]),_:1}),a[20]||(a[20]=d(" 可结算金额:")),p(t,{type:"success"},{default:c(()=>[d(_(v(Z)(v(ie).sum_data.money)),1)]),_:1}),a[21]||(a[21]=d(" 剩余预付: ")),p(t,{type:"primary"},{default:c(()=>[d(_(v(Z)(v(ie).sum_data.prepay_money)),1)]),_:1})])]),username_slot:c(({row:e})=>[w("div",null,_(e.username),1),w("div",J,_(1==e.private_pr?"定制费率用户":""),1),w("div",K,_(1==e.private_status?"定制通道用户":""),1)]),group_slot:c(({row:e})=>[(u(!0),i(D,null,C(e.groupInfo,e=>(u(),i("div",null,_(e.name),1))),256))]),modify_deposit_log_slot:c(({row:e})=>[w("div",null,[a[22]||(a[22]=d("累计:")),p(t,{type:"success"},{default:c(()=>{var a;return[d(_(v(Z)(null==(a=null==e?void 0:e.account)?void 0:a.sum_money)||0),1)]}),_:2},1024)]),w("div",null,[a[23]||(a[23]=d("剩余:")),p(t,{type:"warning"},{default:c(()=>{var a;return[d(_(v(Z)(null==(a=null==e?void 0:e.account)?void 0:a.prepay_money)||0),1)]}),_:2},1024)])]),account_total_slot:c(({row:e})=>[w("div",{onClick:a=>(e=>{ie.showTotalDetailDialog=!0,ie.currentRow=e})(e)},[w("div",null,[a[24]||(a[24]=d("可结算: ")),p(t,{type:"success"},{default:c(()=>{var a;return[d(_(v(Z)(null==(a=null==e?void 0:e.account)?void 0:a.money)||0),1)]}),_:2},1024)]),w("div",null,[a[25]||(a[25]=d("昨日: ")),p(t,{type:"warning"},{default:c(()=>{var a;return[d(_(v(Z)(null==(a=null==e?void 0:e.account)?void 0:a.yesterday_money)||0),1)]}),_:2},1024)])],8,Q)]),account_type_slot:c(({row:e})=>[w("div",null,_(ue(e.account_type,0)),1)]),pay_type_slot:c(({row:e})=>[w("div",null,_(ue(e.pay_type,1)),1)]),modify_deposit_slot:c(({row:e})=>[w("div",null,[p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showModifyDeposit=!0,ie.currentRow=e})(e)},{default:c(()=>a[26]||(a[26]=[d("加减预付")])),_:2,__:[26]},1032,["onClick"])]),w("div",X,[p(o,{type:"warning",size:"small",onClick:a=>(e=>{ie.showModifyDepositLog=!0,ie.currentRow=e})(e)},{default:c(()=>a[27]||(a[27]=[d("预付记录")])),_:2,__:[27]},1032,["onClick"])])]),channel_slot:c(({row:e})=>[p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showSingleChannelSet=!0,ie.currentRow=e})(e)},{default:c(()=>a[28]||(a[28]=[d("通道")])),_:2,__:[28]},1032,["onClick"])]),fee_slot:c(({row:e})=>[p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showSingleFeeSet=!0,ie.currentRow=e})(e)},{default:c(()=>a[29]||(a[29]=[d("费率")])),_:2,__:[29]},1032,["onClick"])]),status_slot:c(({row:e})=>[w("div",null,[a[30]||(a[30]=d("状态: ")),p(l,{onChange:a=>ge(e,1),modelValue:e.status,"onUpdate:modelValue":a=>e.status=a,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"冻结"},null,8,["onChange","modelValue","onUpdate:modelValue"])]),w("div",null,[a[31]||(a[31]=d("充值: ")),p(l,{onChange:a=>ge(e,2),modelValue:e.recharge_status,"onUpdate:modelValue":a=>e.recharge_status=a,"inline-prompt":"","active-value":1,"inactive-value":2,"active-text":"开启","inactive-text":"关闭"},null,8,["onChange","modelValue","onUpdate:modelValue"])])]),operate_slot:c(({row:e})=>[w("div",null,[p(s,null,{default:c(()=>[p(o,{type:1==e.clear_status?"danger":"warning",size:"small",onClick:a=>(e=>"1"==e.clear_status?k.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==se.value?k.error(se.value):void R.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{k.success("清账中"),ve(3,[e.shop_id])}).catch(()=>{}))(e)},{default:c(()=>[d(_(1==e.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showBindAircraftDialog=!0,ie.currentRow=e})(e)},{default:c(()=>a[32]||(a[32]=[d("飞机")])),_:2,__:[32]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{F({shop_id:e.shop_id}).then(e=>{const{access_token:a}=e;localStorage.setItem("payeraccessToken",a);const o=oe.resolve({path:"/login/payer"});window.open(o.href,"_blank")})})(e)},{default:c(()=>a[33]||(a[33]=[d("登录")])),_:2,__:[33]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showDetailDialog=!0,ie.currentRow=e})(e)},{default:c(()=>a[34]||(a[34]=[d("资料")])),_:2,__:[34]},1032,["onClick"])]),_:2},1024)]),w("div",Y,[p(s,null,{default:c(()=>[1==e.google2fa_bind?(u(),g(o,{key:0,type:"warning",size:"small",onClick:a=>(e=>{R.alert("是否确定对当前用户进行解绑Google?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{S({id:e.id}).then(e=>{k.success("解绑成功!"),_e()})})})(e)},{default:c(()=>a[35]||(a[35]=[d("解绑")])),_:2,__:[35]},1032,["onClick"])):y("",!0),p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showModifyPassword=!0,ie.currentRow=e})(e)},{default:c(()=>a[36]||(a[36]=[d("密码")])),_:2,__:[36]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showAddDialog=!0,ie.addForm.values.id=e.id,ie.addForm.values.username=e.username,ie.addForm.values.name=e.name,ie.addForm.values.user_type=e.user_type,ie.addForm.values.login_white_ip=e.login_white_ip,ie.addForm.values.callback_white_ip=e.callback_white_ip,ie.addForm.fields[0].disabled=!0,ie.addForm.title="编辑用户"})(e)},{default:c(()=>a[37]||(a[37]=[d("编辑")])),_:2,__:[37]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:a=>(e=>{ie.showUserGroupDialog=!0,ie.currentRow=e})(e)},{default:c(()=>a[38]||(a[38]=[d("分组")])),_:2,__:[38]},1032,["onClick"]),p(o,{type:"primary",size:"small",onClick:e=>{R.alert("确定删除当前用户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{k.success("删除成功!")}).catch(()=>{})}},{default:c(()=>a[39]||(a[39]=[d("删除")])),_:2,__:[39]},1032,["onClick"])]),_:2},1024)])]),login_time_slot:c(({row:e})=>[p(t,null,{default:c(()=>[d(_(null==e?void 0:e.login_time),1)]),_:2},1024)]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(n,{showDialog:v(ie).showAddDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>v(ie).showAddDialog=e),formData:v(ie).addForm,"onUpdate:formData":a[6]||(a[6]=e=>v(ie).addForm=e),ref:"addFormRef",labelWidth:"120px"},{submit:c(()=>[p(o,{type:"primary",loading:v(ie).btnLoading,onClick:he},{default:c(()=>a[40]||(a[40]=[d("确定")])),_:1,__:[40]},8,["loading"])]),_:1},8,["showDialog","formData"]),p(M,{showModifyDeposit:v(ie).showModifyDeposit,"onUpdate:showModifyDeposit":a[7]||(a[7]=e=>v(ie).showModifyDeposit=e),currentRow:v(ie).currentRow},null,8,["showModifyDeposit","currentRow"]),p(I,{showModifyDepositLog:v(ie).showModifyDepositLog,"onUpdate:showModifyDepositLog":a[8]||(a[8]=e=>v(ie).showModifyDepositLog=e),currentRow:v(ie).currentRow},null,8,["showModifyDepositLog","currentRow"]),p(P,{showSingleChannelSet:v(ie).showSingleChannelSet,"onUpdate:showSingleChannelSet":a[9]||(a[9]=e=>v(ie).showSingleChannelSet=e),currentRow:v(ie).currentRow},null,8,["showSingleChannelSet","currentRow"]),p(L,{showSingleFeeSet:v(ie).showSingleFeeSet,"onUpdate:showSingleFeeSet":a[10]||(a[10]=e=>v(ie).showSingleFeeSet=e),currentRow:v(ie).currentRow},null,8,["showSingleFeeSet","currentRow"]),p(G,{showModifyPassword:v(ie).showModifyPassword,"onUpdate:showModifyPassword":a[11]||(a[11]=e=>v(ie).showModifyPassword=e),currentRow:v(ie).currentRow},null,8,["showModifyPassword","currentRow"]),p(V,{showClearAccount:v(ie).showClearAccount,"onUpdate:showClearAccount":a[12]||(a[12]=e=>v(ie).showClearAccount=e),onClearAccount:ve},null,8,["showClearAccount"]),p(E,{showBindAircraftDialog:v(ie).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[13]||(a[13]=e=>v(ie).showBindAircraftDialog=e),currentRow:v(ie).currentRow,onRefreshLoad:ye},null,8,["showBindAircraftDialog","currentRow"]),p(O,{showUserGroupDialog:v(ie).showUserGroupDialog,"onUpdate:showUserGroupDialog":a[14]||(a[14]=e=>v(ie).showUserGroupDialog=e),currentRow:v(ie).currentRow,onRefreshLoad:ye},null,8,["showUserGroupDialog","currentRow"]),p($,{showDetailDialog:v(ie).showDetailDialog,"onUpdate:showDetailDialog":a[15]||(a[15]=e=>v(ie).showDetailDialog=e),currentRow:v(ie).currentRow},null,8,["showDetailDialog","currentRow"]),p(W,{showTotalDetailDialog:v(ie).showTotalDetailDialog,"onUpdate:showTotalDetailDialog":a[16]||(a[16]=e=>v(ie).showTotalDetailDialog=e),currentRow:v(ie).currentRow},null,8,["showTotalDetailDialog","currentRow"]),a[41]||(a[41]=d('" '))])}}};export{ee as default};