1import{i as E}from"./index-Ddg5t14L.js";import{B as O,_ as V,r as p,z as m,C as B,D as F,d as G,F as J,G as U,o,c,e,p as D,A as n,H as y,I as f,n as k,f as $,h as W,J as j,K as A,L as H,s as K,t as q}from"./index-uGWb9Yh4.js";function Q(){return O({url:"/crm/dashboard/overview",method:"get"})}const u=v=>(K("data-v-32623aa6"),v=v(),q(),v),X={class:"screen"},Y=u(()=>e("div",null,[e("p",null,"CRM COMMAND CENTER"),e("h1",null,"客æ·ç»è¥æ°æ®å¤§å±")],-1)),Z=u(()=>e("i",null,null,-1)),ee={class:"metrics"},te={class:"grid"},le={class:"panel trend"},ne=u(()=>e("div",{class:"title"},[e("div",null,[e("p",null,"å¢é¿è¶å¿"),e("h2",null,"客æ·ä¸ååéé¢èµ°å¿")]),e("span",null,"è¿ 6 个æ")],-1)),ae={class:"panel source"},se=u(()=>e("div",{class:"title"},[e("div",null,[e("p",null,"å®¢æ·æ´å¯"),e("h2",null,"å®¢æ·æ¥æºåå¸")])],-1)),oe={class:"panel plans"},ce=u(()=>e("div",{class:"title"},[e("div",null,[e("p",null,"è·è¿ç¶æ"),e("h2",null,"å®¢æ·æ¨è¿é¶æ®µ")])],-1)),re={key:0,class:"empty"},ie={class:"panel contracts"},ue={class:"title"},de=u(()=>e("div",null,[e("p",null,"ä¸å¡å¨æ"),e("h2",null,"ææ°åå")],-1)),pe=u(()=>e("i",null,null,-1)),ve={key:0,class:"empty"},_e={__name:"index",setup(v){const _=p(!0),b=p(""),i=p({summary:{},clientSources:[],clientPlans:[],monthlyTrend:[],recentContracts:[]}),g=p(),x=p();let a,s;const h=t=>(Number(t||0)/1e4).toFixed(1),N=t=>`${h(t)} ä¸`,T=m(()=>{const t=i.value.summary||{};return[{label:"ææå®¢æ·",value:t.clientCount||0,unit:"å®¶",note:`æ¬ææ°å¢ ${t.newClientCount||0} å®¶`,icon:"客",tone:"blue"},{label:"ååæ»æ°",value:t.contractCount||0,unit:"份",note:`å¾
å®¡æ¹ ${t.pendingContractCount||0} 份`,icon:"å",tone:"orange"},{label:"ååæ»é¢",value:h(t.contractAmount),unit:"ä¸",note:"累计ææååéé¢",icon:"é",tone:"green"},{label:"徿¥é®ä»¶",value:t.emailCount||0,unit:"å°",note:"å®¢æ·æ²éæ²æ·",icon:"é®",tone:"purple"}]}),C=m(()=>{const t=i.value.clientPlans||[],r=Math.max(...t.map(d=>Number(d.value)),1);return t.map(d=>({...d,percent:Math.round(Number(d.value)/r*100)}))}),w=m(()=>i.value.recentContracts||[]),I=t=>({APPROVED:"å·²éè¿",APPROVING:"审æ¹ä¸",SUBMITTED:"å·²æäº¤",REJECTED:"已驳å",DRAFT:"è稿"})[t]||"å¾
å¤ç",L=t=>({APPROVED:"ok",APPROVING:"wait",SUBMITTED:"wait",REJECTED:"no"})[t]||"draft";function P(){const t=i.value.monthlyTrend||[];a==null||a.dispose(),s==null||s.dispose(),a=E(g.value),s=E(x.value),a.setOption({grid:{left:42,right:45,top:28,bottom:25},tooltip:{trigger:"axis"},legend:{right:0,textStyle:{color:"#65758c"}},xAxis:{type:"category",data:t.map(r=>r.month),axisLabel:{color:"#8190a3"},axisLine:{lineStyle:{color:"#dce5ef"}}},yAxis:[{type:"value",axisLabel:{color:"#8190a3"},splitLine:{lineStyle:{type:"dashed",color:"#e9eff5"}}},{type:"value",axisLabel:{color:"#8190a3",formatter:"{value}ä¸"},splitLine:{show:!1}}],series:[{name:"æ°å¢å®¢æ·",type:"bar",data:t.map(r=>r.clientCount),barWidth:17,itemStyle:{color:"#3790f4",borderRadius:[5,5,0,0]}},{name:"ååéé¢",type:"line",yAxisIndex:1,smooth:!0,data:t.map(r=>h(r.contractAmount)),lineStyle:{color:"#f39b3d",width:3},itemStyle:{color:"#f39b3d"},areaStyle:{color:"rgba(243,155,61,.12)"}}]}),s.setOption({tooltip:{trigger:"item"},legend:{bottom:0,icon:"circle",textStyle:{color:"#65758c"}},color:["#368cf2","#32bf97","#f2b44b","#8573e6","#ee788b","#47b8c4"],series:[{type:"pie",radius:["48%","72%"],center:["50%","43%"],label:{show:!1},itemStyle:{borderColor:"#fff",borderWidth:4},data:i.value.clientSources||[]}]})}async function R(){_.value=!0;try{const t=await Q();i.value=t.data||i.value}finally{_.value=!1,await j(),P()}}const S=()=>{a==null||a.resize(),s==null||s.resize()};return B(()=>{b.value=new Date().toLocaleString("zh-CN",{hour12:!1}).replace(/\//g,"."),R(),window.addEventListener("resize",S)}),F(()=>{window.removeEventListener("resize",S),a==null||a.dispose(),s==null||s.dispose()}),(t,r)=>{const d=G("router-link"),z=J("loading");return U((o(),c("main",X,[e("header",null,[Y,e("aside",null,[Z,D("æ°æ®å®æ¶æ±æ»ã"+n(b.value),1)])]),e("section",ee,[(o(!0),c(y,null,f(T.value,l=>(o(),c("article",{key:l.label},[e("b",{class:A(l.tone)},n(l.icon),3),e("div",null,[e("p",null,n(l.label),1),e("strong",null,n(l.value),1),e("small",null,n(l.unit),1),e("em",null,n(l.note),1)])]))),128))]),e("section",te,[e("article",le,[ne,e("div",{ref_key:"trendEl",ref:g,class:"chart"},null,512)]),e("article",ae,[se,e("div",{ref_key:"sourceEl",ref:x,class:"chart"},null,512)]),e("article",oe,[ce,(o(!0),c(y,null,f(C.value,(l,M)=>(o(),c("div",{key:l.name,class:"plan"}
1,[e("span",null,"0"+n(M+1),1),e("label",null,n(l.name),1),e("i",null,[e("b",{style:H({width:l.percent+"%"})},null,4)]),e("strong",null,n(l.value),1)]))),128)),C.value.length?k("",!0):(o(),c("div",re,"ææ å®¢æ·é¶æ®µæ°æ®"))]),e("article",ie,[e("div",ue,[de,$(d,{to:"/contract/contractlist"},{default:W(()=>[D("æ¥çå
¨é¨")]),_:1})]),(o(!0),c(y,null,f(w.value,l=>(o(),c("div",{key:l.contractId,class:"contract"},[pe,e("div",null,[e("b",null,n(l.subject||"æªå½ååå"),1),e("span",null,n(l.customerName||"æªå
³è客æ·"),1)]),e("strong",null,n(N(l.finalAmount)),1),e("em",{class:A(L(l.approveStatus))},n(I(l.approveStatus)),3)]))),128)),w.value.length?k("",!0):(o(),c("div",ve,"ææ ååè®°å½"))])])])),[[z,_.value]])}}},ye=V(_e,[["__scopeId","data-v-32623aa6"]]);export{ye as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.