feat(版本): 优化概览与只读状态
关键改动: - 增加需求排序和版本只读状态规则及测试 - 完善版本概览阶段耗时、项目页和工作台展示 - 优化小宝预警请求节流、建议状态和风险过滤 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
@@ -91,7 +91,7 @@ export const useRequirementStore = create<RequirementState>((set, get) => {
|
||||
status: data.status ?? 'pending_review',
|
||||
id: `req-${Date.now()}`,
|
||||
code,
|
||||
createdAt: new Date().toISOString().slice(0, 10),
|
||||
createdAt: new Date().toISOString(),
|
||||
};
|
||||
const updated = [...requirements, newReq];
|
||||
set({ requirements: updated });
|
||||
|
||||
@@ -14,6 +14,7 @@ interface XiaobaoRiskState {
|
||||
snapshots: XiaobaoRiskSnapshot[];
|
||||
insights: XiaobaoRiskInsightCacheItem[];
|
||||
pendingInsightKeys: string[];
|
||||
insightRequestAttempts: Record<string, string>;
|
||||
riskDataLoaded: boolean;
|
||||
error?: string;
|
||||
fetchRiskData: () => Promise<void>;
|
||||
@@ -46,6 +47,7 @@ export const useXiaobaoRiskStore = create<XiaobaoRiskState>((set, get) => ({
|
||||
snapshots: [],
|
||||
insights: [],
|
||||
pendingInsightKeys: [],
|
||||
insightRequestAttempts: {},
|
||||
riskDataLoaded: false,
|
||||
error: undefined,
|
||||
|
||||
@@ -99,7 +101,13 @@ export const useXiaobaoRiskStore = create<XiaobaoRiskState>((set, get) => ({
|
||||
beginInsightUpdate: (key) => {
|
||||
if (!key) return;
|
||||
if (get().pendingInsightKeys.includes(key)) return;
|
||||
set({ pendingInsightKeys: [...get().pendingInsightKeys, key] });
|
||||
set({
|
||||
pendingInsightKeys: [...get().pendingInsightKeys, key],
|
||||
insightRequestAttempts: {
|
||||
...get().insightRequestAttempts,
|
||||
[key]: new Date().toISOString(),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
finishInsightUpdate: (key) => {
|
||||
|
||||
Reference in New Issue
Block a user