Files
zyt/server/public/admin/assets/index-CpMdXpUi.js
T
2026-03-24 16:32:56 +08:00

2 lines
15 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{P as X,Q as Z,i as tt,J as et}from"./element-plus-CFxTwCZ2.js";import{H as E}from"./vue-echarts-80nmytZh.js";import{i as st,L as C,N as ot}from"./index-DqzX0p3J.js";import{M as at}from"./tcm-CEDF0dA_.js";import{n as rt}from"./order-B2Np0-0y.js";import{u as L}from"./getExposeType-BrKpbHO7.js";import{f as Q,w as nt,b as it,ak as r,I as i,a as l,aN as g,J as t,F as v,ap as b,H as w,G as M,O as z,A as W}from"./@vue/runtime-core-C0pg79pw.js";import{r as F,y as o,a as T,o as U}from"./@vue/reactivity-BIbyPIZJ.js";import{Q as n,o as J}from"./@vue/shared-mAAVTE9n.js";import"./@vue/runtime-dom-iFk_KP8y.js";import"./lodash-D3kF6u-c.js";import"./@element-plus/icons-vue-cboVPb4D.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 lt={class:"workbench"},dt={class:"flex justify-between items-center"},ct={class:"flex items-center gap-2"},pt={class:"text-tx-secondary text-sm"},mt={class:"mb-4 p-4 rounded-lg bg-blue-50 border border-blue-100"},ut={class:"flex items-center justify-between flex-wrap gap-4"},yt={class:"flex items-center gap-6"},gt={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"},_t={class:"flex flex-wrap gap-2"},ft={class:"text-amber-500 font-medium"},ht={class:"text-primary font-medium"},vt={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},bt={class:"lg:col-span-1"},kt={key:0,class:"space-y-2"},wt={class:"flex items-center gap-2"},St={class:"text-gray-800"},Ot={class:"font-semibold text-primary"},At={key:1,class:"py-8 text-center text-tx-secondary"},Ct={class:"lg:col-span-2"},Dt={key:1,class:"h-[320px] flex items-center justify-center text-tx-secondary"},Vt={key:0,class:"mt-4 pt-4 border-t border-gray-100"},jt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},$t={class:"font-medium text-gray-800 mb-2"},Et={class:"space-y-1 text-sm"},Nt={class:"text-gray-600"},Rt={class:"font-medium"},Bt={key:0,class:"text-tx-secondary"},Lt={class:"order-stats-panel"},zt={class:"flex justify-between items-center mb-4 flex-wrap gap-2"},Wt={class:"text-tx-secondary text-sm"},Ft={class:"flex items-center gap-3"},Ht={class:"mb-4 p-4 rounded-lg bg-green-50 border border-green-100"},Mt={class:"flex items-center gap-6 flex-wrap"},Tt={class:"text-2xl font-bold text-primary mt-1"},Ut={class:"text-2xl font-bold text-primary mt-1"},Jt={key:0,class:"flex items-center gap-4 pl-6 border-l border-green-200"},Qt={class:"flex flex-wrap gap-2"},Gt={class:"text-amber-500 font-medium"},It={class:"text-primary font-medium"},Pt={class:"text-gray-500"},Yt={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},qt={class:"lg:col-span-1"},Kt={key:0,class:"space-y-2"},Xt={class:"flex items-center gap-2"},Zt={class:"w-6 h-6 rounded-full text-center text-xs font-medium leading-6 bg-gray-200 text-gray-600"},te={class:"text-gray-800"},ee={class:"text-right"},se={class:"font-semibold text-primary"},oe={class:"text-gray-500 text-sm ml-1"},ae={key:1,class:"py-8 text-center text-tx-secondary"},re={class:"lg:col-span-2"},ne={key:1,class:"h-[280px] flex items-center justify-center text-tx-secondary"},ie={key:0,class:"mt-4 pt-4 border-t border-gray-100"},le={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},de={class:"font-medium text-gray-800 mb-2"},ce={class:"space-y-1 text-sm"},pe={class:"text-gray-600"},me={class:"font-medium"},ue={class:"text-gray-500"},ye={key:0,class:"text-tx-secondary"},ge={class:"lg:flex gap-4"},xe=Q({name:"workbench"}),ns=Q({...xe,setup(_e){const m=st(),N=L(),R=L(),G=L(),c=F({days:7,departments:[],today_ranking:[],ranking:[],chart:{xAxis:[],series:[]}}),I=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=()=>{at({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(()=>{})},S=U(1),O=U(7),y=F({date_range:[],today_total:0,today_amount:"0.00",today_ranking:[],departments:[],ranking:[],chart:{xAxis:[],series:[]}}),P=W(()=>{const s=y.date_range;if((s==null?void 0:s.length)>=2)return`${s[0]}${s[1]}`;const e=O.value,d=new Date,x=new Date;return e===0?(x.setHours(0,0,0,0),`${D(x)}${D(d)}`):(x.setDate(x.getDate()-(e||7)),`${D(x)}${D(d)}`)});function D(s){return s.getFullYear()+"-"+String(s.getMonth()+1).padStart(2,"0")+"-"+String(s.getDate()).padStart(2,"0")}const Y=W(()=>{var s,e;return{xAxis:{type:"category",data:((s=y.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=y.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=()=>{rt({order_type:S.value,days:O.value}).then(s=>{Object.assign(y,{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(()=>{})};nt(()=>m.theme,()=>{K()});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}]}}}]}}),q=()=>{ot().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)})},K=()=>{var s,e,d,x;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),(x=R.value)==null||x.setOption(p.visitorOption)};return it(()=>{q(),B(),V()}),(s,e)=>{const d=Z,x=X,H=tt,j=et;return r(),i("div",lt,[l(j,{class:"!border-none mt-4 w-full",shadow:"never"},{header:g(()=>{var f,h;return[t("div",dt,[e[4]||(e[4]=t("span",null,"医助理诊单统计",-1)),t("div",ct,[t("span",pt,n((f=o(c).date_range)==null?void 0:f[0])+" 至 "+n((h=o(c).date_range)==null?void 0:h[1]),1),l(x,{modelValue:o(c).days,"onUpdate:modelValue":e[0]||(e[0]=k=>o(c).days=k),class:"w-28",onChange:B},{default:g(()=>[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:g(()=>[...e[3]||(e[3]=[z("刷新",-1)])]),_:1})])])]}),default:g(()=>{var f,h,k,A;return[t("div",mt,[t("div",ut,[t("div",yt,[t("div",null,[e[5]||(e[5]=t("span",{class:"text-tx-secondary text-sm"},"今日创建诊单",-1)),t("div",gt,n(o(c).today_total??0),1)]),(f=o(c).today_ranking)!=null&&f.length?(r(),i("div",xt,[e[6]||(e[6]=t("span",{class:"text-tx-secondary text-sm"},"今日排行:",-1)),t("div",_t,[(r(!0),i(v,null,b(o(c).today_ranking.slice(0,5),(u,a)=>(r(),i("span",{key:u.id,class:"inline-flex items-center gap-1 px-2 py-1 rounded text-sm bg-white"},[t("span",ft,n(a+1)+".",1),t("span",null,n(u.name),1),t("span",ht,n(u.count),1)]))),128))])])):w("",!0)])])]),t("div",vt,[t("div",bt,[e[7]||(e[7]=t("div",{class:"font-medium text-gray-800 mb-3"},"医助排行",-1)),(h=o(c).ranking)!=null&&h.length?(r(),i("div",kt,[(r(!0),i(v,null,b(o(c).ranking,(u,a)=>(r(),i("div",{key:u.id,class:J(["flex items-center justify-between py-2 px-3 rounded-lg",a<3?"bg-amber-50":"bg-gray-50"])},[t("span",wt,[t("span",{class:J(["w-6 h-6 rounded-full text-center text-xs font-medium leading-6",a===0?"bg-amber-400 text-white":a===1?"bg-gray-300 text-gray-700":a===2?"bg-amber-200 text-amber-800":"bg-gray-200 text-gray-600"])},n(a+1),3),t("span",St,n(u.name),1)]),t("span",Ot,n(u.count),1)],2))),128))])):(r(),i("div",At,"暂无排行数据"))]),t("div",Ct,[e[8]||(e[8]=t("div",{class:"font-medium text-gray-800 mb-2"},"诊单数分布",-1)),(k=o(c).chart.xAxis)!=null&&k.length?(r(),M(o(E),{key:0,ref_key:"assistantChart",ref:G,style:{height:"320px"},option:o(I),autoresize:!0},null,8,["option"])):(r(),i("div",Dt," 暂无数据 "))])]),(A=o(c).departments)!=null&&A.length?(r(),i("div",Vt,[e[9]||(e[9]=t("div",{class:"font-medium text-gray-800 mb-3"},"按部门统计",-1)),t("div",jt,[(r(!0),i(v,null,b(o(c).departments,u=>{var a;return r(),i("div",{key:u.dept_id,class:"p-4 rounded-lg bg-gray-50"},[t("div",$t,n(u.dept_name)+"(共"+n(u.total)+"",1),t("div",Et,[(r(!0),i(v,null,b(u.assistants,_=>(r(),i("div",{key:`${u.dept_id}-${_.id}`,class:"flex justify-between"},[t("span",Nt,n(_.name),1),t("span",Rt,n(_.count),1)]))),128)),(a=u.assistants)!=null&&a.length?w("",!0):(r(),i("div",Bt,"暂无医助"))])])}),128))])])):w("",!0)]}),_:1}),l(j,{class:"!border-none mt-4 w-full",shadow:"never"},{header:g(()=>[...e[10]||(e[10]=[t("span",null,"订单统计",-1)])]),default:g(()=>{var f,h,k,A,u;return[t("div",Lt,[t("div",zt,[t("span",Wt,n(o(P)),1),t("div",Ft,[e[12]||(e[12]=t("span",{class:"text-gray-600 text-sm"},"统计类型",-1)),l(x,{modelValue:o(S),"onUpdate:modelValue":e[1]||(e[1]=a=>T(S)?S.value=a:null),style:{width:"120px"},onChange:V},{default:g(()=>[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[13]||(e[13]=t("span",{class:"text-gray-600 text-sm"},"时间范围",-1)),l(x,{modelValue:o(O),"onUpdate:modelValue":e[2]||(e[2]=a=>T(O)?O.value=a:null),style:{width:"110px"},onChange:V},{default:g(()=>[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:g(()=>[...e[11]||(e[11]=[z("刷新",-1)])]),_:1})])]),t("div",Ht,[t("div",Mt,[t("div",null,[e[14]||(e[14]=t("span",{class:"text-tx-secondary text-sm"},"今日单数",-1)),t("div",Tt,n(o(y).today_total??0),1)]),t("div",null,[e[15]||(e[15]=t("span",{class:"text-tx-secondary text-sm"},"今日金额",-1)),t("div",Ut,"¥"+n(o(y).today_amount??"0.00"),1)]),(f=o(y).today_ranking)!=null&&f.length?(r(),i("div",Jt,[e[16]||(e[16]=t("span",{class:"text-tx-secondary text-sm"},"今日排行:",-1)),t("div",Qt,[(r(!0),i(v,null,b(o(y).today_ranking.slice(0,5),(a,_)=>(r(),i("span",{key:a.id,class:"inline-flex items-center gap-1 px-2 py-1 rounded text-sm bg-white"},[t("span",Gt,n(Number(_)+1)+".",1),t("span",null,n(a.name),1),t("span",It,n(a.count),1),t("span",Pt,"¥"+n(a.amount),1)]))),128))])])):w("",!0)])]),t("div",Yt,[t("div",qt,[e[17]||(e[17]=t("div",{class:"font-medium text-gray-800 mb-3"},"排行",-1)),(h=o(y).ranking)!=null&&h.length?(r(),i("div",Kt,[(r(!0),i(v,null,b(o(y).ranking,(a,_)=>(r(),i("div",{key:a.id,class:"flex items-center justify-between py-2 px-3 rounded-lg bg-gray-50"},[t("span",Xt,[t("span",Zt,n(Number(_)+1),1),t("span",te,n(a.name),1)]),t("span",ee,[t("span",se,n(a.count),1),t("span",oe,"¥"+n(a.amount),1)])]))),128))])):(r(),i("div",ae,"暂无数据"))]),t("div",re,[e[18]||(e[18]=t("div",{class:"font-medium text-gray-800 mb-2"},"单数分布",-1)),(A=(k=o(y).chart)==null?void 0:k.xAxis)!=null&&A.length?(r(),M(o(E),{key:"order-chart-"+o(S),style:{height:"280px"},option:o(Y),autoresize:!0},null,8,["option"])):(r(),i("div",ne,"暂无数据"))])]),(u=o(y).departments)!=null&&u.length?(r(),i("div",ie,[e[20]||(e[20]=t("div",{class:"font-medium text-gray-800 mb-3"},"按部门统计",-1)),t("div",le,[(r(!0),i(v,null,b(o(y).departments,a=>{var _;return r(),i("div",{key:a.dept_id,class:"p-4 rounded-lg bg-gray-50"},[t("div",de,n(a.dept_name)+""+n(a.total)+"单 ¥"+n(a.amount)+"",1),t("div",ce,[(r(!0),i(v,null,b(a.members,$=>(r(),i("div",{key:`${a.dept_id}-${$.id}`,class:"flex justify-between"},[t("span",pe,n($.name),1),t("span",null,[t("span",me,n($.count),1),e[19]||(e[19]=z()),t("span",ue,"¥"+n($.amount),1)])]))),128)),(_=a.members)!=null&&_.length?w("",!0):(r(),i("div",ye,"暂无"))])])}),128))])])):w("",!0)])]}),_:1}),t("div",ge,[l(j,{class:"!border-none mb-4 lg:mb-0 w-full lg:w-2/3",shadow:"never"},{header:g(()=>[...e[21]||(e[21]=[t("span",null,"访问量趋势图",-1)])]),default:g(()=>[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(j,{class:"!border-none w-full lg:w-1/3",shadow:"never"},{header:g(()=>[...e[22]||(e[22]=[t("span",null,"销售额趋势图",-1)])]),default:g(()=>[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{ns as default};