uniugm/admin/ui/static/static/js/project_op-C-AB3DOA.js
2025-06-12 16:51:10 +08:00

2 lines
9.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{t as e}from"./table-C3U4vmQf.js";import{_ as l,s as a,l as t,u as o,r}from"./index-DDz3nIfx.js";import{a as d,o as n,b as c,w as p,V as s,u,W as i,a5 as f,a8 as m,y as _,F as b,q as y,c as h,r as k,T as w,ab as I,x as V,a6 as g,ac as v,_ as K,E as D,$ as C,a0 as x,a2 as U,a1 as j,Z as L}from"./vendor-DP_UVbSV.js";import"./resource-BheMLjer.js";import"./empty-CyOOHAV7.js";const R=l({__name:"userDetailAccount",props:{accountInfo:{}},setup(e){const l=e,a=l.accountInfo;console.log("账户信息:",a);let t=[{filedKey1:"账户id",filedValue1:a.account_id,filedKey2:"平台",filedValue2:a.platform},{filedKey1:"角色数",filedValue1:a.role_list.length,filedKey2:"渠道",filedValue2:a.channel},{filedKey1:"注册时间",filedValue1:a.created_at,filedKey2:"注册ip",filedValue2:a.created_ip},{filedKey1:"总付费金额",filedValue1:a.total_pay_amount,filedKey2:"总付费次数",filedValue2:a.total_pay_times},{filedKey1:"首次付费时间",filedValue1:a.first_pay_at,filedKey2:"最后付费时间",filedValue2:a.last_pay_at},{filedKey1:"登录设备数(暂无)",filedValue1:0,filedKey2:"最后登录时间",filedValue2:a.last_login_time}],o=[],r=[],k=!0;a.role_list.forEach((e=>{let l=0;e.currency_items.forEach((a=>{l++;let t="currencyNum"+l;e["currencyName"+l]=a.desc,e[t]=a.item_num,k&&r.push({colProp:t,colLabel:a.desc})})),k=!1,o.push(e)})),Object.keys(l.accountInfo).forEach((e=>{l.accountInfo[e]}));const w=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=i,k=s,I=f,V=m;return n(),d("div",null,[c(I,null,{default:p((()=>[c(k,{data:u(t),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":w,"show-header":!1},{default:p((()=>[c(a,{prop:"filedKey1",label:"",width:"180"}),c(a,{prop:"filedValue1",label:"",width:"200"}),c(a,{prop:"filedKey2",label:"",width:"180"}),c(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),c(I,null,{default:p((()=>[c(V,{"content-position":"left"},{default:p((()=>l[0]||(l[0]=[_("角色详情")]))),_:1}),c(k,{class:"roleDetailList",data:u(o),border:"","show-header":!0,style:{width:"100%"}},{default:p((()=>[c(a,{prop:"platform",label:"平台"}),c(a,{prop:"server_id",label:"区服"}),c(a,{prop:"name",label:"角色名称",width:"100%"}),c(a,{prop:"role_id",label:"角色id"}),c(a,{prop:"total_pay_amount",label:"充值金额"}),c(a,{prop:"level",label:"等级"}),c(a,{prop:"created_at",label:"创建时间",width:"100"}),c(a,{prop:"last_login_time",label:"最后登录时间",width:"100"}),(n(!0),d(b,null,y(u(r),(e=>(n(),h(a,{prop:e.colProp,label:e.colLabel},null,8,["prop","label"])))),256))])),_:1},8,["data"])])),_:1})])}}},[["__scopeId","data-v-5a8d8958"]]),Y={__name:"userDetailOrder",props:{accountInfo:{}},setup(e){const l=e.accountInfo;let a=[];return l.role_list.forEach((e=>{a.push(...e.order_list)})),(e,l)=>{const t=i,o=s;return n(),d("div",null,[c(o,{data:u(a),style:{width:"100%"},"table-layout":"auto",border:"","show-header":!0},{default:p((()=>[c(t,{prop:"server_id",label:"区服"}),c(t,{prop:"account_id",label:"账户id"}),c(t,{prop:"role_id",label:"角色id"}),c(t,{prop:"role_name",label:"角色名"}),c(t,{prop:"sn",label:"订单号"}),c(t,{prop:"product_id",label:"商品id"}),c(t,{prop:"price",label:"金额"}),c(t,{prop:"purchase_type",label:"支付方式"}),c(t,{prop:"purchase_at",label:"订单时间"})])),_:1},8,["data"])])}}};const E={__name:"userDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=t.getCache("resource").meta.resource_url,r=k("detail");console.log("进入用户详情:",l.rowInfo),l.rowInfo.Account,l.rowInfo.ServerConfId;let s=k(!1),i={};var f,m;(f=o,m=l.rowInfo,a({url:f+"/special/detail",method:"get",params:m})).then((e=>{console.log("获取账户详情返回:",e.data),i=e.data.account_info,s.value=!0}),(e=>{}));const _=(e,l)=>{switch(e.props.name){case"detail":console.log("点击了账号详情");break;case"order":console.log("点击了充值订单记录");break;case"currency":console.log("点击了货币记录")}};return(e,l)=>{const a=I,t=v;return n(),d("div",null,[u(s)?(n(),h(t,{key:0,modelValue:u(r),"onUpdate:modelValue":l[0]||(l[0]=e=>g(r)?r.value=e:null),class:"demo-tabs",onTabClick:_},{default:p((()=>[c(a,{label:"账号详情",name:"detail"},{default:p((()=>[u(s)?(n(),h(V(R),{key:0,accountInfo:u(i)},null,8,["accountInfo"])):w("",!0)])),_:1}),u(s)?(n(),h(a,{key:0,label:"充值订单记录",name:"order",accountInfo:u(i)},{default:p((()=>[u(s)?(n(),h(V(Y),{key:0,accountInfo:u(i)},null,8,["accountInfo"])):w("",!0)])),_:1},8,["accountInfo"])):w("",!0)])),_:1},8,["modelValue"])):w("",!0)])}}},T={__name:"cdkeyDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,a=l.rowInfo,o=l.fieldsDescInfo;return t.getCache("resource").meta.resource_url,(e,l)=>{const t=i,r=s,f=K,m=x,_=C,k=D,w=U,I=j,V=L;return n(),h(V,{ref:"dialogLookFormRef",model:u(a),class:"operation_form","label-width":"130px"},{default:p((()=>[(n(!0),d(b,null,y(u(o),(e=>(n(),d(b,null,["items"===e.type?(n(),h(f,{key:0,label:"奖励列表",prop:"Attach"},{default:p((()=>[c(r,{data:u(a).Attach,border:""},{default:p((()=>[c(t,{label:"道具id",prop:"id"}),c(t,{label:"数量",prop:"num"}),c(t,{label:"道具名",prop:"desc"})])),_:1},8,["data"])])),_:1})):(n(),d(b,{key:1},[void 0!==e.choices&&e.choices.length>0?(n(),h(f,{key:0,label:e.name,prop:e.key},{default:p((()=>[c(k,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:p((()=>[c(_,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",disabled:"",modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:p((()=>[(n(!0),d(b,null,y(e.choices,(e=>(n(),h(m,{key:e.desc,label:e.desc,value:e.value},null,8,["label","value"])))),128))])),_:2},1032,["placeholder","modelValue","onUpdate:modelValue","multiple"])])),_:2},1032,["content"])])),_:2},1032,["label","prop"])):"Time"===e.type?(n(),h(f,{key:1,label:e.name,prop:e.key},{default:p((()=>[c(w,{modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,type:"datetime",disabled:"",placeholder:"空时间",format:"YYYY/MM/DD HH:mm:ss","value-format":"YYYY/MM/DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"])):(n(),h(f,{key:2,label:e.name,prop:e.key},{default:p((()=>[c(I,{modelValue:u(a)[e.key],"onUpdate:modelValue":l=>u(a)[e.key]=l,disabled:""},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"]))],64))],64)))),256))])),_:1},8,["model"])}}};const A={__name:"cdkeyUsedHistory",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=l.rowInfo;l.fieldsDescInfo;const r=t.getCache("resource").meta.resource_url,y=k([]),h=k([]);var w,I;(w=r,I={id:o.ID},a({url:w+"/special/used",method:"get",params:I})).then((e=>{y.value=e.data.list,h.value=[{filedKey1:"礼包名称",filedValue1:o.Name,filedKey2:"礼包总数量",filedValue2:o.CodeNum},{filedKey1:"礼包使用数量",filedValue1:y.value.length}]}),(e=>{}));const V=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=i,t=s,o=f,r=m;return n(),d(b,null,[c(o,null,{default:p((()=>[c(t,{data:u(h),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":V,"show-header":!1},{default:p((()=>[c(a,{prop:"filedKey1",label:"",width:"180"}),c(a,{prop:"filedValue1",label:"",width:"200"}),c(a,{prop:"filedKey2",label:"",width:"180"}),c(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),c(r,{"content-position":"left"},{default:p((()=>l[0]||(l[0]=[_("使用详情")]))),_:1}),c(o,null,{default:p((()=>[c(t,{data:u(y),style:{width:"100%"},height:"300","max-height":"300","table-layout":"auto",stripe:""},{default:p((()=>[c(a,{prop:"server_id",label:"区服"}),c(a,{prop:"account",label:"账号名"}),c(a,{prop:"role_id",label:"角色id"}),c(a,{prop:"role_name",label:"角色名"}),c(a,{prop:"key",label:"码"}),c(a,{prop:"ip",label:"ip"}),c(a,{prop:"device_id",label:"设备号"}),c(a,{prop:"created_at",label:"使用时间"})])),_:1},8,["data"])])),_:1})],64)}}},H={__name:"project_op",setup(l){const d=t.getCache("resource"),c=o().dynamicRouteChildren,p=d.meta.projectId,s=[];switch(d.meta.resource){case"account":if(s.length>0)break;s.push({key:"account:detail",name:"用户详情",btn_color_type:"primary",btn_type:1,btn_callback_component:E},{key:"account:detail",name:"白名单",btn_color_type:"default",btn_type:2,click_handler:e=>{for(let l=0;l<c.length;l++){const a=c[l];void 0!==a.meta&&(a.meta.projectId===p&&"whitelist"===a.meta.resource&&(t.setCache("resource",a),r.push({path:a.path,query:{from:"account",WType:"account",Value:e.Account}})))}}});break;case"role":if(s.length>0)break;s.push({key:"account:detail",name:"封禁",btn_color_type:"info",btn_type:2,click_handler:e=>{for(let l=0;l<c.length;l++){const a=c[l];void 0!==a.meta&&(a.meta.projectId===p&&"ban"===a.meta.resource&&(t.setCache("resource",a),r.push({path:a.path,query:{from:"role",ServerConfID:e.ServerConfId,Value:e.RoleId}})))}}});break;case"cdkey":if(s.length>0)break;s.push({key:"cdkey:detail",name:"查看",btn_color_type:"primary",btn_type:1,btn_callback_component:T},{key:"cdkey:export",name:"导出",btn_color_type:"warning",btn_type:2,click_handler:e=>{const l=t.getCache("resource").meta.resource_url;var o,r;(o=l,r={id:e.ID},a({url:o+"/special/export",method:"get",params:r,responseType:"blob"})).then((e=>{console.log("导出cdkey返回",e);let l="default_filename.ext";const a=e.headers["content-disposition"].match(/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i);a&&a[1]&&(l=decodeURIComponent(a[1]));const t=new Blob([e.data]),o=document.createElement("a");o.href=window.URL.createObjectURL(t),o.download=l,o.click(),window.URL.revokeObjectURL(o.href)}))}},{key:"cdkey:used:history",name:"礼包使用",btn_color_type:"default",btn_type:1,btn_callback_component:A})}return(l,a)=>(n(),h(V(e),{rowClickDialogBtns:s}))}};export{H as default};