新增:查询页面快照并修复筛选选框闪烁

页面快照支持勾选查询条件、指标卡片、趋势、汇总表、不良构成和细分缺陷图,复制PNG或下载;增加取消、分阶段提示和等待超时恢复。

修复公共Select弹层准备帧被opacity覆盖导致的先闪出再展开,并取消查询字段原生label的重复点击转发。

同步已经验收上线的销售订单类型映射、排除筛选及预聚合,以及其线上权限、删除确认配套源码;保留既有公式编辑和名录编码修改。源码范围按发布清单冻结,不纳入本机数据、凭据及未发布工作。

验证:前后端独立源码构建通过;10项前端检查、4项订单分类单元测试通过;实际系统剪贴板粘贴PNG验证通过;线上配置及筛选结果与发布前一致,后端未重启。
This commit is contained in:
2026-11-04 00:15:32 +08:00
parent 54813accaa
commit c3354c1f64
106 changed files with 1678 additions and 353 deletions
+3 -1
View File
@@ -1,3 +1,4 @@
import { useDeleteConfirmation } from './useDeleteConfirmation';
import { useEffect, useRef, useState } from 'react';
import { Alert, Button, Form, Input, Modal, Select } from 'antd';
import { ArrowDownOutlined, ArrowUpOutlined, PlusOutlined } from '@ant-design/icons';
@@ -13,6 +14,7 @@ const missingLabels: Record<string, string> = { PROPAGATE:'任一输入缺失,
const outcomeLabels: Record<string, string> = { ONE:'取1', ZERO:'取0', NULL:'保留空白', ERROR:'停止并报错' };
export function ResultFormulaModal({ result, existing, schema, availableTargets, onCancel, onApply }: Props) {
const confirmDelete = useDeleteConfirmation();
const [draft, setDraft] = useState<ResultFormula>(() => structuredClone(result));
const [error, setError] = useState('');
const errorHost = useRef<HTMLDivElement>(null);
@@ -69,7 +71,7 @@ export function ResultFormulaModal({ result, existing, schema, availableTargets,
{branchIndexes.length === 0 && baseFormula}
{(branchIndexes.length > 0) && <p className="result-priority-hint">{draft.rules.some(rule=>rule.otherwiseFormula !== undefined) ? '已设置其他情况取值,最终取值以完整公式为准。' : '条件同时满足时,上方分支优先。'}</p>}
{branchIndexes.map((index, position) => { const rule=draft.rules[index], when=obj(rule.when); return <section className="result-condition-branch" key={index}>
<div className="result-branch-heading"><strong>条件 {position + 1}</strong><span className="task-actions"><Button size="small" type="text" aria-label={`条件${position+1}提高优先级`} icon={<ArrowUpOutlined/>} disabled={position===0} onClick={()=>moveBranch(index,-1)}/><Button size="small" type="text" aria-label={`条件${position+1}降低优先级`} icon={<ArrowDownOutlined/>} disabled={position===branchIndexes.length-1} onClick={()=>moveBranch(index,1)}/><Button size="small" type="link" danger onClick={()=>remove(index)}>移除</Button></span></div>
<div className="result-branch-heading"><strong>条件 {position + 1}</strong><span className="task-actions"><Button size="small" type="text" aria-label={`条件${position+1}提高优先级`} icon={<ArrowUpOutlined/>} disabled={position===0} onClick={()=>moveBranch(index,-1)}/><Button size="small" type="text" aria-label={`条件${position+1}降低优先级`} icon={<ArrowDownOutlined/>} disabled={position===branchIndexes.length-1} onClick={()=>moveBranch(index,1)}/><Button size="small" type="link" danger onClick={()=>confirmDelete({title:`移除条件 ${position + 1}?`,description:"将从当前结果公式中移除此条件分支,点击“应用修改”后更新编辑内容,保存并更新报表后生效。",confirmText:"确认移除",onConfirm:()=>remove(index)})}>移除</Button></span></div>
<div className="result-condition-fields">
<Form.Item label="条件字段" htmlFor={`result-field-${index}`}><Select id={`result-field-${index}`} {...readableSelectPopup} value={String(when.field || '')} options={Object.entries(fields).map(([value,name])=>({value,label:String(name)}))} onChange={field=>condition(index,{field})}/></Form.Item>
<Form.Item label="判断方式" htmlFor={`result-operator-${index}`}><Select id={`result-operator-${index}`} value={String(when.operator || '')} options={strings(schema.conditionOperators).map(value=>({value,label:conditionOperators[value]||value}))} onChange={operator=>condition(index,{operator})}/></Form.Item>