gameapi-client/dist-API/assets/index.865WemSH.js

2 lines
13 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{_ as te,k as g,o as i,c as L,m as p,e as l,d as n,t as s,f as e,h as ae,a as Pe,r,C as M,J as Te,G as Y,H as E,I as Z,l as De,q as u,p as S,U as ee,n as f,K as Ee,L as $e,D as F,B as Ue,v as Re,x as Ne}from"./index.R3qQMktZ.js";import{c as xe,u as Fe,d as Ie,e as Ae,s as Ke}from"./tenant.5hwMVhFj.js";import{a as qe}from"./index.BhcO8UcA.js";import Be from"./AddMerchantsDialog.Bi0RXl5j.js";import Le from"./AdjustmentDialog.D2qsaA3H.js";import ze from"./WhitelistDialog.BpbQ6fa7.js";import Je from"./RenewDialog.IHlerXHM.js";import{_ as Oe}from"./index.DHAs7v_T.js";import{C as je}from"./index.DU8FQYf7.js";/* empty css *//* empty css */function Me(b=8){let d="";const $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",z=$.length;for(let C=0;C<b;C++)d+=$.charAt(Math.floor(Math.random()*z));return d}const Ge=["id"],He={key:1},Qe={__name:"index",props:{text:{type:[String,Number],default:""},btnText:{type:String,default:""},colors:{type:String,default:""}},setup(b){const{proxy:d}=ae(),$=()=>{d.$modal.msgSuccess("复制成功")},z=async C=>navigator.clipboard&&window.isSecureContext?($(),navigator.clipboard.writeText(C)):new Promise((_,k)=>{try{const c=document.createElement("textarea");c.value=C,c.style.position="fixed",c.style.top="-9999px",c.style.left="-9999px",c.setAttribute("readonly",!0),document.body.appendChild(c),c.select();const U=document.execCommand("copy");$(),document.body.removeChild(c),U?_():k(new Error("execCommand copy failed"))}catch(c){k(c)}});return(C,_)=>{const k=g("DocumentCopy"),c=g("el-icon");return i(),L("span",{class:"column-copy",onClick:_[0]||(_[0]=U=>z(b.text)),id:e(Me)(8)},[b.btnText?(i(),L("span",He,s(b.btnText),1)):(i(),p(c,{key:0,color:b.colors,size:"14"},{default:l(()=>[n(k)]),_:1},8,["color"]))],8,Ge)}}},I=te(Qe,[["__scopeId","data-v-0155959a"]]),We=b=>(Re("data-v-7f6120aa"),b=b(),Ne(),b),Xe={class:"app-container"},Ye=We(()=>f("br",null,null,-1)),Ze={key:0},et={class:"label-scoreRatio"},tt={class:"dialog-footer"},at={class:"dialog-header"},lt={class:"dialog-title",style:{width:"100%","text-align":"center"}},nt={style:{width:"300px"}},ot={style:{width:"300px"}},st={style:{width:"300px"}},rt={style:{width:"300px"}},it={style:{width:"300px"}},dt={style:{width:"300px"}},ut={class:"dialog-footer",style:{width:"100%","text-align":"center"}},ct=Ue({name:"Agent"}),pt=Object.assign(ct,{setup(b){Pe();const{proxy:d}=ae(),{ff_tenant_type:$,ff_tenant_status:z}=d.useDict("ff_tenant_type","ff_tenant_status"),C=r([]),_=r(!1),k=r("add"),c=r({}),U=r(!0),le=r(!0);r([]),r(!0),r(!0);const J=r(0),G=r(""),V=r(!1);r(!1),r("");const ne=r([]),oe=r([]),se=r([{label:"正常",value:"1"},{label:"停用",value:"0"}]),re=M({form:{proportion:0},queryParams:{pageNum:1,pageSize:10,tenantKey:""},rules:{account:[{required:!0,message:d.t("商户账号不能为空"),trigger:"blur"}],password:[{required:!0,message:d.t("密码不能为空"),trigger:"blur"}],scoreRatio:[{required:!0,message:d.t("买分比例不能为空"),trigger:"blur"}],tenantType:[{required:!0,message:d.t("商户模式不能为空"),trigger:"change"}],realBalanceNum:[{required:!0,message:d.t("信誉额度不能为空"),trigger:"change"}]}}),{queryParams:h,form:v,rules:ie}=Te(re),O=r(window.location.origin);M({pwd:[{required:!0,message:d.t("密码不能为空"),trigger:"change"}]}),M({pwd:""});const A=r(!1);function P(){U.value=!0,xe(h.value).then(t=>{C.value=t.rows,J.value=t.total,U.value=!1})}const de=async(t,o)=>{const T=t[o]==1?0:1,D={id:t.id};D[o]=T;try{return await Fe(D).then(()=>{d.$modal.msgSuccess(T===1?d.t("开启成功"):d.t("关闭成功")),P()}),!0}catch(y){return console.error(d.t("接口调用失败"),y),!1}};function ue(){_.value=!1,A.value=!1,j()}function j(){v.value={account:"",password:"",scoreRatio:1,tenantType:1,tenantSystemPlatforms:[],realBalance:[]},d.resetForm("agentRef")}function H(){h.value.pageNum=1,P()}const K=r(!1),ce=t=>{K.value=!0,c.value=t},m=r({}),pe=t=>{A.value=!0,m.value=t},me=t=>{d.$modal.confirm(d.t("确认是否重置密码?")).then(()=>Ie(t.id)).then(()=>{P(),d.$modal.msgSuccess(d.t("重置成功"))}).catch(()=>{})},q=r(!1),fe=t=>{q.value=!0,c.value=t},B=r(!1),ge=t=>{j(),_e(),he(),Ae(t.id).then(o=>{G.value=d.t("修改商户"),c.value={...t,account:o.data.tenantKey,tenantType:1,scoreRatio:o.data.scoreRatio,tenantSystemPlatforms:o.data.tenantPlatforms},B.value=!0})},ye=r({pageNum:1,pageSize:100,orderByColumn:"platformCode",isAsc:"desc"}),be=r(0);function _e(){qe(ye.value).then(t=>{v.value.tenantSystemPlatforms=t.rows,be.value=t.total,ne.value=JSON.parse(JSON.stringify(t.rows))})}function he(){Ke({}).then(t=>{let o=t.data.map(T=>({...T,balance:"",currencyCode:T.currencyCode}));v.value.realBalance=o,oe.value=JSON.parse(JSON.stringify(o))})}function ve(){j(),_.value=!0,G.value=d.t("添加商户")}return P(),(t,o)=>{const T=g("el-input"),D=g("el-form-item"),y=g("el-button"),Q=g("el-form"),w=g("el-table-column"),W=g("el-table"),we=g("pagination"),Se=g("el-radio-button"),Ce=g("el-radio-group"),X=g("el-dialog"),R=g("el-descriptions-item"),ke=g("el-descriptions"),N=Y("hasPermi"),Ve=Y("loading");return i(),L("div",Xe,[E(n(Q,{model:e(h),ref:"queryRef",inline:!0},{default:l(()=>[n(D,{label:t.t("商户账号"),prop:"tenantKey"},{default:l(()=>[n(T,{modelValue:e(h).tenantKey,"onUpdate:modelValue":o[0]||(o[0]=a=>e(h).tenantKey=a),placeholder:t.t("请输入商户账号"),clearable:"",style:{width:"200px"},onKeyup:De(H,["enter"])},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),n(D,{label:t.t("状态"),prop:"tenantStatus"},{default:l(()=>[n(e(je),{modelValue:e(h).tenantStatus,"onUpdate:modelValue":o[1]||(o[1]=a=>e(h).tenantStatus=a),options:e(se),placeholder:"请选择状态",style:{width:"200px"}},null,8,["modelValue","options"])]),_:1},8,["label"]),n(D,null,{default:l(()=>[n(y,{type:"primary",icon:"Search",onClick:H},{default:l(()=>[u(s(t.t("搜索")),1)]),_:1}),E((i(),p(y,{type:"primary",icon:"Plus",onClick:ve},{default:l(()=>[u(s(t.t("新增商户")),1)]),_:1})),[[N,["agent:tenant:create"]]])]),_:1})]),_:1},8,["model"]),[[Z,e(le)]]),E((i(),p(W,{data:e(C),class:"c-table-main",border:""},{default:l(()=>[n(w,{label:t.t("商户标识"),width:"100",align:"center",prop:"tenantSn"},{default:l(({row:a})=>[u(s(a.tenantSn),1),Ye,a.agentAccount?(i(),L("span",Ze,s(t.t("代理"))+": "+s(a.agentAccount),1)):S("",!0)]),_:1},8,["label"]),n(w,{label:t.t("商户账号"),align:"center",prop:"tenantKey",width:"160px","show-overflow-tooltip":!0},null,8,["label"]),n(w,{label:t.t("商户额度"),width:"100",align:"center"},{default:l(({row:a})=>[E((i(),p(y,{link:"",type:"primary",onClick:x=>fe(a)},{default:l(()=>[u(s(t.t("调额")),1)]),_:2},1032,["onClick"])),[[N,["agent:tenant:view"]]])]),_:1},8,["label"]),n(w,{label:t.t("注册时间"),align:"center",prop:"createTime","show-overflow-tooltip":!0},{default:l(a=>[u(s(e(ee)(a.row.createTime)),1)]),_:1},8,["label"]),n(w,{label:t.t("最后登录时间"),align:"center",prop:"createTime","show-overflow-tooltip":!0},{default:l(a=>[u(s(e(ee)(a.row.createTime)),1)]),_:1},8,["label"]),n(w,{label:t.t("状态"),align:"center"},{default:l(({row:a})=>[n(e(Oe),{modelValue:a.tenantStatus,"onUpdate:modelValue":x=>a.tenantStatus=x,"active-value":!0,"inactive-value":!1,"before-change":()=>de(a,"tenantStatus")},null,8,["modelValue","onUpdate:modelValue","before-change"])]),_:1},8,["label"]),n(w,{label:t.t("操作"),align:"center",width:"260","class-name":"small-padding fixed-width"},{default:l(a=>[E((i(),p(y,{link:"",type:"primary",onClick:x=>me(a.row)},{default:l(()=>[u(s(t.t("重置密码")),1)]),_:2},1032,["onClick"])),[[N,["agent:tenant:view"]]]),E((i(),p(y,{link:"",type:"primary",onClick:x=>pe(a.row)},{default:l(()=>[u(s(t.t("对接信息")),1)]),_:2},1032,["onClick"])),[[N,["agent:tenant:view"]]]),E((i(),p(y,{link:"",type:"primary",onClick:x=>ge(a.row)},{default:l(()=>[u(s(t.t("编辑")),1)]),_:2},1032,["onClick"])),[[N,["agent:tenant:view"]]]),E((i(),p(y,{link:"",type:"primary",onClick:x=>ce(a.row)},{default:l(()=>[u(s(t.t("白名单")),1)]),_:2},1032,["onClick"])),[[N,["agent:tenant:view"]]])]),_:1},8,["label"])]),_:1},8,["data"])),[[Ve,e(U)]]),E(n(we,{total:e(J),page:e(h).pageNum,"onUpdate:page":o[2]||(o[2]=a=>e(h).pageNum=a),limit:e(h).pageSize,"onUpdate:limit":o[3]||(o[3]=a=>e(h).pageSize=a),onPagination:P},null,8,["total","page","limit"]),[[Z,e(J)>0]]),n(X,{title:t.t("成本比例"),modelValue:e(V),"onUpdate:modelValue":o[8]||(o[8]=a=>F(V)?V.value=a:null),width:"820px","append-to-body":""},{footer:l(()=>[f("div",tt,[n(y,{onClick:o[7]||(o[7]=a=>V.value=!1)},{default:l(()=>[u(s(t.t("关 闭")),1)]),_:1})])]),default:l(()=>[n(Q,{model:e(v),rules:e(ie),"label-width":"120px"},{default:l(()=>[n(D,{label:t.t("商户账号"),prop:"account"},{default:l(()=>[n(T,{disabled:e(V),modelValue:e(v).account,"onUpdate:modelValue":o[4]||(o[4]=a=>e(v).account=a),placeholder:t.t("请输入商户账号")},null,8,["disabled","modelValue","placeholder"])]),_:1},8,["label"]),n(D,{label:t.t("商户模式"),prop:"tenantType"},{default:l(()=>[n(Ce,{modelValue:e(v).tenantType,"onUpdate:modelValue":o[5]||(o[5]=a=>e(v).tenantType=a),disabled:e(V)},{default:l(()=>[(i(!0),L(Ee,null,$e(e($),a=>(i(),p(Se,{key:a.value,value:a.value},{default:l(()=>[u(s(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1},8,["label"]),n(D,{label:t.t("买分比例")},{default:l(()=>[n(T,{disabled:e(V),modelValue:e(v).scoreRatio,"onUpdate:modelValue":o[6]||(o[6]=a=>e(v).scoreRatio=a),placeholder:""},null,8,["disabled","modelValue"])]),_:1},8,["label"]),f("div",et,[f("span",null,s(t.t("平台比例")),1),f("div",null,[n(y,{type:"danger",disabled:e(V)},{default:l(()=>[u("-0.5")]),_:1},8,["disabled"]),n(y,{type:"primary",disabled:e(V)},{default:l(()=>[u("+0.5")]),_:1},8,["disabled"])])]),n(W,{data:e(v).tenantSystemPlatforms,class:"scoreRatioTable"},{default:l(()=>[n(w,{label:t.t("平台"),align:"center",prop:"platformCode"},null,8,["label"]),n(w,{label:t.t("币种"),align:"center",prop:"currencyCode"},null,8,["label"]),n(w,{label:t.t("成本比例(%"),align:"center",prop:"cost"},{default:l(a=>[u(s(a.row.cost)+"% ",1)]),_:1},8,["label"]),n(w,{label:t.t("商户通用比例(%"),align:"center",prop:"useCost"},{default:l(a=>[u(s(a.row.useCost)+"% ",1)]),_:1},8,["label"])]),_:1},8,["data"])]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"]),n(X,{title:t.t("对接信息"),modelValue:e(A),"onUpdate:modelValue":o[9]||(o[9]=a=>F(A)?A.value=a:null),width:"620px","append-to-body":""},{header:l(()=>[f("div",at,[f("div",lt,s(t.t("对接信息")),1)])]),footer:l(()=>[f("div",ut,[n(y,{onClick:ue},{default:l(()=>[u(s(t.t("关 闭")),1)]),_:1})])]),default:l(()=>[n(ke,{border:"",column:1,class:"c-descriptions"},{default:l(()=>[n(R,{"label-width":"150","label-align":"right",label:t.t("商户后台")},{default:l(()=>[f("div",nt,[u(s(e(O))+" ",1),e(O)?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(O))},null,8,["text"])):S("",!0)])]),_:1},8,["label"]),n(R,{"label-width":"150","label-align":"right",label:t.t("登录账号")},{default:l(()=>[f("div",ot,[u(s(e(m).tenantKey),1),e(m).tenantKey?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(m).tenantKey)},null,8,["text"])):S("",!0)])]),_:1},8,["label"]),n(R,{"label-width":"150","label-align":"right",label:t.t("初始密码")},{default:l(()=>[f("div",st,[u(s(e(m).originalPassword),1),e(m).originalPassword?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(m).originalPassword)},null,8,["text"])):S("",!0)])]),_:1},8,["label"]),n(R,{"label-width":"150","label-align":"right",label:t.t("商户ID")},{default:l(()=>[f("div",rt,[u(s(e(m).id),1),e(m).id?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(m).id)},null,8,["text"])):S("",!0)])]),_:1},8,["label"]),n(R,{"label-width":"150","label-align":"right",label:t.t("商户密钥")},{default:l(()=>[f("div",it,[u(s(e(m).tenantSecret),1),e(m).tenantSecret?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(m).tenantSecret)},null,8,["text"])):S("",!0)])]),_:1},8,["label"]),n(R,{"label-width":"150","label-align":"right",label:t.t("回调IP")},{default:l(()=>[f("div",dt,[u(s(e(m).loginIp),1),e(m).loginIp?(i(),p(e(I),{key:0,colors:"#409EFF",text:String(e(m).loginIp)},null,8,["text"])):S("",!0)])]),_:1},8,["label"])]),_:1})]),_:1},8,["title","modelValue"]),e(_)?(i(),p(e(Be),{key:0,addEditStatus:e(k),modifyDate:e(c),onSubmit:P,show:e(_),"onUpdate:show":o[10]||(o[10]=a=>F(_)?_.value=a:null)},null,8,["addEditStatus","modifyDate","show"])):S("",!0),e(q)?(i(),p(e(Le),{key:1,addEditStatus:e(k),modifyDate:e(c),onSubmit:P,show:e(q),"onUpdate:show":o[11]||(o[11]=a=>F(q)?q.value=a:null)},null,8,["addEditStatus","modifyDate","show"])):S("",!0),e(K)?(i(),p(e(ze),{key:2,addEditStatus:e(k),modifyDate:e(c),onSubmit:P,show:e(K),"onUpdate:show":o[12]||(o[12]=a=>F(K)?K.value=a:null)},null,8,["addEditStatus","modifyDate","show"])):S("",!0),e(B)?(i(),p(e(Je),{key:3,show:e(B),"onUpdate:show":o[13]||(o[13]=a=>F(B)?B.value=a:null),addEditStatus:e(k),modifyDate:e(c),onSubmit:P},null,8,["show","addEditStatus","modifyDate"])):S("",!0)])}}}),kt=te(pt,[["__scopeId","data-v-7f6120aa"]]);export{kt as default};