diff --git a/app/components/dashboard/dashboard-home.tsx b/app/components/dashboard/dashboard-home.tsx
index c1c4d83..35feda2 100644
--- a/app/components/dashboard/dashboard-home.tsx
+++ b/app/components/dashboard/dashboard-home.tsx
@@ -130,18 +130,18 @@ export function DashboardHome() {
let incCapacityTotal = 0;
const chartRows = rows.map((r) => {
const rel = r?.related_company ?? "-";
- const preFee = Number(r?.pre_innovation_fee_sum ?? 0) > 0 ? r?.pre_innovation_fee_sum : 0;
- const costRed = Number(r?.innovation_cost_reduction_sum ?? 0) > 0 ? r?.innovation_cost_reduction_sum : 0;
- const preCap = Number(r?.pre_project_production_capacity_sum ?? 0) > 0 ? r?.pre_project_production_capacity_sum : 0;
- const incCap = Number(r?.increased_capacity_after_innovation_sum ?? 0) > 0 ? r?.increased_capacity_after_innovation_sum : 0;
- const preInc = Number(r?.pre_project_income_sum ?? 0) > 0 ? r?.pre_project_income_sum : 0;
- const incInc = Number(r?.increased_income_after_innovation_sum ?? 0) > 0 ? r?.increased_income_after_innovation_sum : 0;
+ const preFee = Number(r?.pre_innovation_fee_sum ?? 0) >= 0 ? r?.pre_innovation_fee_sum : 0;
+ const costRed = Number(r?.innovation_cost_reduction_sum ?? 0) >= 0 ? r?.innovation_cost_reduction_sum : 0;
+ const preCap = Number(r?.pre_project_production_capacity_sum ?? 0) >= 0 ? r?.pre_project_production_capacity_sum : 0;
+ const incCap = Number(r?.increased_capacity_after_innovation_sum ?? 0) >= 0 ? r?.increased_capacity_after_innovation_sum : 0;
+ const preInc = Number(r?.pre_project_income_sum ?? 0) >= 0 ? r?.pre_project_income_sum : 0;
+ const incInc = Number(r?.increased_income_after_innovation_sum ?? 0) >= 0 ? r?.increased_income_after_innovation_sum : 0;
incCapacityTotal += incCap;
- const capacityPct = preCap > 0 ? (incCap / preCap) * 100 : 0;
- const revenuePct = preInc > 0 ? (incInc / preInc) * 100 : 0;
- const costPct = preFee > 0 ? (costRed / preFee) * 100 : 0;
+ const capacityPct = preCap >= 0 ? (incCap / preCap) * 100 : 0;
+ const revenuePct = preInc >= 0 ? (incInc / preInc) * 100 : 0;
+ const costPct = preFee >= 0 ? (costRed / preFee) * 100 : 0;
return {
category: rel,
capacity: isFinite(capacityPct) ? capacityPct : 0,
@@ -178,7 +178,7 @@ export function DashboardHome() {
dashboardData.topData.ongoing_innovation_technology_ideas || "0",
);
const percentage =
- registered > 0 ? Math.round((ongoing / registered) * 100) : 0;
+ registered > 0 ? (ongoing / registered) * 100 : 0;
return [
{ browser: "safari", visitors: percentage, fill: "var(--color-safari)" },
@@ -461,7 +461,7 @@ export function DashboardHome() {
@@ -469,7 +469,7 @@ export function DashboardHome() {
@@ -646,17 +646,10 @@ export function DashboardHome() {
شدت فناوری
-
- %
- {formatNumber(
- Math.round(
- dashboardData.leftData?.technology_intensity || 0,
- ),
- )}
-
+
diff --git a/app/components/dashboard/project-management/process-innovation-page.tsx b/app/components/dashboard/project-management/process-innovation-page.tsx
index 048682d..6572ab2 100644
--- a/app/components/dashboard/project-management/process-innovation-page.tsx
+++ b/app/components/dashboard/project-management/process-innovation-page.tsx
@@ -260,7 +260,6 @@ export function ProcessInnovationPage() {
Pagination: { PageNumber: pageToFetch, PageSize: pageSize },
});
- console.log(JSON.parse(response.data));
if (response.state === 0) {
const dataString = response.data;
if (dataString && typeof dataString === "string") {
@@ -656,6 +655,12 @@ export function ProcessInnovationPage() {
{/* Process Impacts Chart */}
+ {/* نمودار با الگوریتم Nice Numbers:
+ مثلاً اگر دادهها [10, 35, 63, 18] باشند:
+ - حداکثر: 63، با حاشیه 5% = 66.15
+ - Nice Max: 75 (گرد و خوانا)
+ - Ticks: [0, 20, 40, 60, 75]
+ این باعث میشود نمودار زیباتر و خواناتر باشد */}
x == valueTimeLine)
+ const per = () => {
+ const main = stages?.findIndex((x) => x == "ثبت ایده")
+ console.log( 'yay ' , 25 * main + 12.5);
+ return 25 * main + 12.5
+ }
return (
{/* Year labels */}
@@ -151,7 +157,6 @@ export default function Timeline() {
۱۴۰۵
۱۴۰۴
-
{/* Timeline bar */}
{stages.map((stage, index) => (
@@ -171,15 +176,17 @@ export default function Timeline() {
))}
{/* Vertical line showing current position */}
-
+ > ) }
+
+
);
}
@@ -343,6 +350,7 @@ export function ProductInnovationPage() {
"project_no",
"title",
"project_status",
+ "current_status",
"project_rating",
"project_description",
"developed_technology_type",
@@ -350,7 +358,7 @@ export function ProductInnovationPage() {
"knowledge_based_certificate_obtained",
"knowledge_based_certificate_number",
"certificate_obtain_date",
- "issuing_authority",
+ "issuing_authority"
],
Sorts: [["start_date", "asc"]],
Conditions: [["type_of_innovation", "=", "نوآوری در محصول"]],
@@ -458,8 +466,8 @@ export function ProductInnovationPage() {
...prev,
revenueNewProducts: {
...prev.revenueNewProducts,
- value: formatNumber(normalized.new_products_revenue_share),
- percent: formatNumber(normalized.new_products_revenue_share_percent),
+ value: formatNumber(normalized?.new_products_revenue_share),
+ percent: formatNumber(normalized?.new_products_revenue_share_percent),
},
impactOnImports: {
...prev.impactOnImports,
@@ -708,8 +716,8 @@ export function ProductInnovationPage() {
@@ -936,7 +944,7 @@ export function ProductInnovationPage() {
{selectedProjectDetails?.title}
{selectedProjectDetails?.project_description}
-
+
{/* Technical Knowledge */}
diff --git a/app/components/dashboard/project-management/project-management-page.tsx b/app/components/dashboard/project-management/project-management-page.tsx
index dca4735..8e76f6a 100644
--- a/app/components/dashboard/project-management/project-management-page.tsx
+++ b/app/components/dashboard/project-management/project-management-page.tsx
@@ -289,7 +289,7 @@ export function ProjectManagementPage() {
const { scrollTop, scrollHeight, clientHeight } = scrollContainer;
const scrollPercentage = (scrollTop + clientHeight) / scrollHeight;
// Trigger load more when scrolled to 90% of the container
- if (scrollPercentage == 1) {
+ if (scrollPercentage == 1 || scrollPercentage == .9) {
loadMore();
}
};
diff --git a/app/components/dashboard/strategic-alignment-popup.tsx b/app/components/dashboard/strategic-alignment-popup.tsx
index 046538d..8769448 100644
--- a/app/components/dashboard/strategic-alignment-popup.tsx
+++ b/app/components/dashboard/strategic-alignment-popup.tsx
@@ -41,11 +41,11 @@ const chartConfig = {
},
};
- const maxHeight = 150;
+ const maxHeight = 150;
const barHeights = () => Math.floor(Math.random() * maxHeight);
const ChartSkeleton = () => (
-
+
{/* Chart bars */}
@@ -131,7 +131,7 @@ export function StrategicAlignmentPopup({
return (