var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(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={}))l.call(a,t)&&i(e,t,a[t]);if(s)for(var t of s(a))r.call(a,t)&&i(e,t,a[t]);return e};import{H as o,w as c,_ as p}from"./index-Cc7iUtpa.js";import{d,r as u,k as m,o as v,H as h,a0 as y,a3 as _,f as b,a8 as f,a1 as g}from"./vendor-C4fU48ba.js";import{u as w,i as k,a as P,b as L,c as j}from"./installCanvasRenderer-6BeeRync.js";import{i as T,a as D}from"./install-C_w2vyTz.js";import{R as O,j as Y}from"./antd-31u6eFi9.js";import"./utils-uTUGmQQn.js";const C=d({components:{},setup(){let e,s=u({dataList:{}}),l=u({rangePickerValue:[],userType:""}),r=m([{label:"all",value:""},{label:"visitor",value:"0"},{label:"yearly",value:"1"},{label:"monthly",value:"2"},{label:"trial",value:"3"}]),i=()=>{return e=null,a=null,t=function*(){var e,a;s.tableLoading=!0;let t=(null==(e=l.rangePickerValue)?void 0:e[0])?l.rangePickerValue[0]+" 00:00:00":"",r={endTime:(null==(a=l.rangePickerValue)?void 0:a[1])?l.rangePickerValue[1]+" 23:59:59":"",startTime:t,userType:l.userType};o.axiosGet(o.httpUrls.recentNewUserChart,{params:r}).then(e=>{if(e){let a=[];e.names.forEach((t,s)=>{let l={name:t,value:e.values[s]};a.push(l)}),s.dataList=a,p(a)}})},new Promise((s,l)=>{var r=e=>{try{n(t.next(e))}catch(a){l(a)}},i=e=>{try{n(t.throw(e))}catch(a){l(a)}},n=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,i);n((t=t.apply(e,a)).next())});var e,a,t},p=a=>{if(e)e.setOption({series:[{data:a}]});else{w([P,L,T,j,D]);var t,s=y.value;e=k(s),(t={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:a}]})&&e.setOption(t)}},d=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=[c(a,"YYYY-MM-DD"),c(s,"YYYY-MM-DD")],i()},y=m();return v(()=>{d("month")}),_=n(n({},h(s)),h(l)),a(_,t({state:r,searchHistoryList:()=>{i()},gettrialList:i,pageChartDom:y,lastGeTrialList:d}));var _},data:()=>({}),methods:{}}),x={class:"recentNewUserChart admin_page"},S={class:"admin_table_search"},V={class:"admin_state"},H={class:"admin_state_item"},M={class:"admin_state_item"},G={class:"admin_search"},U={class:"admin_state_list"},E={class:"admin_table_content",ref:"pageChartDom"};const N=p(C,[["render",function(e,a,t,s,l,r){const i=O,n=Y;return g(),y("div",x,[_("div",S,[_("div",V,[_("div",H,[a[7]||(a[7]=_("span",null,"Start Time:",-1)),b(i,{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:f(()=>a[6]||(a[6]=[_("span",{class:"icon iconfont range_picker_icon icon-rili"},null,-1)])),_:1},8,["value","placeholder"])]),_("div",M,[a[8]||(a[8]=_("span",null,"Type:",-1)),b(n,{value:e.userType,"onUpdate:value":a[1]||(a[1]=a=>e.userType=a),size:"large",style:{width:"280px"},optionFilterProp:"label",options:e.state,placeholder:"Please select",allowClear:"","show-search":""},null,8,["value","options"])])]),_("div",G,[_("div",{class:"admin_search_item",onClick:a[2]||(a[2]=(...a)=>e.searchHistoryList&&e.searchHistoryList(...a))},"Search")]),_("div",U,[_("div",{class:"admin_state_list_item",onClick:a[3]||(a[3]=a=>e.lastGeTrialList("year"))},"Nearly a year"),_("div",{class:"admin_state_list_item",onClick:a[4]||(a[4]=a=>e.lastGeTrialList("month"))},"Last month"),_("div",{class:"admin_state_list_item",onClick:a[5]||(a[5]=a=>e.lastGeTrialList("week"))},"Last week")])]),_("div",E,null,512)])}]]);export{N as default};
