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
10 KiB
1 line
10 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 te,p as d,u as f,ut as p,v as m,y as ne,z as re}from"./runtime-core.esm-bundler-CnFWH3R5.js";import{n as h}from"./http-LCi9aT1G.js";import{a as g,c as ie,f as ae,i as oe,n as se,o as ce,r as le,u as _}from"./index-DWQkWGTP.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--sky`},A={class:`dash-stat-cell__value`},j={key:0,class:`dash-metric-card dash-metric-card--todo`},M={class:`dash-metric-card__head dash-metric-card__head--todo`},N={class:`dash-metric-card__icon dash-metric-card__icon--todo`,"aria-hidden":`true`},P={class:`dash-metric-card__body`},F={key:0,class:`dash-todo-sheet dash-todo-sheet--loading`},I={key:1,class:`dash-todo-sheet`},L={key:0,class:`dash-todo-sheet--empty-inner`},R={class:`dash-todo-line__name`},z={class:`dash-schedule-dual`},B={class:`dash-metric-card`},V={class:`dash-metric-card__head`},H={class:`dash-metric-card__icon`,"aria-hidden":`true`},U={class:`dash-metric-card__body`},W={class:`dash-stat-grid dash-stat-grid--schedule-act`},ue={class:`dash-stat-cell dash-stat-cell--rose`},de={class:`dash-stat-cell__value`},fe={class:`dash-stat-cell dash-stat-cell--amber`},pe={class:`dash-stat-cell__value`},me={class:`dash-stat-cell dash-stat-cell--sky`},he={class:`dash-stat-cell__value`},G={class:`dash-stat-cell dash-stat-cell--mint`},ge={class:`dash-stat-cell__value`},_e={class:`dash-metric-card`},ve={class:`dash-metric-card__head`},ye={class:`dash-metric-card__icon dash-metric-card__icon--schedule-tg`,"aria-hidden":`true`},be={class:`dash-metric-card__body`},xe={class:`dash-stat-grid dash-stat-grid--schedule-tg`},Se={class:`dash-stat-cell dash-stat-cell--rose`},Ce={class:`dash-stat-cell__value`},we={class:`dash-stat-cell dash-stat-cell--amber`},Te={class:`dash-stat-cell__value`},Ee={class:`dash-stat-cell dash-stat-cell--sky`},De={class:`dash-stat-cell__value`},Oe={class:`dash-stat-cell dash-stat-cell--mint`},ke={class:`dash-stat-cell__value`},Ae={class:`dash-stat-cell dash-stat-cell--violet dash-stat-cell--verify-rate`},je={class:`dash-stat-cell__value dash-stat-cell__value--pct`},Me={class:`dash-stat-cell__hint`},Ne={class:`dash-rank-dual`},Pe={class:`dash-metric-card dash-metric-card--rank`},Fe={class:`dash-metric-card__head`},Ie={class:`dash-metric-card__icon dash-metric-card__icon--rank-pub`,"aria-hidden":`true`},Le={class:`dash-metric-card__body dash-rank-card__body`},Re={class:`dash-metric-card dash-metric-card--rank`},ze={class:`dash-metric-card__head`},Be={class:`dash-metric-card__icon dash-metric-card__icon--rank-live`,"aria-hidden":`true`},Ve={class:`dash-metric-card__body dash-rank-card__body`},K=300,q=_(ne({__name:`Dashboard`,setup(ne){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},activity_schedule_counts:{total:0,not_started:0,ongoing:0,ended: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),te({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 He=u(()=>X.value.pending_audits?.activities.count??0),Q=u(()=>He.value),$=u(()=>X.value.pending_audits?.activities.items??[]),Ue=u(()=>$.value.length>0);function We(){_.push({path:`/activities`,query:{audit_status:`pending`}})}let Ge=u(()=>{let e=X.value.ticket_grab_schedule_counts;return!e||e.booked_people<=0?`0%`:`${e.verify_rate_pct??0}%`}),Ke=u(()=>{let e=X.value.ticket_grab_schedule_counts;return`已核销 ${e?.verified_people??0} / 已约 ${e?.booked_people??0} 人`});async function qe(){q.value=!0;try{let{data:e}=await h.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 Je(){let{data:e}=await h.get(`/me`);J.value=e?.full_admin_access===!0,Y.value=e?.role===`venue_admin`}return n(async()=>{await Je(),await qe()}),(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(),d(`div`,v,[f(`div`,y,[n[39]||=f(`header`,{class:`dashboard-page__header`},[f(`div`,{class:`dashboard-page__heading`},[f(`h1`,{class:`dashboard-page__title`},`工作台`),f(`span`,{class:`dashboard-page__subtitle`},`数据看板`)])],-1),f(`section`,b,[Y.value?s(``,!0):(t(),d(`div`,{key:0,class:r([`dash-overview-dual`,{"dash-overview-dual--split":J.value}])},[f(`div`,x,[f(`article`,S,[f(`header`,C,[f(`div`,w,[m(p(oe))]),n[2]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`核心数据统计`)],-1)]),f(`div`,T,[f(`div`,E,[f(`div`,D,[f(`div`,O,l(X.value.summary.venues_count??0),1),n[3]||=f(`div`,{class:`dash-stat-cell__label`},`现有场馆`,-1)]),f(`div`,k,[f(`div`,A,l(X.value.summary.user_count),1),n[4]||=f(`div`,{class:`dash-stat-cell__label`},`用户数`,-1),n[5]||=f(`div`,{class:`dash-stat-cell__hint`},`预约用户`,-1)])])])])]),J.value?(t(),d(`article`,j,[f(`header`,M,[f(`div`,N,[m(p(ce))]),n[6]||=f(`h2`,{class:`dash-metric-card__title dash-metric-card__title--inline`},`待办事项`,-1),f(`span`,{class:r([`dash-todo-count-badge`,{"dash-todo-count-badge--zero":Q.value===0}])},l(Q.value),3)]),f(`div`,P,[q.value&&X.value.pending_audits==null?(t(),d(`div`,F,[...n[7]||=[f(`span`,{class:`dash-todo-placeholder`},`加载中…`,-1)]])):(t(),d(`div`,I,[Ue.value?(t(!0),d(ee,{key:1},re($.value,e=>(t(),d(`button`,{key:`pa-`+e.id,type:`button`,class:`dash-todo-line`,onClick:We},[n[9]||=f(`span`,{class:`dash-todo-line__kind`},`活动审核`,-1),f(`span`,R,l(e.title),1),n[10]||=f(`span`,{class:`dash-todo-line__action`},`去处理`,-1)]))),128)):(t(),d(`div`,L,[...n[8]||=[f(`span`,{class:`dash-todo-placeholder`},`暂无待审核事项`,-1)]]))]))])])):s(``,!0)],2)),f(`div`,z,[f(`article`,B,[f(`header`,V,[f(`div`,H,[m(p(ae))]),n[11]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`活动统计`)],-1)]),f(`div`,U,[f(`div`,W,[f(`div`,ue,[f(`div`,de,l(X.value.activity_schedule_counts.total),1),n[12]||=f(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),f(`div`,fe,[f(`div`,pe,l(X.value.activity_schedule_counts.not_started),1),n[13]||=f(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),f(`div`,me,[f(`div`,he,l(X.value.activity_schedule_counts.ongoing),1),n[14]||=f(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),f(`div`,G,[f(`div`,ge,l(X.value.activity_schedule_counts.ended),1),n[15]||=f(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)])])])]),f(`article`,_e,[f(`header`,ve,[f(`div`,ye,[m(p(le))]),n[16]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`抢票统计`)],-1)]),f(`div`,be,[f(`div`,xe,[f(`div`,Se,[f(`div`,Ce,l(X.value.ticket_grab_schedule_counts.total),1),n[17]||=f(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),f(`div`,we,[f(`div`,Te,l(X.value.ticket_grab_schedule_counts.not_started),1),n[18]||=f(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),f(`div`,Ee,[f(`div`,De,l(X.value.ticket_grab_schedule_counts.ongoing),1),n[19]||=f(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),f(`div`,Oe,[f(`div`,ke,l(X.value.ticket_grab_schedule_counts.ended),1),n[20]||=f(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)]),f(`div`,Ae,[f(`div`,je,l(Ge.value),1),n[21]||=f(`div`,{class:`dash-stat-cell__label`},`核销率`,-1),f(`div`,Me,l(Ke.value),1)])])])])]),f(`div`,Ne,[f(`article`,Pe,[f(`header`,Fe,[f(`div`,Ie,[m(p(g))]),n[22]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`活动发布排行`)],-1)]),f(`div`,Le,[m(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(()=>[m(c,{title:`#`,width:52},{cell:a(({rowIndex:e})=>[o(l(e+1),1)]),_:1}),m(c,{title:`场馆名称`,"data-index":`venue_name`,ellipsis:!0,tooltip:!0}),m(c,{title:`发布活动数`,"data-index":`published_count`,width:120,align:`right`})]),_:1},8,[`data`,`loading`,`scroll`])])]),f(`article`,Re,[f(`header`,ze,[f(`div`,Be,[m(p(se))]),n[23]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`实时人数排行`)],-1)]),f(`div`,Ve,[m(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(()=>[m(c,{title:`#`,width:52},{cell:a(({rowIndex:e})=>[o(l(e+1),1)]),_:1}),m(c,{title:`场馆名称`,"data-index":`venue_name`,ellipsis:!0,tooltip:!0}),m(c,{title:`在馆人数`,"data-index":`live_count`,width:100,align:`right`})]),_:1},8,[`data`,`loading`,`scroll`])])])])]),s(``,!0)])])}}}),[[`__scopeId`,`data-v-9ce3e610`]]);export{q as default}; |