You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
11 KiB
1 line
11 KiB
import{n as e}from"./axios-CiYFffbI.js";import{I as t,N as n,Tt as r,V as i,Y as a,_ as o,f as s,i as ee,it as c,kt as l,l as u,nt as d,p as f,u as p,ut as m,v as h,y as te,z as ne}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{n as g}from"./http-LCi9aT1G.js";import{a as re,c as ie,f as ae,i as oe,n as se,o as ce,r as le,u as _}from"./index-CTbRJnkM.js";var v={class:`dashboard-page`},y={class:`dashboard-page__inner`},b={class:`dash-bundle`,"aria-label":`数据统计`},x={class:`dash-core-pack`},S={class:`dash-metric-card dash-metric-card--core`},C={class:`dash-metric-card__head`},w={class:`dash-metric-card__icon`,"aria-hidden":`true`},T={class:`dash-metric-card__body`},E={class:`dash-stat-grid dash-stat-grid--core`},D={class:`dash-stat-cell dash-stat-cell--violet`},O={class:`dash-stat-cell__value`},k={class:`dash-stat-cell dash-stat-cell--mint`},A={class:`dash-stat-cell__value`},j={class:`dash-stat-cell dash-stat-cell--sky`},M={class:`dash-stat-cell__value`},N={class:`dash-stat-cell__hint`},P={key:0,class:`dash-metric-card dash-metric-card--todo`},F={class:`dash-metric-card__head dash-metric-card__head--todo`},I={class:`dash-metric-card__icon dash-metric-card__icon--todo`,"aria-hidden":`true`},L={class:`dash-metric-card__body`},R={key:0,class:`dash-todo-sheet dash-todo-sheet--loading`},z={key:1,class:`dash-todo-sheet`},B={key:0,class:`dash-todo-sheet--empty-inner`},V={class:`dash-todo-placeholder`},H={class:`dash-todo-line__kind`},U={class:`dash-todo-line__name`},W={class:`dash-schedule-dual`},ue={class:`dash-metric-card`},de={class:`dash-metric-card__head`},fe={class:`dash-metric-card__icon`,"aria-hidden":`true`},pe={class:`dash-metric-card__body`},me={class:`dash-stat-grid dash-stat-grid--schedule-act`},he={class:`dash-stat-cell dash-stat-cell--rose`},ge={class:`dash-stat-cell__value`},_e={class:`dash-stat-cell dash-stat-cell--amber`},ve={class:`dash-stat-cell__value`},ye={class:`dash-stat-cell dash-stat-cell--sky`},be={class:`dash-stat-cell__value`},xe={class:`dash-stat-cell dash-stat-cell--mint`},Se={class:`dash-stat-cell__value`},Ce={class:`dash-stat-cell dash-stat-cell--indigo`},we={class:`dash-stat-cell__value`},G={class:`dash-metric-card`},Te={class:`dash-metric-card__head`},Ee={class:`dash-metric-card__icon dash-metric-card__icon--schedule-tg`,"aria-hidden":`true`},De={class:`dash-metric-card__body`},Oe={class:`dash-stat-grid dash-stat-grid--schedule-tg`},ke={class:`dash-stat-cell dash-stat-cell--rose`},Ae={class:`dash-stat-cell__value`},je={class:`dash-stat-cell dash-stat-cell--amber`},Me={class:`dash-stat-cell__value`},Ne={class:`dash-stat-cell dash-stat-cell--sky`},Pe={class:`dash-stat-cell__value`},Fe={class:`dash-stat-cell dash-stat-cell--mint`},Ie={class:`dash-stat-cell__value`},Le={class:`dash-stat-cell dash-stat-cell--violet dash-stat-cell--verify-rate`},Re={class:`dash-stat-cell__value dash-stat-cell__value--pct`},ze={class:`dash-stat-cell__hint`},Be={class:`dash-rank-dual`},Ve={class:`dash-metric-card dash-metric-card--rank`},He={class:`dash-metric-card__head`},Ue={class:`dash-metric-card__icon dash-metric-card__icon--rank-pub`,"aria-hidden":`true`},We={class:`dash-metric-card__body dash-rank-card__body`},Ge={class:`dash-metric-card dash-metric-card--rank`},Ke={class:`dash-metric-card__head`},qe={class:`dash-metric-card__icon dash-metric-card__icon--rank-live`,"aria-hidden":`true`},Je={class:`dash-metric-card__body dash-rank-card__body`},K=300,q=_(te({__name:`Dashboard`,setup(te){let _=ie(),q=c(!1),J=c(!1),Y=c(!1),X=c({scope:{role:``,venue_id:void 0,activity_id:void 0},summary:{activity_sessions:0,venues_count:0,ticket_grab_sessions:0,user_count:0,reservation_order_count:0},activity_schedule_counts:{total:0,not_started:0,ongoing:0,ended:0,published_venues_count:0},ticket_grab_schedule_counts:{total:0,not_started:0,ongoing:0,ended:0,verify_rate_pct:null,verified_people:0,booked_people:0},pending_audits:null,activity_publish_ranking:[],live_people_ranking:[],live_people_counting_ok:!1});c([]),c(!1),d({eventId:void 0,date:void 0});let Z=c(null);u(()=>Z.value?.daily_verify_matrix?.date_labels??[]),u(()=>Z.value?.daily_verify_matrix?.rows??[]),c(!1);let Ye=u(()=>X.value.pending_audits?.activities.count??0),Q=u(()=>Ye.value),$=u(()=>X.value.pending_audits?.activities.items??[]),Xe=u(()=>$.value.length>0),Ze=u(()=>J.value||Y.value),Qe=u(()=>Y.value?`暂无已退回活动`:`暂无待审核事项`),$e=u(()=>Y.value?`活动退回`:`活动审核`);function et(){_.push({path:`/activities`,query:{audit_status:`pending`}})}function tt(){_.push({path:`/activities`,query:{audit_status:`rejected`}})}function nt(){Y.value?tt():et()}let rt=u(()=>{let e=X.value.ticket_grab_schedule_counts;return!e||e.booked_people<=0?`0%`:`${e.verify_rate_pct??0}%`}),it=u(()=>{let e=X.value.ticket_grab_schedule_counts;return`已核销 ${e?.verified_people??0} / 已约 ${e?.booked_people??0} 人`});async function at(){q.value=!0;try{let{data:e}=await g.get(`/dashboard/stats`),{live_people_counting_debug:t,...n}=e;n.live_people_counting_ok===!1&&console.warn(`[工作台] 客流统计接口异常`,t??{}),X.value={...X.value,...n,summary:e.summary??X.value.summary,activity_schedule_counts:{...X.value.activity_schedule_counts,...e.activity_schedule_counts??{}},ticket_grab_schedule_counts:{...X.value.ticket_grab_schedule_counts,...e.ticket_grab_schedule_counts??{}},pending_audits:e.pending_audits??null,activity_publish_ranking:Array.isArray(e.activity_publish_ranking)?e.activity_publish_ranking:X.value.activity_publish_ranking,live_people_ranking:Array.isArray(e.live_people_ranking)?e.live_people_ranking:X.value.live_people_ranking,live_people_counting_ok:typeof e.live_people_counting_ok==`boolean`?e.live_people_counting_ok:X.value.live_people_counting_ok}}catch(t){e.error(t?.response?.data?.message??`加载统计失败`)}finally{q.value=!1}}async function ot(){let{data:e}=await g.get(`/me`);J.value=e?.full_admin_access===!0,Y.value=e?.role===`venue_admin`}return n(async()=>{await ot(),await at()}),(e,n)=>{let c=i(`a-table-column`),u=i(`a-table`);return i(`a-tag`),i(`a-option`),i(`a-select`),i(`a-date-picker`),i(`a-button`),i(`a-space`),i(`a-card`),i(`a-empty`),i(`a-spin`),t(),f(`div`,v,[p(`div`,y,[n[38]||=p(`header`,{class:`dashboard-page__header`},[p(`div`,{class:`dashboard-page__heading`},[p(`h1`,{class:`dashboard-page__title`},`工作台`),p(`span`,{class:`dashboard-page__subtitle`},`数据看板`)])],-1),p(`section`,b,[p(`div`,{class:r([`dash-overview-dual`,{"dash-overview-dual--split":Ze.value}])},[p(`div`,x,[p(`article`,S,[p(`header`,C,[p(`div`,w,[h(m(oe))]),n[2]||=p(`div`,{class:`dash-metric-card__head-main`},[p(`h2`,{class:`dash-metric-card__title`},`核心数据统计`)],-1)]),p(`div`,T,[p(`div`,E,[p(`div`,D,[p(`div`,O,l(X.value.summary.venues_count??0),1),n[3]||=p(`div`,{class:`dash-stat-cell__label`},`现有场馆`,-1)]),p(`div`,k,[p(`div`,A,l(X.value.summary.reservation_order_count??0),1),n[4]||=p(`div`,{class:`dash-stat-cell__label`},`总预约次数`,-1)]),p(`div`,j,[p(`div`,M,l(X.value.summary.user_count),1),n[5]||=p(`div`,{class:`dash-stat-cell__label`},`用户数`,-1),p(`div`,N,l(Y.value?`预约本场馆活动用户`:`预约用户`),1)])])])])]),J.value||Y.value?(t(),f(`article`,P,[p(`header`,F,[p(`div`,I,[h(m(ce))]),n[6]||=p(`h2`,{class:`dash-metric-card__title dash-metric-card__title--inline`},`待办事项`,-1),p(`span`,{class:r([`dash-todo-count-badge`,{"dash-todo-count-badge--zero":Q.value===0}])},l(Q.value),3)]),p(`div`,L,[q.value&&X.value.pending_audits==null?(t(),f(`div`,R,[...n[7]||=[p(`span`,{class:`dash-todo-placeholder`},`加载中…`,-1)]])):(t(),f(`div`,z,[Xe.value?(t(!0),f(ee,{key:1},ne($.value,e=>(t(),f(`button`,{key:`pa-`+e.id,type:`button`,class:`dash-todo-line`,onClick:nt},[p(`span`,H,l($e.value),1),p(`span`,U,l(e.title),1),n[8]||=p(`span`,{class:`dash-todo-line__action`},`去处理`,-1)]))),128)):(t(),f(`div`,B,[p(`span`,V,l(Qe.value),1)]))]))])])):s(``,!0)],2),p(`div`,W,[p(`article`,ue,[p(`header`,de,[p(`div`,fe,[h(m(ae))]),n[9]||=p(`div`,{class:`dash-metric-card__head-main`},[p(`h2`,{class:`dash-metric-card__title`},`活动统计`)],-1)]),p(`div`,pe,[p(`div`,me,[p(`div`,he,[p(`div`,ge,l(X.value.activity_schedule_counts.total),1),n[10]||=p(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),p(`div`,_e,[p(`div`,ve,l(X.value.activity_schedule_counts.not_started),1),n[11]||=p(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),p(`div`,ye,[p(`div`,be,l(X.value.activity_schedule_counts.ongoing),1),n[12]||=p(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),p(`div`,xe,[p(`div`,Se,l(X.value.activity_schedule_counts.ended),1),n[13]||=p(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)]),p(`div`,Ce,[p(`div`,we,l(X.value.activity_schedule_counts.published_venues_count??0),1),n[14]||=p(`div`,{class:`dash-stat-cell__label`},`已发布活动场馆`,-1)])])])]),p(`article`,G,[p(`header`,Te,[p(`div`,Ee,[h(m(le))]),n[15]||=p(`div`,{class:`dash-metric-card__head-main`},[p(`h2`,{class:`dash-metric-card__title`},`抢票统计`)],-1)]),p(`div`,De,[p(`div`,Oe,[p(`div`,ke,[p(`div`,Ae,l(X.value.ticket_grab_schedule_counts.total),1),n[16]||=p(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),p(`div`,je,[p(`div`,Me,l(X.value.ticket_grab_schedule_counts.not_started),1),n[17]||=p(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),p(`div`,Ne,[p(`div`,Pe,l(X.value.ticket_grab_schedule_counts.ongoing),1),n[18]||=p(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),p(`div`,Fe,[p(`div`,Ie,l(X.value.ticket_grab_schedule_counts.ended),1),n[19]||=p(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)]),p(`div`,Le,[p(`div`,Re,l(rt.value),1),n[20]||=p(`div`,{class:`dash-stat-cell__label`},`核销率`,-1),p(`div`,ze,l(it.value),1)])])])])]),p(`div`,Be,[p(`article`,Ve,[p(`header`,He,[p(`div`,Ue,[h(m(re))]),n[21]||=p(`div`,{class:`dash-metric-card__head-main`},[p(`h2`,{class:`dash-metric-card__title`},`活动发布排行`)],-1)]),p(`div`,We,[h(u,{class:`dash-table dash-rank-table`,data:X.value.activity_publish_ranking,loading:q.value,pagination:!1,scroll:{y:K},"row-key":`venue_id`,size:`small`},{columns:a(()=>[h(c,{title:`#`,width:52},{cell:a(({rowIndex:e})=>[o(l(e+1),1)]),_:1}),h(c,{title:`场馆名称`,"data-index":`venue_name`,ellipsis:!0,tooltip:!0}),h(c,{title:`发布活动数`,"data-index":`published_count`,width:120,align:`right`})]),_:1},8,[`data`,`loading`,`scroll`])])]),p(`article`,Ge,[p(`header`,Ke,[p(`div`,qe,[h(m(se))]),n[22]||=p(`div`,{class:`dash-metric-card__head-main`},[p(`h2`,{class:`dash-metric-card__title`},`实时人数排行`)],-1)]),p(`div`,Je,[h(u,{class:`dash-table dash-rank-table`,data:X.value.live_people_ranking,loading:q.value,pagination:!1,scroll:{y:K},"row-key":`venue_id`,size:`small`},{columns:a(()=>[h(c,{title:`#`,width:52},{cell:a(({rowIndex:e})=>[o(l(e+1),1)]),_:1}),h(c,{title:`场馆名称`,"data-index":`venue_name`,ellipsis:!0,tooltip:!0}),h(c,{title:`在馆人数`,"data-index":`live_count`,width:100,align:`right`})]),_:1},8,[`data`,`loading`,`scroll`])])])])]),s(``,!0)])])}}}),[[`__scopeId`,`data-v-95f60e14`]]);export{q as default}; |