feat: turn workbench into action queue
This commit is contained in:
parent
3470b124e4
commit
9199072435
@ -36,6 +36,9 @@ export const getServiceCustomers = (params: Record<string, unknown> = {}) =>
|
||||
export const getWorkbenchReportFunnel = (date?: string) =>
|
||||
apiGet('/admin/workbench/report-funnel', date ? { date } : {})
|
||||
|
||||
export const getWorkbenchActions = () =>
|
||||
apiGet('/admin/workbench/actions')
|
||||
|
||||
export const getAdminStore = () => apiGet<Record<string, unknown>>('/admin/store')
|
||||
|
||||
export const updateStore = (data: Record<string, unknown>) => apiPut('/store/update', data)
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
<el-option v-for="s in staffOptions" :key="s.id" :label="s.name" :value="s.id" />
|
||||
</el-select>
|
||||
<el-checkbox v-model="missingReport">待出报告</el-checkbox>
|
||||
<el-checkbox v-model="overdueOnly">已过预约时间</el-checkbox>
|
||||
<el-checkbox v-model="completedTodayOnly">今日完成</el-checkbox>
|
||||
<el-input v-model="keyword" clearable placeholder="宠主/手机/宠物名" style="width: 200px" />
|
||||
<el-button type="primary" @click="load">查询</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
@ -132,6 +134,8 @@ const dateFilter = ref((route.query.date as string) || '')
|
||||
const dateRange = ref<[string, string] | ''>('')
|
||||
const staffId = ref<number | undefined>()
|
||||
const missingReport = ref(route.query.missingReport === '1')
|
||||
const overdueOnly = ref(route.query.overdue === '1')
|
||||
const completedTodayOnly = ref(route.query.completedToday === '1')
|
||||
|
||||
function appointmentRange(row: Appt): string {
|
||||
const start = String(row.appointmentTime || '').replace('T', ' ').slice(0, 16)
|
||||
@ -195,6 +199,17 @@ async function load() {
|
||||
if (missingReport.value) {
|
||||
list = list.filter((a) => a.status === 'doing' && !a.hasReport)
|
||||
}
|
||||
if (overdueOnly.value) {
|
||||
const now = Date.now()
|
||||
list = list.filter((a) => {
|
||||
const appointmentAt = Date.parse(String(a.appointmentTime || ''))
|
||||
return a.status === 'new' && !Number.isNaN(appointmentAt) && appointmentAt < now
|
||||
})
|
||||
}
|
||||
if (completedTodayOnly.value) {
|
||||
const today = todayPrefix()
|
||||
list = list.filter((a) => a.status === 'done' && String(a.updateTime || '').startsWith(today))
|
||||
}
|
||||
if (keyword.value.trim()) {
|
||||
const q = keyword.value.trim()
|
||||
list = list.filter((a) =>
|
||||
@ -216,6 +231,8 @@ function reset() {
|
||||
dateRange.value = ''
|
||||
staffId.value = undefined
|
||||
missingReport.value = false
|
||||
overdueOnly.value = false
|
||||
completedTodayOnly.value = false
|
||||
load()
|
||||
}
|
||||
|
||||
@ -265,6 +282,10 @@ onMounted(async () => {
|
||||
}
|
||||
await loadStaff()
|
||||
await load()
|
||||
const focusId = Number(route.query.id)
|
||||
if (Number.isFinite(focusId) && focusId > 0) {
|
||||
await openDetail({ id: focusId })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,197 +1,631 @@
|
||||
<template>
|
||||
<div class="page-card">
|
||||
<h2 class="page-title">今日工作台</h2>
|
||||
<el-row :gutter="12" class="metrics">
|
||||
<el-col :span="6" v-for="card in cards" :key="card.key">
|
||||
<el-card shadow="hover" class="metric" @click="go(card.to)">
|
||||
<div class="metric-label">{{ card.label }}</div>
|
||||
<div class="metric-value">{{ card.value }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="page-card workbench">
|
||||
<header class="workbench-header">
|
||||
<div>
|
||||
<div class="eyebrow">TODAY · {{ dateLabel }}</div>
|
||||
<h2>今天先做什么</h2>
|
||||
<p>按影响履约的紧急程度排好顺序,处理完再看经营结果。</p>
|
||||
</div>
|
||||
<el-button :loading="loading" @click="load">刷新</el-button>
|
||||
</header>
|
||||
|
||||
<h3>今日待办</h3>
|
||||
<div class="todos">
|
||||
<el-tag
|
||||
v-for="t in todos"
|
||||
:key="t.key"
|
||||
class="todo"
|
||||
effect="plain"
|
||||
@click="go(t.to)"
|
||||
>{{ t.label }} {{ t.value }}</el-tag>
|
||||
</div>
|
||||
<el-alert
|
||||
v-if="errorMessage"
|
||||
class="load-error"
|
||||
type="error"
|
||||
:closable="false"
|
||||
:title="errorMessage"
|
||||
show-icon
|
||||
/>
|
||||
|
||||
<h3>报告漏斗</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6" v-for="f in funnel" :key="f.label">
|
||||
<div class="funnel-item">
|
||||
<div>{{ f.label }}</div>
|
||||
<strong>{{ f.value }}</strong>
|
||||
<section class="metrics" aria-label="今日概览">
|
||||
<button
|
||||
v-for="metric in metricCards"
|
||||
:key="metric.key"
|
||||
type="button"
|
||||
class="metric-card"
|
||||
@click="go(metric.to)"
|
||||
>
|
||||
<span>{{ metric.label }}</span>
|
||||
<strong>{{ metric.value }}</strong>
|
||||
<small>{{ metric.hint }}</small>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<section class="action-section">
|
||||
<div class="section-heading">
|
||||
<div>
|
||||
<span class="section-kicker">行动队列</span>
|
||||
<h3>先处理会卡住服务的事</h3>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span class="action-total">{{ totalActions }} 项待处理</span>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="todoDialog"
|
||||
title="今日待办"
|
||||
width="480px"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table :data="todos" size="small">
|
||||
<el-table-column prop="label" label="事项" />
|
||||
<el-table-column prop="value" label="数量" width="80" />
|
||||
<el-table-column label="" width="90">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="goFromDialog(row.to)">去处理</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-checkbox v-model="suppressToday">今日不再提醒</el-checkbox>
|
||||
<el-button type="primary" @click="closeTodoDialog">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div v-if="loading && !workbenchData" class="skeletons">
|
||||
<el-skeleton v-for="index in 3" :key="index" :rows="2" animated />
|
||||
</div>
|
||||
<el-empty
|
||||
v-else-if="actionGroups.length === 0"
|
||||
description="当前没有待处理事项,可以安心接待今天的顾客"
|
||||
/>
|
||||
<div v-else class="action-groups">
|
||||
<article
|
||||
v-for="group in actionGroups"
|
||||
:key="group.kind"
|
||||
class="action-group"
|
||||
:class="`urgency-${group.urgency}`"
|
||||
>
|
||||
<div class="action-group-head">
|
||||
<div class="action-copy">
|
||||
<span class="priority-dot" />
|
||||
<div>
|
||||
<div class="action-title-line">
|
||||
<h4>{{ groupMeta(group.kind).title }}</h4>
|
||||
<el-tag :type="tagType(group.urgency)" effect="light" round>
|
||||
{{ group.count }} 项
|
||||
</el-tag>
|
||||
</div>
|
||||
<p>{{ groupMeta(group.kind).description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" link @click="go(groupMeta(group.kind).to)">
|
||||
全部处理
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div class="action-items">
|
||||
<button
|
||||
v-for="item in group.items"
|
||||
:key="`${item.resourceType}-${item.resourceId}`"
|
||||
type="button"
|
||||
class="action-item"
|
||||
@click="goItem(group.kind, item)"
|
||||
>
|
||||
<span class="item-main">
|
||||
<strong>{{ item.petName || '未命名宠物' }}</strong>
|
||||
<span>{{ item.serviceType || '服务待确认' }}</span>
|
||||
</span>
|
||||
<span class="item-time">{{ formatSchedule(item.scheduledAt) }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="group.count > group.items.length" class="remaining">
|
||||
另有 {{ group.count - group.items.length }} 项,点击“全部处理”查看
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="funnel-section">
|
||||
<div class="section-heading compact">
|
||||
<div>
|
||||
<span class="section-kicker">服务结果</span>
|
||||
<h3>今天的报告走到哪一步</h3>
|
||||
</div>
|
||||
<span class="funnel-note">发送与再次预约将在下一阶段接入真实状态</span>
|
||||
</div>
|
||||
<div class="funnel-grid">
|
||||
<div v-for="step in funnelSteps" :key="step.label" class="funnel-step">
|
||||
<span>{{ step.label }}</span>
|
||||
<strong>{{ step.value }}</strong>
|
||||
<small>{{ step.hint }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { getAppointmentList, getLeads, getReportList, getWorkbenchReportFunnel } from '@/api'
|
||||
import { isHighlightProcessingStale } from '@/utils/publicLinks'
|
||||
import { getWorkbenchActions } from '@/api'
|
||||
|
||||
const SUPPRESS_KEY = 'petstore_admin_todo_suppress_date'
|
||||
type RouteTarget = { path: string; query?: Record<string, string | undefined> }
|
||||
|
||||
const router = useRouter()
|
||||
const todayAppt = ref(0)
|
||||
const todayDone = ref(0)
|
||||
const pendingLead = ref(0)
|
||||
const highlightFailed = ref(0)
|
||||
const pendingReport = ref(0)
|
||||
const todayReports = ref(0)
|
||||
const openedReports = ref(0)
|
||||
const todayLeads = ref(0)
|
||||
const rebookCount = ref<number | null>(null)
|
||||
const todoDialog = ref(false)
|
||||
const suppressToday = ref(false)
|
||||
|
||||
const today = new Date()
|
||||
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
|
||||
|
||||
function isSameDay(iso?: string | null) {
|
||||
if (!iso) return false
|
||||
return String(iso).startsWith(todayStr)
|
||||
type WorkbenchMetrics = {
|
||||
todayAppointmentCount: number
|
||||
todayDoneCount: number
|
||||
overdueAppointmentCount: number
|
||||
inServiceCount: number
|
||||
upcomingTodayCount: number
|
||||
highlightAnomalyCount: number
|
||||
dueFollowUpCount: number
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const [apptRes, reportRes, leadRes, funnelRes] = await Promise.all([
|
||||
getAppointmentList({ page: 1, pageSize: 200 }),
|
||||
getReportList({ page: 1, pageSize: 200 }),
|
||||
getLeads('pending'),
|
||||
getWorkbenchReportFunnel(todayStr),
|
||||
])
|
||||
const appts = Array.isArray(apptRes.data) ? apptRes.data as Array<Record<string, unknown>> : []
|
||||
const reports = Array.isArray(reportRes.data) ? reportRes.data as Array<Record<string, unknown>> : []
|
||||
const leads = Array.isArray(leadRes.data) ? leadRes.data as Array<Record<string, unknown>> : []
|
||||
type ActionItem = {
|
||||
resourceType: 'appointment' | 'report' | 'lead'
|
||||
resourceId: number
|
||||
petName?: string | null
|
||||
serviceType?: string | null
|
||||
scheduledAt?: string | null
|
||||
status?: string | null
|
||||
overdue: boolean
|
||||
}
|
||||
|
||||
todayAppt.value = appts.filter((a) => isSameDay(a.appointmentTime as string)).length
|
||||
todayDone.value = appts.filter((a) => a.status === 'done' && isSameDay((a.updateTime as string) || (a.appointmentTime as string))).length
|
||||
pendingReport.value = appts.filter((a) => a.status === 'doing' && a.hasReport !== true).length
|
||||
pendingLead.value = leads.filter((l) => {
|
||||
const d = l.remindDate as string | undefined
|
||||
return !d || d <= todayStr
|
||||
}).length
|
||||
const eventFunnel = (funnelRes.data || {}) as Record<string, unknown>
|
||||
todayReports.value = Number(eventFunnel.reportSubmittedCount || 0)
|
||||
openedReports.value = Number(eventFunnel.reportOpenedCount || 0)
|
||||
todayLeads.value = Number(eventFunnel.leadSubmittedCount || 0)
|
||||
rebookCount.value = eventFunnel.rebookTrackingReady === true
|
||||
? Number(eventFunnel.rebookCreatedCount || 0)
|
||||
: null
|
||||
highlightFailed.value = reports.filter(
|
||||
(r) =>
|
||||
r.highlightVideoStatus === 'failed' ||
|
||||
isHighlightProcessingStale(r.highlightVideoStatus as string, r.updateTime as string),
|
||||
).length
|
||||
type ActionGroup = {
|
||||
kind: string
|
||||
urgency: 'critical' | 'high' | 'normal'
|
||||
count: number
|
||||
items: ActionItem[]
|
||||
}
|
||||
|
||||
const suppressed = localStorage.getItem(SUPPRESS_KEY)
|
||||
if (suppressed !== todayStr) {
|
||||
todoDialog.value = true
|
||||
}
|
||||
type WorkbenchData = {
|
||||
date: string
|
||||
generatedAt: string
|
||||
metrics: WorkbenchMetrics
|
||||
actions: ActionGroup[]
|
||||
reportFunnel: Record<string, unknown>
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const errorMessage = ref('')
|
||||
const workbenchData = ref<WorkbenchData | null>(null)
|
||||
|
||||
const emptyMetrics: WorkbenchMetrics = {
|
||||
todayAppointmentCount: 0,
|
||||
todayDoneCount: 0,
|
||||
overdueAppointmentCount: 0,
|
||||
inServiceCount: 0,
|
||||
upcomingTodayCount: 0,
|
||||
highlightAnomalyCount: 0,
|
||||
dueFollowUpCount: 0,
|
||||
}
|
||||
|
||||
const metrics = computed(() => workbenchData.value?.metrics || emptyMetrics)
|
||||
const actionGroups = computed(() => workbenchData.value?.actions || [])
|
||||
const totalActions = computed(() => actionGroups.value.reduce((sum, group) => sum + Number(group.count || 0), 0))
|
||||
|
||||
const dateLabel = computed(() => {
|
||||
const raw = workbenchData.value?.date
|
||||
if (!raw) return '加载中'
|
||||
const date = new Date(`${raw}T00:00:00`)
|
||||
return `${date.getMonth() + 1}月${date.getDate()}日 · 周${'日一二三四五六'[date.getDay()]}`
|
||||
})
|
||||
|
||||
const cards = computed(() => [
|
||||
{ key: 'appt', label: '今日预约', value: todayAppt.value, to: { path: '/appointments', query: { date: 'today' } } },
|
||||
{ key: 'done', label: '今日完成', value: todayDone.value, to: { path: '/appointments', query: { status: 'done', date: 'today' } } },
|
||||
{ key: 'lead', label: '待回访', value: pendingLead.value, to: { path: '/leads', query: { due: 'today' } } },
|
||||
{ key: 'hl', label: '成片失败', value: highlightFailed.value, to: { path: '/reports', query: { highlightStatus: 'failed' } } },
|
||||
])
|
||||
const metricCards = computed(() => [
|
||||
{
|
||||
key: 'today',
|
||||
label: '今日预约',
|
||||
value: metrics.value.todayAppointmentCount,
|
||||
hint: `还有 ${metrics.value.upcomingTodayCount} 位待到店`,
|
||||
to: { path: '/appointments', query: { date: 'today' } },
|
||||
},
|
||||
{
|
||||
key: 'overdue',
|
||||
label: '逾期未开始',
|
||||
value: metrics.value.overdueAppointmentCount,
|
||||
hint: '优先确认到店或改约',
|
||||
to: { path: '/appointments', query: { status: 'new', overdue: '1' } },
|
||||
},
|
||||
{
|
||||
key: 'doing',
|
||||
label: '服务中',
|
||||
value: metrics.value.inServiceCount,
|
||||
hint: '完成报告才能闭环',
|
||||
to: { path: '/appointments', query: { status: 'doing', missingReport: '1' } },
|
||||
},
|
||||
{
|
||||
key: 'done',
|
||||
label: '今日完成',
|
||||
value: metrics.value.todayDoneCount,
|
||||
hint: '已形成完整服务记录',
|
||||
to: { path: '/appointments', query: { status: 'done', completedToday: '1' } },
|
||||
},
|
||||
] satisfies Array<{ key: string; label: string; value: number; hint: string; to: RouteTarget }>)
|
||||
|
||||
const todos = computed(() => [
|
||||
{ key: 'a', label: '今日预约', value: todayAppt.value, to: { path: '/appointments', query: { date: 'today' } } },
|
||||
{ key: 'r', label: '待出报告', value: pendingReport.value, to: { path: '/appointments', query: { status: 'doing', missingReport: '1' } } },
|
||||
{ key: 'h', label: '成片异常', value: highlightFailed.value, to: { path: '/reports', query: { highlightStatus: 'failed' } } },
|
||||
{ key: 'l', label: '待回访', value: pendingLead.value, to: { path: '/leads', query: { due: 'today' } } },
|
||||
])
|
||||
const groupDefinitions: Record<string, { title: string; description: string; to: RouteTarget }> = {
|
||||
overdue_appointment: {
|
||||
title: '预约已过时间',
|
||||
description: '先确认顾客是否到店;未到店就改约或取消,别让状态悬着。',
|
||||
to: { path: '/appointments', query: { status: 'new', overdue: '1' } },
|
||||
},
|
||||
in_service: {
|
||||
title: '服务中,等待收尾',
|
||||
description: '补齐服务前后照片与报告,提交后预约才会完成。',
|
||||
to: { path: '/appointments', query: { status: 'doing', missingReport: '1' } },
|
||||
},
|
||||
upcoming_today: {
|
||||
title: '今天接下来要到店',
|
||||
description: '提前看服务项目和时长,安排好工位与接待。',
|
||||
to: { path: '/appointments', query: { status: 'new', date: 'today' } },
|
||||
},
|
||||
highlight_anomaly: {
|
||||
title: '服务短片异常',
|
||||
description: '失败或处理超过 30 分钟,确认素材后再重试。',
|
||||
to: { path: '/reports', query: { highlightStatus: 'anomaly' } },
|
||||
},
|
||||
follow_up_due: {
|
||||
title: '回访日期已到',
|
||||
description: '只显示低敏摘要;进入回访池后再按权限查看联系信息。',
|
||||
to: { path: '/leads', query: { due: 'today' } },
|
||||
},
|
||||
}
|
||||
|
||||
const funnel = computed(() => [
|
||||
{ label: '今日已提交报告', value: todayReports.value },
|
||||
{ label: '已打开', value: openedReports.value },
|
||||
{ label: '已留资', value: todayLeads.value },
|
||||
{ label: '报告转预约', value: rebookCount.value ?? '—' },
|
||||
])
|
||||
function groupMeta(kind: string) {
|
||||
return groupDefinitions[kind] || {
|
||||
title: '其他待办',
|
||||
description: '进入对应列表继续处理。',
|
||||
to: { path: '/workbench' },
|
||||
}
|
||||
}
|
||||
|
||||
function go(to: { path: string; query?: Record<string, string | undefined> }) {
|
||||
const query: Record<string, string> = {}
|
||||
if (to.query) {
|
||||
for (const [k, v] of Object.entries(to.query)) {
|
||||
if (v != null) query[k] = v
|
||||
const funnelSteps = computed(() => {
|
||||
const funnel = workbenchData.value?.reportFunnel || {}
|
||||
const sentReady = funnel.reportSentTrackingReady === true
|
||||
const rebookReady = funnel.rebookTrackingReady === true
|
||||
return [
|
||||
{ label: '报告提交', value: Number(funnel.reportSubmittedCount || 0), hint: '服务已完成' },
|
||||
{ label: '确认发送', value: sentReady ? Number(funnel.reportSentCount || 0) : '—', hint: sentReady ? '门店已发送' : '状态待接入' },
|
||||
{ label: '宠主打开', value: Number(funnel.reportOpenedCount || 0), hint: '按报告去重' },
|
||||
{ label: '留下提醒', value: Number(funnel.leadSubmittedCount || 0), hint: '按线索去重' },
|
||||
{ label: '再次预约', value: rebookReady ? Number(funnel.rebookCreatedCount || 0) : '—', hint: rebookReady ? '已归因' : '归因待接入' },
|
||||
]
|
||||
})
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
errorMessage.value = ''
|
||||
try {
|
||||
const response = await getWorkbenchActions()
|
||||
if (response.code !== 200 || !response.data) {
|
||||
errorMessage.value = response.message || '工作台加载失败,请稍后重试'
|
||||
return
|
||||
}
|
||||
workbenchData.value = response.data as WorkbenchData
|
||||
} catch {
|
||||
errorMessage.value = '工作台加载失败,请检查网络后重试'
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function go(to: RouteTarget) {
|
||||
const query: Record<string, string> = {}
|
||||
for (const [key, value] of Object.entries(to.query || {})) {
|
||||
if (value != null) query[key] = value
|
||||
}
|
||||
router.push({ path: to.path, query })
|
||||
}
|
||||
|
||||
function goFromDialog(to: { path: string; query?: Record<string, string | undefined> }) {
|
||||
closeTodoDialog()
|
||||
go(to)
|
||||
function goItem(kind: string, item: ActionItem) {
|
||||
if (item.resourceType === 'appointment') {
|
||||
go({ path: '/appointments', query: { id: String(item.resourceId) } })
|
||||
return
|
||||
}
|
||||
if (item.resourceType === 'report') {
|
||||
go({ path: '/reports', query: { q: String(item.resourceId), highlightStatus: 'anomaly' } })
|
||||
return
|
||||
}
|
||||
go(groupMeta(kind).to)
|
||||
}
|
||||
|
||||
function closeTodoDialog() {
|
||||
if (suppressToday.value) {
|
||||
localStorage.setItem(SUPPRESS_KEY, todayStr)
|
||||
function formatSchedule(value?: string | null) {
|
||||
if (!value) return '日期待确认'
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
||||
return `${Number(value.slice(5, 7))}月${Number(value.slice(8, 10))}日`
|
||||
}
|
||||
todoDialog.value = false
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
const isToday = workbenchData.value?.date === value.slice(0, 10)
|
||||
const time = `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
||||
return isToday ? `今天 ${time}` : `${date.getMonth() + 1}月${date.getDate()}日 ${time}`
|
||||
}
|
||||
|
||||
function tagType(urgency: ActionGroup['urgency']) {
|
||||
if (urgency === 'critical') return 'danger'
|
||||
if (urgency === 'high') return 'warning'
|
||||
return 'info'
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.workbench {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.workbench-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 26px 28px 24px;
|
||||
color: #fff;
|
||||
background:
|
||||
radial-gradient(circle at 82% 12%, rgb(255 255 255 / 18%), transparent 28%),
|
||||
linear-gradient(135deg, #2457b8 0%, var(--admin-accent) 58%, #4f8cff 100%);
|
||||
}
|
||||
|
||||
.eyebrow,
|
||||
.section-kicker {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.12em;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
color: rgb(255 255 255 / 72%);
|
||||
}
|
||||
|
||||
.workbench-header h2 {
|
||||
margin: 8px 0 6px;
|
||||
font-size: 28px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.workbench-header p {
|
||||
margin: 0;
|
||||
color: rgb(255 255 255 / 78%);
|
||||
}
|
||||
|
||||
.workbench-header :deep(.el-button) {
|
||||
color: #fff;
|
||||
border-color: rgb(255 255 255 / 42%);
|
||||
background: rgb(255 255 255 / 12%);
|
||||
}
|
||||
|
||||
.load-error {
|
||||
margin: 16px 20px 0;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
margin-bottom: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
padding: 18px 20px 0;
|
||||
}
|
||||
.metric {
|
||||
|
||||
.metric-card {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
min-height: 120px;
|
||||
padding: 17px;
|
||||
text-align: left;
|
||||
color: #1f2a37;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border: 1px solid #e5eaf1;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 24px rgb(31 42 55 / 5%);
|
||||
transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
|
||||
}
|
||||
.metric-label {
|
||||
color: #7a8494;
|
||||
|
||||
.metric-card:hover {
|
||||
border-color: #b7caef;
|
||||
box-shadow: 0 12px 30px rgb(47 111 237 / 10%);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.metric-card span {
|
||||
color: #657184;
|
||||
font-size: 13px;
|
||||
}
|
||||
.metric-value {
|
||||
margin-top: 8px;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
|
||||
.metric-card strong {
|
||||
font-size: 30px;
|
||||
line-height: 1;
|
||||
}
|
||||
.todos {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
|
||||
.metric-card small {
|
||||
color: #8a94a6;
|
||||
}
|
||||
|
||||
.action-section,
|
||||
.funnel-section {
|
||||
margin: 16px 20px 0;
|
||||
padding: 22px;
|
||||
background: #fff;
|
||||
border: 1px solid #e8edf3;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.funnel-section {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.todo {
|
||||
cursor: pointer;
|
||||
|
||||
.section-heading {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.funnel-item {
|
||||
background: #f7f9fc;
|
||||
|
||||
.section-heading.compact {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-kicker {
|
||||
color: var(--admin-accent);
|
||||
}
|
||||
|
||||
.section-heading h3 {
|
||||
margin: 5px 0 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.action-total,
|
||||
.funnel-note {
|
||||
color: #7a8494;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.action-groups {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.action-group {
|
||||
position: relative;
|
||||
padding: 16px 16px 14px 18px;
|
||||
overflow: hidden;
|
||||
background: #fbfcfe;
|
||||
border: 1px solid #e8edf3;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.action-group::before {
|
||||
position: absolute;
|
||||
inset: 0 auto 0 0;
|
||||
width: 3px;
|
||||
content: '';
|
||||
background: #9aa4b2;
|
||||
}
|
||||
|
||||
.action-group.urgency-critical::before { background: #d64545; }
|
||||
.action-group.urgency-high::before { background: #d38a20; }
|
||||
.action-group.urgency-normal::before { background: var(--admin-accent); }
|
||||
|
||||
.action-group-head,
|
||||
.action-copy,
|
||||
.action-title-line,
|
||||
.item-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.action-group-head {
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.action-copy {
|
||||
align-items: flex-start;
|
||||
gap: 11px;
|
||||
}
|
||||
|
||||
.priority-dot {
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
margin-top: 6px;
|
||||
background: #9aa4b2;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.urgency-critical .priority-dot { background: #d64545; }
|
||||
.urgency-high .priority-dot { background: #d38a20; }
|
||||
.urgency-normal .priority-dot { background: var(--admin-accent); }
|
||||
|
||||
.action-title-line {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.action-title-line h4 {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.action-copy p {
|
||||
margin: 5px 0 0;
|
||||
color: #6d7888;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.action-items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.action-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 10px 12px;
|
||||
text-align: left;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border: 1px solid #e7ebf1;
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.action-item:hover {
|
||||
color: var(--admin-accent);
|
||||
border-color: #b7caef;
|
||||
}
|
||||
|
||||
.item-main {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-main strong,
|
||||
.item-main span {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.item-main span,
|
||||
.item-time,
|
||||
.remaining {
|
||||
color: #7a8494;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.remaining {
|
||||
margin: 10px 0 0 20px;
|
||||
}
|
||||
|
||||
.funnel-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 1px;
|
||||
overflow: hidden;
|
||||
background: #e7ebf1;
|
||||
border: 1px solid #e7ebf1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.funnel-step {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
min-height: 100px;
|
||||
padding: 14px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.funnel-step span,
|
||||
.funnel-step small {
|
||||
color: #718096;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.funnel-step strong {
|
||||
font-size: 23px;
|
||||
}
|
||||
|
||||
.skeletons {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 1080px) {
|
||||
.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.action-items { grid-template-columns: 1fr; }
|
||||
.funnel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.workbench-header,
|
||||
.section-heading,
|
||||
.action-group-head {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
.metrics { grid-template-columns: 1fr; }
|
||||
.funnel-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user