8 lines
17 KiB
JavaScript
8 lines
17 KiB
JavaScript
var te=(k,d,c)=>new Promise((I,C)=>{var m=u=>{try{b(c.next(u))}catch(N){C(N)}},_=u=>{try{b(c.throw(u))}catch(N){C(N)}},b=u=>u.done?I(u.value):Promise.resolve(u.value).then(m,_);b((c=c.apply(k,d)).next())});import{az as U,ay as D,an as y,ak as H,a9 as L,c3 as se,ac as ve}from"./bootstrap-BdGqHkJ8.js";import{g as me,a as he}from"./index-CH1K1w17.js";import{u as ye,_ as we}from"./use-echarts-D70yZvyL.js";import{m as Q,ad as x,b2 as g,aR as t,u as e,cd as ke,bc as Ce,b9 as f,w as _e,v as re,x as ce,aT as ae,j as o,aa as J,aU as Te,aX as Ie,ae as s,bJ as i,bp as p,ai as S,I as le,bb as oe,ac as E,ab as $e}from"../jse/index-index-DZkv9inb.js";const F=Q({__name:"GlassCard",props:{class:{}},setup(k){const d=k;return(c,I)=>(g(),x("div",{class:t(e(ke)("glass-card glass-border glass-shadow glass-highlight","rounded-[2rem] text-card-foreground","transition-all duration-300 ease-out","hover:glass-shadow-hover hover:-translate-y-1",d.class))},[Ce(c.$slots,"default")],2))}}),ne=Q({__name:"BackgroundChart",props:{options:{},opacity:{default:.6},paddingBottom:{default:"1.5rem"}},setup(k){const d=k,c=f(),{renderEcharts:I}=ye(c);function C(){d.options&&I(d.options)}_e(()=>d.options,()=>{C()},{deep:!0});const m=()=>{var _,b;c.value&&((b=(_=c.value).resize)==null||b.call(_))};return re(()=>{C(),window.addEventListener("resize",m)}),ce(()=>{window.removeEventListener("resize",m)}),(_,b)=>(g(),x("div",{class:"absolute inset-x-0 bottom-0 top-0 z-0 overflow-visible rounded-lg",style:ae({paddingBottom:k.paddingBottom})},[o(e(we),{ref_key:"chartRef",ref:c,style:ae({opacity:k.opacity}),class:"h-full w-full"},null,8,["style"])],4))}});function ie(k){const{xAxisData:d,yAxisData:c,seriesName:I,lineColor:C,areaColor:m,yAxisFormatter:_}=k;return{grid:{left:"4%",right:"2%",top:"5%",bottom:"15%",containLabel:!0},xAxis:{type:"category",data:d,show:!0,boundaryGap:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,color:"rgba(148, 163, 184, 0.6)",fontSize:10,fontWeight:400,margin:6,interval:0,rotate:0},splitLine:{show:!1}},yAxis:{type:"value",show:!0,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,color:"rgba(148, 163, 184, 0.6)",fontSize:10,fontWeight:400,margin:6,formatter:_},splitLine:{show:!0,lineStyle:{color:"rgba(148, 163, 184, 0.1)",type:"dashed",width:1}}},series:[{name:I,type:"line",data:c,smooth:!0,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:m[0]},{offset:.5,color:m[1]},{offset:1,color:m[2]}]}},lineStyle:{color:C,width:4},symbol:"none",symbolSize:0}],tooltip:{show:!0,trigger:"axis",axisPointer:{type:"line",lineStyle:{color:"rgba(148, 163, 184, 0.3)",width:1}},backgroundColor:"rgba(255, 255, 255, 0.95)",borderColor:"rgba(148, 163, 184, 0.2)",borderWidth:1,textStyle:{color:"#475569",fontSize:12},padding:[8,12],formatter:b=>{const u=b[0];return`
|
|
<div style="margin-bottom: 4px; font-weight: 600;">${u.name}</div>
|
|
<div style="display: flex; align-items: center; gap: 8px;">
|
|
<span style="display: inline-block; width: 10px; height: 10px; background-color: ${u.color}; border-radius: 50%;"></span>
|
|
<span>${u.seriesName||"数值"}: <strong>${u.value}</strong></span>
|
|
</div>
|
|
`}}}}const V={title:"drop-shadow-[0_2px_16px_rgba(255,255,255,0.95),0_0_8px_rgba(255,255,255,0.8)]",largeNumber:"drop-shadow-[0_2px_20px_rgba(255,255,255,0.98),0_0_12px_rgba(255,255,255,0.9)]",tag:"drop-shadow-[0_1px_8px_rgba(255,255,255,0.9),0_0_4px_rgba(255,255,255,0.8)]",smallText:"drop-shadow-[0_1px_8px_rgba(255,255,255,0.85),0_0_4px_rgba(255,255,255,0.7)]"},z={container:"relative",title:`text-sm font-semibold uppercase tracking-wide text-slate-500 ${V.title}`,numberContainer:"mt-1 flex items-baseline gap-2",largeNumber:`text-4xl font-bold text-slate-800 ${V.largeNumber}`,description:`mt-1 text-xs text-slate-400 ${V.smallText}`},r={card:"flex min-h-0 flex-1 flex-col overflow-hidden p-0",header:"flex shrink-0 items-center justify-between border-b border-white/40 p-5",title:"flex items-center gap-2 font-bold text-slate-800",titleDot:"h-2 w-2 animate-pulse rounded-full bg-red-500",filterButton:"text-xs font-medium text-slate-400 hover:text-orange-600",filterMenu:"min-w-[120px] rounded-lg bg-white p-2 shadow-lg",filterMenuItem:"cursor-pointer rounded px-3 py-2 text-sm hover:bg-gray-50",filterMenuItemActive:"bg-orange-50 text-orange-600",listContainer:"flex flex-1 flex-col overflow-y-auto px-2",emptyState:"flex h-full items-center justify-center text-slate-400",emptyContent:"flex flex-col items-center text-center",emptyIcon:"mb-2 text-4xl",taskItem:"group cursor-pointer rounded-lg border-b border-slate-50 p-3 transition-colors last:border-0 hover:bg-orange-50/40",taskContent:"flex items-center justify-between",taskLeft:"flex min-w-0 flex-1 items-center gap-3",taskIcon:"flex h-7 w-7 items-center justify-center rounded-lg shadow-sm transition-transform group-hover:scale-110",taskInfo:"min-w-0 flex-1",taskTitle:"truncate font-semibold text-slate-700",taskMeta:"mt-1 flex items-center gap-3 text-xs text-slate-500",taskActions:"ml-2 flex items-center gap-1",taskPriorityTag:"border px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide"},P={circleIcon:"h-7 w-7 bg-slate-50 text-slate-400",complete:"hover:bg-green-500 hover:text-white",view:"hover:bg-orange-500 hover:text-white",delete:"hover:bg-red-500 hover:text-white",refresh:"text-slate-400 hover:text-orange-600",viewAll:"rounded-lg bg-white/50 px-2 py-1 text-xs font-medium hover:text-blue-600"},O={container:"grid shrink-0 grid-cols-2 gap-3",card:"glass-card glass-border glass-shadow glass-highlight flex cursor-pointer items-center gap-3 rounded-[2rem] p-3 transition-colors hover:bg-white/60",iconContainer:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl text-lg",content:"min-w-0",label:"truncate text-[10px] font-bold uppercase text-slate-400",value:"mt-0.5 text-lg font-bold leading-none text-slate-800"},T={container:"group relative flex min-h-[140px] flex-1 items-center overflow-hidden border-0 !bg-gradient-to-br from-orange-400 to-amber-300 p-0 shadow-lg",background:"pointer-events-none absolute inset-0 opacity-20",leftContent:"relative z-10 flex h-full w-[60%] flex-col justify-center py-4 pl-8 pr-2",iconContainer:"flex h-6 w-6 items-center justify-center rounded-lg bg-white/20 shadow-sm backdrop-blur-sm",label:"text-[10px] font-bold uppercase tracking-widest text-white/90",title:"mb-4 whitespace-nowrap text-lg font-bold leading-tight text-white drop-shadow-sm",button:"flex w-fit items-center gap-2 rounded-full bg-white px-6 py-2.5 text-sm font-bold text-amber-600 shadow-md shadow-orange-900/10 transition-all hover:scale-105 hover:shadow-lg",buttonIcon:"text-base text-amber-400 transition-transform group-hover:rotate-12",imageContainer:"pointer-events-none absolute bottom-0 right-[-10px] top-0 z-20 flex w-[45%] items-center justify-center",image:"h-full w-full object-contain"},w={field:"space-y-4",label:"mb-1 text-sm text-slate-400",value:"text-base text-slate-700",titleValue:"text-lg font-bold text-slate-800",actions:"flex gap-2 pt-4"},Ae={class:"animate-fade-in flex h-full w-full gap-5 px-5 py-5"},Se={class:"flex h-full w-[60%] flex-none flex-col gap-5"},ze={class:"relative z-10 flex items-start justify-between"},De={key:1,class:"space-y-2"},Pe=["onClick"],Le={key:0},Ne={key:1},Oe={class:"flex h-full w-[40%] flex-none flex-col gap-5",style:{"padding-right":"1.25rem"}},Re={class:"relative z-10 mb-2 flex items-start justify-between"},je={class:"flex min-h-0 flex-1 flex-col gap-4"},Be={class:"mb-2 flex items-center gap-2"},Me={key:0},Ee={key:1},Fe="/images/Image_robot.png",Ve=Q({__name:"index",setup(k){const d=f([]),c=f([]),I=f([]),C=f([]),m=f([]),_=f(0),b=f(0),u=f(0),N=f([{label:"在岗人员",value:"-/-",icon:"ant-design:user-outlined",color:"indigo"},{label:"待处理",value:"0",icon:"ant-design:file-text-outlined",color:"orange"},{label:"平均响应",value:"-",icon:"ant-design:thunderbolt-outlined",color:"teal"},{label:"满意度",value:"-",icon:"ant-design:bar-chart-outlined",color:"pink"}]),de={0:"P0",1:"P1",2:"P2"};function W(){return te(this,null,function*(){var n,a,l,h;try{const[M,$]=yield Promise.all([me(),he()]);_.value=M.totalIn||0,c.value=((n=M.hourlyTrend)==null?void 0:n.hours)||[],I.value=((a=M.hourlyTrend)==null?void 0:a.inData)||[],b.value=$.todayOrderCount||0,u.value=$.newOrderCount||0,C.value=((l=$.workOrderTrend)==null?void 0:l.hours)||[],m.value=((h=$.workOrderTrend)==null?void 0:h.data)||[],d.value=($.urgentTasks||[]).filter(A=>A.status!=="CANCELLED"&&A.status!=="COMPLETED").map(A=>({id:A.id,title:A.title,location:A.location,priority:de[A.priority]||"P2",status:"pending",createTime:A.createTime,assignee:A.assigneeName})),N.value=[{label:"在岗人员",value:`${$.onlineStaffCount||0}`,icon:"ant-design:user-outlined",color:"indigo"},{label:"待处理",value:`${$.pendingCount||0}`,icon:"ant-design:file-text-outlined",color:"orange"},{label:"平均响应",value:`${$.avgResponseMinutes||0}m`,icon:"ant-design:thunderbolt-outlined",color:"teal"},{label:"满意度",value:`${$.satisfactionRate||0}%`,icon:"ant-design:bar-chart-outlined",color:"pink"}]}catch(M){}})}const ue=f(!1),v=f(null),R=f(!1),X=J(()=>{let n=d.value;return ue.value||(n=n.filter(a=>a.status!=="completed")),n}),pe=J(()=>ie({xAxisData:c.value,yAxisData:I.value,seriesName:"客流",lineColor:"#FFA00A",areaColor:["rgba(255, 160, 10, 0.25)","rgba(255, 160, 10, 0.15)","rgba(255, 160, 10, 0)"],yAxisFormatter:n=>n>=1e3?`${(n/1e3).toFixed(1)}k`:n.toString()})),ge=J(()=>ie({xAxisData:C.value,yAxisData:m.value,seriesName:"工单",lineColor:"#3B82F6",areaColor:["rgba(59, 130, 246, 0.25)","rgba(59, 130, 246, 0.15)","rgba(59, 130, 246, 0)"]}));function fe(n){return n.toLocaleString()}function Y(n){const a=d.value.find(l=>l.id===n);a&&(a.status="completed",L.success(`任务"${a.title}"已完成`))}function q(n){v.value=n,R.value=!0}function K(n){se.confirm({title:"确认删除",content:"确定要删除这个任务吗?",onOk(){const a=d.value.findIndex(l=>l.id===n);a!==-1&&(d.value.splice(a,1),L.success("任务已删除"))}})}function xe(){L.loading("刷新中...",.5),W().then(()=>{L.success("刷新成功")})}function be(n){L.info(`查看${n.label}详情`)}function j(n){const a={P0:{color:"red",bg:"bg-red-50",border:"border-red-100",text:"text-red-600"},P1:{color:"orange",bg:"bg-orange-50",border:"border-orange-100",text:"text-orange-600"},P2:{color:"slate",bg:"bg-slate-50",border:"border-slate-100",text:"text-slate-600"}};return a[n]||a.P2}function Z(n,a){var h;return((h={indigo:{bg:"bg-indigo-50",text:"text-indigo-500"},orange:{bg:"bg-orange-50",text:"text-orange-500"},teal:{bg:"bg-teal-50",text:"text-teal-500"},pink:{bg:"bg-pink-50",text:"text-pink-500"}}[n])==null?void 0:h[a])||""}let B=null;function ee(){G(),W(),B=setInterval(W,3e4)}function G(){B&&(clearInterval(B),B=null)}return re(ee),Te(()=>{B||ee()}),Ie(G),ce(G),(n,a)=>(g(),x("div",Ae,[s("div",Se,[o(e(F),{class:"relative flex h-[35%] flex-col overflow-hidden p-6"},{default:i(()=>[s("div",ze,[s("div",{class:t(e(z).container)},[s("h3",{class:t(e(z).title)},"实时客流监测",2),s("div",{class:t(e(z).numberContainer)},[s("span",{class:t(e(z).largeNumber)},p(fe(_.value)),3),o(e(U),{color:"success",class:t(`text-xs font-bold ${e(V).tag}`)},{default:i(()=>[...a[5]||(a[5]=[S(" +12% ",-1)])]),_:1},8,["class"])],2),s("p",{class:t(e(z).description)},"预计高峰时间: 14:00",2)],2),o(e(D),{type:"text",shape:"circle",class:t(e(P).refresh),onClick:xe},{icon:i(()=>[o(e(y),{icon:"ant-design:more-outlined",class:"text-base"})]),_:1},8,["class"])]),o(e(ne),{options:pe.value,opacity:.6},null,8,["options"])]),_:1}),o(e(F),{class:t(e(r).card)},{default:i(()=>[s("div",{class:t(e(r).header)},[s("h3",{class:t(e(r).title)},[s("span",{class:t(e(r).titleDot)},null,2),a[6]||(a[6]=S(" 待办事项 ",-1))],2)],2),s("div",{class:t(e(r).listContainer)},[X.value.length===0?(g(),x("div",{key:0,class:t(e(r).emptyState)},[s("div",{class:t(e(r).emptyContent)},[o(e(y),{icon:"ant-design:check-circle-outlined",class:t(e(r).emptyIcon)},null,8,["class"]),a[7]||(a[7]=s("p",null,"暂无待办任务",-1))],2)],2)):(g(),x("div",De,[(g(!0),x(le,null,oe(X.value,l=>(g(),x("div",{key:l.id,class:t(e(r).taskItem),onClick:h=>q(l)},[s("div",{class:t(e(r).taskContent)},[s("div",{class:t(e(r).taskLeft)},[s("div",{class:t([e(r).taskIcon,j(l.priority).bg])},[o(e(y),{icon:"ant-design:clock-circle-outlined",class:t(["text-xs",[j(l.priority).text]])},null,8,["class"])],2),s("div",{class:t(e(r).taskInfo)},[s("div",{class:t(e(r).taskTitle)},p(l.title),3),s("div",{class:t(e(r).taskMeta)},[s("span",null,p(l.location),1),l.createTime?(g(),x("span",Le,"• "+p(l.createTime),1)):E("",!0),l.assignee?(g(),x("span",Ne,"• "+p(l.assignee),1)):E("",!0)],2)],2),o(e(U),{color:j(l.priority).color,class:t([e(r).taskPriorityTag,j(l.priority).border])},{default:i(()=>[S(p(l.priority),1)]),_:2},1032,["color","class"])],2),s("div",{class:t(e(r).taskActions)},[o(e(D),{type:"text",size:"small",shape:"circle",class:t([e(P).circleIcon,e(P).complete]),onClick:H(h=>Y(l.id),["stop"])},{icon:i(()=>[o(e(y),{icon:"ant-design:check-circle-outlined",class:"text-xs"})]),_:1},8,["class","onClick"]),o(e(D),{type:"text",size:"small",shape:"circle",class:t([e(P).circleIcon,e(P).view]),onClick:H(h=>q(l),["stop"])},{icon:i(()=>[o(e(y),{icon:"ant-design:eye-outlined",class:"text-xs"})]),_:1},8,["class","onClick"]),o(e(D),{type:"text",size:"small",shape:"circle",class:t([e(P).circleIcon,e(P).delete]),onClick:H(h=>K(l.id),["stop"])},{icon:i(()=>[o(e(y),{icon:"ant-design:delete-outlined",class:"text-xs"})]),_:1},8,["class","onClick"])],2)],2)],10,Pe))),128))]))],2)]),_:1},8,["class"])]),s("div",Oe,[o(e(F),{class:"relative flex h-[35%] flex-col overflow-hidden p-6"},{default:i(()=>[s("div",Re,[s("div",{class:t(e(z).container)},[s("h3",{class:t(e(z).title)},"工单趋势分析",2),s("div",{class:t(e(z).numberContainer)},[s("span",{class:t(e(z).largeNumber)},p(b.value),3),o(e(U),{color:"processing",class:t(`text-xs font-bold ${e(V).tag}`)},{default:i(()=>[S(" +"+p(u.value)+" 新增 ",1)]),_:1},8,["class"])],2)],2),o(e(D),{type:"text",size:"small",class:t(e(P).viewAll),onClick:a[0]||(a[0]=l=>e(L).info("查看全部工单"))},{default:i(()=>[...a[8]||(a[8]=[S(" 查看全部 ",-1)])]),_:1},8,["class"])]),o(e(ne),{options:ge.value,opacity:.6},null,8,["options"])]),_:1}),s("div",je,[s("div",{class:t(e(O).container)},[(g(!0),x(le,null,oe(N.value,(l,h)=>(g(),$e(e(F),{key:h,class:t(e(O).card),onClick:M=>be(l)},{default:i(()=>[s("div",{class:t([e(O).iconContainer,Z(l.color,"bg"),Z(l.color,"text")])},[o(e(y),{icon:l.icon,class:"text-lg"},null,8,["icon"])],2),s("div",{class:t(e(O).content)},[s("p",{class:t(e(O).label)},p(l.label),3),s("p",{class:t(e(O).value)},p(l.value),3)],2)]),_:2},1032,["class","onClick"]))),128))],2),o(e(F),{class:t(e(T).container)},{default:i(()=>[s("div",{class:t(e(T).background)},[...a[9]||(a[9]=[s("svg",{width:"100%",height:"100%"},[s("pattern",{id:"grid",x:"0",y:"0",width:"20",height:"20",patternUnits:"userSpaceOnUse"},[s("circle",{cx:"1",cy:"1",r:"1",fill:"white"})]),s("rect",{width:"100%",height:"100%",fill:"url(#grid)"}),s("path",{d:"M0,50 Q100,20 200,80 T400,50",fill:"none",stroke:"white","stroke-width":"1","stroke-opacity":"0.3"})],-1)])],2),s("div",{class:t(e(T).leftContent)},[s("div",Be,[s("span",{class:t(e(T).iconContainer)},[o(e(y),{icon:"ant-design:robot-outlined",class:"text-xs text-white"})],2),s("span",{class:t(e(T).label)},"AI Agent",2)]),s("h3",{class:t(e(T).title)},"需要我帮你做什么吗?",2),o(e(D),{type:"primary",class:t(e(T).button),onClick:a[1]||(a[1]=l=>e(L).info("打开AI助手"))},{default:i(()=>[a[10]||(a[10]=S(" 使用AI助手 ",-1)),o(e(y),{icon:"ant-design:robot-outlined",class:t(e(T).buttonIcon)},null,8,["class"])]),_:1},8,["class"])],2),s("div",{class:t(e(T).imageContainer)},[s("img",{src:Fe,alt:"AI Robot",class:t(e(T).image)},null,2)],2)]),_:1},8,["class"])])]),o(e(se),{open:R.value,"onUpdate:open":a[4]||(a[4]=l=>R.value=l),title:"任务详情",footer:null,width:"600px"},{default:i(()=>[v.value?(g(),x("div",{key:0,class:t(e(w).field)},[s("div",null,[s("div",{class:t(e(w).label)},"任务标题",2),s("div",{class:t(e(w).titleValue)},p(v.value.title),3)]),s("div",null,[s("div",{class:t(e(w).label)},"位置",2),s("div",{class:t(e(w).value)},p(v.value.location),3)]),s("div",null,[s("div",{class:t(e(w).label)},"优先级",2),o(e(U),{color:j(v.value.priority).color,class:"px-2 py-1 text-xs font-bold uppercase"},{default:i(()=>[S(p(v.value.priority),1)]),_:1},8,["color"])]),v.value.assignee?(g(),x("div",Me,[s("div",{class:t(e(w).label)},"负责人",2),s("div",{class:t(e(w).value)},p(v.value.assignee),3)])):E("",!0),v.value.createTime?(g(),x("div",Ee,[s("div",{class:t(e(w).label)},"创建时间",2),s("div",{class:t(e(w).value)},p(v.value.createTime),3)])):E("",!0),s("div",{class:t(e(w).actions)},[o(e(D),{type:"primary",onClick:a[2]||(a[2]=l=>{Y(v.value.id),R.value=!1})},{icon:i(()=>[o(e(y),{icon:"ant-design:check-circle-outlined"})]),default:i(()=>[a[11]||(a[11]=S(" 标记完成 ",-1))]),_:1}),o(e(D),{danger:"",onClick:a[3]||(a[3]=l=>{K(v.value.id),R.value=!1})},{icon:i(()=>[o(e(y),{icon:"ant-design:delete-outlined"})]),default:i(()=>[a[12]||(a[12]=S(" 删除任务 ",-1))]),_:1})],2)],2)):E("",!0)]),_:1},8,["open"])]))}}),Qe=ve(Ve,[["__scopeId","data-v-3fdb5021"]]);export{Qe as default};
|