uniugm/admin/ui/static/static/js/project_op--da6BW3g.js
2025-08-05 23:55:19 +08:00

2 lines
16 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-D5XQjs73.js";import{_ as l,s as a,L as t,u as o,r}from"./index-u8jI_EeY.js";import{a as n,o as s,b as d,w as u,X as c,u as i,Y as p,a7 as m,aa as f,v as h,F as _,z as b,c as y,r as v,ad as g,d as w,a1 as k,a8 as I,a2 as V,a4 as D,W as x,t as C,Z as Y,ae as U,U as K,af as T,B as L,ag as j,a0 as E,E as H,a3 as M,$ as N}from"./vendor-BRRlSJxx.js";import"./resource-BvLlYROj.js";import"./empty-lI4MuuPg.js";const S=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=[],v=!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,v&&r.push({colProp:t,colLabel:a.desc})})),v=!1,o.push(e)})),Object.keys(l.accountInfo).forEach((e=>{l.accountInfo[e]}));const g=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=p,v=c,w=m,k=f;return s(),n("div",null,[d(w,null,{default:u((()=>[d(v,{data:i(t),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":g,"show-header":!1},{default:u((()=>[d(a,{prop:"filedKey1",label:"",width:"180"}),d(a,{prop:"filedValue1",label:"",width:"200"}),d(a,{prop:"filedKey2",label:"",width:"180"}),d(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),d(w,null,{default:u((()=>[d(k,{"content-position":"left"},{default:u((()=>l[0]||(l[0]=[h("角色详情")]))),_:1}),d(v,{class:"roleDetailList",data:i(o),border:"","show-header":!0,style:{width:"100%"}},{default:u((()=>[d(a,{prop:"platform",label:"平台"}),d(a,{prop:"server_id",label:"区服"}),d(a,{prop:"name",label:"角色名称",width:"100%"}),d(a,{prop:"role_id",label:"角色id"}),d(a,{prop:"total_pay_amount",label:"充值金额"}),d(a,{prop:"level",label:"等级"}),d(a,{prop:"created_at",label:"创建时间",width:"100"}),d(a,{prop:"last_login_time",label:"最后登录时间",width:"100"}),(s(!0),n(_,null,b(i(r),(e=>(s(),y(a,{prop:e.colProp,label:e.colLabel},null,8,["prop","label"])))),256))])),_:1},8,["data"])])),_:1})])}}},[["__scopeId","data-v-5a8d8958"]]),R={__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=p,o=c;return s(),n("div",null,[d(o,{data:i(a),style:{width:"100%"},"max-height":"500px","table-layout":"auto",border:"","show-header":!0},{default:u((()=>[d(t,{prop:"server_id",label:"区服"}),d(t,{prop:"account_id",label:"账户id"}),d(t,{prop:"role_id",label:"角色id"}),d(t,{prop:"role_name",label:"角色名"}),d(t,{prop:"sn",label:"订单号"}),d(t,{prop:"product_id",label:"商品id"}),d(t,{prop:"price",label:"金额"}),d(t,{prop:"purchase_type",label:"支付方式"}),d(t,{prop:"purchase_at",label:"订单时间"})])),_:1},8,["data"])])}}};const z={style:{"margin-right":"20px"}},A={style:{width:"400px","margin-right":"10px"}},P={__name:"gamelogList",props:{eventName:"",serverId:"",account:"",roleId:""},setup(e,{expose:l}){const o=e,r=v({totalCount:0,fieldsDescInfo:[],rows:[]}),f=t.getCache("resource").meta.resource_url,K=new Date,T=new Date;K.setHours(0),K.setMinutes(0),K.setSeconds(0);const L=v([K,T]),j=v(1),E=v(10),H=[10,20,50,100,200],M=o.eventName.split(","),N=v(""),S=v([]),R=()=>{let e={EventName:o.eventName,ServerId:o.serverId,Account:o.account,RoleId:o.roleId,PageNo:j.value,PageLen:E.value};var l,t;console.log("select name:",N.value),void 0!==N.value&&""!==N.value&&" "!==N.value&&(e.EventName=N.value),2===L.value.length&&(console.log("select date time:",L.value),e.DateStart=U(L.value[0]).format("YYYY-MM-DD HH:mm:ss"),e.DateEnd=U(L.value[1]).format("YYYY-MM-DD HH:mm:ss")),(l=f,t=e,a({url:l+"/special/event_list",method:"get",params:t})).then((e=>{r.value=e.data,S.value=[],r.value.rows.forEach((e=>{let l=!1;for(let a=0;a<S.value.length;a++)if(e[4]===S.value[a].value){l=!0;break}l||S.value.push({text:e[4],value:e[4]})}))}),(e=>{}))},P=()=>{};l({getEventList:R});const O=()=>{R()},B=()=>{R()},F=()=>{N.value="",L.value=[K,T]},q=(e,l,a)=>l[4]===e;g((()=>{console.log("用户列表组件已销毁")}));const W=[{text:"今天",value:()=>[K,T]},{text:"昨天",value:()=>{const e=new Date;e.setHours(0),e.setMinutes(0),e.setSeconds(0);const l=new Date;return l.setHours(0),l.setMinutes(0),l.setSeconds(0),l.setTime(l.getTime()-864e5),[l,e]}},{text:"最近7天",value:()=>{const e=new Date,l=new Date;return l.setTime(l.getTime()-6048e5),[l,e]}},{text:"上周",value:()=>{const e=new Date,l=new Date;return l.setTime(l.getTime()-6048e5),[l,e]}},{text:"上个月",value:()=>{const e=new Date,l=new Date;return l.setTime(l.getTime()-2592e6),[l,e]}},{text:"最近1个月",value:()=>{const e=new Date,l=new Date;return l.setTime(l.getTime()-2592e6),[l,e]}}];return(e,l)=>{const a=V,t=k,o=D,f=x,v=m,g=p,U=c,K=Y;return s(),n("div",null,[d(v,{align:"middle"},{default:u((()=>[w("div",z,[d(t,{modelValue:i(N),"onUpdate:modelValue":l[0]||(l[0]=e=>I(N)?N.value=e:null),placeholder:"选择事件",clearable:"",style:{width:"150px","margin-right":"10px"}},{default:u((()=>[(s(!0),n(_,null,b(i(M),(e=>(s(),y(a,{key:e,label:e,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])]),l[6]||(l[6]=w("span",null,"选择时间范围:",-1)),w("div",A,[d(o,{modelValue:i(L),"onUpdate:modelValue":l[1]||(l[1]=e=>I(L)?L.value=e:null),type:"datetimerange",format:"YYYY/MM/DD HH:mm:ss","range-separator":"到",placeholder:"选个一个时间范围","start-placeholder":"开始时间","end-placeholder":"结束时间",shortcuts:W,onChange:P},null,8,["modelValue"])]),d(f,{type:"primary",onClick:R},{default:u((()=>l[4]||(l[4]=[h(" 查询 ")]))),_:1}),d(f,{onClick:F},{default:u((()=>l[5]||(l[5]=[h(" 重置 ")]))),_:1}),l[7]||(l[7]=w("div",{style:{width:"100%",height:"0px",border:"1px solid #ebeef5",margin:"8px 0 8px 0"}},null,-1))])),_:1}),d(v,null,{default:u((()=>[d(U,{data:i(r).rows,"max-height":"500px",style:{width:"100%"},"table-layout":"auto",border:"","show-header":!0},{default:u((()=>[(s(!0),n(_,null,b(i(r).fieldsDescInfo,((e,l)=>(s(),n(_,null,["pub_roleid"===e.name?(s(),y(g,{key:0,prop:e.name,label:e.alias,width:"100px",filters:i(S),"filter-method":q},{default:u((e=>[w("span",null,C(e.row[l]),1)])),_:2},1032,["prop","label","filters"])):(s(),y(g,{key:1,prop:e.name,label:e.alias,width:"100px"},{default:u((e=>[w("span",null,C(e.row[l]),1)])),_:2},1032,["prop","label"]))],64)))),256))])),_:1},8,["data"])])),_:1}),d(v,{style:{"margin-top":"10px","margin-right":"10px"},justify:"end"},{default:u((()=>[d(K,{"current-page":i(j),"onUpdate:currentPage":l[2]||(l[2]=e=>I(j)?j.value=e:null),"page-size":i(E),"onUpdate:pageSize":l[3]||(l[3]=e=>I(E)?E.value=e:null),"page-sizes":H,layout:"total, sizes, prev, pager, next, jumper",total:i(r).totalCount,onSizeChange:O,onCurrentChange:B},null,8,["current-page","page-size","total"])])),_:1})])}}},O={style:{width:"1000px"}},B={__name:"userDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=t.getCache("resource").meta.resource_url,r=v("detail");console.log("进入用户详情:",l.rowInfo);const c=l.rowInfo.Account,p=l.rowInfo.ServerConfId;let m=v(!1),f={};var h,_;(h=o,_=l.rowInfo,a({url:h+"/special/detail",method:"get",params:_})).then((e=>{console.log("获取账户详情返回:",e.data),f=e.data.account_info,m.value=!0}),(e=>{}));const b=v(null),g=v(null),w=v(null),k=(e,l)=>{switch(e.props.name){case"detail":console.log("点击了账号详情");break;case"order":console.log("点击了充值订单记录");break;case"chat":b.value.getEventList();break;case"currencyChange":g.value.getEventList();break;case"itemChange":w.value.getEventList();break;case"currency":console.log("点击了货币记录")}};return(e,l)=>{const a=T,t=j;return s(),n("div",O,[i(m)?(s(),y(t,{key:0,modelValue:i(r),"onUpdate:modelValue":l[0]||(l[0]=e=>I(r)?r.value=e:null),class:"demo-tabs",onTabClick:k},{default:u((()=>[d(a,{label:"账号详情",name:"detail"},{default:u((()=>[(s(),y(L(S),{accountInfo:i(f)},null,8,["accountInfo"]))])),_:1}),d(a,{label:"充值订单记录",name:"order"},{default:u((()=>["order"===i(r)?(s(),y(L(R),{key:0,accountInfo:i(f)},null,8,["accountInfo"])):K("",!0)])),_:1}),d(a,{key:"tab-chat",label:"聊天记录",name:"chat"},{default:u((()=>[d(P,{key:"tab-chat",ref:e=>b.value=e,serverId:i(p),account:i(c),eventName:"chatlog"},null,8,["serverId","account"])])),_:1}),d(a,{key:"tab-currency",label:"货币变动",name:"currencyChange"},{default:u((()=>[d(P,{key:"tab-currency",ref:e=>g.value=e,serverId:i(p),account:i(c),eventName:"addcoin,costcoin"},null,8,["serverId","account"])])),_:1}),d(a,{key:"tab-item",label:"道具变动",name:"itemChange"},{default:u((()=>[d(P,{key:"tab-item",ref:e=>w.value=e,serverId:i(p),account:i(c),eventName:"gainitem,loseitem"},null,8,["serverId","account"])])),_:1})])),_:1},8,["modelValue"])):K("",!0)])}}},F={__name:"roleDetailItems",props:{items:{}},setup:e=>(l,a)=>{const t=p,o=c;return s(),n("div",null,[d(o,{data:e.items,style:{width:"100%"},"max-height":"500px","table-layout":"auto",border:"","show-header":!0},{default:u((()=>[d(t,{prop:"item_id",label:"道具id"}),d(t,{prop:"desc",label:"道具名"}),d(t,{prop:"item_num",label:"道具数量"})])),_:1},8,["data"])])}},q={__name:"roleDetail",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=t.getCache("resource").meta.resource_url,r=v("detail");console.log("进入角色详情:",l.rowInfo),l.rowInfo.RoleId,l.rowInfo.ServerConfId;let c=v(!1),p={};var m,f;(m=o,f=l.rowInfo,a({url:m+"/special/detail",method:"get",params:f})).then((e=>{console.log("获取角色详情返回:",e.data),p=e.data.role_info,c.value=!0}),(e=>{}));const h=(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=T,t=j;return s(),n("div",null,[i(c)?(s(),y(t,{key:0,modelValue:i(r),"onUpdate:modelValue":l[0]||(l[0]=e=>I(r)?r.value=e:null),class:"demo-tabs",onTabClick:h},{default:u((()=>[d(a,{label:"道具列表",name:"detail"},{default:u((()=>[d(F,{items:i(p).items},null,8,["items"])])),_:1})])),_:1},8,["modelValue"])):K("",!0)])}}},W={__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=p,r=c,m=E,f=V,h=k,v=H,g=D,w=M,I=N;return s(),y(I,{ref:"dialogLookFormRef",model:i(a),class:"operation_form","label-width":"130px"},{default:u((()=>[(s(!0),n(_,null,b(i(o),(e=>(s(),n(_,null,["items"===e.type?(s(),y(m,{key:0,label:"奖励列表",prop:"Attach"},{default:u((()=>[d(r,{data:i(a).Attach,border:""},{default:u((()=>[d(t,{label:"道具id",prop:"id"}),d(t,{label:"数量",prop:"num"}),d(t,{label:"道具名",prop:"desc"})])),_:1},8,["data"])])),_:1})):(s(),n(_,{key:1},[void 0!==e.choices&&e.choices.length>0?(s(),y(m,{key:0,label:e.name,prop:e.key},{default:u((()=>[d(v,{effect:"light",content:e.help_text,placement:"bottom-start"},{default:u((()=>[d(h,{placeholder:!0===e.multi_choice?"--多选--":"--单选--",disabled:"",modelValue:i(a)[e.key],"onUpdate:modelValue":l=>i(a)[e.key]=l,style:{width:"150px"},multiple:!0===e.multi_choice},{default:u((()=>[(s(!0),n(_,null,b(e.choices,(e=>(s(),y(f,{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?(s(),y(m,{key:1,label:e.name,prop:e.key},{default:u((()=>[d(g,{modelValue:i(a)[e.key],"onUpdate:modelValue":l=>i(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"])):(s(),y(m,{key:2,label:e.name,prop:e.key},{default:u((()=>[d(w,{modelValue:i(a)[e.key],"onUpdate:modelValue":l=>i(a)[e.key]=l,disabled:""},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["label","prop"]))],64))],64)))),256))])),_:1},8,["model"])}}};const X={__name:"cdkeyUsedHistory",props:{rowInfo:{},fieldsDescInfo:{}},setup(e){const l=e,o=l.rowInfo;l.fieldsDescInfo;const r=t.getCache("resource").meta.resource_url,b=v([]),y=v([]);var g,w;(g=r,w={id:o.ID},a({url:g+"/special/used",method:"get",params:w})).then((e=>{b.value=e.data.list,y.value=[{filedKey1:"礼包名称",filedValue1:o.Name,filedKey2:"礼包总数量",filedValue2:o.CodeNum},{filedKey1:"礼包使用数量",filedValue1:b.value.length}]}),(e=>{}));const k=e=>0===e.columnIndex||2===e.columnIndex?{"font-weight":"bold",color:"black"}:{};return(e,l)=>{const a=p,t=c,o=m,r=f;return s(),n(_,null,[d(o,null,{default:u((()=>[d(t,{data:i(y),style:{width:"100%"},"table-layout":"auto",border:"","cell-style":k,"show-header":!1},{default:u((()=>[d(a,{prop:"filedKey1",label:"",width:"180"}),d(a,{prop:"filedValue1",label:"",width:"200"}),d(a,{prop:"filedKey2",label:"",width:"180"}),d(a,{prop:"filedValue2",label:"",width:"200"})])),_:1},8,["data"])])),_:1}),d(r,{"content-position":"left"},{default:u((()=>l[0]||(l[0]=[h("使用详情")]))),_:1}),d(o,null,{default:u((()=>[d(t,{data:i(b),style:{width:"100%"},height:"300","max-height":"300","table-layout":"auto",stripe:""},{default:u((()=>[d(a,{prop:"server_id",label:"区服"}),d(a,{prop:"account",label:"账号名"}),d(a,{prop:"role_id",label:"角色id"}),d(a,{prop:"role_name",label:"角色名"}),d(a,{prop:"key",label:"码"}),d(a,{prop:"ip",label:"ip"}),d(a,{prop:"device_id",label:"设备号"}),d(a,{prop:"created_at",label:"使用时间"})])),_:1},8,["data"])])),_:1})],64)}}},Z={__name:"project_op",setup(l){const n=t.getCache("resource"),d=o().dynamicRouteChildren,u=n.meta.projectId,c=[];switch(n.meta.resource){case"account":if(c.length>0)break;c.push({key:"account:detail",name:"用户详情",btn_color_type:"primary",btn_type:1,btn_callback_component:B},{key:"account:detail",name:"白名单",btn_color_type:"default",btn_type:2,click_handler:e=>{for(let l=0;l<d.length;l++){const a=d[l];void 0!==a.meta&&(a.meta.projectId===u&&"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(c.length>0)break;c.push({key:"role:detail",name:"角色详情",btn_color_type:"primary",btn_type:1,btn_callback_component:q},{key:"account:detail",name:"封禁",btn_color_type:"info",btn_type:2,click_handler:e=>{for(let l=0;l<d.length;l++){const a=d[l];void 0!==a.meta&&(a.meta.projectId===u&&"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(c.length>0)break;c.push({key:"cdkey:detail",name:"查看",btn_color_type:"primary",btn_type:1,btn_callback_component:W},{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:X})}return(l,a)=>(s(),y(L(e),{rowClickDialogBtns:c}))}};export{Z as default};