var x=(y,m,u)=>new Promise((c,n)=>{var f=l=>{try{g(u.next(l))}catch(d){n(d)}},v=l=>{try{g(u.throw(l))}catch(d){n(d)}},g=l=>l.done?c(l.value):Promise.resolve(l.value).then(f,v);g((u=u.apply(y,m)).next())});import{d as Y,f as b,r as B,U as p,a2 as K,a3 as T,k as a,af as o,u as _,G as i}from"./vue-vendor-CxLCUzY4.js";import{h as $}from"./index-Cy4uayzW.js";import{B as P}from"./Bar-C2dAaQCo.js";import{P as V}from"./Pie-s7GuvuDq.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useECharts-C5PCME_B.js";import"./useTimeout-gJpgadD6.js";import"./echarts-3CSrakfu.js";const E={class:"p-4"},O=Y({__name:"index",setup(y){const m=b("bar"),u=b("year"),c=b("year"),n=b([]),f=B({getYearCountInfo:"/mock/api/report/getYearCountInfo",getMonthCountInfo:"/mock/api/report/getMonthCountInfo",getCntrNoCountInfo:"/mock/api/report/getCntrNoCountInfo",getCabinetCountInfo:"/mock/api/report/getCabinetCountInfo"});function v(t,e,r){return x(this,null,function*(){const s=yield $.get({url:t,params:r},{isTransformResponse:!1,errorMessageMode:"none"});if(s.success)switch(n.value=[],e){case"year":g(s.result);break;case"month":l(s.result);break;case"category":d(s.result);break;case"cabinet":D(s.result);break;default:break}})}function g(t){for(let e=0;e<t.length;e++)n.value.push({name:`${t[e].year}年`,value:t[e].yearcount})}function l(t){for(let e=0;e<t.length;e++)n.value.push({name:`${t[e].month}`,value:t[e].monthcount})}function d(t){for(let e=0;e<t.length;e++)n.value.push({name:`${t[e].classifyname}`,value:t[e].cntrnocount})}function D(t){for(let e=0;e<t.length;e++)n.value.push({name:`${t[e].cabinetname}`,value:t[e].cabinetcocunt})}function h(t){_(m)==="pie"?v(k(_(c)),_(c),{}):v(k(_(u)),_(u),{})}function k(t){if(t==="year")return f.getYearCountInfo;if(t==="month")return f.getMonthCountInfo;if(t==="category")return f.getCntrNoCountInfo;if(t==="cabinet")return f.getCabinetCountInfo}function N(t){}return v(f.getYearCountInfo,"year",{}),(t,e)=>{const r=p("a-radio-button"),s=p("a-radio-group"),I=p("a-col"),M=p("a-row"),w=p("a-tab-pane"),S=p("a-tabs"),U=p("a-card");return K(),T("div",E,[a(U,{bordered:!1,style:{height:"100%"}},{default:o(()=>[a(S,{activeKey:m.value,"onUpdate:activeKey":e[2]||(e[2]=C=>m.value=C),animated:"",onChange:N},{default:o(()=>[a(w,{key:"bar",tab:"柱状图"},{default:o(()=>[a(M,null,{default:o(()=>[a(I,{span:10},{default:o(()=>[a(s,{value:u.value,"onUpdate:value":e[0]||(e[0]=C=>u.value=C),onChange:h},{default:o(()=>[a(r,{value:"year"},{default:o(()=>e[3]||(e[3]=[i("按年统计")])),_:1}),a(r,{value:"month"},{default:o(()=>e[4]||(e[4]=[i("按月统计")])),_:1}),a(r,{value:"category"},{default:o(()=>e[5]||(e[5]=[i("按类别统计")])),_:1}),a(r,{value:"cabinet"},{default:o(()=>e[6]||(e[6]=[i("按柜号统计")])),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),a(P,{chartData:n.value,height:"50vh"},null,8,["chartData"])]),_:1}),a(w,{key:"pie",tab:"饼状图","force-render":""},{default:o(()=>[a(M,{gutter:24},{default:o(()=>[a(I,{span:10},{default:o(()=>[a(s,{value:c.value,"onUpdate:value":e[1]||(e[1]=C=>c.value=C),onChange:h},{default:o(()=>[a(r,{value:"year"},{default:o(()=>e[7]||(e[7]=[i("按年统计")])),_:1}),a(r,{value:"month"},{default:o(()=>e[8]||(e[8]=[i("按月统计")])),_:1}),a(r,{value:"category"},{default:o(()=>e[9]||(e[9]=[i("按类别统计")])),_:1}),a(r,{value:"cabinet"},{default:o(()=>e[10]||(e[10]=[i("按柜号统计")])),_:1})]),_:1},8,["value"])]),_:1}),a(V,{chartData:n.value,height:"40vh"},null,8,["chartData"])]),_:1})]),_:1})]),_:1},8,["activeKey"])]),_:1})])}}});export{O as default};
