dsh-data-dashboard 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/public/admin.css +28 -0
- package/backend/public/admin.js +61 -2
- package/backend/public/board.css +30 -3
- package/backend/public/board.html +12 -9
- package/backend/public/board.js +70 -13
- package/backend/public/index.html +3 -0
- package/backend/public/org-mapping.js +49 -0
- package/backend/real-data/generate-dashboard.mjs +2 -0
- package/backend/real-data/organization-mapping.mjs +119 -55
- package/backend/real-data/v10-components.mjs +1 -1
- package/backend/real-data/v10-model.mjs +48 -1
- package/backend/real-data/v10-overview-data.mjs +7 -2
- package/backend/real-data/v10-overview.css +139 -33
- package/backend/real-data/v10-overview.mjs +100 -23
- package/backend/real-data/v10-presentation.mjs +12 -0
- package/backend/real-data/v10-template.mjs +4 -2
- package/backend/server.mjs +27 -3
- package/build-manifest.json +24 -23
- package/client.js +33 -3
- package/package.json +1 -1
|
@@ -4,72 +4,135 @@ const validPath = path => Array.isArray(path) && path.length === 6 && path.every
|
|
|
4
4
|
const fullPath = path => validPath(path) && path.every(Boolean);
|
|
5
5
|
const key = path => JSON.stringify(path);
|
|
6
6
|
const isObject = value => value && typeof value === 'object' && !Array.isArray(value);
|
|
7
|
-
const
|
|
7
|
+
const SHA = /^[a-f0-9]{64}$/i;
|
|
8
|
+
const shaMatches = (payload, moduleId, sha) => typeof sha === 'string' && SHA.test(sha) && payload.sources[moduleId]?.sha256 === sha.toLowerCase() && payload.modules[moduleId]?.state !== 'unavailable';
|
|
9
|
+
// v10 业务确认「组织映射生效条件修订(2026-11-26)」: target paths are verified
|
|
10
|
+
// against the current reference boards; their SHAs are recorded, not gates.
|
|
11
|
+
export const REFERENCE_MODULES = ['invoice', 'movement', 'terminal', 'inventory'];
|
|
12
|
+
const KINDS = ['parent-completion', 'confirmed-alias'];
|
|
13
|
+
const LIST_LIMIT = 500;
|
|
14
|
+
// The shape parent completion addresses: upper three levels missing, lower three present.
|
|
15
|
+
const missingParents = path => validPath(path) && path.slice(0, 3).every(value => !value) && path.slice(3).every(Boolean);
|
|
16
|
+
const shaOrNull = sha => typeof sha === 'string' && SHA.test(sha) ? sha.toLowerCase() : null;
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
function reviewedAgainst(decision) {
|
|
19
|
+
// version 2 stores the reviewed versions explicitly; version 1 kept the same
|
|
20
|
+
// facts in referenceSources / sources.*.sourceSha256 (formerly gates).
|
|
21
|
+
const recorded = decision.version === 2 ? decision.reviewedAgainst : null;
|
|
22
|
+
const references = isObject(recorded?.references) ? recorded.references : isObject(decision.referenceSources) ? decision.referenceSources : {};
|
|
23
|
+
const sources = isObject(recorded?.sources) ? recorded.sources : Object.fromEntries(Object.entries(decision.sources).map(([id, source]) => [id, source?.sourceSha256]));
|
|
24
|
+
const clean = values => Object.fromEntries(Object.entries(values).filter(([id]) => MODULES.includes(id)).map(([id, sha]) => [id, shaOrNull(sha)]));
|
|
25
|
+
return { references: clean(references), sources: clean(sources) };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Apply reviewed, exact from → to organization paths one by one. A mapping
|
|
29
|
+
* applies only when its from path occurs in the mapped board, its full target
|
|
30
|
+
* path occurs in the current reference boards (invoice, movement, terminal,
|
|
31
|
+
* inventory), parent completion is a unique fill of the missing upper levels,
|
|
32
|
+
* and no other target is listed for the same from. Anything else is rejected
|
|
33
|
+
* on its own and reported; the rest still apply. No suffix rewriting or fuzzy
|
|
34
|
+
* matching. Original paths stay on every row for traceability.
|
|
12
35
|
*/
|
|
13
36
|
export function applyOrganizationMapping(payload, decision) {
|
|
14
|
-
const report = { version:
|
|
15
|
-
const
|
|
16
|
-
for (const id of MODULES) for (const row of payload.modules[id]
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (decision.version !== 1 || !isObject(decision.sources) || !isObject(decision.referenceSources)) {
|
|
22
|
-
report.status = 'invalid'; report.errors.push('组织映射合同格式不受支持。'); return report;
|
|
37
|
+
const report = { version: 2, rules: 'path-verified', status: 'not-configured', contractVersion: null, reviewedAgainst: { references: {}, sources: {} }, actualSources: { references: {}, sources: {} }, appliedSources: {}, modules: {}, errors: [] };
|
|
38
|
+
const referencePaths = new Set();
|
|
39
|
+
for (const id of MODULES) for (const row of payload.modules[id]?.records || []) row.originalOrgPath ??= [...row.orgPath];
|
|
40
|
+
for (const id of REFERENCE_MODULES) {
|
|
41
|
+
if (payload.modules[id]?.state === 'unavailable') continue;
|
|
42
|
+
if (payload.sources[id]?.sha256) report.actualSources.references[id] = payload.sources[id].sha256;
|
|
43
|
+
for (const row of payload.modules[id]?.records || []) if (fullPath(row.originalOrgPath)) referencePaths.add(key(row.originalOrgPath));
|
|
23
44
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
45
|
+
const pendingFor = (id, applied) => {
|
|
46
|
+
const counts = new Map();
|
|
47
|
+
for (const row of payload.modules[id]?.records || []) { const from = key(row.originalOrgPath); if (!applied.has(from) && missingParents(row.originalOrgPath)) counts.set(from, (counts.get(from) || 0) + 1); }
|
|
48
|
+
const all = [...counts].map(([path, rows]) => ({ path: JSON.parse(path), rows })).sort((a, b) => b.rows - a.rows);
|
|
49
|
+
return { pendingPathCount: all.length, pendingRows: all.reduce((sum, item) => sum + item.rows, 0), pendingPaths: all.slice(0, LIST_LIMIT) };
|
|
50
|
+
};
|
|
51
|
+
const finish = () => {
|
|
52
|
+
// Paths still missing their parents are never silent, configured or not.
|
|
53
|
+
for (const id of MODULES) if (!report.modules[id]) { const pending = pendingFor(id, new Set()); if (pending.pendingPathCount) report.modules[id] = { configured: false, ...pending, rejected: [], rejectedCount: 0, status: 'partial' }; }
|
|
54
|
+
if (report.status !== 'invalid' && Object.values(report.modules).some(detail => detail.rejectedCount || detail.pendingPathCount)) report.status = 'partial';
|
|
55
|
+
return report;
|
|
56
|
+
};
|
|
57
|
+
if (!decision) return finish();
|
|
58
|
+
if (!isObject(decision) || ![1, 2].includes(decision.version) || !isObject(decision.sources)) {
|
|
59
|
+
report.status = 'invalid'; report.errors.push('组织映射合同格式不受支持。'); return finish();
|
|
28
60
|
}
|
|
29
|
-
report.
|
|
61
|
+
report.contractVersion = decision.version;
|
|
62
|
+
report.reviewedAgainst = reviewedAgainst(decision);
|
|
63
|
+
report.status = 'applied';
|
|
64
|
+
const referenceList = [...referencePaths].map(path => JSON.parse(path));
|
|
30
65
|
for (const [id, source] of Object.entries(decision.sources)) {
|
|
31
|
-
if (!MODULES.includes(id)) { report.
|
|
32
|
-
|
|
66
|
+
if (!MODULES.includes(id)) { report.errors.push(`组织映射含未知板块 ${String(id).slice(0, 40)},已忽略。`); continue; }
|
|
67
|
+
if (payload.sources[id]?.sha256) report.actualSources.sources[id] = payload.sources[id].sha256;
|
|
68
|
+
const detail = { configured: true, mappings: 0, appliedPaths: 0, appliedRows: 0, parentCompletionPaths: 0, parentCompletionRows: 0, aliasPaths: 0, aliasRows: 0, notInSourceMappings: 0, rejected: [], rejectedCount: 0, status: 'applied' };
|
|
33
69
|
report.modules[id] = detail;
|
|
34
|
-
|
|
35
|
-
|
|
70
|
+
const records = payload.modules[id]?.records || [];
|
|
71
|
+
const present = new Map(); for (const row of records) { const from = key(row.originalOrgPath); present.set(from, (present.get(from) || 0) + 1); }
|
|
72
|
+
const rejectedFroms = new Set();
|
|
73
|
+
const reject = (mapping, reason) => {
|
|
74
|
+
const from = validPath(mapping?.from) ? mapping.from : null;
|
|
75
|
+
if (from) rejectedFroms.add(key(from));
|
|
76
|
+
detail.rejectedCount++;
|
|
77
|
+
if (detail.rejected.length < LIST_LIMIT) detail.rejected.push({ from, to: validPath(mapping?.to) ? mapping.to : null, kind: KINDS.includes(mapping?.kind) ? mapping.kind : null, reason, rows: from ? present.get(key(from)) || 0 : 0 });
|
|
78
|
+
};
|
|
79
|
+
const mappings = Array.isArray(source?.mappings) ? source.mappings : null;
|
|
80
|
+
if (!mappings) { reject(null, 'malformed'); }
|
|
81
|
+
// Group by from first: one from with two different targets rejects all of them (d).
|
|
82
|
+
const byFrom = new Map();
|
|
83
|
+
for (const mapping of mappings || []) {
|
|
84
|
+
detail.mappings++;
|
|
85
|
+
if (!validPath(mapping?.from) || !fullPath(mapping?.to) || !KINDS.includes(mapping.kind)
|
|
86
|
+
|| (mapping.kind === 'parent-completion' && (mapping.from.slice(3).some((value, i) => value !== mapping.to[i + 3]) || mapping.from.slice(0, 3).some((value, i) => value && value !== mapping.to[i])))) { reject(mapping, 'malformed'); continue; }
|
|
87
|
+
const from = key(mapping.from), group = byFrom.get(from) ?? new Map();
|
|
88
|
+
group.set(key(mapping.to) + mapping.kind, mapping); byFrom.set(from, group);
|
|
36
89
|
}
|
|
37
|
-
const
|
|
38
|
-
for (const
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
|
|
90
|
+
const accepted = new Map();
|
|
91
|
+
for (const [from, group] of byFrom) {
|
|
92
|
+
const list = [...group.values()];
|
|
93
|
+
if (new Set(list.map(mapping => key(mapping.to))).size !== 1 || list.length !== 1) { for (const mapping of list) reject(mapping, 'ambiguous'); continue; }
|
|
94
|
+
const [mapping] = list;
|
|
95
|
+
if (!present.has(from)) { detail.notInSourceMappings++; continue; } // (a) nothing to apply in this version
|
|
96
|
+
if (!referencePaths.has(key(mapping.to))) { reject(mapping, 'target-missing'); continue; } // (b)
|
|
97
|
+
if (mapping.kind === 'parent-completion') { // (c) unique among current reference paths
|
|
98
|
+
let matches = 0;
|
|
99
|
+
for (const candidate of referenceList) if (mapping.from.every((value, index) => !value || value === candidate[index])) matches++;
|
|
100
|
+
if (matches !== 1) { reject(mapping, 'ambiguous'); continue; }
|
|
42
101
|
}
|
|
43
|
-
|
|
44
|
-
// change names, but only through the exact reviewed from/to pair.
|
|
45
|
-
if (mapping.kind === 'parent-completion' && (mapping.from.slice(3).some((value, i) => value !== mapping.to[i + 3]) || mapping.from.slice(0, 3).some((value, i) => value && value !== mapping.to[i]))) {
|
|
46
|
-
detail.rejectedMappings++; invalidKeys.add(from); continue;
|
|
47
|
-
}
|
|
48
|
-
if (mapping.kind === 'parent-completion') {
|
|
49
|
-
const matches = [...observedTargets].map(path => JSON.parse(path)).filter(path => mapping.from.every((value, index) => !value || value === path[index]));
|
|
50
|
-
if (matches.length !== 1) { detail.rejectedMappings++; invalidKeys.add(from); detail.ambiguousPaths.push(mapping.from); continue; }
|
|
51
|
-
}
|
|
52
|
-
const targets = candidates.get(from) ?? new Map();
|
|
53
|
-
targets.set(key(mapping.to), mapping); candidates.set(from, targets);
|
|
102
|
+
accepted.set(from, mapping);
|
|
54
103
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
row.organizationMapping = { version: 1, kind: mapping.kind, status: 'applied' };
|
|
64
|
-
detail.appliedRows++; applied.add(from);
|
|
65
|
-
if (mapping.kind === 'parent-completion') detail.parentCompletionRows++; else detail.aliasRows++;
|
|
66
|
-
} else if (!fullPath(row.orgPath)) incomplete.set(from, row.orgPath);
|
|
104
|
+
const appliedPaths = new Map();
|
|
105
|
+
for (const row of records) {
|
|
106
|
+
const from = key(row.originalOrgPath), mapping = accepted.get(from);
|
|
107
|
+
if (!mapping) continue;
|
|
108
|
+
row.orgPath = [...mapping.to]; row.org = Object.fromEntries(ORG_FIELDS.map((field, index) => [field, row.orgPath[index]])); row.orgKey = key(row.orgPath);
|
|
109
|
+
row.organizationMapping = { version: 2, kind: mapping.kind, status: 'applied' };
|
|
110
|
+
detail.appliedRows++; appliedPaths.set(from, mapping.kind);
|
|
111
|
+
if (mapping.kind === 'parent-completion') detail.parentCompletionRows++; else detail.aliasRows++;
|
|
67
112
|
}
|
|
68
|
-
detail.appliedPaths =
|
|
69
|
-
|
|
70
|
-
|
|
113
|
+
detail.appliedPaths = appliedPaths.size;
|
|
114
|
+
detail.parentCompletionPaths = [...appliedPaths.values()].filter(kind => kind === 'parent-completion').length;
|
|
115
|
+
detail.aliasPaths = detail.appliedPaths - detail.parentCompletionPaths;
|
|
116
|
+
// Rows of a rejected mapping are listed once, under the rejection.
|
|
117
|
+
Object.assign(detail, pendingFor(id, new Set([...appliedPaths.keys(), ...rejectedFroms])));
|
|
118
|
+
if (detail.rejectedCount || detail.pendingPathCount) detail.status = 'partial';
|
|
119
|
+
if (detail.appliedRows && payload.sources[id]?.sha256) report.appliedSources[id] = payload.sources[id].sha256;
|
|
120
|
+
}
|
|
121
|
+
return finish();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const SUMMARY_ITEMS = 100;
|
|
125
|
+
/** Compact copy of the mapping report for the generation record (state.json):
|
|
126
|
+
* counts per board plus the first rejected / pending paths for the 查看 list. */
|
|
127
|
+
export function summarizeOrganizationMapping(report) {
|
|
128
|
+
if (!isObject(report)) return null;
|
|
129
|
+
const modules = {}, items = [];
|
|
130
|
+
for (const [id, detail] of Object.entries(report.modules || {})) {
|
|
131
|
+
modules[id] = Object.fromEntries(['appliedPaths', 'appliedRows', 'parentCompletionPaths', 'parentCompletionRows', 'aliasPaths', 'aliasRows', 'rejectedCount', 'pendingPathCount', 'pendingRows', 'notInSourceMappings'].map(name => [name, Number.isSafeInteger(detail[name]) ? detail[name] : 0]));
|
|
132
|
+
for (const item of detail.rejected || []) items.push({ moduleId: id, path: item.from, rows: item.rows || 0, reason: item.reason });
|
|
133
|
+
for (const item of detail.pendingPaths || []) items.push({ moduleId: id, path: item.path, rows: item.rows, reason: 'pending' });
|
|
71
134
|
}
|
|
72
|
-
return report;
|
|
135
|
+
return { version: 2, status: report.status, contractVersion: report.contractVersion ?? null, errors: (report.errors || []).slice(0, 5), modules, items: items.slice(0, SUMMARY_ITEMS), itemCount: items.length };
|
|
73
136
|
}
|
|
74
137
|
|
|
75
138
|
const RULES = {
|
|
@@ -85,7 +148,8 @@ export function buildDecisionContract(payload, decisions, mappingReport) {
|
|
|
85
148
|
version: 1, decisionId: typeof decisions?.decisionId === 'string' ? decisions.decisionId : null,
|
|
86
149
|
confirmedAt: typeof decisions?.confirmedAt === 'string' ? decisions.confirmedAt : null,
|
|
87
150
|
timeZone: typeof decisions?.timeZone === 'string' ? decisions.timeZone : null,
|
|
88
|
-
|
|
151
|
+
// version 2: path-verified rules; status is the mapping report's own (applied / partial / invalid / not-configured).
|
|
152
|
+
organizationMapping: { status: ['applied', 'partial', 'invalid', 'not-configured'].includes(mappingReport.status) ? mappingReport.status : 'invalid', version: 2, appliedSources: mappingReport.appliedSources || {} },
|
|
89
153
|
agreementFulfillment: { status: 'pending' }, banquetReward: { status: 'pending' }, inventoryValuationBasis: { status: 'pending' },
|
|
90
154
|
};
|
|
91
155
|
for (const [name, rule] of Object.entries(RULES)) {
|
|
@@ -67,7 +67,7 @@ export function createV10Components({ T, g, model, icons, Pn }) {
|
|
|
67
67
|
el(CardMonths,{module:m,view:v,compact,filters}),
|
|
68
68
|
el('div',{className:'card-bottom inv-bottom'},el('span',{},`${kind==='invoice'?'经销商':'扫码终端'} ${number(count)}${available(count)?' 家':''}`),
|
|
69
69
|
el('span',{},`负金额 ${money(negative)}${available(negative)?' 万':''}`),
|
|
70
|
-
kind==='invoice'?el('span',{className:'inv-pending'},'达成率 ·
|
|
70
|
+
kind==='invoice'?(att=>available(att)?el('span',{title:att.note||''},`${att.label||'达成率'} ${model.format(att.value,1,1)}%`):el('span',{className:'inv-pending',title:att?.reason||'未上传经营目标'},m.targets?.available?'达成率 · 待确认':'达成率 · 未上传目标'))(m.targets?.attainment):el('span',{},`累计动销/开票 ${number(ratio)}${available(ratio)?'%':''}`))),
|
|
71
71
|
kind==='opening' && el(Sparkline,{view:v,color:m.color}),
|
|
72
72
|
kind==='terminal' && el(TerminalCardContent,{module:m}),
|
|
73
73
|
kind==='inventory' && el('div',{className:'stock-compare'},
|
|
@@ -66,7 +66,8 @@ export function createV10Model(payload, terminalBuilder = buildTerminalStructure
|
|
|
66
66
|
const orgMap = new Map(), categoryMap = new Map();
|
|
67
67
|
for (const id of ids) for (const row of payload.modules[id].records) {
|
|
68
68
|
const { region, office, unit } = keysFor(row);
|
|
69
|
-
if (!orgMap.has(unit)) orgMap.set(unit, { id: unit, region, office, unit });
|
|
69
|
+
if (!orgMap.has(unit)) orgMap.set(unit, { id: unit, region, office, unit, sources: new Set() });
|
|
70
|
+
orgMap.get(unit).sources.add(id);
|
|
70
71
|
if (['invoice', 'movement', 'inventory'].includes(id) && !(id === 'inventory' && inventoryHistory)) {
|
|
71
72
|
const key = JSON.stringify([row.brand || '未映射品牌', row.category || '未映射品类']);
|
|
72
73
|
if (!categoryMap.has(key)) categoryMap.set(key, { id: key, name: row.category || '未映射品类', brand: row.brand || '未映射品牌' });
|
|
@@ -314,6 +315,39 @@ export function createV10Model(payload, terminalBuilder = buildTerminalStructure
|
|
|
314
315
|
const value = actual.value / target.value * 100;
|
|
315
316
|
return finite(value) ? { label, unit: '%', value, state: 'available', reason: null, target, actual: actual.value, precision: 1, note: `实际 ${format(actual.unit === '元' ? actual.value / 10000 : actual.value, target.unit === '元' ? 2 : 0)} / 目标 ${format(target.unit === '元' ? target.value / 10000 : target.value, target.unit === '元' ? 2 : 0)} ${target.unit === '元' ? '万元' : target.unit}` } : fail('达成率超出可表示范围');
|
|
316
317
|
}
|
|
318
|
+
// Quarter / fiscal-year windows for the selected month (range mode: the range's end month).
|
|
319
|
+
// Fiscal year runs 1 Jul – 30 Jun; quarters are calendar quarters (fiscal Q1 = Jul–Sep).
|
|
320
|
+
const dayCount = (start, end) => Math.round((Date.parse(`${end}T00:00:00Z`) - Date.parse(`${start}T00:00:00Z`)) / 86400000) + 1;
|
|
321
|
+
function cumulativeWindow(kind, f, p) {
|
|
322
|
+
if (p.mode === 'fixed' || !isDate(p.end) || !/^\d{4}-\d{2}$/.test(f.month || '')) return null;
|
|
323
|
+
const year = Number(f.month.slice(0, 4)), month = Number(f.month.slice(5));
|
|
324
|
+
const first = kind === 'quarter' ? `${year}-${String(Math.floor((month - 1) / 3) * 3 + 1).padStart(2, '0')}` : month >= 7 ? `${year}-07` : `${year - 1}-07`;
|
|
325
|
+
const months = Array.from({ length: kind === 'quarter' ? 3 : 12 }, (_, index) => offsetMonth(first, index));
|
|
326
|
+
const fiscal = month >= 7 ? year : year - 1;
|
|
327
|
+
const label = kind === 'quarter' ? `${Number(months[0].slice(5))}–${Number(months[2].slice(5))} 月` : `${String(fiscal).slice(2)}/${String(fiscal + 1).slice(2)} 财年`;
|
|
328
|
+
const detail = kind === 'quarter' ? `${months[0]} 至 ${months[2]}(财年第 ${[3, 3, 3, 4, 4, 4, 1, 1, 1, 2, 2, 2][month - 1]} 季度)` : `${fiscal}-07-01 至 ${fiscal + 1}-06-30`;
|
|
329
|
+
return { kind, label, detail, start: `${months[0]}-01`, end: p.end, periodEnd: monthEnd(months.at(-1)), months };
|
|
330
|
+
}
|
|
331
|
+
function cumulativeActual(id, module, window, label) {
|
|
332
|
+
const source = payload.modules[id], cover = payload.coverage[id];
|
|
333
|
+
const base = { label, unit: '元', range: { start: window.start, end: window.end } };
|
|
334
|
+
const fail = (reason, state = 'pending') => ({ ...base, value: null, state, reason });
|
|
335
|
+
if (source.state === 'unavailable') return fail(source.reviewReason || '未接入有效来源', source.reviewPending ? 'pending' : 'missing');
|
|
336
|
+
if (!isDate(cover?.start) || !isDate(cover?.end)) return fail('来源覆盖期间缺失或无效');
|
|
337
|
+
if (cover.start > window.start) return fail(`来源从 ${cover.start} 开始,未覆盖 ${window.start} 起的完整累计期间`);
|
|
338
|
+
if (cover.end < window.start) return fail(`来源截至 ${cover.end},尚无本期记录`, 'missing');
|
|
339
|
+
if (module.scopedRows.some(row => !row.date)) return fail('存在缺失日期的记录,无法完整分期');
|
|
340
|
+
const rows = module.scopedRows.filter(row => row.date >= window.start && row.date <= window.end);
|
|
341
|
+
if (!rows.length) return fail('当前范围在累计期间无来源记录;不推定为业务零值', 'missing');
|
|
342
|
+
return { ...metric(rows, 'amount', source, label, '元'), range: { start: window.start, end: [window.end, cover.end].sort()[0] } };
|
|
343
|
+
}
|
|
344
|
+
// Elapsed share of a period, counted to the earlier of the window end and the source cut-off.
|
|
345
|
+
function timeProgress(id, start, periodEnd, windowEnd) {
|
|
346
|
+
const cover = payload.coverage[id], through = [windowEnd, cover?.end].filter(isDate).sort()[0];
|
|
347
|
+
if (!isDate(start) || !isDate(periodEnd) || !isDate(through) || through < start) return null;
|
|
348
|
+
const days = dayCount(start, [through, periodEnd].sort()[0]), totalDays = dayCount(start, periodEnd);
|
|
349
|
+
return { through, days, totalDays, value: days / totalDays * 100 };
|
|
350
|
+
}
|
|
317
351
|
// A custom range uses each overlapping month's target, prorated by calendar days.
|
|
318
352
|
function targetSegments(start, end) {
|
|
319
353
|
const segments = [];
|
|
@@ -467,6 +501,19 @@ export function createV10Model(payload, terminalBuilder = buildTerminalStructure
|
|
|
467
501
|
const ytdTarget = targetValue(id, f, p.mode === 'fixed' ? [] : range ? targetSegments(`${f.month.slice(0, 4)}-01-01`, p.end) : yearMonths(f.month).map(month => ({ month, weight: 1, days: null })), '年累计目标');
|
|
468
502
|
module.targets = { available: Boolean(targetSource), month: monthTarget, ytd: ytdTarget,
|
|
469
503
|
attainment: attainment(module.main, monthTarget, range ? '区间目标达成率' : '当月目标达成率'), ytdAttainment: attainment(ytdActual, ytdTarget, '年累计目标达成率') };
|
|
504
|
+
if (id === 'opening') continue;
|
|
505
|
+
// 当月时间进度(按月模式;区间目标已按天折算,不再给进度)。
|
|
506
|
+
module.targets.monthProgress = p.mode === 'month' ? timeProgress(id, p.start, p.end, p.end) : null;
|
|
507
|
+
// 季度(自然季度 = 财年 Q3/Q4/Q1/Q2)与财年(7 月 1 日起):累计实际对全期整月目标。
|
|
508
|
+
for (const kind of ['quarter', 'fiscal']) {
|
|
509
|
+
const window = cumulativeWindow(kind, f, p);
|
|
510
|
+
if (!window) { module.targets[kind] = null; continue; }
|
|
511
|
+
const name = kind === 'quarter' ? '季度' : '财年';
|
|
512
|
+
const actual = cumulativeActual(id, module, window, `${name}累计`);
|
|
513
|
+
const target = targetValue(id, f, window.months.map(month => ({ month, weight: 1, days: null })), `${name}目标`);
|
|
514
|
+
module.targets[kind] = { ...window, actual, target, attainment: attainment(actual, target, `${name}目标达成率`),
|
|
515
|
+
progress: timeProgress(id, window.start, window.periodEnd, window.end) };
|
|
516
|
+
}
|
|
470
517
|
}
|
|
471
518
|
const crossMetrics = crossTableMetrics(f);
|
|
472
519
|
for (const id of ids) output.modules[id].crossMetrics = crossMetrics[id] || [];
|
|
@@ -149,7 +149,10 @@ export function createV10OverviewData(model, presentation) {
|
|
|
149
149
|
signed: copy(terminal.main), effectiveCount: copy(terminal.extra?.find(item => item.label === '有效终端数') || pending('有效终端数', '家', '有效终端尚未完整判定')),
|
|
150
150
|
openingRate, openingTotal: openingTotal(filters, modules.opening, openingRate),
|
|
151
151
|
ratio: copy(modules.movement.crossMetrics?.find(item => item.key === 'invoiceMovementMonthRatio')
|
|
152
|
-
|| pending('当月动销 / 开票', '%', '当前来源未确认该跨表指标'))
|
|
152
|
+
|| pending('当月动销 / 开票', '%', '当前来源未确认该跨表指标')),
|
|
153
|
+
// 当月(区间)目标达成率,与总览卡同一取数规则。
|
|
154
|
+
invoiceAttainment: copy(modules.invoice.targets?.attainment || pending('发票目标达成率', '%', '未上传经营目标', 'missing')),
|
|
155
|
+
movementAttainment: copy(modules.movement.targets?.attainment || pending('动销目标达成率', '%', '未上传经营目标', 'missing')) };
|
|
153
156
|
result.invoiceYoY = yearComparison('invoice', modules.invoice, filters);
|
|
154
157
|
result.movementYoY = yearComparison('movement', modules.movement, filters);
|
|
155
158
|
result.openingYoY = ready(result.openingTotal) && result.openingTotal.range
|
|
@@ -224,7 +227,9 @@ export function createV10OverviewData(model, presentation) {
|
|
|
224
227
|
? { label: '发票占比', unit: '%', value: metrics.invoice.value / parentInvoice.value * 100, state: 'available', reason: null,
|
|
225
228
|
numerator: metrics.invoice.value, denominator: parentInvoice.value }
|
|
226
229
|
: pending('发票占比', '%', '当前组织或父范围发票净额不完整,或父范围合计不大于零');
|
|
227
|
-
|
|
230
|
+
// 该组织(含下级)在哪些来源出现过;总览各视图只列出与本视图来源相关的组织。
|
|
231
|
+
const sources = [...new Set(model.organizations.filter(item => item[groupField] === key).flatMap(item => [...(item.sources || [])]))];
|
|
232
|
+
return { key, name: model.label(key), fullName: fullName(key), sources,
|
|
228
233
|
drillable: f.unit === 'all' && parts.length === expectedParts && parts.every(text) && model.organizations.some(item => item[groupField] === key),
|
|
229
234
|
...Object.fromEntries(Object.entries(metrics).map(([name, item]) => [name, copy(item)])), invoiceShare };
|
|
230
235
|
});
|
|
@@ -9,7 +9,7 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
9
9
|
.app-shell.overview-mode .page-header .eyebrow{font-family:var(--ov-num);font-size:10.5px;font-weight:500;line-height:1.5;letter-spacing:.32em;color:#b8343c;margin:0}
|
|
10
10
|
.app-shell.overview-mode .page-header h1{font-family:"Songti SC","Noto Serif CJK SC",serif;font-size:26px;font-weight:500;line-height:1.25;letter-spacing:.12em;color:#18212b;margin:8px 0 0}
|
|
11
11
|
.app-shell.overview-mode .header-actions{position:static;display:flex;flex-direction:row;align-items:center;gap:16px;padding:0;font-size:11.5px;line-height:1.5}
|
|
12
|
-
.app-shell.overview-mode .demo-badge{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#
|
|
12
|
+
.app-shell.overview-mode .demo-badge{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#66717e;font-size:11.5px;font-weight:400;letter-spacing:0;white-space:nowrap}
|
|
13
13
|
.app-shell.overview-mode .demo-badge>span{width:6px;height:6px;border-radius:50%;background:#c9a85a;margin:0;box-shadow:none}
|
|
14
14
|
.app-shell.overview-mode .definition-button{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:#3a4552;font-size:11.5px;font-weight:400}
|
|
15
15
|
.app-shell.overview-mode .definition-button svg{display:none}
|
|
@@ -17,11 +17,11 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
17
17
|
.app-shell.overview-mode .filter-label{display:none}
|
|
18
18
|
.app-shell.overview-mode .filter-bar label{display:flex;flex:1 1 0;align-items:center;gap:8px;min-width:0;height:100%;padding:0 16px;border-left:1px solid #edf0f3;line-height:1.5}
|
|
19
19
|
.app-shell.overview-mode .filter-bar label:nth-child(2){border-left:0;padding-left:0}
|
|
20
|
-
.app-shell.overview-mode .filter-bar label>span{display:inline;flex:none;color:#
|
|
20
|
+
.app-shell.overview-mode .filter-bar label>span{display:inline;flex:none;color:#7a8491;font-size:11.5px;white-space:nowrap}
|
|
21
21
|
.app-shell.overview-mode .filter-bar select{flex:1 1 0;min-width:0;width:100%;max-width:100%;padding:0;border:0;border-radius:0;background:transparent;font-family:var(--ov-num),var(--ov-cn);font-size:12.5px;font-weight:500;color:#18212b;text-overflow:ellipsis;cursor:pointer}
|
|
22
|
-
.app-shell.overview-mode .filter-bar .reset-button{display:flex;flex:none;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;color:#
|
|
22
|
+
.app-shell.overview-mode .filter-bar .reset-button{display:flex;flex:none;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;color:#66717e}
|
|
23
23
|
.app-shell.overview-mode .filter-bar .reset-button svg{width:15px;height:15px}
|
|
24
|
-
.app-shell.overview-mode main>.scope-line{display:flex;flex:none;align-items:center;justify-content:space-between;gap:24px;width:100%;min-height:16px;margin:8px 0 16px;font-size:11px;line-height:1.5;color:#
|
|
24
|
+
.app-shell.overview-mode main>.scope-line{display:flex;flex:none;align-items:center;justify-content:space-between;gap:24px;width:100%;min-height:16px;margin:8px 0 16px;font-size:11px;line-height:1.5;color:#7a8491}
|
|
25
25
|
.app-shell.overview-mode main>.scope-line:empty{min-height:0;height:0;margin:0 0 16px}
|
|
26
26
|
.app-shell.overview-mode .overview-shell{display:grid;flex:none;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 288px;grid-template-rows:432px 248px;gap:16px;width:1180px;height:auto;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
|
|
27
27
|
.app-shell.overview-mode .overview-card{display:flex;flex-direction:column;min-width:0;min-height:0;margin:0;padding:24px;border:1px solid #e8ebef;border-radius:16px;background:#fff;box-shadow:none;color:#18212b;text-align:left}
|
|
@@ -37,35 +37,35 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
37
37
|
.app-shell.overview-mode .ov-dot{display:inline-block;flex:none;width:6px;height:6px;border-radius:50%;background:#3a4552}
|
|
38
38
|
.app-shell.overview-mode .ov-hero .ov-dot{background:var(--ov-accent)}
|
|
39
39
|
.app-shell.overview-mode .ov-opening .ov-dot{background:#4a6f94}
|
|
40
|
-
.app-shell.overview-mode .ov-action{display:inline-flex;flex:none;margin-left:auto;font-size:11px;font-weight:400;line-height:1.5;color:#
|
|
41
|
-
.app-shell.overview-mode .ov-label{flex:none;margin:16px 0 0;font-size:11.5px;line-height:1.5;color:#
|
|
40
|
+
.app-shell.overview-mode .ov-action{display:inline-flex;flex:none;margin-left:auto;font-size:11px;font-weight:400;line-height:1.5;color:#7a8491;white-space:nowrap}
|
|
41
|
+
.app-shell.overview-mode .ov-label{flex:none;margin:16px 0 0;font-size:11.5px;line-height:1.5;color:#66717e}
|
|
42
42
|
.app-shell.overview-mode :is(.ov-value,.ov-secondary-value,.ov-stats b,.ov-kv b,.ov-number,.ov-growth,.ov-previous,.ov-month,.ov-rank){font-family:var(--ov-num),var(--ov-cn);font-variant-numeric:tabular-nums lining-nums}
|
|
43
43
|
.app-shell.overview-mode .ov-hero-values{display:flex;align-items:flex-end;gap:24px;margin-top:8px;min-width:0}
|
|
44
44
|
.app-shell.overview-mode .ov-value{margin:0;font-size:44px;font-weight:300;line-height:1;letter-spacing:-.035em;white-space:nowrap}
|
|
45
45
|
.app-shell.overview-mode .ov-movement .ov-value{color:#16705d}
|
|
46
|
-
.app-shell.overview-mode :is(.ov-value,.ov-secondary-value) small{font-family:var(--ov-cn);font-size:13px;font-weight:400;letter-spacing:0;color:#
|
|
47
|
-
.app-shell.overview-mode .ov-comparison{display:flex;flex-direction:column;gap:8px;padding-left:24px;border-left:1px solid #edf0f3;min-width:0;line-height:1.2;font-size:12px;color:#
|
|
48
|
-
.app-shell.overview-mode .ov-growth{display:inline-flex;align-items:baseline;gap:8px;font-size:10.5px;line-height:1.3;white-space:nowrap;color:#
|
|
46
|
+
.app-shell.overview-mode :is(.ov-value,.ov-secondary-value) small{font-family:var(--ov-cn);font-size:13px;font-weight:400;letter-spacing:0;color:#7a8491;margin-left:8px}
|
|
47
|
+
.app-shell.overview-mode .ov-comparison{display:flex;flex-direction:column;gap:8px;padding-left:24px;border-left:1px solid #edf0f3;min-width:0;line-height:1.2;font-size:12px;color:#66717e;white-space:nowrap}
|
|
48
|
+
.app-shell.overview-mode .ov-growth{display:inline-flex;align-items:baseline;gap:8px;font-size:10.5px;line-height:1.3;white-space:nowrap;color:#66717e;font-weight:400}
|
|
49
49
|
.app-shell.overview-mode .ov-growth em{font-style:normal;font-weight:500}
|
|
50
50
|
.app-shell.overview-mode .ov-comparison .ov-growth{font-size:12px}
|
|
51
51
|
.app-shell.overview-mode .ov-hero-values .ov-growth em{font-size:14px}
|
|
52
52
|
.app-shell.overview-mode .ov-previous small{font-size:inherit;margin-left:3px;font-weight:400}
|
|
53
53
|
.app-shell.overview-mode .is-up{color:#1f7a66}
|
|
54
54
|
.app-shell.overview-mode :is(.is-down,.is-negative,.is-alert){color:#b8343c}
|
|
55
|
-
.app-shell.overview-mode .is-flat{color:#
|
|
56
|
-
.app-shell.overview-mode :is([data-state="pending"],[data-state="missing"],[data-state="unavailable"],.is-pending){color:#
|
|
55
|
+
.app-shell.overview-mode .is-flat{color:#66717e}
|
|
56
|
+
.app-shell.overview-mode :is([data-state="pending"],[data-state="missing"],[data-state="unavailable"],.is-pending){color:#b3bac3}
|
|
57
57
|
.app-shell.overview-mode .ov-stats{display:grid;flex:none;grid-template-columns:repeat(4,auto);justify-content:start;gap:0;margin-top:16px;padding-top:16px;border-top:1px solid #edf0f3;min-width:0}
|
|
58
58
|
.app-shell.overview-mode .ov-stats>div{padding:0 16px;border-left:1px solid #edf0f3;white-space:nowrap}
|
|
59
59
|
.app-shell.overview-mode .ov-stats>div:first-child{padding-left:0;border-left:0}
|
|
60
60
|
.app-shell.overview-mode .ov-stats>div:last-child{padding-right:0}
|
|
61
|
-
.app-shell.overview-mode .ov-stats>div>span:first-child{display:block;color:#
|
|
61
|
+
.app-shell.overview-mode .ov-stats>div>span:first-child{display:block;color:#7a8491;font-size:10.5px;line-height:1.3}
|
|
62
62
|
.app-shell.overview-mode .ov-stats b{display:block;margin-top:8px;font-size:15px;font-weight:500;line-height:1.3;letter-spacing:-.01em}
|
|
63
|
-
.app-shell.overview-mode .ov-stats small{font-size:10.5px;font-weight:400;color:#
|
|
63
|
+
.app-shell.overview-mode .ov-stats small{font-size:10.5px;font-weight:400;color:#7a8491;margin-left:3px}
|
|
64
64
|
.app-shell.overview-mode .ov-stats .ov-growth{margin-top:8px}
|
|
65
65
|
.app-shell.overview-mode .ov-stats .ov-negative-amount,.app-shell.overview-mode .ov-negative-amount .is-negative{color:#a8761a}
|
|
66
66
|
.app-shell.overview-mode .ov-negative-amount:before,.app-shell.overview-mode .ov-negative-swatch{content:"";display:inline-block;width:8px;height:8px;border-radius:2px;background:repeating-linear-gradient(-45deg,#e7b75a 0 2px,#f6e3b8 2px 4px)}
|
|
67
67
|
.app-shell.overview-mode .ov-negative-amount:before{margin-right:8px}
|
|
68
|
-
.app-shell.overview-mode .ov-chart-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;color:#
|
|
68
|
+
.app-shell.overview-mode .ov-chart-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;color:#7a8491;font-size:10.5px;line-height:1.3}
|
|
69
69
|
.app-shell.overview-mode .ov-chart-legend{display:flex;gap:16px}
|
|
70
70
|
.app-shell.overview-mode .ov-chart-legend>span{display:flex;align-items:center;gap:8px;white-space:nowrap}
|
|
71
71
|
.app-shell.overview-mode .ov-chart-legend i{display:inline-block;width:8px;height:8px;border-radius:2px}
|
|
@@ -87,46 +87,46 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
87
87
|
.app-shell.overview-mode .ov-net-label{position:absolute;left:50%;transform:translateX(-50%);padding-bottom:8px;font-size:10px;font-weight:500;line-height:1;white-space:nowrap}
|
|
88
88
|
.app-shell.overview-mode .ov-negative-label{position:absolute;top:0;left:100%;font-size:10px;font-weight:500;color:#a8761a;line-height:1;white-space:nowrap}
|
|
89
89
|
.app-shell.overview-mode .ov-month:last-child .ov-negative-label{left:auto;right:100%}
|
|
90
|
-
.app-shell.overview-mode .ov-month-label{font-size:10px;line-height:1;color:#
|
|
90
|
+
.app-shell.overview-mode .ov-month-label{font-size:10px;line-height:1;color:#7a8491;white-space:nowrap}
|
|
91
91
|
.app-shell.overview-mode .is-current .ov-month-label{font-weight:600;color:#18212b}
|
|
92
|
-
.app-shell.overview-mode .ov-missing{position:absolute;inset:0;display:grid;place-items:center;color:#
|
|
93
|
-
.app-shell.overview-mode .ov-chart-note{flex:none;line-height:1;font-size:10px;color:#
|
|
92
|
+
.app-shell.overview-mode .ov-missing{position:absolute;inset:0;display:grid;place-items:center;color:#b3bac3;font-size:10px}
|
|
93
|
+
.app-shell.overview-mode .ov-chart-note{flex:none;line-height:1;font-size:10px;color:#7a8491;margin-top:8px}
|
|
94
94
|
.app-shell.overview-mode .ov-operation{display:flex;flex:1;flex-direction:column;justify-content:center;min-height:0;width:100%;padding:0;border:0;border-top:1px solid #edf0f3;border-radius:0;background:none;color:inherit;text-align:left}
|
|
95
95
|
.app-shell.overview-mode .ov-operation:first-child{border-top:0}
|
|
96
96
|
.app-shell.overview-mode .ov-operation-heading{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#3a4552}
|
|
97
97
|
.app-shell.overview-mode .ov-secondary-value{display:block;font-size:26px;font-weight:300;line-height:1.1;letter-spacing:-.03em;margin:8px 0 0;white-space:nowrap}
|
|
98
98
|
.app-shell.overview-mode .ov-secondary-value small{font-size:11px}
|
|
99
|
-
.app-shell.overview-mode .ov-kv{display:flex;gap:16px;margin-top:8px;font-size:10.5px;color:#
|
|
99
|
+
.app-shell.overview-mode .ov-kv{display:flex;gap:16px;margin-top:8px;font-size:10.5px;color:#7a8491;line-height:1.5;white-space:nowrap}
|
|
100
100
|
.app-shell.overview-mode .ov-kv b{font-size:11.5px;font-weight:500;margin-left:8px}
|
|
101
101
|
.app-shell.overview-mode .ov-kv small{font-size:10px;margin-left:3px}
|
|
102
|
-
.app-shell.overview-mode .ov-tag{background:none;border:0;padding:0;font-size:10.5px;color:#
|
|
102
|
+
.app-shell.overview-mode .ov-tag{background:none;border:0;padding:0;font-size:10.5px;color:#7a8491}
|
|
103
103
|
.app-shell.overview-mode .ov-tag [data-state="available"]{font-size:11.5px;color:#18212b;font-weight:500}
|
|
104
104
|
.app-shell.overview-mode .ov-kv b[data-state="available"]{color:#18212b}
|
|
105
105
|
.app-shell.overview-mode .ov-region-header{display:flex;align-items:center;gap:16px;min-height:20px}
|
|
106
|
-
.app-shell.overview-mode .ov-region-note{font-size:10.5px;color:#
|
|
106
|
+
.app-shell.overview-mode .ov-region-note{font-size:10.5px;color:#7a8491;white-space:nowrap}
|
|
107
107
|
.app-shell.overview-mode .ov-region-tabs{display:flex;gap:8px;margin-left:auto;white-space:nowrap}
|
|
108
|
-
.app-shell.overview-mode .ov-region-tabs button{padding:3px 8px;border:0;border-radius:6px;background:none;box-shadow:none;font-size:11px;font-weight:400;color:#
|
|
108
|
+
.app-shell.overview-mode .ov-region-tabs button{padding:3px 8px;border:0;border-radius:6px;background:none;box-shadow:none;font-size:11px;font-weight:400;color:#66717e}
|
|
109
109
|
.app-shell.overview-mode .ov-region-tabs button[aria-selected="true"]{background:#f1f3f6;color:#18212b;font-weight:500}
|
|
110
110
|
.app-shell.overview-mode .ov-region-columns,.app-shell.overview-mode .ov-region-row{display:grid;grid-template-columns:24px 136px minmax(0,1fr) 96px 96px 72px;align-items:center;gap:16px;width:100%}
|
|
111
|
-
.app-shell.overview-mode .ov-region-columns{flex:none;margin-top:16px;padding:0 0 8px;border-bottom:1px solid #edf0f3;color:#
|
|
111
|
+
.app-shell.overview-mode .ov-region-columns{flex:none;margin-top:16px;padding:0 0 8px;border-bottom:1px solid #edf0f3;color:#7a8491;font-size:10.5px;line-height:1.3}
|
|
112
112
|
.app-shell.overview-mode .ov-region-columns>span:nth-last-child(-n+3){text-align:right}
|
|
113
113
|
.app-shell.overview-mode .ov-pair-legend{display:flex;gap:16px}
|
|
114
114
|
.app-shell.overview-mode .ov-pair-legend>span{display:flex;align-items:center;gap:8px}
|
|
115
115
|
.app-shell.overview-mode .ov-pair-legend i{width:8px;height:8px;border-radius:2px;display:inline-block}
|
|
116
|
-
.app-shell.overview-mode .ov-region-list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#
|
|
116
|
+
.app-shell.overview-mode .ov-region-list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#b3bac3 transparent}
|
|
117
117
|
.app-shell.overview-mode .ov-region-row{height:calc(100% / 3);min-height:calc(100% / 3);padding:0;border:0;border-bottom:1px solid #f4f5f7;border-radius:0;background:none;text-align:left;outline-offset:-2px}
|
|
118
118
|
.app-shell.overview-mode .ov-region-row:disabled{cursor:default}
|
|
119
119
|
.app-shell.overview-mode .ov-region-row>*{min-width:0}
|
|
120
120
|
.app-shell.overview-mode .ov-region-row:last-child{border-bottom:0}
|
|
121
|
-
.app-shell.overview-mode .ov-rank{font-size:11px;color:#
|
|
121
|
+
.app-shell.overview-mode .ov-rank{font-size:11px;color:#b3bac3}
|
|
122
122
|
.app-shell.overview-mode .ov-region-name{font-size:12.5px;font-weight:500;line-height:1.4}
|
|
123
123
|
.app-shell.overview-mode .ov-region-name strong{display:block;font:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
124
|
-
.app-shell.overview-mode .ov-region-name>small{display:block;margin:0;font-size:10px;color:#
|
|
124
|
+
.app-shell.overview-mode .ov-region-name>small{display:block;margin:0;font-size:10px;color:#7a8491;font-weight:400;line-height:1.4}
|
|
125
125
|
.app-shell.overview-mode .ov-region-bars{display:flex;flex-direction:column;gap:8px}
|
|
126
126
|
.app-shell.overview-mode .ov-region-bar-track{display:block;position:relative;height:6px;background:#f4f5f7;border-radius:3px}
|
|
127
127
|
.app-shell.overview-mode .ov-region-bar-track i{position:absolute;top:0;display:block;height:6px;border-radius:3px;max-width:100%}
|
|
128
|
-
.app-shell.overview-mode .ov-region-bar-track s{position:absolute;inset:0 auto 0;border-left:1px solid #
|
|
129
|
-
.app-shell.overview-mode .ov-region-bar-track em{display:block;position:absolute;inset:0;line-height:6px;text-align:center;font-size:10px;color:#
|
|
128
|
+
.app-shell.overview-mode .ov-region-bar-track s{position:absolute;inset:0 auto 0;border-left:1px solid #b3bac3}
|
|
129
|
+
.app-shell.overview-mode .ov-region-bar-track em{display:block;position:absolute;inset:0;line-height:6px;text-align:center;font-size:10px;color:#b3bac3;font-style:normal}
|
|
130
130
|
.app-shell.overview-mode .ov-invoice-bar{background:#d27a80}
|
|
131
131
|
.app-shell.overview-mode .ov-movement-bar{background:#5aa592}
|
|
132
132
|
.app-shell.overview-mode .ov-signed-bar{background:#c4ad83}
|
|
@@ -135,26 +135,26 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
135
135
|
.app-shell.overview-mode .ov-number>.ov-growth{display:flex;justify-content:flex-end;margin:0;font-size:10.5px}
|
|
136
136
|
.app-shell.overview-mode .ov-number small{margin-left:3px;font-size:10.5px;font-weight:400}
|
|
137
137
|
.app-shell.overview-mode .ov-region-opening :is(.ov-region-columns,.ov-region-row){grid-template-columns:24px 1fr 160px 112px}
|
|
138
|
-
.app-shell.overview-mode .ov-region-foot{display:flex;flex:none;justify-content:space-between;gap:16px;margin-top:8px;font-size:10.5px;color:#
|
|
138
|
+
.app-shell.overview-mode .ov-region-foot{display:flex;flex:none;justify-content:space-between;gap:16px;margin-top:8px;font-size:10.5px;color:#7a8491;line-height:1.3}
|
|
139
139
|
.app-shell.overview-mode .ov-opening-value{display:block;margin-top:16px}
|
|
140
140
|
.app-shell.overview-mode .ov-opening .ov-secondary-value{margin:0}
|
|
141
141
|
.app-shell.overview-mode .ov-comparison-inline{flex-direction:row;align-items:baseline;gap:8px;border:0;padding:0;margin-top:8px;font-size:10.5px}
|
|
142
142
|
.app-shell.overview-mode .ov-comparison-inline .ov-growth{font-size:11px}
|
|
143
143
|
.app-shell.overview-mode .ov-comparison-inline .ov-previous{border-left:1px solid #edf0f3;padding-left:8px}
|
|
144
144
|
.app-shell.overview-mode .ov-sparkline{display:block;flex:1;width:100%;min-height:0;margin-top:16px;overflow:visible}
|
|
145
|
-
.app-shell.overview-mode .ov-day-axis{display:flex;justify-content:space-between;margin-top:8px;color:#
|
|
146
|
-
.app-shell.overview-mode .ov-opening-legend{display:flex;gap:16px;margin-top:8px;font-size:10.5px;color:#
|
|
145
|
+
.app-shell.overview-mode .ov-day-axis{display:flex;justify-content:space-between;margin-top:8px;color:#7a8491;font-size:10px;line-height:1}
|
|
146
|
+
.app-shell.overview-mode .ov-opening-legend{display:flex;gap:16px;margin-top:8px;font-size:10.5px;color:#7a8491;line-height:1.3;white-space:nowrap}
|
|
147
147
|
.app-shell.overview-mode .ov-opening-legend i{display:inline-block;width:14px;height:0;border-top:1.6px solid #4a6f94;margin-right:8px}
|
|
148
148
|
.app-shell.overview-mode .ov-opening-legend i.is-prior{border-top:1.2px dashed #aab3bd}
|
|
149
|
-
.app-shell.overview-mode .ov-spark-empty{display:flex;flex:1;align-items:center;color:#
|
|
150
|
-
.app-shell.overview-mode .ov-empty{margin:8px 0;color:#
|
|
149
|
+
.app-shell.overview-mode .ov-spark-empty{display:flex;flex:1;align-items:center;color:#b3bac3;margin-top:16px}
|
|
150
|
+
.app-shell.overview-mode .ov-empty{margin:8px 0;color:#7a8491;font-size:11px}
|
|
151
151
|
@media(max-width:1211px){.app-shell.overview-mode{min-width:1212px}.app-shell.overview-mode main{margin:0 16px}}
|
|
152
152
|
@media(prefers-reduced-motion:reduce){.app-shell.overview-mode *{transition:none!important;scroll-behavior:auto!important}}
|
|
153
153
|
|
|
154
154
|
.app-shell.overview-mode .ov-day-change{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-top:8px;padding:6px 8px;border-radius:6px;background:#f5f7fa;font-size:10.5px;line-height:1.3;white-space:nowrap;min-width:0}
|
|
155
155
|
.app-shell.overview-mode .ov-day-change .ov-growth em{font-size:11.5px}
|
|
156
156
|
.app-shell.overview-mode .ov-day-values{font-family:var(--ov-num),var(--ov-cn);font-variant-numeric:tabular-nums;color:#3a4552;overflow:hidden;text-overflow:ellipsis}
|
|
157
|
-
.app-shell.overview-mode .ov-day-values small{font-size:inherit;color:#
|
|
157
|
+
.app-shell.overview-mode .ov-day-values small{font-size:inherit;color:#66717e}
|
|
158
158
|
|
|
159
159
|
/* Filter area (2026-11-23, compact): start and end as two small boxes, one
|
|
160
160
|
quick-pick group that applies at once (incl. 恢复默认), 应用 and a full reset. */
|
|
@@ -262,3 +262,109 @@ body:has(.app-shell.overview-mode)::before,.app-shell.overview-mode::before{disp
|
|
|
262
262
|
.app-shell.detail-mode .focus-summary{position:static;display:flex;flex:none;flex-direction:column;gap:12px;width:100%;height:auto;min-height:0;padding:0 0 12px;background:none;overflow:hidden;container-type:inline-size}
|
|
263
263
|
.app-shell.detail-mode .details-panel{width:auto;max-width:100%;height:auto;margin:0;overflow-x:auto;overflow-y:visible}
|
|
264
264
|
}
|
|
265
|
+
|
|
266
|
+
/* 总览层次与呼吸感(2026-11-26):提高文字对比,目标达成做主强调;
|
|
267
|
+
动效只解释状态变化:数字换新时淡入、进度条与达成环平滑过渡到新值。 */
|
|
268
|
+
.app-shell.overview-mode{--ov-ease:cubic-bezier(.22,.61,.36,1)}
|
|
269
|
+
body:has(.app-shell.overview-mode){background:#edf0f4}
|
|
270
|
+
.app-shell.overview-mode .overview-shell{gap:20px}
|
|
271
|
+
.app-shell.overview-mode .overview-card{border-color:#e2e7ed;border-radius:18px;box-shadow:0 1px 2px rgba(17,24,39,.04),0 12px 32px -22px rgba(17,24,39,.22);transition:box-shadow .2s var(--ov-ease),border-color .2s var(--ov-ease)}
|
|
272
|
+
.app-shell.overview-mode :is(.ov-hero,.ov-opening):hover{border-color:#d3dae3;box-shadow:0 1px 2px rgba(17,24,39,.05),0 18px 40px -22px rgba(17,24,39,.3)}
|
|
273
|
+
.app-shell.overview-mode .ov-heading{height:22px;font-size:14px;color:#18212b}
|
|
274
|
+
.app-shell.overview-mode .ov-operation-heading{font-size:13px;color:#18212b}
|
|
275
|
+
.app-shell.overview-mode .ov-dot{width:7px;height:7px}
|
|
276
|
+
.app-shell.overview-mode .ov-action{font-size:11.5px;transition:color .2s var(--ov-ease)}
|
|
277
|
+
.app-shell.overview-mode :is(.ov-hero,.ov-opening,.ov-operation):hover .ov-action{color:#18212b}
|
|
278
|
+
.app-shell.overview-mode .ov-label{display:flex;align-items:center;gap:8px;margin-top:14px;font-size:12px;color:#4d5864}
|
|
279
|
+
.app-shell.overview-mode .ov-scope-chip{padding:1px 8px;border-radius:999px;background:#f1f3f6;color:#4d5864;font-family:var(--ov-num),var(--ov-cn);font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
280
|
+
.app-shell.overview-mode .ov-value{font-size:46px;font-weight:400;letter-spacing:-.03em}
|
|
281
|
+
.app-shell.overview-mode .ov-secondary-value{font-weight:400;color:#18212b}
|
|
282
|
+
.app-shell.overview-mode .ov-hero-values{align-items:center;flex-wrap:wrap;row-gap:12px;margin-top:10px}
|
|
283
|
+
.app-shell.overview-mode .ov-comparison{color:#4d5864}
|
|
284
|
+
/* 季度、财年 */
|
|
285
|
+
.app-shell.overview-mode .ov-periods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:20px}
|
|
286
|
+
.app-shell.overview-mode .ov-period{display:flex;flex-direction:column;gap:7px;min-width:0;padding:12px 14px 11px;border-radius:12px;background:#f5f7f9}
|
|
287
|
+
.app-shell.overview-mode .ov-period-head{display:flex;align-items:baseline;gap:6px;min-width:0;font-size:12px;font-weight:600;color:#18212b;white-space:nowrap}
|
|
288
|
+
.app-shell.overview-mode .ov-period-head small{font-size:11px;font-weight:400;color:#66717e}
|
|
289
|
+
.app-shell.overview-mode .ov-period-target{margin-left:auto;overflow:hidden;text-overflow:ellipsis;font-family:var(--ov-num),var(--ov-cn);font-size:10.5px;font-weight:400;color:#66717e}
|
|
290
|
+
.app-shell.overview-mode .ov-period-value{font-family:var(--ov-num),var(--ov-cn);font-size:21px;font-weight:500;line-height:1.15;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:#18212b;white-space:nowrap}
|
|
291
|
+
.app-shell.overview-mode .ov-period-value small{margin-left:4px;font-family:var(--ov-cn);font-size:11px;font-weight:400;letter-spacing:0;color:#66717e}
|
|
292
|
+
.app-shell.overview-mode .ov-progress{position:relative;display:block;height:5px;border-radius:3px;background:#e3e7ec}
|
|
293
|
+
.app-shell.overview-mode .ov-progress i{position:absolute;inset:0 auto 0 0;display:block;border-radius:3px;background:var(--ov-accent);transition:width .45s var(--ov-ease)}
|
|
294
|
+
.app-shell.overview-mode .ov-progress b{position:absolute;top:-3px;bottom:-3px;width:2px;margin-left:-1px;border-radius:1px;background:#18212b;opacity:.45;transition:left .45s var(--ov-ease)}
|
|
295
|
+
.app-shell.overview-mode .ov-period-foot{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 8px;min-width:0;font-size:11px;color:#4d5864;white-space:nowrap}
|
|
296
|
+
.app-shell.overview-mode .ov-period-foot b{font-family:var(--ov-num);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;color:#18212b}
|
|
297
|
+
.app-shell.overview-mode .ov-period-reason{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;color:#66717e}
|
|
298
|
+
.app-shell.overview-mode .ov-delta{padding:1px 7px;border-radius:999px;font-family:var(--ov-num),var(--ov-cn);font-size:10.5px;font-style:normal;font-weight:500;font-variant-numeric:tabular-nums}
|
|
299
|
+
.app-shell.overview-mode .ov-delta.is-up{background:#e6f2ee}
|
|
300
|
+
.app-shell.overview-mode .ov-delta.is-down{background:#f8e8e9}
|
|
301
|
+
/* 辅助指标与月度图 */
|
|
302
|
+
.app-shell.overview-mode .ov-stats{margin-top:18px}
|
|
303
|
+
.app-shell.overview-mode .ov-stats>div>span:first-child{font-size:11px;color:#66717e}
|
|
304
|
+
.app-shell.overview-mode .ov-stats b{margin-top:6px}
|
|
305
|
+
.app-shell.overview-mode .ov-chart{flex:1 0 132px}
|
|
306
|
+
.app-shell.overview-mode .ov-hero{min-height:0}
|
|
307
|
+
/* 区域经营一览:动销/发票视图加两列达成率 */
|
|
308
|
+
.app-shell.overview-mode .ov-region-tabs{gap:0;padding:2px;border-radius:9px;background:#f1f3f6}
|
|
309
|
+
.app-shell.overview-mode .ov-region-tabs button{padding:4px 12px;border-radius:7px;font-size:11.5px;color:#4d5864;transition:background .2s var(--ov-ease),color .2s var(--ov-ease)}
|
|
310
|
+
.app-shell.overview-mode .ov-region-tabs button:hover{color:#18212b}
|
|
311
|
+
.app-shell.overview-mode .ov-region-tabs button[aria-selected="true"]{background:#fff;color:#18212b;box-shadow:0 1px 2px rgba(0,0,0,.08)}
|
|
312
|
+
.app-shell.overview-mode .ov-region-movement :is(.ov-region-columns,.ov-region-row){grid-template-columns:24px minmax(104px,132px) minmax(72px,1fr) 84px 58px 84px 58px 64px;gap:14px}
|
|
313
|
+
.app-shell.overview-mode .ov-region-movement .ov-region-columns>span:nth-last-child(-n+5){text-align:right}
|
|
314
|
+
.app-shell.overview-mode .ov-region-columns{color:#66717e}
|
|
315
|
+
.app-shell.overview-mode .ov-region-name{color:#18212b}
|
|
316
|
+
.app-shell.overview-mode .ov-region-row{transition:background .15s var(--ov-ease)}
|
|
317
|
+
.app-shell.overview-mode .ov-region-row:not(:disabled):hover{background:#f7f9fb}
|
|
318
|
+
.app-shell.overview-mode .ov-att{display:flex;flex-direction:column;align-items:flex-end;gap:6px;min-width:0;font-family:var(--ov-num);font-variant-numeric:tabular-nums}
|
|
319
|
+
.app-shell.overview-mode .ov-att b{font-size:12.5px;font-weight:600;line-height:1.3;color:#18212b;white-space:nowrap}
|
|
320
|
+
.app-shell.overview-mode .ov-att i{position:relative;display:block;width:100%;max-width:52px;height:3px;border-radius:2px;background:#eceff3;overflow:hidden}
|
|
321
|
+
.app-shell.overview-mode .ov-att s{position:absolute;inset:0 auto 0 0;display:block;border-radius:2px;background:#c45a62}
|
|
322
|
+
.app-shell.overview-mode .ov-att[data-region-metric="movementAttainment"] s{background:#2f8a74}
|
|
323
|
+
.app-shell.overview-mode .ov-att:not([data-state="available"]) b{font-weight:400;color:#b3bac3}
|
|
324
|
+
/* 数字换新:短淡入,读数不滚动 */
|
|
325
|
+
@keyframes ov-refresh{from{opacity:.3;transform:translateY(2px)}to{opacity:1;transform:none}}
|
|
326
|
+
.app-shell.overview-mode :is(.ov-refresh,.ov-region-list){animation:ov-refresh .26s var(--ov-ease) both}
|
|
327
|
+
@media(max-width:900px){.app-shell.overview-mode .ov-value{font-size:40px}}
|
|
328
|
+
@media(max-width:760px){
|
|
329
|
+
.app-shell.overview-mode .ov-region-movement :is(.ov-region-columns,.ov-region-row){grid-template-columns:minmax(64px,1fr) 60px 44px 60px 44px;gap:6px}
|
|
330
|
+
.app-shell.overview-mode .ov-region-movement :is(.ov-region-columns,.ov-region-row)>:is(:nth-child(1),:nth-child(3)){display:none}
|
|
331
|
+
.app-shell.overview-mode .ov-region-movement .ov-number{font-size:12.5px}
|
|
332
|
+
}
|
|
333
|
+
@media(max-width:480px){.app-shell.overview-mode .ov-periods{grid-template-columns:minmax(0,1fr)}}
|
|
334
|
+
@media(prefers-reduced-motion:reduce){.app-shell.overview-mode *{animation:none!important}}
|
|
335
|
+
.app-shell.overview-mode .ov-period-time{margin-left:8px;color:#66717e}
|
|
336
|
+
.app-shell.overview-mode .ov-opening .ov-heading .ov-scope-chip{margin-left:2px;font-weight:400}
|
|
337
|
+
.app-shell.overview-mode .ov-spark-empty{justify-content:center;padding:0 8px;font-size:11.5px;line-height:1.6;text-align:center;color:#7a8491}
|
|
338
|
+
.app-shell.overview-mode .ov-period{padding:12px 12px 11px}
|
|
339
|
+
.app-shell.overview-mode .ov-period-foot b{font-size:12.5px}
|
|
340
|
+
.app-shell.overview-mode .ov-period-time{margin-left:6px}
|
|
341
|
+
.app-shell.overview-mode .ov-delta{padding:1px 6px}
|
|
342
|
+
/* 手机窄屏:区域页签与时间区换行,不出现横向滚动 */
|
|
343
|
+
@media(max-width:760px){
|
|
344
|
+
.app-shell.overview-mode .ov-region-header{flex-wrap:wrap;row-gap:8px}
|
|
345
|
+
.app-shell.overview-mode .ov-region-note{white-space:normal}
|
|
346
|
+
.app-shell.overview-mode .ov-region-tabs{width:100%;margin-left:0}
|
|
347
|
+
.app-shell.overview-mode .ov-region-tabs button{flex:1}
|
|
348
|
+
.app-shell.overview-mode .filter-bar .period-range{flex:1 1 100%;min-width:0}
|
|
349
|
+
.app-shell.overview-mode .filter-bar .period-date{flex:1 1 0;min-width:0}
|
|
350
|
+
.app-shell.overview-mode .filter-bar .period-date input{width:100%;min-width:0}
|
|
351
|
+
}
|
|
352
|
+
@media(max-width:480px){.app-shell.overview-mode .filter-bar .period-date>span{display:none}}
|
|
353
|
+
.app-shell.overview-mode main>.filter-bar>.period-bar{height:auto;min-height:52px}
|
|
354
|
+
@media(max-width:480px){
|
|
355
|
+
.app-shell.overview-mode .ov-hero-values .ov-comparison{padding-left:0;border-left:0}
|
|
356
|
+
.app-shell.overview-mode .ov-stats{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:14px}
|
|
357
|
+
.app-shell.overview-mode .ov-stats>div:nth-child(3){padding-left:0;border-left:0}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* 当月(区间)达成:整行进度条 */
|
|
361
|
+
.app-shell.overview-mode .ov-month-target{display:flex;align-items:center;gap:12px;min-width:0;margin-top:16px;font-size:12px;color:#4d5864;white-space:nowrap}
|
|
362
|
+
.app-shell.overview-mode .ov-mt-label b{margin-left:6px;font-family:var(--ov-num);font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;color:#18212b}
|
|
363
|
+
.app-shell.overview-mode .ov-month-target .ov-progress{flex:1 1 auto;min-width:48px}
|
|
364
|
+
.app-shell.overview-mode .ov-mt-meta{display:flex;align-items:center;gap:8px;min-width:0;font-family:var(--ov-num),var(--ov-cn);font-size:11px;color:#66717e;font-variant-numeric:tabular-nums}
|
|
365
|
+
.app-shell.overview-mode .ov-mt-meta.ov-period-reason{display:block;max-width:55%}
|
|
366
|
+
.app-shell.overview-mode .ov-value{font-size:44px}
|
|
367
|
+
.app-shell.overview-mode .ov-hero-values{gap:20px}
|
|
368
|
+
.app-shell.overview-mode .ov-comparison{padding-left:20px}
|
|
369
|
+
@media(max-width:480px){.app-shell.overview-mode .ov-month-target{flex-wrap:wrap;row-gap:8px}.app-shell.overview-mode .ov-month-target .ov-progress{flex-basis:100%;order:3}}
|
|
370
|
+
@media(max-width:900px){.app-shell.overview-mode .ov-value{font-size:38px}}
|