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 o,af as a,u as _,G as i}from"./vue-vendor-CxLCUzY4.js";import{h as $}from"./index-CYriLmQo.js";import{B as P}from"./Bar-5hIPgm2N.js";import{P as V}from"./Pie-UkjdTypB.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useECharts-BdLEHtT5.js";import"./useTimeout-DC8132dd.js";import"./echarts-DjaBQeb6.js";import"./renderers-qdWQN0CG.js";const E={class:"p-4"},Q=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,[o(U,{bordered:!1,style:{height:"100%"}},{default:a(()=>[o(S,{activeKey:m.value,"onUpdate:activeKey":e[2]||(e[2]=C=>m.value=C),animated:"",onChange:N},{default:a(()=>[o(w,{key:"bar",tab:"柱状图"},{default:a(()=>[o(M,null,{default:a(()=>[o(I,{span:10},{default:a(()=>[o(s,{value:u.value,"onUpdate:value":e[0]||(e[0]=C=>u.value=C),onChange:h},{default:a(()=>[o(r,{value:"year"},{default:a(()=>e[3]||(e[3]=[i("按年统计")])),_:1}),o(r,{value:"month"},{default:a(()=>e[4]||(e[4]=[i("按月统计")])),_:1}),o(r,{value:"category"},{default:a(()=>e[5]||(e[5]=[i("按类别统计")])),_:1}),o(r,{value:"cabinet"},{default:a(()=>e[6]||(e[6]=[i("按柜号统计")])),_:1})]),_:1},8,["value"])]),_:1})]),_:1}),o(P,{chartData:n.value,height:"50vh"},null,8,["chartData"])]),_:1}),o(w,{key:"pie",tab:"饼状图","force-render":""},{default:a(()=>[o(M,{gutter:24},{default:a(()=>[o(I,{span:10},{default:a(()=>[o(s,{value:c.value,"onUpdate:value":e[1]||(e[1]=C=>c.value=C),onChange:h},{default:a(()=>[o(r,{value:"year"},{default:a(()=>e[7]||(e[7]=[i("按年统计")])),_:1}),o(r,{value:"month"},{default:a(()=>e[8]||(e[8]=[i("按月统计")])),_:1}),o(r,{value:"category"},{default:a(()=>e[9]||(e[9]=[i("按类别统计")])),_:1}),o(r,{value:"cabinet"},{default:a(()=>e[10]||(e[10]=[i("按柜号统计")])),_:1})]),_:1},8,["value"])]),_:1}),o(V,{chartData:n.value,height:"40vh"},null,8,["chartData"])]),_:1})]),_:1})]),_:1},8,["activeKey"])]),_:1})])}}});export{Q as default};
