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 h}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 _,u as v}from"./index-CUH3hGCJ.js";var y={class:`dashboard-page`},b={class:`dashboard-page__inner`},x={class:`dash-bundle`,"aria-label":`数据统计`},S={class:`dash-core-pack`},C={class:`dash-metric-card dash-metric-card--core`},w={class:`dash-metric-card__head`},T={class:`dash-metric-card__icon`,"aria-hidden":`true`},E={class:`dash-metric-card__body`},D={class:`dash-stat-grid dash-stat-grid--core`},O={class:`dash-stat-cell dash-stat-cell--violet`},k={class:`dash-stat-cell__value`},A={class:`dash-stat-cell dash-stat-cell--sky`},j={class:`dash-stat-cell__value`},M={key:0,class:`dash-metric-card dash-metric-card--todo`},N={class:`dash-metric-card__head dash-metric-card__head--todo`},P={class:`dash-metric-card__icon dash-metric-card__icon--todo`,"aria-hidden":`true`},F={class:`dash-metric-card__body`},I={key:0,class:`dash-todo-sheet dash-todo-sheet--loading`},L={key:1,class:`dash-todo-sheet`},R={key:0,class:`dash-todo-sheet--empty-inner`},z={class:`dash-todo-line__name`},B={class:`dash-schedule-dual`},V={class:`dash-metric-card`},H={class:`dash-metric-card__head`},U={class:`dash-metric-card__icon`,"aria-hidden":`true`},W={class:`dash-metric-card__body`},G={class:`dash-stat-grid dash-stat-grid--schedule-act`},le={class:`dash-stat-cell dash-stat-cell--rose`},ue={class:`dash-stat-cell__value`},de={class:`dash-stat-cell dash-stat-cell--amber`},fe={class:`dash-stat-cell__value`},pe={class:`dash-stat-cell dash-stat-cell--sky`},K={class:`dash-stat-cell__value`},me={class:`dash-stat-cell dash-stat-cell--mint`},he={class:`dash-stat-cell__value`},ge={class:`dash-metric-card`},_e={class:`dash-metric-card__head`},ve={class:`dash-metric-card__icon dash-metric-card__icon--schedule-tg`,"aria-hidden":`true`},ye={class:`dash-metric-card__body`},be={class:`dash-stat-grid dash-stat-grid--schedule-tg`},xe={class:`dash-stat-cell dash-stat-cell--rose`},Se={class:`dash-stat-cell__value`},Ce={class:`dash-stat-cell dash-stat-cell--amber`},we={class:`dash-stat-cell__value`},Te={class:`dash-stat-cell dash-stat-cell--sky`},Ee={class:`dash-stat-cell__value`},De={class:`dash-stat-cell dash-stat-cell--mint`},Oe={class:`dash-stat-cell__value`},ke={class:`dash-stat-cell dash-stat-cell--violet dash-stat-cell--verify-rate`},Ae={class:`dash-stat-cell__value dash-stat-cell__value--pct`},je={class:`dash-stat-cell__hint`},Me={class:`dash-rank-dual`},Ne={class:`dash-metric-card dash-metric-card--rank`},Pe={class:`dash-metric-card__head`},Fe={class:`dash-metric-card__icon dash-metric-card__icon--rank-pub`,"aria-hidden":`true`},Ie={class:`dash-metric-card__body dash-rank-card__body`},Le={class:`dash-metric-card dash-metric-card--rank`},Re={class:`dash-metric-card__head`},ze={class:`dash-metric-card__icon dash-metric-card__icon--rank-live`,"aria-hidden":`true`},Be={class:`dash-metric-card__body dash-rank-card__body`},q=300,J=v(ne({__name:`Dashboard`,setup(ne){let v=ie(),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 Ve=u(()=>X.value.pending_audits?.activities.count??0),Q=u(()=>Ve.value),$=u(()=>X.value.pending_audits?.activities.items??[]),He=u(()=>$.value.length>0);function Ue(){v.push({path:`/activities`,query:{audit_status:`pending`}})}let We=u(()=>{let e=X.value.ticket_grab_schedule_counts;return!e||e.booked_people<=0?`0%`:`${e.verify_rate_pct??0}%`}),Ge=u(()=>{let e=X.value.ticket_grab_schedule_counts;return`已核销 ${e?.verified_people??0} / 已约 ${e?.booked_people??0} 人`});async function Ke(){J.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{J.value=!1}}async function qe(){let{data:e}=await g.get(`/me`);Y.value=e?.full_admin_access===!0}return n(async()=>{await qe(),await Ke()}),(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`,y,[f(`div`,b,[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`,x,[f(`div`,{class:r([`dash-overview-dual`,{"dash-overview-dual--split":Y.value}])},[f(`div`,S,[f(`article`,C,[f(`header`,w,[f(`div`,T,[m(p(oe))]),n[2]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`核心数据统计`)],-1)]),f(`div`,E,[f(`div`,D,[f(`div`,O,[f(`div`,k,l(X.value.summary.venues_count??0),1),n[3]||=f(`div`,{class:`dash-stat-cell__label`},`现有场馆`,-1)]),f(`div`,A,[f(`div`,j,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)])])])])]),Y.value?(t(),d(`article`,M,[f(`header`,N,[f(`div`,P,[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`,F,[J.value&&X.value.pending_audits==null?(t(),d(`div`,I,[...n[7]||=[f(`span`,{class:`dash-todo-placeholder`},`加载中…`,-1)]])):(t(),d(`div`,L,[He.value?(t(!0),d(ee,{key:1},h($.value,e=>(t(),d(`button`,{key:`pa-`+e.id,type:`button`,class:`dash-todo-line`,onClick:Ue},[n[9]||=f(`span`,{class:`dash-todo-line__kind`},`活动审核`,-1),f(`span`,z,l(e.title),1),n[10]||=f(`span`,{class:`dash-todo-line__action`},`去处理`,-1)]))),128)):(t(),d(`div`,R,[...n[8]||=[f(`span`,{class:`dash-todo-placeholder`},`暂无待审核事项`,-1)]]))]))])])):s(``,!0)],2),f(`div`,B,[f(`article`,V,[f(`header`,H,[f(`div`,U,[m(p(ae))]),n[11]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`活动统计`)],-1)]),f(`div`,W,[f(`div`,G,[f(`div`,le,[f(`div`,ue,l(X.value.activity_schedule_counts.total),1),n[12]||=f(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),f(`div`,de,[f(`div`,fe,l(X.value.activity_schedule_counts.not_started),1),n[13]||=f(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),f(`div`,pe,[f(`div`,K,l(X.value.activity_schedule_counts.ongoing),1),n[14]||=f(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),f(`div`,me,[f(`div`,he,l(X.value.activity_schedule_counts.ended),1),n[15]||=f(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)])])])]),f(`article`,ge,[f(`header`,_e,[f(`div`,ve,[m(p(_))]),n[16]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`抢票统计`)],-1)]),f(`div`,ye,[f(`div`,be,[f(`div`,xe,[f(`div`,Se,l(X.value.ticket_grab_schedule_counts.total),1),n[17]||=f(`div`,{class:`dash-stat-cell__label`},`总场数`,-1)]),f(`div`,Ce,[f(`div`,we,l(X.value.ticket_grab_schedule_counts.not_started),1),n[18]||=f(`div`,{class:`dash-stat-cell__label`},`未开始`,-1)]),f(`div`,Te,[f(`div`,Ee,l(X.value.ticket_grab_schedule_counts.ongoing),1),n[19]||=f(`div`,{class:`dash-stat-cell__label`},`进行中`,-1)]),f(`div`,De,[f(`div`,Oe,l(X.value.ticket_grab_schedule_counts.ended),1),n[20]||=f(`div`,{class:`dash-stat-cell__label`},`已结束`,-1)]),f(`div`,ke,[f(`div`,Ae,l(We.value),1),n[21]||=f(`div`,{class:`dash-stat-cell__label`},`核销率`,-1),f(`div`,je,l(Ge.value),1)])])])])]),f(`div`,Me,[f(`article`,Ne,[f(`header`,Pe,[f(`div`,Fe,[m(p(re))]),n[22]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`活动发布排行`)],-1)]),f(`div`,Ie,[m(u,{class:`dash-table dash-rank-table`,data:X.value.activity_publish_ranking,loading:J.value,pagination:!1,scroll:{y:q},"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`,Le,[f(`header`,Re,[f(`div`,ze,[m(p(se))]),n[23]||=f(`div`,{class:`dash-metric-card__head-main`},[f(`h2`,{class:`dash-metric-card__title`},`实时人数排行`)],-1)]),f(`div`,Be,[m(u,{class:`dash-table dash-rank-table`,data:X.value.live_people_ranking,loading:J.value,pagination:!1,scroll:{y:q},"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-02cf73ee`]]);export{J as default}; |