2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{P as K,Q as X,i as Z,J as tt}from"./element-plus-D9NzL5HE.js";import{H as E}from"./vue-echarts-80nmytZh.js";import{k as et,N as C,O as st}from"./index-D54sWaXv.js";import{L as ot}from"./tcm-9dTydv5E.js";import{n as at}from"./order-B9Y8pnvT.js";import{u as L}from"./getExposeType-BrKpbHO7.js";import{f as M,w as rt,b as nt,ak as a,I as i,a as l,aN as x,J as t,F as b,ap as k,H as S,G as T,O as z,A as W}from"./@vue/runtime-core-C0pg79pw.js";import{r as F,y as o,a as U,o as J}from"./@vue/reactivity-BIbyPIZJ.js";import{Q as r}from"./@vue/shared-mAAVTE9n.js";import"./@vue/runtime-dom-iFk_KP8y.js";import"./lodash-D3kF6u-c.js";import"./@element-plus/icons-vue-BZWa1PtL.js";import"./lodash-es-BADexyn7.js";import"./@popperjs/core-C5az9QE8.js";import"./dayjs-DG77mNTn.js";import"./@ctrl/tinycolor-BuyEbX8F.js";import"./async-validator-CFA_igpM.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./resize-detector-G6vbKCU7.js";import"./echarts-DYKKs4Al.js";import"./tslib-BDyQ-Jie.js";import"./zrender-CTTuYiLF.js";import"./jspdf-BsthCvR5.js";import"./@babel/runtime-BanGtE2-.js";import"./fflate-_ayOYiT1.js";import"./vue-router-CYz6RFzi.js";import"./pinia-Ba_jX6-d.js";import"./axios-C80V62Fs.js";import"./@vueuse/core-DIKi2bJB.js";import"./@vueuse/shared-D8934tfB.js";import"./css-color-function-DI01JAaZ.js";import"./balanced-match-BdS7OldZ.js";import"./color-B2zxaWkI.js";import"./clone-DBZ6_OiU.js";import"./color-convert-OrFsTA_V.js";import"./color-name-Dju3oUBS.js";import"./color-string-pUQDDJII.js";import"./ms-CzQ2E3wO.js";import"./vue-clipboard3-DByT_rEQ.js";import"./clipboard-CHgxszqY.js";import"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-BVMzZUvF.js";const it={class:"workbench"},lt={class:"flex justify-between items-center"},dt={class:"flex items-center gap-2"},pt={class:"text-tx-secondary text-sm"},ct={class:"mb-4 p-4 rounded-lg bg-blue-50 border border-blue-100"},mt={class:"flex items-center justify-between flex-wrap gap-4"},ut={class:"flex items-center gap-6"},yt={class:"text-2xl font-bold text-primary mt-1"},xt={key:0,class:"flex items-center gap-4 pl-6 border-l border-blue-200"},gt={class:"flex flex-wrap gap-2"},_t={class:"text-amber-500 font-medium"},ft={class:"text-primary font-medium"},ht={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},vt={class:"lg:col-span-2"},bt={key:1,class:"h-[320px] flex items-center justify-center text-tx-secondary"},kt={key:0,class:"mt-4 pt-4 border-t border-gray-100"},wt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},St={class:"font-medium text-gray-800 mb-2"},Ot={class:"space-y-1 text-sm"},At={class:"text-gray-600"},Ct={class:"font-medium"},Dt={key:0,class:"text-tx-secondary"},Vt={class:"order-stats-panel"},$t={class:"flex justify-between items-center mb-4 flex-wrap gap-2"},jt={class:"text-tx-secondary text-sm"},Et={class:"flex items-center gap-3"},Nt={class:"mb-4 p-4 rounded-lg bg-green-50 border border-green-100"},Rt={class:"flex items-center gap-6 flex-wrap"},Bt={class:"text-2xl font-bold text-primary mt-1"},Lt={class:"text-2xl font-bold text-primary mt-1"},zt={key:0,class:"flex items-center gap-4 pl-6 border-l border-green-200"},Wt={class:"flex flex-wrap gap-2"},Ft={class:"text-amber-500 font-medium"},Ht={class:"text-primary font-medium"},Tt={class:"text-gray-500"},Ut={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},Jt={class:"lg:col-span-1"},Mt={key:0,class:"space-y-2"},Qt={class:"flex items-center gap-2"},Gt={class:"w-6 h-6 rounded-full text-center text-xs font-medium leading-6 bg-gray-200 text-gray-600"},It={class:"text-gray-800"},Pt={class:"text-right"},Yt={class:"font-semibold text-primary"},qt={class:"text-gray-500 text-sm ml-1"},Kt={key:1,class:"py-8 text-center text-tx-secondary"},Xt={class:"lg:col-span-2"},Zt={key:1,class:"h-[280px] flex items-center justify-center text-tx-secondary"},te={key:0,class:"mt-4 pt-4 border-t border-gray-100"},ee={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},se={class:"font-medium text-gray-800 mb-2"},oe={class:"space-y-1 text-sm"},ae={class:"text-gray-600"},re={class:"font-medium"},ne={class:"text-gray-500"},ie={key:0,class:"text-tx-secondary"},le={class:"lg:flex gap-4"},de=M({name:"workbench"}),Ze=M({...de,setup(pe){const m=et(),N=L(),R=L(),Q=L(),c=F({days:7,departments:[],today_ranking:[],ranking:[],chart:{xAxis:[],series:[]}}),G=W(()=>({xAxis:{type:"category",data:c.chart.xAxis||[],axisLabel:{rotate:30}},yAxis:{type:"value",name:"诊单数"},tooltip:{trigger:"axis"},grid:{left:"3%",right:"4%",bottom:"15%",containLabel:!0},series:(c.chart.series||[]).map(s=>({...s,type:"bar",barWidth:"50%",itemStyle:{borderRadius:[6,6,0,0],color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:C(m.theme,.8)},{offset:1,color:m.theme}]}}}))})),B=()=>{ot({days:c.days}).then(s=>{c.date_range=s.date_range,c.today_total=s.today_total??0,c.today_ranking=s.today_ranking||[],c.departments=s.departments||[],c.ranking=s.ranking||[],c.chart=s.chart||{xAxis:[],series:[]}}).catch(()=>{})},O=J(1),A=J(7),u=F({date_range:[],today_total:0,today_amount:"0.00",today_ranking:[],departments:[],ranking:[],chart:{xAxis:[],series:[]}}),I=W(()=>{const s=u.date_range;if((s==null?void 0:s.length)>=2)return`${s[0]} 至 ${s[1]}`;const e=A.value,d=new Date,g=new Date;return e===0?(g.setHours(0,0,0,0),`${D(g)} 至 ${D(d)}`):(g.setDate(g.getDate()-(e||7)),`${D(g)} 至 ${D(d)}`)});function D(s){return s.getFullYear()+"-"+String(s.getMonth()+1).padStart(2,"0")+"-"+String(s.getDate()).padStart(2,"0")}const P=W(()=>{var s,e;return{xAxis:{type:"category",data:((s=u.chart)==null?void 0:s.xAxis)||[],axisLabel:{rotate:30}},yAxis:{type:"value",name:"单数"},tooltip:{trigger:"axis"},grid:{left:"3%",right:"4%",bottom:"15%",containLabel:!0},series:(((e=u.chart)==null?void 0:e.series)||[]).map(d=>({...d,type:"bar",barWidth:"50%",itemStyle:{borderRadius:[6,6,0,0],color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:C(m.theme,.8)},{offset:1,color:m.theme}]}}}))}}),V=()=>{at({order_type:O.value,days:A.value}).then(s=>{Object.assign(u,{date_range:s.date_range||[],today_total:s.today_total??0,today_amount:s.today_amount??"0.00",today_ranking:s.today_ranking||[],departments:s.departments||[],ranking:s.ranking||[],chart:s.chart||{xAxis:[],series:[]}})}).catch(()=>{})};rt(()=>m.theme,()=>{q()});const p=F({version:{version:"",website:"",based:"",channel:{gitee:"",website:""}},support:[],today:{},menu:[],visitor:[],article:[],visitorOption:{xAxis:{type:"category",data:[]},yAxis:{type:"value"},legend:{data:["访问量"]},tooltip:{trigger:"axis"},series:[{name:"访问量",data:[],type:"line",smooth:!0,color:m.theme,lineStyle:{color:m.theme,width:2},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:m.theme},{offset:1,color:m.theme}]},opacity:.1}}]},saleOption:{xAxis:{type:"category",data:[]},yAxis:{type:"value",name:"单位(万)"},tooltip:{trigger:"axis"},series:[{name:"销售量",data:[],type:"bar",showBackground:!0,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderRadius:[10,10,0,0]},barWidth:"40%",itemStyle:{borderRadius:[10,10,0,0],color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:C(m.theme,.7)},{offset:1,color:m.theme}]}}}]}}),Y=()=>{st().then(s=>{p.version=s.version,p.today=s.today,p.menu=s.menu,p.visitor=s.visitor,p.support=s.support,p.visitorOption.xAxis.data=[],p.visitorOption.series[0].data=[],p.saleOption.xAxis.data=[],p.saleOption.series[0].data=[],s.visitor.date.reverse().forEach(e=>{p.visitorOption.xAxis.data.push(e)}),s.visitor.list[0].data.forEach(e=>{p.visitorOption.series[0].data.push(e)}),s.sale.date.reverse().forEach(e=>{p.saleOption.xAxis.data.push(e)}),s.sale.list[0].data.forEach(e=>{e<=50&&(e={value:e,itemStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:C("#ff8729",.7)},{offset:1,color:"#ff8729"}]}}}),p.saleOption.series[0].data.push(e)})}).catch(s=>{console.log("err",s)})},q=()=>{var s,e,d,g;p.visitorOption.series[0].color=m.theme,p.visitorOption.series[0].lineStyle.color=m.theme,p.visitorOption.series[0].areaStyle.color.colorStops=[{offset:0,color:m.theme},{offset:1,color:m.theme}],p.saleOption.series[0].itemStyle.color.colorStops=[{offset:0,color:C(m.theme,.7)},{offset:1,color:m.theme}],(s=N.value)==null||s.clear(),(e=R.value)==null||e.clear(),(d=N.value)==null||d.setOption(p.saleOption),(g=R.value)==null||g.setOption(p.visitorOption)};return nt(()=>{Y(),B(),V()}),(s,e)=>{const d=X,g=K,H=Z,$=tt;return a(),i("div",it,[l($,{class:"!border-none mt-4 w-full",shadow:"never"},{header:x(()=>{var _,f;return[t("div",lt,[e[4]||(e[4]=t("span",null,"医助理诊单统计",-1)),t("div",dt,[t("span",pt,r((_=o(c).date_range)==null?void 0:_[0])+" 至 "+r((f=o(c).date_range)==null?void 0:f[1]),1),l(g,{modelValue:o(c).days,"onUpdate:modelValue":e[0]||(e[0]=h=>o(c).days=h),class:"w-28",onChange:B},{default:x(()=>[l(d,{label:"今天",value:0}),l(d,{label:"最近7天",value:7}),l(d,{label:"最近14天",value:14}),l(d,{label:"最近30天",value:30})]),_:1},8,["modelValue"]),l(H,{type:"primary",link:"",onClick:B},{default:x(()=>[...e[3]||(e[3]=[z("刷新",-1)])]),_:1})])])]}),default:x(()=>{var _,f,h;return[t("div",ct,[t("div",mt,[t("div",ut,[t("div",null,[e[5]||(e[5]=t("span",{class:"text-tx-secondary text-sm"},"今日创建诊单",-1)),t("div",yt,r(o(c).today_total??0),1)]),(_=o(c).today_ranking)!=null&&_.length?(a(),i("div",xt,[e[6]||(e[6]=t("span",{class:"text-tx-secondary text-sm"},"今日排行:",-1)),t("div",gt,[(a(!0),i(b,null,k(o(c).today_ranking.slice(0,5),(y,v)=>(a(),i("span",{key:y.id,class:"inline-flex items-center gap-1 px-2 py-1 rounded text-sm bg-white"},[t("span",_t,r(v+1)+".",1),t("span",null,r(y.name),1),t("span",ft,r(y.count),1)]))),128))])])):S("",!0)])])]),t("div",ht,[t("div",vt,[e[7]||(e[7]=t("div",{class:"font-medium text-gray-800 mb-2"},"诊单数分布",-1)),(f=o(c).chart.xAxis)!=null&&f.length?(a(),T(o(E),{key:0,ref_key:"assistantChart",ref:Q,style:{height:"320px"},option:o(G),autoresize:!0},null,8,["option"])):(a(),i("div",bt," 暂无数据 "))])]),(h=o(c).departments)!=null&&h.length?(a(),i("div",kt,[e[8]||(e[8]=t("div",{class:"font-medium text-gray-800 mb-3"},"按部门统计",-1)),t("div",wt,[(a(!0),i(b,null,k(o(c).departments,y=>{var v;return a(),i("div",{key:y.dept_id,class:"p-4 rounded-lg bg-gray-50"},[t("div",St,r(y.dept_name)+"(共"+r(y.total)+")",1),t("div",Ot,[(a(!0),i(b,null,k(y.assistants,n=>(a(),i("div",{key:`${y.dept_id}-${n.id}`,class:"flex justify-between"},[t("span",At,r(n.name),1),t("span",Ct,r(n.count),1)]))),128)),(v=y.assistants)!=null&&v.length?S("",!0):(a(),i("div",Dt,"暂无医助"))])])}),128))])])):S("",!0)]}),_:1}),l($,{class:"!border-none mt-4 w-full",shadow:"never"},{header:x(()=>[...e[9]||(e[9]=[t("span",null,"订单统计",-1)])]),default:x(()=>{var _,f,h,y,v;return[t("div",Vt,[t("div",$t,[t("span",jt,r(o(I)),1),t("div",Et,[e[11]||(e[11]=t("span",{class:"text-gray-600 text-sm"},"统计类型",-1)),l(g,{modelValue:o(O),"onUpdate:modelValue":e[1]||(e[1]=n=>U(O)?O.value=n:null),style:{width:"120px"},onChange:V},{default:x(()=>[l(d,{label:"挂号费",value:1}),l(d,{label:"问诊费",value:2}),l(d,{label:"药品费用",value:3}),l(d,{label:"首付费用",value:4}),l(d,{label:"尾款费用",value:5}),l(d,{label:"其他费用",value:6}),l(d,{label:"退款统计",value:0})]),_:1},8,["modelValue"]),e[12]||(e[12]=t("span",{class:"text-gray-600 text-sm"},"时间范围",-1)),l(g,{modelValue:o(A),"onUpdate:modelValue":e[2]||(e[2]=n=>U(A)?A.value=n:null),style:{width:"110px"},onChange:V},{default:x(()=>[l(d,{label:"今天",value:0}),l(d,{label:"最近7天",value:7}),l(d,{label:"最近30天",value:30})]),_:1},8,["modelValue"]),l(H,{type:"primary",link:"",onClick:V},{default:x(()=>[...e[10]||(e[10]=[z("刷新",-1)])]),_:1})])]),t("div",Nt,[t("div",Rt,[t("div",null,[e[13]||(e[13]=t("span",{class:"text-tx-secondary text-sm"},"今日单数",-1)),t("div",Bt,r(o(u).today_total??0),1)]),t("div",null,[e[14]||(e[14]=t("span",{class:"text-tx-secondary text-sm"},"今日金额",-1)),t("div",Lt,"¥"+r(o(u).today_amount??"0.00"),1)]),(_=o(u).today_ranking)!=null&&_.length?(a(),i("div",zt,[e[15]||(e[15]=t("span",{class:"text-tx-secondary text-sm"},"今日排行:",-1)),t("div",Wt,[(a(!0),i(b,null,k(o(u).today_ranking.slice(0,5),(n,w)=>(a(),i("span",{key:n.id,class:"inline-flex items-center gap-1 px-2 py-1 rounded text-sm bg-white"},[t("span",Ft,r(Number(w)+1)+".",1),t("span",null,r(n.name),1),t("span",Ht,r(n.count),1),t("span",Tt,"¥"+r(n.amount),1)]))),128))])])):S("",!0)])]),t("div",Ut,[t("div",Jt,[e[16]||(e[16]=t("div",{class:"font-medium text-gray-800 mb-3"},"排行",-1)),(f=o(u).ranking)!=null&&f.length?(a(),i("div",Mt,[(a(!0),i(b,null,k(o(u).ranking,(n,w)=>(a(),i("div",{key:n.id,class:"flex items-center justify-between py-2 px-3 rounded-lg bg-gray-50"},[t("span",Qt,[t("span",Gt,r(Number(w)+1),1),t("span",It,r(n.name),1)]),t("span",Pt,[t("span",Yt,r(n.count),1),t("span",qt,"¥"+r(n.amount),1)])]))),128))])):(a(),i("div",Kt,"暂无数据"))]),t("div",Xt,[e[17]||(e[17]=t("div",{class:"font-medium text-gray-800 mb-2"},"单数分布",-1)),(y=(h=o(u).chart)==null?void 0:h.xAxis)!=null&&y.length?(a(),T(o(E),{key:"order-chart-"+o(O),style:{height:"280px"},option:o(P),autoresize:!0},null,8,["option"])):(a(),i("div",Zt,"暂无数据"))])]),(v=o(u).departments)!=null&&v.length?(a(),i("div",te,[e[19]||(e[19]=t("div",{class:"font-medium text-gray-800 mb-3"},"按部门统计",-1)),t("div",ee,[(a(!0),i(b,null,k(o(u).departments,n=>{var w;return a(),i("div",{key:n.dept_id,class:"p-4 rounded-lg bg-gray-50"},[t("div",se,r(n.dept_name)+"("+r(n.total)+"单 ¥"+r(n.amount)+")",1),t("div",oe,[(a(!0),i(b,null,k(n.members,j=>(a(),i("div",{key:`${n.dept_id}-${j.id}`,class:"flex justify-between"},[t("span",ae,r(j.name),1),t("span",null,[t("span",re,r(j.count),1),e[18]||(e[18]=z()),t("span",ne,"¥"+r(j.amount),1)])]))),128)),(w=n.members)!=null&&w.length?S("",!0):(a(),i("div",ie,"暂无"))])])}),128))])])):S("",!0)])]}),_:1}),t("div",le,[l($,{class:"!border-none mb-4 lg:mb-0 w-full lg:w-2/3",shadow:"never"},{header:x(()=>[...e[20]||(e[20]=[t("span",null,"访问量趋势图",-1)])]),default:x(()=>[t("div",null,[l(o(E),{ref_key:"visitorChart",ref:R,style:{height:"350px"},option:o(p).visitorOption,autoresize:!0},null,8,["option"])])]),_:1}),l($,{class:"!border-none w-full lg:w-1/3",shadow:"never"},{header:x(()=>[...e[21]||(e[21]=[t("span",null,"销售额趋势图",-1)])]),default:x(()=>[t("div",null,[l(o(E),{ref_key:"saleChart",ref:N,style:{height:"350px"},option:o(p).saleOption,autoresize:!0},null,8,["option"])])]),_:1})])])}}});export{Ze as default};
|