优化:未分类连续维护与柏拉图预汇总,同步已发布修复
This commit is contained in:
+43
-73
@@ -15,6 +15,9 @@ import { usePageCache, useMaintenanceRefresh } from './pageCache';
|
||||
import { FilterFieldSettings } from './FilterFieldSettings';
|
||||
import { isInternalDataField, publicJson, readableRuleDescription } from './publicDataDisplay';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useClassificationQueue } from './useClassificationQueue';
|
||||
import { useUnclassifiedInventory } from './useUnclassifiedInventory';
|
||||
import type { ClassificationCommand } from './classificationQueue';
|
||||
import {
|
||||
Alert,
|
||||
App,
|
||||
@@ -386,6 +389,8 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
const [form] = Form.useForm<{ name: string; description: string }>();
|
||||
const [draftDefinition, setDraftDefinition] = useState<ConfigDefinition>({});
|
||||
const loadedDefinitionKey=useRef('');
|
||||
const loadedDefinition=useRef('');
|
||||
const classificationUpdates=useClassificationQueue(kind==='mappings'?String(user.id):'inactive-'+kind);
|
||||
const [ruleSchema, setRuleSchema] = useState<Record<string, unknown> | null>(null);
|
||||
const [ruleSchemaError, setRuleSchemaError] = useState('');
|
||||
const [publishedNames, setPublishedNames] = useState<PublishedConfigNames | null>(null);
|
||||
@@ -405,8 +410,8 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
? { ...items.find(item => String(item.id || '') === String(workflowStatus.activeMapping?.id || '')), ...workflowStatus.activeMapping }
|
||||
: items.find(item => String(item.status).toUpperCase() === 'ACTIVE');
|
||||
|
||||
const load = async () => {
|
||||
setLoading(true);
|
||||
const load = async (silent = false) => {
|
||||
if(!silent)setLoading(true);
|
||||
try {
|
||||
const result = isRules ? await api.rules() : await api.mappings();
|
||||
setItems(collectionItems(result)); setError('');
|
||||
@@ -438,7 +443,7 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
const definition = isRules && testMode && String(active?.id ?? fallback?.id) === 'pq-dax-v1' && ruleSchema?.defaultDefinition
|
||||
? ruleSchema.defaultDefinition : storedDefinition;
|
||||
const definitionKey=JSON.stringify([kind,active?.id??fallback?.id,definition]);
|
||||
if (definition && typeof definition === 'object' && loadedDefinitionKey.current!==definitionKey) {loadedDefinitionKey.current=definitionKey;setDraftDefinition(JSON.parse(JSON.stringify(definition)) as ConfigDefinition);}
|
||||
if (definition && typeof definition === 'object' && loadedDefinitionKey.current!==definitionKey) {loadedDefinitionKey.current=definitionKey;const serialized=JSON.stringify(definition),prior=loadedDefinition.current;setDraftDefinition(previous=>!prior||JSON.stringify(previous)===prior?JSON.parse(serialized) as ConfigDefinition:previous);loadedDefinition.current=serialized;}
|
||||
const metadata = items.find(row => String(row.id) === String(active?.id)) ?? fallback;
|
||||
form.setFieldsValue({ name: testMode ? currentConfigurationName(active?.name ?? metadata?.name, metadata?.createdAt) : isRules ? ruleDisplayName(active?.name || fallback?.name || '测试计算规则') : String(active?.name || fallback?.name || '测试基础数据与对应关系'), description: isRules ? readableRuleDescription(active?.description || fallback?.description) : String(active?.description || fallback?.description || '') });
|
||||
}, [workflowStatus, items, kind, isRules, testMode, ruleSchema]);
|
||||
@@ -556,6 +561,10 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
];
|
||||
|
||||
const simpleStageLabel: Record<string, string> = { QUEUED: '等待处理', VALIDATING: '检查配置与来源', VERSION_CREATED: '保存配置', CLASSIFYING_UNASSIGNED:'处理未分类记录', REBUILDING: '重新计算报表', PUBLISHING: '更新当前报表', COMPLETED: '已完成', FAILED: '处理失败' };
|
||||
const saveClassification = (command: ClassificationCommand) => {
|
||||
classificationUpdates.queue.enqueue(command,draftDefinition,Array.isArray(matchMetadata?.defaultRules)?matchMetadata.defaultRules:[]);
|
||||
};
|
||||
const classificationBusy=classificationUpdates.jobs.some(job=>!['failed','completed'].includes(job.status));
|
||||
const applyCurrent = async () => {
|
||||
try {
|
||||
await form.validateFields();
|
||||
@@ -567,15 +576,19 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
}
|
||||
};
|
||||
|
||||
useMaintenanceRefresh(() => { void load(); void refreshWorkflowStatus(); void loadEditorSupport(); });
|
||||
useMaintenanceRefresh(() => { void load(true); void refreshWorkflowStatus(); void loadEditorSupport(); });
|
||||
if (!workflowStatusLoaded) return <div className="management-page"><div className="loading-panel"><Spin />正在读取当前维护模式…</div></div>;
|
||||
if (testMode) {
|
||||
const notices = <>
|
||||
{kind==='mappings'&&classificationUpdates.jobs.some(job=>job.status!=='completed')&&<div className="classification-queue-status" role="status">
|
||||
{classificationBusy&&<span><Spin size="small"/> 后台更新中 · {classificationUpdates.jobs.filter(job=>!['failed','completed'].includes(job.status)).length} 条</span>}
|
||||
{classificationUpdates.jobs.filter(job=>['failed','paused'].includes(job.status)).map(job=><Alert key={job.id} type="error" showIcon message={`${job.target}:${job.error}`} action={<><Button size="small" onClick={()=>classificationUpdates.queue.retry(job.id)}>重试</Button>{job.status==='failed'&&<Button size="small" onClick={()=>classificationUpdates.queue.dismiss(job.id)}>关闭</Button>}</>}/>)}
|
||||
</div>}
|
||||
{error && <Alert showIcon type="error" message="配置清单读取失败" description={error} />}
|
||||
{isRules && ruleSchemaError && <Alert showIcon type="error" message="规则编辑结构读取失败" description={ruleSchemaError} />}
|
||||
{!canApplyWorkflow && <Alert showIcon type="info" message="当前账号可查看配置;保存和更新报表需要发布权限。" />}
|
||||
{workflowOperation.error && <Alert showIcon type="error" message="保存或报表更新失败" description={workflowOperation.error} action={workflowOperation.operation?.operationId ? <Button size="small" onClick={workflowOperation.resume}>重试读取进度</Button> : undefined} />}
|
||||
{workflowOperation.operation && <section className="nc-operation-status panel"><div><strong>{simpleStageLabel[String(workflowOperation.operation.stage || workflowOperation.operation.status)] || '正在处理'}</strong></div><Progress percent={workflowOperation.busy ? undefined : String(workflowOperation.operation.status).toUpperCase() === 'COMPLETED' ? 100 : 0} status={String(workflowOperation.operation.status).toUpperCase() === 'FAILED' ? 'exception' : workflowOperation.busy ? 'active' : 'success'} /></section>}
|
||||
{workflowOperation.operation && <section className="nc-operation-status panel"><div><strong>{simpleStageLabel[String(workflowOperation.operation.stage || workflowOperation.operation.status)] || '正在处理'}</strong></div>{workflowOperation.busy ? <Spin size="small" /> : <Progress percent={String(workflowOperation.operation.status).toUpperCase() === 'COMPLETED' ? 100 : 0} status={String(workflowOperation.operation.status).toUpperCase() === 'FAILED' ? 'exception' : 'success'} />}</section>}
|
||||
</>;
|
||||
const editor = (mode: 'catalog' | 'lookups' | 'matchRules' | 'rules') => <div className="management-page nc-simplified-config-page flat-config-page">
|
||||
{notices}
|
||||
@@ -590,14 +603,14 @@ function ConfigManagementPage({ kind, user, onUnauthorized, onNavigate, extraSec
|
||||
: mode === 'lookups' ? <MappingDefinitionEditor value={draftDefinition} onChange={setDraftDefinition} simplified readOnly={!canApplyWorkflow} />
|
||||
: <MatchRulesDefinitionEditor value={draftDefinition} onChange={setDraftDefinition} metadata={matchMetadata??workflowStatus} readOnly={!canApplyWorkflow} />}
|
||||
{!isRules && validateStructuredMappingDefinition(draftDefinition, publishedNames?.groupDepartments).length > 0 && <Alert showIcon type="warning" message="有名录引用需要留意" description={<ul className="structured-config-error-list">{validateStructuredMappingDefinition(draftDefinition, publishedNames?.groupDepartments).slice(0,12).map((issue,index)=><li key={index}>{issue}</li>)}</ul>} />}
|
||||
{canApplyWorkflow && <div className="nc-simple-save-row"><span>保存后检查配置并更新报表。</span><Button type="primary" size="large" disabled={workflowOperation.busy || (isRules && !ruleSchema)} loading={workflowOperation.busy} onClick={() => void applyCurrent()}>保存并更新报表</Button></div>}
|
||||
{canApplyWorkflow && <div className="nc-simple-save-row"><span>保存后检查配置并更新报表。</span><Button type="primary" size="large" disabled={workflowOperation.busy || classificationBusy || (isRules && !ruleSchema)} loading={workflowOperation.busy} onClick={() => void applyCurrent()}>保存并更新报表</Button></div>}
|
||||
</section>
|
||||
</div>;
|
||||
if (kind === 'masterData') return <><Form form={form} component={false} />{editor('catalog')}</>;
|
||||
if (kind === 'mappings') return <MappingEditorContext.Provider value={{definition:draftDefinition,update:setDraftDefinition,ready:!loading && !!workflowMappingBase?.id && !!matchMetadata,defaultRules:Array.isArray(matchMetadata?.defaultRules)?matchMetadata.defaultRules:[],projectGroups:publishedNames?.projectGroups??[],groups:Array.isArray((draftDefinition.masterData as Record<string,unknown>|undefined)?.groups)?((draftDefinition.masterData as Record<string,unknown>).groups as Record<string,unknown>[]).filter(row=>row.enabled!==false).map(row=>String(row.name)):publishedNames?.groups??[]}}><Form form={form} component={false} /><ManagementSections items={[
|
||||
if (kind === 'mappings') return <MappingEditorContext.Provider value={{definition:draftDefinition,update:setDraftDefinition,saveAndApply:saveClassification,classificationJobs:classificationUpdates.jobs,acknowledgeClassifications:ids=>classificationUpdates.queue.acknowledge(ids),ready:canApplyWorkflow && !loading && !workflowOperation.busy && !!workflowMappingBase?.id && !!matchMetadata,defaultRules:Array.isArray(matchMetadata?.defaultRules)?matchMetadata.defaultRules:[],projectGroups:publishedNames?.projectGroups??[],groups:Array.isArray((draftDefinition.masterData as Record<string,unknown>|undefined)?.groups)?((draftDefinition.masterData as Record<string,unknown>).groups as Record<string,unknown>[]).filter(row=>row.enabled!==false).map(row=>String(row.name)):publishedNames?.groups??[]}}><Form form={form} component={false} /><ManagementSections items={[
|
||||
{ key: 'lookups', label: '基础对应', children: editor('lookups') },
|
||||
{ key: 'matchRules', label: '条件匹配', children: editor('matchRules') },
|
||||
...(extraSections ?? []),
|
||||
...(extraSections ?? []).map(section => ({ ...section, children: <>{notices}{section.children}</> })),
|
||||
]} /></MappingEditorContext.Provider>;
|
||||
return editor('rules');
|
||||
}
|
||||
@@ -690,31 +703,12 @@ function MappingMaintenancePage({ user, onUnauthorized, onNavigate }: Omit<Manag
|
||||
}
|
||||
|
||||
function UnclassifiedSourcesPanel({ onUnauthorized, onEdit }: { onUnauthorized: (error: unknown) => boolean; onEdit?: (selection: ClassificationSelection) => void }) {
|
||||
const [items, setItems] = useState<Record<string, unknown>[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
const { refreshKey } = usePageCache();
|
||||
const pages = useRef(new Map<string, Promise<ReturnType<typeof unwrapItems>>>());
|
||||
const loadRevision = useRef(0);
|
||||
const load = async (force = false) => {
|
||||
const revision = ++loadRevision.current;
|
||||
const key = `${refreshKey}:${page}`;
|
||||
if (force) pages.current.clear();
|
||||
setLoading(true);
|
||||
let request: Promise<ReturnType<typeof unwrapItems>> | undefined;
|
||||
try {
|
||||
request = pages.current.get(key) ?? api.unclassifiedSources(page, TABLE_PAGE_SIZE).then(unwrapItems);
|
||||
pages.current.set(key, request);
|
||||
if (pages.current.size > 12) pages.current.delete(pages.current.keys().next().value!);
|
||||
const result = await request;
|
||||
if (revision !== loadRevision.current) return;
|
||||
setItems(result.items); setTotal(Number(result.total ?? result.items.length)); setError('');
|
||||
} catch (value) { if (pages.current.get(key) === request) pages.current.delete(key); if (revision === loadRevision.current && !onUnauthorized(value)) setError(apiMessage(value)); }
|
||||
finally { if (revision === loadRevision.current) setLoading(false); }
|
||||
};
|
||||
useEffect(() => { void load(); }, [page]);
|
||||
const inventory=useUnclassifiedInventory('group',onUnauthorized);
|
||||
const [page,setPage]=useState(1);
|
||||
const total=inventory.items.length;
|
||||
const currentPage=Math.min(page,Math.max(1,Math.ceil(total/TABLE_PAGE_SIZE)));
|
||||
const items=inventory.items.slice((currentPage-1)*TABLE_PAGE_SIZE,currentPage*TABLE_PAGE_SIZE);
|
||||
const {loading,error}=inventory;
|
||||
const columns: ColumnsType<Record<string, unknown>> = [
|
||||
{ title: '阶段', dataIndex: 'stage', width: 85, render: value => value === 'black' ? '黑片' : '亮片' },
|
||||
{ title: '产业部', dataIndex: 'department', width: 140, render: toText },
|
||||
@@ -727,50 +721,27 @@ function UnclassifiedSourcesPanel({ onUnauthorized, onEdit }: { onUnauthorized:
|
||||
{ title: '总重量 / kg', dataIndex: 'totalWeight', width: 140, align: 'right' },
|
||||
{ title: '操作', key: 'action', width: 125, fixed: 'right', render: (_, row) => <Button type="link" disabled={!onEdit} onClick={() => onEdit?.({ kind: 'group', row })}>编辑分类</Button> },
|
||||
];
|
||||
useMaintenanceRefresh(() => { void load(true); });
|
||||
return <div className="management-page">
|
||||
{error && <Alert type="error" showIcon message={error} />}
|
||||
<section className="panel section-panel">
|
||||
<div className="resource-toolbar"><strong>业务分组未分类汇总</strong><div className="completion-actions"><span>共 {total} 条</span><Button icon={<ReloadOutlined />} onClick={() => void load(true)}>刷新</Button></div></div>
|
||||
<div className="resource-table"><Table size="small" bordered loading={loading} columns={columns} dataSource={items} rowKey={row => JSON.stringify([row.stage, row.department, row.product, row.sourceKey])} pagination={false} indexOffset={(page - 1) * TABLE_PAGE_SIZE} scroll={{ x: 1280 }} /></div>
|
||||
{total > TABLE_PAGE_SIZE && <Pagination className="records-pagination" current={page} pageSize={TABLE_PAGE_SIZE} total={total} onChange={setPage} />}
|
||||
<div className="resource-toolbar"><strong>业务分组未分类汇总</strong><div className="completion-actions"><span>共 {total} 条</span><Button icon={<ReloadOutlined />} onClick={() => void inventory.refresh()}>刷新</Button></div></div>
|
||||
<div className="resource-table"><Table size="small" bordered loading={loading} columns={columns} dataSource={items} rowKey={row => JSON.stringify([row.stage, row.department, row.product, row.sourceKey])} pagination={false} indexOffset={(currentPage - 1) * TABLE_PAGE_SIZE} scroll={{ x: 1280 }} /></div>
|
||||
{total > TABLE_PAGE_SIZE && <Pagination className="records-pagination" current={currentPage} pageSize={TABLE_PAGE_SIZE} total={total} onChange={setPage} />}
|
||||
</section>
|
||||
</div>;
|
||||
}
|
||||
|
||||
function MappingIssueResolutionPanel({ onUnauthorized, onEdit }: { onUnauthorized: (error: unknown) => boolean; onEdit?: (selection: ClassificationSelection) => void }) {
|
||||
const [items, setItems] = useState<Record<string, unknown>[]>([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(1);
|
||||
const [customerCode, setCustomerCode] = useState<string>();
|
||||
const [businessGroup, setBusinessGroup] = useState<string>();
|
||||
const [department, setDepartment] = useState<string>();
|
||||
const [filterOptions, setFilterOptions] = useState<{ customerCodes: string[]; businessGroups: string[]; departments: string[] }>({ customerCodes: [], businessGroups: [], departments: [] });
|
||||
const [loading, setLoading] = useState(true);
|
||||
const loadRevision = useRef(0);
|
||||
const [error, setError] = useState('');
|
||||
|
||||
const { refreshKey } = usePageCache();
|
||||
const pages = useRef(new Map<string, ReturnType<typeof api.unclassifiedProjects>>());
|
||||
const load = async (force = false) => {
|
||||
const revision = ++loadRevision.current;
|
||||
const key = JSON.stringify([refreshKey, page, customerCode, businessGroup, department]);
|
||||
if (force) pages.current.clear();
|
||||
setLoading(true);
|
||||
let request: ReturnType<typeof api.unclassifiedProjects> | undefined;
|
||||
try {
|
||||
request = pages.current.get(key) ?? api.unclassifiedProjects({ page, pageSize: TABLE_PAGE_SIZE, customerCode, businessGroup, department });
|
||||
pages.current.set(key, request);
|
||||
if (pages.current.size > 12) pages.current.delete(pages.current.keys().next().value!);
|
||||
const result = await request;
|
||||
if (revision !== loadRevision.current) return;
|
||||
setFilterOptions(result.filterOptions ?? { customerCodes: [], businessGroups: [], departments: [] });
|
||||
const normalized = unwrapItems(result);
|
||||
setItems(normalized.items); setTotal(Number(normalized.total || normalized.items.length)); setError('');
|
||||
} catch (value) { if (pages.current.get(key) === request) pages.current.delete(key); if (revision === loadRevision.current && !onUnauthorized(value)) setError(apiMessage(value)); }
|
||||
finally { if (revision === loadRevision.current) setLoading(false); }
|
||||
};
|
||||
useEffect(() => { void load(); }, [page, customerCode, businessGroup, department]);
|
||||
const inventory=useUnclassifiedInventory('projectGroup',onUnauthorized);
|
||||
const [page,setPage]=useState(1);
|
||||
const [customerCode,setCustomerCode]=useState<string>();
|
||||
const [businessGroup,setBusinessGroup]=useState<string>();
|
||||
const [department,setDepartment]=useState<string>();
|
||||
const {loading,error}=inventory;
|
||||
const filtered=inventory.items.filter(row=>(!customerCode||row.customerCode===customerCode)&&(!businessGroup||row.businessGroup===businessGroup)&&(!department||(Array.isArray(row.departments)&&row.departments.includes(department))));
|
||||
const total=filtered.length,currentPage=Math.min(page,Math.max(1,Math.ceil(total/TABLE_PAGE_SIZE)));
|
||||
const items=filtered.slice((currentPage-1)*TABLE_PAGE_SIZE,currentPage*TABLE_PAGE_SIZE);
|
||||
const filterOptions={customerCodes:[...new Set(inventory.all.map(row=>String(row.customerCode)))].sort(),businessGroups:[...new Set(inventory.all.map(row=>String(row.businessGroup)))].sort(),departments:[...new Set(inventory.all.flatMap(row=>Array.isArray(row.departments)?row.departments.map(String):[]))].sort()};
|
||||
const columns: ColumnsType<Record<string, unknown>> = [
|
||||
{ title: '客户代码', dataIndex: 'customerCode', key: 'customerCode', fixed: 'left', width: 120, render: toText },
|
||||
{ title: '业务分组', dataIndex: 'businessGroup', key: 'businessGroup', width: 190, render: toText },
|
||||
@@ -782,16 +753,15 @@ function MappingIssueResolutionPanel({ onUnauthorized, onEdit }: { onUnauthorize
|
||||
{ title: '状态', dataIndex: 'status', key: 'status', width: 120, render: value => <Tag color={value === 'OPEN' ? 'orange' : value === 'REVALIDATED' ? 'green' : 'blue'}>{value==='OPEN'?'待处理':toText(value)}</Tag> },
|
||||
{ title: '操作', key: 'action', width: 120, fixed: 'right', render: (_, row) => <Button type="link" disabled={!onEdit} onClick={() => onEdit?.({ kind: 'projectGroup', row })}>编辑分类</Button> },
|
||||
];
|
||||
useMaintenanceRefresh(() => { void load(true); });
|
||||
return <div className="management-page">
|
||||
{error && <Alert showIcon type="error" message="映射问题操作失败" description={error} />}
|
||||
<section className="panel section-panel"><div className="resource-toolbar"><strong>项目组未分类汇总</strong><div className="completion-actions"><span>共 {total} 条</span><div className="completion-actions"><Button icon={<ReloadOutlined />} onClick={() => void load(true)}>刷新</Button></div></div></div>
|
||||
<section className="panel section-panel"><div className="resource-toolbar"><strong>项目组未分类汇总</strong><div className="completion-actions"><span>共 {total} 条</span><div className="completion-actions"><Button icon={<ReloadOutlined />} onClick={() => void inventory.refresh()}>刷新</Button></div></div></div>
|
||||
<div className="resource-toolbar mapping-issue-filters">
|
||||
<Select {...readableSelectPopup} showSearch allowClear aria-label="筛选客户代码" placeholder="客户代码" value={customerCode} options={filterOptions.customerCodes.map(value => ({ label: value, value }))} onChange={value => { setCustomerCode(value); setPage(1); }} />
|
||||
<Select {...readableSelectPopup} showSearch allowClear aria-label="筛选业务分组" placeholder="业务分组" value={businessGroup} options={filterOptions.businessGroups.map(value => ({ label: value, value }))} onChange={value => { setBusinessGroup(value); setPage(1); }} />
|
||||
<Select {...readableSelectPopup} showSearch allowClear aria-label="筛选产业部" placeholder="产业部" value={department} options={filterOptions.departments.map(value => ({ label: value, value }))} onChange={value => { setDepartment(value); setPage(1); }} />
|
||||
<Button onClick={() => { setCustomerCode(undefined); setBusinessGroup(undefined); setDepartment(undefined); setPage(1); }}>重置</Button>
|
||||
</div>{loading ? <div className="loading-panel"><Spin />正在读取未命中问题…</div> : items.length ? <div className="resource-table"><Table size="small" bordered columns={columns} dataSource={items} rowKey={row => String(row.id)} pagination={false} indexOffset={(page - 1) * TABLE_PAGE_SIZE} scroll={{ x: 1320 }} /></div> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="没有项目组未分类记录" />}{total > TABLE_PAGE_SIZE && <Pagination className="records-pagination" current={page} pageSize={TABLE_PAGE_SIZE} total={total} showTotal={count => `共 ${count} 条问题`} onChange={setPage} />}</section>
|
||||
</div>{loading ? <div className="loading-panel"><Spin />正在读取未命中问题…</div> : items.length ? <div className="resource-table"><Table size="small" bordered columns={columns} dataSource={items} rowKey={row => String(row.id)} pagination={false} indexOffset={(currentPage - 1) * TABLE_PAGE_SIZE} scroll={{ x: 1320 }} /></div> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="没有项目组未分类记录" />}{total > TABLE_PAGE_SIZE && <Pagination className="records-pagination" current={currentPage} pageSize={TABLE_PAGE_SIZE} total={total} showTotal={count => `共 ${count} 条问题`} onChange={setPage} />}</section>
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -1726,7 +1696,7 @@ function AnalysisTurn({ turn: sourceTurn, onResume, onRetry, onClarify, onUnauth
|
||||
{resumable ? <AiMarkdown content={answer} className="ai-answer" />
|
||||
: <AnalysisNarrative answer={answer} visuals={visuals} visualState={result.visualState} question={question} turnId={String(turn.id || '')} beforeExport={() => authorizeAnalysisSnapshot(turn)} turn={turn} />}
|
||||
</> : <p className={resumable ? 'analysis-chat-notice' : undefined}>{resumable ? '分析任务仍在运行,尚未返回完整回答。' : emptyStatus}</p>}
|
||||
{status === 'PARTIAL' && answer && <p className="analysis-chat-notice">{partialAnalysisNotice(result.stopReason || turn.stopReason || (isObjectRecord(turn.plan) ? turn.plan.stopReason : ''))}</p>}
|
||||
{status === 'PARTIAL' && answer && <p className="analysis-chat-notice">{partialAnalysisNotice(result.stopReason || turn.stopReason || (isObjectRecord(turn.plan) ? turn.plan.stopReason : ''), result)}</p>}
|
||||
<div className="analysis-message-actions">
|
||||
{(reportMarkdown.trim() || reportHtml?.trim()) && <NativeAnalysisReport turn={turn} reportMarkdown={reportMarkdown} reportHtml={reportHtml} />}
|
||||
{!reportMarkdown.trim() && !reportHtml?.trim() && answer && ['COMPLETED', 'PARTIAL'].includes(status) && <AnalysisReportExport turn={turn} />}
|
||||
|
||||
Reference in New Issue
Block a user