جزییات

This commit is contained in:
mahmoodsht 2025-10-06 10:49:00 +03:30
parent d451cc438a
commit efb1990a55
2 changed files with 12 additions and 9 deletions

View File

@ -24,7 +24,7 @@ import { TruncatedText } from "../ui/truncatedText";
interface StrategicAlignmentData {
strategic_theme: string;
operational_fee_sum: number;
operational_fee_count: number;
percentage?: number;
}
@ -138,7 +138,7 @@ export function StrategicAlignmentPopup({
ProcessName: "project",
OutputFields: [
"strategic_theme",
"sum(operational_fee) as operational_fee_sum",
"count(operational_fee)",
],
GroupBy: ["strategic_theme"],
});
@ -168,7 +168,7 @@ export function StrategicAlignmentPopup({
ProcessName: "project",
OutputFields: [
"value_technology_and_innovation",
"sum(operational_fee)",
"count(operational_fee)",
],
Conditions: [["strategic_theme", "=", item]],
GroupBy: ["value_technology_and_innovation"],
@ -233,13 +233,13 @@ export function StrategicAlignmentPopup({
.map((item: any) => ({
strategic_theme:
item.strategic_theme || item.value_technology_and_innovation || "N/A",
operational_fee_sum: Math.max(0, Number(item.operational_fee_sum)),
operational_fee_count: Math.max(0, Number(item.operational_fee_count)),
}))
.filter((item: StrategicAlignmentData) => item.strategic_theme !== "");
const total = processedData.reduce(
(acc: number, item: StrategicAlignmentData) =>
acc + item.operational_fee_sum,
acc + item.operational_fee_count,
0
);
@ -247,7 +247,7 @@ export function StrategicAlignmentPopup({
(item: StrategicAlignmentData) => ({
...item,
percentage:
total > 0 ? Math.round((item.operational_fee_sum / total) * 100) : 0,
total > 0 ? Math.round((item.operational_fee_count / total) * 100) : 0,
})
);
setData(dataWithPercentage || []);

View File

@ -305,7 +305,7 @@ export function NetworkGraph({ onNodeClick, onLoadingChange }: NetworkGraphProps
.enter()
.append("g")
.attr("class", "node")
.style("cursor", "pointer");
.style("cursor", d => d.stageid === -1 ? "default" : "pointer");
const drag = d3
.drag<SVGGElement, Node>()
@ -437,9 +437,12 @@ export function NetworkGraph({ onNodeClick, onLoadingChange }: NetworkGraphProps
.attr("stroke-width", 3);
});
nodeGroup.on("click", async function (event, d) {
event.stopPropagation();
if (d.isCenter) return;
// جلوگیری از کلیک روی مرکز و دسته‌بندی‌ها
if (d.isCenter || d.stageid === -1) return;
if (onNodeClick && d.stageid) {
// Open dialog immediately with basic info