This commit is contained in:
qumeng039@126.com 2025-08-11 09:20:57 +08:00
parent f55627e0c0
commit 690a7fc670

View File

@ -204,75 +204,7 @@ const clusterAnalyze = () => {
console.log(storeId)
}
function handleAnomalousGroup() {
console.log(storeId)
// store T0
const now = (props.store.currentUtc);
const TA = "2024-06-19T08:57:55Z"; // A
const TB = "2024-06-19T10:58:03Z"; // B
const TC = "2024-06-19T12:58:04Z"; // C
// colorMap
const GROUP_COLOR = { 0: "12,112,144", 1: "180,150,20", 6: "50,141,120" };
const GROUP_ALPHA = 0.30;
const RED = "220,50,60";
// //绿
/* const buckets = new Map();
graphVis.nodes.forEach(n => {
const t = parseInt(n.type); // "0"|"1"|"6" 0/1/6
if (!buckets.has(t)) buckets.set(t, []);
buckets.get(t).push(n);
});
buckets.forEach((nodes, t) => {
const color = GROUP_COLOR[t] || "120,120,120";
const g = graphVis.addNodesInGroup(nodes, { shape: "circle", color, alpha: GROUP_ALPHA });
g.smoothPath = false;
}); */
// +
const shouldA = now >= TA;
const shouldB = now >= TB;
const shouldC = now >= TC;
if(shouldA) {
console.log("A异常")
graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupA.includes(n.id)) {
n.fillColor = RED;
}
return n;
})
}
if(shouldB) {
console.log("B异常")
graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupB.includes(n.id)) {
n.fillColor = RED;
}
return n;
})
}
if(shouldC) {
console.log("C异常")
graphVis.nodes = graphVis.nodes.map(n => {
if(props.store.graphAbnormalData.groupC.includes(n.id)) {
n.fillColor = RED;
}
return n;
})
}
graphVis.autoGroupLayout(graphVis.nodes);
graphVis.zoomFit(); // refresh
}
function handleAnomalousGroup() {}
new Map([
["groupDiscovery", () => handleGroupDiscoveryDiff()],
@ -284,16 +216,16 @@ const clusterAnalyze = () => {
}
//
if (storeId === 'anomalousGroup') {
if (storeId === "anomalousGroup") {
watch(
() => props.store.currentUtc,
() => {
// graph graph addGraph clusterAnalyze runForceLayout
if (graphVis) {
updateChart(toRaw(graph.value));
updateChart(toRaw(graph.value))
}
}
);
)
}
// GraphVis/