import{aa as V,d as $,a4 as z,aN as A,r as f,b as C,c as n,at as G,e as h,f as H,g as E,h as t,i as a,u as o,k as w,q as J,A as B,m as d,t as K,w as O,F as Q,a as x,y as W,_ as X}from"./index.0308b213.js";const Z=_=>V({url:"agent/statcenter.order/areaData",params:_}),ee=_=>V({url:"agent/statcenter.order/exportAreaData",params:_}),te={class:"filter-form"},ae=d("\u4ECA\u5929"),oe=d("\u6700\u8FD17\u5929"),le=d("\u6700\u8FD130\u5929"),ne=d("\u81EA\u5B9A\u4E49"),re=d("\u641C\u7D22"),ue={style:{"margin-bottom":"10px"}},se=d("\u5BFC\u51FA"),de=$({setup(_){const D=z();let i=[];D.query.stat_day!==void 0?i=A([D.query.stat_day,D.query.stat_day],"YYYY-MM-DD"):i=[];const M=[{text:"\u4E00\u5468\u5185",value:()=>{const e=x();return[e.subtract(1,"week").toDate(),e.toDate()]}},{text:"\u4E24\u5468\u5185",value:()=>{const e=x();return[e.subtract(2,"week").toDate(),e.toDate()]}},{text:"\u4E00\u4E2A\u6708\u5185",value:()=>{const e=x();return[e.subtract(1,"month").toDate(),e.toDate()]}}];let b=f(!1);const l=C({days:i.length!==0?-1:0,keyword:"",stat_day:"",end_day:"",page:1,limit:10}),u=C({records:[],areas:[],count:0});let s=f(i);const q=()=>{const e=A(s.value,"YYYY-MM-DD");l.stat_day=e[0]||"",l.end_day=e[1]||""},F=()=>{l.days===-1&&(!s.value||s.value.length===0)||(b.value=!0,q(),Z(l).then(e=>{console.log(e,"res"),u.count=e.count,u.areas=e.parent_areas,u.records=e.list,b.value=!1}))};F();const T=()=>{ee(l).then(e=>{window.open(e.data)})},k=()=>{N(),F()},N=()=>{u.records=[],u.areas=[],u.count=0};let y=f(!0),m=f(!0);const R=()=>{y.value=!1,W(()=>{m.value=!m.value,y.value=!0})};return(e,r)=>{const p=n("el-radio"),S=n("el-radio-group"),L=n("el-date-picker"),Y=n("el-form-item"),g=n("el-button"),U=n("el-form"),v=n("el-table-column"),j=n("el-table"),I=n("el-card"),P=G("loading");return h(),H(Q,null,[E("div",te,[t(U,{model:o(l),"label-width":"90px"},{default:a(()=>[t(Y,{class:"tn-el-form-item",label:"\u7B5B\u9009\u65F6\u95F4"},{default:a(()=>[t(S,{modelValue:o(l).days,"onUpdate:modelValue":r[0]||(r[0]=c=>o(l).days=c)},{default:a(()=>[t(p,{border:!0,label:0},{default:a(()=>[ae]),_:1}),t(p,{border:!0,label:7},{default:a(()=>[oe]),_:1}),t(p,{border:!0,label:30},{default:a(()=>[le]),_:1}),t(p,{border:!0,label:-1},{default:a(()=>[ne]),_:1})]),_:1},8,["modelValue"]),o(l).days===-1?(h(),w(L,{key:0,modelValue:o(s),"onUpdate:modelValue":r[1]||(r[1]=c=>J(s)?s.value=c:s=c),type:"daterange","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",style:{"margin-left":"8px"},shortcuts:M,onChange:k},null,8,["modelValue"])):B("",!0)]),_:1}),t(Y,null,{default:a(()=>[t(g,{type:"primary",onClick:k},{default:a(()=>[re]),_:1})]),_:1})]),_:1},8,["model"])]),t(I,{class:"table"},{default:a(()=>[E("div",ue,[t(g,{class:"tn-el-form-item--item tn-button tn-button--green",onClick:r[2]||(r[2]=c=>T())},{default:a(()=>[se]),_:1}),t(g,{class:"tn-el-form-item--item tn-button tn-button--danger",onClick:r[3]||(r[3]=c=>R())},{default:a(()=>[d(K(o(m)?"\u6536\u8D77":"\u5C55\u5F00"),1)]),_:1})]),o(y)?O((h(),w(j,{key:0,data:o(u).records,border:!0,"row-key":"id","default-expand-all":o(m)},{default:a(()=>[t(v,{label:"\u533A\u57DF",prop:"title",align:"center"}),t(v,{label:"\u8BA2\u5355\u6570\u91CF",prop:"num",align:"center"}),t(v,{label:"\u8BA2\u5355\u91D1\u989D",prop:"price",align:"center"})]),_:1},8,["data","default-expand-all"])),[[P,o(b)]]):B("",!0)]),_:1})],64)}}});const _e=X(de,[["__scopeId","data-v-4c1a01d5"]]);export{_e as default};
