import{a$ as e,r as a,ag as t,b4 as o,d8 as l,c as s,e as r,N as i,O as n,w as p,t as u,l as d,d9 as c,an as _,bb as w,a7 as h,a8 as m,g,c8 as y,aO as f,a_ as v}from"./index.DYePfyem.js";import{_ as D}from"./index.DYwS_xFe.js";/* empty css */import{E as C}from"./el-text.BUumAqEQ.js";import b from"./modify_deposit.CKxB2E0J.js";import F from"./modify_deposit_log.Dt3cl3YF.js";import R from"./single_channel_set.C0HJdjtG.js";import k from"./single_fee_set.D4zjK9_L.js";import S from"./modify_password.CWz73WWH.js";import j from"./clear_account.CpkZrw55.js";import x from"./aircraft.D1AapaEN.js";import U from"./user_gorup.CKMTtvvV.js";import A from"./detail.C9wvGn8K.js";import z from"./account_total.DF9xBniC.js";import{g as B,d as M,f as T,h as I,i as P,j as L,k as G,l as V}from"./payee-user.63Avc7B0.js";import{b as E}from"./payee-order.s8X1e7-s.js";import{s as O}from"./staticData.8wZxkmL4.js";import"./lodash.B0C_AyXz.js";/* empty css */import"./el-col.DpOXIyFv.js";import"./el-card.B7PWWSBO.js";import"./settlement_log.BrfDFgWL.js";import"./payee-count.CngbgP1_.js";import"./select_channel.CBbAwLNt.js";import"./payee-channel.mXsebGpJ.js";import"./handle_balance.AkAQG8k6.js";import"./freeze_balance.CeeSfWI8.js";import"./freeze_money_management.B-i-VOfA.js";import"./freeze_balance_management.igndLbh7.js";const W={class:"statistics-box"},Z={style:{"font-size":"10px"}},$={style:{"font-size":"10px"}},N=["onClick"],Q={style:{"margin-top":"4px"}},X={style:{"margin-top":"4px"}},Y={__name:"user-info",setup(Y,{expose:q}){const H=e(),J=O.userType,K=a([]),ee=a("日切清账,关闭通道"),ae=a("warning"),te=a("0"),oe=t({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:"created_at",label:"回调IP",align:"center"},{prop:"",label:"操作",align:"center",slot:"operate_slot",width:"240"},{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:J},{label:"用户分组",type:"select",prop:"user_group",value:"",options:K}],total:0,page:1,per_page:10,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:""}),le=(e,a)=>{let t="";return(0===a?type_options:pay_type_options).some(a=>{if(a.value===e)return t=a.label,!0}),t},se=()=>{oe.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),ne()};o(async()=>{K.value=[],(await B({})).data.forEach(e=>{K.value.push({label:e.name,value:e.id})}),ne(),ie()}),l(()=>{clearInterval(we.value)});let re=!1;const ie=()=>{E().then(e=>{0!=e.system_clear_status&&2!=e.system_clear_status||clearInterval(we.value),te.value=e.system_clear_status,1==e.system_clear_status&&(ae.value="danger",ee.value="日切清账中,所有支付通道已关闭",re||(me(),re=!0)),2==e.system_clear_status&&(ae.value="success",ee.value="日切清账完成,请手动点击开启所有通道")})};const ne=()=>{let e={limit:oe.per_page,page:oe.page,status:oe.freezeStatus},a=function(e){const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a}(oe.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,M(Object.assign(e,a)).then(e=>{oe.tableData=e.data,oe.total=e.total}).catch(()=>{oe.loading=!1})},pe=e=>{oe.selectData=e},ue=()=>{V({onoff:"on"}).then(e=>{ie(),ne(),ee.value="日切清账,关闭通道",ae.value="warning",clearInterval(we.value)}).catch(()=>{})},de=()=>{let e={username:oe.addForm.values.username,name:oe.addForm.values.name,user_type:oe.addForm.values.user_type,password:oe.addForm.values.password,login_white_ip:oe.addForm.values.login_white_ip};oe.addForm.values.id?(e.id=oe.addForm.values.id,P(e).then(e=>{oe.showAddDialog=!1,ne()})):L(e).then(e=>{oe.showAddDialog=!1,ne()})},ce=(e,a)=>{v.alert("是否确定对当前用户进行状态切换?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{I({id:e.id,status:1==a?e.status:e.recharge_status,type:a}).then(e=>{f.success("修改成功!")})}).catch(()=>{1==a?e.status=1==e.status?2:1:e.recharge_status=1==e.recharge_status?2:1})},_e=()=>{ne()};let we=a(null);const he=(e,a)=>{G({type:e,clear_ids:a}).then(e=>{ie(),me(),setTimeout(()=>{ne()},1e3)})},me=()=>{clearInterval(we.value),we.value=setInterval(()=>{ie()},1e4)};return q({getFreezeUserList:()=>{oe.page=1,oe.freezeStatus=2,ne()}}),(e,a)=>{const t=_,o=C,l=w,B=c,M=D,I=y;return r(),s("div",null,[i(M,{type:"export",columns:g(oe).columns,searchFields:g(oe).searchFields,"onUpdate:searchFields":a[2]||(a[2]=e=>g(oe).searchFields=e),data:g(oe).tableData,per_page:g(oe).per_page,"onUpdate:per_page":a[3]||(a[3]=e=>g(oe).per_page=e),page:g(oe).page,"onUpdate:page":a[4]||(a[4]=e=>g(oe).page=e),total:g(oe).total,onGetTableData:ne,onResetForm:se,loading:g(oe).loading,showSelection:!0,selectionChange:pe,showRightRefreshSlot:!1},{btns:p(()=>[d("div",null,[i(t,{type:g(ae),onClick:a[0]||(a[0]=e=>(()=>{if(1==te.value)return f.warning("清账中,请勿重复点击");2!=te.value?oe.showClearAccount=!0:v.alert("确定开启所有通道","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{ue()}).catch(()=>{})})())},{default:p(()=>[n(u(g(ee)),1)]),_:1},8,["type"]),i(t,{type:"primary",onClick:a[1]||(a[1]=e=>(oe.showAddDialog=!0,oe.addForm.values.id="",oe.addForm.fields[0].disabled=!1,void(oe.addForm.title="新增用户")))},{default:p(()=>a[17]||(a[17]=[n(" 添加用户 ")])),_:1,__:[17]})])]),count:p(({row:e})=>[d("div",W,[a[25]||(a[25]=n(" 商户数量: ")),i(o,{type:"primary"},{default:p(()=>a[18]||(a[18]=[n("0")])),_:1,__:[18]}),a[26]||(a[26]=n(" 总预付: ")),i(o,{type:"primary"},{default:p(()=>a[19]||(a[19]=[n("0")])),_:1,__:[19]}),a[27]||(a[27]=n(" 可提现金额:")),i(o,{type:"success"},{default:p(()=>a[20]||(a[20]=[n("0")])),_:1,__:[20]}),a[28]||(a[28]=n(" 剩余预付: ")),i(o,{type:"primary"},{default:p(()=>a[21]||(a[21]=[n("0")])),_:1,__:[21]}),a[29]||(a[29]=n(" 冻结金额:")),i(o,{type:"danger"},{default:p(()=>a[22]||(a[22]=[n("0")])),_:1,__:[22]}),a[30]||(a[30]=n(" 已结算保证金:")),i(o,{type:"primary"},{default:p(()=>a[23]||(a[23]=[n("0")])),_:1,__:[23]}),a[31]||(a[31]=n(" 冻结保证金:")),i(o,{type:"warning"},{default:p(()=>a[24]||(a[24]=[n("0")])),_:1,__:[24]})])]),username_slot:p(({row:e})=>[d("div",null,u(e.username),1),d("div",Z,u(1==e.private_pr?"定制费率用户":""),1),d("div",$,u(1==e.private_status?"定制通道用户":""),1)]),group_slot:p(({row:e})=>[(r(!0),s(h,null,m(e.groupInfo,e=>(r(),s("div",null,u(e.name),1))),256))]),modify_deposit_log_slot:p(({row:e})=>a[32]||(a[32]=[])),account_total_slot:p(({row:e})=>[d("div",{onClick:a=>(e=>{oe.showTotalDetailDialog=!0,oe.currentRow=e})(e)},null,8,N)]),account_type_slot:p(({row:e})=>[d("div",null,u(le(e.account_type,0)),1)]),pay_type_slot:p(({row:e})=>[d("div",null,u(le(e.pay_type,1)),1)]),modify_deposit_slot:p(({row:e})=>[d("div",null,[i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showModifyDeposit=!0,oe.currentRow=e})(e)},{default:p(()=>a[33]||(a[33]=[n("加减预付")])),_:2,__:[33]},1032,["onClick"])]),d("div",Q,[i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showModifyDepositLog=!0,oe.currentRow=e})(e)},{default:p(()=>a[34]||(a[34]=[n("预付记录")])),_:2,__:[34]},1032,["onClick"])])]),channel_slot:p(({row:e})=>[i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showSingleChannelSet=!0,oe.currentRow=e})(e)},{default:p(()=>a[35]||(a[35]=[n("通道")])),_:2,__:[35]},1032,["onClick"])]),fee_slot:p(({row:e})=>[i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showSingleFeeSet=!0,oe.currentRow=e})(e)},{default:p(()=>a[36]||(a[36]=[n("费率")])),_:2,__:[36]},1032,["onClick"])]),status_slot:p(({row:e})=>[d("div",null,[a[37]||(a[37]=n("状态: ")),i(l,{onChange:a=>ce(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"])]),d("div",null,[a[38]||(a[38]=n("充值: ")),i(l,{onChange:a=>ce(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:p(({row:e})=>[d("div",null,[i(B,null,{default:p(()=>[i(t,{type:1==e.clear_status?"danger":"warning",size:"small",onClick:a=>(e=>"1"==e.clear_status?f.warning("清账中,请勿重复点击"):"日切清账完成,请手动点击开启所有通道"==ee.value?f.error(ee.value):void v.alert("是否确定对当前用户进行日切清账?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{f.success("清账中"),he(3,[e.shop_id])}).catch(()=>{}))(e)},{default:p(()=>[n(u(1==e.clear_status?"清账中":"清账"),1)]),_:2},1032,["type","onClick"]),i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showBindAircraftDialog=!0,oe.currentRow=e})(e)},{default:p(()=>a[39]||(a[39]=[n("飞机")])),_:2,__:[39]},1032,["onClick"]),i(t,{type:"primary",size:"small",onClick:a=>(e=>{T({shop_id:e.shop_id}).then(e=>{const{access_token:a}=e;localStorage.setItem("payeraccessToken",a);const t=H.resolve({path:"/login/payer"});window.open(t.href,"_blank")})})(e)},{default:p(()=>a[40]||(a[40]=[n("登录")])),_:2,__:[40]},1032,["onClick"]),i(t,{type:"primary",size:"small",onClick:e=>{oe.showDetailDialog=!0}},{default:p(()=>a[41]||(a[41]=[n("资料")])),_:2,__:[41]},1032,["onClick"])]),_:2},1024)]),d("div",X,[i(B,null,{default:p(()=>[i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showModifyPassword=!0,oe.currentRow=e})(e)},{default:p(()=>a[42]||(a[42]=[n("密码")])),_:2,__:[42]},1032,["onClick"]),i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showAddDialog=!0,oe.addForm.values.id=e.id,oe.addForm.values.username=e.username,oe.addForm.values.name=e.name,oe.addForm.values.user_type=e.user_type,oe.addForm.values.login_white_ip=e.login_white_ip,oe.addForm.values.callback_white_ip=e.callback_white_ip,oe.addForm.fields[0].disabled=!0,oe.addForm.title="编辑用户"})(e)},{default:p(()=>a[43]||(a[43]=[n("编辑")])),_:2,__:[43]},1032,["onClick"]),i(t,{type:"primary",size:"small",onClick:a=>(e=>{oe.showUserGroupDialog=!0,oe.currentRow=e})(e)},{default:p(()=>a[44]||(a[44]=[n("分组")])),_:2,__:[44]},1032,["onClick"]),i(t,{type:"primary",size:"small",onClick:e=>{v.alert("确定删除当前用户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,type:"warning"}).then(()=>{f.success("删除成功!")}).catch(()=>{})}},{default:p(()=>a[45]||(a[45]=[n("删除")])),_:2,__:[45]},1032,["onClick"])]),_:2},1024)])]),login_time_slot:p(({row:e})=>[i(o,null,{default:p(()=>[n(u(null==e?void 0:e.login_time),1)]),_:2},1024)]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),i(I,{showDialog:g(oe).showAddDialog,"onUpdate:showDialog":a[5]||(a[5]=e=>g(oe).showAddDialog=e),formData:g(oe).addForm,"onUpdate:formData":a[6]||(a[6]=e=>g(oe).addForm=e),ref:"addFormRef",labelWidth:"120px"},{submit:p(()=>[i(t,{type:"primary",loading:g(oe).btnLoading,onClick:de},{default:p(()=>a[46]||(a[46]=[n("确定")])),_:1,__:[46]},8,["loading"])]),_:1},8,["showDialog","formData"]),i(b,{showModifyDeposit:g(oe).showModifyDeposit,"onUpdate:showModifyDeposit":a[7]||(a[7]=e=>g(oe).showModifyDeposit=e),currentRow:g(oe).currentRow},null,8,["showModifyDeposit","currentRow"]),i(F,{showModifyDepositLog:g(oe).showModifyDepositLog,"onUpdate:showModifyDepositLog":a[8]||(a[8]=e=>g(oe).showModifyDepositLog=e),currentRow:g(oe).currentRow},null,8,["showModifyDepositLog","currentRow"]),i(R,{showSingleChannelSet:g(oe).showSingleChannelSet,"onUpdate:showSingleChannelSet":a[9]||(a[9]=e=>g(oe).showSingleChannelSet=e),currentRow:g(oe).currentRow},null,8,["showSingleChannelSet","currentRow"]),i(k,{showSingleFeeSet:g(oe).showSingleFeeSet,"onUpdate:showSingleFeeSet":a[10]||(a[10]=e=>g(oe).showSingleFeeSet=e),currentRow:g(oe).currentRow},null,8,["showSingleFeeSet","currentRow"]),i(S,{showModifyPassword:g(oe).showModifyPassword,"onUpdate:showModifyPassword":a[11]||(a[11]=e=>g(oe).showModifyPassword=e),currentRow:g(oe).currentRow},null,8,["showModifyPassword","currentRow"]),i(j,{showClearAccount:g(oe).showClearAccount,"onUpdate:showClearAccount":a[12]||(a[12]=e=>g(oe).showClearAccount=e),onClearAccount:he},null,8,["showClearAccount"]),i(x,{showBindAircraftDialog:g(oe).showBindAircraftDialog,"onUpdate:showBindAircraftDialog":a[13]||(a[13]=e=>g(oe).showBindAircraftDialog=e),currentRow:g(oe).currentRow},null,8,["showBindAircraftDialog","currentRow"]),i(U,{showUserGroupDialog:g(oe).showUserGroupDialog,"onUpdate:showUserGroupDialog":a[14]||(a[14]=e=>g(oe).showUserGroupDialog=e),currentRow:g(oe).currentRow,onRefreshLoad:_e},null,8,["showUserGroupDialog","currentRow"]),i(A,{showDetailDialog:g(oe).showDetailDialog,"onUpdate:showDetailDialog":a[15]||(a[15]=e=>g(oe).showDetailDialog=e)},null,8,["showDetailDialog"]),i(z,{showTotalDetailDialog:g(oe).showTotalDetailDialog,"onUpdate:showTotalDetailDialog":a[16]||(a[16]=e=>g(oe).showTotalDetailDialog=e),currentRow:g(oe).currentRow},null,8,["showTotalDetailDialog","currentRow"]),a[47]||(a[47]=n('" '))])}}};export{Y as default};