fix(admin): 移除一诊患者和挂号统计的固定装饰绿

This commit is contained in:
2026-12-02 10:57:16 +08:00
parent 6d72d6abe7
commit e73e8b1b18
6 changed files with 231 additions and 12 deletions
@@ -717,4 +717,14 @@ onMounted(getLists)
}
}
}
:root[data-admin-ui='v2'] .embedded-panel {
.scope-chip { color: var(--zyt-text); }
.status-filter-row :deep(.el-radio-button.is-active .el-radio-button__inner) {
color: var(--zyt-feedback-ink);
background: var(--zyt-accent-soft);
border-color: var(--zyt-primary);
font-weight: 600;
}
}
</style>
@@ -574,4 +574,24 @@ onUnmounted(() => {
:deep(.el-radio) {
margin-right: 0;
}
:root[data-admin-ui='v2'] .paiban-container .time-slot-item {
&.available:not(.selected):hover, &.selected {
border-color: var(--zyt-primary);
background: var(--zyt-accent-soft);
box-shadow: none;
.slot-time { color: var(--zyt-feedback-ink); }
}
&.selected {
box-shadow: inset 0 -3px 0 var(--zyt-primary);
.slot-status {
background: var(--zyt-surface);
color: var(--zyt-text);
}
.status-available {
background: var(--el-color-success-light-9);
color: color-mix(in srgb, var(--el-color-success) 30%, var(--zyt-ink));
}
}
}
</style>
@@ -1025,4 +1025,41 @@ onUnmounted(() => {
text-align: left;
}
}
:root[data-admin-ui='v2'] .progress-board {
.board-section {
background: var(--zyt-surface);
border-color: var(--zyt-card-border);
}
.heading-copy h2, .remaining-detail-heading h3 { color: var(--zyt-ink); }
.remaining-detail {
background: var(--zyt-surface-subtle);
border-color: var(--zyt-card-border);
}
.scope-chip, .remaining-detail-heading span { color: var(--zyt-text); }
.doctor-index, .queue-number {
color: var(--zyt-text);
background: var(--zyt-surface-subtle);
}
.schedule-card {
background: var(--zyt-surface);
border-color: var(--zyt-card-border);
> strong { color: var(--zyt-ink); }
&:hover, &.is-today {
border-color: var(--zyt-accent-border);
background: var(--zyt-accent-soft);
}
&:focus-visible { outline-color: var(--zyt-primary); }
&.is-selected {
border-color: var(--zyt-primary);
background: var(--zyt-accent-soft);
box-shadow: inset 0 -3px 0 var(--zyt-primary);
}
}
.schedule-date, .schedule-card-action { color: var(--zyt-text); }
.schedule-card-action {
border-color: var(--zyt-card-border);
span:last-child { color: var(--zyt-feedback-ink); }
}
}
</style>
@@ -1175,4 +1175,35 @@ onMounted(() => {
flex-wrap: wrap;
}
}
:root[data-admin-ui='v2'] .my-patients-page {
background: var(--zyt-canvas);
color: var(--zyt-ink);
.page-heading .eyebrow { color: var(--zyt-feedback-ink); }
.page-heading p { color: var(--zyt-text); }
.heading-actions :deep(.el-tag) {
color: var(--zyt-text);
background: var(--zyt-surface-subtle);
border-color: var(--zyt-card-border);
}
.workspace-tabs :deep(.el-tabs__header) {
background: var(--zyt-surface-subtle);
border-color: var(--zyt-card-border);
}
.workspace-tabs :deep(.el-tabs__active-bar) { background: var(--zyt-primary); }
.summary-card {
color: var(--zyt-ink);
background: var(--zyt-surface);
border-color: var(--zyt-card-border);
&:hover { border-color: var(--zyt-primary); box-shadow: none; }
&:focus-visible { outline: 2px solid var(--zyt-primary); outline-offset: 2px; }
}
.summary-copy small, .summary-copy em, .summary-date { color: var(--zyt-text); }
.summary-card .summary-icon, .patient-avatar {
color: var(--zyt-feedback-ink);
background: var(--zyt-accent-soft);
}
}
</style>
@@ -1,6 +1,7 @@
<template>
<div
class="registration-stats"
:style="pageColors"
v-loading="loading"
element-loading-text="正在汇总权限范围内的挂号与预约数据"
>
@@ -176,7 +177,7 @@
:percentage="progressValue(dashboard.target.completion_rate)"
:show-text="false"
:stroke-width="13"
color="#139a8c"
:color="palette?.accentText ?? '#139a8c'"
/>
<p v-if="Number(dashboard.target.target_amount) > 0">
尚差 {{ formatMoney(Math.max(0, Number(dashboard.target.target_amount) - Number(dashboard.target.actual_amount))) }} 达成年度目标
@@ -293,6 +294,7 @@ import {
Wallet
} from '@element-plus/icons-vue'
import vCharts from 'vue-echarts'
import { useStatsChartPalette } from '@/hooks/useStatsChartPalette'
import {
firstVisitRegistrationStatsOverview,
type FirstVisitRegistrationStatsParams
@@ -334,39 +336,57 @@ const deptTreeProps = { label: 'name', value: 'id', children: 'children' }
const maxPerformance = computed(() => rankMax(dashboard.rankings.performance))
const maxRegistrations = computed(() => rankMax(dashboard.rankings.registrations))
const maxAppointments = computed(() => rankMax(dashboard.rankings.appointments))
const palette = useStatsChartPalette()
const pageColors = computed(() => palette.value ? {
'--registration-accent-text': palette.value.accentText,
'--registration-series': palette.value.accentInk,
'--registration-detail': palette.value.muted
} : undefined)
const targetChartOption = computed(() => ({
animationDuration: 450,
grid: { left: 18, right: 18, top: 18, bottom: 12, containLabel: true },
tooltip: {
trigger: 'axis',
valueFormatter: (value: number) => formatMoney(value)
valueFormatter: (value: number) => formatMoney(value),
...(palette.value && {
backgroundColor: palette.value.surface,
borderColor: palette.value.border,
textStyle: { color: palette.value.ink },
axisPointer: { lineStyle: { color: palette.value.muted, type: 'dashed' } },
confine: true
})
},
xAxis: {
type: 'category',
boundaryGap: false,
data: dashboard.target.months,
axisLine: { lineStyle: { color: '#d9e1e8' } },
axisLine: { lineStyle: { color: palette.value?.border ?? '#d9e1e8' } },
axisTick: { show: false },
axisLabel: { color: '#7d8b9c', fontSize: 11 }
axisLabel: { color: palette.value?.muted ?? '#7d8b9c', fontSize: 11 }
},
yAxis: {
type: 'value',
splitNumber: 3,
axisLabel: { color: '#8b98a8', formatter: (value: number) => compactMoney(value) },
splitLine: { lineStyle: { color: '#eef2f5' } }
axisLabel: { color: palette.value?.muted ?? '#8b98a8', formatter: (value: number) => compactMoney(value) },
splitLine: { lineStyle: { color: palette.value?.grid ?? '#eef2f5' } }
},
series: [
{
name: '累计完成', type: 'line', smooth: true, symbol: 'circle', symbolSize: 5,
data: dashboard.target.actual_cumulative,
lineStyle: { color: '#139a8c', width: 3 },
itemStyle: { color: '#ffffff', borderColor: '#139a8c', borderWidth: 2 },
areaStyle: { color: 'rgba(19,154,140,.08)' }
lineStyle: { color: palette.value?.accentInk ?? '#139a8c', width: 3 },
itemStyle: {
color: palette.value?.accentInk ?? '#ffffff',
borderColor: palette.value?.surface ?? '#139a8c',
borderWidth: 2
},
areaStyle: palette.value ? { color: palette.value.accentInk, opacity: .10 } : { color: 'rgba(19,154,140,.08)' }
},
{
name: '累计目标', type: 'line', smooth: true, showSymbol: false,
data: dashboard.target.target_cumulative,
lineStyle: { color: '#5f86e8', width: 2, type: 'dashed' }
lineStyle: { color: palette.value?.muted ?? '#5f86e8', width: 2, type: 'dashed' },
...(palette.value && { itemStyle: { color: palette.value.muted } })
}
]
}))
@@ -653,4 +673,68 @@ h2 { font-size: 15px; line-height: 1.4; }
.filter-item--time { justify-content: flex-start; }
.target-numbers { grid-template-columns: 1fr; }
}
:root[data-admin-ui='v2'] .registration-stats {
--ink: var(--zyt-ink);
--muted: var(--registration-detail, var(--zyt-text));
--line: var(--zyt-card-border);
--canvas: var(--zyt-canvas);
--reg-accent: var(--registration-accent-text, var(--zyt-primary));
--reg-positive: #15704b;
--reg-negative: #b33643;
--reg-warning: #87540e;
padding: 0;
.page-heading, .filter-strip, .panel, .metric-card { background: var(--zyt-surface); }
.heading-mark, .metric-icon {
color: var(--reg-accent);
background: var(--zyt-accent-soft);
box-shadow: none;
}
.scope-chip, .panel-badge, .name-cell :deep(.el-avatar), .ranking-row > b {
color: var(--zyt-text);
border-color: var(--line);
background: var(--zyt-surface-subtle);
}
.ranking-row > b.is-top {
color: var(--ink);
background: var(--zyt-surface-subtle);
box-shadow: inset 0 0 0 1px var(--line);
}
.filter-item, .metric-card span { color: var(--zyt-text); }
.metric-card small, .name-cell em, .rate-text.is-neutral, .ranking-row small,
.chart-legend, .data-note { color: var(--muted); }
.status-pill, .rate-text.is-up, .metric-card small.is-up { color: var(--reg-positive); }
.status-pill i { background: currentColor; }
.rate-text.is-down, .metric-card small.is-down { color: var(--reg-negative); }
.target-summary .target-empty { color: var(--reg-warning); }
.target-numbers .is-teal { color: var(--reg-accent); }
.dept-dot, .rank-track i { background: var(--reg-accent); }
.rank-track, :deep(.el-progress-bar__outer) { background: var(--art-gray-300); }
.chart-legend .actual { background: var(--registration-series, var(--zyt-primary)); }
.chart-legend .target { background: repeating-linear-gradient(90deg, var(--muted) 0 5px, transparent 5px 8px); }
.target-layout, .target-summary, .ranking-row, .department-table { border-color: var(--line); }
:deep(.el-segmented) {
--el-segmented-item-selected-bg-color: var(--zyt-accent-soft);
--el-segmented-item-selected-color: var(--zyt-ink);
}
.stats-table {
--el-table-header-bg-color: var(--zyt-surface-subtle);
--el-table-tr-bg-color: var(--zyt-surface);
--el-table-text-color: var(--zyt-text);
--el-table-row-hover-bg-color: var(--zyt-hover);
--el-table-border-color: var(--zyt-border);
}
.stats-table :deep(th.el-table__cell) { color: var(--ink); }
.stats-table :deep(.el-table__row--level-0) {
--el-table-tr-bg-color: var(--zyt-surface-subtle);
background: var(--el-table-tr-bg-color);
}
}
:root.dark[data-admin-ui='v2'] .registration-stats {
--reg-positive: #80dcb1;
--reg-negative: #ffa4aa;
--reg-warning: #edc68b;
}
</style>
@@ -15,15 +15,18 @@ const { outputText } = ts.transpileModule(content, { compilerOptions: { module:
const groups = ['performance', 'registrations', 'appointments']
// Render the real page, replacing its HTTP response and running the mount fetch before SSR.
async function rankings(samples) {
async function renderStats(samples, palette = null) {
const rankings = Object.fromEntries(groups.map((key, i) => [key, samples[i].map((value, j) =>
({ admin_id: j + 1, name: '员工' + j, count: 1, value }))]))
const stub = { render: () => null }
let chartOption
const chart = { props: ['option'], render() { chartOption = this.option; return null } }
const imports = {
vue: { ...vue, onMounted: vue.onServerPrefetch },
'@/api/first_visit': { firstVisitRegistrationStatsOverview: async () => ({ rankings }) },
'@/hooks/useStatsChartPalette': { useStatsChartPalette: () => vue.shallowRef(palette) },
'@element-plus/icons-vue': new Proxy({}, { get: () => stub }),
'element-plus': {}, 'vue-echarts': { default: stub }
'element-plus': {}, 'vue-echarts': { default: chart }
}
const mod = { exports: {} }
new Function('require', 'module', 'exports', outputText)(id => imports[id] || require(id), mod, mod.exports)
@@ -34,12 +37,46 @@ async function rankings(samples) {
}
app.directive('loading', {})
const html = await renderToString(app)
return { html, chartOption }
}
async function rankings(samples) {
const { html } = await renderStats(samples)
const panels = [...html.matchAll(/<article class="panel ranking-panel"[^>]*>([\s\S]*?)<\/article>/g)]
assert.equal(panels.length, 3)
return panels.map(([, panel]) => [...panel.matchAll(/<div class="ranking-row"[^>]*><b[^>]*>(\d+)<\/b>.*?<i style="width:([^;"]+);?"[^>]*><\/i><\/div><strong[^>]*>([^<]+)<\/strong>/gs)]
.map(([, rank, width, label]) => ({ rank: Number(rank), width, label })))
}
test('target chart and external legend share the selected primary and a separate dashed comparison', async () => {
const theme = {
surface: '#161618', ink: '#eeeeef', muted: '#b2b2c5', accentInk: '#b395ff',
accentText: '#bda9f9', border: '#394055', grid: '#252530'
}
const { html, chartOption } = await renderStats([[], [], []], theme)
const [actual, target] = chartOption.series
assert.equal(actual.lineStyle.color, theme.accentInk)
assert.equal(actual.itemStyle.color, theme.accentInk)
assert.equal(actual.areaStyle.color, theme.accentInk)
assert.equal(target.lineStyle.color, theme.muted)
assert.equal(target.lineStyle.type, 'dashed')
assert.equal(target.itemStyle.color, theme.muted)
assert.ok(html.includes('--registration-series:' + theme.accentInk))
assert.ok(html.includes('--registration-detail:' + theme.muted))
assert.equal(chartOption.tooltip.backgroundColor, theme.surface)
assert.equal(chartOption.xAxis.axisLabel.color, theme.muted)
assert.equal(chartOption.yAxis.splitLine.lineStyle.color, theme.grid)
})
test('classic target chart keeps both original line colors and original tooltip defaults', async () => {
const { html, chartOption } = await renderStats([[], [], []])
assert.equal(chartOption.series[0].lineStyle.color, '#139a8c')
assert.equal(chartOption.series[1].lineStyle.color, '#5f86e8')
assert.equal(chartOption.series[0].itemStyle.color, '#ffffff')
assert.equal(chartOption.tooltip.backgroundColor, undefined)
assert.ok(!html.includes('--registration-series:'))
})
const cases = [
[[2, 1, 0], ['100%', '50%', '0%']],
[[100, 1, 0], ['100%', '1%', '0%']],