新增:查询页面快照并修复筛选选框闪烁
页面快照支持勾选查询条件、指标卡片、趋势、汇总表、不良构成和细分缺陷图,复制PNG或下载;增加取消、分阶段提示和等待超时恢复。 修复公共Select弹层准备帧被opacity覆盖导致的先闪出再展开,并取消查询字段原生label的重复点击转发。 同步已经验收上线的销售订单类型映射、排除筛选及预聚合,以及其线上权限、删除确认配套源码;保留既有公式编辑和名录编码修改。源码范围按发布清单冻结,不纳入本机数据、凭据及未发布工作。 验证:前后端独立源码构建通过;10项前端检查、4项订单分类单元测试通过;实际系统剪贴板粘贴PNG验证通过;线上配置及筛选结果与发布前一致,后端未重启。
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useDeleteConfirmation } from './useDeleteConfirmation';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
Alert, App, Button, Empty, Form, Input, InputNumber, Modal, Popconfirm,
|
||||
@@ -200,6 +201,7 @@ export function M01Insights({ query, onUnauthorized }: { query: QueryParams; onU
|
||||
}
|
||||
|
||||
export function M02SavedViews({ query, view, onUnauthorized, onApply }: { query: QueryParams; view: ViewKind; onUnauthorized: (error: unknown) => boolean; onApply: (context: Partial<QueryParams>) => void }) {
|
||||
const confirmDelete = useDeleteConfirmation();
|
||||
const { message } = App.useApp();
|
||||
const [items, setItems] = useState<Row[]>([]);
|
||||
const [sharedItems, setSharedItems] = useState<Row[]>([]);
|
||||
@@ -293,7 +295,7 @@ export function M02SavedViews({ query, view, onUnauthorized, onApply }: { query:
|
||||
{ title: '视图名称', dataIndex: 'name', key: 'name', width: 210 },
|
||||
{ title: '分组维度', key: 'groupBy', width: 140, render: (_, row) => text(record(row.definition).groupBy, '总体') },
|
||||
{ title: '数据范围', key: 'dataScope', width: 180, render: () => '打开时使用当前数据' },
|
||||
{ title: '操作', key: 'actions', width: 250, render: (_, row) => <span className="completion-actions"><Button type="link" loading={busyId === String(row.id)} onClick={() => void open(row)}>打开</Button><Button type="link" onClick={() => void manageShares(row)}>共享</Button><Popconfirm title="删除此个人比较视图?" onConfirm={() => void remove(row)}><Button type="link" danger loading={busyId === String(row.id)}>删除</Button></Popconfirm></span> },
|
||||
{ title: '操作', key: 'actions', width: 250, render: (_, row) => <span className="completion-actions"><Button type="link" loading={busyId === String(row.id)} onClick={() => void open(row)}>打开</Button><Button type="link" onClick={() => void manageShares(row)}>共享</Button><Button type="link" danger loading={busyId === String(row.id)} onClick={()=>confirmDelete({title:`删除个人视图“${text(row.name || row.title,"当前视图")}”?`,description:"确认后立即删除此个人比较视图,原始业务数据保留。",onConfirm:()=>remove(row)})}>删除</Button></span> },
|
||||
];
|
||||
const sharedColumns: ColumnsType<Row> = [
|
||||
{ title: '视图名称', dataIndex: 'name', key: 'name', width: 230 },
|
||||
@@ -336,6 +338,7 @@ export function M02SavedViews({ query, view, onUnauthorized, onApply }: { query:
|
||||
}
|
||||
|
||||
export function ScrapAnalyticsPanel({ query, onUnauthorized }: { query: QueryParams; onUnauthorized: (error: unknown) => boolean }) {
|
||||
const confirmDelete = useDeleteConfirmation();
|
||||
const [stage, setStage] = useState<Stage>('black');
|
||||
const [dimension, setDimension] = useState('category');
|
||||
const [limit, setLimit] = useState(10);
|
||||
@@ -493,7 +496,7 @@ export function ScrapAnalyticsPanel({ query, onUnauthorized }: { query: QueryPar
|
||||
{ title: '阶段 / 对象', dataIndex: 'subject', key: 'subject', width: 260, render: value => typeof value === 'string' ? value : (() => { const subject = record(value); return `${subject.stage === 'black' ? '黑片' : subject.stage === 'bright' ? '亮片' : '—'} · ${text(subject.label)}`; })() },
|
||||
{ title: '重算综合率', key: 'snapshot', align: 'right', width: 130, render: (_, row) => { const summary = record(record(row.metricSnapshot || row.snapshot).summary); return pct(summary.compositeRate); } },
|
||||
{ title: '证据状态', key: 'evidence', width: 125, render: (_, row) => row.evidenceAvailable === false ? <Tag color="gold">当前不可见</Tag> : <Tag color="green">已重新授权</Tag> },
|
||||
{ title: '操作', key: 'remove', width: 90, render: (_, row) => <Button type="link" danger loading={checklistBusy} onClick={() => void removeChecklistItem(row)}>移除</Button> },
|
||||
{ title: '操作', key: 'remove', width: 90, render: (_, row) => <Button type="link" danger loading={checklistBusy} onClick={() => confirmDelete({title:`移除核查证据“${text(row.title || row.label || row.name || row.objectKey,"当前证据")}”?`,description:"仅从核查清单中移除这项证据,原始业务数据保留;确认后立即生效。",confirmText:"确认移除",onConfirm:()=>removeChecklistItem(row)})}>移除</Button> },
|
||||
];
|
||||
const impactRows = list(impactResult?.groups);
|
||||
const impactColumns: ColumnsType<Row> = [
|
||||
@@ -541,6 +544,7 @@ export function ScrapAnalyticsPanel({ query, onUnauthorized }: { query: QueryPar
|
||||
}
|
||||
|
||||
export function TargetVersionAdmin({ onUnauthorized }: { onUnauthorized: (error: unknown) => boolean }) {
|
||||
const confirmDelete = useDeleteConfirmation();
|
||||
const { message } = App.useApp();
|
||||
const [items, setItems] = useState<Row[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -583,10 +587,7 @@ export function TargetVersionAdmin({ onUnauthorized }: { onUnauthorized: (error:
|
||||
? { ...item, values: { ...record(item.values), [String(year)]: value } }
|
||||
: item));
|
||||
};
|
||||
const removeRow = (row: Row) => {
|
||||
const key = String(row.editorKey || '');
|
||||
setTargetRows(current => current.filter(item => String(item.editorKey || '') !== key));
|
||||
};
|
||||
const removeRow = (row: Row) => confirmDelete({title:`删除“${dimensionKeys.map(key=>String(row[key]||'')).filter(Boolean).join(' / ') || '总体'}”的目标行?`,description:`将移除当前编辑内容中“${metricOptions.find(item=>item.value===row.metric)?.label || '所选指标'}”及其各年度目标,保存目标后生效。`,onConfirm:()=>{const key=String(row.editorKey || '');setTargetRows(current=>current.filter(item=>String(item.editorKey || '')!==key));}});
|
||||
const isScopeRow = (row: Row) => row.editorScope === true;
|
||||
const overallRows = targetRows.filter(row => !isScopeRow(row));
|
||||
const scopeRows = targetRows.filter(isScopeRow);
|
||||
|
||||
Reference in New Issue
Block a user