var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,l=(a,t,s)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,n=(e,a)=>{for(var t in a||(a={}))i.call(a,t)&&l(e,t,a[t]);if(s)for(var t of s(a))r.call(a,t)&&l(e,t,a[t]);return e};import{u as o,a as c,H as d,w as m,_ as p}from"./index-Dy4pwQz7.js";import{d as u,r as v,c as h,k as f,o as _,H as g,a0 as y,a3 as L,f as b,aa as k,a8 as w,a1 as P}from"./vendor-C4fU48ba.js";import{u as j,i as O,a as Y,b as D,c as C}from"./installCanvasRenderer-6BeeRync.js";import{i as x,a as $}from"./install-C_w2vyTz.js";import{R as M,j as S}from"./antd-31u6eFi9.js";import"./utils-uTUGmQQn.js";const T=u({components:{},setup(){const{t:e}=o(),s=c();let i,r=v({dataList:h(()=>s.state.adminPage.allUserList)}),l=v({rangePickerValue:[],userIdList:[]}),p=()=>{return a=null,t=null,s=function*(){var a,t;r.tableLoading=!0;let s=(null==(a=l.rangePickerValue)?void 0:a[0])?l.rangePickerValue[0]+" 00:00:00":"",i={endTime:(null==(t=l.rangePickerValue)?void 0:t[1])?l.rangePickerValue[1]+" 23:59:59":"",startTime:s,userIdList:l.userIdList.join(",")};d.axiosGet(d.httpUrls.getActiveUserFunc,{params:i}).then(a=>{if(a){let t=[];a.names.forEach((s,i)=>{let r={name:e(`admin.${s}`),value:a.values[i]};t.push(r)}),u(t)}})},new Promise((e,i)=>{var r=e=>{try{n(s.next(e))}catch(a){i(a)}},l=e=>{try{n(s.throw(e))}catch(a){i(a)}},n=a=>a.done?e(a.value):Promise.resolve(a.value).then(r,l);n((s=s.apply(a,t)).next())});var a,t,s},u=e=>{if(i)i.setOption({series:[{data:e}]});else{j([Y,D,x,C,$]);var a,t=L.value;i=O(t),(a={tooltip:{trigger:"item"},legend:{top:"5%",left:"center"},series:[{type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:30,fontWeight:"bold"}},labelLine:{show:!1},stillShowZeroSum:!0,data:e}]})&&i.setOption(a)}},y=e=>{let a,t=new Date,s=Math.floor(t.getTime()/1e3);"year"==e?a=s-31104e3:"month"==e?a=s-2592e3:"week"==e&&(a=s-604800),l.rangePickerValue=[m(a,"YYYY-MM-DD"),m(s,"YYYY-MM-DD")],p()},L=f();return _(()=>{y("month")}),b=n(n({},g(r)),g(l)),a(b,t({searchHistoryList:()=>{p()},gettrialList:p,pageChartDom:L,lastGeTrialList:y,filterOption:(e,a)=>a.label.toLowerCase().indexOf(e.toLowerCase())>=0}));var b},data:()=>({}),methods:{}}),V={class:"recentActiveChart admin_page"},H={class:"admin_table_search"},I={class:"admin_state"},U={class:"admin_state_item"},G={class:"admin_state_item"},A={class:"admin_search"},E={class:"admin_state_list"},N={class:"admin_table_content",ref:"pageChartDom"};const R=p(T,[["render",function(e,a,t,s,i,r){const l=M,n=S;return P(),y("div",V,[L("div",H,[L("div",I,[L("div",U,[L("span",null,k(e.$t("admin.StartTime"))+":",1),b(l,{style:{width:"280px"},class:"range_picker",value:e.rangePickerValue,"onUpdate:value":a[0]||(a[0]=a=>e.rangePickerValue=a),allowClear:!1,placeholder:[e.$t("HistoryPage.StartDate"),e.$t("HistoryPage.EndDate")],valueFormat:"YYYY-MM-DD"},{suffixIcon:w(()=>a[6]||(a[6]=[L("span",{class:"icon iconfont range_picker_icon icon-rili"},null,-1)])),_:1},8,["value","placeholder"])]),L("div",G,[L("span",null,k(e.$t("admin.UserName"))+":",1),b(n,{value:e.userIdList,"onUpdate:value":a[1]||(a[1]=a=>e.userIdList=a),mode:"multiple",style:{width:"280px"},"filter-option":e.filterOption,placeholder:e.$t("admin.selectUserName"),"max-tag-count":"responsive",options:e.dataList},null,8,["value","filter-option","placeholder","options"])])]),L("div",A,[L("div",{class:"admin_search_item",onClick:a[2]||(a[2]=(...a)=>e.searchHistoryList&&e.searchHistoryList(...a))},"Search")]),L("div",E,[L("div",{class:"admin_state_list_item",onClick:a[3]||(a[3]=a=>e.lastGeTrialList("year"))},k(e.$t("admin.NearlyAYear")),1),L("div",{class:"admin_state_list_item",onClick:a[4]||(a[4]=a=>e.lastGeTrialList("month"))},k(e.$t("admin.LastMonth")),1),L("div",{class:"admin_state_list_item",onClick:a[5]||(a[5]=a=>e.lastGeTrialList("week"))},k(e.$t("admin.LastWeek")),1)])]),L("div",N,null,512)])}]]);export{R as default};
