import{d as O,f as P}from"./list.bf3a7bdf.js";import{b as z,c as U}from"./list.0bcb9472.js";import{d as G,a6 as L,r as _,b as F,a as h,s as Q,p as W,y as w,c as y,e as H,k as J,i as m,h as D,g as e,t as g,u as o,q as I,n as K,R as X,S as Z,aN as $,_ as tt}from"./index.0308b213.js";const u=n=>(X("data-v-95221799"),n=n(),Z(),n),et=u(()=>e("div",{class:"header"},[e("div",{class:"tn-title--vertical-line title"}," \u603B\u89C8 ")],-1)),at={class:"body"},st={class:"data"},ot=u(()=>e("div",{class:"data-title"}," \u4ECA\u65E5\u914D\u9001 ",-1)),lt={class:"data-value"},ut={class:"data"},nt=u(()=>e("div",{class:"data-title"}," \u6628\u65E5\u914D\u9001 ",-1)),dt={class:"data-value"},it={class:"data"},rt=u(()=>e("div",{class:"data-title"}," \u672C\u6708\u914D\u9001 ",-1)),ct={class:"data-value"},_t={class:"data"},ht=u(()=>e("div",{class:"data-title"}," \u603B\u914D\u9001 ",-1)),mt={class:"data-value"},pt=u(()=>e("div",{class:"header"},[e("div",{class:"tn-title--vertical-line title"}," \u8D8B\u52BF\u56FE ")],-1)),ft={class:"date-filter"},vt=G({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(n,{emit:A}){const l=n,{OpPlatform:j}=L(),E=[{text:"\u4E00\u5468\u5185",value:()=>{const t=h();return[t.subtract(1,"week").toDate(),t.toDate()]}},{text:"\u4E24\u5468\u5185",value:()=>{const t=h();return[t.subtract(2,"week").toDate(),t.toDate()]}},{text:"\u4E00\u4E2A\u6708\u5185",value:()=>{const t=h();return[t.subtract(1,"month").toDate(),t.toDate()]}}];let d=_(!1);const p=F({start:"",end:""});let i=_([h().subtract(1,"week").format("YYYY-MM-DD"),h().format("YYYY-MM-DD")]);const k=()=>{const t=$(i.value,"YYYY-MM-DD");p.start=t[0]||"",p.end=t[1]||""},a=F({shuju:{yesterday_num:0,today_num:0,month_num:0,total_num:0}}),f=F({shuju:{label:[],datasets:{flow1:{}}}}),Y=_(),C=Q(()=>{const t=f.shuju.label,s=Object.values(f.shuju.datasets.flow1);return{tooltip:{trigger:"axis"},legend:{data:[{name:"",icon:"",itemStyle:{color:"#3AAFFF"},lineStyle:{color:"#3AAFFF"}}]},color:["#3AAFFF"],grid:{left:"0%",right:"3%",bottom:"0%",containLabel:!0},toolbox:{showTitle:!1,orient:"vertical",feature:{saveAsImage:{}}},xAxis:{type:"category",boundaryGap:!1,data:t},yAxis:{type:"value"},series:[{name:"",type:"line",stack:"Total",data:s,areaStyle:{opacity:.8,color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:1,color:"#FFFFFF1A"},{offset:0,color:"#3AAFFFAA"}]}}}]}}),B=()=>j.value==="agent"?z({id:l.id,errander:0}):O({id:l.id,errander:0}),V=()=>j.value==="agent"?U({id:l.id,errander:1},p):P({id:l.id,errander:1},p),T=()=>{B().then(t=>{a.shuju.today_num=t.shuju.today_num,a.shuju.yesterday_num=t.shuju.yesterday_num,a.shuju.month_num=t.shuju.month_num,a.shuju.total_num=t.shuju.total_num})},S=()=>{k(),V().then(t=>{console.log(t.shuju),f.shuju.label=t.shuju.label,f.shuju.datasets.flow1=t.shuju.datasets.flow1})};W(()=>l.modelValue,t=>{d.value=t,t&&l.id&&(T(),S(),w(()=>{var r;const s=((r=b.value)==null?void 0:r.clientWidth)||"100%";x.value.width=`${s}px`,w(()=>{var v;(v=Y.value)==null||v.resize()})}))});const M=()=>{S()},b=_();let x=_({});const R=()=>{A("update:modelValue",!1),A("onClose")};return(t,s)=>{const r=y("el-card"),v=y("el-date-picker"),q=y("v-chart"),N=y("el-dialog");return H(),J(N,{modelValue:o(d),"onUpdate:modelValue":s[1]||(s[1]=c=>I(d)?d.value=c:d=c),title:"\u914D\u9001\u5458\u7EDF\u8BA1\u4FE1\u606F",width:"90%",onClose:R},{default:m(()=>[D(r,{class:"overview"},{header:m(()=>[et]),default:m(()=>[e("div",at,[e("div",st,[ot,e("div",lt,g(o(a).shuju.today_num),1)]),e("div",ut,[nt,e("div",dt,g(o(a).shuju.yesterday_num),1)]),e("div",it,[rt,e("div",ct,g(o(a).shuju.month_num),1)]),e("div",_t,[ht,e("div",mt,g(o(a).shuju.total_num),1)])])]),_:1}),D(r,{class:"trend"},{header:m(()=>[pt]),default:m(()=>[e("div",{class:"body",ref_key:"trendBodyRef",ref:b},[e("div",ft,[D(v,{modelValue:o(i),"onUpdate:modelValue":s[0]||(s[0]=c=>I(i)?i.value=c:i=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:E,onChange:M},null,8,["modelValue"])]),e("div",{class:"echarts",style:K(o(x))},[D(q,{ref_key:"trendEcharts",ref:Y,class:"chart",option:o(C)},null,8,["option"])],4)],512)]),_:1})]),_:1},8,["modelValue"])}}});const Ft=tt(vt,[["__scopeId","data-v-95221799"]]);export{Ft as default};
