新增功能
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<div class="dashboard-title-row">
|
||||
<h1>数据驾驶舱</h1>
|
||||
<h1>我的首页</h1>
|
||||
<span class="scope-badge">
|
||||
<el-icon><Lock /></el-icon>
|
||||
{{ dashboard.scope.label || '数据范围' }}
|
||||
@@ -181,7 +181,7 @@
|
||||
<div class="ranking-main">
|
||||
<div class="ranking-copy">
|
||||
<strong>{{ item.name || '未命名成员' }}</strong>
|
||||
<span>{{ formatNumber(item.count) }} 个挂号</span>
|
||||
<span>{{ formatNumber(item.count) }} 笔挂号</span>
|
||||
</div>
|
||||
<div class="ranking-meter" aria-hidden="true">
|
||||
<span :style="{ width: rankingWidth(item.count, appointmentRankingMax) }" />
|
||||
@@ -328,7 +328,7 @@ import vCharts from 'vue-echarts'
|
||||
|
||||
import { performanceDashboardOverview } from '@/api/stats'
|
||||
|
||||
type TrendKey = 'appointments' | 'leads' | 'orders'
|
||||
type TrendKey = 'registrations' | 'appointments' | 'leads' | 'orders'
|
||||
|
||||
interface RankingItem {
|
||||
id: number
|
||||
@@ -417,6 +417,7 @@ const createInitialDashboard = () => ({
|
||||
trend: {
|
||||
date_range: [] as string[],
|
||||
dates: [] as string[],
|
||||
registrations: [] as number[],
|
||||
appointments: [] as number[],
|
||||
leads: [] as number[],
|
||||
orders: [] as number[],
|
||||
@@ -442,14 +443,15 @@ const dashboard = reactive(createInitialDashboard())
|
||||
const loading = ref(false)
|
||||
const loaded = ref(false)
|
||||
const errorMessage = ref('')
|
||||
const activeTrend = ref<TrendKey>('appointments')
|
||||
const activeTrend = ref<TrendKey>('registrations')
|
||||
const rankingDeptId = ref<number | undefined>()
|
||||
const now = ref(new Date())
|
||||
let clockTimer: ReturnType<typeof setInterval> | undefined
|
||||
const departmentTreeProps = { value: 'id', label: 'name', children: 'children' }
|
||||
|
||||
const trendOptions = [
|
||||
{ label: '挂号', value: 'appointments' },
|
||||
{ label: '挂号', value: 'registrations' },
|
||||
{ label: '预约', value: 'appointments' },
|
||||
{ label: '进线', value: 'leads' },
|
||||
{ label: '诊单', value: 'orders' },
|
||||
]
|
||||
@@ -472,16 +474,16 @@ const todayMetrics = computed(() => [
|
||||
},
|
||||
{
|
||||
key: 'appointments',
|
||||
label: '今日挂号',
|
||||
label: '今日预约',
|
||||
value: formatNumber(dashboard.today.appointment_total_count),
|
||||
hint: '状态为已预约、已完成或改期,排除已取消',
|
||||
comparisons: [dashboard.today.comparisons.appointment_total_count],
|
||||
},
|
||||
{
|
||||
key: 'lowAmountPayments',
|
||||
label: '今日 10 元及以下收款',
|
||||
label: '今日挂号',
|
||||
value: `${formatNumber(dashboard.today.low_amount_payment_count)} 笔`,
|
||||
hint: '实收金额大于 0 且不超过 10 元的已支付订单',
|
||||
hint: '已支付且实收金额大于 0、低于 10 元的订单',
|
||||
comparisons: [dashboard.today.comparisons.low_amount_payment_count],
|
||||
},
|
||||
{
|
||||
@@ -496,9 +498,9 @@ const todayMetrics = computed(() => [
|
||||
},
|
||||
{
|
||||
key: 'appointmentRate',
|
||||
label: '付费挂号率',
|
||||
label: '挂号率',
|
||||
value: formatPercent(dashboard.today.paid_appointment_rate),
|
||||
hint: `付费挂号 ${formatNumber(dashboard.today.paid_appointment_count)} / 加粉数`,
|
||||
hint: `挂号 ${formatNumber(dashboard.today.paid_appointment_count)} / 加粉数`,
|
||||
comparisons: [dashboard.today.comparisons.paid_appointment_rate],
|
||||
},
|
||||
{
|
||||
@@ -512,7 +514,7 @@ const todayMetrics = computed(() => [
|
||||
key: 'interviews',
|
||||
label: '今日面诊',
|
||||
value: formatNumber(dashboard.today.interview_count),
|
||||
hint: '状态为已完成的挂号',
|
||||
hint: '状态为已完成的预约',
|
||||
comparisons: [dashboard.today.comparisons.interview_count],
|
||||
},
|
||||
])
|
||||
@@ -532,8 +534,8 @@ const currentDate = computed(() => new Intl.DateTimeFormat('zh-CN', {
|
||||
}).format(now.value))
|
||||
|
||||
const appointmentRankingSubtitle = computed(() => {
|
||||
const actor = dashboard.rankings.appointments.kind === 'doctor' ? '医生' : '医助'
|
||||
return `${dashboard.rankings.appointments.scope_label}内的${actor}有效挂号数(不含已取消)`
|
||||
const actor = dashboard.rankings.appointments.kind === 'doctor' ? '医生' : '成员'
|
||||
return `${dashboard.rankings.appointments.scope_label}内${actor}已支付且实收低于 10 元的订单笔数`
|
||||
})
|
||||
|
||||
const appointmentRankingMax = computed(() => Math.max(
|
||||
@@ -548,7 +550,8 @@ const performanceRankingMax = computed(() => Math.max(
|
||||
|
||||
const trendChartOption = computed(() => {
|
||||
const config: Record<TrendKey, { label: string; data: number[] }> = {
|
||||
appointments: { label: '挂号', data: dashboard.trend.appointments },
|
||||
registrations: { label: '挂号', data: dashboard.trend.registrations },
|
||||
appointments: { label: '预约', data: dashboard.trend.appointments },
|
||||
leads: { label: '进线', data: dashboard.trend.leads },
|
||||
orders: { label: '诊单', data: dashboard.trend.orders },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user