优化:取消内部缩放并统一图表和冻结位置
This commit is contained in:
@@ -55,11 +55,10 @@ import { downloadMetricWorkbook } from './metricWorkbook';
|
||||
echarts.use([BarChart, LineChart, GraphicComponent, GridComponent, LegendComponent, MarkLineComponent, TooltipComponent, SVGRenderer]);
|
||||
|
||||
const MONTHS = Array.from({ length: 12 }, (_, index) => `${String(index + 1).padStart(2, '0')}月`);
|
||||
// 图表为保持坐标交互准确使用局部 zoom,字体需抵消该缩放以匹配页面正文。
|
||||
// 图表直接沿用页面字号,不再补偿内部缩放。
|
||||
function queryChartTypography(node: HTMLElement) {
|
||||
const css = getComputedStyle(node);
|
||||
const zoom = Number.parseFloat(css.zoom) || 1;
|
||||
const size = (token: string, fallback: number) => Math.round((Number.parseFloat(css.getPropertyValue(token)) || fallback) / zoom * 10) / 10;
|
||||
const size = (token: string, fallback: number) => Math.round((Number.parseFloat(css.getPropertyValue(token)) || fallback) * 10) / 10;
|
||||
return {
|
||||
fontFamily: css.getPropertyValue('--font-ui').trim() || css.fontFamily,
|
||||
numericFamily: css.getPropertyValue('--font-numeric').trim() || css.fontFamily,
|
||||
|
||||
+15
-15
@@ -15,15 +15,15 @@
|
||||
--sidebar-surface: #f8fafd;
|
||||
--sidebar: 202px;
|
||||
--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
--ui-scale: .8;
|
||||
--viewport-height: calc(100vh / var(--ui-scale));
|
||||
--dynamic-viewport-height: calc(100dvh / var(--ui-scale));
|
||||
--small-viewport-height: calc(100svh / var(--ui-scale));
|
||||
--viewport-height: 100vh;
|
||||
--dynamic-viewport-height: 100dvh;
|
||||
--small-viewport-height: 100svh;
|
||||
--topbar-height: 53px;
|
||||
--workspace-sticky-top: var(--topbar-height);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html { zoom: var(--ui-scale); }
|
||||
@media (max-width: 760px) { :root { --ui-scale: 1; } }
|
||||
@media (max-width: 760px) { :root { --topbar-height: 40px; } }
|
||||
html, body, #root { min-width: 320px; min-height: 100%; margin: 0; }
|
||||
body { color: var(--ink); background: #f4f6fb; font-size: var(--font-body); }
|
||||
button, input, textarea, select { font: inherit; }
|
||||
@@ -69,7 +69,7 @@ button { color: inherit; }
|
||||
.sidebar-collapsed .user-profile-trigger { flex: 0; }
|
||||
}
|
||||
@media (max-width: 760px) { .sidebar-toggle.ant-btn { display: none; } }
|
||||
.topbar { position: sticky; top: 0; z-index: 40; display: flex; height: 44px; align-items: center; justify-content: space-between; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
|
||||
.topbar { position: sticky; top: 0; z-index: 40; display: flex; height: var(--topbar-height); align-items: center; justify-content: space-between; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
|
||||
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: var(--font-control); }
|
||||
.breadcrumb strong { font-weight: 650; }
|
||||
.breadcrumb-slash { color: #63738a; }
|
||||
@@ -78,7 +78,7 @@ button { color: inherit; }
|
||||
.page-content { width: 100%; min-width: 0; margin: 0; padding: 15px 20px 20px; }
|
||||
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--panel-radius, 5px) !important; }
|
||||
.query-page { display: flex; min-width: 0; flex-direction: column; gap: 11px; overflow-anchor: none; }
|
||||
.query-toolbar { position: sticky; top: 53px; z-index: 35; display: flex; min-height: 48px; flex-wrap: wrap; align-items: center; gap: 10px 13px; padding: 7px 11px; }
|
||||
.query-toolbar { position: sticky; top: var(--workspace-sticky-top); z-index: 35; display: flex; min-height: 48px; flex-wrap: wrap; align-items: center; gap: 10px 13px; padding: 7px 11px; }
|
||||
.query-toolbar::before { content: ''; position: absolute; right: -20px; bottom: 100%; left: -20px; height: 18px; background: var(--background); pointer-events: none; }
|
||||
.query-field { display: inline-flex; min-width: 0; align-items: center; gap: 7px; }
|
||||
.query-field > span { flex: 0 0 auto; white-space: nowrap; font-size: var(--font-control); }
|
||||
@@ -155,8 +155,8 @@ button { color: inherit; }
|
||||
.trend-object .ant-select { width: min(420px, 100%); }
|
||||
.chart-viewport { width: 100%; overflow-x: auto; }
|
||||
.chart-surface { position: relative; width: 100%; min-width: 0; }
|
||||
/* Keep SVG chart coordinates aligned with pointer events under the app's global UI zoom. */
|
||||
.chart-container { width: 100%; height: calc(380px * var(--ui-scale)); min-width: 0; zoom: calc(1 / var(--ui-scale)); }
|
||||
/* 图表与页面使用同一坐标尺寸,保持 SVG 和鼠标位置一致。 */
|
||||
.chart-container { width: 100%; height: 380px; min-width: 0; }
|
||||
.chart-footnote { display: flex; justify-content: space-between; gap: 12px; padding: 0 13px 10px; font-size: var(--font-note); }
|
||||
.defects-panel { min-height: 120px; }
|
||||
.defect-stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
|
||||
@@ -164,7 +164,7 @@ button { color: inherit; }
|
||||
.defect-pareto-heading { display: flex; min-height: 38px; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; padding: 8px 1px 0; }
|
||||
.defect-pareto-heading strong { font-size: var(--font-body); font-weight: 650; }
|
||||
.defect-pareto-heading span { color: var(--ink); font-size: var(--font-note); }
|
||||
.defect-pareto-chart { width: 100%; height: calc(470px * var(--ui-scale)); min-width: 0; zoom: calc(1 / var(--ui-scale)); }
|
||||
.defect-pareto-chart { width: 100%; height: 470px; min-width: 0; }
|
||||
.defect-pareto-status { display: flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; font-size: var(--font-control); }
|
||||
.defect-stage-column { min-width: 0; padding: 0 12px 10px; }
|
||||
.defect-stage-column + .defect-stage-column { border-left: 1px solid var(--line); }
|
||||
@@ -374,7 +374,7 @@ button { color: inherit; }
|
||||
:root { --sidebar: 0px; }
|
||||
.sidebar { display: none; }
|
||||
.main-column { margin-left: 0; }
|
||||
.topbar { height: 40px; padding: 0 12px; }
|
||||
.topbar { padding: 0 12px; }
|
||||
.top-organization { display: none; }
|
||||
.mobile-brand { display: flex; min-height: 44px; align-items: center; gap: 7px; padding: 4px 10px; background: #f8f9fc; border-bottom: 1px solid var(--line); font-size: var(--font-section); }
|
||||
.mobile-brand > strong { white-space: nowrap; }
|
||||
@@ -478,7 +478,7 @@ body { background: var(--background); }
|
||||
.nav-item:hover { background: var(--hover); }
|
||||
.nav-item.active { color: var(--blue-dark); background: var(--blue-soft); }
|
||||
.nav-item.active .anticon { color: var(--blue); }
|
||||
.topbar { height: 53px; padding: 0 20px; }
|
||||
.topbar { height: var(--topbar-height); padding: 0 20px; }
|
||||
.topbar-actions { display: flex; align-items: center; gap: 8px; }
|
||||
.topbar-search.ant-btn {
|
||||
display: inline-flex;
|
||||
@@ -559,7 +559,7 @@ body { background: var(--background); }
|
||||
.query-toolbar::before { right: -15px; left: -15px; height: 16px; }
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.topbar { height: 40px; padding: 0 12px; }
|
||||
.topbar { padding: 0 12px; }
|
||||
.topbar-actions { gap: 2px; }
|
||||
.topbar-search.ant-btn { width: 30px; justify-content: center; padding: 0; }
|
||||
.topbar-search > span:not(.anticon), .topbar-search kbd { display: none; }
|
||||
@@ -568,7 +568,7 @@ body { background: var(--background); }
|
||||
.top-organization { display: none; }
|
||||
.mobile-brand { background: var(--sidebar-surface); }
|
||||
.page-content { padding: 11px 10px 18px; }
|
||||
.query-toolbar { top: 40px; }
|
||||
.query-toolbar { top: var(--workspace-sticky-top); }
|
||||
.query-toolbar::before { right: -10px; left: -10px; height: 12px; }
|
||||
.navigation-search-modal { max-width: calc(100vw - 24px); }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
body, button, input, textarea, select { font-family: var(--font-ui); }
|
||||
|
||||
/* 查询区在既有缩放下保留可读正文,避免指标与明细的字号反差过大。 */
|
||||
/* 查询区保留统一的可读正文,避免指标与明细的字号反差过大。 */
|
||||
.query-page {
|
||||
--font-control: 13px;
|
||||
--font-table: 13px;
|
||||
|
||||
@@ -106,19 +106,19 @@ body, .app-shell, .main-column { color: var(--ink); background: var(--background
|
||||
.mapping-issue-filters .ant-select { min-width: 180px; flex: 0 1 240px; }
|
||||
|
||||
/* Retained maintenance sections share a compact, sticky navigation bar. */
|
||||
.management-sections > .ant-tabs-nav { position: sticky; top: 53px; z-index: 34; margin: 0 0 12px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); }
|
||||
.management-sections > .ant-tabs-nav { position: sticky; top: var(--workspace-sticky-top); z-index: 34; margin: 0 0 12px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); }
|
||||
.management-sections > .ant-tabs-body-holder > .ant-tabs-body > .ant-tabs-content { padding: 12px; background: var(--surface); border: 1px solid var(--line); }
|
||||
.management-sections .management-page { gap: 10px; }
|
||||
.management-module-actions { display: flex; justify-content: flex-end; margin: 0; padding: 0 0 6px; }
|
||||
.management-module-actions .page-heading-actions { margin: 0; }
|
||||
.management-sections .nc-simple-config-tabs > .ant-tabs-nav { position: sticky; top: 100px; z-index: 33; background: var(--surface); }
|
||||
@media (max-width: 760px) { .management-sections > .ant-tabs-nav { top: 40px; } .management-sections .nc-simple-config-tabs > .ant-tabs-nav { top: 87px; } }
|
||||
.management-sections .nc-simple-config-tabs > .ant-tabs-nav { position: sticky; top: calc(var(--workspace-sticky-top) + 47px); z-index: 33; background: var(--surface); }
|
||||
|
||||
|
||||
.management-sections > .ant-tabs-body-holder, .management-sections > .ant-tabs-body-holder > .ant-tabs-body { overflow: visible; }
|
||||
.management-sections { overflow: visible; }
|
||||
.management-sections .management-sections > .ant-tabs-nav { top: 100px; z-index: 33; }
|
||||
.management-sections .management-sections .management-sections > .ant-tabs-nav { top: 147px; z-index: 32; }
|
||||
@media (max-width: 760px) { .management-sections .management-sections > .ant-tabs-nav { top: 87px; } .management-sections .management-sections .management-sections > .ant-tabs-nav { top: 134px; } }
|
||||
.management-sections .management-sections > .ant-tabs-nav { top: calc(var(--workspace-sticky-top) + 47px); z-index: 33; }
|
||||
.management-sections .management-sections .management-sections > .ant-tabs-nav { top: calc(var(--workspace-sticky-top) + 94px); z-index: 32; }
|
||||
|
||||
/* A clipping panel becomes a false scroll ancestor for sticky tab navigation. */
|
||||
.management-sections .panel:has(.ant-tabs-nav) { overflow: visible; }
|
||||
.management-sections .resource-toolbar > .completion-actions { margin-left: auto; }
|
||||
|
||||
Reference in New Issue
Block a user