feat: add operational timeline workspace
This commit is contained in:
@@ -13,6 +13,10 @@ const PRESSURE_DIAGNOSIS: FixtureFactory = (id, generatedAt) => ({
|
||||
scope: "北辰供水分区 · 最近 6 小时",
|
||||
confidence: "92.6%",
|
||||
generatedAt,
|
||||
analyticalTimeRange: {
|
||||
start: new Date(resolveFixtureTimestamp(generatedAt) - 6 * 60 * 60 * 1000).toISOString(),
|
||||
end: new Date(resolveFixtureTimestamp(generatedAt)).toISOString()
|
||||
},
|
||||
preferredView: "map_split",
|
||||
mapRelation: "required",
|
||||
blocks: [
|
||||
@@ -93,6 +97,10 @@ const SUPPLY_ZONE_ANALYSIS: FixtureFactory = (id, generatedAt) => ({
|
||||
scope: "六个服务分区 · 今日峰值预测",
|
||||
confidence: "88.4%",
|
||||
generatedAt,
|
||||
analyticalTimeRange: {
|
||||
start: new Date(new Date(resolveFixtureTimestamp(generatedAt)).setHours(0, 0, 0, 0)).toISOString(),
|
||||
end: new Date(new Date(resolveFixtureTimestamp(generatedAt)).setHours(23, 59, 59, 999)).toISOString()
|
||||
},
|
||||
preferredView: "focus",
|
||||
mapRelation: "none",
|
||||
blocks: [
|
||||
@@ -171,6 +179,10 @@ const DISPATCH_FLOW: FixtureFactory = (id, generatedAt) => ({
|
||||
scope: "北辰低压事件 · 30 分钟模拟",
|
||||
confidence: "90.8%",
|
||||
generatedAt,
|
||||
analyticalTimeRange: {
|
||||
start: new Date(resolveFixtureTimestamp(generatedAt) - 30 * 60 * 1000).toISOString(),
|
||||
end: new Date(resolveFixtureTimestamp(generatedAt)).toISOString()
|
||||
},
|
||||
preferredView: "map_split",
|
||||
mapRelation: "required",
|
||||
blocks: [
|
||||
@@ -251,3 +263,10 @@ export function createAnalysisArtifactFixture(index: number, instance: number):
|
||||
now.toLocaleTimeString("zh-CN", { hour12: false })
|
||||
);
|
||||
}
|
||||
|
||||
function resolveFixtureTimestamp(clock: string) {
|
||||
const [hours = 0, minutes = 0, seconds = 0] = clock.split(":").map(Number);
|
||||
const value = new Date();
|
||||
value.setHours(hours, minutes, seconds, 0);
|
||||
return value.getTime();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user